Skip to content

Commit 140dc21

Browse files
authored
Metric overhaul (#1504)
1 parent ccd8ae9 commit 140dc21

File tree

120 files changed

+4537
-449
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+4537
-449
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ GET requests. (Issue [#1517](https://github.com/realm/realm-kotlin/pull/1517))
8686
* File format: Generates Realms with file format v23.
8787
* Realm Studio 13.0.0 or above is required to open Realms created by this version.
8888
* This release is compatible with the following Kotlin releases:
89-
* Kotlin 1.8.0 and above. The K2 compiler is not supported yet.
89+
* Kotlin 1.8.20 and above. The K2 compiler is not supported yet.
9090
* Ktor 2.1.2 and above.
9191
* Coroutines 1.7.0 and above.
9292
* AtomicFu 0.18.3 and above.

Jenkinsfile

+11-2
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,11 @@ pipeline {
8484
ANDROID_NDK="${NDK_HOME}"
8585
ANDROID_NDK_HOME="${NDK_HOME}"
8686
REALM_DISABLE_ANALYTICS=true
87+
REALM_PRINT_ANALYTICS=true
88+
REALM_FAIL_ON_ANALYTICS_ERRORS=false
8789
JAVA_8='/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home'
8890
JAVA_11='/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home'
91+
JAVA_17='/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home'
8992
JAVA_HOME="${JAVA_11}"
9093
}
9194
stages {
@@ -246,8 +249,14 @@ pipeline {
246249
stage('Gradle Plugin Integration Tests') {
247250
when { expression { runTests } }
248251
steps {
249-
testAndCollect("integration-tests/gradle-plugin-test", "integrationTest")
250-
testAndCollect("integration-tests/gradle-plugin-test", "-Pkotlin.experimental.tryK2=true integrationTest")
252+
testAndCollect("integration-tests/gradle/current", "integrationTest")
253+
testAndCollect("integration-tests/gradle/current", "-Pkotlin.experimental.tryK2=true integrationTest")
254+
testAndCollect("integration-tests/gradle/gradle6-test", "integrationTest")
255+
testAndCollect("integration-tests/gradle/gradle71-test", "integrationTest")
256+
testAndCollect("integration-tests/gradle/gradle75-test", "integrationTest")
257+
withEnv(["JAVA_HOME=${JAVA_17}"]) {
258+
testAndCollect("integration-tests/gradle/gradle8-test", "integrationTest")
259+
}
251260
}
252261
}
253262
stage('Tests Android Sample App') {

build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fun readAndCacheVersion(): String {
4848
return version
4949
}
5050
val currentVersion = readAndCacheVersion()
51-
val subprojects = listOf("packages", "integration-tests/gradle-plugin-test", "examples/kmm-sample", "benchmarks")
51+
val subprojects = listOf("packages", "examples/kmm-sample", "benchmarks")
5252
fun taskName(subdir: String): String {
5353
return subdir.split("/", "-").map { it.capitalize() }.joinToString(separator = "")
5454
}

examples/min-android-sample/build.gradle.kts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ buildscript {
1515
}
1616
dependencies {
1717
classpath("com.android.tools.build:gradle:4.1.3")
18-
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
18+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
1919
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
2020
}
2121
}

examples/min-android-sample/gradle.properties

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1313
# org.gradle.parallel=true
1414
# Kotlin code style for this project: "official" or "obsolete":
1515
kotlin.code.style=official
16-
android.useAndroidX=true
16+
android.useAndroidX=true
17+
18+
org.gradle.configuration-cache=true

integration-tests/README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
This folder holds the various integration test projects.
44

5-
- `gradle-plugin-test` - Smoke test project that verifies that our top level Gradle plugin can be
5+
- `gradle/` - Various smoke test project that verifies that our top level Gradle plugin can be
66
applied on a both single and a multi platform modules. It is currently testing:
77
- `single-platform` - Android single module project
88
- `multi-platform` - Kotlin Multiplatform project with JVM and Native targets running on the host
99
platform.
10+
There are various project with specific Gradle versions that has been proven troublesome with
11+
regards to collecting analytics data and a `current` project that will use the versions used to
12+
build the SDK.

integration-tests/gradle-plugin-test/buildSrc

-1
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../buildSrc

integration-tests/gradle-plugin-test/gradle.properties integration-tests/gradle/current/gradle.properties

+1
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ kotlin.mpp.stability.nowarn=true
2828
kotlin.native.binary.memoryModel=experimental
2929
kotlin.native.binary.freezing=disabled
3030

31+
org.gradle.configuration-cache=true

integration-tests/gradle-plugin-test/settings.gradle.kts integration-tests/gradle/current/settings.gradle.kts

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ pluginManagement {
2222
gradlePluginPortal()
2323
google()
2424
mavenCentral()
25-
maven("file://${rootDir.absolutePath}/../../packages/build/m2-buildrepo")
25+
maven("file://${rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
2626
}
2727
}
2828
dependencyResolutionManagement {
2929
repositories {
3030
google()
3131
mavenCentral()
32-
maven("file://${rootDir.absolutePath}/../../packages/build/m2-buildrepo")
32+
maven("file://${rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
3333
}
3434
}
3535

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
/*
2+
* Copyright 2022 Realm Inc.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13+
* or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
// Explicitly adding the plugin to the classpath as it makes it easier to control the version
19+
// centrally (don't need version in the 'plugins' block). Further, snapshots are not published with
20+
// marker interface so would need to be added to the classpath manually anyway.
21+
buildscript {
22+
extra["realmVersion"] = file("${rootProject.rootDir.absolutePath}/../../../buildSrc/src/main/kotlin/Config.kt")
23+
.readLines()
24+
.first { it.contains("const val version") }
25+
.let {
26+
it.substringAfter("\"").substringBefore("\"")
27+
}
28+
29+
repositories {
30+
maven(url = "file://${rootProject.rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
31+
gradlePluginPortal()
32+
google()
33+
mavenCentral()
34+
}
35+
dependencies {
36+
classpath("com.android.tools.build:gradle:4.2.2")
37+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
38+
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
39+
}
40+
}
41+
group = "io.realm.test"
42+
version = rootProject.extra["realmVersion"]
43+
44+
// Attempt to make an easy entry point for verifying all modules. Maybe we could do a better split
45+
// when migrating to GHA.
46+
tasks.register("integrationTest") {
47+
dependsOn(":single-platform:connectedDebugAndroidTest")
48+
dependsOn(":multi-platform:cleanAllTests")
49+
dependsOn(":multi-platform:jvmTest")
50+
dependsOn(":multi-platform:nativeTest")
51+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#
2+
# Copyright 2022 Realm Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
13+
# or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
#
17+
18+
kotlin.code.style=official
19+
20+
org.gradle.jvmargs=-Xmx4096M
21+
22+
android.useAndroidX=true
23+
android.enableJetifier=true
24+
25+
kotlin.mpp.stability.nowarn=true
26+
27+
# Enable new memory model as default
28+
kotlin.native.binary.memoryModel=experimental
29+
kotlin.native.binary.freezing=disabled
30+
31+
org.gradle.configuration-cache=true
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)