Skip to content

Commit 3d446c1

Browse files
committed
Try to use GitInfo
1 parent ff27142 commit 3d446c1

File tree

13 files changed

+46
-33
lines changed

13 files changed

+46
-33
lines changed

Directory.Build.props

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</_OutputPath>
7+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
8+
<NoWarn>CS0436</NoWarn>
79
</PropertyGroup>
8-
10+
911
<PropertyGroup>
1012
<XlfLanguages>cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant</XlfLanguages>
1113
<UpdateXlfOnBuild Condition="'$(RunningOnCI)' != 'true'">true</UpdateXlfOnBuild>
@@ -73,7 +75,7 @@
7375
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(DotnetToolPath) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
7476
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
7577
</PropertyGroup>
76-
78+
7779
<!-- Add Roslyn analyzers NuGet to all projects -->
7880
<ItemGroup Condition=" '$(DisableRoslynAnalyzers)' != 'True' ">
7981
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
@@ -82,4 +84,16 @@
8284
</PackageReference>
8385
</ItemGroup>
8486

87+
<!-- GitInfo Package for Assembly Versioning -->
88+
<PropertyGroup>
89+
<GitDefaultBranch>main</GitDefaultBranch>
90+
<GitThisAssemblyMetadata>false</GitThisAssemblyMetadata>
91+
<GitThisAssembly>true</GitThisAssembly>
92+
</PropertyGroup>
93+
<ItemGroup>
94+
<PackageReference Include="GitInfo" Version="*" PrivateAssets="all" />
95+
</ItemGroup>
96+
97+
<Import Project="$(MSBuildThisFileDirectory)src/version/Version.props" />
98+
8599
</Project>

GitInfo.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.1.1

build-tools/automation/azure-pipelines.yaml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ variables:
1919
RunningOnCI: true
2020
Build.Configuration: Release
2121
MaxJdkVersion: 8
22-
DotNetCoreVersion: 6.0.x
22+
DotNetCoreVersion: 6.0.100-preview.6.21355.2
2323
HostedMacImage: macOS-10.15
2424
HostedWinVS2019: Hosted Windows 2019 with VS2019
2525
NetCoreTargetFrameworkPathSuffix: -net6.0
@@ -58,7 +58,7 @@ jobs:
5858
solution: Java.Interop.sln
5959
configuration: $(Build.Configuration)
6060
msbuildArguments: /restore
61-
61+
6262
- task: MSBuild@1
6363
displayName: MSBuild RunNUnitTests.targets
6464
inputs:
@@ -93,7 +93,7 @@ jobs:
9393
runNativeDotnetTests: true
9494

9595
- template: templates\fail-on-issue.yaml
96-
96+
9797
- job: mac_build
9898
displayName: Mac - Mono
9999
pool:
@@ -114,10 +114,10 @@ jobs:
114114
115115
- script: make prepare CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion)
116116
displayName: make prepare
117-
117+
118118
- script: make all CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion)
119119
displayName: make all
120-
120+
121121
- script: |
122122
r=0
123123
make run-all-tests CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion) || r=$?
@@ -139,7 +139,7 @@ jobs:
139139
SourceFolder: $(System.DefaultWorkingDirectory)
140140
Contents: |
141141
xatb.jar
142-
bin.zip
142+
bin.zip
143143
TargetFolder: $(Build.ArtifactStagingDirectory)
144144
condition: succeededOrFailed()
145145

@@ -148,7 +148,7 @@ jobs:
148148
inputs:
149149
ArtifactName: debug
150150
condition: succeededOrFailed()
151-
151+
152152
- job: mac_dotnet_build
153153
displayName: Mac - .NET Core
154154
pool:
@@ -161,12 +161,12 @@ jobs:
161161
submodules: recursive
162162

163163
- template: templates\install-dependencies.yaml
164-
164+
165165
- script: make prepare-core CONFIGURATION=$(Build.Configuration) JI_MAX_JDK=$(MaxJdkVersion)
166166
displayName: make prepare-core
167-
167+
168168
- template: templates\core-build.yaml
169-
169+
170170
- template: templates\core-tests.yaml
171171
parameters:
172172
runNativeTests: true

src/Java.Interop.Dynamic/Java.Interop.Dynamic.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
99
<AssemblyTitle>Java.Interop.Dynamic</AssemblyTitle>
10-
<Company>Microsoft Corporation</Company>
11-
<Copyright>Microsoft Corporation</Copyright>
12-
<AssemblyVersion>0.1.0.0</AssemblyVersion>
1310
</PropertyGroup>
1411
<PropertyGroup>
1512
<OutputPath>$(ToolOutputFullPath)</OutputPath>

