Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 62e2da3

Browse files
authored
Merge pull request UiPath#31 from UiPath/fix/git-version
Use VSTS counters for revision
2 parents 2f0204a + 8e07877 commit 62e2da3

File tree

8 files changed

+79
-112
lines changed

8 files changed

+79
-112
lines changed

.vsts-ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ variables:
1010
Solution: "UiPath.Orchestrator.Powershell.sln"
1111
BuildConfiguration: "Release"
1212
BuildPlatform: "Any CPU"
13+
# TODO: reset counter on each GlobalAssemblyProperties version bump
14+
# https://docs.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=vsts&tabs=yaml%2Cbatch#counters
15+
patch: $[counter('patch_counter_18_4_1', 64216)]
1316

1417
steps:
1518
- task: NuGetToolInstaller@0
@@ -26,12 +29,12 @@ steps:
2629
displayName: NuGet restore
2730
inputs:
2831
restoreSolution: "$(Solution)"
29-
32+
3033
- task: VSBuild@1
3134
displayName: Build solution
3235
inputs:
3336
solution: '$(Solution)'
34-
msbuildArgs: '/p:Revision=$(Build.BuildId)'
37+
msbuildArgs: '/p:Revision=$(patch)'
3538
platform: '$(BuildPlatform)'
3639
configuration: '$(BuildConfiguration)'
3740

Properties/GlobalAssemblyInfo.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@
1010

1111

1212
// The version should be set to match the current released platform version
13+
// IMPORTANT: see .vsts-ci.yml $patch variable
14+
// Remeber to reset the counter on each version bump
15+
// Eg. if you change version here to 18.4.2.*, in .vsts-ci.yml the line should be patch: $[counter('patch_counter_18_4_2', 1)]
1316
//
1417
[assembly: AssemblyVersion("18.4.1.*")]

UiPath.PowerShell.Tests/UiPath.PowerShell.Tests.csproj

Lines changed: 28 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" />
43
<PropertyGroup>
54
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
65
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@@ -38,32 +37,10 @@
3837
<WarningLevel>4</WarningLevel>
3938
</PropertyGroup>
4039
<ItemGroup>
41-
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
42-
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.10\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
43-
</Reference>
44-
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
45-
<HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll</HintPath>
46-
</Reference>
47-
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
48-
<HintPath>..\packages\MSTest.TestFramework.1.2.0\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll</HintPath>
49-
</Reference>
50-
<Reference Include="Microsoft.Web.XmlTransform, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
51-
<HintPath>..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
52-
</Reference>
53-
<Reference Include="Newtonsoft.Json, Version=11.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
54-
<HintPath>..\packages\Newtonsoft.Json.11.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
55-
</Reference>
56-
<Reference Include="NuGet.Core, Version=2.14.0.832, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
57-
<HintPath>..\packages\NuGet.Core.2.14.0\lib\net40-Client\NuGet.Core.dll</HintPath>
58-
</Reference>
5940
<Reference Include="System" />
6041
<Reference Include="System.Core" />
6142
<Reference Include="System.IO.Compression" />
6243
<Reference Include="System.IO.Compression.FileSystem" />
63-
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
64-
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
65-
<Private>True</Private>
66-
</Reference>
6744
<Reference Include="System.Net" />
6845
<Reference Include="System.Net.Http" />
6946
<Reference Include="System.Web" />
@@ -96,7 +73,6 @@
9673
</ItemGroup>
9774
<ItemGroup>
9875
<None Include="app.config" />
99-
<None Include="packages.config" />
10076
</ItemGroup>
10177
<ItemGroup>
10278
<ProjectReference Include="..\UiPath.PowerShell\UiPath.PowerShell.csproj">
@@ -108,18 +84,36 @@
10884
<Name>UiPath.Web.Client</Name>
10985
</ProjectReference>
11086
</ItemGroup>
87+
<ItemGroup>
88+
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies">
89+
<Version>1.1.0</Version>
90+
</PackageReference>
91+
<PackageReference Include="Microsoft.Rest.ClientRuntime">
92+
<Version>2.3.18</Version>
93+
</PackageReference>
94+
<PackageReference Include="Microsoft.Web.Xdt">
95+
<Version>3.0.0</Version>
96+
</PackageReference>
97+
<PackageReference Include="MSBuildTasks">
98+
<Version>1.5.0.235</Version>
99+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
100+
<PrivateAssets>all</PrivateAssets>
101+
</PackageReference>
102+
<PackageReference Include="MSTest.TestAdapter">
103+
<Version>1.4.0</Version>
104+
</PackageReference>
105+
<PackageReference Include="MSTest.TestFramework">
106+
<Version>1.4.0</Version>
107+
</PackageReference>
108+
<PackageReference Include="Newtonsoft.Json">
109+
<Version>12.0.1</Version>
110+
</PackageReference>
111+
<PackageReference Include="NuGet.Core">
112+
<Version>2.14.0</Version>
113+
</PackageReference>
114+
</ItemGroup>
111115
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
112116
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
113-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
114-
<PropertyGroup>
115-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
116-
</PropertyGroup>
117-
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.props'))" />
118-
<Error Condition="!Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets'))" />
119-
<Error Condition="!Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets'))" />
120-
</Target>
121-
<Import Project="..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets" Condition="Exists('..\packages\MSTest.TestAdapter.1.2.0\build\net45\MSTest.TestAdapter.targets')" />
122-
<Import Project="..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
123117
<Target Name="BeforeBuild" Condition="'$(Revision)' != '' ">
124118
<FileUpdate Files="..\properties\GlobalAssemblyInfo.cs" Regex="(?&lt;=AssemblyVersion\(&quot;\d+\.\d+\.\d+\.)(\*)" ReplacementText="$(Revision)" />
125119
</Target>

