Update FG to v4 for compat

This commit is contained in:
JackCarterSmith 2024-03-09 16:32:02 +01:00
parent c15d2623e5
commit 8bfe6bda7f
Signed by: JackCarterSmith
GPG Key ID: 832E52F4E23F8F24
3 changed files with 94 additions and 65 deletions

View File

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

Binary file not shown.

View File

@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.3-bin.zip
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