Skip to content

Commit

Permalink
UPDATE build script & lib version
Browse files Browse the repository at this point in the history
  • Loading branch information
Chrisplus committed Jun 27, 2016
1 parent 65e4c99 commit 38267ae
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 43 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,7 @@ proguard/
# android studio
.idea/
*.iml

# release config
release.properties
publish.properties
11 changes: 5 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
}
}

allprojects {
repositories {
jcenter()
}
ext {
minSdkVersion = 9
compileSdkVersion = 23
buildToolsVersion = '23.0.3'
}

17 changes: 16 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,19 @@
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# org.gradle.parallel=true

version_code = 211
version_name = 2.1.1

repo_name = RootManager
repo_desc = RootManager is a library that developers can use to access root utilities on Android devices. RootManager provides functions including checking if the device is rooted, trying to obtain superuser privileges, installing/uninstalling applications silently, capturing screen shot, recording screen and so on.
repo_site = https://github.com/Chrisplus/RootManager
repo_git = https://github.com/Chrisplus/RootManager.git

license_name = GNU GENERAL PUBLIC LICENSE, Version 2
license_url = https://www.gnu.org/licenses/gpl-2.0.txt

developer_name = Shiqi Jiang
developer_id = Chrisplus
developer_email = chrisplus.jiang@gmail.com
121 changes: 85 additions & 36 deletions library/build.gradle
Original file line number Diff line number Diff line change
@@ -1,33 +1,89 @@
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
}
}

apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: "com.jfrog.bintray"

version = "2.0.3"

group = 'com.chrisplus.rootmanager'
version = project.version_name

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion
buildToolsVersion rootProject.ext.buildToolsVersion

defaultConfig {
minSdkVersion 9
targetSdkVersion 21
versionCode 203
versionName "2.0.3"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
minSdkVersion rootProject.ext.minSdkVersion
versionCode project.version_code.toInteger()
versionName project.version_name
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

def siteUrl = 'https://github.com/Chrisplus/RootManager' // Homepage URL of the library
def gitUrl = 'https://github.com/Chrisplus/RootManager.git' // Git repository URL
group = "com.chrisplus.rootmanager" // Maven Group ID for the artifact
install {
repositories.mavenInstaller {
pom {
project {
name project.repo_name
description project.repo_desc
url project.repo_site

packaging 'aar'
groupId group
artifactId 'library'
version project.version_name

// Set your license
licenses {
license {
name project.license_name
url project.license_url
}
}
developers {
developer {
id project.developer_id
name project.developer_name
email project.developer_email
}
}
scm {
connection project.repo_git
developerConnection project.repo_site
url project.repo_site

}
}
}
}
}

bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('publish.properties').newDataInputStream())
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
configurations = ['archives']
pkg {
repo = "maven"
name = project.repo_name
websiteUrl = project.repo_site
vcsUrl = project.repo_git
licenses = [project.license_name]
publish = true
}
}

task sourcesJar(type: Jar) {
from android.sourceSets.main.java.srcDirs
Expand All @@ -48,28 +104,21 @@ artifacts {
archives sourcesJar
}

def Properties props = new Properties()
def propFile = new File('publish.properties')
if (propFile.canRead()) {
props.load(new FileInputStream(propFile))

if (props != null && props.containsKey('bintray.user') &&
props.containsKey('bintray.key')) {

bintray {
Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
user = properties.getProperty("bintray.user")
key = properties.getProperty("bintray.apikey")
println 'publish.properties found'
bintray.user = props['bintray.user']
bintray.key = props['bintray.key']

configurations = ['archives']
pkg {
repo = "maven"
name = "RootManager"
websiteUrl = siteUrl
vcsUrl = gitUrl
licenses = ["GPL-2.0"]
publish = true
version {
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'
}
}
} else {
println 'publish.properties found but some entries are missing'
}
} else {
println 'publish.properties not found'
}

0 comments on commit 38267ae

Please sign in to comment.