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
Prev Previous commit
Next Next commit
One gradle-plugins module only
  • Loading branch information
gchristov committed Nov 20, 2022
commit 8329bfb34fc48b9d11c8d7e239591462c8b48c1c
2 changes: 1 addition & 1 deletion appJs/appApiJs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("javascript-node-executable-plugin")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,25 @@ plugins {
gradlePlugin {
plugins.register("kmp-platform-plugin") {
id = "kmp-platform-plugin"
implementationClass = "com.gchristov.thecodinglove.kmpgradleplugins.KmpPlatformPlugin"
implementationClass = "com.gchristov.thecodinglove.gradleplugins.kmp.KmpPlatformPlugin"
}
plugins.register("kmp-module-plugin") {
id = "kmp-module-plugin"
implementationClass = "com.gchristov.thecodinglove.kmpgradleplugins.KmpModulePlugin"
implementationClass = "com.gchristov.thecodinglove.gradleplugins.kmp.KmpModulePlugin"
}
plugins.register("build-config-plugin") {
id = "build-config-plugin"
implementationClass = "com.gchristov.thecodinglove.gradleplugins.BuildConfigPlugin"
}
plugins.register("javascript-browser-executable-plugin") {
id = "javascript-browser-executable-plugin"
implementationClass =
"com.gchristov.thecodinglove.kmpgradleplugins.JavascriptBrowserExecutablePlugin"
"com.gchristov.thecodinglove.gradleplugins.js.JavascriptBrowserExecutablePlugin"
}
plugins.register("javascript-node-executable-plugin") {
id = "javascript-node-executable-plugin"
implementationClass =
"com.gchristov.thecodinglove.kmpgradleplugins.JavascriptNodeExecutablePlugin"
}
plugins.register("build-config-plugin") {
id = "build-config-plugin"
implementationClass = "com.gchristov.thecodinglove.kmpgradleplugins.BuildConfigPlugin"
"com.gchristov.thecodinglove.gradleplugins.js.JavascriptNodeExecutablePlugin"
}
}

Expand Down
1 change: 1 addition & 0 deletions gradle-plugins/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "gradle-plugins"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gchristov.thecodinglove.kmpgradleplugins
package com.gchristov.thecodinglove.gradleplugins

import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gchristov.thecodinglove.kmpgradleplugins
package com.gchristov.thecodinglove.gradleplugins

@Suppress("unused")
class Deps {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gchristov.thecodinglove.kmpgradleplugins
package com.gchristov.thecodinglove.gradleplugins.js

import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down Expand Up @@ -33,16 +33,4 @@ class JavascriptNodeExecutablePlugin : Plugin<Project> {
}
}
}
}

@Suppress("unused")
abstract class KmpPlatformPlugin : Plugin<Project> {
override fun apply(target: Project) {
target.plugins.apply("org.jetbrains.kotlin.multiplatform")
target.extensions.configure(KotlinMultiplatformExtension::class.java) {
js(IR) {
nodejs()
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.gchristov.thecodinglove.kmpgradleplugins
package com.gchristov.thecodinglove.gradleplugins.kmp

import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.gchristov.thecodinglove.gradleplugins.kmp

import org.gradle.api.Plugin
import org.gradle.api.Project
import org.jetbrains.kotlin.gradle.dsl.KotlinMultiplatformExtension

@Suppress("unused")
abstract class KmpPlatformPlugin : Plugin<Project> {
override fun apply(target: Project) {
target.plugins.apply("org.jetbrains.kotlin.multiplatform")
target.extensions.configure(KotlinMultiplatformExtension::class.java) {
js(IR) {
nodejs()
}
}
}
}
2 changes: 1 addition & 1 deletion kmp/kmp-common-di/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("kmp-platform-plugin")
Expand Down
2 changes: 1 addition & 1 deletion kmp/kmp-common-firebase/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps
import java.io.FileInputStream
import java.util.*

Expand Down
2 changes: 1 addition & 1 deletion kmp/kmp-common-kotlin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("kmp-platform-plugin")
Expand Down
2 changes: 1 addition & 1 deletion kmp/kmp-common-network/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("kmp-module-plugin")
Expand Down
2 changes: 1 addition & 1 deletion kmp/kmp-common-test/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import com.gchristov.thecodinglove.kmpgradleplugins.Deps
import com.gchristov.thecodinglove.gradleplugins.Deps

plugins {
id("kmp-platform-plugin")
Expand Down
1 change: 0 additions & 1 deletion kmp/kmp-gradle-plugins/settings.gradle.kts

This file was deleted.

4 changes: 2 additions & 2 deletions modules.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ val projects = listOf(
"kmp-common-kotlin",
"kmp-common-network",
"kmp-common-test",
"kmp-gradle-plugins",
"kmp-htmlparser",
"kmp-module-b",
"appApiJs",
"appHtmlJs",
"gradle-plugins",
"module-a",
)
/**
Expand All @@ -28,7 +28,7 @@ projects.forEach { project ->
}
}

fun String.projectRoot() = if (startsWith("kmp-")) "kmp" else "appJs"
fun String.projectRoot() = if (startsWith("kmp-")) "kmp" else if (isGradlePlugin()) "" else "appJs"

fun String.projectDir() = if (projectRoot().isEmpty()) "$this" else "${projectRoot()}/$this"

Expand Down