This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-android/scripts/upload.gradle

56 lines
1.4 KiB
Groovy
Raw Normal View History

2019-12-04 18:58:28 +08:00
apply plugin: 'maven'
Properties properties = new Properties()
properties.load(project.rootProject.file('scripts/maven.properties').newDataInputStream())
properties.load(new FileInputStream("${projectDir}/pom.properties"))
2020-03-24 19:09:15 +08:00
if (new File("local.properties").exists()) {
properties.load(project.rootProject.file('local.properties').newDataInputStream())
}
2019-12-04 18:58:28 +08:00
2020-03-24 17:59:15 +08:00
def user = System.getenv("BINTARY_USER")
def apiKey = System.getenv("BINTARY_APIKEY")
def repo = System.getenv("BINTARY_REPO")
if (user == null || user.length() == 0) {
user = properties.user
}
if (apiKey == null || apiKey.length() == 0) {
apiKey = properties.apiKey
}
if (repo == null || repo.length() == 0) {
repo = properties.releasesRepository
}
2019-12-04 18:58:28 +08:00
apply plugin: 'maven'
uploadArchives {
repositories {
mavenDeployer {
pom.groupId = properties.groupId
pom.artifactId = properties.artifactId
pom.version = rootProject.ext.Version
pom.project {
description 'git rev-parse HEAD'.execute([], projectDir).text.trim()
}
2020-03-24 17:59:15 +08:00
repository(url: repo + properties.name) {
authentication(userName: user, password: apiKey)
2019-12-04 18:58:28 +08:00
}
}
}
}
task uploadAar {
dependsOn clean, uploadArchives
}
2019-12-23 19:34:00 +08:00
task androidSourcesJar(type: Jar) {
classifier = "sources"
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archives androidSourcesJar
}