123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170 |
- plugins {
- id 'java-library'
- id 'eclipse'
- id 'idea'
- id 'maven-publish'
- id 'net.neoforged.gradle.userdev' version '7.0.+'
- }
- def secrets = new Properties()
- def secretsFile = file('secrets.properties')
- if (secretsFile.exists()) {
- secretsFile.withInputStream {
- stream -> secrets.load(stream)
- }
- fileTree("secrets").matching {
- include "**/*.properties"
- }.each {
- File file ->
- file.withInputStream {
- stream -> secrets.load(stream)
- }
- }
- }
- version = (hasProperty("CIRevision") ? CIRevision : project.mod_version)
- group = group_name
- base {
- archivesName = "${project.mod_id}-${project.minecraft_version}"
- }
- java.toolchain.languageVersion = JavaLanguageVersion.of(17)
- minecraft.accessTransformers.file rootProject.file('src/main/resources/META-INF/accesstransformer.cfg')
- compileJava.options.compilerArgs << "-Xlint:all,-classfile,-processing,-deprecation" << "-Werror"
- runs {
- configureEach {
- workingDirectory project.file('run')
- systemProperty 'forge.logging.console.level', 'debug'
- systemProperty 'fml.earlyprogresswindow', 'false'
- systemProperty 'mixin.env.disableRefMap', 'true'
- modSource project.sourceSets.main
- }
- client {
- // name "Minecraft_Client_${project.minecraft_version}"
- systemProperty 'forge.enabledGameTestNamespaces', mod_id
- programArguments.addAll '--username', secrets.getProperty("username")?: 'Dev', secrets.getProperty("uuid") ? '--uuid' : '', secrets.getProperty("uuid")?: ''
- }
- server {
- // name "Minecraft_Server_${project.minecraft_version}"
- systemProperty 'forge.enabledGameTestNamespaces', mod_id
- programArgument '--nogui'
- }
- gameTestServer {
- // name "Minecraft_GameTestServer_${project.minecraft_version}"
- systemProperty 'forge.enabledGameTestNamespaces', mod_id
- }
- data {
- // name "Minecraft_Data_${project.minecraft_version}"
- workingDirectory project.file('run-data')
- programArguments.addAll '--mod', mod_id, '--all', '--output', file('src/generated/resources/').getAbsolutePath(), '--existing', file('src/main/resources/').getAbsolutePath()
- }
- }
- sourceSets.main.resources { srcDir 'src/generated/resources' }
- repositories {
- maven {
- name 'Jared\'s Maven' // JEI
- url 'https://maven.blamejared.com/'
- }
- maven {
- name 'tterrag\'s Maven' // CTM
- url 'https://maven.tterrag.com/'
- }
- maven {
- name 'theillusivec4\'s Maven' // Curios
- url 'https://maven.theillusivec4.top/'
- }
- maven {
- name 'Tama\'s Maven' // Cross-Dim Commands
- url "https://maven.tamaized.com/releases"
- }
- maven {
- name 'Curseforge Maven' // Jade
- url "https://www.cursemaven.com"
- content {
- includeGroup "curse.maven"
- }
- }
- }
- dependencies {
- // jared
- //implementation fg.deobf("mezz.jei:jei-${project.minecraft_version}-forge:${project.jei_version}")
- // tterrag
- //runtimeOnly fg.deobf("team.chisel.ctm:CTM:${project.minecraft_version}-${project.ctm_version}")
- // theillusivec4
- //implementation fg.deobf("top.theillusivec4.curios:curios-forge:${project.curios_version}+${project.minecraft_version}")
- //curse maven
- //implementation fg.deobf("curse.maven:jade-324717:4681833")
- //runtimeOnly fg.deobf("curse.maven:jeed-532286:4599236")
- //runtimeOnly fg.deobf("curse.maven:museum-curator-859070:4629894")
- //compileOnly fg.deobf("curse.maven:the-one-probe-245211:4629624")
- //mods we dont have compat with but are nice to have
- //runtimeOnly fg.deobf("team-twilight:crossdimcommands:${project.base_minecraft_version}-1.0")
- //minecraft
- implementation "net.neoforged:neoforge:${project.neo_version}"
- }
- tasks.named('jar', Jar).configure {
- manifest {
- archiveClassifier = 'universal'
- attributes([
- 'Specification-Title' : mod_id,
- 'Specification-Vendor' : "TeamTwilight",
- 'Specification-Version' : "1",
- 'Implementation-Title' : project.name,
- 'Implementation-Version' : project.jar.archiveVersion,
- 'Implementation-Vendor' : "TeamTwilight",
- 'Implementation-Timestamp': new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")
- ])
- }
- }
- publishing {
- publications {
- mavenJava(MavenPublication) {
- afterEvaluate {
- artifact project.jar
- artifact project.sourceJar
- }
- setGroupId 'teamtwilight'
- setArtifactId project.mod_id
- }
- }
- repositories {
- maven {
- //url "file:///${project.projectDir}/mcmodsrepo"
- url "https://modmaven.dev:443/artifactory/local-releases"
- credentials {
- username System.getenv('ARTIFACTORY_USER')
- password System.getenv('ARTIFACTORY_PASS')
- }
- }
- }
- }
- tasks.register('sourceJar', Jar) {
- dependsOn 'classes'
- from sourceSets.main.allSource
- archiveClassifier = 'sources'
- }
- tasks.withType(JavaCompile).configureEach {
- options.encoding = 'UTF-8'
- }
|