Skip to content

Commit

Permalink
Use kotlin DSL for gradle scripts
Browse files Browse the repository at this point in the history
Use latest gretty plugin
Version up jetty to v11
Version up servlet api to 5.0
Version up dependencies
  • Loading branch information
evantill committed Dec 7, 2022
2 parents d53dd92 + 4507fe0 commit 917b795
Show file tree
Hide file tree
Showing 12 changed files with 379 additions and 280 deletions.
9 changes: 9 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# Linux start script should use lf
/gradlew text eol=lf

# These are Windows script files and should use crlf
*.bat text eol=crlf

3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -273,3 +273,6 @@ gradle-app.setting

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

# Ignore Gradle build output directory
build
68 changes: 0 additions & 68 deletions build.gradle

This file was deleted.

76 changes: 76 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat.FULL
import org.gradle.language.base.plugins.LifecycleBasePlugin.VERIFICATION_GROUP

plugins {
java
eclipse
idea
war
id("org.gretty") version "4.0.3"
}

repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

version = "1.1"

defaultTasks("clean", "build")

dependencies {
implementation("org.slf4j:slf4j-api:2.0.5")
implementation("ch.qos.logback:logback-classic:1.4.5")
providedCompile("jakarta.servlet:jakarta.servlet-api:5.0.0")
/**
* CVE-2022-4065 https://devhub.checkmarx.com/cve-details/CVE-2022-4065
* TODO upgrade version when https://github.com/cbeust/testng/pull/2806 will be released
*/
testImplementation("org.testng:testng:7.6.1")
}

gretty {
servletContainer="jetty11"
httpPort = 8080
contextPath = "/gradle-war"
springBoot = false
}

java{
sourceCompatibility=JavaVersion.VERSION_11
targetCompatibility=JavaVersion.VERSION_11
}

tasks.war {
archiveFileName.set("gradle-war.war")
}

val test by tasks.existing(Test::class) {
testLogging {
// show standard out and standard error of the test JVM(s) on the console
showStandardStreams = true
exceptionFormat = FULL
}
useTestNG {
excludeGroups("integration")
}
}

val integrationTest by tasks.registering(Test::class) {
dependsOn(test)
description = "Runs the integration test suite."
group = VERIFICATION_GROUP

testLogging {
// show standard out and standard error of the test JVM(s) on the console
showStandardStreams = true
exceptionFormat = FULL
}
useTestNG {
includeGroups("integration")
}
}

tasks.check{
dependsOn(integrationTest)
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Fri Jan 12 14:23:14 PST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4.1-all.zip
Loading

0 comments on commit 917b795

Please sign in to comment.