-
Notifications
You must be signed in to change notification settings - Fork 537
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[build] JavacSourceVersion JavacTargetVersion Harmonization (#4771)
Context: #4567 In order to support using JDK 11 to build Xamarin.Android, we need to consistently use `javac -source 1.8 -target 1.8` ~everywhere, because we also require `javac --boot-class-path`, and JDK11 doesn't support `javac --boot-class-path` unless targeting < JDK 1.9: % javac --boot-class-path ~/android-toolchain/sdk/platforms/android-29/android.jar Example.java error: option --boot-class-path not allowed with target 11 The `<Javac/>` task use `javac --boot-class-path` to compile Java code, so that Android's `android.jar` provides everything: Task "Javac" (TaskId:154) Task Parameter:JavaPlatformJarPath=/Users/runner/Library/Android/sdk/platforms/android-29/android.jar Task Parameter:ClassesOutputDirectory=obj/Release/android/bin/classes/ Task Parameter:ClassesZip=obj/Release/android/bin/classes.zip Task Parameter:StubSourceDirectory=obj/Release/android/src/ Task Parameter:ToolPath=/Users/runner/Library/Android/jdk/bin Task Parameter: Jars= /Library/Frameworks/Mono.framework/External/xbuild-frameworks/MonoAndroid/v10.0/mono.android.jar /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/java_runtime.jar /Users/runner/Library/Android/jdk/bin/javac -J-Dfile.encoding=UTF8 "@/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/tmp2eba46d8.tmp" JAVAC : error : option --boot-class-path not allowed with target 11 The command exited with code 2. (TaskId:154) Harmonize provisioning of `javac -source` and `javac -target` values: * Add `$(JavacSourceVersion)` and `$(JavacTargetVersion)` MSBuild properties to `Configuration.props`. * Update the `src/manifestmerger` and `src/r8` builds so that `$(JavacSourceVersion)` and `$(JavacTargetVersion)` are used to control the `.class` files that they create. * Update `build-tools/scripts/Jar.targets` to use the values from `Configuration.props`, instead of separate values. * Fix errant invocations of `javac -target $(JavacSourceVersion)`, which should be `javac -target $(JavacTargetVersion)`.
- Loading branch information
Showing
9 changed files
with
28 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters