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/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..645971e 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.3.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..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-6.4.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-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/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__ ) diff --git a/gradle/native-build.gradle b/gradle/native-build.gradle index 91a746b..f17eee3 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-29/android.jar" + def androidJar = sdk + "/platforms/android-${AndroidPlatform}/android.jar" if (!file(androidJar).exists()) { throw new GradleException("Error: path for ${androidJar} doesn't exist") } @@ -277,19 +279,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 +306,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", @@ -368,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 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index a4b4429..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-6.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists