Files
Amethyst-Android/forge_installer/build.gradle
alexytomi beeb8b5cb9 fix: version files for components now reproducable
Hash the jar (which is now reproducable) and use that for version file
Also made it so it is no longer dependent on `pwd` being the root
project.

Should fix part of the issues this has on compiling in android (termux /
Android Code Studio)
2026-03-10 18:47:23 +08:00

34 lines
1.0 KiB
Groovy

plugins {
id 'java-library'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
dependencies {
implementation 'org.json:json:20230618'
}
jar {
destinationDirectory.set(file("../app_pojavlauncher/src/main/assets/components/forge_installer/"))
manifest {
attributes("Manifest-Version": "1.0",
"PreMain-Class": "git.artdeell.installer_agent.Agent")
}
from {
configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) }
}
// Makes the jar reproducible so the version file actually is a version file
preserveFileTimestamps = false
reproducibleFileOrder = true
// Write version file
def versionFile = new File(project(":app_pojavlauncher").projectDir, "src/main/assets/components/forge_installer/version")
def jarFile = archiveFile.get().asFile
doLast {
writeVersionFile(jarFile, versionFile)
}
outputs.file(versionFile) // Adds the versionFile to outputs
}