commit
d4daba0583
|
@ -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
|
||||
|
|
282
app/build.gradle
282
app/build.gradle
|
@ -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')
|
||||
}
|
||||
|
232
app/build.gradle.kts
Normal file
232
app/build.gradle.kts
Normal file
|
@ -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")
|
||||
}
|
||||
|
|
@ -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<String> = 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])
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
127
build.gradle
127
build.gradle
|
@ -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
|
||||
}
|
||||
}
|
62
build.gradle.kts
Normal file
62
build.gradle.kts
Normal file
|
@ -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<KotlinCompile> {
|
||||
kotlinOptions {
|
||||
freeCompilerArgs = listOf(
|
||||
"-opt-in=kotlin.RequiresOptIn",
|
||||
"-opt-in=kotlin.ExperimentalUnsignedTypes",
|
||||
"-Xjvm-default=all" //Support @JvmDefault
|
||||
)
|
||||
jvmTarget = "11"
|
||||
}
|
||||
}
|
||||
gradle.projectsEvaluated {
|
||||
tasks.withType<JavaCompile> {
|
||||
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<Delete>("clean").configure {
|
||||
delete(rootProject.buildDir)
|
||||
}
|
22
buildSrc/build.gradle.kts
Normal file
22
buildSrc/build.gradle.kts
Normal file
|
@ -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))
|
||||
}
|
215
buildSrc/src/main/kotlin/Libs.kt
Normal file
215
buildSrc/src/main/kotlin/Libs.kt
Normal file
|
@ -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"
|
||||
}
|
18
buildSrc/src/main/kotlin/Versions.kt
Normal file
18
buildSrc/src/main/kotlin/Versions.kt
Normal file
|
@ -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"
|
||||
}
|
|
@ -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")
|
||||
}
|
41
buildSrc/src/main/kotlin/android-app-dependencies.gradle.kts
Normal file
41
buildSrc/src/main/kotlin/android-app-dependencies.gradle.kts
Normal file
|
@ -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"
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
207
buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts
Normal file
207
buildSrc/src/main/kotlin/jacoco-app-dependencies.gradle.kts
Normal file
|
@ -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<JacocoReport>("${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<String, Double>
|
||||
|
||||
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<String, Double> {
|
||||
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<NodeChild> = xmlReader
|
||||
.parse(this).parent()
|
||||
.children()
|
||||
.filter {
|
||||
(it as NodeChild).name() == "counter"
|
||||
} as List<NodeChild>
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
207
buildSrc/src/main/kotlin/jacoco-module-dependencies.gradle.kts
Normal file
207
buildSrc/src/main/kotlin/jacoco-module-dependencies.gradle.kts
Normal file
|
@ -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<JacocoReport>("${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<String, Double>
|
||||
|
||||
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<String, Double> {
|
||||
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<NodeChild> = xmlReader
|
||||
.parse(this).parent()
|
||||
.children()
|
||||
.filter {
|
||||
(it as NodeChild).name() == "counter"
|
||||
} as List<NodeChild>
|
||||
|
||||
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)
|
||||
}
|
||||
}
|
62
buildSrc/src/main/kotlin/test-app-dependencies.gradle.kts
Normal file
62
buildSrc/src/main/kotlin/test-app-dependencies.gradle.kts
Normal file
|
@ -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<Test> {
|
||||
// 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<Test>().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"
|
||||
}
|
||||
}
|
||||
}
|
62
buildSrc/src/main/kotlin/test-module-dependencies.gradle.kts
Normal file
62
buildSrc/src/main/kotlin/test-module-dependencies.gradle.kts
Normal file
|
@ -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<Test> {
|
||||
// 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<Test>().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"
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
15
core/graphview/build.gradle.kts
Normal file
15
core/graphview/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
52
core/interfaces/build.gradle.kts
Normal file
52
core/interfaces/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<!-- Maintenance -->
|
||||
<color name="metadataOk">#66BB6A</color>
|
||||
<color name="metadataTextWarning">#FF8C00</color>
|
||||
<color name="metadataTextError">#FF5555</color>
|
||||
|
||||
<!-- Toasts-->
|
||||
<color name="toastBorder">#666666</color>
|
||||
<color name="toastBase">#000000</color>
|
||||
<color name="toastOk">#77dd77</color>
|
||||
<color name="toastError">#ff0400</color>
|
||||
<color name="toastWarn">#FF8C00</color>
|
||||
<color name="toastInfo">#03A9F4</color>
|
||||
|
||||
</resources>
|
|
@ -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'))
|
||||
artifacts.add("default", file("libs/iconify.aar"))
|
|
@ -1,4 +0,0 @@
|
|||
allOpen {
|
||||
// allows mocking for classes w/o directly opening them for release builds
|
||||
annotation 'app.aaps.annotations.OpenForTesting'
|
||||
}
|
|
@ -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'
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
|
@ -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'
|
||||
}
|
40
core/main/build.gradle.kts
Normal file
40
core/main/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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"
|
||||
}
|
32
core/nssdk/build.gradle.kts
Normal file
32
core/nssdk/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
20
core/ui/build.gradle.kts
Normal file
20
core/ui/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -360,4 +360,17 @@
|
|||
<color name="widget_ribbonCritical">#ff0400</color>
|
||||
<color name="widget_basal">#00ffff</color>
|
||||
|
||||
<!-- Maintenance -->
|
||||
<color name="metadataOk">#66BB6A</color>
|
||||
<color name="metadataTextWarning">#FF8C00</color>
|
||||
<color name="metadataTextError">#FF5555</color>
|
||||
|
||||
<!-- Toasts-->
|
||||
<color name="toastBorder">#666666</color>
|
||||
<color name="toastBase">#000000</color>
|
||||
<color name="toastOk">#77dd77</color>
|
||||
<color name="toastError">#ff0400</color>
|
||||
<color name="toastWarn">#FF8C00</color>
|
||||
<color name="toastInfo">#03A9F4</color>
|
||||
|
||||
</resources>
|
||||
|
|
|
@ -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
|
||||
}
|
38
core/utils/build.gradle.kts
Normal file
38
core/utils/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
24
core/validators/build.gradle.kts
Normal file
24
core/validators/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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'
|
||||
}
|
24
database/entities/build.gradle.kts
Normal file
24
database/entities/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
51
database/impl/build.gradle.kts
Normal file
51
database/impl/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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
|
|
@ -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
|
||||
) {
|
||||
|
||||
|
|
|
@ -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
|
|
@ -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'
|
||||
}
|
32
implementation/build.gradle.kts
Normal file
32
implementation/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
39
insight/build.gradle.kts
Normal file
39
insight/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
91
jacoco_aggregation.gradle.kts
Normal file
91
jacoco_aggregation.gradle.kts
Normal file
|
@ -0,0 +1,91 @@
|
|||
apply(plugin = "jacoco")
|
||||
|
||||
project.afterEvaluate {
|
||||
val variants = listOf("fullDebug")
|
||||
|
||||
tasks.register<JacocoReport>(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<String>().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<ConfigurableFileTree>().also {
|
||||
classesDirectories.forEach { path ->
|
||||
it.add(fileTree(path) { exclude(excludes) })
|
||||
}
|
||||
}
|
||||
|
||||
classDirectories.setFrom(files(listOf(classes)))
|
||||
|
||||
val sources = mutableListOf<String>().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<String>().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))
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
}
|
||||
}
|
|
@ -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'
|
||||
}
|
35
plugins/aps/build.gradle.kts
Normal file
35
plugins/aps/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
34
plugins/automation/build.gradle.kts
Normal file
34
plugins/automation/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
34
plugins/configuration/build.gradle.kts
Normal file
34
plugins/configuration/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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'
|
||||
}
|
40
plugins/constraints/build.gradle.kts
Normal file
40
plugins/constraints/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
29
plugins/insulin/build.gradle.kts
Normal file
29
plugins/insulin/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
48
plugins/main/build.gradle.kts
Normal file
48
plugins/main/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
27
plugins/sensitivity/build.gradle.kts
Normal file
27
plugins/sensitivity/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
22
plugins/smoothing/build.gradle.kts
Normal file
22
plugins/smoothing/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
29
plugins/source/build.gradle.kts
Normal file
29
plugins/source/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
54
plugins/sync/build.gradle.kts
Normal file
54
plugins/sync/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
32
pump/combo/build.gradle.kts
Normal file
32
pump/combo/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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
|
||||
}
|
||||
}
|
46
pump/combov2/build.gradle.kts
Normal file
46
pump/combov2/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
30
pump/combov2/comboctl/build.gradle.kts
Normal file
30
pump/combov2/comboctl/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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
|
||||
}
|
40
pump/dana/build.gradle.kts
Normal file
40
pump/dana/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
29
pump/danar/build.gradle.kts
Normal file
29
pump/danar/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
38
pump/danars/build.gradle.kts
Normal file
38
pump/danars/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
42
pump/diaconn/build.gradle.kts
Normal file
42
pump/diaconn/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -1,2 +0,0 @@
|
|||
configurations.create("default")
|
||||
artifacts.add("default", file('libs/eopatch_core.aar'))
|
2
pump/eopatch-core/build.gradle.kts
Normal file
2
pump/eopatch-core/build.gradle.kts
Normal file
|
@ -0,0 +1,2 @@
|
|||
configurations.create("default")
|
||||
artifacts.add("default", file("libs/eopatch_core.aar"))
|
|
@ -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"
|
||||
}
|
34
pump/eopatch/build.gradle.kts
Normal file
34
pump/eopatch/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
29
pump/medtronic/build.gradle.kts
Normal file
29
pump/medtronic/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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')
|
||||
}
|
32
pump/medtrum/build.gradle.kts
Normal file
32
pump/medtrum/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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"
|
||||
}
|
27
pump/omnipod-common/build.gradle.kts
Normal file
27
pump/omnipod-common/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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'
|
||||
}
|
47
pump/omnipod-dash/build.gradle.kts
Normal file
47
pump/omnipod-dash/build.gradle.kts
Normal file
|
@ -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)
|
||||
}
|
|
@ -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()
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue