gogio: use ANDROID_HOME instead of the deprecated ANDROID_SDK_ROOT

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2025-05-24 11:19:37 +02:00
parent c108ce0a29
commit 3f0ad89ca9
2 changed files with 8 additions and 8 deletions
+2 -2
View File
@@ -24,9 +24,9 @@ type AndroidTestDriver struct {
var rxAdbDevice = regexp.MustCompile(`(.*)\s+device$`)
func (d *AndroidTestDriver) Start(path string) {
d.sdkDir = os.Getenv("ANDROID_SDK_ROOT")
d.sdkDir = os.Getenv("ANDROID_HOME")
if d.sdkDir == "" {
d.Skipf("Android SDK is required; set $ANDROID_SDK_ROOT")
d.Skipf("Android SDK is required; set $ANDROID_HOME")
}
d.adbPath = filepath.Join(d.sdkDir, "platform-tools", "adb")
if _, err := os.Stat(d.adbPath); os.IsNotExist(err) {
+6 -6
View File
@@ -76,9 +76,9 @@ func init() {
}
func buildAndroid(tmpDir string, bi *buildInfo) error {
sdk := os.Getenv("ANDROID_SDK_ROOT")
sdk := os.Getenv("ANDROID_HOME")
if sdk == "" {
return errors.New("please set ANDROID_SDK_ROOT to the Android SDK path")
return errors.New("please set ANDROID_HOME to the Android SDK path")
}
if _, err := os.Stat(sdk); err != nil {
return err
@@ -179,9 +179,9 @@ func buildAndroid(tmpDir string, bi *buildInfo) error {
}
func compileAndroid(tmpDir string, tools *androidTools, bi *buildInfo) (err error) {
androidHome := os.Getenv("ANDROID_SDK_ROOT")
androidHome := os.Getenv("ANDROID_HOME")
if androidHome == "" {
return errors.New("ANDROID_SDK_ROOT is not set. Please point it to the root of the Android SDK")
return errors.New("ANDROID_HOME is not set. Please point it to the root of the Android SDK")
}
javac, err := findJavaC()
if err != nil {
@@ -744,7 +744,7 @@ func findNDK(androidHome string) (string, error) {
if bestNDK, found := latestVersionPath(ndks); found {
return bestNDK, nil
}
// The old NDK path was $ANDROID_SDK_ROOT/ndk-bundle.
// The old NDK path was $ANDROID_HOME/ndk-bundle.
ndkBundle := filepath.Join(androidHome, "ndk-bundle")
if _, err := os.Stat(ndkBundle); err == nil {
return ndkBundle, nil
@@ -757,7 +757,7 @@ func findNDK(androidHome string) (string, error) {
}
}
return "", fmt.Errorf("no NDK found in $ANDROID_SDK_ROOT (%s). Set $ANDROID_NDK_ROOT or use `sdkmanager ndk-bundle` to install the NDK", androidHome)
return "", fmt.Errorf("no NDK found in $ANDROID_HOME (%s). Set $ANDROID_NDK_ROOT or use `sdkmanager ndk-bundle` to install the NDK", androidHome)
}
func findKeytool() (string, error) {