// Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { ext.version_kotlin = '1.9.23' ext.version_shadow = "8.1.1" ext.atomicfu_version = '0.23.2' ext.version_ktor = "2.3.9" ext.version_moko_resources = "0.23.0" repositories { google() mavenCentral() gradlePluginPortal() //Compose multiplatform as per https://github.com/JetBrains/compose-multiplatform-desktop-template/#readme maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" } } } plugins { id 'com.android.application' version '8.5.2' apply false id 'com.android.library' version '8.5.2' apply false id 'org.jetbrains.kotlin.android' version "$version_kotlin" apply false id 'org.jetbrains.kotlin.plugin.serialization' version "$version_kotlin" apply false id 'org.jetbrains.kotlin.plugin.atomicfu' version "$version_kotlin" apply false id 'dev.icerock.mobile.multiplatform-resources' version "$version_moko_resources" apply false id "com.github.ben-manes.versions" version "0.49.0" id 'org.jetbrains.kotlin.jvm' version "$version_kotlin" apply false alias(libs.plugins.jetbrains.compose) apply false id 'com.github.gmazzo.buildconfig' version '5.3.5' apply false id 'com.android.test' version '8.5.2' apply false // Version of Android.baselineprofile as per // https://mvnrepository.com/artifact/androidx.baselineprofile/androidx.baselineprofile.gradle.plugin id 'androidx.baselineprofile' version '1.2.4' apply false id 'base' } allprojects { repositories { google() mavenCentral() mavenLocal() //Primary Maven repository for artifacts built on UstadMobile Jenkins // Includes Door and Jetpack Media3 AV1 decoder maven { url "https://devserver3.ustadmobile.com/maven2" } maven { url "https://devserver3.ustadmobile.com/maven" } maven { url "https://devserver3.ustadmobile.com/repo-mvn" } maven { url "https://jitpack.io" } //WordPress Utils Android - https://github.com/wordpress-mobile/WordPress-Utils-Android // Used by Aztec maven { url "https://a8c-libs.s3.amazonaws.com/android" } maven { url "https://repository.jboss.org/nexus/content/repositories/thirdparty-releases/" } //Compose multiplatform maven { url "https://maven.pkg.jetbrains.space/public/p/compose/dev" } //JUnique (required to prevent multiple instqances of desktop app) //As per https://github.com/terjedahl/junique maven { url "https://raw.githubusercontent.com/terjedahl/junique/master/maven2" } } } //Major.minor.database version version = "0.4.137" group = "com.ustadmobile.app" /** * Useful repository listings: * Android: https://maven.google.com/web/index.html * Kotlin: https://package-search.jetbrains.com/ */ ext { ustadVersion = project.version ustadVersionCode = 361 version_gradle_buildconfig_plugin = "1.1.7" version_ksp = "1.0.19" version_kotlin_jvmTarget = "17" //We need to use an exclude on this dependency, so cannot use only the TOML version_jcabi_manifests = "2.1.0" version_android_buildtools = "30.0.2" version_android_compile_sdk = 34 version_android_target_sdk = 34 version_android_min_sdk = 21 /*Kotlin react web app*/ kotlinWrappersVersion = "1.0.0-pre.721" version_npm_mement_io = "^2.14.0" //Should be as specified by kotlinx datetime lib https://github.com/Kotlin/kotlinx-datetime#note-about-time-zones-in-js version_npm_joda_timezone = "2.3.0" version_npm_timezones = "^1.6.1" version_npm_emotion = "11.10.5" version_npm_date_fns = "2.29.1" version_npm_mime_matcher = "^1.0.5" version_npm_react_quill = "2.0.0" version_npm_striptags = "^3.2.0" version_npm_react_easy_sort = "^1.5.1" version_npm_mui_tel_input = "4.0.1" version_npm_libphonenumber_js = "^1.10.47" version_npm_linkify = "^4.1.3" version_npm_dompurify = "^3.0.11" version_pdfview_android = "1.1.0" version_pdfview_android = "1.1.0" version_npm_uuid = "^9.0.1" version_compressorjs = "^1.2.1" version_npm_xxhash = "^0.2.2" version_npm_cuint = "^0.2.2" } /* * Look for a command. If a variable in buildconfig specifies the path, and the file exists, then * use the variable value. Otherwise search the system path. */ ext.findCommand = {String command, String buildConfigVarName -> if(ext.buildConfigProperties.containsKey(buildConfigVarName) && rootProject.file(ext.buildConfigProperties.getProperty(buildConfigVarName)).exists()) { return ext.buildConfigProperties.getProperty(buildConfigVarName) }else { def pathDirs = System.getenv("PATH").split(File.pathSeparator) for(path in pathDirs) { if(file("$path/$command").exists()) { return "$path/$command" } } } return "PATHNOTFOUND" } ext.buildConfigProperties = new Properties() ext.buildConfigProperties.load(new FileInputStream(project.file("buildconfig.default.properties"))) if(project.file("buildconfig.local.properties").exists()) { ext.buildConfigProperties.load(new FileInputStream(project.file("buildconfig.local.properties"))) } if(System.getenv("TESTSERVER_HOST") != null) { ext.buildConfigProperties["test.um_http_testserver"] = System.getenv("TESTSERVER_HOST") } if(System.getenv("TESTSERVER_PORT") != null) { ext.buildConfigProperties["test.um_http_testserver_controlport"] = System.getenv("TESTSERVER_PORT") } ext.localProperties = new Properties() if(project.file("local.properties").exists()) { ext.localProperties.load(new FileInputStream(project.file("local.properties"))) } if(System.getenv("ACRA_HTTP_URI") != null) { ext.buildConfigProperties["android.acra.url"] = System.getenv("ACRA_HTTP_URI") } if(System.getenv("ACRA_BASIC_LOGIN") != null) { ext.buildConfigProperties["android.acra.user"] = System.getenv("ACRA_BASIC_LOGIN") } if(System.getenv("ACRA_BASIC_PASS") != null) { ext.buildConfigProperties["android.acra.auth"] = System.getenv("ACRA_BASIC_PASS") } if(System.getenv("DOORDB_POSTGRES_URL") != null) { ext.buildConfigProperties["doordb_postgres_url"] = System.getenv("DOORDB_POSTGRES_URL") } if(System.getenv("DOORDB_POSTGRES_USER") != null) { ext.buildConfigProperties["doordb_postgres_user"] = System.getenv("DOORDB_POSTGRES_USER") } if(System.getenv("DOORDB_POSTGRES_PASSWORD") != null) { ext.buildConfigProperties["doordb_postgres_password"] = System.getenv("DOORDB_POSTGRES_PASSWORD") } //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) } } clean { delete("test-end-to-end/android-maestro/build", "test-end-to-end/webapp-cypress/cypress/videos", "test-end-to-end/webapp-cypress/cypress/screenshots", "test-end-to-end/webapp-cypress/results", "test-end-to-end/webapp-cypress/logs") }