Skip to content

Commit

Permalink
Rename package to jnigen to avoid pakcage conflict with gdx.util
Browse files Browse the repository at this point in the history
Add deployment under new artifact ids so we can test this workflow
  • Loading branch information
Tom-Ski committed Apr 16, 2024
1 parent 1ea7e74 commit 7461f24
Show file tree
Hide file tree
Showing 18 changed files with 522 additions and 463 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/deploy-package-rename.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Build and deploy package rename

on:
push:
branches: [ package-rename ]
release:
types: [ published ]

env:
GRADLE_USER_HOME: .gradle

jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: 'recursive'
- uses: actions/cache@v2
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: ./gradlew build
- name: Upload all output libs
uses: actions/upload-artifact@v2.1.4
with:
name: output-libs
path: "*/build/libs"

- name: Snapshot build deploy
if: github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository_owner == 'libgdx'
run: ./gradlew build publish
env:
ORG_GRADLE_PROJECT_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}

- name: Import GPG key
if: github.event_name == 'release' && github.repository_owner == 'libgdx'
id: import_gpg
uses: crazy-max/ghaction-import-gpg@1c6a9e9d3594f2d743f1b1dd7669ab0dfdffa922
with:
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
- name: Release build deploy
if: github.event_name == 'release' && github.repository_owner == 'libgdx'
run: ./gradlew build publish -PRELEASE -Psigning.gnupg.keyId=${{ secrets.GPG_KEYID }} -Psigning.gnupg.passphrase=${{ secrets.GPG_PASSPHRASE }} -Psigning.gnupg.keyName=${{ secrets.GPG_KEYID }}
env:
ORG_GRADLE_PROJECT_NEXUS_USERNAME: ${{ secrets.NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
2 changes: 2 additions & 0 deletions gdx-jnigen-gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ plugins {
id 'java-gradle-plugin'
}

archivesBaseName = "jnigen-runtime-gradle"

dependencies {
implementation project(":gdx-jnigen")
implementation gradleApi()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.function.Predicate;

import javax.inject.Inject;
Expand All @@ -19,8 +18,8 @@
import org.slf4j.LoggerFactory;

import com.badlogic.gdx.jnigen.BuildTarget;
import com.badlogic.gdx.utils.Architecture;
import com.badlogic.gdx.utils.Os;
import com.badlogic.gdx.jnigen.Architecture;
import com.badlogic.gdx.jnigen.Os;

/**
* @author Desu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.w3c.dom.Element;

import com.badlogic.gdx.jnigen.BuildTarget;
import com.badlogic.gdx.utils.Os;
import com.badlogic.gdx.jnigen.Os;
import com.badlogic.gdx.jnigen.gradle.JnigenExtension.RoboVMXml.RoboVMXmlLib;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.io.File;

import com.badlogic.gdx.jnigen.BuildTarget;
import com.badlogic.gdx.utils.Os;
import com.badlogic.gdx.jnigen.Os;

public class JnigenIOSJarTask extends JnigenJarTask {
public JnigenIOSJarTask() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import org.gradle.api.tasks.bundling.Jar;

import com.badlogic.gdx.jnigen.BuildTarget;
import com.badlogic.gdx.utils.Os;
import com.badlogic.gdx.jnigen.Os;

/**
* @author Desu
Expand Down
3 changes: 3 additions & 0 deletions gdx-jnigen-loader/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
archivesBaseName = "jnigen-runtime-loader"

sourceCompatibility = 1.7
targetCompatibility = 1.7


eclipse {
project {
name = "gdx-jnigen-loader"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
package com.badlogic.gdx.utils;

public enum Architecture {
x86, ARM, RISCV,LOONGARCH;

public String toSuffix() {
if (this == x86) return "";
else return this.name().toLowerCase();
}

public enum Bitness {
_32, _64, _128;

public String toSuffix() {
if (this == _32) return "";
else return this.name().substring(1);
}
}
}
package com.badlogic.gdx.jnigen;

public enum Architecture {
x86, ARM, RISCV,LOONGARCH;

public String toSuffix() {
if (this == x86) return "";
else return this.name().toLowerCase();
}

public enum Bitness {
_32, _64, _128;

public String toSuffix() {
if (this == _32) return "";
else return this.name().substring(1);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
package com.badlogic.gdx.utils;

/** The target operating system of a build target. */
public enum Os {
Windows, Linux, MacOsX, Android, IOS;

public String getJniPlatform () {
if (this == Os.Windows) return "win32";
if (this == Os.Linux) return "linux";
if (this == Os.MacOsX) return "mac";
return "";
}

public String getLibPrefix () {
if (this == Os.Linux || this == Os.Android || this == Os.MacOsX) {
return "lib";
}
return "";
}

public String getLibExtension () {
if (this == Os.Windows) return "dll";
if (this == Os.Linux) return "so";
if (this == Os.MacOsX) return "dylib";
return "";
}
}
package com.badlogic.gdx.jnigen;

/** The target operating system of a build target. */
public enum Os {
Windows, Linux, MacOsX, Android, IOS;

public String getJniPlatform () {
if (this == Os.Windows) return "win32";
if (this == Os.Linux) return "linux";
if (this == Os.MacOsX) return "mac";
return "";
}

public String getLibPrefix () {
if (this == Os.Linux || this == Os.Android || this == Os.MacOsX) {
return "lib";
}
return "";
}

public String getLibExtension () {
if (this == Os.Windows) return "dll";
if (this == Os.Linux) return "so";
if (this == Os.MacOsX) return "dylib";
return "";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
******************************************************************************/

package com.badlogic.gdx.utils;
package com.badlogic.gdx.jnigen;

/** Typed runtime exception used in jnigen's SharedLibraryLoader
*
Expand Down
Loading

0 comments on commit 7461f24

Please sign in to comment.