Skip to content

Commit d5d025f

Browse files
authored
Feature/dependency updates (#11)
- Update Kotlin to version 1.3.30 - Update Espresso to version 3.1.0 - Update Google Truth to version 0.44 - Migrate to AndroidX
1 parent cdbbde5 commit d5d025f

File tree

10 files changed

+49
-38
lines changed

10 files changed

+49
-38
lines changed

build.gradle

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2+
apply plugin: "com.github.ben-manes.versions"
3+
24
buildscript {
35

46
// Import versions
@@ -8,6 +10,10 @@ buildscript {
810
google()
911
jcenter()
1012
}
13+
14+
dependencies {
15+
classpath "com.github.ben-manes:gradle-versions-plugin:0.21.0"
16+
}
1117
}
1218

1319
allprojects {
@@ -19,4 +25,4 @@ allprojects {
1925

2026
task clean(type: Delete) {
2127
delete rootProject.buildDir
22-
}
28+
}

gradle/dependencies.gradle

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,35 @@
11
ext {
22
projectVersion = [
3-
minSdk : 19,
4-
targetSdk : 28,
5-
compileSdk : 28,
6-
kotlin : "1.3.11"
3+
minSdk : 19,
4+
targetSdk : 28,
5+
compileSdk: 28,
6+
kotlin : "1.3.30"
77
]
88
projectDependency = [
99

1010
// Gradle Plugins
11-
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${projectVersion.kotlin}",
12-
androidGradlePlugin : "com.android.tools.build:gradle:3.3.0",
11+
kotlinPlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${projectVersion.kotlin}",
12+
androidGradlePlugin: "com.android.tools.build:gradle:3.3.0",
1313

1414
// Dependencies
15-
kotlinStdlibJdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${projectVersion.kotlin}",
16-
appCompat : "com.android.support:appcompat-v7:28.0.0",
15+
kotlinStdlibJdk7 : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${projectVersion.kotlin}",
16+
appCompat : "androidx.appcompat:appcompat:1.0.0",
1717

1818
// Test dependencies
19-
junit : "junit:junit:4.12",
20-
truth : "com.google.truth:truth:0.42",
21-
supportTestRunner : "com.android.support.test:runner:1.0.2",
22-
espressoCore : "com.android.support.test.espresso:espresso-core:3.0.2",
23-
commonsCsv : "org.apache.commons:commons-csv:1.6",
24-
kotlinTest : "org.jetbrains.kotlin:kotlin-test:${projectVersion.kotlin}"
19+
junit : "junit:junit:4.12",
20+
truth : "com.google.truth:truth:0.44",
21+
supportTestRunner : "androidx.test:runner:1.1.0",
22+
espressoCore : "androidx.test.espresso:espresso-core:3.1.0",
23+
commonsCsv : "org.apache.commons:commons-csv:1.6",
24+
kotlinTest : "org.jetbrains.kotlin:kotlin-test:${projectVersion.kotlin}"
2525
]
2626

2727
// Used by the plugin-version-handler.gradle
2828
pluginVersions = [
29-
"org.jetbrains.kotlin.android": "${projectVersion.kotlin}",
30-
"org.jetbrains.kotlin.jvm": "${projectVersion.kotlin}"
29+
"org.jetbrains.kotlin.android" : "${projectVersion.kotlin}",
30+
"org.jetbrains.kotlin.jvm" : "${projectVersion.kotlin}",
31+
"com.jfrog.bintray" : "1.8.4",
32+
"com.github.dcendents.android-maven": "2.1",
33+
"com.gradle.plugin-publish" : "0.10.1"
3134
]
3235
}

gradle/plugin-version-handler.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ resolutionStrategy {
3737
def version = pluginVersions[requested.id.id]
3838
if (requested.version == null && version != null) {
3939
useVersion version
40+
} else if(requested.version == null) {
41+
logger.log(LogLevel.WARN, "Plugin with id `${requested.id.id}` is requested without version and no version can be found in the `pluginVersions` map!")
42+
} else {
43+
logger.log(LogLevel.WARN, "Plugin with id `${requested.id.id}` is not defined in the `pluginVersions` map, using version ${requested.version}")
4044
}
4145
}
4246
}

plugin/build.gradle

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@ plugins {
22
id "org.jetbrains.kotlin.jvm"
33
id "java-gradle-plugin"
44

5-
// For publishing to Plugin Portal
6-
id "com.gradle.plugin-publish" version "0.10.0"
7-
8-
// Bintray & Maven for publishing
9-
id "com.github.dcendents.android-maven" version "2.1"
10-
id "com.jfrog.bintray" version "1.8.4"
5+
// For publishing to Plugin Portal & Bintray
6+
id "com.gradle.plugin-publish"
7+
id "com.github.dcendents.android-maven"
8+
id "com.jfrog.bintray"
119
}
1210

1311
// To upload new plugin artifact to maven and Gradle Portal:
@@ -68,4 +66,4 @@ dependencies {
6866
testImplementation projectDependency.commonsCsv
6967
}
7068

71-
apply from: rootProject.file('publish.gradle')
69+
apply from: rootProject.file('publish.gradle')

plugin/src/test/test-fixtures/multi-module/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
targetSdkVersion projectVersion.compileSdk
1919
versionCode 1
2020
versionName "1.0"
21-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2222
}
2323

