VancedMicroG/gradle/publish-java.gradle

81 lines
2.4 KiB
Groovy
Raw Normal View History

2020-11-18 17:06:29 +01:00
/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
2020-11-24 22:42:07 +01:00
task javaSourcesJar(type: Jar) {
archiveClassifier.set("sources")
from sourceSets.main.allJava
}
javadoc {
classpath = configurations.compileClasspath
source = sourceSets.main.allJava
}
task javaJavadocsJar(type: Jar) {
archiveClassifier.set("javadoc")
from javadoc
}
artifacts {
archives javaSourcesJar
archives javaJavadocsJar
}
2020-11-18 17:06:29 +01:00
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
pom {
name = project.name
2020-11-24 22:42:07 +01:00
description = project.description
2020-11-18 17:06:29 +01:00
url = 'https://github.com/microg/GmsCore'
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
developers {
developer {
id = 'microg'
name = 'microG Team'
}
developer {
id = 'mar-v-in'
name = 'Marvin W.'
}
}
scm {
url = 'https://github.com/microg/GmsCore'
connection = 'scm:git:https://github.com/microg/GmsCore.git'
developerConnection = 'scm:git:ssh://github.com/microg/GmsCore.git'
}
}
from components.java
2020-11-24 22:42:07 +01:00
artifact javaSourcesJar
artifact javaJavadocsJar
2020-11-18 17:06:29 +01:00
}
}
if (project.hasProperty('sonatype.username')) {
repositories {
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials {
username project.getProperty('sonatype.username')
password project.getProperty('sonatype.password')
}
}
}
}
}
if (project.hasProperty('signing.keyId')) {
signing {
sign publishing.publications
}
}
}