Migrate to ForgeGradle-4.x
This commit is contained in:
parent
30f63e794e
commit
7c474f872c
25
build.gradle
25
build.gradle
@ -1,10 +1,10 @@
|
|||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven { url = 'https://maven.minecraftforge.net/' }
|
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
|
maven { url = "https://maven.minecraftforge.net/" }
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'net.minecraftforge.gradle:ForgeGradle:3.+'
|
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '4.1.+', changing: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -18,6 +18,9 @@ group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming
|
|||||||
archivesBaseName = 'modid'
|
archivesBaseName = 'modid'
|
||||||
|
|
||||||
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 {
|
minecraft {
|
||||||
// The mappings can be changed at any time, and must be in the following format.
|
// The mappings can be changed at any time, and must be in the following format.
|
||||||
@ -26,7 +29,7 @@ minecraft {
|
|||||||
// Use non-default mappings at your own risk. they may not always work.
|
// 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.
|
// Simply re-run your setup task after changing the mappings to update your workspace.
|
||||||
//mappings channel: 'snapshot', version: '20171003-1.12'
|
//mappings channel: 'snapshot', version: '20171003-1.12'
|
||||||
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.
|
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
|
||||||
|
|
||||||
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
// accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
@ -45,6 +48,7 @@ minecraft {
|
|||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
|
workingDirectory project.file('run')
|
||||||
|
|
||||||
// Recommended logging data for a userdev environment
|
// Recommended logging data for a userdev environment
|
||||||
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
|
||||||
@ -55,6 +59,9 @@ minecraft {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Include resources generated by data generators.
|
||||||
|
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
// Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
|
||||||
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
// that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
|
||||||
@ -102,6 +109,18 @@ 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
|
// 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')
|
//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 {
|
publishing {
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
|
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@ -1,5 +1,6 @@
|
|||||||
|
#Mon Sep 14 12:28:28 PDT 2015
|
||||||
distributionBase=GRADLE_USER_HOME
|
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-4.9-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.1-bin.zip
|
||||||
|
Loading…
x
Reference in New Issue
Block a user