Skip to content

Commit

Permalink
Update gradle, build tools, deps, fix/suppress warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
mar-v-in committed Jan 1, 2018
1 parent e6c6e19 commit b331309
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 27 deletions.
18 changes: 5 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,18 @@
language: android
sudo: false
git:
submodules: false
before_install:
- git submodule update --init --recursive
before_script:
- echo sdk.dir $ANDROID_HOME > local.properties
script:
- jdk_switcher use oraclejdk8
- export TERM=dumb
- export JAVA_OPTS="-XX:MaxPermSize=1024m -XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m"
- export JAVA_OPTS="-XX:+CMSClassUnloadingEnabled -XX:+HeapDumpOnOutOfMemoryError -Xmx2048m"
- ./gradlew build
android:
components:
- tools
- platform-tools
- build-tools-25.0.2
- android-25
- build-tools-27.0.3
- android-27
- extra-android-m2repository
before_cache:
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
cache:
directories:
- $HOME/.gradle/caches/
- $HOME/.gradle/wrapper/
before_install:
- yes | sdkmanager "platforms;android-27"
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,26 +17,29 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.1'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.4.1'
}
}

allprojects {
apply plugin: 'idea'
ext.androidBuildVersionTools = "25.0.2"
ext.androidBuildVersionTools = "27.0.3"
ext.supportLibraryVersion = "27.0.2"
}

def androidCompileSdk() { return 25 }
def androidCompileSdk() { return 27 }

def androidTargetSdk() { return 23 }
def androidTargetSdk() { return 27 }

def androidMinSdk() { return 9 }

subprojects {
repositories {
jcenter()
maven { url "https://maven.google.com" }
}
}
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
10 changes: 8 additions & 2 deletions unifiednlp-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,21 @@ android {
targetSdkVersion androidTargetSdk()
}

flavorDimensions 'tier'

productFlavors {
NetworkLocation {
applicationId = 'com.google.android.gms'
minSdkVersion 19
dimension 'tier'
}
LegacyNetworkLocation {
applicationId = 'com.google.android.location'
dimension 'tier'
}
UnifiedNlp {
applicationId = 'org.microg.nlp'
dimension 'tier'
}
}

Expand All @@ -71,12 +76,13 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile project(':unifiednlp-base')
implementation project(':unifiednlp-base')
}

if (file('user.gradle').exists()) {
Expand Down
6 changes: 5 additions & 1 deletion unifiednlp-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
-->

<manifest package="org.microg.nlp.app"
xmlns:android="http://schemas.android.com/apk/res/android">
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!-- TODO: Does it work on SDK 9? -->
<uses-sdk tools:overrideLibrary="com.takisoft.fix.support.v7.preference,android.support.graphics.drawable.animated,android.arch.lifecycle" />

<application
android:allowBackup="true"
Expand Down
12 changes: 8 additions & 4 deletions unifiednlp-base/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

lintOptions {
Expand All @@ -46,7 +47,10 @@ android {
}

dependencies {
compile project(":microg-ui-tools")
compile project(':unifiednlp-api')
provided project(':unifiednlp-compat')
implementation project(":microg-ui-tools")
implementation project(':unifiednlp-api')
implementation "com.android.support:support-v4:$supportLibraryVersion"
implementation "com.android.support:appcompat-v7:$supportLibraryVersion"
implementation "com.takisoft.fix:preference-v7:$supportLibraryVersion.0"
compileOnly project(':unifiednlp-compat')
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public boolean onUnbind(Intent intent) {
return super.onUnbind(intent);
}

@SuppressWarnings("unchecked")
private void updateLauncherIcon() {
try {
Class cls = Class.forName("org.microg.nlp.ui.SettingsLauncherActivity");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public SettingInjectorService() {
}

@Override
@SuppressWarnings("deprecation")
protected String onGetSummary() {
return "";
}
Expand All @@ -56,6 +57,7 @@ protected boolean onGetEnabled() {
/**
* Dirty method to check whether settings injection is possible on the currently used system
*/
@SuppressWarnings("unchecked")
public static boolean settingsInjectionPossible(Context context) {
try {
Context settingsContext = context.createPackageContext("com.android.settings", CONTEXT_INCLUDE_CODE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
* return location results, but the update rate will be throttled and the exact
* location will be obfuscated to a coarse level of accuracy.
*/
@SuppressWarnings("deprecation")
public class LocationManager {

/**
Expand Down

0 comments on commit b331309

Please sign in to comment.