Add tests dependencies
This commit is contained in:
parent
7f2256bcbb
commit
a4a30d1bea
61
config.toml
61
config.toml
@ -23,6 +23,26 @@ groupId = "org.http4k"
|
||||
artifactId = "http4k-core"
|
||||
version = "3.260.0"
|
||||
category = "server"
|
||||
default = true
|
||||
|
||||
[dependencies.http4k-server-jetty]
|
||||
groupId = "org.http4k"
|
||||
artifactId = "http4k-server-jetty"
|
||||
version = "3.260.0"
|
||||
category = "server"
|
||||
default = true
|
||||
|
||||
[dependencies.http4k-server-apache]
|
||||
groupId = "org.http4k"
|
||||
artifactId = "http4k-server-apache"
|
||||
version = "3.260.0"
|
||||
category = "server"
|
||||
|
||||
[dependencies.http4k-client-apache]
|
||||
groupId = "org.http4k"
|
||||
artifactId = "http4k-server-apache"
|
||||
version = "3.260.0"
|
||||
category = "server"
|
||||
|
||||
[dependencies.javalin]
|
||||
groupId = "io.javalin"
|
||||
@ -34,6 +54,7 @@ category = "server"
|
||||
groupId = "io.pebbletemplates"
|
||||
artifactId = "pebble"
|
||||
version = "3.1.4"
|
||||
default = true
|
||||
|
||||
[dependencies.logback]
|
||||
groupId = "ch.qos.logback"
|
||||
@ -75,4 +96,42 @@ category = "database"
|
||||
groupId = "me.liuwj.ktorm"
|
||||
artifactId = "ktorm-support-mysql"
|
||||
version = "3.0.0"
|
||||
category = "database"
|
||||
category = "database"
|
||||
|
||||
[dependencies.junit]
|
||||
groupId = "org.junit.jupiter"
|
||||
artifactId = "junit-jupiter"
|
||||
version = "5.6.2"
|
||||
scope = "test"
|
||||
category = "test"
|
||||
default = true
|
||||
|
||||
[dependencies.junit-params]
|
||||
groupId = "org.junit.jupiter"
|
||||
artifactId = "junit-jupiter-params"
|
||||
version = "5.6.2"
|
||||
scope = "test"
|
||||
category = "test"
|
||||
default = true
|
||||
|
||||
[dependencies.mokk]
|
||||
groupId = "io.mockk"
|
||||
artifactId = "mockk"
|
||||
version = "1.10.0"
|
||||
scope = "test"
|
||||
category = "test"
|
||||
|
||||
[dependencies.hamkrest]
|
||||
groupId = "com.natpryce"
|
||||
artifactId = "hamkrest"
|
||||
version = "1.7.0.3"
|
||||
scope = "test"
|
||||
category = "test"
|
||||
|
||||
[dependencies.assertJ]
|
||||
groupId = "org.assertj"
|
||||
artifactId = "assertj-core"
|
||||
version = "3.16.1"
|
||||
scope = "test"
|
||||
category = "test"
|
||||
default = true
|
||||
|
||||
@ -18,7 +18,8 @@ class Config {
|
||||
values["artifactId"],
|
||||
values["version"],
|
||||
values.getOrElse("default", false),
|
||||
values.getEnumOrElse("category", Category.Other)
|
||||
values.getEnumOrElse("category", Category.Other),
|
||||
values.getEnumOrElse("scope", Scope.Compile),
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
package starter
|
||||
|
||||
enum class Category {
|
||||
Server, Database, Other
|
||||
Server, Database, Test, Other
|
||||
}
|
||||
|
||||
enum class Scope {
|
||||
Compile, Test
|
||||
}
|
||||
|
||||
data class Dependency(
|
||||
@ -11,5 +15,7 @@ data class Dependency(
|
||||
val version: String,
|
||||
val default: Boolean,
|
||||
val category: Category,
|
||||
val scope: Scope
|
||||
)
|
||||
|
||||
data class Input(val name: String, val display: String, val value: String? = null)
|
||||
@ -24,7 +24,7 @@ class Views(private val engine: PebbleEngine) {
|
||||
fun pom(dependencies: List<Dependency>, inputs: List<Input>): String {
|
||||
|
||||
val args: MutableMap<String, Any?> = mutableMapOf(
|
||||
"dependencies" to dependencies,
|
||||
"dependencies" to dependencies.sortedBy { it.scope },
|
||||
)
|
||||
|
||||
inputs.forEach {
|
||||
|
||||
@ -4,6 +4,9 @@
|
||||
<groupId>{{ dep.groupId }}</groupId>
|
||||
<artifactId>{{ dep.artifactId }}</artifactId>
|
||||
<version>{{ dep.version }}</version>
|
||||
{% if dep.scope.toString == "Test" %}
|
||||
<scope>test</scope>
|
||||
{% endif %}
|
||||
</dependency>
|
||||
{% endfor %}
|
||||
</dependencies>
|
||||
Loading…
x
Reference in New Issue
Block a user