diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4ab449..57edb08 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,9 @@ name: Build and Publish on: + workflow_dispatch: + schedule: + - cron: '17 3 * * 0' push: pull_request: release: diff --git a/.github/workflows/refresh-catalog.yml b/.github/workflows/refresh-catalog.yml new file mode 100644 index 0000000..34bac0b --- /dev/null +++ b/.github/workflows/refresh-catalog.yml @@ -0,0 +1,39 @@ +name: Refresh Catalog + +on: + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +jobs: + refresh-catalog: + name: Refresh central catalog copy + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Java + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: '21' + cache: gradle + + - name: Refresh catalog + run: ./gradlew --no-daemon refreshCatalog + + - name: Open pull request + uses: peter-evans/create-pull-request@v7 + with: + branch: automation/refresh-central-catalog + delete-branch: true + commit-message: Refresh central Gradle version catalog + title: Refresh central Gradle version catalog + body: | + Updates the local Gradle version catalog from NostrGameEngine/libs.catalog. + + If the downloaded catalog is identical to the current file, this workflow exits without opening a pull request. diff --git a/build.gradle b/build.gradle index dc667b9..1dea2f5 100644 --- a/build.gradle +++ b/build.gradle @@ -279,3 +279,21 @@ spotless { notCompatibleWithConfigurationCache("Spotless tasks not compatible with configuration cache") } } + +tasks.register('refreshCatalog') { + group = 'build setup' + description = 'Downloads the central NostrGameEngine Gradle version catalog.' + + def catalogUrl = providers.gradleProperty('centralCatalogUrl') + .orElse('https://raw.githubusercontent.com/NostrGameEngine/libs.catalog/main/libs.versions.toml') + def outputFile = layout.projectDirectory.file('gradle/libs.versions.toml') + + outputs.file(outputFile) + + doLast { + def target = outputFile.asFile + target.parentFile.mkdirs() + target.text = new URI(catalogUrl.get()).toURL().getText('UTF-8') + println "Refreshed ${target}" + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2da9eea..0cfe2ac 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,23 +1,238 @@ [versions] -junit = "4.13.2" -jakarta-annotation = "2.1.1" -spotless = "7.0.2" -gradle-nexus-publish = "2.0.0" -nge-platform = "0.2.3" -nge-platform-snapshot = "0.3.0-SNAPSHOT" -bech32 = "1.2.0" -bech32-snapshot = "1.2.0" + +# Snapshot versions for NostrGameEngine libraries +bech32-snapshot = "1.0.0-SNAPSHOT" +bolt11-snapshot = "0.0.0-SNAPSHOT" +imagewebp-snapshot = "0.1.0-SNAPSHOT" +libdatachannelJava-snapshot = "0.24.1.0-SNAPSHOT" +libjglios-snapshot = "0.3-SNAPSHOT" +lnurl4j-snapshot = "0.3.0-SNAPSHOT" +nanosvgChicoryJava-snapshot = "0.1.0-SNAPSHOT" +ngengine-snapshot = "0.3.0-SNAPSHOT" +ngePlatform-snapshot = "0.3.0-SNAPSHOT" +nostr4j-snapshot = "0.3.0-SNAPSHOT" +nostrads-snapshot = "0.2.0-SNAPSHOT" +saferalloc-snapshot = "0.1.0-SNAPSHOT" +stbImage-snapshot = "1.0.0-SNAPSHOT" + +# Release versions for NostrGameEngine libraries +angle = "2026-05-09" +bech32 = "1.2.1" +bolt11 = "0.0.1" +chicory = "1.7.5-nge2" +imagewebp = "1.3.0" +libdatachannelJava = "0.24.1.nge5" +libjglios = "0.6" +lnurl4j = "0.0.4" +nanosvgChicoryJava = "0.1" +ngengine = "0.2.0" +ngePlatform = "0.2.3" +nostr4j = "0.3.0" +nostrads = "0.2.4" +saferalloc = "0.0.10" +stbImage = "2.30.5" + +# Transitive dependency and build-tool versions +androidGradlePlugin = "9.1.1" +androidxJunit = "1.3.0" +androidxTestCore = "1.7.0" +androidxTestRunner = "1.7.0" +asm = "9.9" +bcprov = "1.84" +checkstyle = "13.3.0" +commons-math3 = "3.6.1" +findsecbugs = "1.12.0" +foojayResolver = "1.0.0" +gradleNexusPublish = "2.0.0" +gradleTestRetry = "1.6.4" +graalvmNativePlugin = "0.11.5" +guava = "33.3.1-jre" +jackson = "2.17.2" +jakartaAnnotation = "2.1.1" +jacoco = "0.8.12" +jmeAndroidNatives = "3.10.0-xt16kb-alloc" +junit4Version = "4.13.2" +lwjgl3 = "3.4.1" +nifty = "1.4.3" +okhttp = "5.3.2" +prettier = "2.8.8" +prettierJava = "2.2.0" +slf4j = "2.0.12" +spotbugs = "4.9.8" +spotbugsPlugin = "6.5.5" +spotlessPlugin = "8.4.0" +teavm = "0.13.0" [libraries] -junit = { module = "junit:junit", version.ref = "junit" } -jakarta-annotation-api = { module = "jakarta.annotation:jakarta.annotation-api", version.ref = "jakarta-annotation" } -nge-platform-jvm = { module = "org.ngengine:nge-platform-jvm", version.ref = "nge-platform" } -nge-platform-jvm-snapshot = { module = "org.ngengine:nge-platform-jvm", version.ref = "nge-platform-snapshot" } -nge-platform-common = { module = "org.ngengine:nge-platform-common", version.ref = "nge-platform" } -nge-platform-common-snapshot = { module = "org.ngengine:nge-platform-common", version.ref = "nge-platform-snapshot" } -bech32 = { module = "org.ngengine:bech32", version.ref = "bech32" } + +# Snapshot artifacts for NostrGameEngine libraries bech32-snapshot = { module = "org.ngengine:bech32", version.ref = "bech32-snapshot" } +bolt11-snapshot = { module = "org.ngengine:bolt11", version.ref = "bolt11-snapshot" } +imagewebp-snapshot = { module = "org.ngengine:image-webp-decoder", version.ref = "imagewebp-snapshot" } +jme3-core-snapshot = { module = "org.ngengine:jme3-core", version.ref = "ngengine-snapshot" } +jme3-desktop-snapshot = { module = "org.ngengine:jme3-desktop", version.ref = "ngengine-snapshot" } +jme3-effects-snapshot = { module = "org.ngengine:jme3-effects", version.ref = "ngengine-snapshot" } +jme3-ios-snapshot = { module = "org.ngengine:jme3-ios", version.ref = "ngengine-snapshot" } +jme3-lwjgl3-snapshot = { module = "org.ngengine:jme3-lwjgl3", version.ref = "ngengine-snapshot" } +jme3-networking-snapshot = { module = "org.ngengine:jme3-networking", version.ref = "ngengine-snapshot" } +jme3-plugins-snapshot = { module = "org.ngengine:jme3-plugins", version.ref = "ngengine-snapshot" } +jme3-plugins-json-snapshot = { module = "org.ngengine:jme3-plugins-json", version.ref = "ngengine-snapshot" } +jme3-plugins-json-gson-snapshot = { module = "org.ngengine:jme3-plugins-json-gson", version.ref = "ngengine-snapshot" } +jme3-terrain-snapshot = { module = "org.ngengine:jme3-terrain", version.ref = "ngengine-snapshot" } +libdatachannel-java-snapshot = { module = "org.ngengine:libdatachannel-java", version.ref = "libdatachannelJava-snapshot" } +libdatachannel-java-android-snapshot = { module = "org.ngengine:libdatachannel-java-android", version.ref = "libdatachannelJava-snapshot" } +libdatachannel-java-arch-detect-snapshot = { module = "org.ngengine:libdatachannel-java-arch-detect", version.ref = "libdatachannelJava-snapshot" } +libdatachannel-java-ios-snapshot = { module = "org.ngengine:libdatachannel-java-ios", version.ref = "libdatachannelJava-snapshot" } +libjglios-angle-ios-snapshot = { module = "org.ngengine:libjglios-angle-ios", version.ref = "libjglios-snapshot" } +libjglios-core-ios-snapshot = { module = "org.ngengine:libjglios-core-ios", version.ref = "libjglios-snapshot" } +libjglios-gles-ios-snapshot = { module = "org.ngengine:libjglios-gles-ios", version.ref = "libjglios-snapshot" } +libjglios-gradle-plugin-snapshot = { module = "org.ngengine:libjglios-gradle-plugin", version.ref = "libjglios-snapshot" } +libjglios-openal-ios-snapshot = { module = "org.ngengine:libjglios-openal-ios", version.ref = "libjglios-snapshot" } +libjglios-sdl3-ios-snapshot = { module = "org.ngengine:libjglios-sdl3-ios", version.ref = "libjglios-snapshot" } +lnurl4j-snapshot = { module = "org.ngengine:lnurl4j", version.ref = "lnurl4j-snapshot" } +nanosvg-chicory-java-snapshot = { module = "org.ngengine:nanosvg-chicory-java", version.ref = "nanosvgChicoryJava-snapshot" } +nge-auth-snapshot = { module = "org.ngengine:nge-auth", version.ref = "ngengine-snapshot" } +nge-core-snapshot = { module = "org.ngengine:nge-core", version.ref = "ngengine-snapshot" } +nge-gui-snapshot = { module = "org.ngengine:nge-gui", version.ref = "ngengine-snapshot" } +nge-networking-snapshot = { module = "org.ngengine:nge-networking", version.ref = "ngengine-snapshot" } +nge-platform-android-snapshot = { module = "org.ngengine:nge-platform-android", version.ref = "ngePlatform-snapshot" } +nge-platform-common-snapshot = { module = "org.ngengine:nge-platform-common", version.ref = "ngePlatform-snapshot" } +nge-platform-jvm-snapshot = { module = "org.ngengine:nge-platform-jvm", version.ref = "ngePlatform-snapshot" } +nge-platform-teavm-snapshot = { module = "org.ngengine:nge-platform-teavm", version.ref = "ngePlatform-snapshot" } +nostr4j-snapshot = { module = "org.ngengine:nostr4j", version.ref = "nostr4j-snapshot" } +nostr4j-turn-server-snapshot = { module = "org.ngengine:nostr4j-turn-server", version.ref = "nostr4j-snapshot" } +nostrads-snapshot = { module = "org.ngengine:nostrads", version.ref = "nostrads-snapshot" } +saferalloc-snapshot = { module = "org.ngengine:saferalloc", version.ref = "saferalloc-snapshot" } +saferalloc-natives-linux-x8664-snapshot = { module = "org.ngengine:saferalloc-natives-linux-x86_64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-linux-aarch64-snapshot = { module = "org.ngengine:saferalloc-natives-linux-aarch64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-windows-x8664-snapshot = { module = "org.ngengine:saferalloc-natives-windows-x86_64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-windows-aarch64-snapshot = { module = "org.ngengine:saferalloc-natives-windows-aarch64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-macos-x8664-snapshot = { module = "org.ngengine:saferalloc-natives-macos-x86_64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-macos-aarch64-snapshot = { module = "org.ngengine:saferalloc-natives-macos-aarch64", version.ref = "saferalloc-snapshot" } +saferalloc-natives-android-snapshot = { module = "org.ngengine:saferalloc-natives-android", version.ref = "saferalloc-snapshot" } +saferalloc-natives-ios-snapshot = { module = "org.ngengine:saferalloc-natives-ios", version.ref = "saferalloc-snapshot" } +stb-image-snapshot = { module = "org.ngengine:stb-image", version.ref = "stbImage-snapshot" } + +# Release artifacts for NostrGameEngine libraries +angle = { module = "org.ngengine:angle-natives", version.ref = "angle" } +bech32 = { module = "org.ngengine:bech32", version.ref = "bech32" } +bolt11 = { module = "org.ngengine:bolt11", version.ref = "bolt11" } +chicory-runtime = { module = "org.ngengine.chicory:runtime", version.ref = "chicory" } +chicory-wasm = { module = "org.ngengine.chicory:wasm", version.ref = "chicory" } +imagewebp = { module = "org.ngengine:image-webp-decoder", version.ref = "imagewebp" } +jme3-core = { module = "org.ngengine:jme3-core", version.ref = "ngengine" } +jme3-desktop = { module = "org.ngengine:jme3-desktop", version.ref = "ngengine" } +jme3-effects = { module = "org.ngengine:jme3-effects", version.ref = "ngengine" } +jme3-ios = { module = "org.ngengine:jme3-ios", version.ref = "ngengine" } +jme3-lwjgl3 = { module = "org.ngengine:jme3-lwjgl3", version.ref = "ngengine" } +jme3-networking = { module = "org.ngengine:jme3-networking", version.ref = "ngengine" } +jme3-plugins = { module = "org.ngengine:jme3-plugins", version.ref = "ngengine" } +jme3-plugins-json = { module = "org.ngengine:jme3-plugins-json", version.ref = "ngengine" } +jme3-plugins-json-gson = { module = "org.ngengine:jme3-plugins-json-gson", version.ref = "ngengine" } +jme3-terrain = { module = "org.ngengine:jme3-terrain", version.ref = "ngengine" } +libdatachannel-java = { module = "org.ngengine:libdatachannel-java", version.ref = "libdatachannelJava" } +libdatachannel-java-android = { module = "org.ngengine:libdatachannel-java-android", version.ref = "libdatachannelJava" } +libdatachannel-java-arch-detect = { module = "org.ngengine:libdatachannel-java-arch-detect", version.ref = "libdatachannelJava" } +libdatachannel-java-ios = { module = "org.ngengine:libdatachannel-java-ios", version.ref = "libdatachannelJava" } +libjglios-angle-ios = { module = "org.ngengine:libjglios-angle-ios", version.ref = "libjglios" } +libjglios-core-ios = { module = "org.ngengine:libjglios-core-ios", version.ref = "libjglios" } +libjglios-gles-ios = { module = "org.ngengine:libjglios-gles-ios", version.ref = "libjglios" } +libjglios-gradle-plugin = { module = "org.ngengine:libjglios-gradle-plugin", version.ref = "libjglios" } +libjglios-openal-ios = { module = "org.ngengine:libjglios-openal-ios", version.ref = "libjglios" } +libjglios-sdl3-ios = { module = "org.ngengine:libjglios-sdl3-ios", version.ref = "libjglios" } +lnurl4j = { module = "org.ngengine:lnurl4j", version.ref = "lnurl4j" } +nanosvg-chicory-java = { module = "org.ngengine:nanosvg-chicory-java", version.ref = "nanosvgChicoryJava" } +nge-auth = { module = "org.ngengine:nge-auth", version.ref = "ngengine" } +nge-core = { module = "org.ngengine:nge-core", version.ref = "ngengine" } +nge-gui = { module = "org.ngengine:nge-gui", version.ref = "ngengine" } +nge-networking = { module = "org.ngengine:nge-networking", version.ref = "ngengine" } +nge-platform-android = { module = "org.ngengine:nge-platform-android", version.ref = "ngePlatform" } +nge-platform-common = { module = "org.ngengine:nge-platform-common", version.ref = "ngePlatform" } +nge-platform-jvm = { module = "org.ngengine:nge-platform-jvm", version.ref = "ngePlatform" } +nge-platform-teavm = { module = "org.ngengine:nge-platform-teavm", version.ref = "ngePlatform" } +nostr4j = { module = "org.ngengine:nostr4j", version.ref = "nostr4j" } +nostr4j-turn-server = { module = "org.ngengine:nostr4j-turn-server", version.ref = "nostr4j" } +nostrads = { module = "org.ngengine:nostrads", version.ref = "nostrads" } +saferalloc = { module = "org.ngengine:saferalloc", version.ref = "saferalloc" } +saferalloc-natives-linux-x8664 = { module = "org.ngengine:saferalloc-natives-linux-x86_64", version.ref = "saferalloc" } +saferalloc-natives-linux-aarch64 = { module = "org.ngengine:saferalloc-natives-linux-aarch64", version.ref = "saferalloc" } +saferalloc-natives-windows-x8664 = { module = "org.ngengine:saferalloc-natives-windows-x86_64", version.ref = "saferalloc" } +saferalloc-natives-windows-aarch64 = { module = "org.ngengine:saferalloc-natives-windows-aarch64", version.ref = "saferalloc" } +saferalloc-natives-macos-x8664 = { module = "org.ngengine:saferalloc-natives-macos-x86_64", version.ref = "saferalloc" } +saferalloc-natives-macos-aarch64 = { module = "org.ngengine:saferalloc-natives-macos-aarch64", version.ref = "saferalloc" } +saferalloc-natives-android = { module = "org.ngengine:saferalloc-natives-android", version.ref = "saferalloc" } +saferalloc-natives-ios = { module = "org.ngengine:saferalloc-natives-ios", version.ref = "saferalloc" } +stb-image = { module = "org.ngengine:stb-image", version.ref = "stbImage" } + +# Transitive dependencies +androidx-annotation = "androidx.annotation:annotation:1.10.0" +androidx-fragment = "androidx.fragment:fragment:1.8.9" +androidx-lifecycle-common = "androidx.lifecycle:lifecycle-common:2.7.0" +android-build-gradle = { module = "com.android.tools.build:gradle", version.ref = "androidGradlePlugin" } +android-support-appcompat = "com.android.support:appcompat-v7:28.0.0" +androidx-test-core = { module = "androidx.test:core", version.ref = "androidxTestCore" } +androidx-test-ext-junit = { module = "androidx.test.ext:junit", version.ref = "androidxJunit" } +androidx-test-runner = { module = "androidx.test:runner", version.ref = "androidxTestRunner" } +asm = { module = "org.ow2.asm:asm", version.ref = "asm" } +asm-tree = { module = "org.ow2.asm:asm-tree", version.ref = "asm" } +bcprov = { module = "org.bouncycastle:bcprov-jdk18on", version.ref = "bcprov" } +commons-math3 = { module = "org.apache.commons:commons-math3", version.ref = "commons-math3" } +findsecbugs-plugin = { module = "com.h3xstream.findsecbugs:findsecbugs-plugin", version.ref = "findsecbugs" } +groovy-test = "org.apache.groovy:groovy-test:4.0.31" +gson = "com.google.code.gson:gson:2.14.0" +guava = { module = "com.google.guava:guava", version.ref = "guava" } +j-ogg-vorbis = "com.github.stephengold:j-ogg-vorbis:1.0.6" +jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" } +jakarta-annotation-api = { module = "jakarta.annotation:jakarta.annotation-api", version.ref = "jakartaAnnotation" } +jme3-android-natives = { module = "org.jmonkeyengine:jme3-android-native", version.ref = "jmeAndroidNatives" } +jbullet = "com.github.stephengold:jbullet:1.0.3" +jinput = "net.java.jinput:jinput:2.0.9" +jna = "net.java.dev.jna:jna:5.18.1" +jnaerator-runtime = "com.nativelibs4java:jnaerator-runtime:0.12" +junit-bom = "org.junit:junit-bom:5.13.4" +junit = { module = "junit:junit", version.ref = "junit4Version" } +junit4 = "junit:junit:4.13.2" +junit4-ref = { module = "junit:junit", version.ref = "junit4Version" } +junit-jupiter = { module = "org.junit.jupiter:junit-jupiter" } +junit-platform-launcher = { module = "org.junit.platform:junit-platform-launcher" } +lwjgl2 = "org.jmonkeyengine:lwjgl:2.9.5" +lwjgl3-awt = "org.jmonkeyengine:lwjgl3-awt:0.2.4" +lwjgl3-base = { module = "org.lwjgl:lwjgl", version.ref = "lwjgl3" } +lwjgl3-glfw = { module = "org.lwjgl:lwjgl-glfw", version.ref = "lwjgl3" } +lwjgl3-jawt = { module = "org.lwjgl:lwjgl-jawt", version.ref = "lwjgl3" } +lwjgl3-jemalloc = { module = "org.lwjgl:lwjgl-jemalloc", version.ref = "lwjgl3" } +lwjgl3-openal = { module = "org.lwjgl:lwjgl-openal", version.ref = "lwjgl3" } +lwjgl3-opengl = { module = "org.lwjgl:lwjgl-opengl", version.ref = "lwjgl3" } +lwjgl3-stb = { module = "org.lwjgl:lwjgl-stb", version.ref = "lwjgl3" } +lwjgl3-nanovg = { module = "org.lwjgl:lwjgl-nanovg", version.ref = "lwjgl3" } +lwjgl3-sdl = { module = "org.lwjgl:lwjgl-sdl", version.ref = "lwjgl3" } +lwjgl3-opengles = { module = "org.lwjgl:lwjgl-opengles", version.ref = "lwjgl3" } +lwjgl3-egl = { module = "org.lwjgl:lwjgl-egl", version.ref = "lwjgl3" } +mokito-core = "org.mockito:mockito-core:5.23.0" +mokito-junit-jupiter = "org.mockito:mockito-junit-jupiter:5.23.0" +nifty = { module = "com.github.nifty-gui:nifty", version.ref = "nifty" } +nifty-default-controls = { module = "com.github.nifty-gui:nifty-default-controls", version.ref = "nifty" } +nifty-examples = { module = "com.github.nifty-gui:nifty-examples", version.ref = "nifty" } +nifty-style-black = { module = "com.github.nifty-gui:nifty-style-black", version.ref = "nifty" } +okhttp = { module = "com.squareup.okhttp3:okhttp", version.ref = "okhttp" } +slf4j-jdk14 = { module = "org.slf4j:slf4j-jdk14", version.ref = "slf4j" } +spotbugs-gradle-plugin = "com.github.spotbugs.snom:spotbugs-gradle-plugin:6.4.8" +vecmath = "javax.vecmath:vecmath:1.5.2" + +[bundles] + +# Bundles for NostrGameEngine libraries +saferalloc = ["saferalloc", "saferalloc-natives-linux-x8664", "saferalloc-natives-linux-aarch64", "saferalloc-natives-windows-x8664", "saferalloc-natives-windows-aarch64", "saferalloc-natives-macos-x8664", "saferalloc-natives-macos-aarch64", "saferalloc-natives-android"] [plugins] -spotless = { id = "com.diffplug.spotless", version.ref = "spotless" } -gradle-nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradle-nexus-publish" } + +# Build plugins +foojay-resolver = { id = "org.gradle.toolchains.foojay-resolver-convention", version.ref = "foojayResolver" } +gradle-nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradleNexusPublish" } +graalvm-native = { id = "org.graalvm.buildtools.native", version.ref = "graalvmNativePlugin" } +jacoco = { id = "jacoco", version.ref = "jacoco" } +nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version.ref = "gradleNexusPublish" } +spotbugs = { id = "com.github.spotbugs", version.ref = "spotbugsPlugin" } +spotless = { id = "com.diffplug.spotless", version.ref = "spotlessPlugin" } +teavm = { id = "org.teavm", version.ref = "teavm" } +test-retry = { id = "org.gradle.test-retry", version.ref = "gradleTestRetry" }