database: generate skeleton project

Signed-off-by: Harsh Shandilya <me@msfjarvis.dev>
This commit is contained in:
Harsh Shandilya 2020-12-08 16:12:13 +05:30
parent 2dfcc4de8f
commit 042b8f60d5
No known key found for this signature in database
GPG key ID: 366D7BBAD1031E80
13 changed files with 58 additions and 1 deletions

1
.idea/gradle.xml generated
View file

@ -13,6 +13,7 @@
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/buildSrc" />
<option value="$PROJECT_DIR$/database" />
<option value="$PROJECT_DIR$/model" />
</set>
</option>

View file

@ -9,6 +9,7 @@ buildscript {
classpath(build.getValue("androidGradlePlugin"))
classpath(build.getValue("daggerGradlePlugin"))
classpath(build.getValue("kotlinGradlePlugin"))
classpath(build.getValue("sqldelightGradlePlugin"))
}
}

View file

@ -39,4 +39,5 @@ dependencies {
implementation(build.getValue("androidGradlePlugin_builderModel"))
implementation(build.getValue("androidGradlePlugin_lintModel"))
implementation(build.getValue("jsemver"))
implementation(build.getValue("sqldelightGradlePlugin"))
}

View file

@ -4,6 +4,7 @@ rootProject.ext.versions = [
kotlin : '1.4.21',
lint : '30.0.0-alpha05',
semver : '0.9.0',
sqldelight: '1.4.4',
]
rootProject.ext.build = [
@ -14,4 +15,5 @@ rootProject.ext.build = [
daggerGradlePlugin : "com.google.dagger:hilt-android-gradle-plugin:${versions.daggerHilt}",
kotlinGradlePlugin : "org.jetbrains.kotlin:kotlin-gradle-plugin:${versions.kotlin}",
jsemver : "com.github.zafarkhaja:java-semver:${versions.semver}",
sqldelightGradlePlugin : "com.squareup.sqldelight:gradle-plugin:${versions.sqldelight}",
]

View file

@ -83,6 +83,13 @@ object Dependencies {
const val compiler = "com.github.MatrixDev.Roomigrant:RoomigrantCompiler:$version"
const val runtime = "com.github.MatrixDev.Roomigrant:RoomigrantLib:$version"
}
object SQLDelight {
private const val version = "1.4.4"
const val jvmDriver = "com.squareup.sqldelight:sqlite-driver:$version"
const val androidDriver = "com.squareup.sqldelight:android-driver:$version"
}
}
object Testing {

View file

@ -7,6 +7,8 @@ import com.android.build.gradle.TestedExtension
import com.android.build.gradle.internal.dsl.BaseAppModuleExtension
import com.android.build.gradle.internal.plugins.AppPlugin
import com.android.build.gradle.internal.plugins.LibraryPlugin
import com.squareup.sqldelight.gradle.SqlDelightExtension
import com.squareup.sqldelight.gradle.SqlDelightPlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.JavaLibraryPlugin
@ -46,6 +48,9 @@ class LobstersPlugin : Plugin<Project> {
is Kapt3GradleSubplugin -> {
project.configureKapt()
}
is SqlDelightPlugin -> {
project.extensions.getByType<SqlDelightExtension>().configureLobstersDatabase()
}
}
}
}

View file

@ -0,0 +1,8 @@
import com.squareup.sqldelight.gradle.SqlDelightExtension
internal fun SqlDelightExtension.configureLobstersDatabase() {
database("LobstersDatabase") {
packageName = "dev.msfjarvis.lobsters.database"
sourceFolders = listOf("sqldelight")
}
}

1
database/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
/build

View file

@ -0,0 +1,6 @@
plugins {
id("com.android.library")
kotlin("android")
id("com.squareup.sqldelight")
`lobsters-plugin`
}

View file

21
database/proguard-rules.pro vendored Normal file
View file

@ -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

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="dev.msfjarvis.lobsters.database">
</manifest>

View file

@ -1,3 +1,3 @@
rootProject.name = "Claw for lobste.rs"
include(":app", ":model")
include(":app", ":database", ":model")
enableFeaturePreview("GRADLE_METADATA")