Skip to content

Commit 2ba5185

Browse files
committed
Migrate mscorlib to v2
- Update and migrate pipeline files. - Update references. - Bump versions. - Remove unused assembly native version. - Update license header. - General improvements in IntelliSense comments. - Minor improvements in code style.
1 parent c84ede9 commit 2ba5185

18 files changed

+449
-490
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright (c) .NET Foundation and Contributors
2+
# See LICENSE file in the project root for full license information.
3+
4+
# This workflow will periodically check .NET nanoFramework dependencies and updates them in the repository it's running.
5+
6+
name: Daily update dependencies (develop)
7+
8+
on:
9+
schedule:
10+
# At 01:20 UTC every Wed,Fri.
11+
- cron: '20 01 * * Wed,Fri'
12+
repository_dispatch:
13+
types: update-dependencies
14+
15+
jobs:
16+
update-dependencies:
17+
name: nanoFramework
18+
uses: nanoframework/nf-tools/.github/workflows/update-dependencies.yml@main
19+
secrets: inherit
20+
with:
21+
solutionsToCheck: 'nanoFramework.System.Threading.sln'
22+
previewPackages: true
23+
branchToPr: 'develop'
24+

.runsettings

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
<TargetPlatform>x64</TargetPlatform>
1010
</RunConfiguration>
1111
<nanoFrameworkAdapter>
12-
<Logging>None</Logging>
12+
<Logging>Verbose</Logging>
1313
<IsRealHardware>False</IsRealHardware>
14+
<UsePreviewClr>True</UsePreviewClr>
1415
</nanoFrameworkAdapter>
15-
</RunSettings>
16+
</RunSettings>

Tests/System.Threading.CancellationToken/CancellationTokenTests.cs

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
// The .NET Foundation licenses this file to you under the MIT license.
33

44
using nanoFramework.TestFramework;
5-
using System;
6-
using System.Diagnostics;
7-
using System.Threading;
85

96
namespace System.Threading
107
{
@@ -28,7 +25,7 @@ public void SimmpleTokenCancellationTest()
2825
}).Start();
2926
TestCancealltionToken(token);
3027
// Assert
31-
Assert.True(isCancelledFunction);
28+
Assert.IsTrue(isCancelledFunction);
3229
}
3330

3431
private void TestCancealltionToken(CancellationToken csToken)
@@ -69,7 +66,7 @@ public void SimmpleTokenCancellationThreadsTest()
6966
// Assert
7067
// Clean in case
7168
toCancelThread?.Abort();
72-
Assert.True(isCancelledFunction);
69+
Assert.IsTrue(isCancelledFunction);
7370

7471
}
7572

@@ -83,7 +80,7 @@ public void CallbackRegistrationTests()
8380
CancellationTokenRegistration ctr = token.Register(ActionToNotify);
8481
// Act
8582
cs.Cancel();
86-
Assert.True(isCancelledAction);
83+
Assert.IsTrue(isCancelledAction);
8784
}
8885

8986

@@ -110,27 +107,27 @@ public void CallbackRegistrationAndThreadsTests()
110107
// Clean in case
111108
toCancelThread?.Abort();
112109

113-
Assert.True(isCancelledFunction);
110+
Assert.IsTrue(isCancelledFunction);
114111
}
115112

116113
[TestMethod]
117114
public void TimerCancellationTest()
118115
{
119116
CancellationTokenSource cs = new(200);
120117
CancellationToken token = cs.Token;
121-
Assert.False(token.IsCancellationRequested);
118+
Assert.IsFalse(token.IsCancellationRequested);
122119
Thread.Sleep(210);
123-
Assert.True(token.IsCancellationRequested);
120+
Assert.IsTrue(token.IsCancellationRequested);
124121
}
125122

