Skip to content

Commit c61def7

Browse files
committed
cmd/gomobile: upgrade minimal javac version to 1.8
Fixes golang/go#59803 upgrade minimal javac for gendex as well update doc related javac version info fix test failure
1 parent e0f5769 commit c61def7

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

cmd/gomobile/bind.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ example, in Android Studio (1.2+), an AAR file can be imported using
4444
the module import wizard (File > New > New Module > Import .JAR or
4545
.AAR package), and setting it as a new dependency
4646
(File > Project Structure > Dependencies). This requires 'javac'
47-
(version 1.7+) and Android SDK (API level 16 or newer) to build the
47+
(version 1.8+) and Android SDK (API level 16 or newer) to build the
4848
library for Android. The ANDROID_HOME and ANDROID_NDK_HOME environment
4949
variables can be used to specify the Android SDK and NDK if they are
5050
not in the default locations. Use the -javapkg flag to specify the Java

cmd/gomobile/bind_androidapp.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ func buildAAR(srcDir, androidDir string, pkgs []*packages.Package, targets []tar
245245
}
246246

247247
const (
248-
javacTargetVer = "1.7"
248+
javacTargetVer = "1.8"
249249
minAndroidAPI = 16
250250
)
251251

cmd/gomobile/bind_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ GOOS=android CGO_ENABLED=1 gobind -lang=go,java -outdir=$WORK{{if .JavaPkg}} -ja
190190
mkdir -p $WORK/src-android-arm
191191
PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go mod tidy
192192
PWD=$WORK/src-android-arm GOMODCACHE=$GOPATH/pkg/mod GOOS=android GOARCH=arm CC=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang CXX=$NDK_PATH/toolchains/llvm/prebuilt/{{.NDKARCH}}/bin/armv7a-linux-androideabi16-clang++ CGO_ENABLED=1 GOARM=7 GOPATH=$WORK:$GOPATH go build -x -buildmode=c-shared -o=$WORK/android/src/main/jniLibs/armeabi-v7a/libgojni.so ./gobind
193-
PWD=$WORK/java javac -d $WORK/javac-output -source 1.7 -target 1.7 -bootclasspath {{.AndroidPlatform}}/android.jar *.java
193+
PWD=$WORK/java javac -d $WORK/javac-output -source 1.8 -target 1.8 -bootclasspath {{.AndroidPlatform}}/android.jar *.java
194194
jar c -C $WORK/javac-output .
195195
`))
196196

cmd/gomobile/gendex.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ func gendex() error {
7474
}
7575
cmd := exec.Command(
7676
"javac",
77-
"-source", "1.7",
78-
"-target", "1.7",
77+
"-source", "1.8",
78+
"-target", "1.8",
7979
"-bootclasspath", platform+"/android.jar",
8080
"-d", tmpdir+"/work",
8181
)

0 commit comments

Comments
 (0)