Skip to content

Commit

Permalink
Migrated to androidx
Browse files Browse the repository at this point in the history
  • Loading branch information
leinardi committed May 26, 2019
1 parent 7b76f59 commit e5a23e1
Show file tree
Hide file tree
Showing 24 changed files with 47 additions and 53 deletions.
10 changes: 5 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ script:
- set -o pipefail
- ./gradlew clean build check --profile --continue 2>&1 | tee build.log
- set +o pipefail
# - |
# if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
# ./gradlew violationCommentsToGitHub -DGITHUB_PULLREQUESTID=$TRAVIS_PULL_REQUEST -DGITHUB_OAUTH2TOKEN=$GITHUB_OAUTH2TOKEN --info
# fi
# - |
# if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
# ./gradlew violationCommentsToGitHub -DGITHUB_PULLREQUESTID=$TRAVIS_PULL_REQUEST -DGITHUB_OAUTH2TOKEN=$GITHUB_OAUTH2TOKEN --info
# fi
- pandoc `ls -1rt build/reports/profile/profile-*.html | tail -n1` -t plain
- ./gradlew dependencyUpdate # I must run this separately due to issues with the support library resolutionStrategy
- ./gradlew dependencyUpdate
12 changes: 0 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,6 @@ allprojects {
}
}

subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex')
&& !gradle.startParameter.taskNames.contains('dependencyUpdates')) {
details.useVersion versions.support
}
}
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}
8 changes: 4 additions & 4 deletions dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
**/
ext.deps = [:]
def versions = [:]
versions.androidthings = "1.0"
versions.android_checkstyle_plugin = "1.1.0"
versions.android_gradle_plugin = "3.4.1"
versions.android_maven_gradle_plugin = "2.1"
versions.androidthings = "1.0"
versions.gradle_bintray_plugin = "1.8.0"
versions.gradle_versions_plugin = "0.21.0"
versions.powermock = "2.0.2"
versions.support = "27.1.1"
versions.androidx_annotations = "1.0.0"
ext.versions = versions

def build_versions = [:]
build_versions.min_sdk = 26
build_versions.target_sdk = 27
build_versions.min_sdk = 28
build_versions.target_sdk = 28
build_versions.java_version = JavaVersion.VERSION_1_7
build_versions.version_code = 'git rev-list --count HEAD'.execute().text.trim() as int
ext.build_versions = build_versions
Expand Down
2 changes: 1 addition & 1 deletion driver-ds3231-receiver/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation 'com.leinardi.android.things:driver-ds3231:1.0'
}
2 changes: 1 addition & 1 deletion driver-ds3231/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"

testImplementation "com.google.android.things:androidthings:$versions.androidthings"
testImplementation "org.powermock:powermock-module-junit4:$versions.powermock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@

package com.leinardi.android.things.driver.ds3231;

import android.support.annotation.IntDef;
import android.support.annotation.Nullable;
import android.util.Log;

import androidx.annotation.IntDef;
import androidx.annotation.Nullable;
import com.google.android.things.pio.I2cDevice;
import com.google.android.things.pio.PeripheralManager;

Expand Down
2 changes: 1 addition & 1 deletion driver-epaperdriverhat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
}
2 changes: 1 addition & 1 deletion driver-hcsr04/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,5 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
}
2 changes: 1 addition & 1 deletion driver-hd44780/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"

testImplementation "com.google.android.things:androidthings:$versions.androidthings"
testImplementation "org.powermock:powermock-module-junit4:$versions.powermock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@

package com.leinardi.android.things.driver.hd44780;

import android.support.annotation.IntDef;
import android.util.Log;

import androidx.annotation.IntDef;
import com.google.android.things.pio.I2cDevice;
import com.google.android.things.pio.PeripheralManager;

Expand Down
2 changes: 1 addition & 1 deletion driver-lsm9ds1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"

testImplementation "com.google.android.things:androidthings:$versions.androidthings"
testImplementation "org.powermock:powermock-module-junit4:$versions.powermock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@

import android.hardware.SensorManager;
import android.os.SystemClock;
import android.support.annotation.IntDef;

