unify @OpenForTesting
This commit is contained in:
parent
9fb20917c5
commit
301fa49e38
6 changed files with 36 additions and 41 deletions
|
@ -11,23 +11,32 @@ apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
|
|||
apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/gradle/jacoco_global.gradle"
|
||||
|
||||
allOpen {
|
||||
annotation 'info.nightscout.androidaps.plugins.pump.omnipod.dash.annotations.OpenClass'
|
||||
}
|
||||
|
||||
detekt { // TODO move to `subprojects` section in global build.gradle
|
||||
toolVersion = "1.15.0-RC2"
|
||||
config = files("./detekt-config.yml") // TODO move to global space and use "../detekt-config.yml"
|
||||
}
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
kapt {
|
||||
arguments {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':core')
|
||||
implementation project(':pump-common')
|
||||
implementation project(':omnipod-common')
|
||||
implementation project(':database')
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
implementation "androidx.room:room-rxjava2:$room_version"
|
||||
implementation project(path: ':pump-common')
|
||||
api "androidx.room:room-ktx:$room_version"
|
||||
api "androidx.room:room-runtime:$room_version"
|
||||
api "androidx.room:room-rxjava2:$room_version"
|
||||
kapt "androidx.room:room-compiler:$room_version"
|
||||
implementation 'com.github.guepardoapps:kulid:2.0.0.0'
|
||||
|
||||
api 'com.github.guepardoapps:kulid:2.0.0.0'
|
||||
}
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.annotations
|
||||
|
||||
/**
|
||||
* This is the actual annotation that makes the class open. Don't use it directly, only through [OpenForTesting]
|
||||
* which has a NOOP replacement in production.
|
||||
*/
|
||||
@Target(AnnotationTarget.ANNOTATION_CLASS)
|
||||
annotation class OpenClass
|
||||
|
||||
/**
|
||||
* Annotate a class with [OpenForTesting] if it should be extendable for testing.
|
||||
*/
|
||||
@OpenClass
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class OpenForTesting
|
|
@ -1,6 +1,6 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util
|
||||
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
import java.security.SecureRandom
|
||||
|
||||
@OpenForTesting
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.driver.pod.util
|
||||
|
||||
import com.google.crypto.tink.subtle.X25519
|
||||
import info.nightscout.androidaps.plugins.pump.omnipod.dash.annotations.OpenForTesting
|
||||
import info.nightscout.androidaps.annotations.OpenForTesting
|
||||
|
||||
@OpenForTesting
|
||||
class X25519KeyGenerator {
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
package info.nightscout.androidaps.plugins.pump.omnipod.dash.annotations
|
||||
|
||||
/**
|
||||
* Annotate a class with [OpenForTesting] if it should be extendable for testing.
|
||||
* In production the class remains final.
|
||||
*/
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class OpenForTesting
|
|
@ -9,21 +9,30 @@ apply from: "${project.rootDir}/gradle/android_module_dependencies.gradle"
|
|||
apply from: "${project.rootDir}/gradle/test_dependencies.gradle"
|
||||
apply from: "${project.rootDir}/gradle/jacoco_global.gradle"
|
||||
|
||||
android {
|
||||
defaultConfig {
|
||||
kapt {
|
||||
arguments {
|
||||
arg("room.incremental", "true")
|
||||
arg("room.schemaLocation", "$projectDir/schemas")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation project(':core')
|
||||
implementation project(':pump-common')
|
||||
implementation project(':omnipod-common')
|
||||
implementation project(':rileylink')
|
||||
implementation project(':database')
|
||||
|
||||
|
||||
implementation "androidx.room:room-runtime:$room_version"
|
||||
annotationProcessor("androidx.room:room-compiler:$room_version")
|
||||
// To use Kotlin annotation processing tool (kapt)
|
||||
kapt("androidx.room:room-compiler:$room_version")
|
||||
// optional - Kotlin Extensions and Coroutines support for Room
|
||||
implementation("androidx.room:room-ktx:$room_version")
|
||||
// optional - RxJava2 support for Room
|
||||
implementation "androidx.room:room-rxjava2:$room_version"
|
||||
api "androidx.room:room-ktx:$room_version"
|
||||
api "androidx.room:room-runtime:$room_version"
|
||||
api "androidx.room:room-rxjava2:$room_version"
|
||||
kapt "androidx.room:room-compiler:$room_version"
|
||||
|
||||
// optional - Test helpers
|
||||
testImplementation("androidx.room:room-testing:$room_version")
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue