Skip to content

Commit

Permalink
Update the project to Android Studio 3 (NASAWorldWind#187)
Browse files Browse the repository at this point in the history
* Updated the project to Android Studio 3
- Updated Gradle to version 4.1
- Updated the Android Plugin for Gradle to version 3.0.1
- Updated gradle.properties to use the new Android Studio defaults
- Removed obsolete android.buildToolsVersion Gradle properties
https://developer.android.com/studio/releases/gradle-plugin.html#3-0-0

* Removed Android SDK build tools from Travis CI configuration

* Restored Android SDK build tools to Travis CI configuration

* Corrected and updated WorldWind module dependencies
- Moved the WorldWind library module to API level 23, the intended target API level for WorldWind
- Updated the Android Support Libraries to the latest versions
- Updated the WorldWind Examples and Tutorials modules to API level 24, the minimum level required for the Android features used
- Updated the WorldWind Examples module to retrieve the latest Mission Command symbology renderer from JCenter, rather than a stale local copy

* Corrected the WorldWind Examples and Tutorials modules API level

* Added support for Java 8 language features
https://developer.android.com/studio/write/java8-support.html
  • Loading branch information
pdavidc authored and zglueck committed Dec 12, 2017
1 parent eb8771a commit 4313b01
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ android:
components:
- platform-tools # latest SDK platform-tools
- tools # latest SDK tools
- android-24 # SDK version used to compile the project
- build-tools-26.0.1 # build tools used by the project
- android-23 # SDK version used to compile the project
- build-tools-26.0.2 # minimum build tools required by Android Gradle plugin 3.0.1
- extra-android-support
- extra-android-m2repository

Expand Down
2 changes: 1 addition & 1 deletion WorldWindAndroid.iml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</configuration>
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8" inherit-compiler-output="true">
<content url="file://$MODULE_DIR$">
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
</content>
Expand Down
5 changes: 3 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@

buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'

classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
google()
jcenter()
}
}
Expand Down
9 changes: 4 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
# any settings specified in this file.

# For more details on how to configure your build environment visit
# https://www.gradle.org/docs/current/userguide/build_environment.html
# http://www.gradle.org/docs/current/userguide/build_environment.html

# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx10248m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
org.gradle.jvmargs=-Xmx1536m

# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# https://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
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 @@
#Fri Mar 03 16:11:43 PST 2017
#Fri Dec 08 14:12:43 PST 2017
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.1-all.zip
24 changes: 10 additions & 14 deletions worldwind-examples/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '26.0.1'
compileSdkVersion 23
defaultConfig {
applicationId 'gov.nasa.worldwindx.examples'
minSdkVersion 16
targetSdkVersion 24
minSdkVersion 23
targetSdkVersion 23
versionCode 10
versionName '0.8.0-SNAPSHOT'
}
Expand All @@ -22,18 +21,15 @@ android {
abortOnError false
disable 'GradleDependency'
}
}

repositories {
flatDir dirs: 'libs'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':worldwind')
compile 'mil-sym-android:renderer:0.1.2@aar'
//maven-like dependency from flatDir repo; alternative: compile(name: 'renderer', ext: 'aar')
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
compile 'mil.army.missioncommand:mil-sym-android-renderer:0.1.36'
}
Binary file removed worldwind-examples/libs/renderer.aar
Binary file not shown.
17 changes: 9 additions & 8 deletions worldwind-tutorials/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 24
buildToolsVersion '26.0.1'
compileSdkVersion 23
defaultConfig {
applicationId 'gov.nasa.worldwindx.tutorials'
minSdkVersion 16
targetSdkVersion 24
minSdkVersion 23
targetSdkVersion 23
versionCode 10
versionName '0.8.0-SNAPSHOT'
}
Expand All @@ -22,12 +21,14 @@ android {
abortOnError false
disable 'GradleDependency'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':worldwind')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:design:23.4.0'
}
16 changes: 9 additions & 7 deletions worldwind/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,10 @@ apply plugin: 'maven-publish'
apply plugin: 'com.jfrog.artifactory'

android {
compileSdkVersion 24
buildToolsVersion '26.0.1'

compileSdkVersion 23
defaultConfig {
minSdkVersion 16
targetSdkVersion 24
targetSdkVersion 23
versionCode 10
versionName '0.8.0-SNAPSHOT'
testInstrumentationRunner 'android.support.test.runner.AndroidJUnitRunner'
Expand All @@ -42,12 +40,14 @@ android {
abortOnError false
disable 'GradleDependency'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}

dependencies {
compile 'com.android.support:support-annotations:24.+'
androidTestCompile 'com.android.support.test:runner:0.5'
androidTestCompile 'com.android.support.test:rules:0.5'
compile 'com.android.support:support-annotations:27.0.2'
testCompile 'junit:junit:4.12'
testCompile 'org.mockito:mockito-core:2.0.43-beta'
// PowerMockito is required to mock static methods like Logger.log
Expand All @@ -59,6 +59,8 @@ dependencies {
exclude module: 'hamcrest-core'
exclude module: 'objenesis'
}
androidTestCompile 'com.android.support.test:runner:1.0.1'
androidTestCompile 'com.android.support.test:rules:1.0.1'
}

publishing {
Expand Down

0 comments on commit 4313b01

Please sign in to comment.