Skip to content

Commit

Permalink
EPMLABSBRN-960 BE: update Spring, Kotlin, libs dependencies in projec…
Browse files Browse the repository at this point in the history
…t to latest
  • Loading branch information
Shterneregen committed Jan 18, 2022
1 parent a521c51 commit 505c4f4
Show file tree
Hide file tree
Showing 8 changed files with 217 additions and 199 deletions.
181 changes: 0 additions & 181 deletions build.gradle

This file was deleted.

194 changes: 194 additions & 0 deletions build.gradle.kts
@@ -0,0 +1,194 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

val kotestAssertionsVerstion: String by properties
val kotlinVersion: String by properties
val flywayVersion: String by properties
val log4jApiKotlinVersion: String by properties
val jsonVersoin: String by properties
val junitVersion: String by properties
val mockkVersion: String by properties
val testContainersVersion: String by properties

val ktlint by configurations.creating

plugins {
id("org.springframework.boot")
id("io.spring.dependency-management")
kotlin("jvm")
kotlin("plugin.spring")
kotlin("plugin.jpa")
id("org.jetbrains.kotlin.plugin.allopen")
jacoco
id("org.sonarqube") version "3.0"
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}

repositories {
mavenCentral()
}

dependencies {
implementation("io.kotest:kotest-assertions:$kotestAssertionsVerstion")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.springframework.boot:spring-boot-starter-actuator")
implementation("org.springframework.boot:spring-boot-starter-data-jpa")
implementation("org.springframework.boot:spring-boot-starter-batch")
implementation("org.springframework.boot:spring-boot-starter-security")
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.security:spring-security-test")
implementation("org.springframework.boot:spring-boot-devtools")
implementation("org.postgresql:postgresql")
implementation("org.flywaydb:flyway-core:$flywayVersion")

/* Firebase admin */
implementation("com.google.firebase:firebase-admin:7.3.0")

implementation("com.auth0:java-jwt:3.10.3")
implementation("com.fasterxml.jackson.dataformat:jackson-dataformat-csv")

implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.2")
implementation("org.apache.logging.log4j:log4j-api-kotlin:$log4jApiKotlinVersion")

implementation("io.springfox:springfox-swagger-ui:2.10.5")
implementation("io.springfox:springfox-swagger2:2.9.2")

implementation("com.amazonaws:aws-java-sdk:1.11.808")
implementation("com.google.cloud:google-cloud-storage:1.110.0")

implementation("org.json:json:$jsonVersoin")
implementation("net.bramp.ffmpeg:ffmpeg:0.6.2")

testImplementation("org.springframework.boot:spring-boot-starter-webflux")
testImplementation("org.amshove.kluent:kluent:1.68") //should be deleted after kotest move all of it
testImplementation("org.jetbrains.kotlin:kotlin-test:1.3.72") //should be deleted after kotest move all of it
testImplementation("io.kotest:kotest-assertions:$kotestAssertionsVerstion")
testImplementation("io.kotest:kotest-assertions-core:$kotestAssertionsVerstion")

testImplementation("org.springframework.boot:spring-boot-starter-test") {
exclude("junit")
}
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")

testImplementation("org.testcontainers:testcontainers")
testImplementation("com.natpryce:hamkrest:1.8.0.1")
testImplementation("org.testcontainers:junit-jupiter:$testContainersVersion")
testImplementation("org.testcontainers:postgresql:$testContainersVersion")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "1.8"
}
}

// --- ktlint - kotlin code style plugin ---
configurations {
ktlint
}

dependencies {
ktlint("com.pinterest:ktlint:0.38.0")
}

tasks.register("ktlintFormat", JavaExec::class.java) {
description = "Fix Kotlin code style deviations."
group = "formatting"
classpath = ktlint
main = "com.pinterest.ktlint.Main"
args = listOf("-F", "src/**/*.kt")
}

tasks.register("ktlint", JavaExec::class.java) {
group = "verification"
description = "Runs ktlint."
main = "com.pinterest.ktlint.Main"
classpath = ktlint
args = listOf(
"--reporter=plain",
"--reporter=checkstyle,output=${project.buildDir}/reports/ktlint/ktlint-checkstyle-report.xml",
"src/**/*.kt"
)
}

project.exec {
commandLine = "git config core.hooksPath .githooks".split(" ")
}

tasks.named("compileKotlin") { dependsOn("ktlint") }

tasks.withType<Test> {
useJUnitPlatform {
excludeTags("integration-test")
}
}

tasks.test {
finalizedBy("jacocoTestReport")
}

tasks.withType<JacocoReport> {
dependsOn("test")

reports {
xml.required.set(true)
html.required.set(true)
xml.outputLocation.set(file("${buildDir}/jacoco/coverage.xml"))
csv.required.set(false)
html.outputLocation.set(file("${buildDir}/jacoco/html"))
}
afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.map {
fileTree(it).apply {
exclude(
"com/epam/brn/dto/**",
"com/epam/brn/model/**",
"com/epam/brn/config/**",
"com/epam/brn/exception/**",
"com/epam/brn/Application*"
)
}
}))
}
executionData.setFrom("$buildDir/jacoco/test.exec")
}

task<Test>("integrationTest") {
useJUnitPlatform { includeTags("integration-test") }
mustRunAfter(tasks["test"])
group = "Verification"
description = "Runs the integration tests on Postgres Test Container."
}

sonarqube {
properties {
// Root project information
property("sonar.projectKey", "Brain-up_brn")
property("sonar.organization", "brain-up")
property("sonar.host.url", "https://sonarcloud.io")

property("sonar.coverage.jacoco.xmlReportPaths", "./build/jacoco/coverage.xml")
property("sonar.language", "kotlin")
property("sonar.java.coveragePlugin", "jacoco")
property("sonar.working.directory", "./build/sonar")
property(
"sonar.coverage.exclusions", "**/com/epam/brn/dto/**," +
"**/com/epam/brn/model/**," +
"**/com/epam/brn/config/**," +
"**/com/epam/brn/exception/**," +
"**/com/epam/brn/Application*," +
"**/com/epam/brn/service/load/InitialDataLoader*," +
"**/com/epam/brn/service/load/FirebaseUserDataLoader*"
)
}
}
4 changes: 2 additions & 2 deletions gradle.properties
@@ -1,8 +1,8 @@
kotlin.code.style=official

springBootVersion=2.4.3
springBootVersion=2.5.8
springDependencyVersion=1.0.11.RELEASE
kotlinVersion=1.4.20
kotlinVersion=1.6.10
flywayVersion=6.5.5
junitVersion=5.3.1
mockkVersion=1.12.0
Expand Down

0 comments on commit 505c4f4

Please sign in to comment.