Skip to content

Commit

Permalink
- updated Android Support Library version to 25.0.0
Browse files Browse the repository at this point in the history
- fixed install & Bintray upload tasks to publish the release configuration only
  • Loading branch information
Piotr Zawadzki committed Oct 23, 2016
1 parent 89cf31b commit 6f5e0f9
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 40 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This library tries to mimic the activity chooser version you can see on Android

## Download (from JCenter)
```groovy
compile 'com.github.zawadz88:material-activity-chooser:0.2.0'
compile 'com.github.zawadz88:material-activity-chooser:0.2.1'
```

## Supported features
Expand Down
53 changes: 20 additions & 33 deletions bintrayv1.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,6 @@ 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())
Expand All @@ -38,6 +11,9 @@ bintray {
key = properties.getProperty("bintray.apikey")

configurations = ['archives']

dryRun = false //[Default: false] Whether to run this as dry-run, without deploying

pkg {
repo = bintrayRepo
name = bintrayName
Expand All @@ -49,11 +25,22 @@ bintray {
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'
}*/
released = new Date()
}
}
}
}

/**
* Delete default debug and release AARs and use the renamed one.
*/
task prepareForUpload(type: Delete) {
delete fileTree(dir: "${project.buildDir}/outputs/aar", exclude: "material-activity-chooser-${libraryVersion}.aar")

doLast {
artifacts {
archives file("${project.buildDir}/outputs/aar/material-activity-chooser-${libraryVersion}.aar")
}
}
}

tasks['bintrayUpload'].dependsOn prepareForUpload
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.0'
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
}
}
Expand All @@ -25,8 +25,8 @@ configure(allprojects) {
androidMinSdkVersion = 16
androidTargetSdkVersion = 24
androidCompileSdkVersion = 24
androidBuildToolsVersion = "24.0.2"
androidSupportLibraryVersion = "24.2.1"
androidBuildToolsVersion = "25.0.0"
androidSupportLibraryVersion = "25.0.0"
butterknifeVersion = "8.4.0"

junitVersion = "4.12"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ org.gradle.jvmargs=-Xmx1536m

POM_GROUP_ID=com.github.zawadz88
POM_ARTIFACT_ID=material-activity-chooser
POM_VERSION=0.2.0
POM_VERSION=0.2.1
39 changes: 38 additions & 1 deletion installv1.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,41 @@ install {
}
}
}
}
}

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
}

task renameReleaseAar(type: Copy) {
from "${project.buildDir}/outputs/aar"
into "${project.buildDir}/outputs/aar"
rename { String fileName ->
fileName.replace('material-activity-chooser-release.aar', "material-activity-chooser-${libraryVersion}.aar")
}
}

tasks['install'].dependsOn renameReleaseAar

0 comments on commit 6f5e0f9

Please sign in to comment.