Skip to content

Commit

Permalink
build: Update gradle log and example's gradle version (#1029)
Browse files Browse the repository at this point in the history
Signed-off-by: CaiJingLong <[email protected]>
  • Loading branch information
CaiJingLong authored Nov 15, 2023
1 parent 876375c commit da01674
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 5 additions & 5 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,29 +67,29 @@ JavaVersion getJavaVersion() {
def javaVersion = project.findProperty("java.version")
if (javaVersion != null) {
res = JavaVersion.toVersion(javaVersion)
println("Get java version from project's gradle.properties: $javaVersion")
logger.info("Get java version from project's gradle.properties: $javaVersion.")
}

String javaHome
// 1. read from JAVA_HOME environment variable
javaHome = System.getenv("JAVA_HOME")
if (res == null && javaHome != null) {
res = getJavaFromHome(javaHome)
println("Get java version from JAVA_HOME: $javaHome")
logger.info("Get java version from JAVA_HOME: $javaHome.")
}

// 2. read gradle.properties
javaHome = project.findProperty("java.home")
if (res == null && javaHome != null) {
res = getJavaFromHome(javaHome)
println("Get java version from gradle.properties: $javaHome")
logger.info("Get java version from gradle.properties: $javaHome.")
}

// 3. read from property with java.home
javaHome = System.getProperty("java.home")
if (res == null && javaHome != null) {
res = getJavaFromHome(javaHome)
println("Get java version from java.home: $javaHome")
logger.info("Get java version from java.home: $javaHome.")
}

if (res != null) {
Expand All @@ -109,7 +109,7 @@ android {
compileSdkVersion 34

def javaVersion = getJavaVersion()
println("The photo_manager java version is ${javaVersion}")
logger.info("Using java ${javaVersion} at android.compileOptions.sourceCompatibility and android.compileOptions.targetCompatibility in photo_manager.")

compileOptions {
sourceCompatibility javaVersion
Expand Down
4 changes: 1 addition & 3 deletions example/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true
kotlin.code.style=official

java.version=17
kotlin.code.style=official

0 comments on commit da01674

Please sign in to comment.