Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add HTML parser implementation and module #23

Merged
merged 14 commits into from
Nov 22, 2022
Next Next commit
Add kmp-htmlparser module and tidy up dependencies
  • Loading branch information
gchristov committed Nov 17, 2022
commit 8067197c1057856aff97d2206b0fbe8eeecb25c8
8 changes: 5 additions & 3 deletions appJs/appApiJs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("javascript-node-library-plugin")
}
Expand All @@ -11,9 +13,9 @@ kotlin {
implementation(projects.kmpCommonNetwork)
implementation(projects.moduleA)
// Needed to get the Firebase deployment to work
implementation(npm("firebase", "9.10.0"))
implementation(npm("firebase-admin", "11.0.1"))
implementation(npm("firebase-functions", "3.24.0"))
implementation(npm(Deps.Firebase.firebase.name, Deps.Firebase.firebase.version))
implementation(npm(Deps.Firebase.admin.name, Deps.Firebase.admin.version))
implementation(npm(Deps.Firebase.functions.name, Deps.Firebase.functions.version))
implementation(npm("node-html-parser", "6.1.4"))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@ package com.gchristov.thecodinglove.gradleplugins

@Suppress("unused")
class Deps {
object Firebase {
private const val firebaseVersion = "1.6.2"
const val firestore = "dev.gitlive:firebase-firestore:$firebaseVersion"
val firebase = NpmDependency("firebase", "9.10.0")
val admin = NpmDependency("firebase-admin", "11.0.1")
val functions = NpmDependency("firebase-functions", "3.24.0")
}

object Kodein {
private const val kodeinVersion = "7.15.0"
const val di = "org.kodein.di:kodein-di:$kodeinVersion"
Expand All @@ -24,12 +32,16 @@ class Deps {
const val logback = "ch.qos.logback:logback-classic:1.2.10"
}

object Firebase {
private const val firebaseVersion = "1.6.2"
const val firestore = "dev.gitlive:firebase-firestore:$firebaseVersion"
object Node {
val htmlParser = NpmDependency("node-html-parser", "6.1.4")
}

object Tests {
const val test = "test"
}
}
}

data class NpmDependency(
val name: String,
val version: String
)
15 changes: 15 additions & 0 deletions kmp/kmp-htmlparser/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("javascript-node-module-plugin")
}

kotlin {
sourceSets {
val commonMain by getting {
dependencies {
implementation(npm(Deps.Node.htmlParser.name, Deps.Node.htmlParser.version))
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.gchristov.thecodinglove.kmphtmlparser

import com.gchristov.thecodinglove.kmpcommondi.DiModule
import org.kodein.di.DI

object HtmlParserModule : DiModule() {
override fun name() = "kmp-htmlparser"

override fun bindLocalDependencies(builder: DI.Builder) {
builder.apply {

}
}
}
1 change: 1 addition & 0 deletions modules.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ val projects = listOf(
"kmp-common-network",
"kmp-common-test",
"kmp-gradle-plugins",
"kmp-htmlparser",
"kmp-module-b",
"appApiJs",
"appHtmlJs",
Expand Down