From 91a82c3736dd8ac63fc840f04fa68e30ad529526 Mon Sep 17 00:00:00 2001 From: Hubert Van De Walle Date: Fri, 11 Sep 2020 16:26:19 +0200 Subject: [PATCH] Add serialization deps --- .gitignore | 2 +- config.toml | 12 ++++++++++++ example.zip | Bin 1800 -> 0 bytes src/main/kotlin/starter/Models.kt | 2 +- .../kotlin/starter/templates/PomTemplate.kt | 1 + .../resources/starter/pom/plugins/@kotlin.twig | 16 +++++++++++++++- 6 files changed, 30 insertions(+), 3 deletions(-) delete mode 100644 example.zip diff --git a/.gitignore b/.gitignore index 54f9d9a..5429a2d 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,4 @@ node_modules/ .yarn/install-state.gz .yarn-integrity yarn-debug.log* -yarn-error.log* \ No newline at end of file +yarn-error.log**.zip diff --git a/config.toml b/config.toml index e5677d9..d422a1a 100644 --- a/config.toml +++ b/config.toml @@ -154,3 +154,15 @@ artifactId = "koin-core" version = "2.1.6" category = "injection" default = true + +[dependencies.Jackson] +groupId = "com.fasterxml.jackson.module" +artifactId = "jackson-module-kotlin" +version = "2.11.2" +category = "serialization" + +[dependencies.Kotlinx-serialization] +groupId = "org.jetbrains.kotlinx" +artifactId = "kotlinx-serialization-runtime" +version = "1.0-M1-1.4.0-rc" +category = "serialization" diff --git a/example.zip b/example.zip deleted file mode 100644 index d532998b8db1ccaa5630922931204adce9935588..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1800 zcmaKt3p5jY9LKk$7V}JbToyvKHda#}krp+NVR32_sH$s)AxV==lA=c|2e<^_xyk7e14v;a;r4}AP@+U z5d*~nR>(w}htu)q6x{KX=AqOGvNTZXL~}wUjzS|7%$@#;@X!b-+D+i@=Hb(1?()v{ zKDq_gglTE%5PFvm9|Xk3aax|HH7QQWoIjFOM-Kpmu(lHA7 zz!S9}YU{DGo?^%!Z+}5i(uxJPhs<@c&#H*PrSEASxA=3Ge!C$ro%Zf8$P?L(_+=1| z2F&b_A;fA<#``|J=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HsMmXpfFG-F;Q9k4q`4P`EZLI z08qa{1_0nH4Zx4_uoBX;@$g?QgZY=kVr5Mk-d6%ghW8(0Nz>(;{|oz{YpwJyL(~uH YN^$ltusmJm*T^p9q^naJ^}e6}21QQ%lK=n! diff --git a/src/main/kotlin/starter/Models.kt b/src/main/kotlin/starter/Models.kt index f1d6ec7..70e0dba 100644 --- a/src/main/kotlin/starter/Models.kt +++ b/src/main/kotlin/starter/Models.kt @@ -1,7 +1,7 @@ package starter enum class Category { - Server, Injection, Database, Test, Other + Server, Injection, Database, Serialization, Test, Other } enum class Scope { diff --git a/src/main/kotlin/starter/templates/PomTemplate.kt b/src/main/kotlin/starter/templates/PomTemplate.kt index d0900bd..f4eb6cd 100644 --- a/src/main/kotlin/starter/templates/PomTemplate.kt +++ b/src/main/kotlin/starter/templates/PomTemplate.kt @@ -11,6 +11,7 @@ class PomTemplate(private val engine: PebbleEngine) : Template { override fun render(project: Project): String { val args: MutableMap = mutableMapOf( "dependencies" to project.dependencies.sortedBy { it.scope }, + "kotlinxSerialization" to project.dependencies.any { it.name == "Kotlinx-serialization" }, ) project.inputs.forEach { diff --git a/src/main/resources/starter/pom/plugins/@kotlin.twig b/src/main/resources/starter/pom/plugins/@kotlin.twig index 83e4d82..2751306 100644 --- a/src/main/resources/starter/pom/plugins/@kotlin.twig +++ b/src/main/resources/starter/pom/plugins/@kotlin.twig @@ -20,5 +20,19 @@ ${java.version} + {% if kotlinxSerialization %} + + kotlinx-serialization + + {% endif %} - \ No newline at end of file + {% if kotlinxSerialization %} + + + org.jetbrains.kotlin + kotlin-maven-serialization + ${kotlin.version} + + + {% endif %} +