diff --git a/reminderData/.gitignore b/reminderData/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/reminderData/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/reminderData/build.gradle.kts b/reminderData/build.gradle.kts new file mode 100644 index 00000000..bbab304d --- /dev/null +++ b/reminderData/build.gradle.kts @@ -0,0 +1,140 @@ +import com.google.protobuf.gradle.id +import org.gradle.api.tasks.testing.logging.TestLogEvent +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile +import org.jetbrains.kotlin.config.KotlinCompilerVersion.VERSION as KOTLIN_VERSION + +plugins { + id("com.android.library") + id("org.jetbrains.kotlin.android") + id("org.jetbrains.kotlin.kapt") + alias(libs.plugins.protobuf.plugin) +} + +android { + namespace = "com.intelligentbackpack.reminderdata" + compileSdk = 33 + + defaultConfig { + minSdk = 29 + + testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") + testInstrumentationRunnerArguments["clearPackageData"] = "true" + + javaCompileOptions { + annotationProcessorOptions { + arguments += mapOf( + "room.schemaLocation" to "$projectDir/schemas", + "room.incremental" to "true", + ) + } + } + } + + testOptions { + execution = "ANDROIDX_TEST_ORCHESTRATOR" + } + + buildTypes { + release { + isMinifyEnabled = false + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro", + ) + } + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_17 + targetCompatibility = JavaVersion.VERSION_17 + } + + kotlinOptions { + jvmTarget = "17" + } + + packaging { + resources { + merges += "META-INF/INDEX.LIST" + } + } +} + +kotlin { + jvmToolchain(17) +} + +dependencies { + implementation(libs.core.ktx) + implementation(libs.bundles.retrofit) + implementation(libs.bundles.protobuf) + implementation(libs.bundles.grpc) + implementation(libs.bundles.room) + kapt(libs.androidx.room.compiler) + implementation(platform("com.google.firebase:firebase-bom:32.1.0")) + implementation("com.google.firebase:firebase-database-ktx") + implementation(project(":networkUtility")) + implementation(project(":reminderDomain")) + implementation(project(":accessDomain")) + testImplementation(gradleTestKit()) + testImplementation(libs.bundles.kotlin.testing) + androidTestImplementation(libs.bundles.androidTest) + androidTestImplementation(libs.mockito.android) + androidTestUtil(libs.orchestrator) +} + +configurations.all { + resolutionStrategy.eachDependency { + if (requested.group == "org.jetbrains.kotlin" && requested.name.startsWith("kotlin")) { + useVersion(KOTLIN_VERSION) + because("All Kotlin modules should use the same version, and compiler uses $KOTLIN_VERSION") + } + } +} + +tasks { + withType { + useJUnitPlatform() + testLogging { + showCauses = true + showStackTraces = true + showStandardStreams = true + events(*TestLogEvent.values()) + } + } + withType { + kotlinOptions { + jvmTarget = "17" + allWarningsAsErrors = true + freeCompilerArgs += listOf("-opt-in=kotlin.RequiresOptIn", "-Xinline-classes") + } + } +} + +protobuf { + protoc { + // The artifact spec for the Protobuf Compiler + artifact = "com.google.protobuf:protoc:${libs.versions.protobuf.compiler.get()}" + } + plugins { + // Optional: an artifact spec for a protoc plugin, with "grpc" as + // the identifier, which can be referred to in the "plugins" + // container of the "generateProtoTasks" closure. + id("grpc") { + artifact = "io.grpc:protoc-gen-grpc-java:${libs.versions.grpc.protobuf.get()}" + } + } + + generateProtoTasks { + all().forEach() { + // The "plugins" container is a NamedDomainObjectContainer + // which can be used to configure the plugins applied to the task. + it.builtins { + id("kotlin") { + } + id("java") { + } + } + } + } +} diff --git a/reminderData/consumer-rules.pro b/reminderData/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/reminderData/proguard-rules.pro b/reminderData/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/reminderData/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile \ No newline at end of file diff --git a/reminderData/src/main/AndroidManifest.xml b/reminderData/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a5918e68 --- /dev/null +++ b/reminderData/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index e2578069..c454af82 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -42,4 +42,5 @@ include(":desktopDomain") include(":desktopData") include(":schoolDomain") include(":reminderDomain") +include(":reminderData") include(":networkUtility")