Skip to content

Commit 0d31d7d

Browse files
mnoman09thomaszurkan-optimizely
authored andcommitted
Gradle Update to 5.2.1 (#256)
* gradle updates * Updated gradle version to 4.10.3 and did little changes to make it runnable * - Updated gradle classpath to 3.3.1 - Updated dependencies inclusion methods to implementation and api * Updated slf4j in share dependency and added using compileOnly instead of implementation to avoid dexmerger issue * Updated gradle version to 5.2.1 fixed generation of aar issue
1 parent 7cb0fab commit 0d31d7d

File tree

8 files changed

+125
-108
lines changed

8 files changed

+125
-108
lines changed

android-sdk/build.gradle

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -58,35 +58,38 @@ android {
5858
}
5959

6060
dependencies {
61-
compile project(':shared')
62-
compile project(':datafile-handler')
63-
compile project(':event-handler')
64-
compile project(':user-profile')
65-
compile ("com.optimizely.ab:core-api:$java_core_ver") {
61+
api project(':shared')
62+
api project(':datafile-handler')
63+
api project(':event-handler')
64+
api project(':user-profile')
65+
api ("com.optimizely.ab:core-api:$java_core_ver") {
6666
exclude group: 'com.google.code.findbugs'
6767
}
6868

69-
compile "com.android.support:support-annotations:$support_annotations_ver"
69+
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
7070

71-
testCompile "junit:junit:$junit_ver"
72-
testCompile "org.mockito:mockito-core:$mockito_ver"
73-
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"
71+
implementation "com.android.support:support-annotations:$support_annotations_ver"
7472

75-
androidTestCompile "com.android.support.test:runner:$support_test_runner_ver"
73+
testImplementation "junit:junit:$junit_ver"
74+
testImplementation "org.mockito:mockito-core:$mockito_ver"
75+
testImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
76+
77+
androidTestImplementation "com.android.support.test:runner:$support_test_runner_ver"
7678
// Set this dependency to use JUnit 4 rules
77-
androidTestCompile "com.android.support.test:rules:$support_test_runner_ver"
79+
androidTestImplementation "com.android.support.test:rules:$support_test_runner_ver"
7880
// Set this dependency to build and run Espresso tests
79-
androidTestCompile "com.android.support.test.espresso:espresso-core:$espresso_ver"
80-
androidTestCompile "org.mockito:mockito-core:$mockito_ver"
81-
androidTestCompile "com.google.dexmaker:dexmaker:$dexmaker_ver"
82-
androidTestCompile "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
83-
androidTestCompile "com.noveogroup.android:android-logger:$android_logger_ver"
84-
androidTestCompile "com.google.code.gson:gson:$gson_ver"
81+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_ver"
82+
androidTestImplementation "org.mockito:mockito-core:$mockito_ver"
83+
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmaker_ver"
84+
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
85+
androidTestImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
86+
androidTestImplementation "com.google.code.gson:gson:$gson_ver"
87+
androidTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
8588
}
8689

8790
uploadArchives {
88-
dependsOn = [':android-sdk:clean', ':android-sdk:releaseJavadocJar', ':android-sdk:releaseSourcesJar']
89-
shouldRunAfter = [':datafile-handler:uploadArchives', ':event-handler:uploadArchives', ':user-profile:uploadArchives']
91+
dependsOn = [':android-sdk:releaseJavadocJar', ':android-sdk:releaseSourcesJar']
92+
shouldRunAfter = [':android-sdk:clean', ':datafile-handler:uploadArchives', ':event-handler:uploadArchives', ':user-profile:uploadArchives']
9093
repositories {
9194
mavenDeployer {
9295
repository(url: "https://api.bintray.com/maven/optimizely/optimizely/optimizely-sdk-android") {
@@ -108,7 +111,7 @@ android.libraryVariants.all { variant ->
108111

109112
doFirst {
110113
// First add all of your dependencies to the classpath, then add the android jars
111-
classpath += files(variant.javaCompile.classpath.files)
114+
classpath += files(variant.javaCompileProvider.classpath.files)
112115
classpath += files(android.getBootClasspath())
113116
}
114117
// We're excluding these generated files

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ buildscript {
3434
google()
3535
}
3636
dependencies {
37-
classpath 'com.android.tools.build:gradle:3.2.1'
37+
classpath 'com.android.tools.build:gradle:3.3.1'
3838

3939
// NOTE: Do not place your application dependencies here; they belong
4040
// in the individual module build.gradle files
@@ -75,18 +75,18 @@ task ship() {
7575
'datafile-handler:uploadArchives')
7676
}
7777

78-
task cleanAllModules << {
78+
task cleanAllModules () {
7979
logger.info("Running clean for all modules")
8080
}
8181

8282
cleanAllModules.dependsOn(':android-sdk:clean', ':event-handler:clean',
8383
':user-profile:clean', ':shared:clean', ':datafile-handler:clean')
8484

85-
task testAllModules << {
85+
task testAllModules () {
8686
logger.info("Running android tests for all modules")
8787
}
8888

89-
task testAllModulesTravis << {
89+
task testAllModulesTravis () {
9090
logger.info("Running android tests for Travis")
9191
}
9292

datafile-handler/build.gradle

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,30 @@ android {
5252
}
5353

5454
dependencies {
55-
compile project(':shared')
56-
compile "com.android.support:support-annotations:$support_annotations_ver"
55+
api project(':shared')
56+
implementation "com.android.support:support-annotations:$support_annotations_ver"
5757

58-
testCompile "junit:junit:$junit_ver"
59-
testCompile "org.mockito:mockito-core:$mockito_ver"
60-
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"
58+
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
6159

62-
androidTestCompile "com.android.support.test:runner:$support_test_runner_ver"
60+
testImplementation "junit:junit:$junit_ver"
61+
testImplementation "org.mockito:mockito-core:$mockito_ver"
62+
testImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
63+
64+
androidTestImplementation "com.android.support.test:runner:$support_test_runner_ver"
6365
// Set this dependency to use JUnit 4 rules
64-
androidTestCompile "com.android.support.test:rules:$support_test_runner_ver"
66+
androidTestImplementation "com.android.support.test:rules:$support_test_runner_ver"
6567
// Set this dependency to build and run Espresso tests
66-
androidTestCompile "com.android.support.test.espresso:espresso-core:$espresso_ver"
67-
androidTestCompile "org.mockito:mockito-core:$mockito_ver"
68-
androidTestCompile "com.google.dexmaker:dexmaker:$dexmaker_ver"
69-
androidTestCompile "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
70-
androidTestCompile "com.noveogroup.android:android-logger:$android_logger_ver"
68+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_ver"
69+
androidTestImplementation "org.mockito:mockito-core:$mockito_ver"
70+
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmaker_ver"
71+
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
72+
androidTestImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
73+
androidTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
7174
}
7275

7376
uploadArchives {
74-
dependsOn = [':datafile-handler:clean', ':datafile-handler:releaseJavadocJar', ':datafile-handler:releaseSourcesJar']
75-
shouldRunAfter = [':shared:uploadArchives']
77+
dependsOn = [':datafile-handler:releaseJavadocJar', ':datafile-handler:releaseSourcesJar']
78+
shouldRunAfter = [':datafile-handler:clean', ':shared:uploadArchives']
7679
repositories {
7780
mavenDeployer {
7881
repository(url: "https://api.bintray.com/maven/optimizely/optimizely/optimizely-sdk-android-datafile-handler") {
@@ -94,7 +97,7 @@ android.libraryVariants.all { variant ->
9497

9598
// First add all of your dependencies to the classpath, then add the android jars
9699
doFirst {
97-
classpath += files(variant.javaCompile.classpath.files)
100+
classpath += files(variant.javaCompileProvider.classpath.files)
98101
classpath += files(android.getBootClasspath())
99102
}
100103
// We're excluding these generated files

event-handler/build.gradle

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,27 +53,30 @@ android {
5353
}
5454

5555
dependencies {
56-
compile project(':shared')
57-
compile "com.android.support:support-annotations:$support_annotations_ver"
56+
api project(':shared')
57+
implementation "com.android.support:support-annotations:$support_annotations_ver"
5858

59-
testCompile "junit:junit:$junit_ver"
60-
testCompile "org.mockito:mockito-core:$mockito_ver"
61-
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"
59+
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
6260

63-
androidTestCompile "com.android.support.test:runner:$support_test_runner_ver"
61+
testImplementation "junit:junit:$junit_ver"
62+
testImplementation "org.mockito:mockito-core:$mockito_ver"
63+
testImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
64+
65+
androidTestImplementation "com.android.support.test:runner:$support_test_runner_ver"
6466
// Set this dependency to use JUnit 4 rules
65-
androidTestCompile "com.android.support.test:rules:$support_test_runner_ver"
67+
androidTestImplementation "com.android.support.test:rules:$support_test_runner_ver"
6668
// Set this dependency to build and run Espresso tests
67-
androidTestCompile "com.android.support.test.espresso:espresso-core:$espresso_ver"
68-
androidTestCompile "org.mockito:mockito-core:$mockito_ver"
69-
androidTestCompile "com.google.dexmaker:dexmaker:$dexmaker_ver"
70-
androidTestCompile "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
71-
androidTestCompile "com.noveogroup.android:android-logger:$android_logger_ver"
69+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_ver"
70+
androidTestImplementation "org.mockito:mockito-core:$mockito_ver"
71+
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmaker_ver"
72+
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
73+
androidTestImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
74+
androidTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
7275
}
7376

7477
uploadArchives {
75-
dependsOn = [':event-handler:clean', ':event-handler:releaseJavadocJar', ':event-handler:releaseSourcesJar']
76-
shouldRunAfter = [':shared:uploadArchives']
78+
dependsOn = [':event-handler:releaseJavadocJar', ':event-handler:releaseSourcesJar']
79+
shouldRunAfter = [':event-handler:clean', ':shared:uploadArchives']
7780
repositories {
7881
mavenDeployer {
7982
repository(url: "https://api.bintray.com/maven/optimizely/optimizely/optimizely-sdk-android-event-handler") {
@@ -95,7 +98,7 @@ android.libraryVariants.all { variant ->
9598

9699
// First add all of your dependencies to the classpath, then add the android jars
97100
doFirst {
98-
classpath += files(variant.javaCompile.classpath.files)
101+
classpath += files(variant.javaCompileProvider.classpath.files)
99102
classpath += files(android.getBootClasspath())
100103
}
101104
// We're excluding these generated files
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Feb 15 06:30:36 PST 2019
1+
#Mon Feb 11 13:52:51 PST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip

shared/build.gradle

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,35 @@ android {
5353
}
5454

5555
dependencies {
56-
compile "com.noveogroup.android:android-logger:$android_logger_ver"
57-
compile ("com.optimizely.ab:core-api:$java_core_ver") {
56+
compileOnly "com.noveogroup.android:android-logger:$android_logger_ver"
57+
api ("com.optimizely.ab:core-api:$java_core_ver") {
5858
exclude group: 'com.google.code.findbugs'
5959
}
60-
compile "com.google.code.gson:gson:$gson_ver"
60+
implementation "com.google.code.gson:gson:$gson_ver"
6161

62-
provided "com.android.support:support-annotations:$support_annotations_ver"
62+
compileOnly group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
6363

64-
testCompile "junit:junit:$junit_ver"
65-
testCompile "org.mockito:mockito-core:$mockito_ver"
66-
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"
64+
compileOnly "com.android.support:support-annotations:$support_annotations_ver"
6765

68-
androidTestCompile "com.android.support.test:runner:$support_test_runner_ver"
66+
testImplementation "junit:junit:$junit_ver"
67+
testImplementation "org.mockito:mockito-core:$mockito_ver"
68+
testImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
69+
70+
androidTestImplementation "com.android.support.test:runner:$support_test_runner_ver"
6971
// Set this dependency to use JUnit 4 rules
70-
androidTestCompile "com.android.support.test:rules:$support_test_runner_ver"
72+
androidTestImplementation "com.android.support.test:rules:$support_test_runner_ver"
7173
// Set this dependency to build and run Espresso tests
72-
androidTestCompile "com.android.support.test.espresso:espresso-core:$espresso_ver"
73-
androidTestCompile "org.mockito:mockito-core:$mockito_ver"
74-
androidTestCompile "com.google.dexmaker:dexmaker:$dexmaker_ver"
75-
androidTestCompile "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
76-
androidTestCompile "com.noveogroup.android:android-logger:$android_logger_ver"
74+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_ver"
75+
androidTestImplementation "org.mockito:mockito-core:$mockito_ver"
76+
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmaker_ver"
77+
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
78+
androidTestImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
79+
androidTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
7780
}
7881

7982
uploadArchives {
80-
dependsOn = [':shared:clean', ':shared:releaseJavadocJar', ':shared:releaseSourcesJar']
83+
dependsOn = [':shared:releaseJavadocJar', ':shared:releaseSourcesJar']
84+
shouldRunAfter = [':shared:clean']
8185
repositories {
8286
mavenDeployer {
8387
repository(url: "https://api.bintray.com/maven/optimizely/optimizely/optimizely-sdk-android-shared") {
@@ -99,7 +103,7 @@ android.libraryVariants.all { variant ->
99103

100104
// First add all of your dependencies to the classpath, then add the android jars
101105
doFirst {
102-
classpath += files(variant.javaCompile.classpath.files)
106+
classpath += files(variant.javaCompileProvider.classpath.files)
103107
classpath += files(android.getBootClasspath())
104108
}
105109
// We're excluding these generated files

test-app/build.gradle

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,36 +36,37 @@ android {
3636

3737
dependencies {
3838
// Includes the Optimizely X Full Stack Java SDK, event handler, and user profile
39-
compile (project(':android-sdk')) {
39+
implementation (project(':android-sdk')) {
4040
exclude group: 'com.google.code.gson', module:'gson'
4141
exclude group: 'com.noveogroup.android', module:'android-logger'
4242
}
4343

44-
// compile 'com.optimizely.ab:android-sdk:1.0.0'
45-
compile 'com.android.support:appcompat-v7:28.0.0'
46-
compile 'com.android.support:design:28.0.0'
44+
// implementation 'com.optimizely.ab:android-sdk:1.0.0'
45+
implementation 'com.android.support:appcompat-v7:28.0.0'
46+
implementation 'com.android.support:design:28.0.0'
4747
// EXAMPLE REPLACE noveogroup android-looger with slf4j-android logger
4848
// https://mvnrepository.com/artifact/org.slf4j/slf4j-android
49-
compile group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
49+
implementation group: 'org.slf4j', name: 'slf4j-android', version: '1.7.25'
5050
// EXAMPLE REPLACE gson json parsing with jackson-databind json parsing.
51-
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
51+
implementation group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.9.8'
5252

53-
testCompile "junit:junit:$junit_ver"
54-
testCompile "org.mockito:mockito-core:$mockito_ver"
55-
testCompile "com.noveogroup.android:android-logger:$android_logger_ver"
56-
// testCompile 'com.optimizely.ab:android-sdk:1.0.0'
57-
testCompile project(':android-sdk')
53+
testImplementation "junit:junit:$junit_ver"
54+
testImplementation "org.mockito:mockito-core:$mockito_ver"
55+
testImplementation "com.noveogroup.android:android-logger:$android_logger_ver"
56+
// testImplementation 'com.optimizely.ab:android-sdk:1.0.0'
57+
testImplementation project(':android-sdk')
5858

59-
androidTestCompile("com.android.support.test:runner:$support_test_runner_ver")
60-
androidTestCompile "com.android.support:support-annotations:28.0.0"
59+
androidTestImplementation("com.android.support.test:runner:$support_test_runner_ver")
60+
androidTestImplementation "com.android.support:support-annotations:28.0.0"
6161
// Set this dependency to use JUnit 4 rules
62-
androidTestCompile "com.android.support.test:rules:$support_test_runner_ver"
62+
androidTestImplementation "com.android.support.test:rules:$support_test_runner_ver"
6363
// Set this dependency to build and run Espresso tests
64-
androidTestCompile "com.android.support.test.espresso:espresso-core:$espresso_ver"
65-
androidTestCompile "org.mockito:mockito-core:$mockito_ver"
66-
androidTestCompile "com.google.dexmaker:dexmaker:$dexmaker_ver"
67-
androidTestCompile "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
68-
// androidTestCompile 'com.optimizely.ab:android-sdk:1.0.0'
69-
androidTestCompile project(':android-sdk')
70-
androidTestCompile project(path: ':shared')
64+
androidTestImplementation "com.android.support.test.espresso:espresso-core:$espresso_ver"
65+
androidTestImplementation "org.mockito:mockito-core:$mockito_ver"
66+
androidTestImplementation "com.google.dexmaker:dexmaker:$dexmaker_ver"
67+
androidTestImplementation "com.google.dexmaker:dexmaker-mockito:$dexmaker_ver"
68+
// androidTestImplementation 'com.optimizely.ab:android-sdk:1.0.0'
69+
androidTestImplementation project(':android-sdk')
70+
androidTestImplementation project(path: ':shared')
71+
androidTestImplementation "com.fasterxml.jackson.core:jackson-databind:2.9.8"
7172
}

0 commit comments

Comments
 (0)