mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-30 05:05:19 -05:00
Publish the sources properly
Signed-off-by: shedaniel <daniel@shedaniel.me>
This commit is contained in:
@@ -87,6 +87,10 @@ allprojects {
|
||||
return changes.toString()
|
||||
}
|
||||
}
|
||||
|
||||
java {
|
||||
withSourcesJar()
|
||||
}
|
||||
}
|
||||
|
||||
task licenseFormatAll
|
||||
|
||||
@@ -14,20 +14,22 @@ architectury {
|
||||
common(false)
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar, dependsOn: classes) {
|
||||
classifier = "sources"
|
||||
from sourceSets.main.allSource
|
||||
afterEvaluate {
|
||||
remapJar {
|
||||
remapAccessWidener.set false
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenCommon(MavenPublication) {
|
||||
artifactId = rootProject.archivesBaseName
|
||||
artifact(file("${project.buildDir}/libs/${project.archivesBaseName}-${project.version}.jar")) {
|
||||
builtBy build
|
||||
}
|
||||
artifact(sourcesJar) {
|
||||
builtBy remapSourcesJar
|
||||
artifact(remapJar)
|
||||
afterEvaluate {
|
||||
artifact(remapSourcesJar.output) {
|
||||
builtBy remapSourcesJar
|
||||
classifier "sources"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"_comment": "This file is here to make fabric loader load this on the Knot classloader.",
|
||||
"schemaVersion": 1,
|
||||
"id": "architectury-common",
|
||||
"version": "0.0.1",
|
||||
"accessWidener": "architectury.accessWidener"
|
||||
}
|
||||
@@ -61,13 +61,28 @@ remapJar {
|
||||
archiveClassifier = "fabric"
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
afterEvaluate {
|
||||
[":common"].forEach {
|
||||
def depSources = project(it).sourcesJar
|
||||
dependsOn depSources
|
||||
from(depSources.archiveFile.map { zipTree(it) }) {
|
||||
exclude "architectury.accessWidener"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenFabric(MavenPublication) {
|
||||
artifactId = rootProject.archivesBaseName + "-fabric"
|
||||
artifact(remapJar.archivePath) {
|
||||
builtBy build
|
||||
classifier null
|
||||
artifact(remapJar) { classifier null }
|
||||
afterEvaluate {
|
||||
artifact(remapSourcesJar.output) {
|
||||
builtBy remapSourcesJar
|
||||
classifier "sources"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,13 +58,28 @@ remapJar {
|
||||
archiveClassifier = "forge"
|
||||
}
|
||||
|
||||
sourcesJar {
|
||||
afterEvaluate {
|
||||
[":common"].forEach {
|
||||
def depSources = project(it).sourcesJar
|
||||
dependsOn depSources
|
||||
from(depSources.archiveFile.map { zipTree(it) }) {
|
||||
exclude "architectury.accessWidener"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
publishing {
|
||||
publications {
|
||||
mavenForge(MavenPublication) {
|
||||
artifactId = rootProject.archivesBaseName + "-forge"
|
||||
artifact(remapJar.archivePath) {
|
||||
builtBy build
|
||||
classifier null
|
||||
artifact(remapJar) { classifier null }
|
||||
afterEvaluate {
|
||||
artifact(remapSourcesJar.output) {
|
||||
builtBy remapSourcesJar
|
||||
classifier "sources"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user