Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xamarin.Android.Build.Tasks] remove $(_InstantRunEnabled) checks #9292

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ Copyright (C) 2016 Xamarin. All rights reserved.
FrameworkDirectories="$(_XATargetFrameworkDirectories);$(_XATargetFrameworkDirectories)Facades"
AcwMapFile="$(_AcwMapFile)"
SupportedAbis="$(_BuildTargetAbis)"
SupportedOSPlatformVersion="$(SupportedOSPlatformVersion)"
InstantRunEnabled="$(_InstantRunEnabled)">
SupportedOSPlatformVersion="$(SupportedOSPlatformVersion)">
</GenerateJavaStubs>
<ManifestMerger
Condition=" '$(AndroidManifestMerger)' == 'manifestmerger.jar' "
Expand Down Expand Up @@ -137,8 +136,7 @@ Copyright (C) 2016 Xamarin. All rights reserved.
EnableSGenConcurrent="$(AndroidEnableSGenConcurrent)"
SupportedAbis="$(_BuildTargetAbis)"
AndroidPackageName="$(_AndroidPackage)"
EnablePreloadAssembliesDefault="$(_AndroidEnablePreloadAssembliesDefault)"
InstantRunEnabled="$(_InstantRunEnabled)">
EnablePreloadAssembliesDefault="$(_AndroidEnablePreloadAssembliesDefault)">
</GeneratePackageManagerJava>
</Target>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ It is shared between "legacy" binding projects and .NET 7+ projects.
JavaLibraries="@(AndroidJavaLibrary);@(EmbeddedJar)"
ExternalJavaLibraries="@(AndroidExternalJavaLibrary)"
LibraryProjectJars="@(ExtractedJarImports)"
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)"
EnableInstantRun="$(_InstantRunEnabled)">
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)">
<Output TaskParameter="JavaLibrariesToCompile" ItemName="_BindingJavaLibrariesToCompile" />
<Output TaskParameter="ReferenceJavaLibraries" ItemName="_ReferenceJavaLibs" />
</DetermineJavaLibrariesToCompile>
Expand All @@ -60,15 +59,13 @@ It is shared between "legacy" binding projects and .NET 7+ projects.
JavaLibraries="@(AndroidJavaLibrary)"
ExternalJavaLibraries="@(AndroidExternalJavaLibrary)"
LibraryProjectJars="@(ExtractedJarImports)"
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)"
EnableInstantRun="$(_InstantRunEnabled)">
DoNotPackageJavaLibraries="@(_ResolvedDoNotPackageAttributes)">
<Output TaskParameter="JavaLibrariesToCompile" ItemName="_JavaLibrariesToCompile" />
<Output TaskParameter="ReferenceJavaLibraries" ItemName="_ReferenceJavaLibs" />
</DetermineJavaLibrariesToCompile>

<ItemGroup>
<_JavaLibrariesToCompileForApp Include="@(_JavaLibrariesToCompile)" Condition=" '$(_InstantRunEnabled)' != 'True' " />
<AndroidExternalJavaLibrary Include="@(_JavaLibrariesToCompile)" Condition=" '$(_InstantRunEnabled)' == 'True' " />
<_JavaLibrariesToCompileForApp Include="@(_JavaLibrariesToCompile)" />
</ItemGroup>
</Target>

Expand Down Expand Up @@ -168,7 +165,7 @@ It is shared between "legacy" binding projects and .NET 7+ projects.
JavaSourceFiles="@(_JavaSource)"
ToolPath="$(JavacToolPath)"
ToolExe="$(JavacToolExe)"
Jars="@(_JavaLibrariesToCompile);@(_InstantRunJavaReference);@(_ReferenceJavaLibs)"
Jars="@(_JavaLibrariesToCompile);@(_ReferenceJavaLibs)"
JavacTargetVersion="$(JavacTargetVersion)"
JavacSourceVersion="$(JavacSourceVersion)"
IntermediateOutputPath="$(IntermediateOutputPath)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ public class DetermineJavaLibrariesToCompile : AndroidTask
[Required]
public ITaskItem[] MonoPlatformJarPaths { get; set; }

public bool EnableInstantRun { get; set; }

public ITaskItem[] JavaSourceFiles { get; set; }