UiPath.PowerShell.Tests/packages.config

Lines changed: 0 additions & 11 deletions
This file was deleted.

UiPath.PowerShell/UiPath.PowerShell.csproj

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -39,25 +39,9 @@
3939
<NoWarn>CS1591</NoWarn>
4040
</PropertyGroup>
4141
<ItemGroup>
42-
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
43-
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.11\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
44-
</Reference>
45-
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
46-
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
47-
</Reference>
48-
<Reference Include="RestSharp, Version=106.2.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
49-
<HintPath>..\packages\RestSharp.106.2.1\lib\net452\RestSharp.dll</HintPath>
50-
</Reference>
5142
<Reference Include="System.Net.Http.WebRequest" />
52-
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
53-
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
54-
</Reference>
5543
<Reference Include="System" />
5644
<Reference Include="System.Core" />
57-
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
58-
<HintPath>..\packages\Microsoft.PowerShell.5.ReferenceAssemblies.1.1.0\lib\net4\System.Management.Automation.dll</HintPath>
59-
<Private>True</Private>
60-
</Reference>
6145
<Reference Include="System.Web" />
6246
<Reference Include="System.Xml.Linq" />
6347
<Reference Include="System.Data.DataSetExtensions" />
@@ -191,7 +175,6 @@
191175
<None Include="app.config">
192176
<SubType>Designer</SubType>
193177
</None>
194-
<None Include="packages.config" />
195178
<None Include="UiPath.PowerShell.psd1">
196179
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
197180
</None>
@@ -202,15 +185,31 @@
202185
<Name>UiPath.Web.Client</Name>
203186
</ProjectReference>
204187
</ItemGroup>
188+
<ItemGroup>
189+
<PackageReference Include="Microsoft.PowerShell.5.ReferenceAssemblies">
190+
<Version>1.1.0</Version>
191+
</PackageReference>
192+
<PackageReference Include="Microsoft.Rest.ClientRuntime">
193+
<Version>2.3.18</Version>
194+
</PackageReference>
195+
<PackageReference Include="MSBuildTasks">
196+
<Version>1.5.0.235</Version>
197+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
198+
<PrivateAssets>all</PrivateAssets>
199+
</PackageReference>
200+
<PackageReference Include="Newtonsoft.Json">
201+
<Version>12.0.1</Version>
202+
</PackageReference>
203+
<PackageReference Include="RestSharp">
204+
<Version>106.5.4</Version>
205+
</PackageReference>
206+
<PackageReference Include="XmlDoc2CmdletDoc">
207+
<Version>0.2.10</Version>
208+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
209+
<PrivateAssets>all</PrivateAssets>
210+
</PackageReference>
211+
</ItemGroup>
205212
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
206-
<Import Project="..\packages\XmlDoc2CmdletDoc.0.2.9\build\XmlDoc2CmdletDoc.targets" Condition="Exists('..\packages\XmlDoc2CmdletDoc.0.2.9\build\XmlDoc2CmdletDoc.targets')" />
207-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
208-
<PropertyGroup>
209-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
210-
</PropertyGroup>
211-
<Error Condition="!Exists('..\packages\XmlDoc2CmdletDoc.0.2.9\build\XmlDoc2CmdletDoc.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\XmlDoc2CmdletDoc.0.2.9\build\XmlDoc2CmdletDoc.targets'))" />
212-
<Error Condition="!Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets'))" />
213-
</Target>
214213
<Target Name="BeforeBuild" Condition="'$(Revision)' != '' ">
215214
<FileUpdate Files="..\properties\GlobalAssemblyInfo.cs" Regex="(?&lt;=AssemblyVersion\(&quot;\d+\.\d+\.\d+\.)(\*)" ReplacementText="$(Revision)" />
216215
</Target>
@@ -236,5 +235,4 @@
236235
<!-- ModuleVersion = '18.3.2.60001' -->
237236
<FileUpdate Files="$(OutputPath)UiPath.PowerShell.psd1" Regex="(?&lt;=ModuleVersion\s=\s)\'.*'" ReplacementText="'$(UiPathFileVersion)'" />
238237
</Target>
239-
<Import Project="..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
240238
</Project>

