Preliminary gradle fixing. Have I ever mentioned that I think Gradle is rubbish?

This commit is contained in:
Adubbz 2019-01-07 17:13:56 +11:00
parent 58f076007a
commit 57ac719093
5 changed files with 66 additions and 47 deletions

1
.gitignore vendored
View File

@ -18,3 +18,4 @@
*.ipr *.ipr
*.iws *.iws
*.launch

View File

@ -1,22 +1,22 @@
buildscript { buildscript {
repositories { repositories {
mavenLocal()
maven { url = 'https://files.minecraftforge.net/maven' }
jcenter() jcenter()
maven { mavenCentral()
name = "forge"
url = "http://files.minecraftforge.net/maven"
}
} }
dependencies { dependencies {
classpath 'net.minecraftforge.gradle:ForgeGradle:2.3-SNAPSHOT' classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '3.+', changing: true
} }
} }
plugins { /*plugins {
id "com.matthewprenger.cursegradle" version "1.0.9" id "com.matthewprenger.cursegradle" version "1.1.2"
} }*/
apply plugin: 'net.minecraftforge.gradle.forge' apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'maven' apply plugin: 'maven'
apply plugin: 'eclipse'
// define the properties file // define the properties file
ext.configFile = file "build.properties" ext.configFile = file "build.properties"
@ -29,26 +29,54 @@ configFile.withReader {
} }
group = "com.github.glitchfiend.biomesoplenty" group = "com.github.glitchfiend.biomesoplenty"
// why set the version twice?
version = config.mod_version
archivesBaseName = "BiomesOPlenty" archivesBaseName = "BiomesOPlenty"
// add some stuff to the version // add some stuff to the version
version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}" version = "${config.minecraft_version}-${config.mod_version}.${System.getenv().BUILD_NUMBER}"
// set this for the version.properties file, or was this broken on purpose?
config.build_number = (System.getenv().BUILD_NUMBER) ? System.getenv().BUILD_NUMBER : "" config.build_number = (System.getenv().BUILD_NUMBER) ? System.getenv().BUILD_NUMBER : ""
sourceCompatibility = targetCompatibility = '1.8' // Need this here so eclipse task generates correctly.
compileJava {
sourceCompatibility = targetCompatibility = '1.8'
}
minecraft { minecraft {
version = config.minecraft_version + "-" + config.forge_version // grab latest forge mappings channel: 'snapshot', version: config.mappings_version
useDepAts = true
mappings = project.config.mappings_version // default run configurations.
//gradle complains if this isn't set when setting up/using IDEA workspace // these can be tweaked, removed, or duplicated as needed.
runDir = "run" runConfig {
//set a full version string with appended build number to be used in mod registration name= "Minecraft Client"
def buildnum = (config.build_number!="") ? '.' + config.build_number : "" main= "net.minecraftforge.userdev.UserdevLauncher"
replace '@MOD_VERSION@', config.mod_version + buildnum ideaModuleName = "${project.name}_main"
replace '1.0.0.0', config.forge_version workingDirectory = project.file("run").canonicalPath
replaceIn 'BiomesOPlenty.java' environment "target", "fmluserdevclient"
environment "assetDirectory", downloadAssets.output.absolutePath
environment "FORGE_VERSION", config.forge_version
environment "FORGE_GROUP", config.forge_group
environment "MCP_VERSION", config.mappings_version
environment "MC_VERSION", config.minecraft_version
environment "MOD_CLASSES", "${sourceSets.main.output.resourcesDir}${File.pathSeparator}${sourceSets.main.output.classesDirs.join(File.pathSeparator)}"
}
runConfig {
name= "Minecraft Server"
main= "net.minecraftforge.userdev.UserdevLauncher"
ideaModuleName = "${project.name}_main"
workingDirectory = project.file("run").canonicalPath
environment "target", "fmluserdevserver"
environment "assetDirectory", downloadAssets.output.absolutePath
environment "FORGE_VERSION", config.forge_version
environment "FORGE_GROUP", config.forge_group
environment "MCP_VERSION", config.mappings_version
environment "MC_VERSION", config.minecraft_version
environment "MOD_CLASSES", "${sourceSets.main.output.resourcesDir}${File.pathSeparator}${sourceSets.main.output.classesDirs.join(File.pathSeparator)}"
}
}
dependencies {
minecraft 'net.minecraftforge.test:userdev:' + config.minecraft_version + '-' + config.forge_version
compile 'net.minecraftforge.test:forge:' + config.minecraft_version + '-' + config.forge_version + ':launcher'
} }
def commonManifest = { def commonManifest = {
@ -80,22 +108,6 @@ processResources {
} }
} }
import groovy.io.FileType
task changelog(type: JenkinsChangelog) {
def buildNumber = "${System.getenv().BUILD_NUMBER}"
serverRoot = 'http://ci.jenkins.minecraftforge.net/'
jobName = 'BiomesOPlenty'
authName = 'console_script'
authPassword = 'dc6d48ca20a474beeac280a9a16a926e'
targetBuild = buildNumber.toString()
output = 'build/libs/' + project.getName() + '-' + project.version + '-changelog.txt'
}
tasks.build.dependsOn('changelog')
task sourcesJar(type: Jar) { task sourcesJar(type: Jar) {
from sourceSets.main.allJava from sourceSets.main.allJava
from (sourceSets.main.output) { from (sourceSets.main.output) {
@ -149,20 +161,19 @@ task listOutputs << {
tasks.build.finalizedBy('listOutputs') tasks.build.finalizedBy('listOutputs')
artifacts { artifacts {
archives changelog.output
archives sourcesJar archives sourcesJar
archives deobfJar archives deobfJar
archives apiJar archives apiJar
} }
curseforge { /*curseforge {
apiKey = "$System.env.curse_api_key" apiKey = "$System.env.curse_api_key"
project { project {
id = '220318' id = '220318'
changelog = file('build/libs/' + project.getName() + '-' + project.version + '-changelog.txt') changelog = file('build/libs/' + project.getName() + '-' + project.version + '-changelog.txt')
releaseType = 'beta' releaseType = 'beta'
} }
} }*/
uploadArchives { uploadArchives {
repositories { repositories {

View File

@ -1,4 +1,12 @@
minecraft_version=1.12.2 # Sets default memory used for gradle commands. Can be overridden by user or command line properties.
forge_version=14.23.5.2768 # This is required to provide enough memory for the Minecraft decompilation process.
mod_version=7.0.1 org.gradle.jvmargs=-Xmx3G
mappings_version=snapshot_nodoc_20171031
mod_version=8.0.0
minecraft_version=1.13
minecraft_version_toml=13
forge_version=24.0.55-1.13-pre
forge_version_toml=24
forge_group=net.minecraftforge.test
mappings_version=20181221-1.13.1

Binary file not shown.

View File

@ -1,6 +1,5 @@
#Thu Nov 17 11:57:30 EST 2016
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-2.9-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip