Setup java paths in soong_ui
This way config.mk no longer needs to check which java is in PATH and fix it. It'll be consistent for all build steps under soong_ui. Also unify handling of ANDROID_JAVA_HOME / JAVA_HOME with OVERRIDE_ANDROID_JAVA_HOME / EXPERIMENTAL_USE_OPENJDK9. Test: m nothing Test: build/soong/soong_ui.bash --make-mode nothing (w/o envsetup.sh) Test: aosp_arm ninja files are the same before/after Test: before/after ninja files match with OVERRIDE_ANDROID_JAVA_HOME Test: before/after ninja files match with EXPERIMENTAL_USE_OPENJDK9 Change-Id: Icdb65093d9c346524074de239a4f895e4230a24d
This commit is contained in:
@@ -55,13 +55,8 @@ func init() {
|
||||
pctx.VariableConfigMethod("hostPrebuiltTag", android.Config.PrebuiltOS)
|
||||
|
||||
pctx.VariableFunc("JavaHome", func(config interface{}) (string, error) {
|
||||
if override := config.(android.Config).Getenv("OVERRIDE_ANDROID_JAVA_HOME"); override != "" {
|
||||
return override, nil
|
||||
}
|
||||
if config.(android.Config).UseOpenJDK9() {
|
||||
return "prebuilts/jdk/jdk9/${hostPrebuiltTag}", nil
|
||||
}
|
||||
return "prebuilts/jdk/jdk8/${hostPrebuiltTag}", nil
|
||||
// This is set up and guaranteed by soong_ui
|
||||
return config.(android.Config).Getenv("ANDROID_JAVA_HOME"), nil
|
||||
})
|
||||
|
||||
pctx.SourcePathVariable("JavaToolchain", "${JavaHome}/bin")
|
||||
|
Reference in New Issue
Block a user