UiPath.PowerShell/packages.config

Lines changed: 0 additions & 10 deletions
This file was deleted.

UiPath.Web.Client/UiPath.Web.Client.csproj

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,18 +33,6 @@
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
3535
<ItemGroup>
36-
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
37-
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.11\lib\net452\Microsoft.Rest.ClientRuntime.dll</HintPath>
38-
</Reference>
39-
<Reference Include="Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
40-
<HintPath>..\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
41-
</Reference>
42-
<Reference Include="RestSharp, Version=106.2.1.0, Culture=neutral, PublicKeyToken=598062e77f915f75, processorArchitecture=MSIL">
43-
<HintPath>..\packages\RestSharp.106.2.1\lib\net452\RestSharp.dll</HintPath>
44-
</Reference>
45-
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
46-
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\net461\System.ValueTuple.dll</HintPath>
47-
</Reference>
4836
<Reference Include="System" />
4937
<Reference Include="System.Core" />
5038
<Reference Include="System.Runtime.Serialization" />
@@ -65,12 +53,27 @@
6553
<None Include="app.config">
6654
<SubType>Designer</SubType>
6755
</None>
68-
<None Include="packages.config" />
6956
<None Include="Swagger\UiPath2018.1.swagger" />
7057
<None Include="Swagger\UiPath2018.2.6.swagger" />
7158
<None Include="Swagger\UiPath2018.3.0-CE.2.swagger" />
7259
<None Include="Swagger\UiPath2018.4.1.swagger" />
7360
</ItemGroup>
61+
<ItemGroup>
62+
<PackageReference Include="Microsoft.Rest.ClientRuntime">
63+
<Version>2.3.18</Version>
64+
</PackageReference>
65+
<PackageReference Include="MSBuildTasks">
66+
<Version>1.5.0.235</Version>
67+
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
68+
<PrivateAssets>all</PrivateAssets>
69+
</PackageReference>
70+
<PackageReference Include="Newtonsoft.Json">
71+
<Version>12.0.1</Version>
72+
</PackageReference>
73+
<PackageReference Include="RestSharp">
74+
<Version>106.5.4</Version>
75+
</PackageReference>
76+
</ItemGroup>
7477
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
7578
<Target Name="Client20181" Inputs="Swagger\UiPath2018.1.swagger" Outputs="generated20181\UiPathWebApi.cs">
7679
<Exec Outputs="generated20181\UiPathWebApi.cs" Command="autorest --input-file=Swagger\UiPath2018.1.swagger --csharp --output-folder=generated20181 --csharp.namespace=UiPath.Web.Client20181 --add-credentials" />
@@ -94,15 +97,10 @@
9497
<FileWrites Include="@(AutoRestGenerated)" />
9598
</ItemGroup>
9699
</Target>
97-
<Import Project="..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
98-
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
99-
<PropertyGroup>
100-
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
101-
</PropertyGroup>
102-
<Error Condition="!Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets'))" />
103-
</Target>
104-
<Target Name="BeforeBuild" Condition="'$(Revision)' != '' ">
100+
<Target Name="UpdateRevision" Condition="'$(Revision)' != ''" BeforeTargets="PrepareForBuild">
101+
<Error Condition="$(Revision) &gt; 65535" Text="The revision number $(Revision) cannot be greater than 65535"/>
105102
<FileUpdate Files="..\properties\GlobalAssemblyInfo.cs" Regex="(?&lt;=AssemblyVersion\(&quot;\d+\.\d+\.\d+\.)(\*)" ReplacementText="$(Revision)" />
103+
<Exec Command="type ..\properties\GlobalAssemblyInfo.cs"/>
106104
</Target>
107105
<Import Project="..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets" Condition="Exists('..\packages\MSBuildTasks.1.5.0.235\build\MSBuildTasks.targets')" />
108106
</Project>

UiPath.Web.Client/packages.config

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)