From 95d7f0737c9ea19000d481e637982106f17608a8 Mon Sep 17 00:00:00 2001 From: AdrianLxM Date: Sun, 14 Mar 2021 21:19:24 +0100 Subject: [PATCH] fix gitignore and tests --- .gitignore | 2 -- .../omnipod/dash/annotations/OpenForTesting.kt | 15 +++++++++++++++ .../omnipod/dash/annotations/OpenForTesting.kt | 8 ++++++++ 3 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 omnipod-dash/src/debug/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt create mode 100644 omnipod-dash/src/release/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt diff --git a/.gitignore b/.gitignore index 74eb164a98..2575eddbbc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,8 +10,6 @@ build/ .idea/* !.idea/codeStyles/ full/ -debug/ -release/ app/com.crashlytics.settings.json app/session_analytics.tap .project diff --git a/omnipod-dash/src/debug/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt b/omnipod-dash/src/debug/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt new file mode 100644 index 0000000000..689d6a467c --- /dev/null +++ b/omnipod-dash/src/debug/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt @@ -0,0 +1,15 @@ +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 diff --git a/omnipod-dash/src/release/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt b/omnipod-dash/src/release/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt new file mode 100644 index 0000000000..6cf2180e50 --- /dev/null +++ b/omnipod-dash/src/release/java/info/nightscout/androidaps/plugins/pump/omnipod/dash/annotations/OpenForTesting.kt @@ -0,0 +1,8 @@ +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