mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-03-04 06:44:40 +01:00
clean up buildscripts
This commit is contained in:
parent
4a465ad24b
commit
c4facc4bf4
5 changed files with 158 additions and 156 deletions
236
build.gradle
236
build.gradle
|
@ -1,31 +1,28 @@
|
||||||
buildscript {
|
|
||||||
repositories {
|
|
||||||
maven { url = 'https://maven.minecraftforge.net' }
|
|
||||||
mavenCentral()
|
|
||||||
jcenter()
|
|
||||||
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
|
||||||
maven { url = 'https://maven.parchmentmc.org' }
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
classpath "net.minecraftforge.gradle:ForgeGradle:${forgegradle_version}"
|
|
||||||
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
|
|
||||||
classpath "org.parchmentmc:librarian:${librarian_version}"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
|
id 'idea'
|
||||||
|
id 'eclipse'
|
||||||
|
id 'maven-publish'
|
||||||
|
|
||||||
|
id 'net.minecraftforge.gradle' version "${forgegradle_version}"
|
||||||
|
id 'org.spongepowered.mixin' version "${mixingradle_version}"
|
||||||
|
id 'org.parchmentmc.librarian.forgegradle' version "${librarian_version}"
|
||||||
|
|
||||||
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
|
||||||
}
|
}
|
||||||
apply plugin: 'net.minecraftforge.gradle'
|
|
||||||
apply plugin: 'org.parchmentmc.librarian.forgegradle'
|
apply from: './gradle/java.gradle'
|
||||||
apply plugin: 'eclipse'
|
|
||||||
apply plugin: 'maven-publish'
|
|
||||||
apply plugin: 'org.spongepowered.mixin'
|
|
||||||
apply plugin: 'idea'
|
|
||||||
|
|
||||||
jarJar.enable()
|
jarJar.enable()
|
||||||
|
|
||||||
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
|
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false')
|
||||||
|
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
||||||
|
|
||||||
|
base {
|
||||||
|
archivesName = "create-${artifact_minecraft_version}"
|
||||||
|
group = 'com.simibubi.create'
|
||||||
|
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
|
||||||
|
}
|
||||||
|
|
||||||
// jozu: I use a gradle workspace with both projects.
|
// jozu: I use a gradle workspace with both projects.
|
||||||
// The project is named Flywheel-Forge, but sub-projects are named by folder.
|
// The project is named Flywheel-Forge, but sub-projects are named by folder.
|
||||||
boolean flywheelInWorkspace = findProject(':Flywheel') != null
|
boolean flywheelInWorkspace = findProject(':Flywheel') != null
|
||||||
|
@ -42,55 +39,58 @@ if (ponderInWorkspace) {
|
||||||
evaluationDependsOn(":Ponder")
|
evaluationDependsOn(":Ponder")
|
||||||
}
|
}
|
||||||
|
|
||||||
ext.buildNumber = System.getenv('BUILD_NUMBER')
|
project.logger.lifecycle("MultiModWorkspace ${inMultiModWorkspace || flywheelInWorkspace ? 'enabled' : 'disabled'} for project ${project.name}.")
|
||||||
|
project.logger.lifecycle("Dependencies included in Workspace: [Flywheel: ${flywheelInWorkspace}], [Catnip: ${catnipInWorkspace}], [Ponder: ${ponderInWorkspace}]")
|
||||||
|
|
||||||
group = 'com.simibubi.create'
|
mixin {
|
||||||
archivesBaseName = "create-${artifact_minecraft_version}"
|
add sourceSets.main, 'create.refmap.json'
|
||||||
version = mod_version + (dev && buildNumber != null ? "-${buildNumber}" : '')
|
|
||||||
|
|
||||||
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
config 'create.mixins.json'
|
||||||
|
}
|
||||||
|
|
||||||
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + ' (' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
|
println "Java: ${System.getProperty 'java.version'}, JVM: ${System.getProperty 'java.vm.version'} (${System.getProperty 'java.vendor'}), Arch: ${System.getProperty 'os.arch'}"
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
|
|
||||||
if (Boolean.parseBoolean(project.use_parchment)) {
|
if (Boolean.parseBoolean(project.use_parchment)) {
|
||||||
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
|
mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
|
||||||
} else {
|
} else {
|
||||||
mappings channel: 'official', version: "${minecraft_version}"
|
mappings channel: 'official', version: "${minecraft_version}"
|
||||||
}
|
}
|
||||||
|
|
||||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
// This property allows configuring Gradle's ProcessResources task(s) to run on IDE output locations before launching the game.
|
||||||
|
copyIdeResources = true
|
||||||
|
|
||||||
|
if (file('src/main/resources/META-INF/accesstransformer.cfg').exists()) {
|
||||||
|
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||||
|
}
|
||||||
|
|
||||||
runs {
|
runs {
|
||||||
client {
|
// applies to all the run configs below
|
||||||
|
configureEach {
|
||||||
workingDirectory project.file('run')
|
workingDirectory project.file('run')
|
||||||
|
|
||||||
if (inMultiModWorkspace)
|
if (inMultiModWorkspace)
|
||||||
ideaModule "createmod.Create.main"
|
ideaModule "createmod.Create.main"
|
||||||
else
|
else
|
||||||
ideaModule "Create.main"
|
ideaModule "Create.main"
|
||||||
|
|
||||||
arg '-mixin.config=create.mixins.json'
|
|
||||||
arg '-mixin.config=flywheel.mixins.json'
|
|
||||||
|
|
||||||
if (catnipInWorkspace) {
|
|
||||||
arg '-mixin.config=catnip.mixins.json'
|
|
||||||
}
|
|
||||||
|
|
||||||
jvmArgs("-XX:-OmitStackTraceInFastThrow") // uncomment when you get exceptions with null messages etc
|
|
||||||
jvmArgs("-XX:+IgnoreUnrecognizedVMOptions", "-XX:+AllowEnhancedClassRedefinition") // uncomment with jbr
|
|
||||||
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
|
|
||||||
property 'forge.logging.console.level', 'info'
|
property 'forge.logging.console.level', 'info'
|
||||||
|
jvmArgs '-XX:+IgnoreUnrecognizedVMOptions', '-XX:+AllowEnhancedClassRedefinition' // uncomment with jbr
|
||||||
|
//jvmArgs("-XX:-OmitStackTraceInFastThrow") // uncomment when you get exceptions with null messages etc
|
||||||
|
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
|
||||||
|
|
||||||
|
property 'mixin.env.remapRefMap', 'true'
|
||||||
|
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
|
||||||
|
|
||||||
|
arg '-mixin.config=create.mixins.json'
|
||||||
|
arg '-mixin.config=catnip.mixins.json'
|
||||||
|
|
||||||
mods {
|
mods {
|
||||||
create {
|
create {
|
||||||
source sourceSets.main
|
source sourceSets.main
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flywheelInWorkspace) {
|
|
||||||
flywheel {
|
|
||||||
source project(":Flywheel").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (catnipInWorkspace) {
|
if (catnipInWorkspace) {
|
||||||
catnip {
|
catnip {
|
||||||
source project(":catnip:Common").sourceSets.main
|
source project(":catnip:Common").sourceSets.main
|
||||||
|
@ -107,83 +107,37 @@ minecraft {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client {
|
||||||
|
arg '-mixin.config=flywheel.mixins.json'
|
||||||
|
|
||||||
|
mods {
|
||||||
|
if (flywheelInWorkspace) {
|
||||||
|
flywheel {
|
||||||
|
source project(":Flywheel").sourceSets.main
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
workingDirectory project.file('run/server')
|
workingDirectory project.file('run/server')
|
||||||
if (inMultiModWorkspace)
|
|
||||||
ideaModule "createmod.Create.main"
|
|
||||||
else
|
|
||||||
ideaModule "Create.main"
|
|
||||||
|
|
||||||
arg '-mixin.config=create.mixins.json'
|
|
||||||
property 'forge.logging.console.level', 'info'
|
|
||||||
mods {
|
|
||||||
create {
|
|
||||||
source sourceSets.main
|
|
||||||
}
|
|
||||||
|
|
||||||
if (catnipInWorkspace) {
|
|
||||||
catnip {
|
|
||||||
source project(":catnip:Common").sourceSets.main
|
|
||||||
source project(":catnip:Forge").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ponderInWorkspace) {
|
|
||||||
ponder {
|
|
||||||
source project(":Ponder:Common").sourceSets.main
|
|
||||||
source project(":Ponder:Forge").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
data {
|
data {
|
||||||
workingDirectory project.file('run')
|
|
||||||
if (inMultiModWorkspace)
|
|
||||||
ideaModule "createmod.Create.main"
|
|
||||||
else
|
|
||||||
ideaModule "Create.main"
|
|
||||||
|
|
||||||
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
|
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
|
||||||
property 'forge.logging.console.level', 'debug'
|
property 'forge.logging.console.level', 'debug'
|
||||||
args '--mod', 'create', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
|
args '--mod', 'create', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
|
||||||
mods {
|
mods {
|
||||||
create {
|
|
||||||
source sourceSets.main
|
|
||||||
}
|
|
||||||
|
|
||||||
if (flywheelInWorkspace) {
|
if (flywheelInWorkspace) {
|
||||||
flywheel {
|
flywheel {
|
||||||
source project(":Flywheel").sourceSets.main
|
source project(":Flywheel").sourceSets.main
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (catnipInWorkspace) {
|
|
||||||
catnip {
|
|
||||||
source project(":catnip:Common").sourceSets.main
|
|
||||||
source project(":catnip:Forge").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (ponderInWorkspace) {
|
|
||||||
ponder {
|
|
||||||
source project(":Ponder:Common").sourceSets.main
|
|
||||||
source project(":Ponder:Forge").sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gameTestServer {
|
gameTestServer {
|
||||||
workingDirectory project.file('run/gametest')
|
workingDirectory project.file('run/gametest')
|
||||||
arg '-mixin.config=create.mixins.json'
|
|
||||||
property 'forge.logging.console.level', 'info'
|
|
||||||
mods {
|
|
||||||
create {
|
|
||||||
source sourceSets.main
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//setForceExit false
|
//setForceExit false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,6 +202,11 @@ repositories {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sourceSets.main.resources {
|
||||||
|
srcDir 'src/generated/resources'
|
||||||
|
exclude '.cache/'
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
|
||||||
|
|
||||||
|
@ -315,45 +274,44 @@ sourceSets.main.java {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceSets.main.resources {
|
|
||||||
srcDir 'src/generated/resources'
|
|
||||||
exclude '.cache/'
|
|
||||||
}
|
|
||||||
|
|
||||||
mixin {
|
|
||||||
add sourceSets.main, 'create.refmap.json'
|
|
||||||
}
|
|
||||||
|
|
||||||
// Workaround for SpongePowered/MixinGradle#38
|
// Workaround for SpongePowered/MixinGradle#38
|
||||||
afterEvaluate {
|
afterEvaluate {
|
||||||
//tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
|
//tasks.configureReobfTaskForReobfJar.mustRunAfter(tasks.compileJava)
|
||||||
//tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
|
//tasks.configureReobfTaskForReobfJarJar.mustRunAfter(tasks.compileJava)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.withType(JavaCompile).configureEach {
|
processResources {
|
||||||
options.encoding = 'UTF-8' // Use the UTF-8 charset for Java compilation
|
def buildProps = project.properties.clone()
|
||||||
|
|
||||||
|
// Replaces FML's magic file.jarVersion string with the correct version at build time.
|
||||||
|
buildProps.put('file', [jarVersion: project.version])
|
||||||
|
|
||||||
|
filesMatching(['META-INF/mods.toml', 'pack.mcmeta']) {
|
||||||
|
expand buildProps
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
options.compilerArgs = ['-Xdiags:verbose']
|
options.compilerArgs = ['-Xdiags:verbose']
|
||||||
}
|
}
|
||||||
|
|
||||||
jar {
|
void addLicense(jarTask) {
|
||||||
archiveClassifier = 'slim'
|
jarTask.from('LICENSE') {
|
||||||
manifest {
|
rename { "${it}_${project.archivesBaseName}" }
|
||||||
attributes([
|
|
||||||
'Specification-Title': 'create',
|
|
||||||
'Specification-Vendor': 'simibubi',
|
|
||||||
'Specification-Version': '1',
|
|
||||||
'Implementation-Title': archiveBaseName,
|
|
||||||
'Implementation-Version': project.jar.archiveVersion,
|
|
||||||
'Implementation-Vendor': 'simibubi',
|
|
||||||
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
|
||||||
'MixinConfigs': 'create.mixins.json'
|
|
||||||
])
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.jar {
|
||||||
|
archiveClassifier = 'slim'
|
||||||
|
finalizedBy('reobfJar')
|
||||||
|
addLicense it
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.jarJar {
|
||||||
|
finalizedBy('reobfJarJar')
|
||||||
|
addLicense it
|
||||||
|
}
|
||||||
|
|
||||||
task jarJarRelease {
|
task jarJarRelease {
|
||||||
group = 'jarjar'
|
group = 'jarjar'
|
||||||
doLast {
|
doLast {
|
||||||
|
@ -364,28 +322,10 @@ task jarJarRelease {
|
||||||
finalizedBy tasks.jarJar
|
finalizedBy tasks.jarJar
|
||||||
}
|
}
|
||||||
|
|
||||||
java {
|
project.publishing {
|
||||||
withSourcesJar()
|
|
||||||
withJavadocJar()
|
|
||||||
}
|
|
||||||
|
|
||||||
void addLicense(jarTask) {
|
|
||||||
jarTask.from('LICENSE') {
|
|
||||||
rename { "${it}_${project.archivesBaseName}" }
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
jar.finalizedBy('reobfJar')
|
|
||||||
tasks.jarJar.finalizedBy('reobfJarJar')
|
|
||||||
|
|
||||||
addLicense(jar)
|
|
||||||
addLicense(tasks.jarJar)
|
|
||||||
|
|
||||||
publishing {
|
|
||||||
publications {
|
publications {
|
||||||
mavenJava(MavenPublication) {
|
mavenJava(MavenPublication) {
|
||||||
artifactId = archivesBaseName
|
artifactId base.archivesName.get()
|
||||||
|
|
||||||
from components.java
|
from components.java
|
||||||
fg.component(it)
|
fg.component(it)
|
||||||
jarJar.component(it)
|
jarJar.component(it)
|
||||||
|
|
|
@ -35,6 +35,16 @@ cc_tweaked_enable = true
|
||||||
cc_tweaked_minecraft_version = 1.19.2
|
cc_tweaked_minecraft_version = 1.19.2
|
||||||
cc_tweaked_version = 1.101.2
|
cc_tweaked_version = 1.101.2
|
||||||
|
|
||||||
|
# mod options
|
||||||
|
mod_id = create
|
||||||
|
mod_name = Create
|
||||||
|
mod_author = simibubi
|
||||||
|
mod_homepage = https://www.curseforge.com/minecraft/mc-mods/create
|
||||||
|
mod_source = https://github.com/Creators-of-Create/Create
|
||||||
|
mod_issues = https://github.com/Creators-of-Create/Create/issues
|
||||||
|
mod_description = Technology that empowers the player.
|
||||||
|
mod_license = MIT
|
||||||
|
|
||||||
# curseforge information
|
# curseforge information
|
||||||
projectId = 328085
|
projectId = 328085
|
||||||
curse_type = beta
|
curse_type = beta
|
||||||
|
|
42
gradle/java.gradle
Normal file
42
gradle/java.gradle
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
|
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
java.withSourcesJar()
|
||||||
|
java.withJavadocJar()
|
||||||
|
|
||||||
|
jar {
|
||||||
|
manifest {
|
||||||
|
attributes([
|
||||||
|
'Specification-Title' : mod_name,
|
||||||
|
'Specification-Vendor' : mod_author,
|
||||||
|
'Specification-Version' : project.jar.archiveVersion,
|
||||||
|
'Implementation-Title' : project.name,
|
||||||
|
'Implementation-Version' : project.jar.archiveVersion,
|
||||||
|
'Implementation-Vendor' : mod_author,
|
||||||
|
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
|
||||||
|
'Timestampe' : System.currentTimeMillis(),
|
||||||
|
'Built-On-Java' : "${System.getProperty('java.vm.version')} (${System.getProperty('java.vm.vendor')})",
|
||||||
|
'Build-On-Minecraft' : minecraft_version
|
||||||
|
])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaCompile).configureEach {
|
||||||
|
|
||||||
|
it.options.encoding = 'UTF-8'
|
||||||
|
it.options.release = 17
|
||||||
|
}
|
||||||
|
|
||||||
|
// Disables Gradle's custom module metadata from being published to maven. The
|
||||||
|
// metadata includes mapped dependencies which are not reasonably consumable by
|
||||||
|
// other mod developers.
|
||||||
|
tasks.withType(GenerateModuleMetadata) {
|
||||||
|
|
||||||
|
enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc {
|
||||||
|
|
||||||
|
// Suppress annoying warnings when generating JavaDoc files.
|
||||||
|
options.addStringOption('Xdoclint:none', '-quiet')
|
||||||
|
}
|
|
@ -1 +1,12 @@
|
||||||
|
pluginManagement {
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
jcenter()
|
||||||
|
maven { url = 'https://maven.minecraftforge.net' }
|
||||||
|
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
|
||||||
|
maven { url = 'https://maven.parchmentmc.org' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rootProject.name = 'Create'
|
rootProject.name = 'Create'
|
||||||
|
|
|
@ -1,20 +1,19 @@
|
||||||
modLoader="javafml"
|
modLoader="javafml"
|
||||||
loaderVersion="[43,)"
|
loaderVersion="[43,)"
|
||||||
issueTrackerURL="https://github.com/Creators-of-Create/Create/issues"
|
issueTrackerURL="${mod_issues}"
|
||||||
license="MIT"
|
license="${mod_license}"
|
||||||
|
|
||||||
[[mods]]
|
[[mods]]
|
||||||
modId="create"
|
modId="create"
|
||||||
# The Implementation-Version property in the jar's MANIFEST.MF file will be used as the mod version at runtime
|
|
||||||
version="${file.jarVersion}"
|
version="${file.jarVersion}"
|
||||||
displayName="Create"
|
displayName="${mod_name}"
|
||||||
#updateJSONURL=""
|
displayURL="${mod_homepage}"
|
||||||
displayURL="https://www.curseforge.com/minecraft/mc-mods/create"
|
|
||||||
logoFile="logo.png"
|
logoFile="logo.png"
|
||||||
#credits=""
|
#credits=""
|
||||||
authors="simibubi"
|
authors="${mod_author}"
|
||||||
description='''
|
description='''
|
||||||
Technology that empowers the player.'''
|
${mod_description}
|
||||||
|
'''
|
||||||
|
|
||||||
[[dependencies.create]]
|
[[dependencies.create]]
|
||||||
modId="forge"
|
modId="forge"
|
||||||
|
|
Loading…
Add table
Reference in a new issue