2424
buildTypes {

plugin/src/test/test-fixtures/multi-module/app/src/androidTest/java/org/neotech/app/multimoduleapplication/TouchLibraryCodeTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.neotech.app.multimoduleapplication
22

3-
import android.support.test.runner.AndroidJUnit4
3+
import androidx.test.runner.AndroidJUnit4
44

55
import org.junit.Test
66
import org.junit.runner.RunWith

plugin/src/test/test-fixtures/multi-module/app/src/main/java/org/neotech/app/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package org.neotech.app
22

33
import android.annotation.SuppressLint
4-
import android.support.v7.app.AppCompatActivity
4+
import androidx.appcompat.app.AppCompatActivity
55
import android.os.Bundle
66
import android.widget.TextView
77
import org.neotech.library.android.LibraryAndroidKotlin
@@ -14,4 +14,4 @@ class MainActivity : AppCompatActivity() {
1414
setContentView(R.layout.activity_main)
1515
findViewById<TextView>(R.id.text).text = "${LibraryAndroidKotlin.getName()}"
1616
}
17-
}
17+
}

plugin/src/test/test-fixtures/multi-module/library_android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ android {
1818
versionCode 1
1919
versionName "1.0"
2020

21-
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
21+
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
2222
}
2323

2424
compileOptions {

plugin/src/test/test-fixtures/multi-module/library_android/src/androidTest/java/org/neotech/library/android/LibraryAInstrumentedTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.neotech.library.android;
22

3-
import android.support.test.runner.AndroidJUnit4;
3+
import androidx.test.runner.AndroidJUnit4;
44

55
import org.junit.Test;
66
import org.junit.runner.RunWith;

publish.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,24 +60,24 @@ if (project.getPlugins().hasPlugin('com.android.application') || project.getPlug
6060
}
6161

6262
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
63-
classifier = 'javadoc'
63+
getArchiveClassifier().set('javadoc')
6464
from androidJavadocs.destinationDir
6565
}
6666

6767
task androidSourcesJar(type: Jar) {
68-
classifier = 'sources'
68+
getArchiveClassifier().set('sources')
6969
from android.sourceSets.main.java.source
7070
}
7171

7272
} else {
7373
// Java libraries
74-
task sourcesJar(type: Jar, dependsOn:classes) {
75-
classifier = 'sources'
74+
task sourcesJar(type: Jar, dependsOn: classes) {
75+
getArchiveClassifier().set('sources')
7676
from sourceSets.main.allSource
7777
}
7878

79-
task javadocJar(type: Jar, dependsOn:javadoc) {
80-
classifier = 'javadoc'
79+
task javadocJar(type: Jar, dependsOn: javadoc) {
80+
getArchiveClassifier().set('javadoc')
8181
from javadoc.destinationDir
8282
}
8383
}
@@ -113,10 +113,10 @@ bintray {
113113
version {
114114
name = VERSION
115115
vcsTag = VERSION
116-
released = new Date();
116+
released = new Date()
117117
}
118118
}
119119
}
120120

121121
// Make sure clean and install are executed before upload.
122-
bintrayUpload.dependsOn clean, install
122+
bintrayUpload.dependsOn clean, install

0 commit comments

Comments
 (0)