126123
[TestMethod]
127124
public void TimerCancellationTokenTest()
128125
{
129126
CancellationTokenSource cs = new();
130127
cs.CancelAfter(200);
131-
Assert.False(cs.IsCancellationRequested);
128+
Assert.IsFalse(cs.IsCancellationRequested);
132129
Thread.Sleep(210);
133-
Assert.True(cs.IsCancellationRequested);
130+
Assert.IsTrue(cs.IsCancellationRequested);
134131
}
135132
}
136133
}

Tests/System.Threading.CancellationToken/System.Threading.CancellationToken.nfproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,30 +30,30 @@
3030
<Compile Include="Properties\AssemblyInfo.cs" />
3131
</ItemGroup>
3232
<ItemGroup>
33-
<Reference Include="mscorlib, Version=1.17.11.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
34-
<HintPath>..\..\packages\nanoFramework.CoreLibrary.1.17.11\lib\mscorlib.dll</HintPath>
33+
<Reference Include="mscorlib">
34+
<HintPath>..\..\packages\nanoFramework.CoreLibrary.2.0.0-preview.29\lib\netnano1.0\mscorlib.dll</HintPath>
3535
</Reference>
36-
<Reference Include="nanoFramework.TestFramework, Version=3.0.77.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
37-
<HintPath>..\..\packages\nanoFramework.TestFramework.3.0.77\lib\nanoFramework.TestFramework.dll</HintPath>
36+
<Reference Include="nanoFramework.TestFramework">
37+
<HintPath>..\..\packages\nanoFramework.TestFramework.4.0.0-preview.45\lib\nanoFramework.TestFramework.dll</HintPath>
3838
</Reference>
39-
<Reference Include="nanoFramework.UnitTestLauncher, Version=0.0.0.0, Culture=neutral, PublicKeyToken=c07d481e9758c731">
40-
<HintPath>..\..\packages\nanoFramework.TestFramework.3.0.77\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
39+
<Reference Include="nanoFramework.UnitTestLauncher">
40+
<HintPath>..\..\packages\nanoFramework.TestFramework.4.0.0-preview.45\lib\nanoFramework.UnitTestLauncher.exe</HintPath>
4141
</Reference>
4242
</ItemGroup>
43-
<ItemGroup>
44-
<None Include="packages.config" />
45-
</ItemGroup>
4643
<ItemGroup>
4744
<Content Include="packages.lock.json" />
4845
</ItemGroup>
4946
<ItemGroup>
5047
<ProjectReference Include="..\..\nanoFramework.System.Threading\nanoFramework.System.Threading.nfproj" />
5148
</ItemGroup>
49+
<ItemGroup>
50+
<None Include="packages.config" />
51+
</ItemGroup>
5252
<Import Project="$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets" Condition="Exists('$(NanoFrameworkProjectSystemPath)NFProjectSystem.CSharp.targets')" />
5353
<!-- MANUAL UPDATE HERE -->
5454
<ProjectExtensions>
5555
<ProjectCapabilities>
5656
<ProjectConfigurationsDeclaredAsItems />
5757
</ProjectCapabilities>
5858
</ProjectExtensions>
59-
</Project>
59+
</Project>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<packages>
3-
<package id="nanoFramework.CoreLibrary" version="1.17.11" targetFramework="netnano1.0" />
4-
<package id="nanoFramework.TestFramework" version="3.0.77" targetFramework="netnano1.0" developmentDependency="true" />
3+
<package id="nanoFramework.CoreLibrary" version="2.0.0-preview.29" targetFramework="netnano1.0" />
4+
<package id="nanoFramework.TestFramework" version="4.0.0-preview.45" targetFramework="netnano1.0" developmentDependency="true" />
55
</packages>

