Unusable FG4 with old deps, revert to FG2

This commit is contained in:
JackCarterSmith 2024-03-10 18:46:01 +01:00
parent 8bfe6bda7f
commit fbec0ad484
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
3 changed files with 87 additions and 120 deletions

View File

@ -1,12 +1,14 @@
buildscript { buildscript {
repositories { repositories {
jcenter()
mavenCentral() mavenCentral()
mavenLocal() mavenLocal()
maven { url = "https://maven.minecraftforge.net/" } maven { url = "https://maven.minecraftforge.net/" }
} }
dependencies { dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true classpath("com.anatawa12.forge:ForgeGradle:2.3-1.0.+") {
changing = true
}
classpath "org.jfrog.buildinfo:build-info-extractor-gradle:5.2.+"
} }
} }
@ -39,123 +41,88 @@ repositories {
} }
} }
apply plugin: 'net.minecraftforge.gradle' apply plugin: 'net.minecraftforge.gradle.forge'
// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
apply plugin: 'eclipse'
apply plugin: 'maven-publish'
ext.buildNumber = "0"
if (System.getenv("BUILD_NUMBER") != null) {
buildNumber = System.getenv("BUILD_NUMBER")
}
version = "$baseVersion.$buildNumber"
group = "fr.jackcartersmith.orbsat"
archivesBaseName = "OrbitalSatellite-$project.minecraftVersion"
ext.buildNumber = "0"
if (System.getenv("BUILD_NUMBER") != null) {
buildNumber = System.getenv("BUILD_NUMBER")
}
version = "$baseVersion.$buildNumber"
group = "fr.jackcartersmith.orbsat"
archivesBaseName = "OrbitalSatellite-$project.minecraftVersion"
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly. sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8' minecraft {
} version = "$project.minecraftVersion-$project.forgeVersion"
runDir = "eclipse"
minecraft {
// The mappings can be changed at any time, and must be in the following format. mappings = "stable_39"
// snapshot_YYYYMMDD Snapshot are built nightly. makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
// stable_# Stables are built at the discretion of the MCP team. }
// Use non-default mappings at your own risk. they may not always work.
// Simply re-run your setup task after changing the mappings to update your workspace. dependencies {
//mappings channel: 'snapshot', version: '20171003-1.12' // you may put jars on which you depend on in ./libs
mappings channel: 'stable', version: '39-1.12' // or you may define them like so..
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable. //compile "some.group:artifact:version:classifier"
//compile "some.group:artifact:version"
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
// real examples
// Default run configurations. //compile 'com.mod-buildcraft:buildcraft:6.0.8:dev' // adds buildcraft to the dev env
// These can be tweaked, removed, or duplicated as needed. //compile 'com.googlecode.efficient-java-matrix-library:ejml:0.24' // adds ejml to the dev env
runs {
client { // the 'provided' configuration is for optional dependencies that exist at compile-time but might not at runtime.
workingDirectory project.file('run') //provided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// Recommended logging data for a userdev environment // the deobf configurations: 'deobfCompile' and 'deobfProvided' are the same as the normal compile and provided,
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' // except that these dependencies get remapped to your current MCP mappings
//deobfCompile 'com.mod-buildcraft:buildcraft:6.0.8:dev'
// Recommended logging level for the console //deobfProvided 'com.mod-buildcraft:buildcraft:6.0.8:dev'
property 'forge.logging.console.level', 'debug'
} // for more info...
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html
server { // http://www.gradle.org/docs/current/userguide/dependency_management.html
workingDirectory project.file('run')
compile "mezz.jei:jei_1.12.2:4.10.+:api"
// Recommended logging data for a userdev environment deobfCompile "cofh:RedstoneFlux:1.12-2.1.0.7:deobf"
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP' compile "li.cil.oc:OpenComputers:MC1.12.2-1.7.+:api"
compile "mcp.mobius.waila:Hwyla:1.8.26-B41_1.12.2:api"
// Recommended logging level for the console compileOnly "net.industrial-craft:industrialcraft-2:2.8.+"
property 'forge.logging.console.level', 'debug' compileOnly 'baubles:Baubles:1.12:1.5.2'
} }
}
} task signJar(type: SignJar, dependsOn: reobfJar) {
onlyIf { // Skip the task if our secret data isn't available
// Include resources generated by data generators. project.hasProperty('keyStore')
sourceSets.main.resources { srcDir 'src/generated/resources' } }
dependsOn reobfJar
dependencies { if (project.hasProperty('keyStore')) { // This needs to be a path to the keystore file
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed keyStore = project.keyStore
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied. alias = project.keyStoreAlias
// The userdev artifact is a special name and will get all sorts of transformations applied to it. storePass = project.keyStorePass
minecraft 'net.minecraftforge:forge:1.12.2-14.23.5.2860' keyPass = project.keyStoreKeyPass
inputFile = jar.archivePath
implementation "mezz.jei:jei_1.12.2:4.10.+" outputFile = jar.archivePath
implementation fg.deobf("cofh:RedstoneFlux:1.12-2.1.1.1") }
implementation "li.cil.oc:OpenComputers:MC1.12.2-1.8.+" }
implementation "mcp.mobius.waila:Hwyla:1.8.26-B41_1.12.2" build.dependsOn signJar
//compileOnly 'industrial-craft:industrialcraft-2:release:ex112'//'net.industrial-craft:industrialcraft-2:2.8.+'
//compileOnly 'baubles:Baubles:1.12:1.5.2' // old dependencies management processResources {
//minecraftLibrary 'baubles:Baubles:1.12:1.5.2' // this will ensure that this task is redone when the versions change.
} inputs.property "version", project.version
inputs.property "mcversion", project.minecraft.version
// Example for how to get properties into the manifest for reading by the runtime..
jar { // replace stuff in mcmod.info, nothing else
manifest { from(sourceSets.main.resources.srcDirs) {
attributes([ include "mcmod.info"
"Specification-Title": "examplemod",
"Specification-Vendor": "examplemodsareus", // replace version and mcversion
"Specification-Version": "1", // We are version 1 of ourselves expand "version": project.version, "mcversion": "1.12.2"
"Implementation-Title": project.name, }
"Implementation-Version": "${version}",
"Implementation-Vendor" :"examplemodsareus", // copy everything else, thats not the mcmod.info
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") from(sourceSets.main.resources.srcDirs) {
]) exclude "mcmod.info"
}
}
// Example configuration to allow publishing using the maven-publish task
// This is the preferred method to reobfuscate your jar file
jar.finalizedBy('reobfJar')
// However if you are in a multi-project build, dev time needs unobfed jar files, so you can delay the obfuscation until publishing by doing
//publish.dependsOn('reobfJar')
// workaround for userdev bug
tasks.create("copyResourceToClasses", Copy.class) {
tasks.classes.dependsOn(it)
dependsOn(tasks.processResources)
onlyIf { gradle.taskGraph.hasTask(tasks.prepareRuns) }
into("$buildDir/classes/java/main")
// if you write @Mod class in kotlin, please use code below
// into("$buildDir/classes/kotlin/main")
from(tasks.processResources.destinationDir)
}
publishing {
publications {
mavenJava(MavenPublication) {
artifact jar
}
}
repositories {
maven {
url "file:///${project.projectDir}/mcmodsrepo"
}
} }
} }

View File

@ -4,4 +4,4 @@ baseVersion=1.0
minecraftVersion=1.12.2 minecraftVersion=1.12.2
forgeVersion=14.23.5.2847 forgeVersion=14.23.5.2847
org.gradle.jvmargs=-Xmx4G org.gradle.jvmargs=-Xmx4G
org.gradle.daemon=false

View File

@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip