@@ -6,12 +6,13 @@ plugins {
66 id ' fabric-loom' version ' 0.2.6-SNAPSHOT' apply false
77 id ' net.minecrell.licenser' version ' 0.4.1'
88 id " org.ajoberstar.grgit" version " 3.1.1"
9+ id ' com.jfrog.bintray' version ' 1.8.4'
910}
1011
1112def ENV = System . getenv()
1213
1314class Globals {
14- static def baseVersion = " 0.1.0 "
15+ static def baseVersion = " 0.1.1 "
1516 static def mcVersion = " 1.14.4"
1617 static def yarnVersion = " +build.15"
1718}
@@ -36,7 +37,8 @@ def getBranch() {
3637 if (grgit == null ) {
3738 return " unknown"
3839 }
39- return grgit. branch. current(). name
40+ def branch = grgit. branch. current(). name
41+ return branch. substring(branch. lastIndexOf(" /" ) + 1 )
4042}
4143
4244allprojects {
@@ -56,7 +58,7 @@ allprojects {
5658 modCompile " net.fabricmc:fabric-loader:0.7.2+build.174"
5759 modCompile " net.fabricmc.fabric-api:fabric-api:0.4.2+build.246-1.14"
5860
59- implementation ' com.github.PatchworkMC:EventBus:d5b038e199 '
61+ implementation ' com.patchworkmc:patchwork-eventbus:0.1.2:all '
6062 implementation ' com.google.code.findbugs:jsr305:3.0.2'
6163
6264 // For EventBus
@@ -73,7 +75,7 @@ allprojects {
7375 }
7476
7577 repositories {
76- maven { url ' https://jitpack.io ' }
78+ maven { url ' https://dl.bintray.com/patchworkmc/Patchwork-Maven/ ' }
7779 }
7880
7981 jar {
@@ -133,7 +135,7 @@ subprojects {
133135 afterEvaluate {
134136 from(" ${ project.buildDir} /libs/$archivesBaseName -${ version} .jar" )
135137 into(" ${ project.buildDir} /libs/" )
136- rename { String fn -> " $archivesBaseName -${ version} -maven.jar" }
138+ rename {String fn -> " $archivesBaseName -${ version} -maven.jar" }
137139 }
138140 }
139141
@@ -172,7 +174,31 @@ task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
172174 addNestedDependencies = false
173175 }
174176}
175-
177+ bintray {
178+ user = project. hasProperty(' bintrayUser' ) ? project. getProperty(' bintrayUser' ) : System . getenv(' bintray_user' )
179+ key = project. hasProperty(' bintrayKey' ) ? project. getProperty(' bintrayKey' ) : System . getenv(' bintray_key' )
180+ publish = true
181+ override = true
182+ publications = [' mavenJava' ]
183+ pkg {
184+ repo = project. bintrayRepo
185+ name = project. name
186+ user = bintray. user
187+ userOrg = project. repoOwner
188+ licenses = [project. codeLicense]
189+ desc = project. description
190+ websiteUrl = " https://github.com/${ project.repoOwner} /${ project.repoName} "
191+ issueTrackerUrl = " https://github.com/${ project.repoOwner} /${ project.repoName} /issues"
192+ vcsUrl = " https://github.com/${ project.repoOwner} /${ project.repoName} .git"
193+ publicDownloadNumbers = true
194+
195+ githubRepo = " ${ project.repoOwner} /${ project.repoName} "
196+ version {
197+ name = project. version
198+ released = new Date ()
199+ }
200+ }
201+ }
176202publishing {
177203 publications {
178204 mavenJava(MavenPublication ) {
@@ -194,39 +220,24 @@ publishing {
194220 }
195221 }
196222 }
197-
198- repositories {
199- maven {
200- url " http://mavenupload.modmuss50.me/"
201- if (project. hasProperty(' mavenPass' )) {
202- credentials {
203- username ' buildslave'
204- password project. getProperty(' mavenPass' )
205- }
206- }
207- }
208- }
209223}
210224
211225task licenseFormatAll
212- subprojects { p -> licenseFormatAll. dependsOn(" ${ p.path} :licenseFormat" ) }
213- subprojects. each { remapJar. dependsOn(" ${ it.path} :remapJar" ) }
214-
226+ subprojects {p -> licenseFormatAll. dependsOn(" ${ p.path} :licenseFormat" )}
227+ subprojects. each {remapJar. dependsOn(" ${ it.path} :remapJar" )}
215228repositories {
216229 flatDir {
217230 dirs ' jars'
218231 }
219232 mavenCentral()
220233}
221-
222234dependencies {
223235 afterEvaluate {
224236 subprojects. each {
225237 compile project(path : " :${ it.name} " , configuration : " dev" )
226238 include project(" ${ it.name} :" )
227239 }
228240 }
229-
230241 implementation ' org.apache.logging.log4j:log4j-core:2.10.0'
231242
232243 minecraft " com.mojang:minecraft:$Globals . mcVersion "
@@ -239,16 +250,16 @@ dependencies {
239250 include ' com.electronwill.night-config:toml:3.6.2'
240251
241252 fileTree(dir : ' jars' , include : ' *.jar' ). each {
242- String baseName = it. name. replace(" .jar" , " " );
243- String version = " 0.1.0" ;
244- int split = baseName. lastIndexOf(' -' );
253+ String baseName = it. name. replace(" .jar" , " " )
254+ String version = " 0.1.0"
255+ int split = baseName. lastIndexOf(' -' )
245256
246257 if (split != -1 ) {
247- version = baseName. substring(split + 1 );
248- baseName = baseName. substring(0 , split);
258+ version = baseName. substring(split + 1 )
259+ baseName = baseName. substring(0 , split)
249260 }
250261
251- String name = " testmod:${ baseName} :${ version} " ;
262+ String name = " testmod:${ baseName} :${ version} "
252263
253264 System . out. println (" Found test mod: " + it. name. replace(" .jar" , " " ) + " -> " + name)
254265
@@ -257,9 +268,8 @@ dependencies {
257268 }
258269}
259270
260- version = Globals . baseVersion + " +" + (ENV . BUILD_NUMBER ? (" build." + ENV . BUILD_NUMBER ) : " local" ) + " -" + getBranch()
271+ version = Globals . baseVersion // + "+" + (ENV.BUILD_NUMBER ? ("build." + ENV.BUILD_NUMBER) : "local") + "-" + getBranch()
261272
262273logger. lifecycle(" Building Patchwork: " + version)
263274
264- // This line breaks every second Gradle command
265- // apply from: 'https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
275+ apply from : ' https://github.com/FabricMC/fabric-docs/raw/master/gradle/ideconfig.gradle'
0 commit comments