diff --git a/.circleci/config.yml b/.circleci/config.yml index bd2004e921..b66ac53c71 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -25,8 +25,8 @@ jobs: - android/start-emulator-and-run-tests: system-image: system-images;android-29;google_apis;x86 # Compile while the emulator starts to use the time. - post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources database:impl:compileFullDebugAndroidTestSources - test-command: ./gradlew database:impl:connectedFullDebugAndroidTest + post-emulator-launch-assemble-command: ./gradlew compileFullDebugUnitTestSources compileFullDebugAndroidTestSources + test-command: ./gradlew connectedFullDebugAndroidTest - android/run-tests: test-command: ./gradlew testFullDebugUnitTest diff --git a/app/build.gradle b/app/build.gradle deleted file mode 100644 index 401db3a2b4..0000000000 --- a/app/build.gradle +++ /dev/null @@ -1,282 +0,0 @@ -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' - id 'kotlinx-serialization' - id 'com.google.gms.google-services' - id 'com.google.firebase.crashlytics' - id 'com.vanniktech.dependency.graph.generator' - -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -repositories { - mavenCentral() - google() -} - -def generateGitBuild = { -> - StringBuilder stringBuilder = new StringBuilder() - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'describe', '--always' - standardOutput = stdout - } - String commitObject = stdout.toString().trim() - stringBuilder.append(commitObject) - } catch (ignored) { - stringBuilder.append('NoGitSystemAvailable') - } - return stringBuilder.toString() -} - -def generateGitRemote = { -> - StringBuilder stringBuilder = new StringBuilder() - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'remote', 'get-url', 'origin' - standardOutput = stdout - } - String commitObject = stdout.toString().trim() - stringBuilder.append(commitObject) - } catch (ignored) { - stringBuilder.append('NoGitSystemAvailable') - } - return stringBuilder.toString() -} - -def generateDate = { -> - StringBuilder stringBuilder = new StringBuilder() - // showing only date prevents app to rebuild everytime - stringBuilder.append((new Date()).format('yyyy.MM.dd')) - return stringBuilder.toString() -} - -def isMaster = { -> - return !version.contains('-') -} - -def gitAvailable = { -> - StringBuilder stringBuilder = new StringBuilder() - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', '--version' - standardOutput = stdout - } - String commitObject = stdout.toString().trim() - stringBuilder.append(commitObject) - } catch (ignored) { - return false // NoGitSystemAvailable - } - return !stringBuilder.toString().isEmpty() - -} - -def allCommitted = { -> - StringBuilder stringBuilder = new StringBuilder() - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'status', '-s' - standardOutput = stdout - } - // ignore all changes done in .idea/codeStyles - String cleanedList = stdout.toString().replaceAll(/(?m)^\s*(M|A|D|\?\?)\s*.*?\.idea\/codeStyles\/.*?\s*$/, "") - // ignore all files added to project dir but not staged/known to GIT - cleanedList = cleanedList.replaceAll(/(?m)^\s*(\?\?)\s*.*?\s*$/, "") - stringBuilder.append(cleanedList.trim()) - } catch (ignored) { - return false // NoGitSystemAvailable - } - return stringBuilder.toString().isEmpty() -} - -android { - - namespace 'app.aaps' - ndkVersion "21.1.6352462" - - defaultConfig { - multiDexEnabled true - versionCode 1500 - version "3.2.0-dev-m" - buildConfigField "String", "VERSION", '"' + version + '"' - buildConfigField "String", "BUILDVERSION", '"' + generateGitBuild() + '-' + generateDate() + '"' - buildConfigField "String", "REMOTE", '"' + generateGitRemote() + '"' - buildConfigField "String", "HEAD", '"' + generateGitBuild() + '"' - buildConfigField "String", "COMMITTED", '"' + allCommitted() + '"' - - } - - flavorDimensions = ["standard"] - productFlavors { - full { - getIsDefault().set(true) - applicationId "info.nightscout.androidaps" - dimension "standard" - resValue "string", "app_name", "AAPS" - versionName version - manifestPlaceholders = [ - appIcon : "@mipmap/ic_launcher", - appIconRound: "@mipmap/ic_launcher_round" - ] - } - pumpcontrol { - applicationId "info.nightscout.aapspumpcontrol" - dimension "standard" - resValue "string", "app_name", "Pumpcontrol" - versionName version + "-pumpcontrol" - manifestPlaceholders = [ - appIcon : "@mipmap/ic_pumpcontrol", - appIconRound: "@null" - ] - } - aapsclient { - applicationId "info.nightscout.aapsclient" - dimension "standard" - resValue "string", "app_name", "AAPSClient" - versionName version + "-aapsclient" - manifestPlaceholders = [ - appIcon : "@mipmap/ic_yellowowl", - appIconRound: "@mipmap/ic_yellowowl" - ] - } - aapsclient2 { - applicationId "info.nightscout.aapsclient2" - dimension "standard" - resValue "string", "app_name", "AAPSClient2" - versionName version + "-aapsclient" - manifestPlaceholders = [ - appIcon : "@mipmap/ic_blueowl", - appIconRound: "@mipmap/ic_blueowl" - ] - } - } - - useLibrary "org.apache.http.legacy" - - dataBinding { //Deleting it causes a binding error - enabled = true - } -} - -allprojects { - repositories { - } -} - -dependencies { - wearApp project(':wear') - - // in order to use internet's versions you'd need to enable Jetifier again - // https://github.com/nightscout/graphview.git - // https://github.com/nightscout/iconify.git - implementation project(':shared:impl') - implementation project(':core:main') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:libraries') - implementation project(':core:nssdk') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':ui') - implementation project(':plugins:aps') - implementation project(':plugins:automation') - implementation project(':plugins:configuration') - implementation project(':plugins:constraints') - implementation project(':plugins:insulin') - implementation project(':plugins:main') - implementation project(':plugins:sensitivity') - implementation project(':plugins:smoothing') - implementation project(':plugins:source') - implementation project(':plugins:sync') - implementation project(':implementation') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':pump:combo') - implementation project(':pump:combov2') - implementation project(':pump:dana') - implementation project(':pump:danars') - implementation project(':pump:danar') - implementation project(':pump:diaconn') - implementation project(':pump:eopatch') - implementation project(':pump:medtrum') - implementation project(':insight') - implementation project(':pump:medtronic') - implementation project(':pump:pump-common') - implementation project(':pump:omnipod-common') - implementation project(':pump:omnipod-eros') - implementation project(':pump:omnipod-dash') - implementation project(':pump:rileylink') - implementation project(':pump:virtual') - implementation project(':workflow') - - testImplementation project(':shared:tests') - - implementation fileTree(include: ['*.jar'], dir: 'libs') - - /* Dagger2 - We are going to use dagger.android which includes - * support for Activity and fragment injection so we need to include - * the following dependencies */ - kapt "com.google.dagger:dagger-android-processor:$dagger_version" - kapt "com.google.dagger:dagger-compiler:$dagger_version" - - // MainApp - api "com.uber.rxdogtag2:rxdogtag:2.0.2" - -} - -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" - - -/* -// Run 'adb' shell command to clear application data of main app for 'debug' variant -task clearMainAppData(type: Exec) { - // we have to iterate to find the 'debug' variant to obtain a variant reference - android.applicationVariants.all { variant -> - if (variant.name == "fullDebug") { - def applicationId = [variant.mergedFlavor.applicationId, variant.buildType.applicationIdSuffix].findAll().join() - def clearDataCommand = ['adb', 'shell', 'pm', 'clear', applicationId] - println "Clearing application data of ${variant.name} variant: [${clearDataCommand}]" - def stdout = new ByteArrayOutputStream() - exec { - commandLine clearDataCommand - standardOutput = stdout - } - String result = stdout.toString().trim() - if (!result.startsWith("Success")) { - println result - throw new GradleException(clearDataCommand.join(" ")) - } - } - } -} -// Clear Application Data (once) before running instrumentation test -tasks.whenTaskAdded { task -> - // Both of these targets are equivalent today, although in future connectedCheck - // will also include connectedUiAutomatorTest (not implemented yet) - if(task.name == "connectedAndroidTest" || task.name == "connectedCheck"){ - task.dependsOn(clearMainAppData) - } -} -*/ - -printf('--------------\n') -printf('isMaster: %s\n', isMaster().toString()) -printf('gitAvailable: %s\n', gitAvailable().toString()) -printf('allCommitted: %s\n', allCommitted().toString()) -printf('--------------\n') -if (isMaster() && !gitAvailable()) { - throw new GradleException('GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it') -} -if (isMaster() && !allCommitted()) { - throw new GradleException('There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update') -} - diff --git a/app/build.gradle.kts b/app/build.gradle.kts new file mode 100644 index 0000000000..352061a921 --- /dev/null +++ b/app/build.gradle.kts @@ -0,0 +1,232 @@ +import java.io.ByteArrayOutputStream +import java.text.SimpleDateFormat +import java.util.Date + +plugins { + id("com.android.application") + id("kotlin-android") + id("kotlin-kapt") + id("com.google.gms.google-services") + id("com.google.firebase.crashlytics") + id("android-app-dependencies") + id("test-app-dependencies") + id("jacoco-app-dependencies") +} + +repositories { + mavenCentral() + google() +} + +fun generateGitBuild(): String { + val stringBuilder: StringBuilder = StringBuilder() + try { + val stdout = ByteArrayOutputStream() + exec { + commandLine("git", "describe", "--always") + standardOutput = stdout + } + val commitObject = stdout.toString().trim() + stringBuilder.append(commitObject) + } catch (ignored: Exception) { + stringBuilder.append("NoGitSystemAvailable") + } + return stringBuilder.toString() +} + +fun generateGitRemote(): String { + val stringBuilder: StringBuilder = StringBuilder() + try { + val stdout = ByteArrayOutputStream() + exec { + commandLine("git", "remote", "get-url", "origin") + standardOutput = stdout + } + val commitObject: String = stdout.toString().trim() + stringBuilder.append(commitObject) + } catch (ignored: Exception) { + stringBuilder.append("NoGitSystemAvailable") + } + return stringBuilder.toString() +} + +fun generateDate(): String { + val stringBuilder: StringBuilder = StringBuilder() + // showing only date prevents app to rebuild everytime + stringBuilder.append(SimpleDateFormat("yyyy.MM.dd").format(Date())) + return stringBuilder.toString() +} + +fun isMaster(): Boolean = !Versions.appVersion.contains("-") + +fun gitAvailable(): Boolean { + val stringBuilder: StringBuilder = StringBuilder() + try { + val stdout = ByteArrayOutputStream() + exec { + commandLine("git", "--version") + standardOutput = stdout + } + val commitObject = stdout.toString().trim() + stringBuilder.append(commitObject) + } catch (ignored: Exception) { + return false // NoGitSystemAvailable + } + return stringBuilder.toString().isNotEmpty() + +} + +fun allCommitted(): Boolean { + val stringBuilder: StringBuilder = StringBuilder() + try { + val stdout = ByteArrayOutputStream() + exec { + commandLine("git", "status", "-s") + standardOutput = stdout + } + // ignore all changes done in .idea/codeStyles + val cleanedList: String = stdout.toString().replace("/(?m)^\\s*(M|A|D|\\?\\?)\\s*.*?\\.idea\\/codeStyles\\/.*?\\s*\$/", "") + // ignore all files added to project dir but not staged/known to GIT + .replace("/(?m)^\\s*(\\?\\?)\\s*.*?\\s*\$/", "") + stringBuilder.append(cleanedList.trim()) + } catch (ignored: Exception) { + return false // NoGitSystemAvailable + } + return stringBuilder.toString().isEmpty() +} + +android { + + namespace = "app.aaps" + ndkVersion = Versions.ndkVersion + + defaultConfig { + minSdk = Versions.minSdk + targetSdk = Versions.targetSdk + + buildConfigField("String", "VERSION", "\"$version\"") + buildConfigField("String", "BUILDVERSION", "\"${generateGitBuild()}-${generateDate()}\"") + buildConfigField("String", "REMOTE", "\"${generateGitRemote()}\"") + buildConfigField("String", "HEAD", "\"${generateGitBuild()}\"") + buildConfigField("String", "COMMITTED", "\"${allCommitted()}\"") + } + + flavorDimensions.add("standard") + productFlavors { + create("full") { + isDefault = true + applicationId = "info.nightscout.androidaps" + dimension = "standard" + resValue("string", "app_name", "AAPS") + versionName = Versions.appVersion + manifestPlaceholders["appIcon"] = "@mipmap/ic_launcher" + manifestPlaceholders["appIconRound"] = "@mipmap/ic_launcher_round" + } + create("pumpcontrol") { + applicationId = "info.nightscout.aapspumpcontrol" + dimension = "standard" + resValue("string", "app_name", "Pumpcontrol") + versionName = Versions.appVersion + "-pumpcontrol" + manifestPlaceholders["appIcon"] = "@mipmap/ic_pumpcontrol" + manifestPlaceholders["appIconRound"] = "@null" + } + create("aapsclient") { + applicationId = "info.nightscout.aapsclient" + dimension = "standard" + resValue("string", "app_name", "AAPSClient") + versionName = Versions.appVersion + "-aapsclient" + manifestPlaceholders["appIcon"] = "@mipmap/ic_yellowowl" + manifestPlaceholders["appIconRound"] = "@mipmap/ic_yellowowl" + } + create("aapsclient2") { + applicationId = "info.nightscout.aapsclient2" + dimension = "standard" + resValue("string", "app_name", "AAPSClient2") + versionName = Versions.appVersion + "-aapsclient" + manifestPlaceholders["appIcon"] = "@mipmap/ic_blueowl" + manifestPlaceholders["appIconRound"] = "@mipmap/ic_blueowl" + } + } + + useLibrary("org.apache.http.legacy") + + //Deleting it causes a binding error + dataBinding { enable } +} + +allprojects { + repositories { + } +} + +dependencies { + wearApp(project(":wear")) + + // in order to use internet"s versions you"d need to enable Jetifier again + // https://github.com/nightscout/graphview.git + // https://github.com/nightscout/iconify.git + implementation(project(":shared:impl")) + implementation(project(":core:main")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:libraries")) + implementation(project(":core:nssdk")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":ui")) + implementation(project(":plugins:aps")) + implementation(project(":plugins:automation")) + implementation(project(":plugins:configuration")) + implementation(project(":plugins:constraints")) + implementation(project(":plugins:insulin")) + implementation(project(":plugins:main")) + implementation(project(":plugins:sensitivity")) + implementation(project(":plugins:smoothing")) + implementation(project(":plugins:source")) + implementation(project(":plugins:sync")) + implementation(project(":implementation")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":pump:combo")) + implementation(project(":pump:combov2")) + implementation(project(":pump:dana")) + implementation(project(":pump:danars")) + implementation(project(":pump:danar")) + implementation(project(":pump:diaconn")) + implementation(project(":pump:eopatch")) + implementation(project(":pump:medtrum")) + implementation(project(":insight")) + implementation(project(":pump:medtronic")) + implementation(project(":pump:pump-common")) + implementation(project(":pump:omnipod-common")) + implementation(project(":pump:omnipod-eros")) + implementation(project(":pump:omnipod-dash")) + implementation(project(":pump:rileylink")) + implementation(project(":pump:virtual")) + implementation(project(":workflow")) + + testImplementation(project(":shared:tests")) + + /* Dagger2 - We are going to use dagger.android which includes + * support for Activity and fragment injection so we need to include + * the following dependencies */ + kapt(Libs.Dagger.androidProcessor) + kapt(Libs.Dagger.compiler) + + // MainApp + api(Libs.Rx.rxDogTag) +} + +println("-------------------") +println("isMaster: ${isMaster()}") +println("gitAvailable: ${gitAvailable()}") +println("allCommitted: ${allCommitted()}") +println("-------------------") +if (isMaster() && !gitAvailable()) { + throw GradleException("GIT system is not available. On Windows try to run Android Studio as an Administrator. Check if GIT is installed and Studio have permissions to use it") +} +if (isMaster() && !allCommitted()) { + throw GradleException("There are uncommitted changes. Clone sources again as described in wiki and do not allow gradle update") +} + diff --git a/app/src/main/kotlin/app/aaps/MainActivity.kt b/app/src/main/kotlin/app/aaps/MainActivity.kt index 735d4699cf..b5296ab7c4 100644 --- a/app/src/main/kotlin/app/aaps/MainActivity.kt +++ b/app/src/main/kotlin/app/aaps/MainActivity.kt @@ -205,7 +205,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { } R.id.nav_about -> { - var message = "Build: ${BuildConfig.BUILDVERSION}\n" + var message = "Build: ${config.BUILD_VERSION}\n" message += "Flavor: ${BuildConfig.FLAVOR}${BuildConfig.BUILD_TYPE}\n" message += "${rh.gs(app.aaps.plugins.configuration.R.string.configbuilder_nightscoutversion_label)} ${activePlugin.activeNsClient?.detectedNsVersion() ?: rh.gs(app.aaps.plugins.main.R.string.not_available_full)}" if (config.isEngineeringMode()) message += "\n${rh.gs(app.aaps.plugins.configuration.R.string.engineering_mode_enabled)}" @@ -215,7 +215,7 @@ class MainActivity : DaggerAppCompatActivityWithResult() { val messageSpanned = SpannableString(message) Linkify.addLinks(messageSpanned, Linkify.WEB_URLS) MaterialAlertDialogBuilder(this@MainActivity, app.aaps.core.ui.R.style.DialogTheme) - .setTitle(rh.gs(R.string.app_name) + " " + BuildConfig.VERSION) + .setTitle(rh.gs(R.string.app_name) + " " + config.VERSION) .setIcon(iconsProvider.getIcon()) .setMessage(messageSpanned) .setPositiveButton(rh.gs(app.aaps.core.ui.R.string.ok), null) @@ -448,16 +448,16 @@ class MainActivity : DaggerAppCompatActivityWithResult() { if (!fabricPrivacy.fabricEnabled()) return val closedLoopEnabled = if (constraintChecker.isClosedLoopAllowed().value()) "CLOSED_LOOP_ENABLED" else "CLOSED_LOOP_DISABLED" // Size is limited to 36 chars - val remote = BuildConfig.REMOTE.lowercase(Locale.getDefault()) + val remote = config.REMOTE.lowercase(Locale.getDefault()) .replace("https://", "") .replace("http://", "") .replace(".git", "") .replace(".com/", ":") .replace(".org/", ":") .replace(".net/", ":") - fabricPrivacy.firebaseAnalytics.setUserProperty("Mode", BuildConfig.APPLICATION_ID + "-" + closedLoopEnabled) + fabricPrivacy.firebaseAnalytics.setUserProperty("Mode", config.APPLICATION_ID + "-" + closedLoopEnabled) fabricPrivacy.firebaseAnalytics.setUserProperty("Language", sp.getString(app.aaps.core.ui.R.string.key_language, Locale.getDefault().language)) - fabricPrivacy.firebaseAnalytics.setUserProperty("Version", BuildConfig.VERSION) + fabricPrivacy.firebaseAnalytics.setUserProperty("Version", config.VERSION_NAME) fabricPrivacy.firebaseAnalytics.setUserProperty("HEAD", BuildConfig.HEAD) fabricPrivacy.firebaseAnalytics.setUserProperty("Remote", remote) val hashes: List = signatureVerifierPlugin.shortHashes() @@ -471,9 +471,9 @@ class MainActivity : DaggerAppCompatActivityWithResult() { activePlugin.activeInsulin.let { fabricPrivacy.firebaseAnalytics.setUserProperty("Insulin", it::class.java.simpleName) } // Add to crash log too FirebaseCrashlytics.getInstance().setCustomKey("HEAD", BuildConfig.HEAD) - FirebaseCrashlytics.getInstance().setCustomKey("Version", BuildConfig.VERSION) - FirebaseCrashlytics.getInstance().setCustomKey("BuildType", BuildConfig.BUILD_TYPE) - FirebaseCrashlytics.getInstance().setCustomKey("BuildFlavor", BuildConfig.FLAVOR) + FirebaseCrashlytics.getInstance().setCustomKey("Version", config.VERSION_NAME) + FirebaseCrashlytics.getInstance().setCustomKey("BuildType", config.BUILD_TYPE) + FirebaseCrashlytics.getInstance().setCustomKey("BuildFlavor", config.FLAVOR) FirebaseCrashlytics.getInstance().setCustomKey("Remote", remote) FirebaseCrashlytics.getInstance().setCustomKey("Committed", BuildConfig.COMMITTED) FirebaseCrashlytics.getInstance().setCustomKey("Hash", hashes[0]) diff --git a/app/src/main/kotlin/app/aaps/MainApp.kt b/app/src/main/kotlin/app/aaps/MainApp.kt index ec13f49f43..ae14a5a51e 100644 --- a/app/src/main/kotlin/app/aaps/MainApp.kt +++ b/app/src/main/kotlin/app/aaps/MainApp.kt @@ -100,7 +100,7 @@ class MainApp : DaggerApplication() { setRxErrorHandler() LocaleHelper.update(this@MainApp) - var gitRemote: String? = BuildConfig.REMOTE + var gitRemote: String? = config.REMOTE var commitHash: String? = BuildConfig.HEAD if (gitRemote?.contains("NoGitSystemAvailable") == true) { gitRemote = null @@ -109,9 +109,9 @@ class MainApp : DaggerApplication() { disposable += compatDBHelper.dbChangeDisposable() registerActivityLifecycleCallbacks(activityMonitor) runOnUiThread { themeSwitcherPlugin.setThemeMode() } - aapsLogger.debug("Version: " + BuildConfig.VERSION_NAME) - aapsLogger.debug("BuildVersion: " + BuildConfig.BUILDVERSION) - aapsLogger.debug("Remote: " + BuildConfig.REMOTE) + aapsLogger.debug("Version: " + config.VERSION_NAME) + aapsLogger.debug("BuildVersion: " + config.BUILD_VERSION) + aapsLogger.debug("Remote: " + config.REMOTE) registerLocalBroadcastReceiver() // trigger here to see the new version on app start after an update @@ -128,7 +128,7 @@ class MainApp : DaggerApplication() { if (config.isDev() && sp.getStringOrNull(app.aaps.core.utils.R.string.key_email_for_crash_report, null).isNullOrBlank()) notificationStore.add(Notification(Notification.IDENTIFICATION_NOT_SET, rh.get().gs(R.string.identification_not_set), Notification.INFO)) // log version - disposable += repository.runTransaction(VersionChangeTransaction(BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() + disposable += repository.runTransaction(VersionChangeTransaction(config.VERSION_NAME, BuildConfig.VERSION_CODE, gitRemote, commitHash)).subscribe() // log app start if (sp.getBoolean(app.aaps.plugins.sync.R.string.key_ns_log_app_started_event, config.APS)) disposable += repository diff --git a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt index 7102b9ab80..4d0f1cbc1e 100644 --- a/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt +++ b/app/src/main/kotlin/app/aaps/implementations/ConfigImpl.kt @@ -47,8 +47,8 @@ class ConfigImpl @Inject constructor( engineeringMode = engineeringModeSemaphore.exists() && engineeringModeSemaphore.isFile unfinishedMode = unfinishedModeSemaphore.exists() && unfinishedModeSemaphore.isFile - devBranch = BuildConfig.VERSION.contains("-") || BuildConfig.VERSION.matches(Regex(".*[a-zA-Z]+.*")) - if (BuildConfig.VERSION.contains("-beta") || BuildConfig.VERSION.contains("-rc")) + devBranch = VERSION.contains("-") || VERSION.matches(Regex(".*[a-zA-Z]+.*")) + if (VERSION.contains("-beta") || VERSION.contains("-rc")) devBranch = false } diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 9816e7612a..0000000000 --- a/build.gradle +++ /dev/null @@ -1,127 +0,0 @@ -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - -// Top-level build file where you can add configuration options common to all sub-projects/modules. - -buildscript { - ext { - kotlin_version = '1.9.10' - core_version = '1.12.0' - rxjava_version = '3.1.7' - rxandroid_version = '3.0.2' - rxkotlin_version = '3.0.1' - room_version = '2.5.2' - lifecycle_version = '2.6.2' - dagger_version = '2.48.1' - coroutines_version = '1.7.3' - activity_version = '1.8.0' - fragmentktx_version = '1.6.1' - ormLite_version = '4.46' - gson_version = '2.10.1' - nav_version = '2.7.4' - appcompat_version = '1.6.1' - material_version = '1.10.0' - gridlayout_version = '1.0.0' - constraintlayout_version = '2.1.4' - preferencektx_version = '1.2.1' - commonslang3_version = '3.13.0' - commonscodec_version = '1.16.0' - guava_version = '32.1.3-jre' - jodatime_version = '2.12.5' - work_version = '2.8.1' - tink_version = '1.10.0' - json_version = '20230618' - joda_version = '2.12.5' - swipe_version = '1.1.0' - - junit_version = '4.13.2' - junit_jupiter_version = '5.10.0' - mockito_version = '5.6.0' - dexmaker_version = '1.2' - retrofit2_version = '2.9.0' - okhttp3_version = '4.12.0' - byteBuddy_version = '1.12.8' - - androidx_junit_version = '1.1.5' - androidx_rules_version = '1.5.0' - - rxandroidble_version = '1.12.1' - replayshare_version = '2.2.0' - - wearable_version = '2.9.0' - play_services_wearable_version = '18.1.0' - play_services_location_version = '21.0.1' - play_services_measurement_version = '21.4.0' - - kotlinx_datetime_version = '0.4.1' - kotlinx_serialization_version = '1.6.0' - - caverock_androidsvg_version = '1.4' - } - repositories { - google() - mavenCentral() - } - dependencies { - classpath 'com.android.tools.build:gradle:8.1.2' - classpath 'com.google.gms:google-services:4.4.0' - classpath 'com.google.firebase:firebase-crashlytics-gradle:2.9.9' - - // NOTE: Do not place your application dependencies here; they belong - // in the individual module build.gradle files - - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" - classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" - classpath "org.jacoco:org.jacoco.core:0.8.11" - classpath "com.vanniktech:gradle-dependency-graph-generator-plugin:0.8.0" - } -} - -plugins { - // Test Gradle build, keep disabled under normal circumstances - // id "com.osacky.doctor" version "0.8.1" - id "org.jlleitschuh.gradle.ktlint" version "11.6.1" - // Aggregates and/or logs Jacoco test coverage to the Gradle build log - //id 'org.barfuin.gradle.jacocolog' version '3.1.0' - id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false -} - -allprojects { - repositories { - google() - mavenCentral() - maven { url "https://maven.google.com" } - maven { url 'https://jitpack.io' } - } - tasks.withType(KotlinCompile).all { - kotlinOptions { - freeCompilerArgs = [ - '-opt-in=kotlin.RequiresOptIn', - '-opt-in=kotlin.ExperimentalUnsignedTypes', - '-Xjvm-default=all' //Support @JvmDefault - ] - jvmTarget = "11" - } - } - gradle.projectsEvaluated { - tasks.withType(JavaCompile) { - options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation" - } - } - - apply plugin: 'org.jlleitschuh.gradle.ktlint' - apply plugin: 'jacoco' -} - -// Setup all al reports aggregation -apply from: 'jacoco_project.gradle' - -task clean(type: Delete) { - delete rootProject.buildDir -} - -subprojects { - tasks.withType(Test) { - maxParallelForks = Runtime.runtime.availableProcessors().intdiv(2) ?: 1 - } -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000000..6e60c97998 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,62 @@ +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +// Top-level build file where you can add configuration options common to all sub-projects/modules. + +buildscript { + repositories { + google() + mavenCentral() + } + dependencies { + classpath("com.android.tools.build:gradle:8.1.2") + classpath("com.google.gms:google-services:4.4.0") + classpath("com.google.firebase:firebase-crashlytics-gradle:2.9.9") + + // NOTE: Do not place your application dependencies here; they belong + // in the individual module build.gradle files + + classpath(kotlin("gradle-plugin", version = Libs.Kotlin.kotlin)) + classpath(kotlin("allopen", version = Libs.Kotlin.kotlin)) + classpath(kotlin("serialization", version = Libs.Kotlin.kotlin)) + } +} + +plugins { + id("org.jlleitschuh.gradle.ktlint") version "11.6.1" +} + +allprojects { + repositories { + google() + mavenCentral() + maven("https://maven.google.com") + maven("https://jitpack.io") + } + tasks.withType { + kotlinOptions { + freeCompilerArgs = listOf( + "-opt-in=kotlin.RequiresOptIn", + "-opt-in=kotlin.ExperimentalUnsignedTypes", + "-Xjvm-default=all" //Support @JvmDefault + ) + jvmTarget = "11" + } + } + gradle.projectsEvaluated { + tasks.withType { + val compilerArgs = options.compilerArgs + compilerArgs.add("-Xlint:deprecation") + compilerArgs.add("-Xlint:unchecked") + } + } + + apply(plugin = "org.jlleitschuh.gradle.ktlint") + apply(plugin = "jacoco") +} + +// Setup all reports aggregation +apply(from = "jacoco_aggregation.gradle.kts") + +tasks.register("clean").configure { + delete(rootProject.buildDir) +} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 0000000000..c7ac53bd42 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,22 @@ +object KtsBuildVersions { + + const val gradle = "8.1.2" + const val kotlin = "1.9.0" +} + +plugins { + `kotlin-dsl` + `kotlin-dsl-precompiled-script-plugins` +} + +repositories { + google() + mavenCentral() + gradlePluginPortal() +} + +dependencies { + implementation("com.android.tools.build:gradle:${KtsBuildVersions.gradle}") + implementation(kotlin("gradle-plugin", version = KtsBuildVersions.kotlin)) + implementation(kotlin("allopen", version = KtsBuildVersions.kotlin)) +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt new file mode 100644 index 0000000000..719175d1a0 --- /dev/null +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -0,0 +1,215 @@ +@Suppress("SpellCheckingInspection") +object Libs { + + object Kotlin { + + const val kotlin = "1.9.10" + + const val stdlibJdk8 = "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin" + const val reflect = "org.jetbrains.kotlin:kotlin-reflect:$kotlin" + } + + object KotlinX { + + private const val serialization = "1.6.0" + private const val coroutinesVersion = "1.7.3" + + const val serializationJson = "org.jetbrains.kotlinx:kotlinx-serialization-json:$serialization" + const val serializationProtobuf = "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$serialization" + const val serializationCore = "org.jetbrains.kotlinx:kotlinx-serialization-core:$serialization" + const val coroutinesCore = "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion" + const val coroutinesAndroid = "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutinesVersion" + const val coroutinesRx3 = "org.jetbrains.kotlinx:kotlinx-coroutines-rx3:$coroutinesVersion" + const val coroutinesGuava = "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutinesVersion" + const val coroutinesPlayServices = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion" + const val coroutinesTest = "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion" + const val datetime = "org.jetbrains.kotlinx:kotlinx-datetime:0.4.1" + } + + object AndroidX { + + const val core = "androidx.core:core-ktx:1.12.0" + const val appCompat = "androidx.appcompat:appcompat:1.6.1" + const val activity = "androidx.activity:activity-ktx:1.8.0" + const val preference = "androidx.preference:preference-ktx:1.2.1" + const val constraintLayout = "androidx.constraintlayout:constraintlayout:2.1.4" + const val swipeRefreshLayout = "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0" + const val gridLayout = "androidx.gridlayout:gridlayout:1.0.0" + const val browser = "androidx.browser:browser:1.6.0" + const val lifecycleViewmodel = "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2" + const val fragment = "androidx.fragment:fragment-ktx:1.6.1" + const val navigationFragment = "androidx.navigation:navigation-fragment-ktx:2.7.4" + const val legacySupport = "androidx.legacy:legacy-support-v13:1.0.0" + + object Work { + + private const val workVersion = "2.8.1" + const val runtimeKtx = "androidx.work:work-runtime-ktx:$workVersion" + const val testing = "androidx.work:work-testing:$workVersion" + } + + object Test { + + const val espressoCore = "androidx.test.espresso:espresso-core:3.5.1" + const val extKtx = "androidx.test.ext:junit-ktx:1.1.5" + const val rules = "androidx.test:rules:1.5.0" + const val uiAutomator = "androidx.test.uiautomator:uiautomator:2.2.0" + } + + object Room { + + private const val roomVersion = "2.5.2" + + const val room = "androidx.room:room-ktx:$roomVersion" + const val compiler = "androidx.room:room-compiler:$roomVersion" + const val runtime = "androidx.room:room-runtime:$roomVersion" + const val rxJava3 = "androidx.room:room-rxjava3:$roomVersion" + const val testing = "androidx.room:room-testing:$roomVersion" + } + + object Wear { + + const val wear = "androidx.wear:wear:1.3.0" + const val tiles = "androidx.wear.tiles:tiles:1.2.0" + } + + const val biometric = "androidx.biometric:biometric:1.1.0" + const val media3 = "androidx.media3:media3-common:1.1.1" + } + + object Google { + + object Android { + object PlayServices { + + const val measurementApi = "com.google.android.gms:play-services-measurement-api:21.4.0" + const val wearable = "com.google.android.gms:play-services-wearable:18.1.0" + const val location = "com.google.android.gms:play-services-location:21.0.1" + } + + object Wearable { + + const val wearable = "com.google.android.wearable:wearable:2.9.0" + const val wearableSupport = "com.google.android.support:wearable:2.9.0" + } + + const val material = "com.google.android.material:material:1.10.0" + const val flexbox = "com.google.android.flexbox:flexbox:3.0.0" + } + + object Firebase { + + const val firebaseBom = "com.google.firebase:firebase-bom:32.4.0" + const val analytics = "com.google.firebase:firebase-analytics-ktx" + const val crashlytics = "com.google.firebase:firebase-crashlytics-ktx" + const val messaging = "com.google.firebase:firebase-messaging-ktx" + const val auth = "com.google.firebase:firebase-auth-ktx" + const val database = "com.google.firebase:firebase-database-ktx" + } + + const val truth = "com.google.truth:truth:1.1.5" + const val gson = "com.google.code.gson:gson:2.10.1" + const val guava = "com.google.guava:guava:32.1.3-jre" + const val tinkAndroid = "com.google.crypto.tink:tink-android:1.10.0" + } + + object Dagger { + + private const val version = "2.48.1" + const val dagger = "com.google.dagger:dagger:$version" + const val android = "com.google.dagger:dagger-android:$version" + const val androidProcessor = "com.google.dagger:dagger-android-processor:$version" + const val androidSupport = "com.google.dagger:dagger-android-support:$version" + const val compiler = "com.google.dagger:dagger-compiler:$version" + } + + object Rx { + + const val rxDogTag = "com.uber.rxdogtag2:rxdogtag:2.0.2" + const val rxJava = "io.reactivex.rxjava3:rxjava:3.1.7" + const val rxKotlin = "io.reactivex.rxjava3:rxkotlin:3.0.1" + const val rxAndroid = "io.reactivex.rxjava3:rxandroid:3.0.2" + } + + object Apache { + + const val commonsLang3 = "org.apache.commons:commons-lang3:3.13.0" + } + + object Logging { + + const val slf4jApi = "org.slf4j:slf4j-api:1.7.36" // 2.0.x breaks logging. Code change needed + const val logbackAndroid = "com.github.tony19:logback-android:2.0.0" + } + + object JUnit { + + private const val junitVersion = "5.10.0" + + const val jupiter = "org.junit.jupiter:junit-jupiter:$junitVersion" + const val jupiterApi = "org.junit.jupiter:junit-jupiter-api:$junitVersion" + const val jupiterEngine = "org.junit.jupiter:junit-jupiter-engine:$junitVersion" + } + + object Mockito { + + const val jupiter = "org.mockito:mockito-junit-jupiter:5.6.0" + const val kotlin = "org.mockito.kotlin:mockito-kotlin:5.1.0" + } + + object Squareup { + object Retrofit2 { + + private const val retrofitVersion = "2.9.0" + + const val retrofit = "com.squareup.retrofit2:retrofit:$retrofitVersion" + const val adapterRxJava3 = "com.squareup.retrofit2:adapter-rxjava3:$retrofitVersion" + const val converterGson = "com.squareup.retrofit2:converter-gson:$retrofitVersion" + } + + object Okhttp3 { + + private const val okhttpVersion = "4.12.0" + + const val okhttp = "com.squareup.okhttp3:okhttp:$okhttpVersion" + const val loggingInterceptor = "com.squareup.okhttp3:logging-interceptor:$okhttpVersion" + } + } + + object Mozilla { + + const val rhino = "org.mozilla:rhino:1.7.14" + } + + const val spongycastleCore = "com.madgag.spongycastle:core:1.58.0.0" + const val androidSvg = "com.caverock:androidsvg:1.4" + const val jodaTimeAndroid = "net.danlew:android.joda:2.12.5" + const val jodaTime = "joda-time:joda-time:2.12.5" + const val json = "org.json:json:20230618" + const val jsonAssert = "org.skyscreamer:jsonassert:1.5.0" + const val rootBeer = "com.scottyab:rootbeer-lib:0.1.0" + const val javaOtp = "com.eatthepath:java-otp:0.4.0" + const val qrGen = "com.github.kenglxn.QRGen:android:3.0.1" + const val socketIo = "io.socket:socket.io-client:2.1.0" + const val kotlinTestRunner = "io.kotlintest:kotlintest-runner-junit5:3.4.2" + const val rxandroidBle = "com.polidea.rxandroidble3:rxandroidble:1.17.2" + const val rx3ReplayingShare = "com.jakewharton.rx3:replaying-share:3.0.0" + const val commonCodecs = "commons-codec:commons-codec:1.16.0" + const val kulid = "com.github.guepardoapps:kulid:2.0.0.0" + const val xstream = "com.thoughtworks.xstream:xstream:1.4.20" + + const val ormLite = "4.46" + + const val junit = "4.13.2" + const val mockito = "5.6.0" + const val dexmaker = "1.2" + const val byteBuddy = "1.12.8" + + const val androidx_junit = "1.1.5" + const val androidx_rules = "1.5.0" + + const val kotlinx_datetime = "0.4.1" + const val kotlinx_serialization = "1.6.0" + + const val caverock_androidsvg = "1.4" +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/Versions.kt b/buildSrc/src/main/kotlin/Versions.kt new file mode 100644 index 0000000000..7eacef9f80 --- /dev/null +++ b/buildSrc/src/main/kotlin/Versions.kt @@ -0,0 +1,18 @@ +import org.gradle.api.JavaVersion + +object Versions { + + const val appVersion = "3.2.0-dev-m" + const val versionCode = 1500 + + const val ndkVersion = "21.1.6352462" + + const val compileSdk = 34 + const val minSdk = 28 + const val targetSdk = 28 + const val wearMinSdk = 26 + const val wearTargetSdk = 29 + + val javaVersion = JavaVersion.VERSION_11 + const val jacoco = "0.8.11" +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/all-open-dependencies.gradle.kts b/buildSrc/src/main/kotlin/all-open-dependencies.gradle.kts new file mode 100644 index 0000000000..439fb3ed9e --- /dev/null +++ b/buildSrc/src/main/kotlin/all-open-dependencies.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("com.android.library") + id("kotlin-allopen") +} + +allOpen { + // allows mocking for classes w/o directly opening them for release builds + annotation("app.aaps.annotations.OpenForTesting") +} diff --git a/buildSrc/src/main/kotlin/android-app-dependencies.gradle.kts b/buildSrc/src/main/kotlin/android-app-dependencies.gradle.kts new file mode 100644 index 0000000000..a134c05e76 --- /dev/null +++ b/buildSrc/src/main/kotlin/android-app-dependencies.gradle.kts @@ -0,0 +1,41 @@ +plugins { + id("com.android.application") + id("kotlin-android") +} + +android { + compileSdk = Versions.compileSdk + defaultConfig { + multiDexEnabled = true + versionCode = Versions.versionCode + version = Versions.appVersion + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildFeatures { + viewBinding = true + } + + buildTypes { + named("release") { + isMinifyEnabled = false + setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) + } + named("debug") { + enableUnitTestCoverage = true + enableAndroidTestCoverage = true + } + } + + compileOptions { + sourceCompatibility = Versions.javaVersion + targetCompatibility = Versions.javaVersion + } + + lint { + checkReleaseBuilds = false + disable += "MissingTranslation" + disable += "ExtraTranslation" + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/android-module-dependencies.gradle.kts b/buildSrc/src/main/kotlin/android-module-dependencies.gradle.kts new file mode 100644 index 0000000000..c95e263536 --- /dev/null +++ b/buildSrc/src/main/kotlin/android-module-dependencies.gradle.kts @@ -0,0 +1,66 @@ +plugins { + id("com.android.library") + id("kotlin-android") +} + +android { + compileSdk = Versions.compileSdk + defaultConfig { + minSdk = Versions.minSdk + @Suppress("DEPRECATION") + targetSdk = Versions.targetSdk + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + } + + buildTypes { + named("release") { + isMinifyEnabled = false + setProguardFiles(listOf(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")) + } + named("debug") { + enableUnitTestCoverage = true + enableAndroidTestCoverage = true + } + } + + sourceSets { + named("main") { + jniLibs.srcDirs(listOf("src/main/jniLibs")) + } + } + + compileOptions { + sourceCompatibility = Versions.javaVersion + targetCompatibility = Versions.javaVersion + } + + lint { + checkReleaseBuilds = false + disable += "MissingTranslation" + disable += "ExtraTranslation" + } + + flavorDimensions.add("standard") + productFlavors { + create("full") { + isDefault = true + dimension = "standard" + } + create("pumpcontrol") { + dimension = "standard" + } + create("aapsclient") { + dimension = "standard" + } + create("aapsclient2") { + dimension = "standard" + } + } + + buildFeatures { + // disable for modules here + buildConfig = false + viewBinding = true + } +} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts b/buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts new file mode 100644 index 0000000000..db9a293e9e --- /dev/null +++ b/buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts @@ -0,0 +1,207 @@ +import groovy.xml.XmlSlurper +import groovy.xml.slurpersupport.NodeChild +import java.io.File +import java.util.Locale +import org.gradle.api.GradleException +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.extra +import org.gradle.kotlin.dsl.register +import org.gradle.testing.jacoco.tasks.JacocoReport +import kotlin.math.roundToInt + +plugins { + id("com.android.application") + id("jacoco") +} + +private val limits = mutableMapOf( + "instruction" to 0.0, + "branch" to 0.0, + "line" to 0.0, + "complexity" to 0.0, + "method" to 0.0, + "class" to 0.0 +) + +extra.set("limits", limits) + +dependencies { + "implementation"("org.jacoco:org.jacoco.core:${Versions.jacoco}") +} + +project.afterEvaluate { + val buildTypes = android.buildTypes.map { type -> type.name } + var productFlavors = android.productFlavors.map { flavor -> flavor.name } + + if (productFlavors.isEmpty()) { + productFlavors = productFlavors + "" + } + + productFlavors.forEach { flavorName -> + buildTypes.forEach { buildTypeName -> + val sourceName: String + val sourcePath: String + + if (flavorName.isEmpty()) { + sourceName = buildTypeName + sourcePath = buildTypeName + } else { + sourceName = "${flavorName}${buildTypeName.replaceFirstChar(Char::titlecase)}" + sourcePath = "${flavorName}/${buildTypeName}" + } + + val testTaskName = "test${sourceName.replaceFirstChar(Char::titlecase)}UnitTest" + //println("Task -> $testTaskName") + + registerCodeCoverageTask( + testTaskName = testTaskName, + sourceName = sourceName, + sourcePath = sourcePath, + flavorName = flavorName, + buildTypeName = buildTypeName + ) + } + } +} + +val excludedFiles = mutableSetOf( + // data binding + "android/databinding/**/*.class", + "**/android/databinding/*Binding.class", + "**/android/databinding/*", + "**/androidx/databinding/*", + "**/BR.*", + // android + "**/R.class", + "**/R$*.class", + "**/BuildConfig.*", + "**/Manifest*.*", + "**/*Test*.*", + "android/**/*.*", + // kotlin + "**/*MapperImpl*.*", + "**/*\$ViewInjector*.*", + "**/*\$ViewBinder*.*", + "**/BuildConfig.*", + "**/*Component*.*", + "**/*BR*.*", + "**/Manifest*.*", + "**/*\$Lambda\$*.*", + "**/*Companion*.*", + "**/*Module*.*", + "**/*Dagger*.*", + "**/*Hilt*.*", + "**/*MembersInjector*.*", + "**/*_MembersInjector.class", + "**/*_Factory*.*", + "**/*_Provide*Factory*.*", + "**/*Extensions*.*", + // sealed and data classes + "**/*\$Result.*", + "**/*\$Result\$*.*", + // adapters generated by moshi + "**/*JsonAdapter.*" +) + +fun Project.registerCodeCoverageTask( + testTaskName: String, + sourceName: String, + sourcePath: String, + flavorName: String, + buildTypeName: String +) { + tasks.register("${testTaskName}Coverage") { + dependsOn(testTaskName) + group = "Reporting" + description = "Generate Jacoco coverage reports on the ${sourceName.replaceFirstChar(Char::titlecase)} build." + + val javaDirectories = fileTree( + "${project.buildDir}/intermediates/classes/${sourcePath}" + ) { exclude(excludedFiles) } + + val kotlinDirectories = fileTree( + "${project.buildDir}/tmp/kotlin-classes/${sourcePath}" + ) { exclude(excludedFiles) } + + val coverageSrcDirectories = listOf( + "src/main/java", + "src/main/kotlin", + "src/$flavorName/java", + "src/$flavorName/kotlin", + "src/$buildTypeName/java", + "src/$buildTypeName/kotlin" + ) + + classDirectories.setFrom(files(javaDirectories, kotlinDirectories)) + additionalClassDirs.setFrom(files(coverageSrcDirectories)) + sourceDirectories.setFrom(files(coverageSrcDirectories)) + executionData.setFrom( + files("${project.buildDir}/jacoco/${testTaskName}.exec") + ) + + reports { + xml.required.set(true) + html.required.set(true) + } + + doLast { + jacocoTestReport("${testTaskName}Coverage") + } + } +} + +@Suppress("UNCHECKED_CAST") +fun Project.jacocoTestReport(testTaskName: String) { + val reportsDirectory = jacoco.reportsDirectory.asFile.get() + val report = file("$reportsDirectory/${testTaskName}/${testTaskName}.xml") + + logger.lifecycle("Checking coverage results: $report") + + val metrics = report.extractTestsCoveredByType() + val limits = project.extra["limits"] as Map + + val failures = metrics.filter { entry -> + entry.value < limits[entry.key]!! + }.map { entry -> + "- ${entry.key} coverage rate is: ${entry.value}%, minimum is ${limits[entry.key]}%" + } + + if (failures.isNotEmpty()) { + logger.quiet("------------------ Code Coverage Failed -----------------------") + failures.forEach { logger.quiet(it) } + logger.quiet("---------------------------------------------------------------") + throw GradleException("Code coverage failed") + } + + logger.quiet("------------------ Code Coverage Success -----------------------") + metrics.forEach { entry -> + logger.quiet("- ${entry.key} coverage rate is: ${entry.value}%") + } + logger.quiet("---------------------------------------------------------------") +} + +@Suppress("UNCHECKED_CAST") +fun File.extractTestsCoveredByType(): Map { + val xmlReader = XmlSlurper().apply { + setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) + setFeature("http://apache.org/xml/features/disallow-doctype-decl", false) + } + + val counterNodes: List = xmlReader + .parse(this).parent() + .children() + .filter { + (it as NodeChild).name() == "counter" + } as List + + return counterNodes.associate { nodeChild -> + val type = nodeChild.attributes()["type"].toString().lowercase(Locale.ENGLISH) + + val covered = nodeChild.attributes()["covered"].toString().toDouble() + val missed = nodeChild.attributes()["missed"].toString().toDouble() + val percentage = ((covered / (covered + missed)) * 10000.0).roundToInt() / 100.0 + + Pair(type, percentage) + } +} diff --git a/buildSrc/src/main/kotlin/jacoco-module-dependencies.gradle.kts b/buildSrc/src/main/kotlin/jacoco-module-dependencies.gradle.kts new file mode 100644 index 0000000000..e199e8ff78 --- /dev/null +++ b/buildSrc/src/main/kotlin/jacoco-module-dependencies.gradle.kts @@ -0,0 +1,207 @@ +import groovy.xml.XmlSlurper +import groovy.xml.slurpersupport.NodeChild +import java.io.File +import java.util.Locale +import org.gradle.api.GradleException +import org.gradle.api.Project +import org.gradle.kotlin.dsl.dependencies +import org.gradle.kotlin.dsl.extra +import org.gradle.kotlin.dsl.register +import org.gradle.testing.jacoco.tasks.JacocoReport +import kotlin.math.roundToInt + +plugins { + id("com.android.library") + id("jacoco") +} + +private val limits = mutableMapOf( + "instruction" to 0.0, + "branch" to 0.0, + "line" to 0.0, + "complexity" to 0.0, + "method" to 0.0, + "class" to 0.0 +) + +extra.set("limits", limits) + +dependencies { + "implementation"("org.jacoco:org.jacoco.core:${Versions.jacoco}") +} + +project.afterEvaluate { + val buildTypes = android.buildTypes.map { type -> type.name } + var productFlavors = android.productFlavors.map { flavor -> flavor.name } + + if (productFlavors.isEmpty()) { + productFlavors = productFlavors + "" + } + + productFlavors.forEach { flavorName -> + buildTypes.forEach { buildTypeName -> + val sourceName: String + val sourcePath: String + + if (flavorName.isEmpty()) { + sourceName = buildTypeName + sourcePath = buildTypeName + } else { + sourceName = "${flavorName}${buildTypeName.replaceFirstChar(Char::titlecase)}" + sourcePath = "${flavorName}/${buildTypeName}" + } + + val testTaskName = "test${sourceName.replaceFirstChar(Char::titlecase)}UnitTest" + //println("Task -> $testTaskName") + + registerCodeCoverageTask( + testTaskName = testTaskName, + sourceName = sourceName, + sourcePath = sourcePath, + flavorName = flavorName, + buildTypeName = buildTypeName + ) + } + } +} + +val excludedFiles = mutableSetOf( + // data binding + "android/databinding/**/*.class", + "**/android/databinding/*Binding.class", + "**/android/databinding/*", + "**/androidx/databinding/*", + "**/BR.*", + // android + "**/R.class", + "**/R$*.class", + "**/BuildConfig.*", + "**/Manifest*.*", + "**/*Test*.*", + "android/**/*.*", + // kotlin + "**/*MapperImpl*.*", + "**/*\$ViewInjector*.*", + "**/*\$ViewBinder*.*", + "**/BuildConfig.*", + "**/*Component*.*", + "**/*BR*.*", + "**/Manifest*.*", + "**/*\$Lambda\$*.*", + "**/*Companion*.*", + "**/*Module*.*", + "**/*Dagger*.*", + "**/*Hilt*.*", + "**/*MembersInjector*.*", + "**/*_MembersInjector.class", + "**/*_Factory*.*", + "**/*_Provide*Factory*.*", + "**/*Extensions*.*", + // sealed and data classes + "**/*\$Result.*", + "**/*\$Result\$*.*", + // adapters generated by moshi + "**/*JsonAdapter.*" +) + +fun Project.registerCodeCoverageTask( + testTaskName: String, + sourceName: String, + sourcePath: String, + flavorName: String, + buildTypeName: String +) { + tasks.register("${testTaskName}Coverage") { + dependsOn(testTaskName) + group = "Reporting" + description = "Generate Jacoco coverage reports on the ${sourceName.replaceFirstChar(Char::titlecase)} build." + + val javaDirectories = fileTree( + "${project.buildDir}/intermediates/classes/${sourcePath}" + ) { exclude(excludedFiles) } + + val kotlinDirectories = fileTree( + "${project.buildDir}/tmp/kotlin-classes/${sourcePath}" + ) { exclude(excludedFiles) } + + val coverageSrcDirectories = listOf( + "src/main/java", + "src/main/kotlin", + "src/$flavorName/java", + "src/$flavorName/kotlin", + "src/$buildTypeName/java", + "src/$buildTypeName/kotlin" + ) + + classDirectories.setFrom(files(javaDirectories, kotlinDirectories)) + additionalClassDirs.setFrom(files(coverageSrcDirectories)) + sourceDirectories.setFrom(files(coverageSrcDirectories)) + executionData.setFrom( + files("${project.buildDir}/jacoco/${testTaskName}.exec") + ) + + reports { + xml.required.set(true) + html.required.set(true) + } + + doLast { + jacocoTestReport("${testTaskName}Coverage") + } + } +} + +@Suppress("UNCHECKED_CAST") +fun Project.jacocoTestReport(testTaskName: String) { + val reportsDirectory = jacoco.reportsDirectory.asFile.get() + val report = file("$reportsDirectory/${testTaskName}/${testTaskName}.xml") + + logger.lifecycle("Checking coverage results: $report") + + val metrics = report.extractTestsCoveredByType() + val limits = project.extra["limits"] as Map + + val failures = metrics.filter { entry -> + entry.value < limits[entry.key]!! + }.map { entry -> + "- ${entry.key} coverage rate is: ${entry.value}%, minimum is ${limits[entry.key]}%" + } + + if (failures.isNotEmpty()) { + logger.quiet("------------------ Code Coverage Failed -----------------------") + failures.forEach { logger.quiet(it) } + logger.quiet("---------------------------------------------------------------") + throw GradleException("Code coverage failed") + } + + logger.quiet("------------------ Code Coverage Success -----------------------") + metrics.forEach { entry -> + logger.quiet("- ${entry.key} coverage rate is: ${entry.value}%") + } + logger.quiet("---------------------------------------------------------------") +} + +@Suppress("UNCHECKED_CAST") +fun File.extractTestsCoveredByType(): Map { + val xmlReader = XmlSlurper().apply { + setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false) + setFeature("http://apache.org/xml/features/disallow-doctype-decl", false) + } + + val counterNodes: List = xmlReader + .parse(this).parent() + .children() + .filter { + (it as NodeChild).name() == "counter" + } as List + + return counterNodes.associate { nodeChild -> + val type = nodeChild.attributes()["type"].toString().lowercase(Locale.ENGLISH) + + val covered = nodeChild.attributes()["covered"].toString().toDouble() + val missed = nodeChild.attributes()["missed"].toString().toDouble() + val percentage = ((covered / (covered + missed)) * 10000.0).roundToInt() / 100.0 + + Pair(type, percentage) + } +} diff --git a/buildSrc/src/main/kotlin/test-app-dependencies.gradle.kts b/buildSrc/src/main/kotlin/test-app-dependencies.gradle.kts new file mode 100644 index 0000000000..15db69e88d --- /dev/null +++ b/buildSrc/src/main/kotlin/test-app-dependencies.gradle.kts @@ -0,0 +1,62 @@ +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + id("com.android.application") + id("kotlin-android") +} + +dependencies { + testImplementation(kotlin("test")) + testImplementation(Libs.JUnit.jupiter) + testImplementation(Libs.JUnit.jupiterApi) + testImplementation(Libs.json) + testImplementation(Libs.Mockito.jupiter) + testImplementation(Libs.Mockito.kotlin) + testImplementation(Libs.jodaTime) + testImplementation(Libs.Google.truth) + testImplementation(Libs.jsonAssert) + + androidTestImplementation(Libs.AndroidX.Test.espressoCore) + androidTestImplementation(Libs.AndroidX.Test.extKtx) + androidTestImplementation(Libs.AndroidX.Test.rules) + androidTestImplementation(Libs.AndroidX.Test.uiAutomator) + androidTestImplementation(Libs.Google.truth) +} + +tasks.withType { + // use to display stdout in travis + testLogging { + // set options for log level LIFECYCLE + events = setOf( + TestLogEvent.FAILED, + TestLogEvent.STARTED, + TestLogEvent.SKIPPED, + TestLogEvent.STANDARD_OUT + ) + exceptionFormat = TestExceptionFormat.FULL + useJUnitPlatform() + } +} + +tasks.withType().configureEach { + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 20 +} + +android { + testOptions { + unitTests { + isReturnDefaultValues = true + isIncludeAndroidResources = true + } + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + excludes += "META-INF/COPYRIGHT" + excludes += "META-INF/LICENSE.md" + excludes += "META-INF/LICENSE-notice.md" + } + } +} diff --git a/buildSrc/src/main/kotlin/test-module-dependencies.gradle.kts b/buildSrc/src/main/kotlin/test-module-dependencies.gradle.kts new file mode 100644 index 0000000000..22fc2175b7 --- /dev/null +++ b/buildSrc/src/main/kotlin/test-module-dependencies.gradle.kts @@ -0,0 +1,62 @@ +import org.gradle.api.tasks.testing.logging.TestExceptionFormat +import org.gradle.api.tasks.testing.logging.TestLogEvent + +plugins { + id("com.android.library") + id("kotlin-android") +} + +dependencies { + testImplementation(kotlin("test")) + testImplementation(Libs.JUnit.jupiter) + testImplementation(Libs.JUnit.jupiterApi) + testImplementation(Libs.json) + testImplementation(Libs.Mockito.jupiter) + testImplementation(Libs.Mockito.kotlin) + testImplementation(Libs.jodaTime) + testImplementation(Libs.Google.truth) + testImplementation(Libs.jsonAssert) + + androidTestImplementation(Libs.AndroidX.Test.espressoCore) + androidTestImplementation(Libs.AndroidX.Test.extKtx) + androidTestImplementation(Libs.AndroidX.Test.rules) + androidTestImplementation(Libs.Google.truth) + androidTestImplementation(Libs.AndroidX.Test.uiAutomator) +} + +tasks.withType { + // use to display stdout in travis + testLogging { + // set options for log level LIFECYCLE + events = setOf( + TestLogEvent.FAILED, + TestLogEvent.STARTED, + TestLogEvent.SKIPPED, + TestLogEvent.STANDARD_OUT + ) + exceptionFormat = TestExceptionFormat.FULL + useJUnitPlatform() + } +} + +tasks.withType().configureEach { + maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).coerceAtLeast(1) + forkEvery = 20 +} + +android { + testOptions { + unitTests { + isReturnDefaultValues = true + isIncludeAndroidResources = true + } + } + packaging { + resources { + excludes += "/META-INF/{AL2.0,LGPL2.1}" + excludes += "META-INF/COPYRIGHT" + excludes += "META-INF/LICENSE.md" + excludes += "META-INF/LICENSE-notice.md" + } + } +} diff --git a/core/graphview/build.gradle b/core/graphview/build.gradle deleted file mode 100644 index cf3075074d..0000000000 --- a/core/graphview/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - } - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" - -android { - - namespace 'com.jjoe64.graphview' -} - -dependencies { - api "androidx.core:core-ktx:$core_version" -} \ No newline at end of file diff --git a/core/graphview/build.gradle.kts b/core/graphview/build.gradle.kts new file mode 100644 index 0000000000..8a9f212ffd --- /dev/null +++ b/core/graphview/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("android-module-dependencies") +} + + +android { + + namespace = "com.jjoe64.graphview" +} + +dependencies { + api(Libs.AndroidX.core) +} \ No newline at end of file diff --git a/core/interfaces/build.gradle b/core/interfaces/build.gradle deleted file mode 100644 index 23a82717bd..0000000000 --- a/core/interfaces/build.gradle +++ /dev/null @@ -1,54 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' - id 'kotlin-parcelize' - id 'kotlinx-serialization' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'app.aaps.core.interfaces' - defaultConfig { - minSdkVersion 26 // for wear - } -} - -dependencies { - implementation project(':database:entities') - - api "androidx.appcompat:appcompat:$appcompat_version" - api "androidx.preference:preference-ktx:$preferencektx_version" - api "net.danlew:android.joda:$joda_version" - - - api "com.google.dagger:dagger:$dagger_version" - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - //Logger - api 'org.slf4j:slf4j-api:1.7.36' // 2.0.x breaks logging. Code change needed - api 'com.github.tony19:logback-android:2.0.0' - - api "com.google.android.gms:play-services-measurement-api:$play_services_measurement_version" - - api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version" - api "org.jetbrains.kotlinx:kotlinx-serialization-protobuf:$kotlinx_serialization_version" - api "com.caverock:androidsvg:$caverock_androidsvg_version" - api "org.apache.commons:commons-lang3:$commonslang3_version" - - //RxBus - api "io.reactivex.rxjava3:rxjava:$rxjava_version" - api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" - api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" - - // WorkerClasses - api "androidx.work:work-runtime-ktx:$work_version" -} \ No newline at end of file diff --git a/core/interfaces/build.gradle.kts b/core/interfaces/build.gradle.kts new file mode 100644 index 0000000000..4e62e26615 --- /dev/null +++ b/core/interfaces/build.gradle.kts @@ -0,0 +1,52 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("kotlin-parcelize") + id("kotlinx-serialization") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "app.aaps.core.interfaces" + defaultConfig { + minSdk = Versions.wearMinSdk // for wear + } +} + +dependencies { + implementation(project(":database:entities")) + + api(Libs.AndroidX.appCompat) + api(Libs.AndroidX.preference) + api(Libs.jodaTimeAndroid) + + api(Libs.Dagger.androidSupport) + + //Logger + api(Libs.Logging.slf4jApi) + api(Libs.Logging.logbackAndroid) + + api(Libs.Google.Android.PlayServices.measurementApi) + + api(Libs.KotlinX.serializationJson) + api(Libs.KotlinX.serializationProtobuf) + + api(Libs.androidSvg) + api(Libs.Apache.commonsLang3) + + //RxBus + api(Libs.Rx.rxJava) + api(Libs.Rx.rxKotlin) + api(Libs.Rx.rxAndroid) + + // WorkerClasses + api(Libs.AndroidX.Work.runtimeKtx) + + // TODO eliminate kapt from low level modules + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/core/interfaces/src/main/res/values/colors.xml b/core/interfaces/src/main/res/values/colors.xml deleted file mode 100644 index 3f06959c5b..0000000000 --- a/core/interfaces/src/main/res/values/colors.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - #66BB6A - #FF8C00 - #FF5555 - - - #666666 - #000000 - #77dd77 - #ff0400 - #FF8C00 - #03A9F4 - - \ No newline at end of file diff --git a/core/libraries/build.gradle b/core/libraries/build.gradle.kts similarity index 75% rename from core/libraries/build.gradle rename to core/libraries/build.gradle.kts index 14c29c3764..6a9a29cd50 100644 --- a/core/libraries/build.gradle +++ b/core/libraries/build.gradle.kts @@ -1,4 +1,4 @@ // in order to use internet's versions you'd need to enable Jetifier again // https://github.com/nightscout/iconify.git configurations.create("default") -artifacts.add("default", file('libs/iconify.aar')) \ No newline at end of file +artifacts.add("default", file("libs/iconify.aar")) \ No newline at end of file diff --git a/core/main/allopen_dependencies.gradle b/core/main/allopen_dependencies.gradle deleted file mode 100644 index 14416d2e8c..0000000000 --- a/core/main/allopen_dependencies.gradle +++ /dev/null @@ -1,4 +0,0 @@ -allOpen { - // allows mocking for classes w/o directly opening them for release builds - annotation 'app.aaps.annotations.OpenForTesting' -} diff --git a/core/main/android_dependencies.gradle b/core/main/android_dependencies.gradle deleted file mode 100644 index b89931830f..0000000000 --- a/core/main/android_dependencies.gradle +++ /dev/null @@ -1,37 +0,0 @@ -android { - compileSdk 34 - defaultConfig { - minSdkVersion 28 - targetSdkVersion 28 - - testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - } - - buildFeatures { - viewBinding true - } - - buildTypes { - release { - minifyEnabled false - proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' - } - } - - sourceSets { - main { - jniLibs.srcDirs = ['src/main/jniLibs'] - } - } - - compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 - } - - lint { - checkReleaseBuilds false - disable 'MissingTranslation' - disable 'ExtraTranslation' - } -} \ No newline at end of file diff --git a/core/main/android_module_dependencies.gradle b/core/main/android_module_dependencies.gradle deleted file mode 100644 index 8ccf62d869..0000000000 --- a/core/main/android_module_dependencies.gradle +++ /dev/null @@ -1,29 +0,0 @@ -android { - - flavorDimensions = ["standard"] - productFlavors { - full { - getIsDefault().set(true) - dimension "standard" - } - pumpcontrol { - dimension "standard" - } - aapsclient { - dimension "standard" - } - aapsclient2 { - dimension "standard" - } - } - - // disable for modules here - buildFeatures { - buildConfig = false - } -} - -dependencies { - kapt "com.google.dagger:dagger-android-processor:$dagger_version" - kapt "com.google.dagger:dagger-compiler:$dagger_version" -} diff --git a/core/main/build.gradle b/core/main/build.gradle deleted file mode 100644 index fd9df93b21..0000000000 --- a/core/main/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-parcelize' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -dependencies { - implementation project(':database:entities') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') - testImplementation project(':shared:impl') - - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - - api "com.google.guava:guava:$guava_version" - - api "androidx.activity:activity-ktx:$activity_version" - api "androidx.appcompat:appcompat:$appcompat_version" - api "com.google.android.material:material:$material_version" - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - //WorkManager - api "androidx.work:work-runtime-ktx:$work_version" // DataWorkerStorage -} - -android { - namespace 'app.aaps.core.main' -} diff --git a/core/main/build.gradle.kts b/core/main/build.gradle.kts new file mode 100644 index 0000000000..8968e8631d --- /dev/null +++ b/core/main/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("kotlin-parcelize") + id("android-module-dependencies") + id("all-open-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.core.main" +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":shared:impl")) + + api(Libs.Kotlin.stdlibJdk8) + api(Libs.Google.Android.material) + api(Libs.Google.guava) + api(Libs.AndroidX.activity) + api(Libs.AndroidX.appCompat) + + api(Libs.Dagger.android) + api(Libs.Dagger.androidSupport) + + //WorkManager + api(Libs.AndroidX.Work.runtimeKtx) // DataWorkerStorage + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/core/main/jacoco_global.gradle b/core/main/jacoco_global.gradle deleted file mode 100644 index 3863fd0102..0000000000 --- a/core/main/jacoco_global.gradle +++ /dev/null @@ -1,102 +0,0 @@ -project.afterEvaluate { project -> - setupAndroidReporting() -} - -def setupAndroidReporting() { - tasks.withType(Test) { - // Whether or not classes without source location should be instrumented - jacoco.includeNoLocationClasses = true - jacoco.excludes = ['jdk.internal.*'] - } - - def buildTypes = ["debug", "fullDebug"] - - def productFlavors = android.productFlavors.collect { flavor -> - flavor.name - } - // When no product flavors defined, use empty - if (!productFlavors) productFlavors.add('') - productFlavors.each { productFlavorName -> - buildTypes.each { buildTypeName -> - def sourceName, sourcePath - if (!productFlavorName) { - sourceName = sourcePath = "${buildTypeName}" - } else { - sourceName = "${productFlavorName}${buildTypeName.capitalize()}" - sourcePath = "${productFlavorName}/${buildTypeName}" - } - def testTaskName = "test${sourceName.capitalize()}UnitTest" - // System.out.println("Task -> $testTaskName") - - // Create coverage task of form 'testFlavorTypeCoverage' depending on 'testFlavorTypeUnitTest' - task "${testTaskName}Coverage"(type: JacocoReport, dependsOn: "$testTaskName") { - group = "Reporting" - description = "Generate Jacoco coverage reports on the ${sourceName.capitalize()} build." - - def fileFilter = [ - // data binding - 'android/databinding/**/*.class', - '**/android/databinding/*Binding.class', - '**/android/databinding/*', - '**/androidx/databinding/*', - '**/BR.*', - // android - '**/R.class', - '**/R$*.class', - '**/BuildConfig.*', - '**/Manifest*.*', - '**/*Test*.*', - 'android/**/*.*', - // kotlin - '**/*MapperImpl*.*', - '**/*$ViewInjector*.*', - '**/*$ViewBinder*.*', - '**/BuildConfig.*', - '**/*Component*.*', - '**/*BR*.*', - '**/Manifest*.*', - '**/*$Lambda$*.*', - '**/*Companion*.*', - '**/*Module*.*', - '**/*Dagger*.*', - '**/*Hilt*.*', - '**/*MembersInjector*.*', - '**/*_MembersInjector.class', - '**/*_Factory*.*', - '**/*_Provide*Factory*.*', - '**/*Extensions*.*', - // sealed and data classes - '**/*$Result.*', - '**/*$Result$*.*', - // adapters generated by moshi - '**/*JsonAdapter.*', - ] - - def javaTree = fileTree(dir: "${project.buildDir}/intermediates/javac/$sourceName/classes", excludes: fileFilter) - def kotlinTree = fileTree(dir: "${project.buildDir}/tmp/kotlin-classes/$sourceName", excludes: fileFilter) - classDirectories.from = files([javaTree], [kotlinTree]) - executionData.from = files("${project.buildDir}/jacoco/${testTaskName}.exec") - def coverageSourceDirs = ["src/main/java", - "src/$productFlavorName/java", - "src/$buildTypeName/java"] - - sourceDirectories.setFrom(files(coverageSourceDirs)) - additionalSourceDirs.setFrom(files(coverageSourceDirs)) - - reports { - csv.required = false - xml.required = true - html.required = true - } - } - } - } -} - -android { - buildTypes { - debug { - testCoverageEnabled true - } - } -} \ No newline at end of file diff --git a/core/main/test_dependencies.gradle b/core/main/test_dependencies.gradle deleted file mode 100644 index 800cb42b2e..0000000000 --- a/core/main/test_dependencies.gradle +++ /dev/null @@ -1,40 +0,0 @@ -dependencies { - //testImplementation "junit:junit:$junit_version" - testImplementation 'org.jetbrains.kotlin:kotlin-test:1.9.10' - testImplementation "org.junit.jupiter:junit-jupiter:$junit_jupiter_version" - testImplementation "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version" - testImplementation "org.json:json:$json_version" - testImplementation "org.mockito:mockito-junit-jupiter:$mockito_version" - testImplementation "org.mockito.kotlin:mockito-kotlin:4.1.0" - testImplementation "joda-time:joda-time:$jodatime_version" - testImplementation 'com.google.truth:truth:1.1.5' - testImplementation "org.skyscreamer:jsonassert:1.5.0" - - androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1' - androidTestImplementation "androidx.test.ext:junit-ktx:$androidx_junit_version" - androidTestImplementation "androidx.test:rules:$androidx_rules_version" - - androidTestImplementation 'androidx.test.uiautomator:uiautomator:2.2.0' -} - -tasks.matching { it instanceof Test }.all { - //testLogging.events = ["failed", "skipped", "started"] - // use to display stdout in travis - testLogging.events = ["failed", "skipped", "started", "standard_out"] - testLogging.exceptionFormat = "full" - useJUnitPlatform() -} - -android { - testOptions { - unitTests { - returnDefaultValues = true - includeAndroidResources = true - - all { - maxParallelForks = 10 - forkEvery = 20 - } - } - } -} diff --git a/core/nssdk/build.gradle b/core/nssdk/build.gradle deleted file mode 100644 index 1a9d40e8db..0000000000 --- a/core/nssdk/build.gradle +++ /dev/null @@ -1,38 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlinx-serialization' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" - -android { - namespace 'app.aaps.core.nssdk' -} - -dependencies { - api "com.squareup.retrofit2:retrofit:$retrofit2_version" - api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" - api "com.squareup.retrofit2:converter-gson:$retrofit2_version" - api "com.squareup.okhttp3:okhttp:$okhttp3_version" - api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" - - api "com.google.code.gson:gson:$gson_version" - - api "net.danlew:android.joda:$joda_version" - - api "io.reactivex.rxjava3:rxjava:$rxjava_version" - api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" - api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" - - api "androidx.core:core-ktx:$core_version" - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" - api "org.jetbrains.kotlinx:kotlinx-coroutines-rx3:$coroutines_version" - - api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version" -} diff --git a/core/nssdk/build.gradle.kts b/core/nssdk/build.gradle.kts new file mode 100644 index 0000000000..2b645915f9 --- /dev/null +++ b/core/nssdk/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlinx-serialization") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.core.nssdk" +} + +dependencies { + api(Libs.Squareup.Retrofit2.retrofit) + api(Libs.Squareup.Retrofit2.adapterRxJava3) + api(Libs.Squareup.Retrofit2.converterGson) + api(Libs.Squareup.Okhttp3.okhttp) + api(Libs.Squareup.Okhttp3.loggingInterceptor) + api(Libs.Google.gson) + api(Libs.jodaTimeAndroid) + api(Libs.Rx.rxJava) + //api(Libs.Rx.rxAndroid) + api(Libs.Rx.rxKotlin) + + api(Libs.AndroidX.core) + api(Libs.Kotlin.stdlibJdk8) + api(Libs.KotlinX.coroutinesCore) + api(Libs.KotlinX.coroutinesAndroid) + api(Libs.KotlinX.coroutinesRx3) + api(Libs.KotlinX.serializationJson) +} \ No newline at end of file diff --git a/core/ui/build.gradle b/core/ui/build.gradle deleted file mode 100644 index f8d0c810f6..0000000000 --- a/core/ui/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" - -android { - namespace 'app.aaps.core.ui' - - buildFeatures { - viewBinding true - } -} - -dependencies { - - api "androidx.core:core-ktx:$core_version" - api "androidx.appcompat:appcompat:$appcompat_version" - api "androidx.preference:preference-ktx:$preferencektx_version" - - api "com.google.android.material:material:$material_version" - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" -} \ No newline at end of file diff --git a/core/ui/build.gradle.kts b/core/ui/build.gradle.kts new file mode 100644 index 0000000000..0237acb232 --- /dev/null +++ b/core/ui/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("android-module-dependencies") +} + +android { + namespace = "app.aaps.core.ui" +} + +dependencies { + api(Libs.AndroidX.core) + api(Libs.AndroidX.appCompat) + api(Libs.AndroidX.preference) + + api(Libs.Google.Android.material) + + api(Libs.Dagger.android) + api(Libs.Dagger.androidSupport) +} \ No newline at end of file diff --git a/core/ui/src/main/res/values/colors.xml b/core/ui/src/main/res/values/colors.xml index 91179d4355..0e61c5c936 100644 --- a/core/ui/src/main/res/values/colors.xml +++ b/core/ui/src/main/res/values/colors.xml @@ -360,4 +360,17 @@ #ff0400 #00ffff + + #66BB6A + #FF8C00 + #FF5555 + + + #666666 + #000000 + #77dd77 + #ff0400 + #FF8C00 + #03A9F4 + diff --git a/core/utils/build.gradle b/core/utils/build.gradle deleted file mode 100644 index a3a1e8e324..0000000000 --- a/core/utils/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'app.aaps.core.utils' -} - -dependencies { - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - api "net.danlew:android.joda:$joda_version" - - //Firebase - api platform('com.google.firebase:firebase-bom:32.4.0') - api "com.google.firebase:firebase-analytics-ktx" - api "com.google.firebase:firebase-crashlytics-ktx" - // StatsActivity not in use now - // api "com.google.firebase:firebase-messaging-ktx" - // api 'com.google.firebase:firebase-auth-ktx' - // api 'com.google.firebase:firebase-database-ktx' - - //CryptoUtil - api 'com.madgag.spongycastle:core:1.58.0.0' - api "com.google.crypto.tink:tink-android:$tink_version" - - //WorkManager - api "androidx.work:work-runtime-ktx:$work_version" // DataWorkerStorage -} \ No newline at end of file diff --git a/core/utils/build.gradle.kts b/core/utils/build.gradle.kts new file mode 100644 index 0000000000..f5366c8fd6 --- /dev/null +++ b/core/utils/build.gradle.kts @@ -0,0 +1,38 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("kotlin-allopen") + id("android-module-dependencies") + id("all-open-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.core.utils" +} + +dependencies { + + api(Libs.jodaTimeAndroid) + + //Firebase + api(platform(Libs.Google.Firebase.firebaseBom)) + api(Libs.Google.Firebase.analytics) + api(Libs.Google.Firebase.crashlytics) + // StatsActivity not in use now + // api(Libs.Google.Firebase.messaging) + // api(Libs.Google.Firebase.auth) + // api(Libs.Google.Firebase.database) + + //CryptoUtil + api(Libs.spongycastleCore) + api(Libs.Google.tinkAndroid) + + //WorkManager + api(Libs.AndroidX.Work.runtimeKtx) // DataWorkerStorage + + api(Libs.Dagger.android) + api(Libs.Dagger.androidSupport) +} \ No newline at end of file diff --git a/core/validators/build.gradle b/core/validators/build.gradle deleted file mode 100644 index ba7c4b77b2..0000000000 --- a/core/validators/build.gradle +++ /dev/null @@ -1,26 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.core.validators' -} - - -dependencies { - implementation project(':core:interfaces') - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - api "com.google.android.material:material:$material_version" -} \ No newline at end of file diff --git a/core/validators/build.gradle.kts b/core/validators/build.gradle.kts new file mode 100644 index 0000000000..8b82e097e5 --- /dev/null +++ b/core/validators/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.core.validators" +} + + +dependencies { + implementation(project(":core:interfaces")) + + api(Libs.Dagger.android) + api(Libs.Dagger.androidSupport) + api(Libs.Google.Android.material) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/database/entities/build.gradle b/database/entities/build.gradle deleted file mode 100644 index 248d1db0c6..0000000000 --- a/database/entities/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" - -android { - - namespace 'app.aaps.database.entities' - defaultConfig { - minSdkVersion 26 // for wear - } - - buildFeatures { - buildConfig = false - } -} - -dependencies { - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - - api "androidx.core:core-ktx:$core_version" - - kapt "androidx.room:room-compiler:$room_version" - api "androidx.room:room-ktx:$room_version" - -} - -allOpen { - // allows mocking for classes w/o directly opening them for release builds - annotation 'app.aaps.database.annotations.DbOpenForTesting' -} diff --git a/database/entities/build.gradle.kts b/database/entities/build.gradle.kts new file mode 100644 index 0000000000..7fd6633bd4 --- /dev/null +++ b/database/entities/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "app.aaps.database.entities" + defaultConfig { + minSdk = Versions.wearMinSdk // for wear + } +} + +dependencies { + api(Libs.Kotlin.stdlibJdk8) + api(Libs.AndroidX.core) + api(Libs.AndroidX.Room.room) + + kapt(Libs.AndroidX.Room.compiler) +} \ No newline at end of file diff --git a/database/impl/build.gradle b/database/impl/build.gradle deleted file mode 100644 index ae471b1193..0000000000 --- a/database/impl/build.gradle +++ /dev/null @@ -1,53 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.database.impl' - - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } - sourceSets { - androidTest.assets.srcDirs += files("$projectDir/schemas") - } -} - -dependencies { - implementation project(':database:entities') - - api "androidx.core:core-ktx:$core_version" - api "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - api "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version" - - api "io.reactivex.rxjava3:rxjava:$rxjava_version" - api "io.reactivex.rxjava3:rxandroid:$rxandroid_version" - api "io.reactivex.rxjava3:rxkotlin:$rxkotlin_version" - - api "com.google.code.gson:gson:$gson_version" - - api "androidx.room:room-runtime:$room_version" - kapt "androidx.room:room-compiler:$room_version" - /* Database schema export */ - kapt "androidx.room:room-compiler:$room_version" - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-rxjava3:$room_version" - - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" - - androidTestImplementation "androidx.room:room-testing:$room_version" -} \ No newline at end of file diff --git a/database/impl/build.gradle.kts b/database/impl/build.gradle.kts new file mode 100644 index 0000000000..0a780f1976 --- /dev/null +++ b/database/impl/build.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("kotlin-allopen") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.database.impl" + + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } + sourceSets { + getByName("androidTest").assets.srcDirs("$projectDir/schemas") + } +} + +dependencies { + implementation(project(":database:entities")) + + api(Libs.Kotlin.stdlibJdk8) + api(Libs.Kotlin.reflect) + api(Libs.AndroidX.core) + + api(Libs.Rx.rxJava) + api(Libs.Rx.rxAndroid) + api(Libs.Rx.rxKotlin) + + api(Libs.Google.gson) + + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + + api(Libs.Dagger.android) + api(Libs.Dagger.androidSupport) + + androidTestImplementation(Libs.AndroidX.Room.testing) + + kapt(Libs.Dagger.compiler) + kapt(Libs.AndroidX.Room.compiler) +} \ No newline at end of file diff --git a/database/impl/src/debug/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt b/database/impl/src/debug/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt deleted file mode 100644 index 4d71733d52..0000000000 --- a/database/impl/src/debug/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt +++ /dev/null @@ -1,15 +0,0 @@ -package app.aaps.database.annotations - -/** - * This is the actual annotation that makes the class open. Don't use it directly, only through [DbOpenForTesting] - * which has a NOOP replacement in production. - */ -@Target(AnnotationTarget.ANNOTATION_CLASS) -annotation class DbOpenClass - -/** - * Annotate a class with [DbOpenForTesting] if it should be extendable for testing. - */ -@DbOpenClass -@Target(AnnotationTarget.CLASS) -annotation class DbOpenForTesting \ No newline at end of file diff --git a/database/impl/src/main/java/app/aaps/database/impl/AppRepository.kt b/database/impl/src/main/java/app/aaps/database/impl/AppRepository.kt index 657aa71706..e7600e68c9 100644 --- a/database/impl/src/main/java/app/aaps/database/impl/AppRepository.kt +++ b/database/impl/src/main/java/app/aaps/database/impl/AppRepository.kt @@ -1,7 +1,7 @@ package app.aaps.database.impl +import androidx.annotation.OpenForTesting import app.aaps.database.ValueWrapper -import app.aaps.database.annotations.DbOpenForTesting import app.aaps.database.entities.Bolus import app.aaps.database.entities.BolusCalculatorResult import app.aaps.database.entities.Carbs @@ -34,8 +34,9 @@ import javax.inject.Inject import javax.inject.Singleton import kotlin.math.roundToInt -@DbOpenForTesting -@Singleton class AppRepository @Inject internal constructor( +@OpenForTesting +@Singleton +class AppRepository @Inject internal constructor( internal val database: AppDatabase ) { diff --git a/database/impl/src/release/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt b/database/impl/src/release/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt deleted file mode 100644 index f00a7a2ff0..0000000000 --- a/database/impl/src/release/kotlin/app/aaps/database/annotations/DbOpenForTesting.kt +++ /dev/null @@ -1,8 +0,0 @@ -package app.aaps.database.annotations - -/** - * Annotate a class with [DbOpenForTesting] if it should be extendable for testing. - * In production the class remains final. - */ -@Target(AnnotationTarget.CLASS) -annotation class DbOpenForTesting \ No newline at end of file diff --git a/implementation/build.gradle b/implementation/build.gradle deleted file mode 100644 index ac3a14775f..0000000000 --- a/implementation/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'app.aaps.implementation' -} - -dependencies { - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:main') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') - testImplementation project(':plugins:aps') - testImplementation project(':pump:virtual') - - // Protection - api 'androidx.biometric:biometric:1.1.0' -} \ No newline at end of file diff --git a/implementation/build.gradle.kts b/implementation/build.gradle.kts new file mode 100644 index 0000000000..1e42bffd00 --- /dev/null +++ b/implementation/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("all-open-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.implementation" +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:main")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":plugins:aps")) + testImplementation(project(":pump:virtual")) + // Protection + api(Libs.AndroidX.biometric) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/insight/build.gradle b/insight/build.gradle deleted file mode 100644 index 78ebd94579..0000000000 --- a/insight/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'info.nightscout.androidaps.insight' - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } -} - -dependencies { - - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':pump:pump-common') - - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava3:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - api "com.google.android.material:material:$material_version" -} \ No newline at end of file diff --git a/insight/build.gradle.kts b/insight/build.gradle.kts new file mode 100644 index 0000000000..4e2a561932 --- /dev/null +++ b/insight/build.gradle.kts @@ -0,0 +1,39 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "info.nightscout.androidaps.insight" + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } +} + +dependencies { + + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":pump:pump-common")) + + api(Libs.Google.Android.material) + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + + kapt(Libs.AndroidX.Room.compiler) + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/jacoco_aggregation.gradle.kts b/jacoco_aggregation.gradle.kts new file mode 100644 index 0000000000..23a2da0531 --- /dev/null +++ b/jacoco_aggregation.gradle.kts @@ -0,0 +1,91 @@ +apply(plugin = "jacoco") + +project.afterEvaluate { + val variants = listOf("fullDebug") + + tasks.register(name = "jacocoAllDebugReport") { + + group = "Reporting" + description = "Generate overall Jacoco coverage report for the debug build." + + reports { + html.required.set(true) + xml.required.set(true) + } + + val excludes = listOf( + "**/di/*Module.class", + "**/di/*Component.class", + "**/com/jjoe64/**/*.*", + "**/R.class", + "**/R$*.class", + "**/BuildConfig.*", + "**/Manifest*.*", + "**/*Test*.*", + "android/**/*.*", + "androidx/**/*.*", + "**/*\$ViewInjector*.*", + "**/*Dagger*.*", + "**/*MembersInjector*.*", + "**/*_Factory.*", + "**/*_Provide*Factory*.*", + "**/*_ViewBinding*.*", + "**/AutoValue_*.*", + "**/R2.class", + "**/R2$*.class", + "**/*Directions$*", + "**/*Directions.*", + "**/*Binding.*", + "**/BR.class" + ) + + val classesDirectories = mutableListOf().also { + subprojects.forEach { proj -> + variants.forEach { variant -> + it.add("${proj.buildDir}/intermediates/javac/$variant/classes") + it.add("${proj.buildDir}/tmp/kotlin-classes/$variant") + } + } + } + + val classes = HashSet().also { + classesDirectories.forEach { path -> + it.add(fileTree(path) { exclude(excludes) }) + } + } + + classDirectories.setFrom(files(listOf(classes))) + + val sources = mutableListOf().also { + subprojects.forEach { proj -> + variants.forEach { variant -> + it.add("${proj.projectDir}/src/main/java") + it.add("${proj.projectDir}/src/main/kotlin") + it.add("${proj.projectDir}/src/$variant/java") + it.add("${proj.projectDir}/src/$variant/kotlin") + } + } + } + sourceDirectories.setFrom(files(sources)) + + val executions = mutableListOf().also { + subprojects.forEach { proj -> + variants.forEach { variant -> + val path = "${proj.buildDir}/outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.replaceFirstChar(Char::titlecase)}UnitTest.exec" + if ((File(path)).exists()) { + it.add(path) + println("Collecting execution data from: $path") + } + val androidPath = "${proj.buildDir}/outputs/code_coverage/${variant}AndroidTest/connected/" + val androidFiles = fileTree(androidPath) + androidFiles.forEach { file -> + it.add(file.path) + println("Collecting android execution data from: ${file.path}") + } + } + } + } + + executionData.setFrom(files(executions)) + } +} diff --git a/jacoco_project.gradle b/jacoco_project.gradle deleted file mode 100644 index eafbc72525..0000000000 --- a/jacoco_project.gradle +++ /dev/null @@ -1,84 +0,0 @@ -apply plugin: 'jacoco' - -jacoco { - toolVersion '0.8.10' -} - -project.afterEvaluate { - def variants = ["debug", "fullDebug"] - - tasks.create(name: "jacocoAllDebugReport", type: JacocoReport) { - - group = "Reporting" - description = "Generate overall Jacoco coverage report for the debug build." - - reports { - html.required.set(true) - xml.required.set(true) - } - - def excludes = [ - '**/di/*Module.class', - '**/di/*Component.class', - '**/com/jjoe64/**/*.*', - '**/R.class', - '**/R$*.class', - '**/BuildConfig.*', - '**/Manifest*.*', - '**/*Test*.*', - 'android/**/*.*', - 'androidx/**/*.*', - '**/*$ViewInjector*.*', - '**/*Dagger*.*', - '**/*MembersInjector*.*', - '**/*_Factory.*', - '**/*_Provide*Factory*.*', - '**/*_ViewBinding*.*', - '**/AutoValue_*.*', - '**/R2.class', - '**/R2$*.class', - '**/*Directions$*', - '**/*Directions.*', - '**/*Binding.*', - '**/BR.class' - ] - - def jClasses = subprojects.collect { proj -> - variants.collect { variant -> - "${proj.buildDir}/intermediates/javac/$variant/classes" - } - }.flatten() - def kClasses = subprojects.collect { proj -> - variants.collect { variant -> - "${proj.buildDir}/tmp/kotlin-classes/$variant" - } - }.flatten() - - def javaClasses = jClasses.collect { path -> - fileTree(dir: path, excludes: excludes) - } - def kotlinClasses = kClasses.collect { path -> - fileTree(dir: path, excludes: excludes) - } - - classDirectories.from = files([javaClasses, kotlinClasses]) - def sources = subprojects.collect { proj -> - variants.collect { variant -> - ["${proj.projectDir}/src/main/java", "${proj.projectDir}/src/main/kotlin", - "${proj.projectDir}/src/$variant/java", "${proj.projectDir}/src/$variant/kotlin"] - }.flatten() - }.flatten() - sourceDirectories.from = files(sources) - - def executions = subprojects.collect { proj -> - variants.collect { variant -> - def path = "${proj.buildDir}/outputs/unit_test_code_coverage/${variant}UnitTest/test${variant.capitalize()}UnitTest.exec" - // printf('Collecting execution data from: %s\n', path) - if ((new File(path)).exists()) path else null - } - }.flatten() - executions.removeAll([null]) - - executionData.from = files(executions) - } -} diff --git a/plugins/aps/build.gradle b/plugins/aps/build.gradle deleted file mode 100644 index f7b1eef555..0000000000 --- a/plugins/aps/build.gradle +++ /dev/null @@ -1,37 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.aps' -} - -dependencies { - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:main') - implementation project(':core:interfaces') - implementation project(':core:nssdk') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - - testImplementation project(':pump:virtual') - testImplementation project(':shared:tests') - - api "androidx.appcompat:appcompat:$appcompat_version" - api "androidx.swiperefreshlayout:swiperefreshlayout:$swipe_version" - api "androidx.gridlayout:gridlayout:$gridlayout_version" - - // APS - api 'org.mozilla:rhino:1.7.14' -} \ No newline at end of file diff --git a/plugins/aps/build.gradle.kts b/plugins/aps/build.gradle.kts new file mode 100644 index 0000000000..fae1e7a91d --- /dev/null +++ b/plugins/aps/build.gradle.kts @@ -0,0 +1,35 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.aps" +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:main")) + implementation(project(":core:interfaces")) + implementation(project(":core:nssdk")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + + testImplementation(project(":pump:virtual")) + testImplementation(project(":shared:tests")) + + api(Libs.AndroidX.appCompat) + api(Libs.AndroidX.swipeRefreshLayout) + api(Libs.AndroidX.gridLayout) + + // APS + api(Libs.Mozilla.rhino) + + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/automation/build.gradle b/plugins/automation/build.gradle deleted file mode 100644 index 06d03961cc..0000000000 --- a/plugins/automation/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.automation' -} - -dependencies { - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':database:entities') - implementation project(':database:impl') - - testImplementation project(':shared:tests') - testImplementation project(':shared:impl') - testImplementation project(':implementation') - testImplementation project(':plugins:main') - - api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" - api "com.google.android.gms:play-services-location:$play_services_location_version" -} \ No newline at end of file diff --git a/plugins/automation/build.gradle.kts b/plugins/automation/build.gradle.kts new file mode 100644 index 0000000000..a0d4361dd5 --- /dev/null +++ b/plugins/automation/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.automation" +} + +dependencies { + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":shared:impl")) + testImplementation(project(":implementation")) + testImplementation(project(":plugins:main")) + + api(Libs.AndroidX.constraintLayout) + api(Libs.Google.Android.PlayServices.location) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/configuration/build.gradle b/plugins/configuration/build.gradle deleted file mode 100644 index cb33277adb..0000000000 --- a/plugins/configuration/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' - id 'kotlin-parcelize' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.configuration' -} - - -dependencies { - implementation project(':database:entities') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:nssdk') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - - testImplementation project(':shared:tests') - - //WorkManager - api "androidx.work:work-runtime-ktx:$work_version" - // Maintenance - api "androidx.gridlayout:gridlayout:$gridlayout_version" -} \ No newline at end of file diff --git a/plugins/configuration/build.gradle.kts b/plugins/configuration/build.gradle.kts new file mode 100644 index 0000000000..0a16c630da --- /dev/null +++ b/plugins/configuration/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("kotlin-parcelize") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.configuration" +} + + +dependencies { + implementation(project(":database:entities")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:nssdk")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + + testImplementation(project(":shared:tests")) + + //WorkManager + api(Libs.AndroidX.Work.runtimeKtx) + // Maintenance + api(Libs.AndroidX.gridLayout) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/constraints/build.gradle b/plugins/constraints/build.gradle deleted file mode 100644 index e85a73b018..0000000000 --- a/plugins/constraints/build.gradle +++ /dev/null @@ -1,40 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.constraints' -} - -dependencies { - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - implementation project(':database:entities') - - testImplementation project(':database:impl') - testImplementation project(':implementation') - testImplementation project(':insight') - testImplementation project(':plugins:aps') - testImplementation project(':plugins:source') - testImplementation project(':pump:combo') - testImplementation project(':pump:dana') - testImplementation project(':pump:danar') - testImplementation project(':pump:danars') - testImplementation project(':pump:virtual') - testImplementation project(':shared:tests') - - // Phone checker - api 'com.scottyab:rootbeer-lib:0.1.0' -} \ No newline at end of file diff --git a/plugins/constraints/build.gradle.kts b/plugins/constraints/build.gradle.kts new file mode 100644 index 0000000000..fd111e8de4 --- /dev/null +++ b/plugins/constraints/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("all-open-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.constraints" +} + +dependencies { + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + implementation(project(":database:entities")) + + testImplementation(project(":database:impl")) + testImplementation(project(":implementation")) + testImplementation(project(":insight")) + testImplementation(project(":plugins:aps")) + testImplementation(project(":plugins:source")) + testImplementation(project(":pump:combo")) + testImplementation(project(":pump:dana")) + testImplementation(project(":pump:danar")) + testImplementation(project(":pump:danars")) + testImplementation(project(":pump:virtual")) + testImplementation(project(":shared:tests")) + + // Phone checker + api(Libs.rootBeer) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/insulin/build.gradle b/plugins/insulin/build.gradle deleted file mode 100644 index e934f67d54..0000000000 --- a/plugins/insulin/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'app.aaps.plugins.insulin' -} - - -dependencies { - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - implementation project(':database:entities') - - testImplementation project(':shared:tests') - testImplementation project(':core:main') -} \ No newline at end of file diff --git a/plugins/insulin/build.gradle.kts b/plugins/insulin/build.gradle.kts new file mode 100644 index 0000000000..33e7514873 --- /dev/null +++ b/plugins/insulin/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.insulin" +} + + +dependencies { + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + implementation(project(":database:entities")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":core:main")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/main/build.gradle b/plugins/main/build.gradle deleted file mode 100644 index fa34723f9c..0000000000 --- a/plugins/main/build.gradle +++ /dev/null @@ -1,48 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'app.aaps.plugins.main' -} - -dependencies { - implementation project(':shared:impl') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:nssdk') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - - testImplementation project(':implementation') - testImplementation project(':plugins:insulin') - testImplementation project(':shared:tests') - - api "androidx.appcompat:appcompat:$appcompat_version" - api "com.google.android.material:material:$material_version" - - // Actions - api "androidx.gridlayout:gridlayout:$gridlayout_version" - - //SmsCommunicator - api 'com.eatthepath:java-otp:0.4.0' - api 'com.github.kenglxn.QRGen:android:3.0.1' - - // Overview - api 'com.google.android.flexbox:flexbox:3.0.0' - - // Food - api "androidx.work:work-runtime-ktx:$work_version" -} \ No newline at end of file diff --git a/plugins/main/build.gradle.kts b/plugins/main/build.gradle.kts new file mode 100644 index 0000000000..62f7951e91 --- /dev/null +++ b/plugins/main/build.gradle.kts @@ -0,0 +1,48 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.main" +} + +dependencies { + implementation(project(":shared:impl")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:nssdk")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + + testImplementation(project(":implementation")) + testImplementation(project(":plugins:insulin")) + testImplementation(project(":shared:tests")) + + api(Libs.AndroidX.appCompat) + api(Libs.Google.Android.material) + + // Actions + api(Libs.AndroidX.gridLayout) + + //SmsCommunicator + api(Libs.javaOtp) + api(Libs.qrGen) + + // Overview + api(Libs.Google.Android.flexbox) + + // Food + api(Libs.AndroidX.Work.runtimeKtx) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/sensitivity/build.gradle b/plugins/sensitivity/build.gradle deleted file mode 100644 index d33ef78ef0..0000000000 --- a/plugins/sensitivity/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.sensitivity' -} - - -dependencies { - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:interfaces') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - - testImplementation project(':shared:tests') -} \ No newline at end of file diff --git a/plugins/sensitivity/build.gradle.kts b/plugins/sensitivity/build.gradle.kts new file mode 100644 index 0000000000..c81647e025 --- /dev/null +++ b/plugins/sensitivity/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.sensitivity" +} + + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:interfaces")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + + testImplementation(project(":shared:tests")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/smoothing/build.gradle b/plugins/smoothing/build.gradle deleted file mode 100644 index c910ef3dbd..0000000000 --- a/plugins/smoothing/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.smoothing' -} - - -dependencies { - implementation project(':database:entities') - implementation project(':core:interfaces') - implementation project(':core:ui') -} \ No newline at end of file diff --git a/plugins/smoothing/build.gradle.kts b/plugins/smoothing/build.gradle.kts new file mode 100644 index 0000000000..8dfc72e9d9 --- /dev/null +++ b/plugins/smoothing/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.smoothing" +} + + +dependencies { + implementation(project(":database:entities")) + implementation(project(":core:interfaces")) + implementation(project(":core:ui")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/source/build.gradle b/plugins/source/build.gradle deleted file mode 100644 index 95d4773913..0000000000 --- a/plugins/source/build.gradle +++ /dev/null @@ -1,30 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.source' -} - - -dependencies { - implementation project(':shared:impl') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:nssdk') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') -} \ No newline at end of file diff --git a/plugins/source/build.gradle.kts b/plugins/source/build.gradle.kts new file mode 100644 index 0000000000..df0c6cf34a --- /dev/null +++ b/plugins/source/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.source" +} + + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":shared:impl")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:nssdk")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/plugins/sync/build.gradle b/plugins/sync/build.gradle deleted file mode 100644 index dc8826f9ba..0000000000 --- a/plugins/sync/build.gradle +++ /dev/null @@ -1,55 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.plugins.sync' -} - -dependencies { - implementation project(':shared:impl') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:nssdk') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - - testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutines_version" - testImplementation "androidx.work:work-testing:$work_version" - - testImplementation project(':shared:tests') - testImplementation project(':implementation') - testImplementation project(':plugins:aps') - - // OpenHuman - api "com.squareup.okhttp3:okhttp:$okhttp3_version" - api "com.squareup.retrofit2:retrofit:$retrofit2_version" - api "androidx.browser:browser:1.6.0" - api "androidx.work:work-runtime-ktx:$work_version" - api "com.google.android.material:material:$material_version" - - // NSClient, Tidepool - api("io.socket:socket.io-client:2.1.0") - api "com.squareup.okhttp3:okhttp:$okhttp3_version" - api "com.squareup.okhttp3:logging-interceptor:$okhttp3_version" - api "com.squareup.retrofit2:adapter-rxjava3:$retrofit2_version" - api "com.squareup.retrofit2:converter-gson:$retrofit2_version" - - api "com.google.code.gson:gson:$gson_version" - - // DataLayerListenerService - api "com.google.android.gms:play-services-wearable:$play_services_wearable_version" -} \ No newline at end of file diff --git a/plugins/sync/build.gradle.kts b/plugins/sync/build.gradle.kts new file mode 100644 index 0000000000..b6b885370c --- /dev/null +++ b/plugins/sync/build.gradle.kts @@ -0,0 +1,54 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.plugins.sync" +} + +dependencies { + implementation(project(":shared:impl")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:nssdk")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + + + testImplementation(Libs.KotlinX.coroutinesTest) + testImplementation(Libs.AndroidX.Work.testing) + + testImplementation(project(":shared:tests")) + testImplementation(project(":implementation")) + testImplementation(project(":plugins:aps")) + + // OpenHuman + api(Libs.Squareup.Okhttp3.okhttp) + api(Libs.Squareup.Retrofit2.retrofit) + api(Libs.AndroidX.browser) + api(Libs.AndroidX.Work.runtimeKtx) + api(Libs.AndroidX.gridLayout) + api(Libs.Google.Android.material) + + // NSClient, Tidepool + api(Libs.socketIo) + api(Libs.Squareup.Okhttp3.loggingInterceptor) + api(Libs.Squareup.Retrofit2.adapterRxJava3) + api(Libs.Squareup.Retrofit2.converterGson) + api(Libs.Google.gson) + + // DataLayerListenerService + api(Libs.Google.Android.PlayServices.wearable) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/combo/build.gradle b/pump/combo/build.gradle deleted file mode 100644 index 53b9d9e7bd..0000000000 --- a/pump/combo/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - - buildFeatures { - aidl true - } - namespace 'info.nightscout.pump.combo' -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') - - // RuffyScripter - api "com.google.guava:guava:$guava_version" -} \ No newline at end of file diff --git a/pump/combo/build.gradle.kts b/pump/combo/build.gradle.kts new file mode 100644 index 0000000000..a7948278fd --- /dev/null +++ b/pump/combo/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + buildFeatures { + aidl = true + } + namespace = "info.nightscout.pump.combo" +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + + // RuffyScripter + api(Libs.Google.guava) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/combov2/build.gradle b/pump/combov2/build.gradle deleted file mode 100644 index 902108af6a..0000000000 --- a/pump/combov2/build.gradle +++ /dev/null @@ -1,46 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -dependencies { - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation(project(":pump:combov2:comboctl")) - - api "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycle_version" - api "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version" - - // This is necessary to avoid errors like these which otherwise come up often at runtime: - // "WARNING: Failed to transform class kotlinx/datetime/TimeZone$Companion - // java.lang.NoClassDefFoundError: kotlinx/serialization/KSerializer" - // - // "Rejecting re-init on previously-failed class java.lang.Class< - // kotlinx.datetime.serializers.LocalDateTimeIso8601Serializer>: - // java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/serialization/KSerializer" - // - // kotlinx-datetime higher than 0.2.0 depends on kotlinx-serialization, but that dependency - // is declared as "compileOnly". The runtime dependency on kotlinx-serialization is missing, - // causing this error. Solution is to add runtimeOnly here. - // - // Source: https://github.com/mockk/mockk/issues/685#issuecomment-907076353: - // TODO: Revisit this when upgrading kotlinx-datetime - runtimeOnly("org.jetbrains.kotlinx:kotlinx-serialization-core:$kotlinx_serialization_version") -} - -android { - namespace 'info.nightscout.pump.combov2' - buildFeatures { - dataBinding true - } -} diff --git a/pump/combov2/build.gradle.kts b/pump/combov2/build.gradle.kts new file mode 100644 index 0000000000..fe3c1ecd4c --- /dev/null +++ b/pump/combov2/build.gradle.kts @@ -0,0 +1,46 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.pump.combov2" + buildFeatures { + dataBinding = true + } +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":pump:combov2:comboctl")) + + api(Libs.AndroidX.lifecycleViewmodel) + api(Libs.KotlinX.datetime) + + // This is necessary to avoid errors like these which otherwise come up often at runtime: + // "WARNING: Failed to transform class kotlinx/datetime/TimeZone$Companion + // java.lang.NoClassDefFoundError: kotlinx/serialization/KSerializer" + // + // "Rejecting re-init on(previously-failed class java.lang.Class< + // kotlinx.datetime.serializers.LocalDateTimeIso8601Serializer>: + // java.lang.NoClassDefFoundError: Failed resolution of: Lkotlinx/serialization/KSerializer" + // + // kotlinx-datetime higher than 0.2.0 depends on kotlinx-serialization, but that dependency + // is declared as "compileOnly". The runtime dependency on kotlinx-serialization is missing, + // causing this error. Solution is to add runtimeOnly here. + // + // Source: https://github.com/mockk/mockk/issues/685#issuecomment-907076353: + // TODO: Revisit this when upgrading kotlinx-datetime + runtimeOnly(Libs.KotlinX.serializationCore) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/combov2/comboctl/build.gradle b/pump/combov2/comboctl/build.gradle deleted file mode 100644 index e999327421..0000000000 --- a/pump/combov2/comboctl/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'info.nightscout.comboctl' - sourceSets { - main { - kotlin.srcDirs += ['src/commonMain/kotlin', 'src/androidMain/kotlin'] - manifest.srcFile 'src/androidMain/AndroidManifest.xml' - } - test { - kotlin.srcDirs += ['src/jvmTest/kotlin'] - } - } -} - -dependencies { - implementation platform("org.jetbrains.kotlin:kotlin-bom") - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version" - implementation "androidx.core:core-ktx:$core_version" - testImplementation 'org.jetbrains.kotlin:kotlin-test' - testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' - testImplementation "io.kotlintest:kotlintest-runner-junit5:3.4.2" - testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:$junit_jupiter_version" -} \ No newline at end of file diff --git a/pump/combov2/comboctl/build.gradle.kts b/pump/combov2/comboctl/build.gradle.kts new file mode 100644 index 0000000000..cac2014d43 --- /dev/null +++ b/pump/combov2/comboctl/build.gradle.kts @@ -0,0 +1,30 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.comboctl" + sourceSets.getByName("main") { + kotlin.srcDir("src/commonMain/kotlin") + kotlin.srcDir("src/androidMain/kotlin") + manifest.srcFile("src/androidMain/AndroidManifest.xml") + } + sourceSets.getByName("test") { + kotlin.srcDir("src/jvmTest/kotlin") + } +} + +dependencies { + + api(Libs.KotlinX.coroutinesCore) + api(Libs.KotlinX.datetime) + api(Libs.AndroidX.core) + + testImplementation(kotlin("test")) + testImplementation(Libs.kotlinTestRunner) + testRuntimeOnly(Libs.JUnit.jupiterEngine) +} \ No newline at end of file diff --git a/pump/dana/build.gradle b/pump/dana/build.gradle deleted file mode 100644 index 3c44880ef9..0000000000 --- a/pump/dana/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'info.nightscout.pump.dana' - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava3:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - testImplementation project(':shared:tests') - testImplementation project(':core:main') // create profile from json -} \ No newline at end of file diff --git a/pump/dana/build.gradle.kts b/pump/dana/build.gradle.kts new file mode 100644 index 0000000000..1b030af2b3 --- /dev/null +++ b/pump/dana/build.gradle.kts @@ -0,0 +1,40 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "info.nightscout.pump.dana" + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + kapt(Libs.AndroidX.Room.compiler) + + testImplementation(project(":shared:tests")) + testImplementation(project(":core:main")) // create profile from json + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/danar/build.gradle b/pump/danar/build.gradle deleted file mode 100644 index 18ed198b15..0000000000 --- a/pump/danar/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'info.nightscout.androidaps.danar' -} - -dependencies { - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':pump:dana') - - api 'androidx.media3:media3-common:1.1.1' - - testImplementation project(':shared:tests') - testImplementation project(':core:main') -} \ No newline at end of file diff --git a/pump/danar/build.gradle.kts b/pump/danar/build.gradle.kts new file mode 100644 index 0000000000..7812d48af7 --- /dev/null +++ b/pump/danar/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.danar" +} + +dependencies { + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":pump:dana")) + + api(Libs.AndroidX.media3) + + testImplementation(project(":shared:tests")) + testImplementation(project(":core:main")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/danars/build.gradle b/pump/danars/build.gradle deleted file mode 100644 index d9dc3a2aab..0000000000 --- a/pump/danars/build.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - ndkVersion "21.1.6352462" - namespace 'info.nightscout.pump.danars' - - defaultConfig { - - ndk { - moduleName "BleCommandUtil" - } - } - - sourceSets { - main { - jniLibs.srcDirs = ['src/main/jniLibs'] - } - } -} - -dependencies { - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':pump:dana') - - testImplementation project(':shared:tests') - testImplementation project(':core:main') -} \ No newline at end of file diff --git a/pump/danars/build.gradle.kts b/pump/danars/build.gradle.kts new file mode 100644 index 0000000000..76b977c0ca --- /dev/null +++ b/pump/danars/build.gradle.kts @@ -0,0 +1,38 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.pump.danars" + ndkVersion = Versions.ndkVersion + + defaultConfig { + ndk { + moduleName = "BleCommandUtil" + } + } + + sourceSets.getByName("main") { + jniLibs.srcDirs("src/main/jniLibs") + } +} + +dependencies { + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":pump:dana")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":core:main")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/diaconn/build.gradle b/pump/diaconn/build.gradle deleted file mode 100644 index 531cc1c38e..0000000000 --- a/pump/diaconn/build.gradle +++ /dev/null @@ -1,43 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'info.nightscout.pump.diaconn' - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } -} - -dependencies { - implementation project(':shared:impl') - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava3:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - api "com.squareup.okhttp3:okhttp:$okhttp3_version" - api "com.squareup.retrofit2:retrofit:$retrofit2_version" - api "com.squareup.retrofit2:converter-gson:$retrofit2_version" -} \ No newline at end of file diff --git a/pump/diaconn/build.gradle.kts b/pump/diaconn/build.gradle.kts new file mode 100644 index 0000000000..3ed5b4c666 --- /dev/null +++ b/pump/diaconn/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "info.nightscout.pump.diaconn" + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } +} + +dependencies { + implementation(project(":shared:impl")) + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + kapt(Libs.AndroidX.Room.compiler) + + api(Libs.Squareup.Okhttp3.okhttp) + api(Libs.Squareup.Retrofit2.retrofit) + api(Libs.Squareup.Retrofit2.converterGson) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/eopatch-core/build.gradle b/pump/eopatch-core/build.gradle deleted file mode 100644 index 37621a5a2b..0000000000 --- a/pump/eopatch-core/build.gradle +++ /dev/null @@ -1,2 +0,0 @@ -configurations.create("default") -artifacts.add("default", file('libs/eopatch_core.aar')) \ No newline at end of file diff --git a/pump/eopatch-core/build.gradle.kts b/pump/eopatch-core/build.gradle.kts new file mode 100644 index 0000000000..9ab3aa190d --- /dev/null +++ b/pump/eopatch-core/build.gradle.kts @@ -0,0 +1,2 @@ +configurations.create("default") +artifacts.add("default", file("libs/eopatch_core.aar")) \ No newline at end of file diff --git a/pump/eopatch/build.gradle b/pump/eopatch/build.gradle deleted file mode 100644 index 281a2187b4..0000000000 --- a/pump/eopatch/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'info.nightscout.androidaps.plugins.pump.eopatch' - dataBinding { - enabled = true - } -} - -dependencies { - implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation project(':pump:eopatch-core') - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':database:entities') - - api "com.google.guava:guava:$guava_version" - - //RxAndroidBle - implementation "com.polidea.rxandroidble3:rxandroidble:1.17.2" - implementation "com.jakewharton.rx3:replaying-share:3.0.0" -} \ No newline at end of file diff --git a/pump/eopatch/build.gradle.kts b/pump/eopatch/build.gradle.kts new file mode 100644 index 0000000000..8cfddc991b --- /dev/null +++ b/pump/eopatch/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.plugins.pump.eopatch" + buildFeatures { + dataBinding = true + } +} + +dependencies { + implementation(project(":pump:eopatch-core")) + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":database:entities")) + + api(Libs.Google.guava) + + //RxAndroidBle + api(Libs.rxandroidBle) + api(Libs.rx3ReplayingShare) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/medtronic/build.gradle b/pump/medtronic/build.gradle deleted file mode 100644 index b71f2603dc..0000000000 --- a/pump/medtronic/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'info.nightscout.androidaps.plugins.pump.medtronic' -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - implementation project(':pump:pump-common') - implementation project(':pump:rileylink') - - testImplementation project(':shared:tests') - testImplementation project(':database:impl') -} diff --git a/pump/medtronic/build.gradle.kts b/pump/medtronic/build.gradle.kts new file mode 100644 index 0000000000..0c38a6f7f5 --- /dev/null +++ b/pump/medtronic/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.plugins.pump.medtronic" +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + implementation(project(":pump:pump-common")) + implementation(project(":pump:rileylink")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":database:impl")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} diff --git a/pump/medtrum/build.gradle b/pump/medtrum/build.gradle deleted file mode 100644 index f60bcbafb6..0000000000 --- a/pump/medtrum/build.gradle +++ /dev/null @@ -1,33 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'info.nightscout.pump.medtrum' - dataBinding { - enabled = true - } -} - -dependencies { - implementation project(':database:entities') - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':core:validators') - implementation project(':pump:pump-common') - - testImplementation project(':shared:tests') - testImplementation project(':core:main') -} diff --git a/pump/medtrum/build.gradle.kts b/pump/medtrum/build.gradle.kts new file mode 100644 index 0000000000..d39da5f847 --- /dev/null +++ b/pump/medtrum/build.gradle.kts @@ -0,0 +1,32 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.pump.medtrum" + buildFeatures { + dataBinding = true + } +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":core:validators")) + implementation(project(":pump:pump-common")) + + testImplementation(project(":shared:tests")) + testImplementation(project(":core:main")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} diff --git a/pump/omnipod-common/build.gradle b/pump/omnipod-common/build.gradle deleted file mode 100644 index 2258b47333..0000000000 --- a/pump/omnipod-common/build.gradle +++ /dev/null @@ -1,29 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'info.nightscout.androidaps.plugins.pump.omnipod.common' -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:ui') - implementation project(':core:utils') - - api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" - api "androidx.fragment:fragment-ktx:$fragmentktx_version" - api "androidx.navigation:navigation-fragment-ktx:$nav_version" - - api "com.google.android.material:material:$material_version" -} \ No newline at end of file diff --git a/pump/omnipod-common/build.gradle.kts b/pump/omnipod-common/build.gradle.kts new file mode 100644 index 0000000000..7c6bf09f47 --- /dev/null +++ b/pump/omnipod-common/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.plugins.pump.omnipod.common" +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + api(Libs.AndroidX.constraintLayout) + api(Libs.AndroidX.fragment) + api(Libs.AndroidX.navigationFragment) + api(Libs.Google.Android.material) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/pump/omnipod-dash/build.gradle b/pump/omnipod-dash/build.gradle deleted file mode 100644 index 8faa4d59a9..0000000000 --- a/pump/omnipod-dash/build.gradle +++ /dev/null @@ -1,49 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'info.nightscout.androidaps.plugins.pump.omnipod.dash' - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } -} - -dependencies { - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':pump:pump-common') - implementation project(':pump:omnipod-common') - - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava3:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - androidTestImplementation project(':shared:tests') - testImplementation project(':shared:tests') - testImplementation "commons-codec:commons-codec:$commonscodec_version" - - api 'com.github.guepardoapps:kulid:2.0.0.0' -} diff --git a/pump/omnipod-dash/build.gradle.kts b/pump/omnipod-dash/build.gradle.kts new file mode 100644 index 0000000000..ca97eb800b --- /dev/null +++ b/pump/omnipod-dash/build.gradle.kts @@ -0,0 +1,47 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + + namespace = "info.nightscout.androidaps.plugins.pump.omnipod.dash" + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":pump:pump-common")) + implementation(project(":pump:omnipod-common")) + + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + api(Libs.kulid) + + androidTestImplementation(project(":shared:tests")) + testImplementation(project(":shared:tests")) + testImplementation(Libs.commonCodecs) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) + kapt(Libs.AndroidX.Room.compiler) +} diff --git a/pump/omnipod-dash/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistoryTest.kt b/pump/omnipod-dash/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistoryTest.kt index 5cb3de649e..33bce4c817 100644 --- a/pump/omnipod-dash/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistoryTest.kt +++ b/pump/omnipod-dash/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/history/DashHistoryTest.kt @@ -5,12 +5,14 @@ import androidx.room.Room import androidx.test.core.app.ApplicationProvider import androidx.test.ext.junit.runners.AndroidJUnit4 import app.aaps.shared.tests.AAPSLoggerTest +import com.github.guepardoapps.kulid.ULID import info.nightscout.androidaps.plugins.pump.omnipod.common.definition.OmnipodCommandType import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.DashHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.database.HistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.dash.history.mapper.HistoryMapper +import org.junit.After import org.junit.Before -import org.junit.jupiter.api.Test +import org.junit.Test import org.junit.runner.RunWith @RunWith(AndroidJUnit4::class) @@ -37,9 +39,9 @@ class DashHistoryTest { assertValue { it.isEmpty() } } - // dashHistory.createRecord(commandType = OmnipodCommandType.CANCEL_BOLUS, 0L).test().apply { - // assertValue { ULID.isValid(it) } - // } + dashHistory.createRecord(commandType = OmnipodCommandType.CANCEL_BOLUS, 0L).test().apply { + assertValue { it != 0L } + } dashHistory.getRecords().test().apply { assertValue { it.size == 1 } @@ -61,7 +63,7 @@ class DashHistoryTest { } } - @org.junit.jupiter.api.AfterEach + @After fun tearDown() { database.close() } diff --git a/pump/omnipod-eros/build.gradle b/pump/omnipod-eros/build.gradle deleted file mode 100644 index 64593ca2f2..0000000000 --- a/pump/omnipod-eros/build.gradle +++ /dev/null @@ -1,51 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'info.nightscout.androidaps.plugins.pump.omnipod.eros' - defaultConfig { - kapt { - arguments { - arg("room.incremental", "true") - arg("room.schemaLocation", "$projectDir/schemas") - } - } - } -} - -dependencies { - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:libraries') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':core:ui') - implementation project(':core:validators') - implementation project(':pump:pump-common') - implementation project(':pump:rileylink') - implementation project(':pump:omnipod-common') - - testImplementation project(':shared:impl') - - api "androidx.room:room-ktx:$room_version" - api "androidx.room:room-runtime:$room_version" - api "androidx.room:room-rxjava3:$room_version" - kapt "androidx.room:room-compiler:$room_version" - - testImplementation project(':shared:tests') - // optional - Test helpers - testImplementation("androidx.room:room-testing:$room_version") - testImplementation project(':implementation') -} diff --git a/pump/omnipod-eros/build.gradle.kts b/pump/omnipod-eros/build.gradle.kts new file mode 100644 index 0000000000..9002b16444 --- /dev/null +++ b/pump/omnipod-eros/build.gradle.kts @@ -0,0 +1,51 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.plugins.pump.omnipod.eros" + + defaultConfig { + kapt { + arguments { + arg("room.incremental", "true") + arg("room.schemaLocation", "$projectDir/schemas") + } + } + } +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:libraries")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + implementation(project(":core:validators")) + implementation(project(":pump:pump-common")) + implementation(project(":pump:rileylink")) + implementation(project(":pump:omnipod-common")) + + api(Libs.AndroidX.Room.room) + api(Libs.AndroidX.Room.runtime) + api(Libs.AndroidX.Room.rxJava3) + + androidTestImplementation(project(":shared:tests")) + // optional - Test helpers + testImplementation(Libs.AndroidX.Room.testing) + testImplementation(project(":implementation")) + testImplementation(project(":shared:impl")) + testImplementation(project(":shared:tests")) + + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) + kapt(Libs.AndroidX.Room.compiler) +} diff --git a/pump/omnipod-eros/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistoryTest.kt b/pump/omnipod-eros/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistoryTest.kt index d8c0da7cae..ad9235fcdd 100644 --- a/pump/omnipod-eros/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistoryTest.kt +++ b/pump/omnipod-eros/src/androidTest/java/info/nightscout/androidaps/plugins/pump/omnipod/eros/history/ErosHistoryTest.kt @@ -3,22 +3,25 @@ package info.nightscout.androidaps.plugins.pump.omnipod.eros.history import android.content.Context import androidx.room.Room import androidx.test.core.app.ApplicationProvider +import androidx.test.ext.junit.runners.AndroidJUnit4 +import com.google.common.truth.Truth.assertThat import info.nightscout.androidaps.plugins.pump.omnipod.eros.definition.PodHistoryEntryType import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryDatabase import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordDao import info.nightscout.androidaps.plugins.pump.omnipod.eros.history.database.ErosHistoryRecordEntity -import org.junit.Assert.assertNotNull -import org.junit.jupiter.api.AfterEach -import org.junit.jupiter.api.BeforeEach -import org.junit.jupiter.api.Test +import org.junit.After +import org.junit.Before +import org.junit.Test +import org.junit.runner.RunWith +@RunWith(AndroidJUnit4::class) class ErosHistoryTest { private lateinit var dao: ErosHistoryRecordDao private lateinit var database: ErosHistoryDatabase private lateinit var erosHistory: ErosHistory - @BeforeEach + @Before fun setUp() { val context = ApplicationProvider.getApplicationContext() database = Room.inMemoryDatabaseBuilder( @@ -32,7 +35,7 @@ class ErosHistoryTest { @Test fun testInsertionAndRetrieval() { var history = erosHistory.getAllErosHistoryRecordsFromTimestamp(0L) - assert(history.isEmpty()) + assertThat(history).isEmpty() val type = PodHistoryEntryType.SET_BOLUS.code.toLong() val entity = ErosHistoryRecordEntity(1000L, type) @@ -40,15 +43,15 @@ class ErosHistoryTest { erosHistory.create(ErosHistoryRecordEntity(3000L, PodHistoryEntryType.CANCEL_BOLUS.code.toLong())) history = erosHistory.getAllErosHistoryRecordsFromTimestamp(0L) - assert(history.size == 2) - assert(type == history.first().podEntryTypeCode) + assertThat(history.size).isEqualTo(2) + assertThat(type).isEqualTo(history.first().podEntryTypeCode) val returnedEntity = erosHistory.findErosHistoryRecordByPumpId(entity.pumpId) - assertNotNull(returnedEntity) - assert(type == returnedEntity?.podEntryTypeCode) + assertThat(returnedEntity).isNotNull() + assertThat(type).isEqualTo(returnedEntity?.podEntryTypeCode) } - @AfterEach + @After fun tearDown() { database.close() } diff --git a/pump/pump-common/build.gradle b/pump/pump-common/build.gradle deleted file mode 100644 index 1eac553e61..0000000000 --- a/pump/pump-common/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'info.nightscout.pump.common' -} - -dependencies { - implementation project(':core:interfaces') - implementation project(':core:utils') - - implementation('com.thoughtworks.xstream:xstream:1.4.20') { - exclude group: 'xmlpull', module: 'xmlpull' - } - - api "com.google.code.gson:gson:$gson_version" - implementation project(path: ':core:ui') -} diff --git a/pump/pump-common/build.gradle.kts b/pump/pump-common/build.gradle.kts new file mode 100644 index 0000000000..27572c08cd --- /dev/null +++ b/pump/pump-common/build.gradle.kts @@ -0,0 +1,24 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.pump.common" +} + +dependencies { + implementation(project(":core:interfaces")) + implementation(project(":core:utils")) + implementation(project(":core:ui")) + + api(Libs.xstream) + api(Libs.Google.gson) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} diff --git a/pump/rileylink/build.gradle b/pump/rileylink/build.gradle deleted file mode 100644 index 4fb93e7916..0000000000 --- a/pump/rileylink/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" -android { - namespace 'info.nightscout.androidaps.plugins.pump.common.hw.rileylink' -} - -dependencies { - implementation project(':core:interfaces') - implementation project(':core:ui') - implementation project(':pump:pump-common') - - testImplementation project(':shared:tests') -} diff --git a/pump/rileylink/build.gradle.kts b/pump/rileylink/build.gradle.kts new file mode 100644 index 0000000000..6dec816cf3 --- /dev/null +++ b/pump/rileylink/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "info.nightscout.androidaps.plugins.pump.common.hw.rileylink" +} + +dependencies { + implementation(project(":core:interfaces")) + implementation(project(":core:ui")) + implementation(project(":pump:pump-common")) + + testImplementation(project(":shared:tests")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} diff --git a/pump/virtual/build.gradle b/pump/virtual/build.gradle deleted file mode 100644 index 3329ea7b62..0000000000 --- a/pump/virtual/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'app.aaps.pump.virtual' -} - -dependencies { - implementation project(':database:entities') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') -} \ No newline at end of file diff --git a/pump/virtual/build.gradle.kts b/pump/virtual/build.gradle.kts new file mode 100644 index 0000000000..eafad6764e --- /dev/null +++ b/pump/virtual/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.pump.virtual" +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/shared/impl/build.gradle b/shared/impl/build.gradle deleted file mode 100644 index e67cbd5e0d..0000000000 --- a/shared/impl/build.gradle +++ /dev/null @@ -1,25 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' - id 'kotlinx-serialization' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - - namespace 'app.aaps.shared.impl' - defaultConfig { - minSdkVersion 26 // for wear - } -} - -dependencies { - implementation project(':core:interfaces') -} \ No newline at end of file diff --git a/shared/impl/build.gradle.kts b/shared/impl/build.gradle.kts new file mode 100644 index 0000000000..59baf7a5a9 --- /dev/null +++ b/shared/impl/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.shared.impl" + defaultConfig { + minSdk = Versions.wearMinSdk // for wear + } +} + +dependencies { + implementation(project(":core:interfaces")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/shared/tests/build.gradle b/shared/tests/build.gradle deleted file mode 100644 index 00c24c1373..0000000000 --- a/shared/tests/build.gradle +++ /dev/null @@ -1,35 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlinx-serialization' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/allopen_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.shared.tests' -} - -dependencies { - implementation project(':database:entities') - implementation project(':shared:impl') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:utils') - implementation project(':implementation') - - - api "org.mockito:mockito-junit-jupiter:$mockito_version" - api "org.mockito.kotlin:mockito-kotlin:5.1.0" - api "org.junit.jupiter:junit-jupiter-api:$junit_jupiter_version" - - api "com.google.dagger:dagger:$dagger_version" - api "com.google.dagger:dagger-android:$dagger_version" - api "com.google.dagger:dagger-android-support:$dagger_version" -} \ No newline at end of file diff --git a/shared/tests/build.gradle.kts b/shared/tests/build.gradle.kts new file mode 100644 index 0000000000..6d06190352 --- /dev/null +++ b/shared/tests/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.shared.tests" +} + +dependencies { + implementation(project(":database:entities")) + implementation(project(":shared:impl")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:utils")) + implementation(project(":implementation")) + + + api(Libs.Mockito.jupiter) + api(Libs.Mockito.kotlin) + api(Libs.JUnit.jupiterApi) + + //api "com.google.dagger:dagger:$dagger_version" + //api "com.google.dagger:dagger-android:$dagger_version" + //api "com.google.dagger:dagger-android-support:$dagger_version" +} \ No newline at end of file diff --git a/ui/build.gradle b/ui/build.gradle deleted file mode 100644 index c75e9364c1..0000000000 --- a/ui/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.ui' -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:graphview') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - - testImplementation project(':shared:tests') -} \ No newline at end of file diff --git a/ui/build.gradle.kts b/ui/build.gradle.kts new file mode 100644 index 0000000000..447b448b3e --- /dev/null +++ b/ui/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.ui" +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:graphview")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + + testImplementation(project(":shared:tests")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file diff --git a/wear/build.gradle b/wear/build.gradle deleted file mode 100644 index 49a9ee4e5c..0000000000 --- a/wear/build.gradle +++ /dev/null @@ -1,149 +0,0 @@ -buildscript { - repositories { - google() - mavenCentral() - } - - dependencies { - classpath "org.jacoco:org.jacoco.core:0.8.11" - } -} - -plugins { - id 'com.android.application' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - - -def generateGitBuild = { -> - - StringBuilder stringBuilder = new StringBuilder() - stringBuilder.append('"') - try { - def stdout = new ByteArrayOutputStream() - exec { - commandLine 'git', 'describe', '--always' - standardOutput = stdout - } - String commitObject = stdout.toString().trim() - stringBuilder.append(commitObject) - } catch (ignored) { - stringBuilder.append('NoGitSystemAvailable') - } - stringBuilder.append('-') - stringBuilder.append((new Date()).format('yyyy.MM.dd')) - stringBuilder.append('"') - return stringBuilder.toString() -} - -android { - compileSdk 34 - - defaultConfig { - minSdkVersion 26 - targetSdkVersion 29 - versionCode 2 - versionName "1.0.3" - buildConfigField "String", "BUILDVERSION", generateGitBuild() - } - - buildFeatures { - viewBinding true - } - - flavorDimensions = ["standard"] - productFlavors { - full { - applicationId "info.nightscout.androidaps" - dimension "standard" - versionName version - } - pumpcontrol { - applicationId "info.nightscout.aapspumpcontrol" - dimension "standard" - versionName version + "-pumpcontrol" - } - aapsclient { - applicationId "info.nightscout.aapsclient" - dimension "standard" - versionName version + "-aapsclient" - } - aapsclient2 { - applicationId "info.nightscout.aapsclient2" - dimension "standard" - versionName version + "-aapsclient" - } - } - namespace 'app.aaps.wear' -} - -allprojects { - repositories { - google() - mavenCentral() - } - apply plugin: 'jacoco' -} - - -dependencies { - implementation project(':shared:impl') - implementation project(':core:interfaces') - - implementation fileTree(include: ['*.jar'], dir: 'libs') - - implementation "androidx.appcompat:appcompat:$appcompat_version" - implementation "androidx.core:core-ktx:$core_version" - implementation 'androidx.legacy:legacy-support-v13:1.0.0' - implementation "androidx.preference:preference-ktx:$preferencektx_version" - implementation 'androidx.wear:wear:1.3.0' - implementation 'androidx.wear.tiles:tiles:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.1.4' - testImplementation project(':shared:tests') - - compileOnly "com.google.android.wearable:wearable:$wearable_version" - implementation "com.google.android.support:wearable:$wearable_version" - implementation "com.google.android.gms:play-services-wearable:$play_services_wearable_version" - implementation(files("${rootProject.rootDir}/core/libraries/libs/ustwo-clockwise-debug.aar")) - implementation(files("${rootProject.rootDir}/core/libraries/libs/wearpreferenceactivity-0.5.0.aar")) - implementation(files("${rootProject.rootDir}/core/libraries/libs/hellocharts-library-1.5.8.aar")) - - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-guava:$coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutines_version" - implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version" - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" - - // for old fashioned support-app version - implementation "com.google.dagger:dagger:$dagger_version" - implementation "com.google.dagger:dagger-android:$dagger_version" - implementation "com.google.dagger:dagger-android-support:$dagger_version" - - kapt "com.google.dagger:dagger-android-processor:$dagger_version" - kapt "com.google.dagger:dagger-compiler:$dagger_version" -} -repositories { - mavenCentral() -} - -// This is necessary to prevent Gradle build errors like: -// -// Duplicate class androidx.lifecycle.ViewModelLazy found in modules jetified-lifecycle-viewmodel-ktx-2.3.1-runtime (androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1) and lifecycle-viewmodel-2.5.0-runtime (androidx.lifecycle:lifecycle-viewmodel:2.5.0) -// -// By explicitly adding these dependencies, the jetifier -// is forced to use the correct lifecycle version instead -// of automatically picking 2.3.1. -// -// See: https://stackoverflow.com/a/69832319/560774 -configurations { - all { - exclude group: 'androidx.lifecycle', module: 'lifecycle-viewmodel-ktx' - } -} diff --git a/wear/build.gradle.kts b/wear/build.gradle.kts new file mode 100644 index 0000000000..9e074ec8c1 --- /dev/null +++ b/wear/build.gradle.kts @@ -0,0 +1,115 @@ +import java.io.ByteArrayOutputStream +import java.text.SimpleDateFormat +import java.util.Date + +plugins { + id("com.android.application") + id("kotlin-android") + id("kotlin-kapt") + id("android-app-dependencies") + id("test-app-dependencies") + id("jacoco-app-dependencies") +} + +repositories { + google() + mavenCentral() +} + +fun generateGitBuild(): String { + val stringBuilder: StringBuilder = StringBuilder() + try { + val stdout = ByteArrayOutputStream() + exec { + commandLine("git", "describe", "--always") + standardOutput = stdout + } + val commitObject = stdout.toString().trim() + stringBuilder.append(commitObject) + } catch (ignored: Exception) { + stringBuilder.append("NoGitSystemAvailable") + } + return stringBuilder.toString() +} + +fun generateDate(): String { + val stringBuilder: StringBuilder = StringBuilder() + // showing only date prevents app to rebuild everytime + stringBuilder.append(SimpleDateFormat("yyyy.MM.dd").format(Date())) + return stringBuilder.toString() +} + + +android { + namespace = "app.aaps.wear" + + defaultConfig { + minSdk = Versions.wearMinSdk + targetSdk = Versions.wearTargetSdk + + buildConfigField("String", "BUILDVERSION", "\"${generateGitBuild()}-${generateDate()}\"") + } + + flavorDimensions.add("standard") + productFlavors { + create("full") { + isDefault = true + applicationId = "info.nightscout.androidaps" + dimension = "standard" + versionName = Versions.appVersion + } + create("pumpcontrol") { + applicationId = "info.nightscout.aapspumpcontrol" + dimension = "standard" + versionName = Versions.appVersion + "-pumpcontrol" + } + create("aapsclient") { + applicationId = "info.nightscout.aapsclient" + dimension = "standard" + versionName = Versions.appVersion + "-aapsclient" + } + create("aapsclient2") { + applicationId = "info.nightscout.aapsclient2" + dimension = "standard" + versionName = Versions.appVersion + "-aapsclient2" + } + } +} + +allprojects { + repositories { + } +} + + +dependencies { + implementation(project(":shared:impl")) + implementation(project(":core:interfaces")) + + implementation(Libs.AndroidX.appCompat) + implementation(Libs.AndroidX.core) + implementation(Libs.AndroidX.legacySupport) + implementation(Libs.AndroidX.preference) + implementation(Libs.AndroidX.Wear.wear) + implementation(Libs.AndroidX.Wear.tiles) + implementation(Libs.AndroidX.constraintLayout) + + testImplementation(project(":shared:tests")) + + compileOnly(Libs.Google.Android.Wearable.wearable) + implementation(Libs.Google.Android.Wearable.wearableSupport) + implementation(Libs.Google.Android.PlayServices.wearable) + implementation(files("${rootDir}/wear/libs/ustwo-clockwise-debug.aar")) + implementation(files("${rootDir}/wear/libs/wearpreferenceactivity-0.5.0.aar")) + implementation(files("${rootDir}/wear/libs/hellocharts-library-1.5.8.aar")) + + implementation(Libs.KotlinX.coroutinesCore) + implementation(Libs.KotlinX.coroutinesAndroid) + implementation(Libs.KotlinX.coroutinesGuava) + implementation(Libs.KotlinX.coroutinesPlayServices) + implementation(Libs.KotlinX.datetime) + implementation(Libs.Kotlin.stdlibJdk8) + + kapt(Libs.Dagger.androidProcessor) + kapt(Libs.Dagger.compiler) +} diff --git a/core/libraries/libs/hellocharts-library-1.5.8.aar b/wear/libs/hellocharts-library-1.5.8.aar similarity index 100% rename from core/libraries/libs/hellocharts-library-1.5.8.aar rename to wear/libs/hellocharts-library-1.5.8.aar diff --git a/core/libraries/libs/ustwo-clockwise-debug.aar b/wear/libs/ustwo-clockwise-debug.aar similarity index 100% rename from core/libraries/libs/ustwo-clockwise-debug.aar rename to wear/libs/ustwo-clockwise-debug.aar diff --git a/core/libraries/libs/wearpreferenceactivity-0.5.0.aar b/wear/libs/wearpreferenceactivity-0.5.0.aar similarity index 100% rename from core/libraries/libs/wearpreferenceactivity-0.5.0.aar rename to wear/libs/wearpreferenceactivity-0.5.0.aar diff --git a/workflow/build.gradle b/workflow/build.gradle deleted file mode 100644 index db01daed40..0000000000 --- a/workflow/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'com.android.library' - id 'kotlin-android' - id 'kotlin-kapt' - id 'kotlin-allopen' -} - -apply from: "${project.rootDir}/core/main/android_dependencies.gradle" -apply from: "${project.rootDir}/core/main/android_module_dependencies.gradle" -apply from: "${project.rootDir}/core/main/test_dependencies.gradle" -apply from: "${project.rootDir}/core/main/jacoco_global.gradle" - -android { - namespace 'app.aaps.workflow' -} - -dependencies { - implementation project(':core:libraries') - implementation project(':core:graphview') - implementation project(':core:interfaces') - implementation project(':core:main') - implementation project(':core:ui') - implementation project(':core:utils') - implementation project(':database:entities') - implementation project(':database:impl') - implementation project(':plugins:main') -} \ No newline at end of file diff --git a/workflow/build.gradle.kts b/workflow/build.gradle.kts new file mode 100644 index 0000000000..af157054d4 --- /dev/null +++ b/workflow/build.gradle.kts @@ -0,0 +1,27 @@ +plugins { + id("com.android.library") + id("kotlin-android") + id("kotlin-kapt") + id("android-module-dependencies") + id("test-module-dependencies") + id("jacoco-module-dependencies") +} + +android { + namespace = "app.aaps.workflow" +} + +dependencies { + implementation(project(":core:libraries")) + implementation(project(":core:graphview")) + implementation(project(":core:interfaces")) + implementation(project(":core:main")) + implementation(project(":core:ui")) + implementation(project(":core:utils")) + implementation(project(":database:entities")) + implementation(project(":database:impl")) + implementation(project(":plugins:main")) + + kapt(Libs.Dagger.compiler) + kapt(Libs.Dagger.androidProcessor) +} \ No newline at end of file