@@ -3,11 +3,20 @@ buildscript {
33 maven { url = ' https://files.minecraftforge.net/maven' }
44 jcenter()
55 mavenCentral()
6+
7+ maven { url " https://plugins.gradle.org/m2/" }
68 }
9+
710 dependencies {
811 classpath group : ' net.minecraftforge.gradle' , name : ' ForgeGradle' , version : ' 3.+' , changing : true
912 }
1013}
14+
15+
16+ plugins {
17+ id " com.matthewprenger.cursegradle" version " 1.4.0"
18+ }
19+
1120apply plugin : ' net.minecraftforge.gradle'
1221// Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.
1322apply plugin : ' eclipse'
@@ -23,7 +32,7 @@ println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getPro
2332minecraft {
2433 mappings channel : ' snapshot' , version : mappings_version
2534 // makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
26-
35+
2736 // accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
2837
2938 // Default run configurations.
@@ -93,7 +102,7 @@ def getModVersion(filename) {
93102
94103 def found = matcher. find()
95104
96- if (found) {
105+ if (found) {
97106 def mod = matcher. group(" modid" );
98107
99108 // Extract MC version or default
@@ -104,7 +113,7 @@ def getModVersion(filename) {
104113
105114 // println("> mod: ${mod}; mc: ${mcVersion}; version: ${version}");
106115
107- if (mcVersion == null )
116+ if (mcVersion == null )
108117 return " ${ mod} :${ mod} :${ version} " ;
109118 else
110119 return " ${ mod} :${ mod} -${ mcVersion} :${ version} " ;
@@ -136,7 +145,7 @@ repositories {
136145 }
137146}
138147
139- def dev_mods = fileTree(dev_mods_dir). filter { it -> it. isFile() }. files. name. collect( { getModVersion(it) } )
148+ def dev_mods = fileTree(dev_mods_dir). filter { it -> it. isFile() }. files. name. collect({ getModVersion(it) })
140149
141150dependencies {
142151 // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
@@ -164,23 +173,40 @@ dependencies {
164173jar {
165174 manifest {
166175 attributes([
167- " Specification-Title" : " compactmachines" ,
168- " Specification-Vendor" : " " ,
169- " Specification-Version" : " 1" , // We are version 1 of ourselves
170- " Implementation-Title" : project. name,
171- " Implementation-Version" : " ${ version} " ,
172- " Implementation-Vendor" : " " ,
173- " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
176+ " Specification-Title" : " compactmachines" ,
177+ " Specification-Vendor" : " " ,
178+ " Specification-Version" : " 1" , // We are version 1 of ourselves
179+ " Implementation-Title" : project. name,
180+ " Implementation-Version" : " ${ version} " ,
181+ " Implementation-Vendor" : " " ,
182+ " Implementation-Timestamp" : new Date (). format(" yyyy-MM-dd'T'HH:mm:ssZ" )
174183 ])
175184 }
176185}
177186
178187// Example configuration to allow publishing using the maven-publish task
179188// This is the preferred method to reobfuscate your jar file
180- jar. finalizedBy(' reobfJar' )
189+ jar. finalizedBy(' reobfJar' )
181190// 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
182191// publish.dependsOn('reobfJar')
183192
193+ curseforge {
194+ apiKey = System . getenv(" CF_TOKEN" )
195+ project {
196+ id = cf_project
197+ releaseType = " ${ cf_release_type} "
198+ changelogType = " markdown"
199+ changelog = file(" changelog/CHANGELOG.md" )
200+ }
201+
202+ options {
203+ debug = true // defaults to false
204+ javaVersionAutoDetect = true // defaults to true
205+ javaIntegration = true // defaults to true
206+ forgeGradleIntegration = true // defaults to true
207+ }
208+ }
209+
184210publishing {
185211 publications {
186212 mavenJava(MavenPublication ) {
@@ -189,12 +215,12 @@ publishing {
189215 }
190216 repositories {
191217 maven {
192- name = " GitHubPackages"
193- url = " https://maven.pkg.github.com/robotgryphon/compact-machines"
194- credentials {
195- username = System . getenv(" GITHUB_ACTOR" )
196- password = System . getenv(" GITHUB_TOKEN" )
197- }
218+ name = " GitHubPackages"
219+ url = " https://maven.pkg.github.com/robotgryphon/compact-machines"
220+ credentials {
221+ username = System . getenv(" GITHUB_ACTOR" )
222+ password = System . getenv(" GITHUB_TOKEN" )
223+ }
198224 }
199225 }
200226}
0 commit comments