Tests/System.Threading.CancellationToken/packages.lock.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
".NETnanoFramework,Version=v1.0": {
55
"nanoFramework.CoreLibrary": {
66
"type": "Direct",
7-
"requested": "[1.17.11, 1.17.11]",
8-
"resolved": "1.17.11",
9-
"contentHash": "HezzAc0o2XrSGf85xSeD/6xsO6ohF9hX6/iMQ1IZS6Zw6umr4WfAN2Jv0BrPxkaYwzEegJxxZujkHoUIAqtOMw=="
7+
"requested": "[2.0.0-preview.29, 2.0.0-preview.29]",
8+
"resolved": "2.0.0-preview.29",
9+
"contentHash": "7NDp9Sda9FTFBDN//X34r23rJBHUkCvyGvrFh9s5B8H2nMoet4J0OlEOiZRUsEPBXlsNpZFVp+Cd6OSjnLSg5A=="
1010
},
1111
"nanoFramework.TestFramework": {
1212
"type": "Direct",
13-
"requested": "[3.0.77, 3.0.77]",
14-
"resolved": "3.0.77",
15-
"contentHash": "Py5W1oN84KMBmOOHCzdz6pyi3bZTnQu9BoqIx0KGqkhG3V8kGoem/t+BuCM0pMIWAyl2iMP1n2S9624YXmBJZw=="
13+
"requested": "[4.0.0-preview.45, 4.0.0-preview.45]",
14+
"resolved": "4.0.0-preview.45",
15+
"contentHash": "QnRl5gAJW4uoH4k4oQMT+gVnI57lGnST8F/PuK31M+j0AekWFvcSHKDirWrY9rs/JJTLPwgllaKiQGioTfBwPg=="
1616
}
1717
}
1818
}

azure-pipelines.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ steps:
5353
parameters:
5454
sonarCloudProject: 'nanoframework_lib-nanoframework.System.Threading'
5555
runUnitTests: true
56+
usePreviewBuild: true
5657

5758
# step from template @ nf-tools repo
5859
# report error

nanoFramework.System.Threading.nuspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
<description>This package includes the nanoFramework.System.Threading assembly for .NET nanoFramework C# projects.</description>
1919
<tags>nanoFramework C# csharp netmf netnf </tags>
2020
<dependencies>
21-
<dependency id="nanoFramework.CoreLibrary" version="1.17.11" />
21+
<dependency id="nanoFramework.CoreLibrary" version="2.0.0-preview.29" />
2222
</dependencies>
2323
</metadata>
2424
<files>
@@ -32,4 +32,4 @@
3232
<file src="assets\nf-logo.png" target="images" />
3333
<file src="LICENSE.md" target="" />
3434
</files>
35-
</package>
35+
</package>

nanoFramework.System.Threading.sln

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ Project("{11A8DD76-328B-46DF-9F39-F559912D0360}") = "nanoFramework.System.Thread
66
EndProject
77
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{9AB89B3C-AA80-4A76-A3C3-A84DCD0323FA}"
88
ProjectSection(SolutionItems) = preProject
9-
nanoFramework.System.Threading.DELIVERABLES.nuspec = nanoFramework.System.Threading.DELIVERABLES.nuspec
9+
.runsettings = .runsettings
1010
nanoFramework.System.Threading.nuspec = nanoFramework.System.Threading.nuspec
1111
NuGet.Config = NuGet.Config
12+
README.md = README.md
1213
version.json = version.json
1314
EndProjectSection
1415
EndProject

nanoFramework.System.Threading/Properties/AssemblyInfo.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@
99
[assembly: AssemblyProduct("nanoFramework.System.Threading")]
1010
[assembly: AssemblyCopyright("Copyright (c) .NET Foundation and Contributors")]
1111

12-
////////////////////////////////////////////////////////////////
13-
// update this whenever the native assembly signature changes //
14-
[assembly: AssemblyNativeVersion("0.0.0.0")]
15-
////////////////////////////////////////////////////////////////
16-
1712
// Setting ComVisible to false makes the types in this assembly not visible
1813
// to COM components. If you need to access a type in this assembly from
1914
// COM, set the ComVisible attribute to true on that type.

0 commit comments

Comments
 (0)