diff --git a/build.gradle b/build.gradle deleted file mode 100644 index 01d7785..0000000 --- a/build.gradle +++ /dev/null @@ -1,82 +0,0 @@ -plugins { - id "java" - id "org.springframework.boot" version "3.1.4" - id "io.spring.dependency-management" version "1.1.3" - - // Code quality plugins - id "checkstyle" - id "jacoco" - id "org.sonarqube" version "4.4.0.3356" -} - -// TODO: Update group to end with "admin" or "trainee". -group = "uk.nhs.tis" -version = "0.0.1" - -configurations { - compileOnly { - extendsFrom annotationProcessor - } -} - -repositories { - mavenCentral() -} - -dependencies { - // Spring Boot starters - implementation "org.springframework.boot:spring-boot-starter-actuator" - implementation "org.springframework.boot:spring-boot-starter-web" - testImplementation "org.springframework.boot:spring-boot-starter-test" - - // Lombok - compileOnly "org.projectlombok:lombok" - annotationProcessor "org.projectlombok:lombok" - - // MapStruct - ext.mapstructVersion = "1.5.5.Final" - implementation "org.mapstruct:mapstruct:${mapstructVersion}" - annotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}" - testAnnotationProcessor "org.mapstruct:mapstruct-processor:${mapstructVersion}" - - // Sentry reporting - ext.sentryVersion = "6.33.0" - implementation "io.sentry:sentry-spring-boot-starter:$sentryVersion" - implementation "io.sentry:sentry-logback:$sentryVersion" -} - -checkstyle { - config = resources.text.fromArchiveEntry(configurations.checkstyle[0], "google_checks.xml") -} - -jacocoTestReport { - reports { - html.required = true - xml.required = true - } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - vendor = JvmVendorSpec.ADOPTIUM - } -} - -sonarqube { - properties { - property "sonar.host.url", "https://sonarcloud.io" - property "sonar.login", System.getenv("SONAR_TOKEN") - property "sonar.organization", "health-education-england" - // TODO: Update sonar.projectKey to real value. - property "sonar.projectKey", "Health-Education-England_tis-microservice-template" - - property "sonar.java.checkstyle.reportPaths", - "build/reports/checkstyle/main.xml,build/reports/checkstyle/test.xml" - } -} - -test { - finalizedBy jacocoTestReport - useJUnitPlatform() -} diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 0000000..7fc2f10 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,82 @@ +plugins { + java + id("org.springframework.boot") version "3.2.0" + id("io.spring.dependency-management") version "1.1.4" + + // Code quality plugins + checkstyle + jacoco + id("org.sonarqube") version "4.4.1.3373" +} + +// TODO: Update group to end with "admin" or "trainee". +group = "uk.nhs.tis" +version = "0.0.1" + +configurations { + compileOnly { + extendsFrom(configurations.annotationProcessor.get()) + } +} + +repositories { + mavenCentral() +} + +dependencies { + // Spring Boot starters + implementation("org.springframework.boot:spring-boot-starter-actuator") + implementation("org.springframework.boot:spring-boot-starter-web") + testImplementation("org.springframework.boot:spring-boot-starter-test") + + // Lombok + compileOnly("org.projectlombok:lombok") + annotationProcessor("org.projectlombok:lombok") + + // MapStruct + val mapstructVersion = "1.5.5.Final" + implementation("org.mapstruct:mapstruct:${mapstructVersion}") + annotationProcessor("org.mapstruct:mapstruct-processor:${mapstructVersion}") + testAnnotationProcessor("org.mapstruct:mapstruct-processor:${mapstructVersion}") + + // Sentry reporting + val sentryVersion = "7.1.0" + implementation("io.sentry:sentry-spring-boot-starter:$sentryVersion") + implementation("io.sentry:sentry-logback:$sentryVersion") +} + +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(17)) + vendor.set(JvmVendorSpec.ADOPTIUM) + } +} + +checkstyle { + config = resources.text.fromArchiveEntry(configurations.checkstyle.get().first(), "google_checks.xml") +} + +sonarqube { + properties { + property("sonar.host.url", "https://sonarcloud.io") + property("sonar.login", System.getenv("SONAR_TOKEN")) + property("sonar.organization", "health-education-england") + // TODO: Update sonar.projectKey to real value. + property("sonar.projectKey", "Health-Education-England_tis-microservice-template") + + property("sonar.java.checkstyle.reportPaths", + "build/reports/checkstyle/main.xml,build/reports/checkstyle/test.xml") + } +} + +tasks.jacocoTestReport { + reports { + html.required.set(true) + xml.required.set(true) + } +} + +tasks.test { + finalizedBy(tasks.jacocoTestReport) + useJUnitPlatform() +} diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 943f0cb..afba109 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 4e86b92..3499ded 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip networkTimeout=10000 zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index c72d82d..0000000 --- a/settings.gradle +++ /dev/null @@ -1,2 +0,0 @@ -// TODO: Update project name. -rootProject.name = 'template' diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 0000000..1e308ee --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,2 @@ +// TODO: Update project name. +rootProject.name = "tis-microservice-template"