Skip to content

Commit

Permalink
build: use platform from property for ci
Browse files Browse the repository at this point in the history
  • Loading branch information
silenium-dev committed Jul 27, 2024
1 parent 5b28110 commit 4d21d6a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/actions/deploy-ubuntu/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 6 additions & 3 deletions ffmpeg/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dev.silenium.libs.jni.NativePlatform
import dev.silenium.libs.jni.Platform

buildscript {
repositories {
Expand All @@ -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<Exec>("compileNative") {
enabled = deployNative
commandLine(
Expand All @@ -49,7 +51,8 @@ val compileNative = if(deployNative) {

val nativesJar = if (deployNative) {
tasks.register<Jar>("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")
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -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" }
Expand Down

0 comments on commit 4d21d6a

Please sign in to comment.