Skip to content

Commit

Permalink
[Xamarin.Android.Build.Tasks] remove $XAMARIN_BUILD_ID (#9223)
Browse files Browse the repository at this point in the history
* [Xamarin.Android.Build.Tasks] remove `$XAMARIN_BUILD_ID`

Fixes: #9212

`$XAMARIN_BUILD_ID` was a value that was only used by the
`mono-symbolicate` feature from Xamarin. In .NET 6+,
`mono-symbolicate` is not supported (and unfortunately, no
replacement yet):

* dotnet/runtime#106395

Likely, a new solution would use some new tool like `dotnet-symbol`,
which is able to locate symbol information based on existing
information inside managed `.dll`'s or even native libraries.

Remove `$XAMARIN_BUILD_ID`, in order to delete unused code, and
improve incremental build times mentioned in #9212.

* Fix GenerateJavaStubsAndAssembly test

`$XAMARIN_BUILD_ID` doesn't trigger `_CompileNativeAssemblySources` any longer

* Fix GenerateJavaStubsAndAssembly test, take 2
  • Loading branch information
jonathanpeppers authored Aug 20, 2024
1 parent 7d3535d commit eb5455a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ Copyright (C) 2016 Xamarin. All rights reserved.
AndroidPackageName="$(_AndroidPackage)"
EnablePreloadAssembliesDefault="$(_AndroidEnablePreloadAssembliesDefault)"
InstantRunEnabled="$(_InstantRunEnabled)">
<Output TaskParameter="BuildId" PropertyName="_XamarinBuildId" />
</GeneratePackageManagerJava>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ public class GeneratePackageManagerJava : AndroidTask
{
public override string TaskPrefix => "GPM";

Guid buildId = Guid.NewGuid ();

[Required]
public ITaskItem[] ResolvedAssemblies { get; set; }

Expand Down Expand Up @@ -81,9 +79,6 @@ public class GeneratePackageManagerJava : AndroidTask
public bool EnableSGenConcurrent { get; set; }
public string? CustomBundleConfigFile { get; set; }

[Output]
public string BuildId { get; set; }

bool _Debug {
get {
return string.Equals (Debug, "true", StringComparison.OrdinalIgnoreCase);
Expand All @@ -92,9 +87,6 @@ bool _Debug {

public override bool RunTask ()
{
BuildId = buildId.ToString ();
Log.LogDebugMessage (" [Output] BuildId: {0}", BuildId);

var doc = AndroidAppManifest.Load (Manifest, MonoAndroidHelper.SupportedVersions);
int minApiVersion = doc.MinSdkVersion == null ? 4 : (int) doc.MinSdkVersion;
// We need to include any special assemblies in the Assemblies list
Expand Down Expand Up @@ -191,9 +183,6 @@ void AddEnvironment ()
AddEnvironmentVariable (defaultMonoDebug[0], defaultMonoDebug[1]);
}

if (!environmentParser.HavebuildId)
AddEnvironmentVariable ("XAMARIN_BUILD_ID", BuildId);

if (!environmentParser.HaveHttpMessageHandler) {
if (HttpClientHandlerType == null)
AddEnvironmentVariable (defaultHttpMessageHandler[0], defaultHttpMessageHandler[1]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -942,8 +942,6 @@ public void GenerateJavaStubsAndAssembly ([Values (true, false)] bool isRelease)
var targets = new [] {
"_GenerateJavaStubs",
"_GeneratePackageManagerJava",
"_CompileNativeAssemblySources",
"_CreateApplicationSharedLibraries",
};
var proj = new XamarinAndroidApplicationProject {
IsRelease = isRelease,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ namespace Xamarin.Android.Tasks
class EnvironmentFilesParser
{
public bool BrokenExceptionTransitions { get; set; }
public bool HavebuildId { get; private set; }
public bool HaveHttpMessageHandler { get; private set; }
public bool HaveLogLevel { get; private set; }
public bool HaveMonoDebug { get; private set; }
Expand Down Expand Up @@ -46,8 +45,6 @@ public void Parse (ITaskItem[] environments, SequencePointsMode sequencePointsMo
log.LogCodedWarning ("XA2000", Properties.Resources.XA2000_gcParams_bridgeImpl);
}
}
if (lineToWrite.StartsWith ("XAMARIN_BUILD_ID=", StringComparison.Ordinal))
HavebuildId = true;
if (lineToWrite.StartsWith ("MONO_DEBUG=", StringComparison.Ordinal)) {
HaveMonoDebug = true;
if (sequencePointsMode != SequencePointsMode.None && !lineToWrite.Contains ("gen-compact-seq-points"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1728,17 +1728,9 @@ because xbuild doesn't support framework reference assemblies.
EnableMarshalMethods="$(_AndroidUseMarshalMethods)"
CustomBundleConfigFile="$(AndroidBundleConfigurationFile)"
>
<Output TaskParameter="BuildId" PropertyName="_XamarinBuildId" />
</GeneratePackageManagerJava>
<Touch Files="$(_AndroidStampDirectory)_GeneratePackageManagerJava.stamp" AlwaysCreate="True" />
<WriteLinesToFile
File="$(_AndroidBuildIdFile)"
Lines="$(_XamarinBuildId)"
Overwrite="true"
WriteOnlyWhenDifferent="true"
/>
<ItemGroup>
<FileWrites Include="$(_AndroidBuildIdFile)" />
<FileWrites Include="@(_EnvironmentAssemblySource)" />
</ItemGroup>
</Target>
Expand Down Expand Up @@ -2547,7 +2539,6 @@ because xbuild doesn't support framework reference assemblies.
<Delete Files="$(_AndroidAapt2VersionFile)" />
<Delete Files="$(IntermediateOutputPath)R.txt" />
<Delete Files="$(_AndroidMainDexListFile)" />
<Delete Files="$(_AndroidBuildIdFile)" />
<Delete Files="$(_ResolvedUserAssembliesHashFile)" />
</Target>

Expand Down

0 comments on commit eb5455a

Please sign in to comment.