import androidx.annotation.IntDef;
import com.google.android.things.pio.I2cDevice;
import com.google.android.things.pio.PeripheralManager;

Expand Down Expand Up @@ -58,21 +58,17 @@
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerGain.MAG_GAIN_16GAUSS;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerGain.MAG_GAIN_4GAUSS;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerGain.MAG_GAIN_8GAUSS;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode
.MAG_CONTINUOUS_CONVERSION;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode.MAG_CONTINUOUS_CONVERSION;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode.MAG_POWER_DOWN;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode.MAG_SINGLE_CONVERSION;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode.MAG_XY_OM_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode.MAG_XY_OM_LOW_POWER;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode
.MAG_XY_OM_MEDIUM_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode
.MAG_XY_OM_ULTRA_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode.MAG_XY_OM_MEDIUM_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerXYOperatingMode.MAG_XY_OM_ULTRA_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerZOperatingMode.MAG_Z_OM_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerZOperatingMode.MAG_Z_OM_LOW_POWER;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerZOperatingMode.MAG_Z_OM_MEDIUM_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerZOperatingMode
.MAG_Z_OM_ULTRA_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerZOperatingMode.MAG_Z_OM_ULTRA_HIGH_PERFORMANCE;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.SensorType.SENSOR_MAG;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.SensorType.SENSOR_XG;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@

import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.AccelGyroOutputDataRate.ODR_952HZ;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.AccelGyroOutputDataRate.ODR_POWER_DOWN;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode
.MAG_CONTINUOUS_CONVERSION;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode.MAG_CONTINUOUS_CONVERSION;
import static com.leinardi.android.things.driver.lsm9ds1.Lsm9ds1.MagnetometerSystemOperatingMode.MAG_POWER_DOWN;

public class Lsm9ds1SensorDriver implements AutoCloseable {
Expand Down
2 changes: 1 addition & 1 deletion driver-sh1106/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"

testImplementation "com.google.android.things:androidthings:$versions.androidthings"
testImplementation "org.powermock:powermock-module-junit4:$versions.powermock"
Expand Down
2 changes: 1 addition & 1 deletion driver-tsl256x/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ android {

dependencies {
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"

testImplementation "com.google.android.things:androidthings:$versions.androidthings"
testImplementation "org.powermock:powermock-module-junit4:$versions.powermock"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
package com.leinardi.android.things.driver.tsl256x;

import android.os.SystemClock;
import android.support.annotation.IntDef;
import android.util.Log;

import androidx.annotation.IntDef;
import com.google.android.things.pio.I2cDevice;
import com.google.android.things.pio.PeripheralManager;

Expand Down
15 changes: 13 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,16 @@
#
KEYSTORE_PATH=../keystore/release.keystore
KEYSTORE_PROPERTIES_PATH=../keystore/keystore.properties

org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=512m
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
org.gradle.jvmargs=-Xmx1536m -XX:MaxMetaspaceSize=512m
# 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
# AndroidX package structure to make it clearer which packages are bundled with the
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
2 changes: 1 addition & 1 deletion sample-ds3231/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-ds3231')
// Uncomment to automatic persist on reboot/poweroff the system wall clock time
// implementation project(':driver-ds3231-receiver')
Expand Down
2 changes: 1 addition & 1 deletion sample-epaperdriverhat/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-epaperdriverhat')

}
2 changes: 1 addition & 1 deletion sample-hcsr04/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-hcsr04')

}
2 changes: 1 addition & 1 deletion sample-hd44780/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-hd44780')
}
2 changes: 1 addition & 1 deletion sample-lsm9ds1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-lsm9ds1')

}
2 changes: 1 addition & 1 deletion sample-sh1106/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-sh1106')

}
2 changes: 1 addition & 1 deletion sample-tsl256x/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ android {
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
compileOnly "com.google.android.things:androidthings:$versions.androidthings"
implementation "com.android.support:support-annotations:$versions.support"
implementation "androidx.annotation:annotation:$versions.androidx_annotations"
implementation project(':driver-tsl256x')

}

0 comments on commit e5a23e1

Please sign in to comment.