Skip to content

Commit

Permalink
Remove more warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
clementetb committed Jun 3, 2024
1 parent 43c0037 commit 453f8a9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
11 changes: 11 additions & 0 deletions packages/cinterop/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -808,3 +808,14 @@ abstract class CmakeVersionProvider : ValueSource<String, ValueSourceParameters.
return cmakeVersion.value
}
}

// enable execution optimizations for generateSdkVersionConstant
tasks.filter {
"$it".endsWith("sourcesjar'", ignoreCase = true)
}.forEach {
it.dependsOn(generateSdkVersionConstant)
}

afterEvaluate {
tasks.getByName("androidReleaseSourcesJar").dependsOn(generateSdkVersionConstant)
}
1 change: 1 addition & 0 deletions packages/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,4 @@ syncTestLoginPassword=password
# syncTestLoginPublicApiKey=replace-with-value
# synctestLoginPrivateApiKey=replace-with-value
# syncTestClusterName=replace-with-value
android.disableAutomaticComponentCreation=true
5 changes: 1 addition & 4 deletions packages/library-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -124,10 +124,7 @@ kotlin {
// Using a custom name module for internal methods to avoid default name mangling in Kotlin compiler which uses the module
// name and build type variant as a suffix, this default behaviour can cause mismatch at runtime https://github.com/realm/realm-kotlin/issues/621
tasks.withType<KotlinCompile>().configureEach {
compilerOptions {
freeCompilerArgs.add("-module-name")
freeCompilerArgs.add("io.realm.kotlin.library")
}
compilerOptions.moduleName.set("io.realm.kotlin.library")
}

tasks.withType<KotlinCompilationTask<*>>().configureEach {
Expand Down
11 changes: 6 additions & 5 deletions packages/library-sync/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.build.joinToReadableString
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

Expand Down Expand Up @@ -28,6 +29,7 @@ buildscript {
classpath("org.jetbrains.kotlinx:atomicfu-gradle-plugin:${Versions.atomicfu}")
}
}

apply(plugin = "kotlinx-atomicfu")
// AtomicFu cannot transform JVM code. Maybe an issue with using IR backend. Throws
// ClassCastException: org.objectweb.asm.tree.InsnList cannot be cast to java.lang.Iterable
Expand Down Expand Up @@ -126,19 +128,18 @@ tasks.withType<KotlinCompilationTask<*>>().configureEach {
}

tasks.withType<KotlinCompile>().configureEach {
compilerOptions.freeCompilerArgs.add("-module-name")
compilerOptions.freeCompilerArgs.add("io.realm.kotlin.library")
compilerOptions.moduleName.set("io.realm.kotlin.library")
}

// Android configuration
android {
namespace = "io.realm.kotlin.mongodb"
compileSdkVersion(Versions.Android.compileSdkVersion)
compileSdk = Versions.Android.compileSdkVersion
buildToolsVersion = Versions.Android.buildToolsVersion

defaultConfig {
minSdkVersion(Versions.Android.minSdk)
targetSdkVersion(Versions.Android.targetSdk)
minSdk = Versions.Android.minSdk
targetSdk = Versions.Android.targetSdk
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

sourceSets {
Expand Down

0 comments on commit 453f8a9

Please sign in to comment.