src/Java.Interop.Export/Java.Interop.Export.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
99
<AssemblyTitle>Java.Interop.Export</AssemblyTitle>
10-
<Company>Microsoft Corporation</Company>
11-
<Copyright>Microsoft Corporation</Copyright>
12-
<AssemblyVersion>0.1.0.0</AssemblyVersion>
1310
</PropertyGroup>
1411
<PropertyGroup>
1512
<OutputPath>$(ToolOutputFullPath)</OutputPath>

src/Java.Interop.GenericMarshaler/Java.Interop.GenericMarshaler.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<SignAssembly>true</SignAssembly>
88
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
99
<AssemblyTitle>Java.Interop.GenericMarshaler</AssemblyTitle>
10-
<Company>Microsoft Corporation</Company>
11-
<Copyright>Microsoft Corporation</Copyright>
12-
<AssemblyVersion>0.1.0.0</AssemblyVersion>
1310
</PropertyGroup>
1411
<PropertyGroup>
1512
<OutputPath>$(ToolOutputFullPath)</OutputPath>

src/Java.Interop.Tools.JavaSource/Java.Interop.Tools.JavaSource.csproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
<DefineConstants>INTERNAL_NULLABLE_ATTRIBUTES</DefineConstants>
88
<ProjectGuid>{5C0B3562-8DA0-4726-9762-75B9709ED6B7}</ProjectGuid>
99
<AssemblyTitle>Java.Interop.Tools.JavaSource</AssemblyTitle>
10-
<Company>Microsoft Corporation</Company>
11-
<Copyright>Microsoft Corporation</Copyright>
12-
<AssemblyVersion>0.1.0.0</AssemblyVersion>
1310
</PropertyGroup>
1411
<PropertyGroup>
1512
<OutputPath>$(ToolOutputFullPath)</OutputPath>

src/Java.Interop/Java.Interop.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
2323
<DefineConstants>INTEROP;FEATURE_JNIENVIRONMENT_JI_PINVOKES;FEATURE_JNIOBJECTREFERENCE_INTPTRS;INTERNAL_NULLABLE_ATTRIBUTES;$(JavaInteropDefineConstants)</DefineConstants>
2424
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
25-
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
2625
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
2726
<OutputPath>$(ToolOutputFullPath)</OutputPath>
2827
<DocumentationFile>$(ToolOutputFullPath)Java.Interop.xml</DocumentationFile>

src/Java.Interop/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,9 @@
44

55
[assembly: DefaultDllImportSearchPathsAttribute (DllImportSearchPath.SafeDirectories | DllImportSearchPath.AssemblyDirectory)]
66

7-
[assembly: AssemblyTitle ("Java.Interop")]
87
[assembly: AssemblyDescription ("")]
98
[assembly: AssemblyCulture ("")]
10-
[assembly: AssemblyConfiguration ("")]
11-
[assembly: AssemblyCompany ("Microsoft Corporation")]
12-
[assembly: AssemblyCopyright ("Microsoft Corporation")]
13-
[assembly: AssemblyProduct ("")]
14-
[assembly: AssemblyTrademark ("Microsoft Corporation")]
15-
[assembly: AssemblyVersion ("0.1.0.0")]
9+
1610
[assembly: AssemblyMetadata ("IsTrimmable", "True")]
1711

1812
[assembly: InternalsVisibleTo (

src/version/AssemblyVersionInfo.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
5+
[assembly: AssemblyCompany ("Microsoft Corporation")]
6+
[assembly: AssemblyCopyright ("Microsoft Corporation")]
7+
[assembly: AssemblyTrademark ("Microsoft Corporation")]
8+
[assembly: AssemblyVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "." + ThisAssembly.Git.BaseVersion.Patch)]
9+
[assembly: AssemblyFileVersion (ThisAssembly.Git.SemVer.Major + "." + ThisAssembly.Git.SemVer.Minor + "." + ThisAssembly.Git.SemVer.Patch)]
10+
[assembly: AssemblyInformationalVersion (ThisAssembly.Git.BaseVersion.Major + "." + ThisAssembly.Git.BaseVersion.Minor + "; git-rev-head:" + ThisAssembly.Git.Commit + " git-branch:" + ThisAssembly.Git.Branch)]

0 commit comments

Comments
 (0)