buildscript { ext.kotlin_version = "1.9.0" dependencies { classpath "com.android.tools.build:gradle:8.0.1" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { id 'org.jetbrains.kotlin.multiplatform' version "$kotlin_version" id 'com.android.library' id 'maven-publish' } group = 'com.github.UstadMobile' version = '0.0.26' def localProperties = new Properties() if(project.file("local.properties").exists()) { localProperties.load(new FileInputStream(project.file("local.properties"))) } repositories { google() mavenCentral() } kotlin { //As per https://developer.android.com/build/jdks#toolchain jvmToolchain { languageVersion.set(JavaLanguageVersion.of(17)) } jvm { compilations.all { kotlinOptions.jvmTarget = JavaVersion.VERSION_17 } testRuns["test"].executionTask.configure { useJUnit() } } js(IR) { browser { testTask { useKarma { useChromeHeadless() //change to useChrome to run the actual browser } } } } androidTarget { publishLibraryVariants("release", "debug") } sourceSets { commonMain { } commonTest { dependencies { implementation kotlin('test-common') implementation kotlin('test-annotations-common') } } jvmMain { dependencies { implementation "net.sf.kxml:kxml2:2.3.0" } } jvmTest { dependencies { implementation kotlin('test-junit') } } jsMain { } jsTest { dependencies { implementation kotlin('test-js') } } androidMain { dependencies { } } androidTest { dependencies { implementation kotlin('test-junit') implementation 'junit:junit:4.13.2' } } } } android { compileSdk 33 sourceSets.main.manifest.srcFile('src/androidMain/AndroidManifest.xml') defaultConfig { minSdkVersion 21 targetSdkVersion 33 } compileOptions { sourceCompatibility = JavaVersion.VERSION_17 targetCompatibility = JavaVersion.VERSION_17 } namespace 'org.kmp.xmlpullparser.library' } publishing { repositories { //Set this in local.properties maven { url localProperties["repo.dir"] } } }