From 4f8d476d0825b2550b4cf7d8ad8699137f8bf309 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Sat, 30 Mar 2024 11:00:02 +0100 Subject: [PATCH 1/8] bump gradle versions --- build.gradle | 4 ++-- gradle/android_project/build.gradle | 4 +--- gradle/android_project/gradle.properties | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- gradle/android_project/library/build.gradle | 12 ++++++++---- .../library/src/main/AndroidManifest.xml | 2 +- gradle/native-build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 8 files changed, 16 insertions(+), 14 deletions(-) diff --git a/build.gradle b/build.gradle index 81ae0d2..a129bc3 100644 --- a/build.gradle +++ b/build.gradle @@ -1,6 +1,6 @@ plugins { id 'java-library' - id "org.openjfx.javafxplugin" version "0.0.10" apply false + id "org.openjfx.javafxplugin" version "0.1.0" apply false } if (System.getProperty('os.name').toLowerCase().contains("mac")) { @@ -17,7 +17,7 @@ if (System.getProperty('os.name').toLowerCase().contains("mac")) { ext.IOS_VERSION = "" } -ext.libraryVersions = [attach: '4.0.14'] +ext.libraryVersions = [attach: '4.0.20'] subprojects { apply plugin: "org.openjfx.javafxplugin" diff --git a/gradle/android_project/build.gradle b/gradle/android_project/build.gradle index ce0713a..2e993cf 100644 --- a/gradle/android_project/build.gradle +++ b/gradle/android_project/build.gradle @@ -2,10 +2,9 @@ buildscript { repositories { mavenCentral() google() - jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:4.1.0-alpha09' + classpath 'com.android.tools.build:gradle:8.1.1' } } @@ -13,6 +12,5 @@ allprojects { repositories { google() mavenCentral() - jcenter() } } diff --git a/gradle/android_project/gradle.properties b/gradle/android_project/gradle.properties index fd61f10..fe2427f 100644 --- a/gradle/android_project/gradle.properties +++ b/gradle/android_project/gradle.properties @@ -1,3 +1,3 @@ android.useAndroidX=true org.gradle.daemon=false -org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxPermSize=1024m -XX:MaxMetaspaceSize=1g +org.gradle.jvmargs=-Xms512M -Xmx4g -XX:MaxMetaspaceSize=1g diff --git a/gradle/android_project/gradle/wrapper/gradle-wrapper.properties b/gradle/android_project/gradle/wrapper/gradle-wrapper.properties index 917840c..7666e22 100644 --- a/gradle/android_project/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/android_project/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip diff --git a/gradle/android_project/library/build.gradle b/gradle/android_project/library/build.gradle index f6c32f7..3ad670d 100644 --- a/gradle/android_project/library/build.gradle +++ b/gradle/android_project/library/build.gradle @@ -1,18 +1,22 @@ apply plugin: 'com.android.library' android { - compileSdkVersion 29 + + namespace 'com.gluonhq.helloandroid' + + compileSdkVersion 33 defaultConfig { minSdkVersion 21 - targetSdkVersion 29 + targetSdkVersion 33 } dependencies { compileOnly fileTree(dir: '../libs', include: '*.jar') } - afterEvaluate { - generateDebugBuildConfig.enabled = false + buildFeatures { + buildConfig = false + resValues = false } } diff --git a/gradle/android_project/library/src/main/AndroidManifest.xml b/gradle/android_project/library/src/main/AndroidManifest.xml index 9398d5e..c2189c3 100644 --- a/gradle/android_project/library/src/main/AndroidManifest.xml +++ b/gradle/android_project/library/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ - + diff --git a/gradle/native-build.gradle b/gradle/native-build.gradle index 91a746b..024ef66 100644 --- a/gradle/native-build.gradle +++ b/gradle/native-build.gradle @@ -123,7 +123,7 @@ ext.aarBuild = { buildDir, projectDir, name, os -> if (sdk == null) { throw new GradleException("Error: ANDROID_SDK can't be null") } - def androidJar = sdk + "/platforms/android-29/android.jar" + def androidJar = sdk + "/platforms/android-33/android.jar" if (!file(androidJar).exists()) { throw new GradleException("Error: path for ${androidJar} doesn't exist") } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4b4429..db9a6b8 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From f7ffaf02e48879d918017b3d427a4765347a652f Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Sat, 30 Mar 2024 11:01:09 +0100 Subject: [PATCH 2/8] allow multiple native iOS sources --- gradle/native-build.gradle | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/gradle/native-build.gradle b/gradle/native-build.gradle index 024ef66..85c546c 100644 --- a/gradle/native-build.gradle +++ b/gradle/native-build.gradle @@ -277,19 +277,20 @@ ext.nativeBuildLib = { buildDir, projectDir, name, os -> println "Skipping native-build on iOS: path for ${platform} doesn't exist" return } - - osSources = "$projectDir/src/main/native/$os/${name}.m" - + + File nativeSourcesDir = file("$projectDir/src/main/native/$os/") + osSources = [nativeSourcesDir.listFiles().findAll {it.name.endsWith(".m")}].flatten() + def compileOutput = "$buildDir/native/ios/$arch" - new File(compileOutput).mkdirs() - def compileOutputs = ["$buildDir/native/ios/$arch/${name}.o"] - def linkerOutput = "$buildDir/native/ios/$arch/lib${name}.a" - + File outputDir = new File(compileOutput) + outputDir.mkdirs() + def clangArgs = [ "-xobjective-c", "-mios-version-min=11.0", includeFlags, osIncludeFlags, + "-fobjc-arc", "-c", "-fPIC", "-arch", arch, @@ -303,6 +304,9 @@ ext.nativeBuildLib = { buildDir, projectDir, name, os -> workingDir compileOutput } + def compileOutputs = [outputDir.listFiles().findAll {it.name.endsWith(".o")}].flatten() + def linkerOutput = "$buildDir/native/ios/$arch/lib${name}.a" + def linkerArgs = [ "-static", "-framework", "Foundation", From 056a448fc1d37d6ecf21b0d6ca929e9c10758ff4 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Sat, 30 Mar 2024 12:12:17 +0100 Subject: [PATCH 3/8] latest gradle versions --- gradle/android_project/build.gradle | 2 +- gradle/android_project/gradle/wrapper/gradle-wrapper.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle/android_project/build.gradle b/gradle/android_project/build.gradle index 2e993cf..645971e 100644 --- a/gradle/android_project/build.gradle +++ b/gradle/android_project/build.gradle @@ -4,7 +4,7 @@ buildscript { google() } dependencies { - classpath 'com.android.tools.build:gradle:8.1.1' + classpath 'com.android.tools.build:gradle:8.3.1' } } diff --git a/gradle/android_project/gradle/wrapper/gradle-wrapper.properties b/gradle/android_project/gradle/wrapper/gradle-wrapper.properties index 7666e22..4518132 100644 --- a/gradle/android_project/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/android_project/gradle/wrapper/gradle-wrapper.properties @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index db9a6b8..48c0a02 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 54c968d262a5ceb1de0d5e17e40f516455fe7e6b Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Sat, 30 Mar 2024 12:17:33 +0100 Subject: [PATCH 4/8] define AndroidPlatform --- gradle/native-build.gradle | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gradle/native-build.gradle b/gradle/native-build.gradle index 85c546c..c7d7167 100644 --- a/gradle/native-build.gradle +++ b/gradle/native-build.gradle @@ -13,6 +13,8 @@ def sdkPath(String platform) { return "/Applications/Xcode.app/Contents/Developer/Platforms/${platform}.platform/Developer/SDKs/${platform}${IOS_VERSION}.sdk"; } +def AndroidPlatform = 33 + configurations { util } @@ -123,7 +125,7 @@ ext.aarBuild = { buildDir, projectDir, name, os -> if (sdk == null) { throw new GradleException("Error: ANDROID_SDK can't be null") } - def androidJar = sdk + "/platforms/android-33/android.jar" + def androidJar = sdk + "/platforms/android-${AndroidPlatform}/android.jar" if (!file(androidJar).exists()) { throw new GradleException("Error: path for ${androidJar} doesn't exist") } From 4bb3cafead50d2a363d17fdee629b43dd4cd4ea8 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Sun, 31 Mar 2024 18:56:40 +0200 Subject: [PATCH 5/8] update workflows --- .github/workflows/build.yml | 11 +++++------ .github/workflows/release.yml | 12 ++++++------ gradle/include/AttachMacros.h | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d2a2053..f2ce914 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: jobs: build: name: Build - runs-on: macos-10.15 + runs-on: macos-11 strategy: fail-fast: false steps: @@ -19,10 +19,11 @@ jobs: with: fetch-depth: 5 - - name: Setup Java 11 - uses: actions/setup-java@v1 + - name: Setup Java 17 + uses: actions/setup-java@v3 with: - java-version: 11 + distribution: 'temurin' + java-version: 17 - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -30,14 +31,12 @@ jobs: - name: Build project run: | export ANDROID_SDK=$ANDROID_HOME - export ANDROID_NDK=$ANDROID_HOME/ndk-bundle ./gradlew -i nativeBuild - name: Deploy Snapshot if: github.ref == 'refs/heads/master' run: | export ANDROID_SDK=$ANDROID_HOME - export ANDROID_NDK=$ANDROID_HOME/ndk-bundle ./gradlew publish -PgluonNexusDeployUsername=$NEXUS_DEPLOY_USERNAME -PgluonNexusDeployPassword=$NEXUS_DEPLOY_PASSWORD env: NEXUS_DEPLOY_USERNAME: ${{ secrets.NEXUS_DEPLOY_USERNAME }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9eb63b8..24c1b4a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,7 +7,7 @@ on: jobs: build: name: Deploy - runs-on: macos-10.15 + runs-on: macos-11 steps: - name: Checkout uses: actions/checkout@v2 @@ -15,10 +15,11 @@ jobs: fetch-depth: 5 persist-credentials: false - - name: Setup Java 11 - uses: actions/setup-java@v1 + - name: Setup Java 17 + uses: actions/setup-java@v3 with: - java-version: 11 + distribution: 'temurin' + java-version: 17 - name: Grant execute permission for gradlew run: chmod +x gradlew @@ -26,7 +27,6 @@ jobs: - name: Deploy Release run: | export ANDROID_SDK=$ANDROID_HOME - export ANDROID_NDK=$ANDROID_HOME/ndk-bundle ./gradlew publish -PgluonNexusDeployUsername=$NEXUS_DEPLOY_USERNAME -PgluonNexusDeployPassword=$NEXUS_DEPLOY_PASSWORD env: NEXUS_DEPLOY_USERNAME: ${{ secrets.NEXUS_DEPLOY_USERNAME }} @@ -44,4 +44,4 @@ jobs: git commit gradle.properties -m "Prepare development of $newVersion" git push https://gluon-bot:$PAT@github.com/$GITHUB_REPOSITORY HEAD:master env: - PAT: ${{ secrets.PAT }} \ No newline at end of file + PAT: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/gradle/include/AttachMacros.h b/gradle/include/AttachMacros.h index ac19668..86245bc 100644 --- a/gradle/include/AttachMacros.h +++ b/gradle/include/AttachMacros.h @@ -43,7 +43,7 @@ static __inline__ void AttachLog(const char *file, int lineNumber, const char *f [dateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; } fprintf(stderr, "[AttachLog] %s %s:%3d %s\n", [[dateFormatter stringFromDate:[NSDate date]] UTF8String], funcName, lineNumber, [formattedMessage UTF8String]); - [formattedMessage release]; +// [formattedMessage release]; } #define AttachLog(MSG, ...) AttachLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, MSG, ## __VA_ARGS__ ) From 245052aad8b7d49dd4ca1f6cb3acd0c7fdef9061 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Tue, 2 Apr 2024 11:14:46 +0200 Subject: [PATCH 6/8] undo change --- gradle/include/AttachMacros.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/include/AttachMacros.h b/gradle/include/AttachMacros.h index 86245bc..ac19668 100644 --- a/gradle/include/AttachMacros.h +++ b/gradle/include/AttachMacros.h @@ -43,7 +43,7 @@ static __inline__ void AttachLog(const char *file, int lineNumber, const char *f [dateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; } fprintf(stderr, "[AttachLog] %s %s:%3d %s\n", [[dateFormatter stringFromDate:[NSDate date]] UTF8String], funcName, lineNumber, [formattedMessage UTF8String]); -// [formattedMessage release]; + [formattedMessage release]; } #define AttachLog(MSG, ...) AttachLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, MSG, ## __VA_ARGS__ ) From 2127c8b8bc4427f352e1d30747c0f6aec06bdd5c Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Tue, 2 Apr 2024 11:16:44 +0200 Subject: [PATCH 7/8] add compile option for Android --- gradle/native-build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/native-build.gradle b/gradle/native-build.gradle index c7d7167..f17eee3 100644 --- a/gradle/native-build.gradle +++ b/gradle/native-build.gradle @@ -374,7 +374,7 @@ ext.nativeBuildLib = { buildDir, projectDir, name, os -> File nativeSourcesDir = file("$projectDir/src/main/native/$os/c/") osSources = [nativeSourcesDir.listFiles().findAll {it.name.endsWith(".c")}].flatten() - def compilerArgs = ["-target", platform, "-Werror", "-c", includeFlags, osIncludeFlags, osSources].flatten() + def compilerArgs = ["-target", platform, "-Werror", "-c", "-fPIC", includeFlags, osIncludeFlags, osSources].flatten() exec { executable compiler From 896a8f7a44d5954d072601edd1076e161184ebd8 Mon Sep 17 00:00:00 2001 From: "jose.pereda" Date: Tue, 2 Apr 2024 11:26:53 +0200 Subject: [PATCH 8/8] remove use of release --- gradle/include/AttachMacros.h | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle/include/AttachMacros.h b/gradle/include/AttachMacros.h index ac19668..5cc5451 100644 --- a/gradle/include/AttachMacros.h +++ b/gradle/include/AttachMacros.h @@ -43,7 +43,6 @@ static __inline__ void AttachLog(const char *file, int lineNumber, const char *f [dateFormatter setTimeZone:[NSTimeZone systemTimeZone]]; } fprintf(stderr, "[AttachLog] %s %s:%3d %s\n", [[dateFormatter stringFromDate:[NSDate date]] UTF8String], funcName, lineNumber, [formattedMessage UTF8String]); - [formattedMessage release]; } #define AttachLog(MSG, ...) AttachLog(__FILE__, __LINE__, __PRETTY_FUNCTION__, MSG, ## __VA_ARGS__ )