Console App (Folder) & Mosaic-SubModule

This commit is contained in:
shabinder 2021-06-26 00:33:43 +05:30
parent 252e0c101d
commit 5102a8ea48
7 changed files with 115 additions and 1 deletions

3
.gitmodules vendored
View File

@ -1,3 +1,6 @@
[submodule "spotiflyer-ios"]
path = spotiflyer-ios
url = https://github.com/Shabinder/spotiflyer-ios
[submodule "mosaic"]
path = mosaic
url = https://github.com/JakeWharton/mosaic

View File

@ -0,0 +1,59 @@
plugins {
kotlin("jvm")// version "1.4.32"
kotlin("plugin.serialization")
id("ktlint-setup")
id("com.jakewharton.mosaic")
application
}
group = "com.shabinder"
version = Versions.versionCode
repositories {
mavenCentral()
}
application {
mainClass.set("MainKt")
applicationName = "spotiflyer-console-app"
}
dependencies {
implementation(Koin.core)
implementation(project(":common:database"))
implementation(project(":common:data-models"))
implementation(project(":common:dependency-injection"))
implementation(project(":common:root"))
implementation(project(":common:main"))
implementation(project(":common:list"))
implementation(project(":common:list"))
// Decompose
implementation(Decompose.decompose)
implementation(Decompose.extensionsCompose)
// MVI
implementation(MVIKotlin.mvikotlin)
implementation(MVIKotlin.mvikotlinMain)
// Koin
implementation(Koin.core)
// Matomo
implementation("org.piwik.java.tracking:matomo-java-tracker:1.6")
implementation(Ktor.slf4j)
implementation(Ktor.clientCore)
implementation(Ktor.clientJson)
implementation(Ktor.clientApache)
implementation(Ktor.clientLogging)
implementation(Ktor.clientSerialization)
implementation(Serialization.json)
// testDeps
testImplementation(kotlin("test-junit"))
}
tasks.test {
useJUnit()
}

View File

@ -0,0 +1,20 @@
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.setValue
import com.jakewharton.mosaic.Text
import com.jakewharton.mosaic.runMosaic
import kotlinx.coroutines.delay
fun main(/*args: Array<String>*/) = runMosaic {
// TODO https://github.com/JakeWharton/mosaic/issues/3
var count by mutableStateOf(0)
setContent {
Text("The count is: $count")
}
for (i in 1..20) {
delay(250)
count = i
}
}

View File

@ -0,0 +1,17 @@
@file:Suppress("ClassName")
package utils
data class ENV_KEY_MISSING(
val keyName: String,
override val message: String? = "$keyName was not found, please check your ENV variables"
) : Exception(message)
data class HCTI_URL_RESPONSE_ERROR(
val response: String,
override val message: String? = "Server Error, We Recieved this Resp: $response"
) : Exception(message)
data class RETRY_LIMIT_EXHAUSTED(
override val message: String? = "RETRY LIMIT EXHAUSTED!"
) : Exception(message)

View File

@ -0,0 +1,9 @@
package utils
val String.byProperty: String get() = System.getenv(this)
?: throw (ENV_KEY_MISSING(this))
val String.byOptionalProperty: String? get() = System.getenv(this)
fun debug(message: String) = println("\n::debug::$message")
fun debug(tag: String, message: String) = println("\n::debug::$tag:\n$message")

View File

@ -0,0 +1,6 @@
package utils
import kotlinx.coroutines.runBlocking
// Test Class- at development Time
fun main(): Unit = runBlocking {}

View File

@ -32,7 +32,7 @@ include(
":maintenance-tasks"
)
includeBuild("mosaic") {
includeBuild("mosaic/mosaic") {
dependencySubstitution {
substitute(module("com.jakewharton.mosaic:mosaic-gradle-plugin")).with(project(":mosaic-gradle-plugin"))
substitute(module("com.jakewharton.mosaic:mosaic-runtime")).with(project(":mosaic-runtime"))