From 4d21d6a3d7f10ba4771ad51b9006321941207ac4 Mon Sep 17 00:00:00 2001 From: Silas Della Contrada Date: Sat, 27 Jul 2024 04:34:06 +0200 Subject: [PATCH] build: use platform from property for ci --- .github/actions/deploy-ubuntu/action.yml | 4 ++-- ffmpeg/build.gradle.kts | 9 ++++++--- gradle/libs.versions.toml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/actions/deploy-ubuntu/action.yml b/.github/actions/deploy-ubuntu/action.yml index 684f9ef..47a571b 100644 --- a/.github/actions/deploy-ubuntu/action.yml +++ b/.github/actions/deploy-ubuntu/action.yml @@ -251,9 +251,9 @@ runs: - name: Publish release shell: bash if: "github.event_name == 'release'" - run: ./gradlew build publish -Pdeploy.kotlin=false -Pdeploy.native=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ github.event.release.tag_name }} --console=plain --info --configure-on-demand --parallel --build-cache + run: ./gradlew build publish -Pdeploy.kotlin=false -Pdeploy.native=true -Pffmpeg.platform=${{ github.job }} -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ github.event.release.tag_name }} --console=plain --info --configure-on-demand --parallel --build-cache - name: Publish snapshot shell: bash if: "github.event_name != 'release'" - run: ./gradlew build publish -Pdeploy.kotlin=false -Pdeploy.native=true -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ steps.vars.outputs.sha_short }}-dev --console=plain --info --configure-on-demand --parallel --build-cache + run: ./gradlew build publish -Pdeploy.kotlin=false -Pdeploy.native=true -Pffmpeg.platform=${{ github.job }} -Pffmpeg.gpl=${{ matrix.gpl }} -Pdeploy.version=${{ steps.vars.outputs.sha_short }}-dev --console=plain --info --configure-on-demand --parallel --build-cache diff --git a/ffmpeg/build.gradle.kts b/ffmpeg/build.gradle.kts index f15add5..68e21ed 100644 --- a/ffmpeg/build.gradle.kts +++ b/ffmpeg/build.gradle.kts @@ -1,4 +1,5 @@ import dev.silenium.libs.jni.NativePlatform +import dev.silenium.libs.jni.Platform buildscript { repositories { @@ -23,9 +24,10 @@ val deployNative = (findProperty("deploy.native") as String?)?.toBoolean() ?: tr val withGPL: Boolean = findProperty("ffmpeg.gpl").toString().toBoolean() val platformExtension = "-gpl".takeIf { withGPL }.orEmpty() -val platform = NativePlatform.platform(platformExtension) +val platformString = findProperty("ffmpeg.platform")?.toString() +val platform = platformString?.let { Platform(it, platformExtension) } ?: NativePlatform.platform(platformExtension) -val compileNative = if(deployNative) { +val compileNative = if (deployNative) { tasks.register("compileNative") { enabled = deployNative commandLine( @@ -49,7 +51,8 @@ val compileNative = if(deployNative) { val nativesJar = if (deployNative) { tasks.register("nativesJar") { - val platform = NativePlatform.platform(platformExtension) + // Required for configuration cache + val platform = platformString?.let { Platform(it, platformExtension) } ?: NativePlatform.platform(platformExtension) from(compileNative!!.get().outputs.files) { include("lib/*.so") diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4383bba..a6af679 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] kotlin = "2.0.0" -jni-utils = "0.1.2" +jni-utils = "0.1.3" [libraries] jni-utils = { group = "dev.silenium.libs.jni", name = "jni-utils", version.ref = "jni-utils" }