File tree Expand file tree Collapse file tree 9 files changed +71
-24
lines changed Expand file tree Collapse file tree 9 files changed +71
-24
lines changed Original file line number Diff line number Diff line change 27
27
</PropertyGroup >
28
28
29
29
<ItemGroup >
30
- <!-- All projects should use Nerdbank.GitVersioning for consistent version numbers -->
31
- <PackageReference Include =" Nerdbank.GitVersioning" >
32
- <Version >3.4.244</Version >
33
- <PrivateAssets >all</PrivateAssets >
30
+ <!-- Workaround https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/issues/4108 -->
31
+ <PackageReference Include =" Newtonsoft.Json" >
32
+ <Version >13.0.1</Version >
34
33
</PackageReference >
35
34
</ItemGroup >
35
+
36
36
</Project >
Original file line number Diff line number Diff line change 5
5
<!-- Load custom build tasks -->
6
6
<Import Project =" $(RepoPath)build\GCM.tasks" />
7
7
8
+ <!-- Use version specified in VERSION file -->
9
+ <Target Name =" GetVersion" BeforeTargets =" BeforeBuild" >
10
+ <GetVersion VersionFile =" $(RepoPath)VERSION" >
11
+ <Output TaskParameter =" Version" PropertyName =" Version" />
12
+ <Output TaskParameter =" AssemblyVersion" PropertyName =" AssemblyVersion" />
13
+ <Output TaskParameter =" FileVersion" PropertyName =" FileVersion" />
14
+ </GetVersion >
15
+ </Target >
16
+
8
17
<!-- Windows application manifest generation -->
9
18
<PropertyGroup Condition =" '$(GenerateWindowsAppManifest)' != 'false'" >
10
19
<ApplicationManifest >$(IntermediateOutputPath)app.manifest</ApplicationManifest >
Original file line number Diff line number Diff line change
1
+ 2.1.0.0
Original file line number Diff line number Diff line change 13
13
<Code Type="Class" Source="$(MSBuildThisFileDirectory)GenerateWindowsAppManifest.cs" />
14
14
</Task>
15
15
</UsingTask>
16
+
17
+ <UsingTask TaskName="GetVersion" TaskFactory="$(_TaskFactory)" AssemblyFile="$(_TaskAssembly)">
18
+ <Task>
19
+ <Code Type="Class" Source="$(MSBuildThisFileDirectory)GetVersion.cs" />
20
+ </Task>
21
+ </UsingTask>
16
22
</Project>
Original file line number Diff line number Diff line change
1
+ using Microsoft . Build . Framework ;
2
+ using Microsoft . Build . Utilities ;
3
+ using System . IO ;
4
+
5
+ namespace GitCredentialManager . MSBuild
6
+ {
7
+ public class GetVersion : Task
8
+ {
9
+ [ Required ]
10
+ public string VersionFile { get ; set ; }
11
+
12
+ [ Output ]
13
+ public string Version { get ; set ; }
14
+
15
+ [ Output ]
16
+ public string AssemblyVersion { get ; set ; }
17
+
18
+ [ Output ]
19
+ public string FileVersion { get ; set ; }
20
+
21
+ public override bool Execute ( )
22
+ {
23
+ Log . LogMessage ( MessageImportance . Normal , "Reading VERSION file..." ) ;
24
+ string textVersion = File . ReadAllText ( VersionFile ) ;
25
+
26
+ if ( ! System . Version . TryParse ( textVersion , out System . Version fullVersion ) )
27
+ {
28
+ Log . LogError ( "Invalid version '{0}' specified." , textVersion ) ;
29
+ return false ;
30
+ }
31
+
32
+ // System.Version names its version components as follows:
33
+ // major.minor[.build[.revision]]
34
+ // The main version number we use for GCM contains the first three
35
+ // components.
36
+ // The assembly and file version numbers contain all components, as
37
+ // ommitting the revision portion from these properties causes
38
+ // runtime failures on Windows.
39
+ Version = $ "{ fullVersion . Major } .{ fullVersion . Minor } .{ fullVersion . Build } ";
40
+ AssemblyVersion = FileVersion = fullVersion . ToString ( ) ;
41
+
42
+ return true ;
43
+ }
44
+ }
45
+ }
Original file line number Diff line number Diff line change 22
22
<!-- Implicit SDK targets import (so we can override the default targets below) -->
23
23
<Import Project =" Sdk.targets" Sdk =" Microsoft.NET.Sdk" />
24
24
25
- <Target Name =" CoreCompile" DependsOnTargets = " GetBuildVersion " Condition =" '$(OSPlatform)'=='linux'" >
26
- <Message Text =" $(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(BuildVersionSimple )'" Importance =" High" />
27
- <Exec Command =" $(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(BuildVersionSimple )'" />
25
+ <Target Name =" CoreCompile" Condition =" '$(OSPlatform)'=='linux'" >
26
+ <Message Text =" $(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version )'" Importance =" High" />
27
+ <Exec Command =" $(MSBuildProjectDirectory)\build.sh --install-from-source=$(InstallFromSource) --configuration='$(Configuration)' --version='$(Version )'" />
28
28
</Target >
29
29
30
30
<Target Name =" CoreClean" >
Original file line number Diff line number Diff line change 18
18
<!-- Implicit SDK targets import (so we can override the default targets below) -->
19
19
<Import Project =" Sdk.targets" Sdk =" Microsoft.NET.Sdk" />
20
20
21
- <Target Name =" CoreCompile" DependsOnTargets = " GetBuildVersion " Condition =" '$(OSPlatform)'=='osx'" >
22
- <Message Text =" $(MSBuildProjectDirectory)\build.sh --configuration='$(Configuration)' --version='$(BuildVersionSimple )' --runtime='$(RuntimeIdentifier)'" Importance =" High" />
23
- <Exec Command =" $(MSBuildProjectDirectory)\build.sh --configuration='$(Configuration)' --version='$(BuildVersionSimple )' --runtime='$(RuntimeIdentifier)'" />
21
+ <Target Name =" CoreCompile" Condition =" '$(OSPlatform)'=='osx'" >
22
+ <Message Text =" $(MSBuildProjectDirectory)\build.sh --configuration='$(Configuration)' --version='$(Version )' --runtime='$(RuntimeIdentifier)'" Importance =" High" />
23
+ <Exec Command =" $(MSBuildProjectDirectory)\build.sh --configuration='$(Configuration)' --version='$(Version )' --runtime='$(RuntimeIdentifier)'" />
24
24
</Target >
25
25
26
26
<Target Name =" CoreClean" >
Original file line number Diff line number Diff line change 22
22
</ItemGroup >
23
23
24
24
<ItemGroup >
25
- <PackageReference Include =" Newtonsoft.Json" Version =" 13.0.1" />
26
25
<PackageReference Include =" Microsoft.Identity.Client" Version =" 4.52.0" />
27
26
<PackageReference Include =" Microsoft.Identity.Client.Extensions.Msal" Version =" 2.28.0" />
28
27
<PackageReference Include =" System.CommandLine" Version =" 2.0.0-beta1.21216.1" />
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments