Skip to content

Commit e0580b7

Browse files
committed
Update tool chain
1 parent d459ab9 commit e0580b7

File tree

14 files changed

+63
-52
lines changed

14 files changed

+63
-52
lines changed

android-ktx/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
buildscript {
1818
ext {
1919
COMPILE_SDK_VERSION = 30
20-
BUILD_TOOLS_VERSION = '30.0.3'
21-
KOTLIN_VERSION = '1.5.31'
20+
BUILD_TOOLS_VERSION = '32.0.0'
21+
KOTLIN_VERSION = '1.6.10'
2222

2323
ANDROID_MIN_SDK = 22
2424
ANDROID_TARGET_SDK = 30
@@ -35,7 +35,7 @@ buildscript {
3535

3636
dependencies {
3737
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}"
38-
classpath 'com.android.tools.build:gradle:4.2.2'
38+
classpath 'com.android.tools.build:gradle:7.1.0'
3939
}
4040
}
4141

android-ktx/etc/jenkins/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
# These versions must match the versions in lib/build.gradle
7-
BUILD_TOOLS_VERSION='30.0.3'
7+
BUILD_TOOLS_VERSION='32.0.0'
88

99
MAVEN_URL="http://proget.build.couchbase.com/maven2/cimaven"
1010

android-ktx/etc/jenkins/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55

66
# These versions must match the versions in lib/build.gradle
7-
BUILD_TOOLS_VERSION='30.0.3'
7+
BUILD_TOOLS_VERSION='32.0.0'
88

99

1010
function usage() {
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

android-ktx/lib/build.gradle

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,10 @@ android {
175175

176176
repositories {
177177
if (USE_LOCAL_MAVEN) { mavenLocal() }
178-
maven { url "http://proget.build.couchbase.com/maven2/cimaven" }
178+
maven {
179+
url "http://proget.build.couchbase.com/maven2/cimaven"
180+
allowInsecureProtocol = true
181+
}
179182
google()
180183
mavenCentral()
181184
}
@@ -189,8 +192,6 @@ dependencies {
189192

190193
testImplementation 'junit:junit:4.13.2'
191194

192-
androidTestImplementation 'com.android.support.test:runner:1.0.2'
193-
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
194195
androidTestImplementation 'androidx.test:runner:1.4.0'
195196
androidTestImplementation 'androidx.test:core:1.4.0'
196197
androidTestImplementation 'androidx.test:rules:1.4.0'
@@ -276,8 +277,8 @@ task dokkaJar(type: Jar, dependsOn: dokkaJavadoc) {
276277

277278
// Generate source.jar
278279
task sourcesJar(type: Jar) {
279-
setArchiveBaseName("${CBL_ARTIFACT_ID}")
280-
setArchiveClassifier('sources')
280+
archiveBaseName = "${CBL_ARTIFACT_ID}"
281+
archiveClassifier = 'sources'
281282
from android.sourceSets.main.java.srcDirs
282283
}
283284

@@ -294,6 +295,7 @@ publishing {
294295
username mavenRepoUser
295296
password mavenRepoPass
296297
}
298+
allowInsecureProtocol = true
297299
}
298300
}
299301
}

android-ktx/test/build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ ext {
5555
// comma separated list of annotations for tests that should not be run.
5656
def TEST_FILTER = (!project.hasProperty("testFilter")) ? null : testFilter
5757

58-
// Set true to use mavenLocal instead of Proget
59-
def USE_LOCAL_MAVEN = project.hasProperty("useLocalMaven")
60-
6158

6259
// ----------------------------------------------------------------
6360
// Build
@@ -80,9 +77,7 @@ android {
8077
versionName BUILD_VERSION
8178

8279
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
83-
if (TEST_FILTER != null) {
84-
testInstrumentationRunnerArguments notAnnotation: TEST_FILTER
85-
}
80+
if (TEST_FILTER != null) { testInstrumentationRunnerArguments notAnnotation: TEST_FILTER }
8681
}
8782

8883
sourceSets {
@@ -124,24 +119,27 @@ android {
124119
}
125120

126121
repositories {
127-
if (USE_LOCAL_MAVEN) { mavenLocal() }
128-
maven { url "http://proget.build.couchbase.com/maven2/cimaven" }
122+
if (BUILD_NUMBER == "SNAPSHOT") { mavenLocal() }
123+
maven {
124+
url "http://proget.build.couchbase.com/maven2/cimaven"
125+
allowInsecureProtocol = true
126+
}
129127
google()
130128
mavenCentral()
131129
}
132130

133131
dependencies {
134132
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${KOTLIN_VERSION}"
135-
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1"
133+
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
136134

137135
implementation("com.couchbase.lite:${CBL_ANDROID_LIB}:${BUILD_VERSION}") { changing = true }
138136

139137
testImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${KOTLIN_VERSION}"
140-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1"
138+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
141139
testImplementation 'junit:junit:4.13.2'
142140

143141
androidTestImplementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${KOTLIN_VERSION}"
144-
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.1"
142+
androidTestImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0"
145143
androidTestImplementation 'androidx.test:runner:1.4.0'
146144
androidTestImplementation 'androidx.test:core:1.4.0'
147145
androidTestImplementation 'androidx.test:rules:1.4.0'
@@ -156,3 +154,4 @@ dependencies {
156154
// This target requires setting the property "automatedTests" true.
157155
// See settings.gradle for explanation.
158156
task ciTest(dependsOn: ['connectedDebugAndroidTest'])
157+

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
buildscript {
1818
ext {
1919
COMPILE_SDK_VERSION = 30
20-
BUILD_TOOLS_VERSION = '30.0.3'
21-
KOTLIN_VERSION = '1.5.31'
20+
BUILD_TOOLS_VERSION = '32.0.0'
21+
KOTLIN_VERSION = '1.6.10'
2222

2323
ANDROID_MIN_SDK = 22
2424
ANDROID_TARGET_SDK = 30
@@ -35,7 +35,7 @@ buildscript {
3535

3636
dependencies {
3737
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${KOTLIN_VERSION}"
38-
classpath 'com.android.tools.build:gradle:4.2.2'
38+
classpath 'com.android.tools.build:gradle:7.1.0'
3939
classpath 'gradle.plugin.com.github.spotbugs.snom:spotbugs-gradle-plugin:4.7.5'
4040
}
4141
}

android/etc/jenkins/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
# These versions must match the versions in lib/build.gradle
77
NDK_VERSION='22.0.7026061'
88
CMAKE_VERSION='3.18.1'
9-
BUILD_TOOLS_VERSION='30.0.3'
9+
BUILD_TOOLS_VERSION='32.0.0'
1010

1111
NEXUS_URL="http://nexus.build.couchbase.com:8081/nexus/content/repositories/releases/com/couchbase/litecore"
1212
MAVEN_URL="http://proget.build.couchbase.com/maven2/cimaven"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists

android/lib/build.gradle

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
// Please try to keep this build file as similar to the other family build files
1818
// as is possible.
1919
//
20-
import com.android.build.gradle.tasks.LintGlobalTask
21-
import com.github.spotbugs.snom.SpotBugsTask
22-
2320
import java.time.Instant
2421
import java.util.regex.Pattern
2522

@@ -123,7 +120,7 @@ android {
123120
kotlinOptions { jvmTarget = '1.8' }
124121

125122
// mumbo-jumbo to prevent "More than one file was found" message
126-
packagingOptions { exclude 'META-INF/library_release.kotlin_module' }
123+
packagingOptions { exclude 'META-INF/*' }
127124

128125
defaultConfig {
129126
minSdkVersion ANDROID_MIN_SDK
@@ -141,9 +138,7 @@ android {
141138
buildConfigField "String", "BUILD_COMMIT", "\"${BUILD_COMMIT}\""
142139

143140
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
144-
if (TEST_FILTER != null) {
145-
testInstrumentationRunnerArguments notAnnotation: TEST_FILTER
146-
}
141+
if (TEST_FILTER != null) { testInstrumentationRunnerArguments notAnnotation: TEST_FILTER }
147142
}
148143

149144
buildTypes {
@@ -259,11 +254,14 @@ dependencies {
259254
task javadoc(type: Javadoc) {
260255
failOnError false
261256

257+
afterEvaluate { dependsOn generateReleaseBuildConfig, generateReleaseRFile, compileReleaseKotlin }
258+
262259
source android.sourceSets.main.java.srcDirs
263260
exclude "com/couchbase/lite/internal/**"
264261

265262
classpath += project.files(android.getBootClasspath().join(File.pathSeparator))
266263
classpath += project.files(android.sourceSets.main.java.srcDirs.join(File.pathSeparator))
264+
classpath += project.files("${buildDir}/generated/source/buildConfig/release")
267265
afterEvaluate {
268266
classpath += files(
269267
android.libraryVariants.collect { variant ->
@@ -278,12 +276,9 @@ task javadoc(type: Javadoc) {
278276
encoding = 'UTF-8'
279277
charSet = 'UTF-8'
280278
locale = 'en_US'
281-
links "https://docs.oracle.com/javase/8/docs/api/"
282-
linksOffline "https://developer.android.com/reference/", "${project.android.sdkDirectory}/docs/reference"
279+
links "https://docs.oracle.com/en/java/javase/11/docs/api"
283280
addStringOption('Xdoclint:none', '-quiet')
284-
if (JavaVersion.current() > JavaVersion.VERSION_1_8) {
285-
addBooleanOption('-ignore-source-errors', true)
286-
}
281+
if (JavaVersion.current() > JavaVersion.VERSION_1_8) { addBooleanOption('-ignore-source-errors', true) }
287282
}
288283
}
289284

@@ -364,13 +359,11 @@ task pmd(type: Pmd) {
364359
// is to disable the check.
365360
spotbugs { toolVersion = SPOTBUGS_VERSION }
366361
['Html', 'Xml'].each { reportType ->
367-
task("spotbugs${reportType}", type: SpotBugsTask) {
362+
task("spotbugs${reportType}", type: com.github.spotbugs.snom.SpotBugsTask) {
368363
description "Spotbugs with ${reportType} report"
369364
group 'verification'
370365

371-
afterEvaluate {
372-
dependsOn tasks.find { t -> t.name.endsWith 'compileDebugSources' }
373-
}
366+
afterEvaluate { dependsOn generateDebugRFile, generateReleaseRFile, compileDebugKotlin, compileReleaseKotlin, compileDebugJavaWithJavac }
374367

375368
effort = "max"
376369
reportLevel = "medium"
@@ -500,6 +493,7 @@ publishing {
500493
username mavenRepoUser
501494
password mavenRepoPass
502495
}
496+
allowInsecureProtocol = true
503497
}
504498
}
505499
}
@@ -589,9 +583,8 @@ project.afterEvaluate {
589583
tasks.withType(Javadoc) { shouldRunAfter connectedDebugAndroidTest }
590584
connectedDebugAndroidTest.shouldRunAfter smokeTest
591585
testDebugUnitTest.shouldRunAfter smokeTest
592-
tasks.withType(SpotBugsTask) { shouldRunAfter tasks.withType(Pmd) }
593-
tasks.withType(Pmd) { shouldRunAfter tasks.withType(LintGlobalTask) }
594-
tasks.withType(LintGlobalTask) { shouldRunAfter tasks.withType(Checkstyle) }
586+
tasks.withType(com.github.spotbugs.snom.SpotBugsTask) { shouldRunAfter tasks.withType(Pmd) }
587+
tasks.withType(Pmd) { shouldRunAfter tasks.withType(Checkstyle) }
595588
tasks.withType(Checkstyle) { shouldRunAfter compileDebugSources }
596589
}
597590

0 commit comments

Comments
 (0)