apply plugin: "kotlin-multiplatform" apply plugin: 'com.android.library' apply plugin: 'maven-publish' apply plugin: 'kotlinx-serialization' group rootProject.group version rootProject.version android { compileSdkVersion rootProject.ext.version_android_compile_sdk defaultConfig { minSdkVersion 21 targetSdkVersion 31 } packagingOptions { resources { excludes += ['META-INF/INDEX.LIST', '**/*.kotlin_metadata', 'META-INF/*.kotlin_module', 'licenses/**.TXT'] } } compileOptions { sourceCompatibility = '1.8' targetCompatibility = '1.8' } namespace 'com.ustadmobile.lib.util' tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile) { kotlinOptions { jvmTarget = "1.8" } } } sourceCompatibility = '1.8' targetCompatibility = '1.8' group rootProject.group version rootProject.version // workaround for https://youtrack.jetbrains.com/issue/KT-27170 configurations { compileClasspath } kotlin { jvm { compilations.main.kotlinOptions { // Setup the Kotlin compiler options for the 'main' compilation: jvmTarget = "$version_kotlin_jvmTarget" } compilations.test.kotlinOptions { // Setup the Kotlin compiler options for the 'main' compilation: jvmTarget = "$version_kotlin_jvmTarget" } } android() js(LEGACY) { browser { testTask { useKarma { useChromeHeadless() //change to useChrome to run the actual browser webpackConfig.cssSupport.enabled = true } } } } sourceSets { commonMain { dependencies { implementation kotlin('stdlib-common') implementation "io.github.aakira:napier:$version_napier" implementation "io.ktor:ktor-client-core:$version_ktor" implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$version_coroutines" implementation "com.github.UstadMobile.door:door-runtime:$version_door" implementation "com.ustadmobile.xmlpullparserkmp:xmlpullparserkmp:$version_xmlpullparserkmp" } } commonJvmMain { dependencies { compileOnly "net.sf.kxml:kxml2:$version_kxml" } } commonTest { dependencies { implementation kotlin('test-common') implementation kotlin('test-annotations-common') } } jvmMain { dependencies { implementation "com.github.h-thurow:simple-jndi:$version_simple_jndi" } dependsOn commonJvmMain } jvmTest { dependencies { implementation "org.jetbrains.kotlin:kotlin-test:$version_kotlin" implementation "org.jetbrains.kotlin:kotlin-test-junit:$version_kotlin" } } androidMain { dependencies { implementation "androidx.lifecycle:lifecycle-livedata-ktx:$version_androidx_lifecycle" implementation "androidx.room:room-runtime:$version_android_room" } dependsOn commonJvmMain } } } publishing { publications { maven(MavenPublication) { groupId rootProject.group artifactId project.name version rootProject.version } } repositories { maven { url rootProject.ext.buildConfigProperties['repo.dir'] } } }