From 4aefa5049b8e27de513352ad85d982ce0e924935 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 4 Apr 2017 23:31:00 +0200 Subject: [PATCH] Add gradle setup to publish to jcenter --- scripts/bintray-publish.gradle | 78 ++++++++++++++++++++++++++++++++++ terminal-emulator/build.gradle | 18 ++++++++ terminal-view/build.gradle | 18 ++++++++ 3 files changed, 114 insertions(+) create mode 100644 scripts/bintray-publish.gradle diff --git a/scripts/bintray-publish.gradle b/scripts/bintray-publish.gradle new file mode 100644 index 00000000..01f8a99f --- /dev/null +++ b/scripts/bintray-publish.gradle @@ -0,0 +1,78 @@ +// Start 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 { + pom { + project { + packaging 'aar' + groupId publishedGroupId + artifactId artifact + + name libraryName + description libraryDescription + url siteUrl + + licenses { + license { + name 'GNU General Public License version 3' + url 'https://opensource.org/licenses/gpl-3.0.html' + } + } + + developers { + developer { + id 'fornwall' + name 'Fredrik Fornwall' + email 'fredrik@fornwall.net' + } + } + scm { + connection gitUrl + developerConnection gitUrl + url siteUrl + } + } + } + } +} +// End https://raw.githubusercontent.com/nuuneoi/JCenter/master/installv1.gradle + +// Start https://raw.githubusercontent.com/nuuneoi/JCenter/master/bintrayv1.gradle +apply plugin: 'com.jfrog.bintray' + +version = libraryVersion + +task sourcesJar(type: Jar) { + classifier = 'sources' + from android.sourceSets.main.java.srcDirs +} + +artifacts { + archives sourcesJar +} + +bintray { + user = System.getenv('BINTRAY_USER') + key = System.getenv('BINTRAY_API_KEY') + + configurations = ['archives'] + pkg { + repo = 'maven' + name = bintrayName + userOrg = 'termux' + desc = libraryDescription + websiteUrl = siteUrl + vcsUrl = gitUrl + licenses = ['GPL-3.0'] + publish = true + publicDownloadNumbers = true + version { + desc = libraryDescription + gpg { + sign = false //Determines whether to GPG sign the files. The default is false + // passphrase = properties.getProperty("bintray.gpg.password") + } + } + } +} diff --git a/terminal-emulator/build.gradle b/terminal-emulator/build.gradle index 71718f1d..d10a39e1 100644 --- a/terminal-emulator/build.gradle +++ b/terminal-emulator/build.gradle @@ -1,5 +1,21 @@ +plugins { + id "com.jfrog.bintray" version "1.7" + id "com.github.dcendents.android-maven" version "1.5" +} + apply plugin: 'com.android.library' +ext { + bintrayName = 'terminal-emulator' + publishedGroupId = 'com.termux' + libraryName = 'TerminalEmulator' + artifact = 'terminal-emulator' + libraryDescription = 'The terminal emulator used in Termux' + siteUrl = 'https://github.com/termux/termux' + gitUrl = 'https://github.com/termux/termux.git' + libraryVersion = '0.49' +} + android { compileSdkVersion 25 buildToolsVersion "25.0.2" @@ -42,3 +58,5 @@ tasks.withType(Test) { dependencies { testCompile 'junit:junit:4.12' } + +apply from: '../scripts/bintray-publish.gradle' diff --git a/terminal-view/build.gradle b/terminal-view/build.gradle index b3f64eae..7e4c7cfa 100644 --- a/terminal-view/build.gradle +++ b/terminal-view/build.gradle @@ -1,5 +1,21 @@ +plugins { + id "com.jfrog.bintray" version "1.7" + id "com.github.dcendents.android-maven" version "1.5" +} + apply plugin: 'com.android.library' +ext { + bintrayName = 'terminal-view' + publishedGroupId = 'com.termux' + libraryName = 'TerminalView' + artifact = 'terminal-view' + libraryDescription = 'The terminal view used in Termux' + siteUrl = 'https://github.com/termux/termux' + gitUrl = 'https://github.com/termux/termux.git' + libraryVersion = '0.49' +} + android { compileSdkVersion 25 buildToolsVersion "25.0.2" @@ -26,3 +42,5 @@ android { dependencies { testCompile 'junit:junit:4.12' } + +apply from: '../scripts/bintray-publish.gradle'