Files
imgui-java/publish.gradle
T
SpaiR e2222f45d3 doc: add conventional commits naming and move to MIT License
- Add conventional commits naming.
- Move imgui-java to a more straightforward MIT License.
  Apache license is ok, yet MIT license is easier to read and understand.
2023-10-01 20:57:31 +03:00

71 lines
2.7 KiB
Groovy

ext.configurePublishing = { packageName, packageDesc, packageVersion ->
tasks.register('sourcesJar', Jar) {
it.dependsOn classes
it.archiveClassifier.set('sources')
it.from sourceSets.main.allSource
}
tasks.register('javadocJar', Jar) {
it.dependsOn javadoc
it.archiveClassifier.set('javadoc')
it.from javadoc.destinationDir
}
publishing {
repositories {
maven {
name = 'MavenCentral'
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv('NEXUS_UPD_ID')?.trim() ?: ''
password = System.getenv('NEXUS_UPD_PASS')?.trim() ?: ''
}
}
}
publications {
imgui(MavenPublication) {
groupId = 'io.github.spair'
artifactId = packageName
version = packageVersion
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = packageName
description = packageDesc
url = 'https://github.com/SpaiR/imgui-java'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/license/mit/'
}
}
developers {
developer {
id = 'SpaiR'
name = 'Ilya Prymshyts'
email = 'despsolver@gmail.com'
}
}
scm {
connection = 'scm:git:https://github.com/SpaiR/imgui-java.git'
developerConnection = 'scm:git:https://github.com/SpaiR/imgui-java.git'
url = 'https://github.com/SpaiR/imgui-java.git'
}
}
}
}
}
if (System.getenv('SIGNING_KEY_ID') != null) {
signing {
def signingKeyId = System.getenv('SIGNING_KEY_ID')?.trim() ?: ''
def signingKey = System.getenv('SIGNING_KEY')?.trim() ?: ''
def signingKeyPass = System.getenv('SIGNING_KEY_PASS')?.trim() ?: ''
useInMemoryPgpKeys(signingKeyId, signingKey, signingKeyPass)
sign publishing.publications.imgui
}
}
}