Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .agent/rules/build-tool.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
trigger: always_on
---

The build tool is gradle
to check if the project is compiling and running correctly use the ./gradlew check
github is used,
the repository is found at https://github.com/triplem/gradle-by-example/
6 changes: 6 additions & 0 deletions .agent/rules/common.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
trigger: always_on
---

store all communications and proposals into adoc files
store those files in a new directory 'antigravity'
5 changes: 3 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: CI Build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

Expand All @@ -23,7 +24,7 @@ jobs:
java-version: '21'

- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v5

- name: Setup Gradle and Compile
uses: gradle/actions/setup-gradle@v3
Expand All @@ -43,7 +44,7 @@ jobs:
distribution: 'temurin'
java-version: '21'
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
uses: gradle/actions/wrapper-validation@v5
- name: Validate Version Catalog
uses: gradle/actions/setup-gradle@v3
with:
Expand Down
20 changes: 0 additions & 20 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,16 @@
plugins {
id("org.jetbrains.dokka")

// due to late-binding not working, aggregation should define tasks doc-consumer
id("org.javafreedom.aggregation-conventions")

id("org.javafreedom.verification.jacoco-consumer-conventions")
id("org.javafreedom.verification.test-consumer-conventions")
id("org.javafreedom.documentation.documentation-consumer-conventions")

id("org.javafreedom.verification.sonarqube-conventions")
}

allprojects {
group = "org.javafreedom.gradle"
}

repositories {
mavenCentral()
}

// Configure Dokka V2 for multi-module documentation
dokka {
dokkaPublications.html {
outputDirectory.set(layout.buildDirectory.dir("dokka"))
}
}

dependencies {
implementation(project(":app"))
asciidoc(project(":documentation"))

dokka(project(":app"))
dokka(project(":list"))
dokka(project(":utilities"))
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ plugins {
id("org.javafreedom.verification.jacoco-consumer-conventions")
id("io.gitlab.arturbosch.detekt")
id("org.sonarqube")
id("org.jetbrains.dokka")
}

// right now, there is no real aggregation of detekt, therefor we are just adding all
Expand Down Expand Up @@ -58,3 +59,18 @@ subprojects {
}
}

// Configure Dokka V2 for multi-module documentation
dokka {
dokkaPublications.html {
outputDirectory.set(layout.buildDirectory.dir("dokka"))
}
}

