Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
build(school): create module schoolData with git submodule
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreaBrighi committed Jun 15, 2023
1 parent 8d2d672 commit 39f6c31
Show file tree
Hide file tree
Showing 8 changed files with 171 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions schoolData/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
140 changes: 140 additions & 0 deletions schoolData/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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<Test> {
useJUnitPlatform()
testLogging {
showCauses = true
showStackTraces = true
showStandardStreams = true
events(*TestLogEvent.values())
}
}
withType<KotlinCompile> {
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<GenerateProtoTask.PluginOptions>
// which can be used to configure the plugins applied to the task.
it.builtins {
id("kotlin") {
}
id("java") {
}
}
}
}
}
Empty file added schoolData/consumer-rules.pro
Empty file.
21 changes: 21 additions & 0 deletions schoolData/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions schoolData/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

</manifest>
1 change: 1 addition & 0 deletions schoolData/src/main/proto/calendar
Submodule calendar added at a0b071
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ include(":accessData")
include(":desktopDomain")
include(":desktopData")
include(":schoolDomain")
include(":schoolData")
include(":reminderDomain")
include(":reminderData")
include(":networkUtility")

0 comments on commit 39f6c31

Please sign in to comment.