mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-08-03 23:56:52 -04:00
Downgrade zink + some other fixes (#6752)
* [Actions]: Remove private token and use public release (#6742) * Feat[zink]: Downgrade to Mesa 23.0.4 from Questcraft This reverts commit f88fb3c61ad1fca4a3b0f719464abe2e40a29b48. Mali devices are severely screwed over by this change. * [Misc]: Make reading custom_env.txt better This makes it override anything that could be set by the launcher, which is the point. Also it looks cleaner imo. * [Misc]: Turn component version file into commit hash of project folder I'm really annoyed at how the version file keeps changing and it seems dumb * fix(actions): Upgrade workflow Java version from 8 to 21 Using 8 is causing some really weird unreproducable shitfuckery that is likely related to caches. Co-authored-by: ItsWinterBush <154499206+ItsWinterBush26@users.noreply.github.com> * enhancement(build): Explicitly clone submodules recursively * fix(build): Update Gradle to 8.13 This is to fix `aar-metadata.properties (No such file or directory)` See https://github.com/leancodepl/patrol/issues/2181 for similar issue * enhancement(build): Add git checks to prevent build errors --------- Co-authored-by: ItsWinterBush <154499206+ItsWinterBush26@users.noreply.github.com>
This commit is contained in:
parent
b239d06745
commit
98947f23d3
8
.github/workflows/android.yml
vendored
8
.github/workflows/android.yml
vendored
@ -18,13 +18,15 @@ jobs:
|
|||||||
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
|
CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: "recursive"
|
||||||
|
|
||||||
- name: Set up JDK 8
|
- name: Set up JDK 21
|
||||||
uses: actions/setup-java@v3
|
uses: actions/setup-java@v3
|
||||||
with:
|
with:
|
||||||
distribution: 'temurin'
|
distribution: 'temurin'
|
||||||
java-version: '8'
|
java-version: '21'
|
||||||
|
|
||||||
- name: Get LTW
|
- name: Get LTW
|
||||||
run: |
|
run: |
|
||||||
|
@ -1 +1 @@
|
|||||||
1738839797928
|
30ec1e2df80972e3eb89f61f9c0894f5926594ef
|
@ -1 +1 @@
|
|||||||
1738839797913
|
d5fc862f0eba62565dee5b8e511544573c281ec1
|
@ -1 +1 @@
|
|||||||
1738839797921
|
4903cfc8d3afd63918f59caf0a146efc2d837069
|
@ -223,18 +223,6 @@ public class JREUtils {
|
|||||||
envMap.put("AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth > 0 ? CallbackBridge.windowWidth : CallbackBridge.physicalWidth));
|
envMap.put("AWTSTUB_WIDTH", Integer.toString(CallbackBridge.windowWidth > 0 ? CallbackBridge.windowWidth : CallbackBridge.physicalWidth));
|
||||||
envMap.put("AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight > 0 ? CallbackBridge.windowHeight : CallbackBridge.physicalHeight));
|
envMap.put("AWTSTUB_HEIGHT", Integer.toString(CallbackBridge.windowHeight > 0 ? CallbackBridge.windowHeight : CallbackBridge.physicalHeight));
|
||||||
|
|
||||||
File customEnvFile = new File(Tools.DIR_GAME_HOME, "custom_env.txt");
|
|
||||||
if (customEnvFile.exists() && customEnvFile.isFile()) {
|
|
||||||
BufferedReader reader = new BufferedReader(new FileReader(customEnvFile));
|
|
||||||
String line;
|
|
||||||
while ((line = reader.readLine()) != null) {
|
|
||||||
// Not use split() as only split first one
|
|
||||||
int index = line.indexOf("=");
|
|
||||||
envMap.put(line.substring(0, index), line.substring(index + 1));
|
|
||||||
}
|
|
||||||
reader.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
GLInfoUtils.GLInfo info = GLInfoUtils.getGlInfo();
|
GLInfoUtils.GLInfo info = GLInfoUtils.getGlInfo();
|
||||||
if(!envMap.containsKey("LIBGL_ES") && LOCAL_RENDERER != null) {
|
if(!envMap.containsKey("LIBGL_ES") && LOCAL_RENDERER != null) {
|
||||||
int glesMajor = info.glesMajorVersion;
|
int glesMajor = info.glesMajorVersion;
|
||||||
@ -256,6 +244,8 @@ public class JREUtils {
|
|||||||
envMap.put("POJAV_LOAD_TURNIP", "1");
|
envMap.put("POJAV_LOAD_TURNIP", "1");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
readCustomEnv(envMap); // Must be last so it overrides anything the user sets for obvious reasons.
|
||||||
|
|
||||||
for (Map.Entry<String, String> env : envMap.entrySet()) {
|
for (Map.Entry<String, String> env : envMap.entrySet()) {
|
||||||
Logger.appendToLog("Added custom env: " + env.getKey() + "=" + env.getValue());
|
Logger.appendToLog("Added custom env: " + env.getKey() + "=" + env.getValue());
|
||||||
try {
|
try {
|
||||||
@ -274,6 +264,19 @@ public class JREUtils {
|
|||||||
// return ldLibraryPath;
|
// return ldLibraryPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static void readCustomEnv(Map<String, String> envMap) throws IOException {
|
||||||
|
File customEnvFile = new File(Tools.DIR_GAME_HOME, "custom_env.txt");
|
||||||
|
if (customEnvFile.exists() && customEnvFile.isFile()) {
|
||||||
|
BufferedReader reader = new BufferedReader(new FileReader(customEnvFile));
|
||||||
|
String line;
|
||||||
|
while ((line = reader.readLine()) != null) {
|
||||||
|
// Not use split() as only split first one
|
||||||
|
int index = line.indexOf("=");
|
||||||
|
envMap.put(line.substring(0, index), line.substring(index + 1));
|
||||||
|
}
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
public static void launchJavaVM(final AppCompatActivity activity, final Runtime runtime, File gameDirectory, final List<String> JVMArgs, final String userArgsString) throws Throwable {
|
public static void launchJavaVM(final AppCompatActivity activity, final Runtime runtime, File gameDirectory, final List<String> JVMArgs, final String userArgsString) throws Throwable {
|
||||||
String runtimeHome = MultiRTUtils.getRuntimeHome(runtime.name).getAbsolutePath();
|
String runtimeHome = MultiRTUtils.getRuntimeHome(runtime.name).getAbsolutePath();
|
||||||
|
|
||||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -6,12 +6,15 @@ java {
|
|||||||
sourceCompatibility = JavaVersion.VERSION_1_8
|
sourceCompatibility = JavaVersion.VERSION_1_8
|
||||||
targetCompatibility = JavaVersion.VERSION_1_8
|
targetCompatibility = JavaVersion.VERSION_1_8
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
jar {
|
||||||
manifest {
|
manifest {
|
||||||
attributes("Manifest-Version": "1.0",
|
attributes("Manifest-Version": "1.0",
|
||||||
"PreMain-Class": "git.artdeell.arcdns.ArcDNSInjectorAgent")
|
"PreMain-Class": "git.artdeell.arcdns.ArcDNSInjectorAgent")
|
||||||
}
|
}
|
||||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/version")
|
if (gitUsed){
|
||||||
versionFile.write(String.valueOf(new Date().getTime()))
|
File versionFile = file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/version")
|
||||||
|
versionFile.write(getGitHash(project.name))
|
||||||
|
}
|
||||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/"))
|
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/arc_dns_injector/"))
|
||||||
}
|
}
|
||||||
|
32
build.gradle
32
build.gradle
@ -1 +1,33 @@
|
|||||||
|
import java.io.IOException
|
||||||
|
plugins{
|
||||||
|
id 'com.android.application' version '8.7.2' apply false
|
||||||
|
id 'com.android.library' version '8.7.2' apply false
|
||||||
|
}
|
||||||
|
|
||||||
|
String getGitHash(String project) {
|
||||||
|
def command = Runtime.getRuntime().exec("git rev-list -1 HEAD " + project)
|
||||||
|
def returnCode = command.waitFor()
|
||||||
|
if (returnCode != 0) {
|
||||||
|
throw new IOException("Command 'getGitHash()' exited with " + returnCode)
|
||||||
|
}
|
||||||
|
String gitCommitHash = command.inputStream.text.trim()
|
||||||
|
return gitCommitHash
|
||||||
|
}
|
||||||
|
|
||||||
|
Boolean gitUsed() {
|
||||||
|
def returnCode = Runtime.getRuntime().exec("git rev-parse --is-inside-work-tree").waitFor()
|
||||||
|
switch(returnCode){
|
||||||
|
case 127:
|
||||||
|
println("git not found");
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case 128:
|
||||||
|
println("not inside a git repository");
|
||||||
|
return false;
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
return true;
|
||||||
|
default:
|
||||||
|
throw new IOException("Command 'gitUsed()' exited with " + returnCode)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -15,11 +15,13 @@ jar {
|
|||||||
from {
|
from {
|
||||||
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
}
|
}
|
||||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/forge_installer/version")
|
if (gitUsed){
|
||||||
versionFile.write(String.valueOf(new Date().getTime()))
|
File versionFile = file("../app_pojavlauncher/src/main/assets/components/forge_installer/version")
|
||||||
|
versionFile.write(getGitHash(project.name))
|
||||||
|
}
|
||||||
manifest {
|
manifest {
|
||||||
attributes("Manifest-Version": "1.0",
|
attributes("Manifest-Version": "1.0",
|
||||||
"PreMain-Class": "git.artdeell.installer_agent.Agent")
|
"PreMain-Class": "git.artdeell.installer_agent.Agent")
|
||||||
}
|
}
|
||||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/forge_installer/"))
|
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/forge_installer/"))
|
||||||
}
|
}
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,7 +1,7 @@
|
|||||||
#Fri Dec 06 21:56:04 CET 2024
|
#Fri Dec 06 21:56:04 CET 2024
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
@ -10,9 +10,10 @@ jar {
|
|||||||
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
archiveBaseName = "lwjgl-glfw-classes"
|
archiveBaseName = "lwjgl-glfw-classes"
|
||||||
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/lwjgl3/"))
|
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/lwjgl3/"))
|
||||||
// Auto update the version with a timestamp so the project jar gets updated by Pojav
|
if (gitUsed){
|
||||||
File versionFile = file("../app_pojavlauncher/src/main/assets/components/lwjgl3/version")
|
File versionFile = file("../app_pojavlauncher/src/main/assets/components/lwjgl3/version")
|
||||||
versionFile.write(String.valueOf(new Date().getTime()))
|
versionFile.write(getGitHash(project.name))
|
||||||
|
}
|
||||||
from {
|
from {
|
||||||
configurations.default.collect {
|
configurations.default.collect {
|
||||||
println(it.getName())
|
println(it.getName())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user