public ITaskItem[] JavaLibraries { get; set; }
Expand All @@ -37,8 +35,7 @@ public class DetermineJavaLibrariesToCompile : AndroidTask
public override bool RunTask ()
{
var jars = new List<ITaskItem> ();
if (!EnableInstantRun)
jars.AddRange (MonoPlatformJarPaths);
jars.AddRange (MonoPlatformJarPaths);
if (JavaSourceFiles != null)
foreach (var jar in JavaSourceFiles.Where (p => Path.GetExtension (p.ItemSpec) == ".jar"))
jars.Add (jar);
Expand Down
2 changes: 0 additions & 2 deletions src/Xamarin.Android.Build.Tasks/Tasks/GenerateJavaStubs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ public class GenerateJavaStubs : AndroidTask

public bool EmbedAssemblies { get; set; }
public bool NeedsInternet { get; set; }
public bool InstantRunEnabled { get; set; }

public bool ErrorOnCustomJavaObject { get; set; }

Expand Down Expand Up @@ -336,7 +335,6 @@ IList<string> MergeManifest (NativeCodeGenState codeGenState, Dictionary<string,
Debug = Debug,
MultiDex = MultiDex,
NeedsInternet = NeedsInternet,
InstantRunEnabled = InstantRunEnabled
};
// Only set manifest.VersionCode if there is no existing value in AndroidManifest.xml.
if (manifest.HasVersionCode) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ public class GeneratePackageManagerJava : AndroidTask
[Required]
public bool EnablePreloadAssembliesDefault { get; set; }

[Required]
public bool InstantRunEnabled { get; set; }

public bool EnableMarshalMethods { get; set; }
public string RuntimeConfigBinFilePath { get; set; }
public string BoundExceptionType { get; set; }
Expand Down Expand Up @@ -334,7 +331,6 @@ void AddEnvironment ()
BrokenExceptionTransitions = environmentParser.BrokenExceptionTransitions,
PackageNamingPolicy = pnp,
BoundExceptionType = boundExceptionType,
InstantRunEnabled = InstantRunEnabled,
JniAddNativeMethodRegistrationAttributePresent = NativeCodeGenState.Template != null ? NativeCodeGenState.Template.JniAddNativeMethodRegistrationAttributePresent : false,
HaveRuntimeConfigBlob = haveRuntimeConfigBlob,
NumberOfAssembliesInApk = assemblyCount,
Expand Down
3 changes: 0 additions & 3 deletions src/Xamarin.Android.Build.Tasks/Tasks/PrepareAbiItems.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,6 @@ public class PrepareAbiItems : AndroidTask
[Required]
public bool Debug { get; set; }

[Required]
public bool InstantRunEnabled { get; set; }

[Output]
public ITaskItem[] AssemblySources { get; set; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ public void CheckPackageManagerAssemblyOrder (string[] resolvedUserAssemblies, s
SupportedAbis = new string [] { "x86" , "arm64-v8a" },
AndroidPackageName = "com.microsoft.net6.helloandroid",
EnablePreloadAssembliesDefault = false,
InstantRunEnabled = false,
Environments = new ITaskItem [] { new TaskItem (Path.Combine (path, "myenv.txt")) },
};
Assert.IsTrue (task.Execute (), "Task should have executed.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ sealed class XamarinAndroidBundledAssembly
public string AndroidPackageName { get; set; }
public bool BrokenExceptionTransitions { get; set; }
public global::Android.Runtime.BoundExceptionType BoundExceptionType { get; set; }
public bool InstantRunEnabled { get; set; }
public bool JniAddNativeMethodRegistrationAttributePresent { get; set; }
public bool HaveRuntimeConfigBlob { get; set; }
public bool HaveAssemblyStore { get; set; }
Expand Down Expand Up @@ -226,7 +225,7 @@ protected override void Construct (LlvmIrModule module)
aot_lazy_load = AotEnableLazyLoad,
uses_assembly_preload = UsesAssemblyPreload,
broken_exception_transitions = BrokenExceptionTransitions,
instant_run_enabled = InstantRunEnabled,
instant_run_enabled = false,
jni_add_native_method_registration_attribute_present = JniAddNativeMethodRegistrationAttributePresent,
have_runtime_config_blob = HaveRuntimeConfigBlob,
have_assemblies_blob = HaveAssemblyStore,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ internal class ManifestDocument
public bool Debug { get; set; }
public bool MultiDex { get; set; }
public bool NeedsInternet { get; set; }
public bool InstantRunEnabled { get; set; }
public bool ForceExtractNativeLibs { get; set; }
public bool ForceDebuggable { get; set; }
public string VersionName { get; set; }
Expand Down
19 changes: 3 additions & 16 deletions src/Xamarin.Android.Build.Tasks/Xamarin.Android.Common.targets
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,6 @@ Copyright (C) 2011-2012 Xamarin. All rights reserved.
<_AndroidSequencePointsMode Condition=" '$(MonoSymbolArchive)' == 'True' And '$(AndroidUseDebugRuntime)' == 'False' And '$(AotAssemblies)' == 'True' And '$(DebugSymbols)' == 'True' And ('$(DebugType)' == 'PdbOnly' Or '$(DebugType)' == 'Portable')">Offline</_AndroidSequencePointsMode>
<_AndroidSequencePointsMode Condition=" '$(MonoSymbolArchive)' == 'True' And '$(AndroidUseDebugRuntime)' == 'False' And '$(_AndroidSequencePointsMode)' == ''">Normal</_AndroidSequencePointsMode>
<_AndroidSequencePointsMode Condition=" '$(_AndroidSequencePointsMode)' == ''">None</_AndroidSequencePointsMode>
<_InstantRunEnabled Condition=" '$(_InstantRunEnabled)' == '' ">False</_InstantRunEnabled>
<_AndroidBuildPropertiesCache>$(IntermediateOutputPath)build.props</_AndroidBuildPropertiesCache>
<_AdbPropertiesCache>$(IntermediateOutputPath)adb.props</_AdbPropertiesCache>
<AndroidGenerateJniMarshalMethods Condition=" '$(AndroidGenerateJniMarshalMethods)' == '' ">False</AndroidGenerateJniMarshalMethods>
Expand Down Expand Up @@ -915,8 +914,7 @@ because xbuild doesn't support framework reference assemblies.
<_NuGetAssetsFile Condition=" '$(_NuGetAssetsFile)' == '' and Exists('$(ProjectLockFile)') ">$(ProjectLockFile)</_NuGetAssetsFile>
<_NuGetAssetsFile Condition=" '$(_NuGetAssetsFile)' == '' and Exists('packages.config') ">packages.config</_NuGetAssetsFile>
<_TypeMapKind Condition=" '$(AndroidIncludeDebugSymbols)' != 'True' ">mvid</_TypeMapKind>
<_TypeMapKind Condition=" '$(AndroidIncludeDebugSymbols)' == 'True' And '$(_InstantRunEnabled)' == 'True' ">strings-files</_TypeMapKind>
<_TypeMapKind Condition=" '$(AndroidIncludeDebugSymbols)' == 'True' And '$(_InstantRunEnabled)' != 'True' ">strings-asm</_TypeMapKind>
<_TypeMapKind Condition=" '$(AndroidIncludeDebugSymbols)' == 'True' ">strings-asm</_TypeMapKind>
</PropertyGroup>
<GetFileHash
Condition=" Exists('$(_NuGetAssetsFile)') "
Expand Down Expand Up @@ -1435,7 +1433,6 @@ because xbuild doesn't support framework reference assemblies.
<PrepareAbiItems
BuildTargetAbis="@(_BuildTargetAbis)"
NativeSourcesDir="$(_NativeAssemblySourceDir)"
InstantRunEnabled="$(_InstantRunEnabled)"
Debug="$(AndroidIncludeDebugSymbols)"
Mode="typemap">
<Output TaskParameter="AssemblySources" ItemName="_TypeMapAssemblySource" />
Expand Down Expand Up @@ -1464,6 +1461,7 @@ because xbuild doesn't support framework reference assemblies.
<_LinkingEnabled Condition=" '$(AndroidLinkMode)' == 'None'">False</_LinkingEnabled>
<_HaveMultipleRIDs Condition=" '$(RuntimeIdentifiers)' != '' ">True</_HaveMultipleRIDs>
<_HaveMultipleRIDs Condition=" '$(RuntimeIdentifiers)' == '' ">False</_HaveMultipleRIDs>
<_AndroidGenerateNativeAssembly Condition=" '$(_AndroidGenerateNativeAssembly)' == '' ">True</_AndroidGenerateNativeAssembly>
</PropertyGroup>
<ItemGroup>
<_MergedManifestDocuments Condition=" '$(AndroidManifestMerger)' == 'legacy' " Include="@(ExtractedManifestDocuments)" />
Expand All @@ -1478,7 +1476,6 @@ because xbuild doesn't support framework reference assemblies.
Debug="$(AndroidIncludeDebugSymbols)"
MultiDex="$(AndroidEnableMultiDex)"
NeedsInternet="$(AndroidNeedsInternetPermission)"
InstantRunEnabled="$(_InstantRunEnabled)"
AndroidSdkPlatform="$(_AndroidApiLevel)"
AndroidSdkDir="$(_AndroidSdkDirectory)"
PackageName="$(_AndroidPackage)"
Expand All @@ -1488,7 +1485,7 @@ because xbuild doesn't support framework reference assemblies.
ManifestPlaceholders="$(AndroidManifestPlaceholders)"
OutputDirectory="$(IntermediateOutputPath)android"
TypemapOutputDirectory="$(_NativeAssemblySourceDir)"
GenerateNativeAssembly="!$(_InstantRunEnabled)"
GenerateNativeAssembly="$(_AndroidGenerateNativeAssembly)"
MergedAndroidManifestOutput="$(_ManifestOutput)"
EmbedAssemblies="$(EmbedAssembliesIntoApk)"
BundledWearApplicationName="$(BundledWearApplicationPackageName)"
Expand All @@ -1505,13 +1502,8 @@ because xbuild doesn't support framework reference assemblies.
HaveMultipleRIDs="$(_HaveMultipleRIDs)"
IntermediateOutputDirectory="$(IntermediateOutputPath)"
Environments="@(AndroidEnvironment);@(LibraryEnvironments)">
<Output TaskParameter="GeneratedBinaryTypeMaps" ItemName="_AndroidTypeMapping" Condition=" '$(_InstantRunEnabled)' == 'True' " />
</GenerateJavaStubs>

<ItemGroup Condition=" '$(_InstantRunEnabled)' == 'True' and '@(_AndroidTypeMapping->Count())' == '0' ">
<_AndroidTypeMapping Include="$(_NativeAssemblySourceDir)typemaps\**\*" />
</ItemGroup>

<ItemGroup>
<FileWrites Include="@(_TypeMapAssemblySource)" />
<FileWrites Include="@(_TypeMapAssemblyInclude)" />
Expand Down Expand Up @@ -1586,23 +1578,20 @@ because xbuild doesn't support framework reference assemblies.
<PrepareAbiItems
BuildTargetAbis="@(_BuildTargetAbis)"
NativeSourcesDir="$(_NativeAssemblySourceDir)"
InstantRunEnabled="$(_InstantRunEnabled)"
Debug="$(AndroidIncludeDebugSymbols)"
Mode="environment">
<Output TaskParameter="AssemblySources" ItemName="_EnvironmentAssemblySource" />
</PrepareAbiItems>
<PrepareAbiItems
BuildTargetAbis="@(_BuildTargetAbis)"
NativeSourcesDir="$(_NativeAssemblySourceDir)"
InstantRunEnabled="$(_InstantRunEnabled)"
Debug="$(AndroidIncludeDebugSymbols)"
Mode="compressed">
<Output TaskParameter="AssemblySources" ItemName="_CompressedAssembliesAssemblySource" />
</PrepareAbiItems>
<PrepareAbiItems
BuildTargetAbis="@(_BuildTargetAbis)"
NativeSourcesDir="$(_NativeAssemblySourceDir)"
InstantRunEnabled="$(_InstantRunEnabled)"
Debug="$(AndroidIncludeDebugSymbols)"
Mode="marshal_methods">
<Output TaskParameter="AssemblySources" ItemName="_MarshalMethodsAssemblySource" />
Expand Down Expand Up @@ -1631,7 +1620,6 @@ because xbuild doesn't support framework reference assemblies.
<PrepareAbiItems
BuildTargetAbis="@(_BuildTargetAbis)"
NativeSourcesDir="$(_NativeAssemblySourceDir)"
InstantRunEnabled="$(_InstantRunEnabled)"
Debug="$(AndroidIncludeDebugSymbols)"
Mode="jniremap">
<Output TaskParameter="AssemblySources" ItemName="_AndroidRemapAssemblySource" />
Expand Down Expand Up @@ -1729,7 +1717,6 @@ because xbuild doesn't support framework reference assemblies.
EnablePreloadAssembliesDefault="$(_AndroidEnablePreloadAssembliesDefault)"
PackageNamingPolicy="$(AndroidPackageNamingPolicy)"
BoundExceptionType="$(AndroidBoundExceptionType)"
InstantRunEnabled="$(_InstantRunEnabled)"
RuntimeConfigBinFilePath="$(_BinaryRuntimeConfigPath)"
UseAssemblyStore="$(AndroidUseAssemblyStore)"
EnableMarshalMethods="$(_AndroidUseMarshalMethods)"
Expand Down
4 changes: 2 additions & 2 deletions src/Xamarin.Android.Build.Tasks/Xamarin.Android.D8.targets
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Copyright (C) 2018 Xamarin. All rights reserved.
Debug="$(AndroidIncludeDebugSymbols)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
EnableDesugar="$(AndroidEnableDesugar)"
AndroidSdkBuildToolsPath="$(AndroidSdkBuildToolsPath)"
Expand Down Expand Up @@ -95,7 +95,7 @@ Copyright (C) 2018 Xamarin. All rights reserved.
Debug="$(AndroidIncludeDebugSymbols)"
JavaPlatformJarPath="$(JavaPlatformJarPath)"
ClassesZip="$(_AndroidIntermediateClassesZip)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp);@(_InstantRunJavaReference)"
JavaLibrariesToEmbed="@(_JavaLibrariesToCompileForApp)"
AlternativeJarLibrariesToEmbed="@(_AlternativeJarForAppD8)"
JavaLibrariesToReference="@(AndroidExternalJavaLibrary)"
EnableDesugar="$(AndroidEnableDesugar)"
Expand Down
Loading