diff --git a/.gitmodules b/.gitmodules index ecc37dbb..b79ba0a5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,3 +7,6 @@ [submodule "reminderData/src/main/proto/calendar"] path = reminderData/src/main/proto/calendar url = https://github.com/IntelligentBackpack/CalendarCommunication.git +[submodule "schoolData/src/main/proto/calendar"] + path = schoolData/src/main/proto/calendar + url = https://github.com/IntelligentBackpack/CalendarCommunication.git diff --git a/schoolData/.gitignore b/schoolData/.gitignore new file mode 100644 index 00000000..42afabfd --- /dev/null +++ b/schoolData/.gitignore @@ -0,0 +1 @@ +/build \ No newline at end of file diff --git a/schoolData/build.gradle.kts b/schoolData/build.gradle.kts new file mode 100644 index 00000000..5796c1b6 --- /dev/null +++ b/schoolData/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.schooldata" + 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/schoolData/consumer-rules.pro b/schoolData/consumer-rules.pro new file mode 100644 index 00000000..e69de29b diff --git a/schoolData/proguard-rules.pro b/schoolData/proguard-rules.pro new file mode 100644 index 00000000..481bb434 --- /dev/null +++ b/schoolData/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/schoolData/src/main/AndroidManifest.xml b/schoolData/src/main/AndroidManifest.xml new file mode 100644 index 00000000..a5918e68 --- /dev/null +++ b/schoolData/src/main/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/schoolData/src/main/proto/calendar b/schoolData/src/main/proto/calendar new file mode 160000 index 00000000..a0b071ac --- /dev/null +++ b/schoolData/src/main/proto/calendar @@ -0,0 +1 @@ +Subproject commit a0b071ac53766ac113dcc313c349c61472dec9a2 diff --git a/settings.gradle.kts b/settings.gradle.kts index c454af82..e2c0b867 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,6 +41,7 @@ include(":accessData") include(":desktopDomain") include(":desktopData") include(":schoolDomain") +include(":schoolData") include(":reminderDomain") include(":reminderData") include(":networkUtility")