-
Notifications
You must be signed in to change notification settings - Fork 568
Expand file tree
/
Copy pathjava-runtime.targets
More file actions
105 lines (100 loc) · 7.15 KB
/
java-runtime.targets
File metadata and controls
105 lines (100 loc) · 7.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<_RuntimeOutput Include="$(OutputPath)java_runtime.jar">
<OutputJar>$(OutputPath)java_runtime.jar</OutputJar>
<OutputDex>$(OutputPath)java_runtime.dex</OutputDex>
<IntermediateRuntimeOutputPath>$(IntermediateOutputPath)release</IntermediateRuntimeOutputPath>
<IntermediateRuntimeClassesTxt>$(IntermediateOutputPath)release.txt</IntermediateRuntimeClassesTxt>
<RemoveItems>..\..\src-ThirdParty\bazel\java\mono\android\debug\MultiDexLoader.java;java\mono\android\debug-net6\BuildConfig.java;java\mono\android\debug\BuildConfig.java;java\mono\android\release\BuildConfig.java;java\mono\android\clr\MonoPackageManager.java</RemoveItems>
</_RuntimeOutput>
<_RuntimeOutput Include="$(OutputPath)java_runtime_trimmable.jar">
<OutputJar>$(OutputPath)java_runtime_trimmable.jar</OutputJar>
<OutputDex>$(OutputPath)java_runtime_trimmable.dex</OutputDex>
<IntermediateRuntimeOutputPath>$(IntermediateOutputPath)release-trimmable</IntermediateRuntimeOutputPath>
<IntermediateRuntimeClassesTxt>$(IntermediateOutputPath)release-trimmable.txt</IntermediateRuntimeClassesTxt>
<RemoveItems>..\..\src-ThirdParty\bazel\java\mono\android\debug\MultiDexLoader.java;java\mono\android\debug-net6\BuildConfig.java;java\mono\android\debug\BuildConfig.java;java\mono\android\release\BuildConfig.java;java\mono\android\MonoPackageManager.java;$(JavaInteropSourceDirectory)\src\Java.Interop\java\net\dot\jni\ManagedPeer.java;$(JavaInteropSourceDirectory)\src\Java.Interop\java\net\dot\jni\internal\JavaProxyObject.java;$(JavaInteropSourceDirectory)\src\Java.Interop\java\net\dot\jni\internal\JavaProxyThrowable.java</RemoveItems>
<AddItems>java-trimmable\net\dot\jni\internal\JavaProxyObject.java;java-trimmable\net\dot\jni\internal\JavaProxyThrowable.java</AddItems>
</_RuntimeOutput>
<_RuntimeOutput Include="$(OutputPath)java_runtime_fastdev.jar">
<OutputJar>$(OutputPath)java_runtime_fastdev.jar</OutputJar>
<OutputDex>$(OutputPath)java_runtime_fastdev.dex</OutputDex>
<IntermediateRuntimeOutputPath>$(IntermediateOutputPath)fastdev</IntermediateRuntimeOutputPath>
<IntermediateRuntimeClassesTxt>$(IntermediateOutputPath)fastdev.txt</IntermediateRuntimeClassesTxt>
<RemoveItems>..\..\src-ThirdParty\bazel\java\mono\android\release\MultiDexLoader.java;java\mono\android\release-net6\BuildConfig.java;java\mono\android\release\BuildConfig.java;java\mono\android\debug\BuildConfig.java;java\mono\android\clr\MonoPackageManager.java</RemoveItems>
</_RuntimeOutput>
<_RuntimeOutput Include="$(OutputPath)java_runtime_clr.jar">
<OutputJar>$(OutputPath)java_runtime_clr.jar</OutputJar>
<OutputDex>$(OutputPath)java_runtime_clr.dex</OutputDex>
<IntermediateRuntimeOutputPath>$(IntermediateOutputPath)release-clr</IntermediateRuntimeOutputPath>
<IntermediateRuntimeClassesTxt>$(IntermediateOutputPath)release-clr.txt</IntermediateRuntimeClassesTxt>
<RemoveItems>..\..\src-ThirdParty\bazel\java\mono\android\debug\MultiDexLoader.java;java\mono\android\debug-net6\BuildConfig.java;java\mono\android\debug\BuildConfig.java;java\mono\android\release\BuildConfig.java;java\mono\android\MonoPackageManager.java</RemoveItems>
</_RuntimeOutput>
<_RuntimeOutput Include="$(OutputPath)java_runtime_fastdev_clr.jar">
<OutputJar>$(OutputPath)java_runtime_fastdev_clr.jar</OutputJar>
<OutputDex>$(OutputPath)java_runtime_fastdev_clr.dex</OutputDex>
<IntermediateRuntimeOutputPath>$(IntermediateOutputPath)fastdev-clr</IntermediateRuntimeOutputPath>
<IntermediateRuntimeClassesTxt>$(IntermediateOutputPath)fastdev-clr.txt</IntermediateRuntimeClassesTxt>
<RemoveItems>..\..\src-ThirdParty\bazel\java\mono\android\release\MultiDexLoader.java;java\mono\android\release-net6\BuildConfig.java;java\mono\android\release\BuildConfig.java;java\mono\android\debug\BuildConfig.java;java\mono\android\MonoPackageManager.java</RemoveItems>
</_RuntimeOutput>
</ItemGroup>
<Target Name="_BuildJavaRuntimeJar"
BeforeTargets="Build"
Inputs="@(AllRuntimeSource);%(_RuntimeOutput.AddItems)"
Outputs="%(_RuntimeOutput.OutputJar)"
>
<MakeDir Directories="%(_RuntimeOutput.IntermediateRuntimeOutputPath)" />
<MakeDir Directories="$(OutputPath)" />
<!-- Remove stale D8 output so 'jar uf' doesn't bundle DEX into the runtime jar. -->
<Delete Files="%(_RuntimeOutput.IntermediateRuntimeOutputPath)\classes.dex" />
<ItemGroup>
<_RuntimeSource Include="@(AllRuntimeSource)" />
<_RuntimeSource Remove="%(_RuntimeOutput.RemoveItems)" />
<_RuntimeSource Include="%(_RuntimeOutput.AddItems)" Condition=" '%(_RuntimeOutput.AddItems)' != '' " />
</ItemGroup>
<WriteLinesToFile
File="%(_RuntimeOutput.IntermediateRuntimeClassesTxt)"
Lines="@(_RuntimeSource)"
Overwrite="True"
/>
<PropertyGroup>
<_Target Condition="'$(JavacSourceVersion)' != ''">-source $(JavacSourceVersion) -target $(JavacTargetVersion)</_Target>
<_AndroidJar>"$(AndroidSdkDirectory)\platforms\android-$(AndroidJavaRuntimeApiLevel)\android.jar"</_AndroidJar>
</PropertyGroup>
<Exec
Command=""$(JavaCPath)" $(_Target) -d %(_RuntimeOutput.IntermediateRuntimeOutputPath) -h %(_RuntimeOutput.IntermediateRuntimeOutputPath) -classpath $(_AndroidJar)$(PathSeparator)"%(_RuntimeOutput.OutputJar)" @%(_RuntimeOutput.IntermediateRuntimeClassesTxt)"
/>
<Copy
SourceFiles="$(IntermediateOutputPath)release/mono_android_Runtime.h"
DestinationFolder="$(OutputPath)"
/>
<!-- These files are auto generated at app build time so should be removed from the runtime.jar -->
<Delete Files="%(_RuntimeOutput.IntermediateRuntimeOutputPath)\mono\MonoPackageManager_Resources.class" />
<Delete Files="%(_RuntimeOutput.IntermediateRuntimeOutputPath)\net\dot\android\ApplicationRegistration.class" />
<Delete Files="%(_RuntimeOutput.IntermediateRuntimeOutputPath)\mono\android\app\XamarinAndroidEnvironmentVariables.class" />
<Exec
Condition="Exists('%(_RuntimeOutput.OutputJar)')"
Command=""$(JarPath)" uf "%(_RuntimeOutput.OutputJar)" -C "%(_RuntimeOutput.IntermediateRuntimeOutputPath)" ."
/>
<Exec
Condition="!Exists('%(_RuntimeOutput.OutputJar)')"
Command=""$(JarPath)" cf "%(_RuntimeOutput.OutputJar)" -C "%(_RuntimeOutput.IntermediateRuntimeOutputPath)" ."
/>
</Target>
<Target Name="_GenerateRuntimeDex16"
AfterTargets="Build"
Inputs="@(_RuntimeOutput->'%(Identity)')"
Outputs="@(_RuntimeOutput->'%(OutputDex)')">
<Exec
Command=""$(JavaPath)" -classpath "$(OutputPath)r8.jar" com.android.tools.r8.D8 --release --no-desugaring --output "%(_RuntimeOutput.IntermediateRuntimeOutputPath)" "%(_RuntimeOutput.OutputJar)""
EnvironmentVariables="JAVA_HOME=$(JavaSdkDirectory)"
/>
<Move
SourceFiles="@(_RuntimeOutput->'%(IntermediateRuntimeOutputPath)\classes.dex')"
DestinationFiles="%(_RuntimeOutput.OutputDex)"
/>
</Target>
<Target Name="_CleanJavaRuntimeJar" BeforeTargets="Clean">
<Delete Files="%(_RuntimeOutput.OutputJar)" />
</Target>
</Project>