Create/build.gradle

302 lines
10 KiB
Groovy
Raw Normal View History

buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
mavenCentral()
jcenter()
2021-11-03 03:30:02 +01:00
maven { url = 'https://repo.spongepowered.org/repository/maven-public' }
2021-11-07 04:59:58 +01:00
maven { url = 'https://maven.parchmentmc.org' }
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: "${forgegradle_version}", changing: true
2021-11-03 03:30:02 +01:00
classpath "org.spongepowered:mixingradle:${mixingradle_version}"
classpath "org.parchmentmc:librarian:${librarian_version}"
}
}
plugins {
id 'com.github.johnrengelman.shadow' version "${shadow_version}"
id 'com.matthewprenger.cursegradle' version "${cursegradle_version}"
}
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'
apply plugin: 'org.spongepowered.mixin'
// apply plugin: 'org.parchmentmc.librarian.forgegradle'
boolean dev = System.getenv('RELEASE') == null || System.getenv('RELEASE').equals('false');
// jozu: I use a gradle workspace with both projects.
// The project is named Flywheel-Forge, but sub-projects are named by folder.
boolean inWorkspace = findProject(':Flywheel') != null
ext.buildnumber = 0
2021-11-02 06:18:30 +01:00
project.buildnumber = System.getenv('BUILD_NUMBER') != null ? System.getenv('BUILD_NUMBER') : 'custom'
2021-11-02 06:18:30 +01:00
version = "mc${minecraft_version}_v${mod_version}" + (dev && !buildnumber.equals('custom') ? "+${buildnumber}" : '')
group = 'com.simibubi.create'
archivesBaseName = 'create'
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
2021-12-03 04:29:12 +01:00
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
// mappings channel: 'parchment', version: "${parchment_version}-${minecraft_version}"
2021-12-16 00:08:07 +01:00
mappings channel: 'official', version: "${minecraft_version}"
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2021-04-10 01:23:49 +02:00
runs {
client {
workingDirectory project.file('run')
2021-01-13 06:58:40 +01:00
arg '-mixin.config=create.mixins.json'
2021-11-18 04:42:34 +01:00
arg '-mixin.config=flywheel.mixins.json'
2021-04-10 01:23:49 +02:00
//jvmArgs '-XX:+UnlockCommercialFeatures' // uncomment for profiling
property 'forge.logging.console.level', 'info'
2021-07-15 11:53:08 +02:00
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
create {
source sourceSets.main
}
if (inWorkspace) {
flywheel {
source project(":Flywheel").sourceSets.main
}
}
}
}
server {
workingDirectory project.file('run/server')
2021-01-13 06:58:40 +01:00
arg '-mixin.config=create.mixins.json'
property 'forge.logging.console.level', 'info'
2021-07-15 11:53:08 +02:00
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
mods {
create {
source sourceSets.main
}
if (inWorkspace) {
flywheel {
source project(":Flywheel").sourceSets.main
}
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
2021-07-15 11:53:08 +02:00
property 'mixin.env.remapRefMap', 'true'
property 'mixin.env.refMapRemappingFile', "${projectDir}/build/createSrgToMcp/output.srg"
args '--mod', 'create', '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources')
mods {
create {
source sourceSets.main
}
if (inWorkspace) {
flywheel {
source project(":Flywheel").sourceSets.main
}
}
}
}
}
}
compileJava {
2021-11-02 06:18:30 +01:00
options.compilerArgs = ['-Xdiags:verbose']
}
sourceSets.main.resources {
srcDir 'src/generated/resources'
}
Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/chromatic-projector # Conflicts: # src/generated/resources/assets/create/lang/en_us.json # src/generated/resources/assets/create/lang/unfinished/de_de.json # src/generated/resources/assets/create/lang/unfinished/es_es.json # src/generated/resources/assets/create/lang/unfinished/es_mx.json # src/generated/resources/assets/create/lang/unfinished/fr_fr.json # src/generated/resources/assets/create/lang/unfinished/it_it.json # src/generated/resources/assets/create/lang/unfinished/ja_jp.json # src/generated/resources/assets/create/lang/unfinished/ko_kr.json # src/generated/resources/assets/create/lang/unfinished/nl_nl.json # src/generated/resources/assets/create/lang/unfinished/pl_pl.json # src/generated/resources/assets/create/lang/unfinished/pt_br.json # src/generated/resources/assets/create/lang/unfinished/ru_ru.json # src/generated/resources/assets/create/lang/unfinished/zh_cn.json # src/generated/resources/assets/create/lang/unfinished/zh_tw.json # src/main/java/com/simibubi/create/AllContainerTypes.java # src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java # src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java # src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerTileEntity.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintRenderer.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java # src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java # src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java # src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java # src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java # src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java # src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java # src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java # src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java # src/main/java/com/simibubi/create/foundation/ponder/content/ChainDriveScenes.java # src/main/java/com/simibubi/create/foundation/render/SuperByteBuffer.java # src/main/resources/META-INF/mods.toml # src/main/resources/assets/create/lang/default/messages.json # src/main/resources/assets/create/lang/default/tooltips.json
2021-06-19 09:54:43 +02:00
mixin {
2021-11-02 06:18:30 +01:00
add sourceSets.main, 'create.refmap.json'
Merge remote-tracking branch 'origin/mc1.16/dev' into mc1.16/chromatic-projector # Conflicts: # src/generated/resources/assets/create/lang/en_us.json # src/generated/resources/assets/create/lang/unfinished/de_de.json # src/generated/resources/assets/create/lang/unfinished/es_es.json # src/generated/resources/assets/create/lang/unfinished/es_mx.json # src/generated/resources/assets/create/lang/unfinished/fr_fr.json # src/generated/resources/assets/create/lang/unfinished/it_it.json # src/generated/resources/assets/create/lang/unfinished/ja_jp.json # src/generated/resources/assets/create/lang/unfinished/ko_kr.json # src/generated/resources/assets/create/lang/unfinished/nl_nl.json # src/generated/resources/assets/create/lang/unfinished/pl_pl.json # src/generated/resources/assets/create/lang/unfinished/pt_br.json # src/generated/resources/assets/create/lang/unfinished/ru_ru.json # src/generated/resources/assets/create/lang/unfinished/zh_cn.json # src/generated/resources/assets/create/lang/unfinished/zh_tw.json # src/main/java/com/simibubi/create/AllContainerTypes.java # src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java # src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerHandler.java # src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/mounted/CartAssemblerTileEntity.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintEntity.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintOverlayRenderer.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintRenderer.java # src/main/java/com/simibubi/create/content/curiosities/tools/BlueprintScreen.java # src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmRenderer.java # src/main/java/com/simibubi/create/content/logistics/item/LinkedControllerScreen.java # src/main/java/com/simibubi/create/content/logistics/item/filter/AttributeFilterScreen.java # src/main/java/com/simibubi/create/content/logistics/item/filter/FilterContainer.java # src/main/java/com/simibubi/create/content/schematics/block/SchematicTableScreen.java # src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java # src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java # src/main/java/com/simibubi/create/foundation/gui/mainMenu/CreateMainMenuScreen.java # src/main/java/com/simibubi/create/foundation/ponder/content/ChainDriveScenes.java # src/main/java/com/simibubi/create/foundation/render/SuperByteBuffer.java # src/main/resources/META-INF/mods.toml # src/main/resources/assets/create/lang/default/messages.json # src/main/resources/assets/create/lang/default/tooltips.json
2021-06-19 09:54:43 +02:00
}
repositories {
maven {
// Location of the maven that hosts JEI files (and TiC)
2021-11-02 06:18:30 +01:00
name 'Progwml6 maven'
url 'https://dvs1.progwml6.com/files/maven'
}
/*maven {
// Location of a maven mirror for JEI files, as a fallback
2021-11-02 06:18:30 +01:00
name 'ModMaven'
url 'https://modmaven.k-4u.nl'
}*/
maven {
// Location of the maven for vazkii's mods
2021-11-02 06:18:30 +01:00
name 'blamejared'
url 'https://maven.blamejared.com'
}
maven {
// Location of the maven for mixed mappings, Registrate, and Flywheel
2021-11-02 06:18:30 +01:00
name 'tterrag maven'
url 'https://maven.tterrag.com'
}
2021-01-20 22:36:04 +01:00
maven {
2021-11-02 06:18:30 +01:00
url 'https://www.cursemaven.com'
2021-06-19 09:29:18 +02:00
content {
includeGroup "curse.maven"
}
2021-01-20 22:36:04 +01:00
}
2021-06-26 19:13:44 +02:00
maven {
//location of the maven for dynamic trees
2021-11-02 06:18:30 +01:00
url 'https://harleyoconnor.com/maven'
2021-06-26 19:13:44 +02:00
}
}
configurations {
shade
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
2021-04-10 01:23:49 +02:00
def registrate = "com.tterrag.registrate:Registrate:${registrate_version}"
implementation fg.deobf(registrate)
shade registrate
if (inWorkspace) {
implementation project(':Flywheel')
2021-06-23 06:09:32 +02:00
} else {
implementation fg.deobf("com.jozufozu.flywheel:Flywheel-Forge:${flywheel_version}")
2021-06-23 06:09:32 +02:00
}
compileOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}:${jei_version}:api")
runtimeOnly fg.deobf("mezz.jei:jei-${jei_minecraft_version}:${jei_version}")
2021-12-18 23:37:42 +01:00
compileOnly fg.deobf("curse.maven:starlight-526854:3559934")
2021-01-20 22:36:04 +01:00
// implementation fg.deobf("curse.maven:druidcraft-340991:3101903")
2021-11-02 06:18:30 +01:00
// implementation fg.deobf("com.ferreusveritas.dynamictrees:DynamicTrees-1.16.5:0.10.0-Beta25")
// runtimeOnly fg.deobf("vazkii.arl:AutoRegLib:1.4-35.69")
// runtimeOnly fg.deobf("vazkii.quark:Quark:r2.0-212.984")
// runtimeOnly fg.deobf("slimeknights.mantle:Mantle:1.16.5-1.6.115")
// runtimeOnly fg.deobf("slimeknights.tconstruct:TConstruct:1.16.5-3.1.1.252")
2021-01-13 09:50:00 +01:00
// https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497
// Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings
// This allows 'Settings > Build, Execution, and Deployment > Build Tools > Gradle > Build and run using' set to IntelliJ to work correctly
if (System.getProperty('idea.sync.active') != 'true') {
annotationProcessor "org.spongepowered:mixin:${mixin_version}:processor"
}
}
jar {
2020-06-10 01:34:57 +02:00
classifier = 'slim'
manifest {
attributes([
2021-11-02 06:18:30 +01:00
'Specification-Title': 'create',
'Specification-Vendor': 'simibubi',
'Specification-Version': '1',
'Implementation-Title': project.name,
'Implementation-Version': "${version}",
2021-11-02 06:18:30 +01:00
'Implementation-Vendor': 'simibubi',
'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ"),
'MixinConfigs': 'create.mixins.json'
])
}
}
shadowJar {
2020-06-10 01:34:57 +02:00
classifier = ''
configurations = [project.configurations.shade]
relocate 'com.tterrag.registrate', 'com.simibubi.create.repack.registrate'
}
reobf {
shadowJar {}
}
2021-08-05 23:57:55 +02:00
task sourcesJar(type: Jar) {
from sourceSets.main.allSource
archiveBaseName.set(project.archivesBaseName)
archiveVersion.set("${project.version}")
archiveClassifier.set('sources')
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc.destinationDir
archiveClassifier.set('javadoc')
}
artifacts {
archives jar, shadowJar, sourcesJar, javadocJar
2021-08-05 23:57:55 +02:00
}
publishing {
tasks.publish.dependsOn 'build'
publications {
mavenJava(MavenPublication) {
artifact shadowJar
artifact sourcesJar
artifact javadocJar
}
}
repositories {
if (project.hasProperty('mavendir')) {
maven { url mavendir }
}
}
}
String getChangelogText() {
def changelogFile = file('changelog.txt')
String str = ''
int lineCount = 0
boolean done = false
changelogFile.eachLine {
if (done || it == null) {
return
}
if (it.size() > 1) {
def temp = it
if (lineCount == 0) {
temp = "Create ${version}"
temp = "<span style=\"font-size: 18px; color: #333399;\">Create v${mod_version}</span>&nbsp;&nbsp;<em>for Minecraft ${minecraft_version}</em><br/>"
} else if (it.startsWith('-')) {
temp = "&nbsp;&nbsp;&nbsp;$temp<br/>"
temp = temp.replaceAll("(\\S+\\/\\S+)#([0-9]+)\\b", "<a href=\"https://github.com/\$1/issues/\$2\">\$0</a>");
temp = temp.replaceAll("#([0-9]+)\\b(?!<\\/a>)", "<a href=\"https://github.com/$github_project/issues/\$1\">\$0</a>");
} else {
temp = "<h4>$temp</h4>"
}
str += temp
lineCount++
} else {
str += "<p>Please submit any Issues you come across on the&nbsp;<a href=\"https://github.com/${github_project}/issues\" rel=\"nofollow\">Issue Tracker</a>.</p>"
done = true
}
}
return str
}
// changelog debugging
// new File("changelog.html").write getChangelogText()
// tasks.curseforge.enabled = !dev && project.hasProperty('simi_curseforge_key')
// curseforge {
// if (project.hasProperty('simi_curseforge_key')) {
// apiKey = project.simi_curseforge_key
// }
//
// project {
// id = project.projectId
// changelog = System.getenv('CHANGELOG') == null || System.getenv('CHANGELOG').equals('none') ? getChangelogText() : System.getenv('CHANGELOG')
// changelogType = 'html'
// releaseType = project.curse_type
// mainArtifact(shadowJar) {
// displayName = "Create - ${version}"
// }
// relations {
// optionalDependency 'jei'
// }
// }
// }