Attempt 2.2

This commit is contained in:
Michael Hillcox 2020-11-20 17:46:34 +00:00
parent 45bbe23f5a
commit 08b1ac049a
No known key found for this signature in database
GPG key ID: 971C5B254742488F

View file

@ -25,9 +25,11 @@ if (System.getenv('BUILD_NUMBER') != null) {
minecraft { minecraft {
version = "1.12.2-14.23.5.2836" version = "1.12.2-14.23.5.2836"
runDir = "run"
mappings = "stable_39" mappings = "stable_39"
runDir = "run"
makeObfSourceJar = false makeObfSourceJar = false
replaceIn "ActuallyAdditions.java" replaceIn "ActuallyAdditions.java"
replace "@VERSION@", project.version.toString() replace "@VERSION@", project.version.toString()
} }
@ -56,7 +58,6 @@ processResources {
from(sourceSets.main.resources.srcDirs) { from(sourceSets.main.resources.srcDirs) {
include 'mcmod.info' include 'mcmod.info'
expand 'version': project.version, 'mcversion': project.minecraft.version expand 'version': project.version, 'mcversion': project.minecraft.version
} }
@ -65,24 +66,19 @@ processResources {
} }
} }
jar { jar {}
}
task deobfJar(type: Jar) { task deobfJar(type: Jar) {
from(sourceSets.main.output) from sourceSets.main.output
archiveName = "${baseName}-${version}-deobf.${extension}" from sourceSets.main.java
} classifier = 'dev'
task sourcesJar(type: Jar) {
from(sourceSets.main.allSource)
archiveName = "${baseName}-${version}-sources.${extension}"
} }
task apiJar(type: Jar) { task apiJar(type: Jar) {
from(sourceSets.main.output) from sourceSets.main.output
from(sourceSets.main.java) from sourceSets.main.java
include("de/ellpeck/actuallyadditions/api/**") classifier = 'api'
archiveName = "${baseName}-${version}-api.${extension}" include 'de/ellpeck/actuallyadditions/api/**'
} }
javadoc { javadoc {
@ -94,6 +90,11 @@ task javadocJar(type: Jar, dependsOn: javadoc) {
classifier 'javadoc' classifier 'javadoc'
} }
task sourcesJar(type: Jar) {
from sourceSets.main.java
classifier = 'sources'
}
artifacts { artifacts {
archives deobfJar archives deobfJar
archives sourcesJar archives sourcesJar
@ -101,6 +102,8 @@ artifacts {
archives javadocJar archives javadocJar
} }
apply plugin: 'maven-publish'
publishing { publishing {
publications { publications {
mavenJava(MavenPublication) { mavenJava(MavenPublication) {
@ -109,21 +112,11 @@ publishing {
version project.version version project.version
from components.java from components.java
artifact deobfJar { artifact jar
classifier 'deobf' artifact apiJar
} artifact javadocJar
artifact sourcesJar { artifact sourcesJar
classifier 'sources' artifact deobfJar
}
artifact apiJar {
classifier 'api'
}
pom.withXml {
def node = asNode()
if (node.dependencies.size() > 0)
node.remove(node.dependencies)
}
} }
} }
repositories { repositories {