Update gradle + Rewrite maven handling to fix #1442
This commit is contained in:
parent
ec6fee9230
commit
804971bb70
4 changed files with 34 additions and 63 deletions
2
Jenkinsfile
vendored
2
Jenkinsfile
vendored
|
@ -8,7 +8,7 @@ node {
|
||||||
sh "rm -rf build/libs/"
|
sh "rm -rf build/libs/"
|
||||||
sh "rm -rf .gradle/asmInjector/"
|
sh "rm -rf .gradle/asmInjector/"
|
||||||
sh "chmod +x gradlew"
|
sh "chmod +x gradlew"
|
||||||
sh "./gradlew build mtDocGen uploadArchive curseTools --refresh-dependencies --stacktrace"
|
sh "./gradlew build mtDocGen publish curseTools --refresh-dependencies --stacktrace"
|
||||||
|
|
||||||
stage "Archive artifacts"
|
stage "Archive artifacts"
|
||||||
|
|
||||||
|
|
91
build.gradle
91
build.gradle
|
@ -193,76 +193,46 @@ task apiJar(type: Jar) {
|
||||||
|
|
||||||
apiJar.mustRunAfter deobfJar
|
apiJar.mustRunAfter deobfJar
|
||||||
|
|
||||||
artifacts {
|
|
||||||
archives deobfJar
|
|
||||||
archives apiJar
|
|
||||||
}
|
|
||||||
|
|
||||||
build.dependsOn deobfJar, apiJar
|
build.dependsOn deobfJar, apiJar
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
maven(MavenPublication) {
|
||||||
|
groupId 'TechReborn'
|
||||||
|
artifactId project.archivesBaseName
|
||||||
|
version project.version
|
||||||
|
|
||||||
|
from components.java
|
||||||
|
|
||||||
uploadArchives {
|
artifact apiJar {
|
||||||
repositories {
|
classifier "api"
|
||||||
mavenDeployer {
|
|
||||||
//This is used when the build is done on a slave node
|
|
||||||
if (project.hasProperty('mavenPass')) {
|
|
||||||
println 'Uploading to remote Maven Repo'
|
|
||||||
repository(url: "http://mavenupload.modmuss50.me/") {
|
|
||||||
authentication(userName: "buildslave", password: project.getProperty('mavenPass'))
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
//this is when the build is executed on the master node
|
|
||||||
println 'Uploading to local Maven Repo'
|
|
||||||
repository(url: "file:///var/www/maven/")
|
|
||||||
}
|
}
|
||||||
pom {
|
|
||||||
groupId = "TechReborn"
|
artifact deobfJar {
|
||||||
version = project.version
|
classifier "dev"
|
||||||
artifactId = project.archivesBaseName
|
}
|
||||||
project {
|
|
||||||
name project.archivesBaseName
|
artifact sourceJar {
|
||||||
packaging 'jar'
|
classifier "sources"
|
||||||
description 'TechReborn'
|
}
|
||||||
url 'https://github.com/TechReborn/TechReborn'
|
|
||||||
scm {
|
//Removes all of the dependencies from the maven pom, fixes issues when other projects try to depend on tr
|
||||||
url 'https://github.com/TechReborn/TechReborn'
|
pom.withXml {
|
||||||
connection 'scm:git:git@github.com:TechReborn/TechReborn.git'
|
asNode().remove(asNode().get('dependencies'))
|
||||||
developerConnection 'scm:git:git@github.com:TechReborn/TechReborn.git'
|
}
|
||||||
}
|
}
|
||||||
issueManagement {
|
}
|
||||||
system 'github'
|
repositories {
|
||||||
url 'https://github.com/TechReborn/TechReborn/issues'
|
maven {
|
||||||
}
|
url "http://mavenupload.modmuss50.me/"
|
||||||
licenses {
|
credentials {
|
||||||
license {
|
username 'buildslave'
|
||||||
name 'License'
|
password project.getProperty('mavenPass')
|
||||||
url 'https://raw.githubusercontent.com/TechReborn/TechReborn/master/LICENSE.md'
|
|
||||||
distribution 'repo'
|
|
||||||
}
|
|
||||||
}
|
|
||||||
developers {
|
|
||||||
developer {
|
|
||||||
id 'modmuss50'
|
|
||||||
name 'modmuss50'
|
|
||||||
roles {role 'developer'}
|
|
||||||
}
|
|
||||||
developer {
|
|
||||||
id 'Gigabit101'
|
|
||||||
name 'Gigabit101'
|
|
||||||
roles {role 'developer'}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task wrapper(type: Wrapper) {
|
|
||||||
//To update the wrapper change the version bellow then run: gradle wrapper
|
|
||||||
gradleVersion = '2.13'
|
|
||||||
}
|
|
||||||
|
|
||||||
//Thanks Matthew from #ForgeGradle https://gist.github.com/matthewprenger/108265e3efc83181bd2cc2d2fc31a853
|
//Thanks Matthew from #ForgeGradle https://gist.github.com/matthewprenger/108265e3efc83181bd2cc2d2fc31a853
|
||||||
task updateMappings(dependsOn: sourceJar) {
|
task updateMappings(dependsOn: sourceJar) {
|
||||||
|
@ -357,6 +327,7 @@ task curseTools {
|
||||||
import com.google.gson.GsonBuilder
|
import com.google.gson.GsonBuilder
|
||||||
import com.google.gson.JsonObject
|
import com.google.gson.JsonObject
|
||||||
import org.apache.commons.io.IOUtils
|
import org.apache.commons.io.IOUtils
|
||||||
|
|
||||||
import java.util.zip.ZipFile
|
import java.util.zip.ZipFile
|
||||||
|
|
||||||
//Reads the new fml_cache_annotation file built into the jar file, to find all crafttweaker methods, and saves the data to a file
|
//Reads the new fml_cache_annotation file built into the jar file, to find all crafttweaker methods, and saves the data to a file
|
||||||
|
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
4
gradle/wrapper/gradle-wrapper.properties
vendored
4
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,6 +1,6 @@
|
||||||
#Fri Feb 09 20:12:54 AEDT 2018
|
#Mon Feb 19 13:23:28 GMT 2018
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-bin.zip
|
||||||
|
|
Loading…
Reference in a new issue