Enforce LF and stop Spotless from requiring CRLF on Windows

This commit is contained in:
AviKav 2020-07-08 20:22:29 -04:00
parent 9087047bc9
commit c0fff9e09f
No known key found for this signature in database
GPG key ID: 7BC4B96BC8A7167D

View file

@ -1,78 +1,79 @@
plugins { plugins {
id "java" id "java"
id "org.jetbrains.kotlin.jvm" version "1.3.72" id "org.jetbrains.kotlin.jvm" version "1.3.72"
id "application" id "application"
id "com.github.johnrengelman.shadow" version "5.2.0" id "com.github.johnrengelman.shadow" version "5.2.0"
id "com.diffplug.gradle.spotless" version "4.4.0" id "com.diffplug.gradle.spotless" version "4.4.0"
id "dev.afanasev.sekret" version "0.0.3" id "dev.afanasev.sekret" version "0.0.3"
} }
group = "com.mangadex" group = "com.mangadex"
version = "git describe --tags --dirty".execute().text.trim() version = "git describe --tags --dirty".execute().text.trim()
mainClassName = "mdnet.base.Main" mainClassName = "mdnet.base.Main"
repositories { repositories {
mavenCentral() mavenCentral()
jcenter() jcenter()
} }
configurations { configurations {
runtime.exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-core" runtime.exclude group: "org.jetbrains.kotlinx", module: "kotlinx-coroutines-core"
runtime.exclude group: "com.sun.mail", module: "javax.mail" runtime.exclude group: "com.sun.mail", module: "javax.mail"
} }
dependencies { dependencies {
compileOnly group: "dev.afanasev", name: "sekret-annotation", version: "0.0.3" compileOnly group: "dev.afanasev", name: "sekret-annotation", version: "0.0.3"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8" implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-reflect" implementation "org.jetbrains.kotlin:kotlin-reflect"
implementation group: "commons-io", name: "commons-io", version: "2.7" implementation group: "commons-io", name: "commons-io", version: "2.7"
implementation group: "org.http4k", name: "http4k-core", version: "$http_4k_version" implementation group: "org.http4k", name: "http4k-core", version: "$http_4k_version"
implementation group: "org.http4k", name: "http4k-format-jackson", version: "$http_4k_version" implementation group: "org.http4k", name: "http4k-format-jackson", version: "$http_4k_version"
implementation group: "com.fasterxml.jackson.datatype", name: "jackson-datatype-jsr310", version: "2.11.1" implementation group: "com.fasterxml.jackson.datatype", name: "jackson-datatype-jsr310", version: "2.11.1"
implementation group: "org.http4k", name: "http4k-client-apache", version: "$http_4k_version" implementation group: "org.http4k", name: "http4k-client-apache", version: "$http_4k_version"
implementation group: "org.http4k", name: "http4k-server-netty", version: "$http_4k_version" implementation group: "org.http4k", name: "http4k-server-netty", version: "$http_4k_version"
runtimeOnly group: "io.netty", name: "netty-tcnative-boringssl-static", version: "2.0.30.Final" runtimeOnly group: "io.netty", name: "netty-tcnative-boringssl-static", version: "2.0.30.Final"
implementation group: "ch.qos.logback", name: "logback-classic", version: "1.3.0-alpha4" implementation group: "ch.qos.logback", name: "logback-classic", version: "1.3.0-alpha4"
implementation group: "org.jetbrains.exposed", name: "exposed-core", version: "$exposed_version" implementation group: "org.jetbrains.exposed", name: "exposed-core", version: "$exposed_version"
implementation group: "org.jetbrains.exposed", name: "exposed-dao", version: "$exposed_version" implementation group: "org.jetbrains.exposed", name: "exposed-dao", version: "$exposed_version"
implementation group: "org.jetbrains.exposed", name: "exposed-jdbc", version: "$exposed_version" implementation group: "org.jetbrains.exposed", name: "exposed-jdbc", version: "$exposed_version"
implementation group: "org.xerial", name: "sqlite-jdbc", version: "3.30.1" implementation group: "org.xerial", name: "sqlite-jdbc", version: "3.30.1"
implementation "com.goterl.lazycode:lazysodium-java:4.2.6" implementation "com.goterl.lazycode:lazysodium-java:4.2.6"
implementation "net.java.dev.jna:jna:5.5.0" implementation "net.java.dev.jna:jna:5.5.0"
} }
java { java {
sourceCompatibility = JavaVersion.VERSION_1_8 sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8
} }
spotless { spotless {
java { lineEndings 'UNIX'
targetExclude("build/generated/**/*") java {
eclipse() targetExclude("build/generated/**/*")
removeUnusedImports() eclipse()
trimTrailingWhitespace() removeUnusedImports()
endWithNewline() trimTrailingWhitespace()
} endWithNewline()
kotlin { }
ktlint() kotlin {
trimTrailingWhitespace() ktlint()
endWithNewline() trimTrailingWhitespace()
} endWithNewline()
} }
}
tasks.register("generateVersion", Copy) {
def templateContext = [version: version] tasks.register("generateVersion", Copy) {
inputs.properties templateContext def templateContext = [version: version]
from "src/template/java" inputs.properties templateContext
into "$buildDir/generated/java" from "src/template/java"
expand templateContext into "$buildDir/generated/java"
} expand templateContext
}
sourceSets.main.java.srcDir generateVersion.outputs.files
sourceSets.main.java.srcDir generateVersion.outputs.files