Move data package to its own module

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-09-08 06:35:38 +05:30
parent b5a3d6489b
commit 19817bf254
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
10 changed files with 50 additions and 19 deletions

2
.idea/gradle.xml generated
View file

@ -12,10 +12,10 @@
<set> <set>
<option value="$PROJECT_DIR$" /> <option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" /> <option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/data" />
</set> </set>
</option> </option>
<option name="resolveModulePerSourceSet" value="false" /> <option name="resolveModulePerSourceSet" value="false" />
<option name="useQualifiedModuleNames" value="true" />
</GradleProjectSettings> </GradleProjectSettings>
</option> </option>
</component> </component>

View file

@ -1,7 +1,6 @@
plugins { plugins {
id 'com.android.application' id 'com.android.application'
id 'kotlin-android' id 'kotlin-android'
id 'kotlin-kapt'
} }
android { android {
@ -14,16 +13,6 @@ android {
targetSdkVersion 30 targetSdkVersion 30
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
javaCompileOptions {
annotationProcessorOptions {
arguments = [
"room.incremental" : "true",
"room.expandProjection": "true"
]
}
}
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
@ -33,14 +22,16 @@ android {
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
} }
} }
compileOptions { compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8
} }
buildFeatures { buildFeatures {
compose true compose true
} }
composeOptions { composeOptions {
kotlinCompilerVersion '1.4.0' kotlinCompilerVersion '1.4.0'
kotlinCompilerExtensionVersion "${compose_version}" kotlinCompilerExtensionVersion "${compose_version}"
@ -56,7 +47,7 @@ tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
dependencies { dependencies {
kapt "androidx.room:room-compiler:$room_version" implementation(project(":data"))
implementation 'androidx.core:core-ktx:1.5.0-alpha02' implementation 'androidx.core:core-ktx:1.5.0-alpha02'
implementation 'androidx.appcompat:appcompat:1.3.0-alpha02' implementation 'androidx.appcompat:appcompat:1.3.0-alpha02'
implementation "androidx.compose.foundation:foundation:$compose_version" implementation "androidx.compose.foundation:foundation:$compose_version"
@ -69,13 +60,10 @@ dependencies {
implementation "androidx.compose.ui:ui-text:$compose_version" implementation "androidx.compose.ui:ui-text:$compose_version"
implementation "androidx.compose.ui:ui-text-android:$compose_version" implementation "androidx.compose.ui:ui-text-android:$compose_version"
implementation "androidx.compose.ui:ui-unit:$compose_version" implementation "androidx.compose.ui:ui-unit:$compose_version"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-ktx:$room_version"
implementation "androidx.ui:ui-tooling:$compose_version" implementation "androidx.ui:ui-tooling:$compose_version"
implementation 'com.google.android.material:material:1.3.0-alpha02' implementation 'com.google.android.material:material:1.3.0-alpha02'
testImplementation 'junit:junit:4.13' testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2' androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
androidTestImplementation "androidx.ui:ui-test:$compose_version" androidTestImplementation "androidx.ui:ui-test:$compose_version"
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
} }

1
data/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

38
data/build.gradle Normal file
View file

@ -0,0 +1,38 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
minSdkVersion 23
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
coreLibraryDesugaringEnabled true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
kapt "androidx.room:room-compiler:$room_version"
api "androidx.room:room-runtime:$room_version"
api "androidx.room:room-ktx:$room_version"
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
coreLibraryDesugaring "com.android.tools:desugar_jdk_libs:1.0.10"
}

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="dev.msfjarvis.todo.data">
</manifest>

View file

@ -1,12 +1,10 @@
package dev.msfjarvis.todo.data.model package dev.msfjarvis.todo.data.model
import androidx.compose.runtime.Immutable
import androidx.room.Entity import androidx.room.Entity
import androidx.room.PrimaryKey import androidx.room.PrimaryKey
import java.time.LocalDateTime import java.time.LocalDateTime
import java.time.ZoneId import java.time.ZoneId
@Immutable
@Entity( @Entity(
tableName = "todo_items", tableName = "todo_items",
) )

View file

@ -1,2 +1,3 @@
rootProject.name = "Compose-ToDo" rootProject.name = "Compose-ToDo"
include ':app' include ':app'
include ':data'