Skip to content

Commit

Permalink
Metric overhaul (#1504)
Browse files Browse the repository at this point in the history
  • Loading branch information
rorbech authored Nov 15, 2023
1 parent ccd8ae9 commit 140dc21
Show file tree
Hide file tree
Showing 120 changed files with 4,537 additions and 449 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ GET requests. (Issue [#1517](https://github.com/realm/realm-kotlin/pull/1517))
* File format: Generates Realms with file format v23.
* Realm Studio 13.0.0 or above is required to open Realms created by this version.
* This release is compatible with the following Kotlin releases:
* Kotlin 1.8.0 and above. The K2 compiler is not supported yet.
* Kotlin 1.8.20 and above. The K2 compiler is not supported yet.
* Ktor 2.1.2 and above.
* Coroutines 1.7.0 and above.
* AtomicFu 0.18.3 and above.
Expand Down
13 changes: 11 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,11 @@ pipeline {
ANDROID_NDK="${NDK_HOME}"
ANDROID_NDK_HOME="${NDK_HOME}"
REALM_DISABLE_ANALYTICS=true
REALM_PRINT_ANALYTICS=true
REALM_FAIL_ON_ANALYTICS_ERRORS=false
JAVA_8='/Library/Java/JavaVirtualMachines/jdk1.8.0_301.jdk/Contents/Home'
JAVA_11='/Library/Java/JavaVirtualMachines/jdk-11.0.12.jdk/Contents/Home'
JAVA_17='/Library/Java/JavaVirtualMachines/jdk-17.0.2.jdk/Contents/Home'
JAVA_HOME="${JAVA_11}"
}
stages {
Expand Down Expand Up @@ -246,8 +249,14 @@ pipeline {
stage('Gradle Plugin Integration Tests') {
when { expression { runTests } }
steps {
testAndCollect("integration-tests/gradle-plugin-test", "integrationTest")
testAndCollect("integration-tests/gradle-plugin-test", "-Pkotlin.experimental.tryK2=true integrationTest")
testAndCollect("integration-tests/gradle/current", "integrationTest")
testAndCollect("integration-tests/gradle/current", "-Pkotlin.experimental.tryK2=true integrationTest")
testAndCollect("integration-tests/gradle/gradle6-test", "integrationTest")
testAndCollect("integration-tests/gradle/gradle71-test", "integrationTest")
testAndCollect("integration-tests/gradle/gradle75-test", "integrationTest")
withEnv(["JAVA_HOME=${JAVA_17}"]) {
testAndCollect("integration-tests/gradle/gradle8-test", "integrationTest")
}
}
}
stage('Tests Android Sample App') {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun readAndCacheVersion(): String {
return version
}
val currentVersion = readAndCacheVersion()
val subprojects = listOf("packages", "integration-tests/gradle-plugin-test", "examples/kmm-sample", "benchmarks")
val subprojects = listOf("packages", "examples/kmm-sample", "benchmarks")
fun taskName(subdir: String): String {
return subdir.split("/", "-").map { it.capitalize() }.joinToString(separator = "")
}
Expand Down
2 changes: 1 addition & 1 deletion examples/min-android-sample/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ buildscript {
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.3")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.20")
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
}
}
Expand Down
4 changes: 3 additions & 1 deletion examples/min-android-sample/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# org.gradle.parallel=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
android.useAndroidX=true
android.useAndroidX=true

org.gradle.configuration-cache=true
5 changes: 4 additions & 1 deletion integration-tests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@

This folder holds the various integration test projects.

- `gradle-plugin-test` - Smoke test project that verifies that our top level Gradle plugin can be
- `gradle/` - Various smoke test project that verifies that our top level Gradle plugin can be
applied on a both single and a multi platform modules. It is currently testing:
- `single-platform` - Android single module project
- `multi-platform` - Kotlin Multiplatform project with JVM and Native targets running on the host
platform.
There are various project with specific Gradle versions that has been proven troublesome with
regards to collecting analytics data and a `current` project that will use the versions used to
build the SDK.
1 change: 0 additions & 1 deletion integration-tests/gradle-plugin-test/buildSrc

This file was deleted.

1 change: 1 addition & 0 deletions integration-tests/gradle/current/buildSrc
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,4 @@ kotlin.mpp.stability.nowarn=true
kotlin.native.binary.memoryModel=experimental
kotlin.native.binary.freezing=disabled

org.gradle.configuration-cache=true
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ pluginManagement {
gradlePluginPortal()
google()
mavenCentral()
maven("file://${rootDir.absolutePath}/../../packages/build/m2-buildrepo")
maven("file://${rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
}
}
dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven("file://${rootDir.absolutePath}/../../packages/build/m2-buildrepo")
maven("file://${rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
}
}

Expand Down
51 changes: 51 additions & 0 deletions integration-tests/gradle/gradle6-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/*
* Copyright 2022 Realm Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
* or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

// Explicitly adding the plugin to the classpath as it makes it easier to control the version
// centrally (don't need version in the 'plugins' block). Further, snapshots are not published with
// marker interface so would need to be added to the classpath manually anyway.
buildscript {
extra["realmVersion"] = file("${rootProject.rootDir.absolutePath}/../../../buildSrc/src/main/kotlin/Config.kt")
.readLines()
.first { it.contains("const val version") }
.let {
it.substringAfter("\"").substringBefore("\"")
}

repositories {
maven(url = "file://${rootProject.rootDir.absolutePath}/../../../packages/build/m2-buildrepo")
gradlePluginPortal()
google()
mavenCentral()
}
dependencies {
classpath("com.android.tools.build:gradle:4.2.2")
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.0")
classpath("io.realm.kotlin:gradle-plugin:${rootProject.extra["realmVersion"]}")
}
}
group = "io.realm.test"
version = rootProject.extra["realmVersion"]

// Attempt to make an easy entry point for verifying all modules. Maybe we could do a better split
// when migrating to GHA.
tasks.register("integrationTest") {
dependsOn(":single-platform:connectedDebugAndroidTest")
dependsOn(":multi-platform:cleanAllTests")
dependsOn(":multi-platform:jvmTest")
dependsOn(":multi-platform:nativeTest")
}
31 changes: 31 additions & 0 deletions integration-tests/gradle/gradle6-test/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# Copyright 2022 Realm Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

kotlin.code.style=official

org.gradle.jvmargs=-Xmx4096M

android.useAndroidX=true
android.enableJetifier=true

kotlin.mpp.stability.nowarn=true

# Enable new memory model as default
kotlin.native.binary.memoryModel=experimental
kotlin.native.binary.freezing=disabled

org.gradle.configuration-cache=true
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 140dc21

Please sign in to comment.