Add sources & javadoc jars to api, configure publication

This commit is contained in:
Vankka 2022-06-09 19:29:21 +03:00
parent c54b1bca8f
commit 229f928269
No known key found for this signature in database
GPG Key ID: 6E50CB7A29B96AD0

View File

@ -1,4 +1,5 @@
apply from: rootProject.file('buildscript/relocations.gradle')
apply plugin: 'maven-publish'
dependencies {
// Annotations
@ -30,6 +31,11 @@ sourceSets {
}
}
java {
withSourcesJar()
withJavadocJar()
}
jar {
from sourceSets.ap.output
}
@ -38,3 +44,24 @@ license {
// Overwrite the default
header = rootProject.file('buildscript/license/API_LICENSE_HEADER')
}
publishing {
publications {
maven(MavenPublication) {
// Shaded & relocated jar...
artifact source: shadowJar, classifier: null
artifact sourcesJar
artifact javadocJar
// ...and a pom with no dependencies
pom {
licenses {
license {
name = 'The MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
}
}
}
}