@@ -6,11 +6,16 @@ variables:
6
6
NugetPackageVersion : ' $(CurrentSemanticVersion)'
7
7
# MONO_VERSION: 6_4_0
8
8
# XCODE_VERSION: 11.4
9
- NETCORE_VERSION : ' 3.1.x'
10
- NETCORE_TEST_VERSION : ' 3.1.x'
9
+ NETCORE_VERSION : ' 5.0.x'
10
+ NETCORE_TEST_VERSION_3_1 : ' 3.1.x'
11
+ NETCORE_TEST_VERSION_2_1 : ' 2.1.x'
11
12
RunPoliCheck : ' false'
12
- PathToCsproj : ' src/CommunityToolkit/Xamarin.CommunityToolkit/Xamarin.CommunityToolkit.csproj'
13
13
PathToMarkupCsproj : ' src/Markup/Xamarin.CommunityToolkit.Markup/Xamarin.CommunityToolkit.Markup.csproj'
14
+ PathToCommunityToolkitCsproj : ' src/CommunityToolkit/Xamarin.CommunityToolkit/Xamarin.CommunityToolkit.csproj'
15
+ PathToSamplesSln : ' samples/XCT.Sample.sln'
16
+ PathToCommunityToolkitUnitTestCsproj : ' src/CommunityToolkit/Xamarin.CommunityToolkit.UnitTests/Xamarin.CommunityToolkit.UnitTests.csproj'
17
+ PathToMarkupUnitTestCsproj : ' src/Markup/Xamarin.CommunityToolkit.Markup.UnitTests/Xamarin.CommunityToolkit.Markup.UnitTests.csproj'
18
+ PathToMsBuildOnMacOS : ' mono /Applications/Visual\ studio.app/Contents/Resources/lib/monodevelop/bin/MSBuild/Current/bin/MSBuild.dll'
14
19
PathToSln : ' samples/XCT.Sample.sln'
15
20
16
21
resources :
68
73
pool :
69
74
vmImage : windows-2019
70
75
steps :
76
+ - task : UseDotNet@2
77
+ displayName : ' Install .NET SDK'
78
+ inputs :
79
+ version : $(NETCORE_VERSION)
80
+ includePreviewVersions : false
81
+ - task : UseDotNet@2
82
+ displayName : ' Install .NET 3.1 Test SDK'
83
+ inputs :
84
+ version : $(NETCORE_TEST_VERSION_3_1)
85
+ includePreviewVersions : false
86
+ - task : UseDotNet@2
87
+ displayName : ' Install .NET 2.1 Test SDK'
88
+ inputs :
89
+ version : $(NETCORE_TEST_VERSION_2_1)
90
+ includePreviewVersions : false
71
91
# if this is a tagged build, then update the version number
72
92
- powershell : |
73
93
$buildSourceBranch = "$(Build.SourceBranch)"
@@ -78,19 +98,19 @@ jobs:
78
98
condition: startsWith(variables['Build.SourceBranch'], 'refs/tags/')
79
99
# restore, build and pack the packages
80
100
- task : MSBuild@1
81
- displayName : Build Solution
101
+ displayName : Build Xamarin.CommunityToolkit.csproj
82
102
inputs :
83
- solution : $(PathToCsproj )
103
+ solution : $(PathToCommunityToolkitCsproj )
84
104
configuration : Release
85
105
msbuildArguments : ' /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
86
106
- task : CopyFiles@2
87
107
inputs :
88
108
Contents : ' SignList.xml'
89
109
TargetFolder : ' $(Build.ArtifactStagingDirectory)/nuget'
90
110
- task : MSBuild@1
91
- displayName : Pack NuGets
111
+ displayName : Pack Community Toolkit NuGets
92
112
inputs :
93
- solution : $(PathToCsproj )
113
+ solution : $(PathToCommunityToolkitCsproj )
94
114
configuration : Release
95
115
msbuildArguments : ' /t:Pack /p:PackageVersion=$(NugetPackageVersion) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
96
116
- task : MSBuild@1
@@ -112,12 +132,14 @@ jobs:
112
132
# command: 'custom'
113
133
# custom: 'nuget'
114
134
# arguments: 'push --source https://nuget.pkg.github.com/xamarin/index.json --api-key $(GitHub.NuGet.Token) "$(Build.ArtifactStagingDirectory)\nuget\*.nupkg"'
115
- - task : DotNetCoreCLI@2
116
- displayName : Run Tests
135
+ - task : CmdLine@2
136
+ displayName : ' Run Markup Unit Tests'
137
+ inputs :
138
+ script : dotnet test $(PathToMarkupUnitTestCsproj) -c Release --collect "Code coverage" -p:BuildInParallel=false
139
+ - task : CmdLine@2
140
+ displayName : ' Run Community Toolkit Unit Tests'
117
141
inputs :
118
- command : test
119
- projects : ' **/*.UnitTests.csproj'
120
- arguments : ' --configuration Release --collect "Code coverage"'
142
+ script : dotnet test $(PathToCommunityToolkitUnitTestCsproj) -c Release --collect "Code coverage" -p:BuildInParallel=false
121
143
# publish the packages
122
144
- task : PublishBuildArtifacts@1
123
145
displayName : ' Publish Unsigned NuGets'
@@ -161,27 +183,44 @@ jobs:
161
183
# displayName: Switch to the latest Xcode
162
184
# restore, build and pack the packages
163
185
- task : UseDotNet@2
164
- displayName : ' Use .Net Core sdk '
186
+ displayName : ' Install .NET SDK '
165
187
inputs :
166
188
version : $(NETCORE_VERSION)
167
189
includePreviewVersions : false
168
190
- task : UseDotNet@2
169
- displayName : ' Use .Net Core sdk '
191
+ displayName : ' Install .NET 3.1 Test SDK '
170
192
inputs :
171
- version : $(NETCORE_TEST_VERSION )
193
+ version : $(NETCORE_TEST_VERSION_3_1 )
172
194
includePreviewVersions : false
173
- - task : MSBuild@1
174
- displayName : Build Solution
195
+ - task : UseDotNet@2
196
+ displayName : ' Install .NET 2.1 Test SDK '
175
197
inputs :
176
- solution : $(PathToCsproj)
177
- configuration : Release
178
- msbuildArguments : ' /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
179
- - task : MSBuild@1
180
- displayName : Pack NuGets
198
+ version : $(NETCORE_TEST_VERSION_2_1)
199
+ includePreviewVersions : false
200
+ - task : CmdLine@2
201
+ displayName : ' Build Markup'
181
202
inputs :
182
- solution : $(PathToCsproj)
183
- configuration : Release
184
- msbuildArguments : ' /t:Pack /p:PackageVersion=$(NugetPackageVersion) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
203
+ script : ' $(PathToMsBuildOnMacOS) $(PathToMarkupCsproj) /p:Configuration=Release /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
204
+ - task : CmdLine@2
205
+ displayName : ' Build Community Toolkit'
206
+ inputs :
207
+ script : ' $(PathToMsBuildOnMacOS) $(PathToCommunityToolkitCsproj) /p:Configuration=Release /restore /t:Build /p:ContinuousIntegrationBuild=true /p:Deterministic=false'
208
+ - task : CmdLine@2
209
+ displayName : ' Run Markup Unit Tests'
210
+ inputs :
211
+ script : ' dotnet test $(PathToMarkupUnitTestCsproj) /p:Configuration=Release -p:BuildInParallel=false'
212
+ - task : CmdLine@2
213
+ displayName : ' Run Community Toolkit Unit Tests'
214
+ inputs :
215
+ script : ' dotnet test $(PathToCommunityToolkitUnitTestCsproj) /p:Configuration=Release -p:BuildInParallel=false'
216
+ - task : CmdLine@2
217
+ displayName : ' Pack Markup NuGets'
218
+ inputs :
219
+ script : ' $(PathToMsBuildOnMacOS) $(PathToMarkupUnitTestCsproj) /p:Configuration=Release /t:Pack /p:PackageVersion=$(NugetPackageVersion) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
220
+ - task : CmdLine@2
221
+ displayName : ' Pack CommunityToolkit NuGets'
222
+ inputs :
223
+ script : ' $(PathToMsBuildOnMacOS) $(PathToCommunityToolkitCsproj) /p:Configuration=Release /t:Pack /p:PackageVersion=$(NugetPackageVersion) /p:PackageOutputPath="$(Build.ArtifactStagingDirectory)/nuget"'
185
224
186
225
- ${{ if eq(variables['System.TeamProject'], 'devdiv') }} :
187
226
- template : sign-artifacts/jobs/v2.yml@internal-templates
0 commit comments