UnifiedNlp/gradle/publish.gradle

90 lines
2.8 KiB
Groovy

/*
* SPDX-FileCopyrightText: 2020, microG Project Team
* SPDX-License-Identifier: Apache-2.0
*/
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.source
}
task androidJavadocs(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
excludes = ["**/*.aidl", "**/*.kt"]
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
classpath += configurations.compile
if (JavaVersion.current().isJava8Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addStringOption('Xdoclint:none', '-quiet')
}
}
}
}
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
classifier = 'javadoc'
from androidJavadocs.destinationDir
}
artifacts {
archives androidSourcesJar
archives androidJavadocsJar
}
afterEvaluate {
publishing {
publications {
release(MavenPublication) {
pom {
name = project.name
description = project.description
url = 'https://github.com/microg/UnifiedNlp'
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/UnifiedNlp'
connection = 'scm:git:https://github.com/microg/UnifiedNlp.git'
developerConnection = 'scm:git:ssh://github.com/microg/UnifiedNlp.git'
}
}
from components.release
artifact androidSourcesJar
artifact androidJavadocsJar
}
}
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
}
}
}