Skip to content

Commit

Permalink
Merge pull request #11 from auth0/add-release-plugin
Browse files Browse the repository at this point in the history
Add OSS Release plugin
  • Loading branch information
lbalmaceda authored Apr 27, 2017
2 parents 8ed3908 + 7a6f0bf commit 713854a
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 392 deletions.
8 changes: 6 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
buildscript {
repositories {
jcenter()
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.dicedmelon.gradle:jacoco-android:0.1.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'gradle.plugin.com.auth0.gradle:oss-library:0.6.0'
}
}

Expand Down
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
#Thu Apr 27 12:53:46 ART 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
75 changes: 21 additions & 54 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,32 @@
apply plugin: 'com.android.library'
apply from: '../scripts/jacoco.gradle'
apply from: '../scripts/release.gradle'
apply plugin: 'com.auth0.gradle.oss-library.android'

logger.lifecycle("Using version ${version} for ${name}")

oss {
library 'jwtdecode.android'
name 'jwtdecode'
repository 'jwtdecode.android'
organization 'auth0'
description 'JWT Decoding library for Android'

developers {
auth0 {
displayName = 'Auth0'
email = '[email protected]'
}
lbalmaceda {
displayName = 'Luciano Balmaceda'
email = '[email protected]'
}
}
}

android {
compileSdkVersion 24
buildToolsVersion "24.0.3"
compileSdkVersion 25
buildToolsVersion "25.0.3"
defaultConfig {
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 25
versionCode 1
versionName "1.0"
}
Expand All @@ -28,55 +41,9 @@ android {
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.google.code.gson:gson:2.7'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:appcompat-v7:25.3.1'
testCompile 'junit:junit:4.12'
testCompile 'org.hamcrest:java-hamcrest:2.0.0.0'
testCompile 'org.robolectric:robolectric:3.1.4'
testCompile 'org.mockito:mockito-core:2.2.5'
}

def defineVersion() {
def current = describeGit(false)
def snapshot = current == null
if (snapshot) {
current = describeGit(snapshot, "0.0.1")
}
return new Semver(snapshot: snapshot, version: current)
}

def describeGit(boolean snapshot, String defaultValue = null) {
def arguments = ['describe', '--tags']
arguments.add(snapshot ? '--abbrev=0' : '--exact-match')
def stdout = new ByteArrayOutputStream()
def string = defaultValue
try {
def result = project.exec {
executable = 'git'
args = arguments
standardOutput = stdout
}

result.assertNormalExitValue()

if (stdout.toByteArray().length > 0) {
string = stdout.toString().replace("\n", "")
}
} catch (Exception e) {
logger.debug("Failed git describe command", e)
} finally {
stdout.close()
}
return string
}

class Semver {
def version
def snapshot

def getStringVersion() {
return snapshot ? version + "-SNAPSHOT" : version
}
}

apply from: '../scripts/maven.gradle'
apply from: '../scripts/bintray.gradle'
}
32 changes: 0 additions & 32 deletions scripts/bintray.gradle

This file was deleted.

56 changes: 0 additions & 56 deletions scripts/jacoco.gradle

This file was deleted.

74 changes: 0 additions & 74 deletions scripts/maven.gradle

This file was deleted.

Loading

0 comments on commit 713854a

Please sign in to comment.