mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-11 16:26:22 +00:00
update to SDK 35 (Android 15), update versionString
This commit is contained in:
6
.github/workflows/publish-android.yml
vendored
6
.github/workflows/publish-android.yml
vendored
@@ -43,8 +43,8 @@ jobs:
|
|||||||
uses: maxim-lobanov/setup-android-tools@v1
|
uses: maxim-lobanov/setup-android-tools@v1
|
||||||
with:
|
with:
|
||||||
packages: |
|
packages: |
|
||||||
platforms;android-34
|
platforms;android-35
|
||||||
build-tools;34.0.0
|
build-tools;35.0.0
|
||||||
|
|
||||||
- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
|
- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
|
||||||
run: |
|
run: |
|
||||||
@@ -83,7 +83,7 @@ jobs:
|
|||||||
- name: Build/Install/Publish to GitHub Packages Apache Maven
|
- name: Build/Install/Publish to GitHub Packages Apache Maven
|
||||||
run: |
|
run: |
|
||||||
export _JAVA_OPTIONS="-Xmx2g"
|
export _JAVA_OPTIONS="-Xmx2g"
|
||||||
mvn -U -B -P android-release-build,android-release-upload install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=34.0.0 -Dmaven.test.skip=true
|
mvn -U -B -P android-release-build,android-release-upload install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=35.0.0 -Dmaven.test.skip=true
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
|||||||
6
.github/workflows/snapshots-android.yml
vendored
6
.github/workflows/snapshots-android.yml
vendored
@@ -46,8 +46,8 @@ jobs:
|
|||||||
- name: Set Up Android tools
|
- name: Set Up Android tools
|
||||||
run: |
|
run: |
|
||||||
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools"
|
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools"
|
||||||
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-33"
|
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-35"
|
||||||
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "build-tools;34.0.0"
|
JAVA_HOME=${JAVA_HOME_17_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "build-tools;35.0.0"
|
||||||
|
|
||||||
- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
|
- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
|
||||||
run: |
|
run: |
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
d=$(date +%m-%d)
|
d=$(date +%m-%d)
|
||||||
# Replace date in forge-gui-mobile/src/forge/Forge.java
|
# Replace date in forge-gui-mobile/src/forge/Forge.java
|
||||||
sed -i -e "s/-SNAPSHOT/-SNAPSHOT-${d}/g" forge-gui-mobile/src/forge/Forge.java
|
sed -i -e "s/-SNAPSHOT/-SNAPSHOT-${d}/g" forge-gui-mobile/src/forge/Forge.java
|
||||||
mvn -U -B -P android-release-build install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=34.0.0 -Dmaven.test.skip=true
|
mvn -U -B -P android-release-build install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=35.0.0 -Dmaven.test.skip=true
|
||||||
mkdir -p forge-gui-android/target/upload
|
mkdir -p forge-gui-android/target/upload
|
||||||
mv forge-gui-android/target/*-signed-aligned.apk forge-gui-android/target/upload/
|
mv forge-gui-android/target/*-signed-aligned.apk forge-gui-android/target/upload/
|
||||||
mv forge-gui-android/target/assets.zip forge-gui-android/target/upload/
|
mv forge-gui-android/target/assets.zip forge-gui-android/target/upload/
|
||||||
|
|||||||
@@ -83,12 +83,11 @@ Google no longer supports Android SDK releases for Eclipse. use IntelliJ.
|
|||||||
|
|
||||||
#### Android SDK
|
#### Android SDK
|
||||||
|
|
||||||
Reference SO for obtaining a specific release: https://stackoverflow.com/questions/27043522/where-can-i-download-an-older-version-of-the-android-sdk
|
TBD
|
||||||
|
|
||||||
##### Windows
|
##### Windows
|
||||||
|
|
||||||
Download the following archived version of the Android SDK: http://dl-ssl.google.com/android/repository/tools_r25.2.3-windows.zip. Install it somewhere on your machine. This is referenced
|
TBD
|
||||||
in the following instructions as your 'Android SDK Install' path.
|
|
||||||
|
|
||||||
##### Linux / Mac OSX
|
##### Linux / Mac OSX
|
||||||
|
|
||||||
@@ -102,8 +101,8 @@ TBD
|
|||||||
|
|
||||||
In Intellij, if the SDK Manager is not already running, go to Tools > Android > Android SDK Manager. Install the following options / versions:
|
In Intellij, if the SDK Manager is not already running, go to Tools > Android > Android SDK Manager. Install the following options / versions:
|
||||||
|
|
||||||
- Android SDK Build-tools 34.0.0
|
- Android SDK Build-tools 35.0.0
|
||||||
- Android 14 (API 34) SDK Platform
|
- Android 15 (API 35) SDK Platform
|
||||||
|
|
||||||
#### Proguard update
|
#### Proguard update
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<uses-sdk
|
<uses-sdk
|
||||||
android:minSdkVersion="26"
|
android:minSdkVersion="26"
|
||||||
android:targetSdkVersion="34" />
|
android:targetSdkVersion="35" />
|
||||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
|
||||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- This one needs Android Runtime Permission for Android 6+ -->
|
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- This one needs Android Runtime Permission for Android 6+ -->
|
||||||
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
|
||||||
|
|||||||
@@ -8,7 +8,8 @@
|
|||||||
<build.min.memory>-Xms1024m</build.min.memory>
|
<build.min.memory>-Xms1024m</build.min.memory>
|
||||||
<build.max.memory>-Xmx1536m</build.max.memory>
|
<build.max.memory>-Xmx1536m</build.max.memory>
|
||||||
<alpha-version>${revision}</alpha-version>
|
<alpha-version>${revision}</alpha-version>
|
||||||
<alpha-versionCode>2</alpha-versionCode>
|
<!-- the previous android:versionCode was 106650000, so it must be larger or it will not be installed -->
|
||||||
|
<alpha-versionCode>200000000</alpha-versionCode>
|
||||||
<sign.keystore>keystore</sign.keystore>
|
<sign.keystore>keystore</sign.keystore>
|
||||||
<sign.alias>alias</sign.alias>
|
<sign.alias>alias</sign.alias>
|
||||||
<sign.storepass>storepass</sign.storepass>
|
<sign.storepass>storepass</sign.storepass>
|
||||||
@@ -58,7 +59,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.robolectric</groupId>
|
<groupId>org.robolectric</groupId>
|
||||||
<artifactId>android-all</artifactId>
|
<artifactId>android-all</artifactId>
|
||||||
<version>14-robolectric-10818077</version>
|
<version>15-robolectric-12468137</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@@ -226,8 +227,8 @@
|
|||||||
<debug>true</debug>
|
<debug>true</debug>
|
||||||
</sign>
|
</sign>
|
||||||
<sdk>
|
<sdk>
|
||||||
<platform>34</platform>
|
<platform>35</platform>
|
||||||
<buildTools>34.0.0</buildTools>
|
<buildTools>35.0.0</buildTools>
|
||||||
</sdk>
|
</sdk>
|
||||||
<dexForceJumbo>true</dexForceJumbo>
|
<dexForceJumbo>true</dexForceJumbo>
|
||||||
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
|
<androidManifestFile>${project.basedir}/AndroidManifest.xml</androidManifestFile>
|
||||||
@@ -344,8 +345,8 @@
|
|||||||
<debug>false</debug>
|
<debug>false</debug>
|
||||||
</sign>
|
</sign>
|
||||||
<sdk>
|
<sdk>
|
||||||
<platform>34</platform>
|
<platform>35</platform>
|
||||||
<buildTools>34.0.0</buildTools>
|
<buildTools>35.0.0</buildTools>
|
||||||
</sdk>
|
</sdk>
|
||||||
<zipalign>
|
<zipalign>
|
||||||
<verbose>false</verbose>
|
<verbose>false</verbose>
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ActivityInfo;
|
import android.content.pm.ActivityInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
@@ -82,6 +83,7 @@ public class Main extends AndroidApplication {
|
|||||||
private View forgeLogo = null, forgeView = null, activeView = null;
|
private View forgeLogo = null, forgeView = null, activeView = null;
|
||||||
private ProgressBar progressBar;
|
private ProgressBar progressBar;
|
||||||
private TextView progressText;
|
private TextView progressText;
|
||||||
|
private String versionString;
|
||||||
|
|
||||||
private AndroidClipboard getAndroidClipboard() {
|
private AndroidClipboard getAndroidClipboard() {
|
||||||
if (androidClipboard == null)
|
if (androidClipboard == null)
|
||||||
@@ -132,6 +134,12 @@ public class Main extends AndroidApplication {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
try {
|
||||||
|
PackageInfo pInfo = getContext().getPackageManager().getPackageInfo(getContext().getPackageName(), 0);
|
||||||
|
versionString = pInfo.versionName;
|
||||||
|
} catch (Exception e) {
|
||||||
|
versionString = "0.0";
|
||||||
|
}
|
||||||
setContentView(getResources().getIdentifier("main", "layout", getPackageName()));
|
setContentView(getResources().getIdentifier("main", "layout", getPackageName()));
|
||||||
mShortAnimationDuration = getResources().getInteger(android.R.integer.config_shortAnimTime);
|
mShortAnimationDuration = getResources().getInteger(android.R.integer.config_shortAnimTime);
|
||||||
sharedPreferences = getPreferences(Context.MODE_PRIVATE);
|
sharedPreferences = getPreferences(Context.MODE_PRIVATE);
|
||||||
@@ -280,7 +288,7 @@ public class Main extends AndroidApplication {
|
|||||||
private void loadGame(final String title, final String steps, boolean isLandscape, AndroidAdapter adapter, boolean permissiongranted, int totalRAM, boolean isTabletDevice, AndroidApplicationConfiguration config, boolean exception, String msg) {
|
private void loadGame(final String title, final String steps, boolean isLandscape, AndroidAdapter adapter, boolean permissiongranted, int totalRAM, boolean isTabletDevice, AndroidApplicationConfiguration config, boolean exception, String msg) {
|
||||||
try {
|
try {
|
||||||
forgeLogo = findViewById(getResources().getIdentifier("logo_id", "id", getPackageName()));
|
forgeLogo = findViewById(getResources().getIdentifier("logo_id", "id", getPackageName()));
|
||||||
forgeView = initializeForView(Forge.getApp(getAndroidClipboard(), adapter, ASSETS_DIR, false, !isLandscape, totalRAM, isTabletDevice, Build.VERSION.SDK_INT, Build.VERSION.RELEASE, getDeviceName()), config);
|
forgeView = initializeForView(Forge.getApp(getAndroidClipboard(), adapter, ASSETS_DIR, false, !isLandscape, totalRAM, isTabletDevice, Build.VERSION.SDK_INT, Build.VERSION.RELEASE, getDeviceName(), versionString), config);
|
||||||
getAnimator(ObjectAnimator.ofFloat(forgeLogo, "alpha", 0f, 1f).setDuration(1800), null, new AnimatorListenerAdapter() {
|
getAnimator(ObjectAnimator.ofFloat(forgeLogo, "alpha", 0f, 1f).setDuration(1800), null, new AnimatorListenerAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void onAnimationEnd(Animator animation) {
|
public void onAnimationEnd(Animator animation) {
|
||||||
@@ -378,8 +386,9 @@ public class Main extends AndroidApplication {
|
|||||||
|
|
||||||
private AnimatorSet getAnimator(Animator play, Animator with, AnimatorListenerAdapter adapter) {
|
private AnimatorSet getAnimator(Animator play, Animator with, AnimatorListenerAdapter adapter) {
|
||||||
AnimatorSet animatorSet = new AnimatorSet();
|
AnimatorSet animatorSet = new AnimatorSet();
|
||||||
if (with != null)
|
if (with != null) {
|
||||||
animatorSet.play(play).with(with);
|
animatorSet.playTogether(play, with);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
animatorSet.play(play);
|
animatorSet.play(play);
|
||||||
animatorSet.addListener(adapter);
|
animatorSet.addListener(adapter);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import java.nio.file.Paths;
|
|||||||
|
|
||||||
public class GameLauncher {
|
public class GameLauncher {
|
||||||
public GameLauncher() {
|
public GameLauncher() {
|
||||||
|
String versionString = BuildInfo.getVersionString();
|
||||||
// Set this to "true" to make the mobile game port run as a full-screen desktop application
|
// Set this to "true" to make the mobile game port run as a full-screen desktop application
|
||||||
boolean desktopMode = true;//cmd.hasOption("fullscreen");
|
boolean desktopMode = true;//cmd.hasOption("fullscreen");
|
||||||
// Set this to the location where you want the mobile game port to look for assets when working as a full-screen desktop application
|
// Set this to the location where you want the mobile game port to look for assets when working as a full-screen desktop application
|
||||||
@@ -44,7 +45,7 @@ public class GameLauncher {
|
|||||||
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
|
Lwjgl3ApplicationConfiguration config = new Lwjgl3ApplicationConfiguration();
|
||||||
config.setResizable(false);
|
config.setResizable(false);
|
||||||
ApplicationListener start = Forge.getApp(new Lwjgl3Clipboard(), new Main.DesktopAdapter(switchOrientationFile),//todo get totalRAM && isTabletDevice
|
ApplicationListener start = Forge.getApp(new Lwjgl3Clipboard(), new Main.DesktopAdapter(switchOrientationFile),//todo get totalRAM && isTabletDevice
|
||||||
desktopMode ? desktopModeAssetsDir : assetsDir, false, false, 0, false, 0, "", "");
|
desktopMode ? desktopModeAssetsDir : assetsDir, false, false, 0, false, 0, "", "", versionString);
|
||||||
if (Config.instance().getSettingData().fullScreen) {
|
if (Config.instance().getSettingData().fullScreen) {
|
||||||
config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
|
config.setFullscreenMode(Lwjgl3ApplicationConfiguration.getDisplayMode());
|
||||||
config.setAutoIconify(true);
|
config.setAutoIconify(true);
|
||||||
@@ -52,7 +53,7 @@ public class GameLauncher {
|
|||||||
} else {
|
} else {
|
||||||
config.setWindowedMode(Config.instance().getSettingData().width, Config.instance().getSettingData().height);
|
config.setWindowedMode(Config.instance().getSettingData().width, Config.instance().getSettingData().height);
|
||||||
}
|
}
|
||||||
config.setTitle("Forge - " + BuildInfo.getVersionString());
|
config.setTitle("Forge - " + versionString);
|
||||||
config.setWindowListener(new Lwjgl3WindowAdapter() {
|
config.setWindowListener(new Lwjgl3WindowAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public boolean closeRequested() {
|
public boolean closeRequested() {
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ import java.nio.file.Paths;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
public class Forge implements ApplicationListener {
|
public class Forge implements ApplicationListener {
|
||||||
public static final String CURRENT_VERSION = "1.6.65-SNAPSHOT";
|
public static String CURRENT_VERSION = "0.0";
|
||||||
|
|
||||||
private static ApplicationListener app = null;
|
private static ApplicationListener app = null;
|
||||||
static Scene currentScene = null;
|
static Scene currentScene = null;
|
||||||
@@ -127,20 +127,23 @@ public class Forge implements ApplicationListener {
|
|||||||
public static boolean createNewAdventureMap = false;
|
public static boolean createNewAdventureMap = false;
|
||||||
private static Localizer localizer;
|
private static Localizer localizer;
|
||||||
|
|
||||||
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean value, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName) {
|
public static ApplicationListener getApp(Clipboard clipboard0, IDeviceAdapter deviceAdapter0, String assetDir0, boolean propertyConfig, boolean androidOrientation, int totalRAM, boolean isTablet, int AndroidAPI, String AndroidRelease, String deviceName, String versionString) {
|
||||||
app = new Forge();
|
if (app == null) {
|
||||||
if (GuiBase.getInterface() == null) {
|
app = new Forge();
|
||||||
clipboard = clipboard0;
|
if (GuiBase.getInterface() == null) {
|
||||||
deviceAdapter = deviceAdapter0;
|
CURRENT_VERSION = versionString;
|
||||||
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint
|
clipboard = clipboard0;
|
||||||
GuiBase.setInterface(new GuiMobile(assetDir0));
|
deviceAdapter = deviceAdapter0;
|
||||||
GuiBase.enablePropertyConfig(value);
|
GuiBase.setUsingAppDirectory(assetDir0.contains("forge.app")); //obb directory on android uses the package name as entrypoint
|
||||||
isPortraitMode = androidOrientation;
|
GuiBase.setInterface(new GuiMobile(assetDir0));
|
||||||
totalDeviceRAM = totalRAM;
|
GuiBase.enablePropertyConfig(propertyConfig);
|
||||||
isTabletDevice = isTablet;
|
isPortraitMode = androidOrientation;
|
||||||
androidVersion = AndroidAPI;
|
totalDeviceRAM = totalRAM;
|
||||||
|
isTabletDevice = isTablet;
|
||||||
|
androidVersion = AndroidAPI;
|
||||||
|
}
|
||||||
|
GuiBase.setDeviceInfo(deviceName, AndroidRelease, AndroidAPI, totalRAM);
|
||||||
}
|
}
|
||||||
GuiBase.setDeviceInfo(deviceName, AndroidRelease, AndroidAPI, totalRAM);
|
|
||||||
return app;
|
return app;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ This file contains the current build notes for Forge.
|
|||||||
-- Compiling Forge for Android: Pre-requisites --
|
-- Compiling Forge for Android: Pre-requisites --
|
||||||
When compiling Forge for Android, make sure the following prerequisites are met:
|
When compiling Forge for Android, make sure the following prerequisites are met:
|
||||||
Java 17, either Oracle or OpenJDK.
|
Java 17, either Oracle or OpenJDK.
|
||||||
Android SDK 34
|
Android SDK 35
|
||||||
Android Build-Tools 34 (this is important, build-tools 33 and below do not work with Java 17)
|
Android Build-Tools 35.0.0 (this is important, build-tools 33 and below do not work with Java 17)
|
||||||
Proguard 7.5.0 (proguard.jar included under "forge-gui-android/tools").
|
Proguard 7.6.0 (proguard.jar included under "forge-gui-android/tools").
|
||||||
|
|||||||
Reference in New Issue
Block a user