dependencies {
subprojects.forEach { subproject ->
if (subproject.name != "documentation") {
dokka(subproject)
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ dependencies {

// Add additional dependencies useful for development
implementation(libs.findLibrary("kotlinLogging").get())
implementation(libs.findLibrary("slf4jApi").get())

// Testing dependencies
testImplementation(libs.findBundle("testing").get())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ val asciidoc by configurations.creating {
}

val dokkaGenerateTask = tasks.named("dokkaGenerate")
val testReportTask = tasks.named("testReport")
val testReportTask = tasks.named("testAggregateTestReport")
val jacocoReportTask = tasks.named("aggregateJacocoTestReport")
val detektReportTask = tasks.named<Detekt>("aggregateDetekt")
val rootDetektTask = tasks.named("detekt")
Expand All @@ -32,9 +32,11 @@ tasks.register<Copy>("aggregateReports") {
into("dokka")
}

from(layout.buildDirectory.dir("reports/allTests")) {
into("tests")
from(layout.buildDirectory.dir("reports/tests/test/aggregated-results")) {
into("tests/unit")
}



from(layout.buildDirectory.dir("reports/jacoco/aggregateJacocoTestReport")) {
into("jacoco")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,17 @@ package org.javafreedom.verification

plugins {
kotlin("jvm")
id("test-report-aggregation")
}

val testReportData by configurations.creating {
isCanBeResolved = true
isCanBeConsumed = false
extendsFrom(configurations.implementation.get())
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("test-report-data"))
}
}

val testReportTask = tasks.register<TestReport>("testReport") {
destinationDirectory.set(layout.buildDirectory.dir("reports/allTests"))
// Use test results from testReportData configuration
(getTestResults() as ConfigurableFileCollection)
.from(testReportData.incoming.artifactView { lenient(true) }.files)
dependencies {
testReportAggregation(project(":app"))
testReportAggregation(project(":list"))
testReportAggregation(project(":utilities"))
}

tasks.check {
dependsOn(testReportTask)
reporting {
reports {
val integrationTestAggregateTestReport by creating(org.gradle.api.tasks.testing.AggregateTestReport::class)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,8 @@ testing {
val integrationTest by registering(JvmTestSuite::class) {
dependencies {
implementation(project())
// Inherit all test dependencies
implementation(platform(libs.findLibrary("kotlin-bom").get()))
implementation(libs.findLibrary("kotlin-stdlib").get())
implementation(libs.findLibrary("kotlinLogging").get())
implementation(libs.findLibrary("kotlin-test").get())
implementation(libs.findLibrary("kotlin-test-junit5").get())
implementation(libs.findLibrary("junitJupiterApi").get())
implementation(libs.findLibrary("assertkJvm").get())
runtimeOnly(libs.findLibrary("junitJupiterEngine").get())
}

targets {
all {
testTask.configure {
Expand All @@ -48,6 +39,14 @@ testing {
}
}

// Inherit dependencies from test suite
configurations.named("integrationTestImplementation") {
extendsFrom(configurations.getByName("testImplementation"))
}
configurations.named("integrationTestRuntimeOnly") {
extendsFrom(configurations.getByName("testRuntimeOnly"))
}

// Configure Kotlin compilation to allow internal visibility for integration tests
afterEvaluate {
kotlin.target.compilations.named("integrationTest") {
Expand All @@ -61,26 +60,7 @@ tasks.check {

// IDEA integration is handled automatically by test-suites plugin

// -----------------------------
// Add configuration to allow aggregation of unit-test-reports
// -----------------------------

// Share the test report data to be aggregated for the whole project
configurations.create("binaryTestResultsElements") {
isVisible = false
isCanBeResolved = false
isCanBeConsumed = true
extendsFrom(configurations.implementation.get())
attributes {
attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.DOCUMENTATION))
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, objects.named("test-report-data"))
}

outgoing.artifact(tasks.test.map { task -> task.binaryResultsDirectory.get() })
outgoing.artifact(tasks.named("integrationTest").map { task ->
(task as Test).binaryResultsDirectory.get()
})
}

tasks.withType<Test>().configureEach {
useJUnitPlatform()
Expand Down
2 changes: 2 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
github_org=triplem

org.gradle.jvmargs=-XX:MaxMetaspaceSize=512m
org.gradle.caching=true
org.gradle.configuration-cache=true
org.gradle.configuration-cache.problems=warn
org.gradle.parallel=true

org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
org.jetbrains.dokka.experimental.gradle.pluginMode.noWarn=true
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
[versions]
# Language versions
kotlin = "2.0.20"
kotlin = "2.3.0"
java = "21"

# Testing frameworks
junit = "5.11.0"
junit = "5.13.4"
assertk = "0.28.1"

# Documentation
dokka = "2.0.0"
dokka = "2.1.0"
asciidoctor = "4.0.4"

# Code quality and security
detekt = "1.23.7"
sonarqube = "5.1.0.4882"
detekt = "1.23.8"
sonarqube = "7.2.2.6593"

# Logging
kotlin-logging = "3.0.5"
slf4j = "2.0.16"
kotlin-logging = "7.0.3"
slf4j = "2.0.17"

# Utilities
commons-text = "1.12.0"
commons-text = "1.15.0"

# Build and deployment
docker = "9.4.0"
docker = "10.0.0"

[libraries]
# Kotlin libraries
Expand All @@ -47,7 +47,7 @@ junitJupiterEngine = { group = "org.junit.jupiter", name = "junit-jupiter-engine
assertkJvm = { group = "com.willowtreeapps.assertk", name = "assertk-jvm", version.ref = "assertk" }

# Logging libraries
kotlinLogging = { group = "io.github.microutils", name = "kotlin-logging", version.ref = "kotlin-logging" }
kotlinLogging = { group = "io.github.oshai", name = "kotlin-logging", version.ref = "kotlin-logging" }
slf4jApi = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }

# Utility libraries
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.3.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading