From e715c5b5fa2236905772b7ad49dca08f3e29d65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=AD=A3=E7=BA=AC?= Date: Wed, 12 Sep 2018 16:43:10 +0800 Subject: [PATCH] backup build script. --- arouter-annotation/build.gradle | 4 +- arouter-api/build.gradle | 4 +- arouter-compiler/build.gradle | 4 +- arouter-gradle-plugin/build.gradle | 4 +- bintray.gradle | 61 ++++++++++++++++++++++++++++++ install.gradle | 44 +++++++++++++++++++++ 6 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 bintray.gradle create mode 100644 install.gradle diff --git a/arouter-annotation/build.gradle b/arouter-annotation/build.gradle index 680a774a..107dc0d9 100644 --- a/arouter-annotation/build.gradle +++ b/arouter-annotation/build.gradle @@ -13,5 +13,5 @@ compileJava { targetCompatibility = '1.7' } -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' \ No newline at end of file +apply from: '../install.gradle' +apply from: '../bintray.gradle' \ No newline at end of file diff --git a/arouter-api/build.gradle b/arouter-api/build.gradle index be16fe1e..e43a5777 100644 --- a/arouter-api/build.gradle +++ b/arouter-api/build.gradle @@ -44,5 +44,5 @@ dependencies { compile "com.android.support:support-v4:${SUPPORT_LIB_VERSION}" } -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' \ No newline at end of file +apply from: '../install.gradle' +apply from: '../bintray.gradle' \ No newline at end of file diff --git a/arouter-compiler/build.gradle b/arouter-compiler/build.gradle index 6b83b4f4..1ecc45fb 100644 --- a/arouter-compiler/build.gradle +++ b/arouter-compiler/build.gradle @@ -25,5 +25,5 @@ dependencies { compile 'com.alibaba:fastjson:1.2.48' } -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' \ No newline at end of file +apply from: '../install.gradle' +apply from: '../bintray.gradle' \ No newline at end of file diff --git a/arouter-gradle-plugin/build.gradle b/arouter-gradle-plugin/build.gradle index 34f82ae8..cb24fd3a 100644 --- a/arouter-gradle-plugin/build.gradle +++ b/arouter-gradle-plugin/build.gradle @@ -17,5 +17,5 @@ dependencies { compile 'com.android.tools.build:gradle:2.1.3' } -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle' -apply from: 'https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle' \ No newline at end of file +apply from: '../install.gradle' +apply from: '../bintray.gradle' \ No newline at end of file diff --git a/bintray.gradle b/bintray.gradle new file mode 100644 index 00000000..aac4ca37 --- /dev/null +++ b/bintray.gradle @@ -0,0 +1,61 @@ +// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle] + +apply plugin: 'com.jfrog.bintray' + +version = libraryVersion + +if (project.hasProperty("android")) { // Android libraries + task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs + } + + task javadoc(type: Javadoc) { + source = android.sourceSets.main.java.srcDirs + classpath += project.files(android.getBootClasspath().join(File.pathSeparator)) + } +} else { // Java libraries + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = 'sources' + from sourceSets.main.allSource + } +} + +task javadocJar(type: Jar, dependsOn: javadoc) { + classifier = 'javadoc' + from javadoc.destinationDir +} + +artifacts { + archives javadocJar + archives sourcesJar +} + +// Bintray +Properties properties = new Properties() +properties.load(project.rootProject.file('local.properties').newDataInputStream()) + +bintray { + user = properties.getProperty("bintray.user") + key = properties.getProperty("bintray.apikey") + + configurations = ['archives'] + pkg { + repo = bintrayRepo + name = bintrayName + desc = libraryDescription + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = allLicenses + publish = true + publicDownloadNumbers = true + version { + desc = libraryDescription + gpg { + sign = true //Determines whether to GPG sign the files. The default is false + passphrase = properties.getProperty("bintray.gpg.password") + //Optional. The passphrase for GPG signing' + } + } + } +} diff --git a/install.gradle b/install.gradle new file mode 100644 index 00000000..727c82c0 --- /dev/null +++ b/install.gradle @@ -0,0 +1,44 @@ +// backup of [https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle] + +apply plugin: 'com.github.dcendents.android-maven' + +group = publishedGroupId // Maven Group ID for the artifact + +install { + repositories.mavenInstaller { + // This generates POM.xml with proper parameters + pom { + project { + packaging 'aar' + groupId publishedGroupId + artifactId artifact + + // Add your description here + name libraryName + description libraryDescription + url siteUrl + + // Set your license + licenses { + license { + name licenseName + url licenseUrl + } + } + developers { + developer { + id developerId + name developerName + email developerEmail + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + + } + } + } + } +}