Skip to content

Commit 1bc2462

Browse files
committed
Fullfør Dokka v2-migrering
1 parent c3dde53 commit 1bc2462

File tree

20 files changed

+165
-79
lines changed

20 files changed

+165
-79
lines changed

.github/workflows/build-and-release.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ jobs:
6565
6666
- name: Genererer docs
6767
run: |
68-
gradle dokkaHtmlMultiModule
68+
gradle dokkaGenerate
6969
7070
- name: upload-artifact for docs
7171
uses: actions/upload-pages-artifact@v3
7272
with:
73-
path: './build/dokka/htmlMultiModule'
73+
path: './build/dokka/'
7474

7575
deploy-pages:
7676
runs-on: ubuntu-latest

build.gradle.kts

+6-72
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,10 @@
1-
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
2-
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
3-
41
plugins {
5-
kotlin("jvm") version "2.1.10"
6-
id("io.ktor.plugin") version "3.1.0" apply false
7-
id("org.jetbrains.dokka") version "2.0.0"
8-
`maven-publish`
9-
`java-library`
10-
}
11-
12-
allprojects {
13-
repositories {
14-
mavenCentral()
15-
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
16-
}
2+
base
3+
id("komponenter.conventions")
174
}
185

19-
subprojects {
20-
group = "no.nav.aap.kelvin"
21-
22-
apply(plugin = "org.jetbrains.kotlin.jvm")
23-
apply(plugin = "maven-publish")
24-
apply(plugin = "java-library")
25-
apply(plugin = "org.jetbrains.dokka")
26-
27-
kotlin {
28-
explicitApi = ExplicitApiMode.Warning
29-
compilerOptions {
30-
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
31-
}
32-
}
33-
34-
tasks {
35-
withType<ShadowJar> {
36-
mergeServiceFiles()
37-
}
38-
39-
withType<Test> {
40-
reports.html.required.set(false)
41-
useJUnitPlatform()
42-
maxParallelForks = Runtime.getRuntime().availableProcessors()
43-
}
44-
}
45-
46-
java {
47-
withSourcesJar()
48-
withJavadocJar()
49-
}
50-
51-
publishing {
52-
publications {
53-
create<MavenPublication>("mavenJava") {
54-
artifactId = project.name
55-
version = project.findProperty("version")?.toString() ?: "0.0.0"
56-
from(components["java"])
57-
}
58-
}
59-
60-
repositories {
61-
maven {
62-
name = "GitHubPackages"
63-
url = uri("https://maven.pkg.github.com/navikt/aap-kelvin-komponenter")
64-
credentials {
65-
username = "x-access-token"
66-
password = System.getenv("GITHUB_TOKEN")
67-
}
68-
}
69-
}
6+
dependencies {
7+
rootProject.subprojects.forEach { subproject ->
8+
dokka(project(":" + subproject.name))
709
}
71-
72-
kotlin.sourceSets["main"].kotlin.srcDirs("main/kotlin")
73-
kotlin.sourceSets["test"].kotlin.srcDirs("test/kotlin")
74-
sourceSets["main"].resources.srcDirs("main/resources")
75-
sourceSets["test"].resources.srcDirs("test/resources")
76-
}
10+
}

buildSrc/build.gradle.kts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
2+
3+
plugins {
4+
`kotlin-dsl`
5+
}
6+
7+
repositories {
8+
mavenCentral()
9+
}
10+
11+
dependencies {
12+
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:2.1.10")
13+
implementation("org.jetbrains.dokka:dokka-gradle-plugin:2.0.0")
14+
}
15+
16+
kotlin {
17+
jvmToolchain(21)
18+
compilerOptions {
19+
jvmTarget.set(JvmTarget.JVM_21)
20+
}
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
4+
plugins {
5+
id("org.jetbrains.kotlin.jvm")
6+
id("org.jetbrains.dokka")
7+
`maven-publish`
8+
`java-library`
9+
}
10+
11+
group = "no.nav.aap"
12+
version = project.findProperty("version")?.toString() ?: "0.0.0"
13+
14+
repositories {
15+
mavenCentral()
16+
maven("https://github-package-registry-mirror.gc.nav.no/cached/maven-release")
17+
}
18+
19+
dokka {
20+
dokkaSourceSets.configureEach {
21+
sourceLink {
22+
remoteUrl("https://github.com/navikt/aap-kelvin-komponenter/")
23+
localDirectory.set(rootDir)
24+
}
25+
}
26+
}
27+
28+
tasks.test {
29+
useJUnitPlatform()
30+
reports.html.required.set(false)
31+
maxParallelForks = Runtime.getRuntime().availableProcessors() / 2
32+
}
33+
34+
kotlin {
35+
jvmToolchain(21)
36+
explicitApi = ExplicitApiMode.Warning
37+
compilerOptions {
38+
jvmTarget.set(JvmTarget.JVM_21)
39+
apiVersion.set(org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_2_0)
40+
}
41+
}
42+
43+
java {
44+
withSourcesJar()
45+
withJavadocJar()
46+
}
47+
48+
publishing {
49+
publications {
50+
create<MavenPublication>("mavenJava") {
51+
artifactId = project.name
52+
version = project.findProperty("version")?.toString() ?: "0.0.0"
53+
from(components["java"])
54+
}
55+
}
56+
57+
repositories {
58+
maven {
59+
name = "GitHubPackages"
60+
url = uri("https://maven.pkg.github.com/navikt/aap-kelvin-komponenter")
61+
credentials {
62+
username = "x-access-token"
63+
password = System.getenv("GITHUB_TOKEN")
64+
}
65+
}
66+
}
67+
}
68+
69+
kotlin.sourceSets["main"].kotlin.srcDirs("main")
70+
kotlin.sourceSets["test"].kotlin.srcDirs("test")
71+
sourceSets["main"].resources.srcDirs("main")
72+
sourceSets["test"].resources.srcDirs("test")

dbconnect/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
implementation("org.slf4j:slf4j-api:2.0.16")
37

dbconnect/src/main/kotlin/no/nav/aap/komponenter/dbconnect/DBConnection.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class DBConnection internal constructor(
4848
/**
4949
* Executes the given SQL query and returns the generated key.
5050
*
51-
* @sample
51+
* ```kotlin
5252
* val key = connection.executeReturnKey(query) {
5353
* setParams {
5454
* setLong(1, avklaringsbehovId)
@@ -60,7 +60,7 @@ public class DBConnection internal constructor(
6060
* setEnumName(7, endring.grunn)
6161
* }
6262
* }
63-
*
63+
*```
6464
* @param query The SQL query to execute.
6565
* @param block Lambda function to configure the execution parameters and result validation.
6666
* @return The generated key as a Long.

dbmigrering/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
implementation(project(":infrastructure"))
37
implementation("org.flywaydb:flyway-database-postgresql:11.3.1")

dbtest/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
implementation("com.zaxxer:HikariCP:6.2.1")
37
implementation("org.flywaydb:flyway-database-postgresql:11.3.1")

gradle.properties

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
org.gradle.caching=true
22
org.gradle.parallel=true
33
org.gradle.jvmargs=-XX:+UseParallelGC
4+
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
5+
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true

gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

httpklient/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
22

3+
plugins {
4+
id("komponenter.conventions")
5+
}
6+
37
val ktorVersion = "3.1.0"
48
val junitVersion = "5.11.4"
59

infrastructure/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
testImplementation("org.junit.jupiter:junit-jupiter-api:5.11.4")
37
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.11.4")

json/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
22

3+
plugins {
4+
id("komponenter.conventions")
5+
}
6+
37
kotlin.explicitApi = ExplicitApiMode.Warning
48

59
dependencies {

motor-api/build.gradle.kts

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
id("io.ktor.plugin") version "3.1.0" apply false
4+
}
5+
16
val ktorVersion = "3.1.0"
27

38
dependencies {

motor-test-utils/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
implementation(project(":dbconnect"))
37
implementation(project(":motor"))

motor/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
plugins {
2+
id("komponenter.conventions")
3+
}
4+
15
dependencies {
26
api(project(":dbconnect"))
37
api(project(":json"))

server/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
22

3+
plugins {
4+
id("komponenter.conventions")
5+
}
6+
37
val ktorVersion = "3.1.0"
48

59
kotlin.explicitApi = ExplicitApiMode.Warning

settings.gradle.kts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1+
pluginManagement {
2+
repositories {
3+
mavenCentral()
4+
gradlePluginPortal()
5+
}
6+
}
7+
8+
19
plugins {
210
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
311
}
412
rootProject.name = "kelvin-komponenter"
513

14+
615
include(
716
"infrastructure",
817
"dbmigrering",
@@ -15,5 +24,5 @@ include(
1524
"httpklient",
1625
"server",
1726
"verdityper",
18-
"tidslinje",
27+
"tidslinje"
1928
)

tidslinje/build.gradle.kts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import org.jetbrains.kotlin.gradle.dsl.ExplicitApiMode
22

3-
kotlin.explicitApi = ExplicitApiMode.Warning
3+
plugins {
4+
id("komponenter.conventions")
5+
}
46

7+
kotlin.explicitApi = ExplicitApiMode.Warning
58

69
dependencies {
710
implementation(project(":dbconnect")) // Periode

verdityper/build.gradle.kts

+4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
plugins {
3+
id("komponenter.conventions")
4+
}
5+
26
dependencies {
37
implementation(project(":dbconnect"))
48
implementation("com.fasterxml.jackson.core:jackson-annotations:2.18.2")

0 commit comments

Comments
 (0)