import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootPlugin buildscript { ext.kotlin_version = "1.9.23" ext.atomicfu_version = '0.23.2' ext.version_shadow = "8.1.1" ext.ksp_version = "1.0.19" repositories { google() mavenCentral() gradlePluginPortal() } } plugins { id 'com.android.application' version '8.2.0' apply false id 'com.android.library' version '8.2.0' apply false id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false id 'org.jetbrains.kotlin.plugin.serialization' version "$kotlin_version" apply false id 'org.jetbrains.kotlin.plugin.atomicfu' version "$kotlin_version" apply false id "com.github.ben-manes.versions" version "0.47.0" id "com.google.devtools.ksp" version "$kotlin_version-$ksp_version" apply false } group 'com.github.UstadMobile.door' version '0.79.15' ext.localProperties = new Properties() //Defaults ext.localProperties["door.postgresUrl"] = "" ext.localProperties["door.postgresUser"] = "" ext.localProperties["door.postgresPass"] = "" if(project.file("local.properties").exists()) { ext.localProperties.load(new FileInputStream(project.file("local.properties"))) } if(System.getenv("DOOR_POSTGRES_URL") != null) { ext.localProperties["door.postgresUrl"] = System.getenv("DOOR_POSTGRES_URL") } if(System.getenv("DOOR_POSTGRES_USER") != null) { ext.localProperties["door.postgresUser"] = System.getenv("DOOR_POSTGRES_USER") } if(System.getenv("DOOR_POSTGRES_PASS") != null) { ext.localProperties["door.postgresPass"] = System.getenv("DOOR_POSTGRES_PASS") } ext { version_kotlin_wrappers_bom = "1.0.0-pre.721" version_android_compile_sdk = 34 version_android_target_sdk = 34 } allprojects { repositories { google() mavenCentral() } } //Find stable updates only as per https://github.com/ben-manes/gradle-versions-plugin def isNonStable = { String version -> def hasPreReleaseKeywords = ["BETA", "ALPHA", "RC"].any { it -> version.toUpperCase().contains(it)} return hasPreReleaseKeywords } // https://github.com/ben-manes/gradle-versions-plugin tasks.named("dependencyUpdates").configure { rejectVersionIf { isNonStable(it.candidate.version) } } /** * This was added as per pull request https://github.com/UstadMobile/door/pull/7 to use a version of node that is * compatible with Jitpack's out of date version. This can be removed once we move to mavencentral. */ //noinspection UnnecessaryQualifiedReference //noinspection GrUnresolvedAccess //noinspection ConfigurationAvoidance rootProject.plugins.withType(NodeJsRootPlugin) { rootProject.extensions.getByType(NodeJsRootExtension).nodeVersion = "16.15.1" }