Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tar i bruk ep-script-plugins #14

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
106 changes: 3 additions & 103 deletions build.gradle
@@ -1,7 +1,5 @@

buildscript {
ext {
kotlinVersion = '1.6.21' // 1.7.0 skaper trøbbel for mockk: https://github.com/mockk/mockk/issues/832 - som igjen feiler tester i prefill-appen
springFrameworkVersion = '5.3.22'
springBootVersion = '2.7.3'
jacksonModuleKotlinVersion = '2.13.3'
Expand All @@ -10,68 +8,20 @@ buildscript {
mockkVersion = '1.12.5'
tokenSupportVersion = '2.1.4'
}

repositories {
mavenCentral()
}
}

plugins {
id("java-library")
id("maven-publish")
id("org.jetbrains.kotlin.jvm") version "${kotlinVersion}"
id("net.researchgate.release") version "3.0.1"
id("org.jetbrains.kotlin.plugin.spring") version "${kotlinVersion}"
id("com.adarshr.test-logger") version "3.2.0"
id("com.github.ben-manes.versions") version "0.42.0"
id("se.patrikerdes.use-latest-versions") version "0.2.18"
id("org.owasp.dependencycheck") version "7.1.2"
id("com.vanniktech.dependency.graph.generator") version "0.8.0"
id "org.sonarqube" version "3.4.0.2513"
id 'jacoco'
}

group = "no.nav.eessi.pensjon"

java {
withJavadocJar()
withSourcesJar()
}

compileKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "17"
allWarningsAsErrors = true
}
}

compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ["-Xjsr305=strict"]
jvmTarget = "17"
allWarningsAsErrors = true
}
}

// https://docs.gradle.org/current/userguide/jacoco_plugin.html
jacoco {
toolVersion = "0.8.8"
}

jacocoTestReport {
reports {
xml.enabled true
}
}
apply from: "https://raw.githubusercontent.com/navikt/ep-script-plugins/release-0.2.0/ep-module.gradle"
apply from: "https://raw.githubusercontent.com/navikt/ep-script-plugins/release-0.2.0/ep-library.gradle"

tasks.sonarqube.dependsOn tasks["jacocoTestReport"]
group = "no.nav.eessi.pensjon"

dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom:${kotlinVersion}"))
implementation("org.jetbrains.kotlin:kotlin-reflect")


// Logging
implementation('net.logstash.logback:logstash-logback-encoder:7.2') {
exclude module: "commons-logging"
Expand Down Expand Up @@ -111,7 +61,6 @@ dependencies {
}

test {
useJUnitPlatform()
failFast = true
testLogging {
exceptionFormat "full"
Expand All @@ -122,56 +71,7 @@ test {

// https://github.com/researchgate/gradle-release
release {
newVersionCommitMessage = "[Release Plugin] - next version commit: "
tagTemplate = "release-\${version}"

git {
requireBranch.set('master')
}
}

// https://help.github.com/en/actions/language-and-framework-guides/publishing-java-packages-with-gradle#publishing-packages-to-github-packages
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/navikt/ep-personoppslag"
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
}

repositories {
mavenCentral()

["ep-metrics", "ep-logging"].each { repo ->
String token = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key")
if (!token) throw new NullPointerException("Missing token, you have to set GITHUB_TOKEN or gpr.key, see README")
maven {
url = uri("https://maven.pkg.github.com/navikt/$repo")
credentials {
username = "token"
password = token
}
}
}
}


/* https://github.com/ben-manes/gradle-versions-plugin */
dependencyUpdates {
rejectVersionIf {
['alpha', 'beta', 'b', 'rc', 'cr', 'm', 'preview', 'pr']
.any { qualifier -> it.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/}
}
revision = 'release'
}