Skip to content

Commit 2d46411

Browse files
dellis1972jpobst
authored andcommitted
Revert "[build] Use GitInfo to generate $(Version) (#865)" (#874)
Context: dotnet/android#6229 Context: dotnet/android#6229 (comment) This reverts commit d16b1e5. The problem is `src/Java.Interop/Java.Interop-MonoAndroid.csproj`, which is [used by the xamarin-android build][0] to create a "MonoAndroid-profile" assembly (see also 85be94f). In a d16b1e5 world -- one in which `src/Java.Interop/Properties/AssemblyInfo.cs` doesn't contain an `[assembly: AssemblyVersion(…)]` custom attribute -- for reasons not yet known, the `SetVersion` target is never run, and/or *can't* run, when `Java.Interop-MonoAndroid.csproj` is built: % msbuild /v:diag Java.Interop-MonoAndroid.csproj /p:JavaInteropProfile=Net45 \ /p:XAInstallPrefix=…/xamarin-android/bin/Debug/lib/xamarin.android \ /p:TargetFrameworkIdentifier=MonoAndroid \ /p:TargetFrameworkVersion=v1.0 \ /p:TargetFrameworkRootPath=…/xamarin-android/bin/Debug/lib/xamarin.android/xbuild-frameworks Consequently, the "MonoAndroid-profile" `Java.Interop.dll` winds up with *no* version set, i.e. version 0.0.0.0, which breaks everything: MainActivity.cs(13,3): error CS1705: Assembly 'Xamarin.Forms.Platform.Android' with identity 'Xamarin.Forms.Platform.Android, Version=2.0.0.0, Culture=neutral, PublicKeyToken=null' uses 'Java.Interop, Version=0.1.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' which has a higher version than referenced assembly 'Java.Interop' with identity 'Java.Interop, Version=0.0.0.0, Culture=neutral, PublicKeyToken=84e04ff9cfb79065' In the interests of expediency -- we can't bump Java.Interop within xamarin-android so long as d16b1e5 is in place -- revert commit d16b1e5 so that we can un-block repo bumps. We'll try to figure out how to properly use the `GitInfo` NuGet package while supporting `Java.Interop-MonoAndroid.csproj` later. [0]: https://github.com/xamarin/xamarin-android/blob/bcc315857f2cd61351ba469973043d91c902c50e/src/Mono.Android/Mono.Android.targets#L10-L35
1 parent 494759c commit 2d46411

File tree

11 files changed

+32
-34
lines changed

11 files changed

+32
-34
lines changed

Directory.Build.props

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@
44
<PropertyGroup>
55
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
66
<_OutputPath>$(MSBuildThisFileDirectory)bin\Build$(Configuration)\</_OutputPath>
7-
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
87
</PropertyGroup>
9-
8+
109
<PropertyGroup>
1110
<XlfLanguages>cs;de;es;fr;it;ja;ko;pl;pt-BR;ru;tr;zh-Hans;zh-Hant</XlfLanguages>
1211
<UpdateXlfOnBuild Condition="'$(RunningOnCI)' != 'true'">true</UpdateXlfOnBuild>
@@ -80,7 +79,7 @@
8079
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' == 'True' ">$(DotnetToolPath) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
8180
<_RunJNIEnvGen Condition=" '$(JIBuildingForNetCoreApp)' != 'True' ">$(Runtime) "$(_JNIEnvGenPath)"</_RunJNIEnvGen>
8281
</PropertyGroup>
83-
82+
8483
<!-- Add Roslyn analyzers NuGet to all projects -->
8584
<ItemGroup Condition=" '$(DisableRoslynAnalyzers)' != 'True' ">
8685
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.3.0">
@@ -89,21 +88,4 @@
8988
</PackageReference>
9089
</ItemGroup>
9190

92-
<!-- GitInfo Package for Assembly Versioning -->
93-
<ItemGroup>
94-
<PackageReference Include="GitInfo" Version="2.1.2" PrivateAssets="all" />
95-
</ItemGroup>
96-
<PropertyGroup>
97-
<GitDefaultBranch>main</GitDefaultBranch>
98-
<GitThisAssembly>false</GitThisAssembly>
99-
</PropertyGroup>
100-
101-
<Target Name="SetVersion" BeforeTargets="GetAssemblyVersion;GetPackageVersion" DependsOnTargets="GitVersion">
102-
<PropertyGroup>
103-
<Version>$(GitSemVerMajor).$(GitSemVerMinor).$(GitSemVerPatch)</Version>
104-
<InformationalVersion>$(Version); git-rev-head:$(GitCommit); git-branch:$(GitBranch)</InformationalVersion>
105-
<Company>Microsoft Corporation</Company>
106-
<Copyright>Microsoft Corporation</Copyright>
107-
</PropertyGroup>
108-
</Target>
10991
</Project>

GitInfo.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

build-tools/automation/azure-pipelines.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
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>
1013
</PropertyGroup>
1114
<PropertyGroup>
1215
<OutputPath>$(ToolOutputFullPath)</OutputPath>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
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>
1013
</PropertyGroup>
1114
<PropertyGroup>
1215
<OutputPath>$(ToolOutputFullPath)</OutputPath>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
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>
1013
</PropertyGroup>
1114
<PropertyGroup>
1215
<OutputPath>$(ToolOutputFullPath)</OutputPath>

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
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>
1013
</PropertyGroup>
1114
<PropertyGroup>
1215
<OutputPath>$(ToolOutputFullPath)</OutputPath>

src/Java.Interop/Java.Interop.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
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>
2526
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)\$(TargetFramework.ToLowerInvariant())\</IntermediateOutputPath>
2627
<OutputPath>$(ToolOutputFullPath)</OutputPath>
2728
<DocumentationFile>$(ToolOutputFullPath)Java.Interop.xml</DocumentationFile>

src/Java.Interop/Properties/AssemblyInfo.cs

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

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

7+
[assembly: AssemblyTitle ("Java.Interop")]
78
[assembly: AssemblyDescription ("")]
89
[assembly: AssemblyCulture ("")]
9-
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")]
1016
[assembly: AssemblyMetadata ("IsTrimmable", "True")]
1117

1218
[assembly: InternalsVisibleTo (

tests/Java.Interop-Tests/Java.Interop-Tests.csproj

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
<TargetFrameworks>net472;net6.0</TargetFrameworks>
55
<IsPackable>false</IsPackable>
66
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
7-
<SignAssembly>true</SignAssembly>
8-
<AssemblyOriginatorKeyFile>..\..\product.snk</AssemblyOriginatorKeyFile>
97
</PropertyGroup>
108

119
<PropertyGroup>

0 commit comments

Comments
 (0)