update gradle files

This commit is contained in:
Raffaele Mignone 2019-03-22 17:39:08 +01:00
parent 0dcae84e5f
commit cc28928e40
Signed by: norangebit
GPG Key ID: F5255658CB220573
4 changed files with 129 additions and 9 deletions

View File

@ -7,10 +7,6 @@ plugins {
group = "norangebit"
version = "0.0.1"
val arrowVersion = "0.8.2"
val kluentVersion = "1.48"
val koinVersion = "1.0.2"
repositories {
mavenCentral()
jcenter()
@ -18,13 +14,19 @@ repositories {
dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation("io.arrow-kt:arrow-core:$arrowVersion")
implementation("org.koin:koin-core:$koinVersion")
implementation(Config.Libs.arrowCore)
implementation(Config.Libs.koin)
testImplementation("org.junit.jupiter:junit-jupiter-api:5.1.0")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation(Config.Libs.junit)
testImplementation(Config.Libs.kluent)
// testImplementation(Config.Libs.spekDsl)
// testRuntimeOnly(Config.Libs.kotlinReflect)
// testRuntimeOnly(Config.Libs.spekRunner)
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.register("ktlint", Ktlint::class)

32
buildSrc/build.gradle.kts Normal file
View File

@ -0,0 +1,32 @@
/*
* MIT License
*
* Copyright (c) 2019 norangebit
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
plugins {
`kotlin-dsl`
}
repositories {
jcenter()
}

View File

@ -0,0 +1,45 @@
/*
* MIT License
*
* Copyright (c) 2019 norangebit
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
object Config {
object Versions {
val arrow = "0.8.2"
val kluent = "1.48"
val koin = "1.0.2"
val junit = "5.1.0"
val spek = "2.0.1"
val kotlin = "1.3.21."
}
object Libs {
val arrowCore = "io.arrow-kt:arrow-core:${Versions.arrow}"
val koin = "org.koin:koin-core:${Versions.koin}"
val junit = "org.junit.jupiter:junit-jupiter-api:${Versions.junit}"
val kluent = "org.amshove.kluent:kluent:${Versions.kluent}"
val spekDsl = "org.spekframework.spek2:spek-dsl-jvm:${Versions.spek}"
val kotlinReflect = "org.jetbrains.kotlin:kotlin-reflect:${Versions.kotlin}"
val spekRunner = "org.spekframework.spek2:spek-runner-junit5:${Versions.spek}"
}
}

View File

@ -0,0 +1,41 @@
import org.gradle.api.DefaultTask
import org.gradle.api.tasks.TaskAction
/*
* MIT License
*
* Copyright (c) 2019 norangebit
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
*/
open class Ktlint : DefaultTask() {
@TaskAction
fun run() {
val input = Runtime.getRuntime().exec("ktlint").inputStream
input.reader().readLines().forEach {
println(it)
}
Runtime.getRuntime().exec("ktlint -F")
}
}