Skip to content

Commit

Permalink
Merge pull request #42 from RADAR-CNS/release-0.5.1
Browse files Browse the repository at this point in the history
Release 0.5.1
  • Loading branch information
blootsvoets authored Dec 12, 2017
2 parents 769c355 + c4a61c8 commit 7382fcd
Show file tree
Hide file tree
Showing 18 changed files with 361 additions and 162 deletions.
8 changes: 5 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,18 @@ android:
- tools
- platform-tools
- tools
- build-tools-26.0.1
- android-26
- build-tools-27.0.1
- android-27
- extra-android-m2repository
- extra-android-support
- extra-google-google_play_services
- extra-google-m2repository

script: TERM=dumb ./gradlew check assembleDebug
# bug https://github.com/travis-ci/travis-ci/issues/8874
before_install:
- yes | sdkmanager "platforms;android-27"

script: ./gradlew check assembleDebug

deploy:
- provider: releases
Expand Down
147 changes: 89 additions & 58 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.4.18'
Expand All @@ -29,19 +30,18 @@ buildscript {

allprojects {
apply plugin: 'com.android.library'
apply plugin: 'de.mobilej.unmock'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'idea'
apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'
apply plugin: 'de.mobilej.unmock'
apply plugin: 'idea'

//---------------------------------------------------------------------------//
// Configuration //
//---------------------------------------------------------------------------//

version = '0.5'
ext.versionCode = 11
version = '0.5.1'
ext.versionCode = 12
group = 'org.radarcns'
ext.githubRepoName = 'RADAR-CNS/RADAR-Commons-Android'

Expand All @@ -53,38 +53,19 @@ allprojects {
// Sources and classpath configurations //
//---------------------------------------------------------------------------//

configurations.compile {
resolutionStrategy.cacheChangingModulesFor 0, 'SECONDS'
configurations {
compile {
resolutionStrategy.cacheChangingModulesFor 0, 'SECONDS'
}
}

repositories {
jcenter()
// radar dev branches
maven { url 'https://maven.google.com' }
google()
maven { url 'https://oss.jfrog.org/artifactory/oss-snapshot-local' }
}

dependencies {
compile 'com.squareup.okhttp3:okhttp:3.8.0'
compile 'com.google.firebase:firebase-config:11.6.2'

compile('org.radarcns:radar-commons:0.6.3') {
exclude group: 'io.confluent', module: 'kafka-avro-serializer'
exclude group: 'org.apache.kafka', module: 'kafka-clients'
exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-yaml'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'org.json', module: 'json'
}
compile 'org.radarcns:radar-schemas-commons:0.2.2'

testCompile 'junit:junit:4.12'
testCompile 'org.slf4j:slf4j-simple:1.7.21'
testCompile 'org.robolectric:robolectric:3.4.2'
testCompile 'com.squareup.okhttp3:mockwebserver:3.8.0'

unmock 'org.robolectric:android-all:5.0.0_r2-robolectric-1'
}

//---------------------------------------------------------------------------//
// Build system metadata //
//---------------------------------------------------------------------------//
Expand Down Expand Up @@ -143,7 +124,7 @@ allprojects {

android {
compileSdkVersion 27
buildToolsVersion "27.0.1"
buildToolsVersion '27.0.1'

defaultConfig {
minSdkVersion 21
Expand All @@ -158,14 +139,14 @@ android {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

libraryVariants.all { variant ->
variant.outputs.each { output ->
if (output.outputFile != null && output.outputFile.name.endsWith('.aar')) {
output.outputFile = new File(output.outputFile.parent,
"${archivesBaseName}-${android.defaultConfig.versionName}.aar")
}
}
}
}
libraryVariants.all { variant ->
variant.outputs.all {
if (variant.name == 'release') {
outputFileName = "${archivesBaseName}-${android.defaultConfig.versionName}.aar"
} else {
outputFileName = "${archivesBaseName}-${android.defaultConfig.versionName}-${variant.name}.aar"
}
}
}
Expand All @@ -174,16 +155,50 @@ android {
ext.moduleName = 'radar-commons-android'
ext.description = 'Kafka backend for processing device data.'

dependencies {
api 'com.squareup.okhttp3:okhttp:3.8.0'

api('org.radarcns:radar-commons:0.6.3') {
exclude group: 'io.confluent', module: 'kafka-avro-serializer'
exclude group: 'org.apache.kafka', module: 'kafka-clients'
exclude group: 'com.fasterxml.jackson.dataformat', module: 'jackson-dataformat-yaml'
exclude group: 'com.fasterxml.jackson.core', module: 'jackson-databind'
exclude group: 'org.json', module: 'json'
}
api 'org.radarcns:radar-schemas-commons:0.2.3'

implementation 'com.google.firebase:firebase-config:11.6.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.7.1@aar') {
transitive = true
}
implementation 'sk.baka.slf4j:slf4j-handroid:1.7.26'

testImplementation 'junit:junit:4.12'
testImplementation 'org.robolectric:robolectric:3.4.2'
testImplementation 'com.squareup.okhttp3:mockwebserver:3.8.0'

unmock 'org.robolectric:android-all:5.0.0_r2-robolectric-1'
}

unMock {
keep "android.widget.BaseAdapter"
keep "android.widget.ArrayAdapter"
keep "android.os.Bundle"
keep "android.os.Parcelable"
keepStartingWith "android.database.MatrixCursor"
keep "android.database.AbstractCursor"
keep "android.database.CrossProcessCursor"
keepStartingWith "android.text.TextUtils"
keepStartingWith "android.util."
keepStartingWith "android.text."
keep "android.app.Application"
keep "android.content.Context"
keep "android.app.ContextImpl"
keep "android.os.UserHandle"
keep "android.R"
keepStartingWith "android.os.Build"
keepStartingWith "android.content.ComponentCallbacks"
keep "android.content.ContextWrapper"
keepStartingWith "android.content.ContentValues"
keepStartingWith "android.content.ComponentName"
keepStartingWith "android.content.ContentUris"
Expand All @@ -200,6 +215,7 @@ unMock {
keep "android.net.Uri"
keepStartingWith "org.json."
keep 'android.os.SystemClock'
keep 'android.os.RemoteException'

keepAndRename "java.nio.charset.Charsets" to "xjava.nio.charset.Charsets"
}
Expand All @@ -215,10 +231,19 @@ task sourcesJar(type: Jar) {
manifest.from sharedManifest
}


task javadoc(type: Javadoc) {
source = android.sourceSets.main.java.srcDirs
classpath += configurations.compile
// this is new
android.libraryVariants.all { variant ->
if (variant.name == 'release') {
owner.classpath += variant.javaCompiler.classpath
}
}
// end of new
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
exclude '**/BuildConfig.java'
exclude '**/R.java'
}

task javadocJar(type: Jar, dependsOn: javadoc) {
Expand All @@ -233,6 +258,8 @@ artifacts {
archives sourcesJar
}

apply plugin: 'maven-publish'

publishing {
publications {
RadarCommonsPublication(MavenPublication) {
Expand All @@ -249,27 +276,31 @@ publishing {
def dependenciesNode = root.appendNode('dependencies')

//Defining configuration names from which dependencies will be taken (debugCompile or releaseCompile and compile)
configurations['compile'].allDependencies.each {
if (it.group != null && it.name != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)

//If there are any exclusions in dependency
if (it.excludeRules.size() > 0) {
def exclusionsNode = dependencyNode.appendNode('exclusions')
it.excludeRules.each { rule ->
def exclusionNode = exclusionsNode.appendNode('exclusion')
exclusionNode.appendNode('groupId', rule.group)
if (rule.module) {
exclusionNode.appendNode('artifactId', rule.module)

android.libraryVariants.all { variant ->
if (variant.name == 'release') {
variant.compileConfiguration.allDependencies.each {
if (it.group != null && it.name != null) {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)

//If there are any exclusions in dependency
if (it.excludeRules.size() > 0) {
def exclusionsNode = dependencyNode.appendNode('exclusions')
it.excludeRules.each { rule ->
def exclusionNode = exclusionsNode.appendNode('exclusion')
exclusionNode.appendNode('groupId', rule.group)
if (rule.module) {
exclusionNode.appendNode('artifactId', rule.module)
}
}
}
}
}
}
}

root.children().last() + pomConfig
}
}
Expand Down Expand Up @@ -319,11 +350,11 @@ artifactory {
}

artifactoryPublish {
publications('RadarCommonsPublication')
publications 'RadarCommonsPublication'
dependsOn 'assembleRelease'
}

task wrapper(type: Wrapper) {
gradleVersion = '4.1'
gradleVersion = '4.4'
distributionType 'all'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
Loading

0 comments on commit 7382fcd

Please sign in to comment.