mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2024-11-14 06:00:27 -06:00
111 lines
3.2 KiB
Groovy
111 lines
3.2 KiB
Groovy
|
apply plugin: 'maven'
|
||
|
apply plugin: 'signing'
|
||
|
|
||
|
def isReleaseBuild() {
|
||
|
return VERSION_NAME.contains("SNAPSHOT") == false
|
||
|
}
|
||
|
|
||
|
def getReleaseRepositoryUrl() {
|
||
|
return ARTIFACT_REPO
|
||
|
}
|
||
|
|
||
|
def getSnapshotRepositoryUrl() {
|
||
|
return ARTIFACT_SNAPSHOT_REPO
|
||
|
}
|
||
|
|
||
|
def getRepositoryUsername() {
|
||
|
return System.properties['username']
|
||
|
}
|
||
|
|
||
|
def getRepositoryPassword() {
|
||
|
return System.properties['password']
|
||
|
}
|
||
|
|
||
|
afterEvaluate { project ->
|
||
|
uploadArchives {
|
||
|
repositories {
|
||
|
mavenDeployer {
|
||
|
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
|
||
|
|
||
|
pom.groupId = GROUP
|
||
|
pom.artifactId = POM_ARTIFACT_ID
|
||
|
pom.version = VERSION_NAME
|
||
|
|
||
|
repository(url: getReleaseRepositoryUrl()) {
|
||
|
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
||
|
}
|
||
|
snapshotRepository(url: getSnapshotRepositoryUrl()) {
|
||
|
authentication(userName: getRepositoryUsername(), password: getRepositoryPassword())
|
||
|
}
|
||
|
|
||
|
pom.project {
|
||
|
name POM_NAME
|
||
|
packaging POM_PACKAGING
|
||
|
description POM_DESCRIPTION
|
||
|
url POM_URL
|
||
|
|
||
|
scm {
|
||
|
url POM_SCM_URL
|
||
|
connection POM_SCM_CONNECTION
|
||
|
developerConnection POM_SCM_DEV_CONNECTION
|
||
|
}
|
||
|
|
||
|
licenses {
|
||
|
license {
|
||
|
name POM_LICENCE_NAME
|
||
|
url POM_LICENCE_URL
|
||
|
distribution POM_LICENCE_DIST
|
||
|
}
|
||
|
}
|
||
|
|
||
|
developers {
|
||
|
developer {
|
||
|
id POM_DEVELOPER_ID
|
||
|
name POM_DEVELOPER_NAME
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
task installArchives(type: Upload) {
|
||
|
description "Installs the artifacts to the local Maven repository."
|
||
|
configuration = configurations['archives']
|
||
|
repositories {
|
||
|
mavenDeployer {
|
||
|
pom.groupId = GROUP
|
||
|
pom.artifactId = POM_ARTIFACT_ID
|
||
|
pom.version = VERSION_NAME
|
||
|
|
||
|
repository url: "file://${System.properties['user.home']}/.m2/repository"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
signing {
|
||
|
required { isReleaseBuild() && gradle.taskGraph.hasTask("uploadArchives") }
|
||
|
sign configurations.archives
|
||
|
}
|
||
|
|
||
|
task androidJavadocs(type: Javadoc) {
|
||
|
source = android.sourceSets.main.java.srcDirs
|
||
|
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
|
||
|
failOnError = false
|
||
|
}
|
||
|
|
||
|
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
|
||
|
classifier = 'javadoc'
|
||
|
from androidJavadocs.destinationDir
|
||
|
}
|
||
|
|
||
|
task androidSourcesJar(type: Jar) {
|
||
|
classifier = 'sources'
|
||
|
from android.sourceSets.main.java.srcDirs
|
||
|
}
|
||
|
|
||
|
artifacts {
|
||
|
archives androidSourcesJar
|
||
|
archives androidJavadocsJar
|
||
|
}
|
||
|
}
|