diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4f259360..60cea26c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -25,7 +25,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: "17" # Required for PrismaKT tests (which call npx prisma) - uses: actions/setup-node@v4 @@ -58,7 +58,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: "17" - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -82,7 +82,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: "17" - uses: pnpm/action-setup@v4 with: version: 9 @@ -125,7 +125,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: "17" - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 @@ -148,7 +148,7 @@ jobs: - uses: actions/setup-java@v4 with: distribution: "temurin" - java-version: "11" + java-version: "17" - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 diff --git a/build.gradle b/build.gradle deleted file mode 100644 index a5c4583c..00000000 --- a/build.gradle +++ /dev/null @@ -1,2 +0,0 @@ -group = "guru.zoroark.tegral" -version = rootProject.file('version.txt').text.trim() diff --git a/build.gradle.kts b/build.gradle.kts new file mode 100644 index 00000000..b0d2cbd4 --- /dev/null +++ b/build.gradle.kts @@ -0,0 +1,2 @@ +group = "guru.zoroark.tegral" +version = rootProject.file("version.txt").readText().trim() diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle deleted file mode 100644 index 5379191e..00000000 --- a/buildSrc/build.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'groovy-gradle-plugin' -} - -repositories { - gradlePluginPortal() -} - -dependencies { - def pluginsDef = [ - libs.plugins.kotlin, - libs.plugins.kotlinSerialization, - libs.plugins.dokkatoo, - libs.plugins.detekt, - libs.plugins.versions, - libs.plugins.gradleTestLogger, - libs.plugins.kotlinBcv, - libs.plugins.nodeGradle, - libs.plugins.licenser, - libs.plugins.shadow - ] - - for (pluginDef in pluginsDef) { - def actualLib = pluginDef.get() - implementation(group: actualLib.getPluginId(), name: actualLib.getPluginId() + ".gradle.plugin", version: actualLib.getVersion()) - } -} diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..aa685280 --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + `kotlin-dsl` +} + +repositories { + gradlePluginPortal() +} + +dependencies { + val pluginsDef = listOf( + libs.plugins.kotlin, + libs.plugins.kotlinSerialization, + libs.plugins.dokkatoo, + libs.plugins.detekt, + libs.plugins.versions, + libs.plugins.gradleTestLogger, + libs.plugins.kotlinBcv, + libs.plugins.nodeGradle, + libs.plugins.licenser, + libs.plugins.shadow + ) + + for (pluginDef in pluginsDef) { + val actualLib = pluginDef.get() + implementation( + group = actualLib.pluginId, + name = actualLib.pluginId + ".gradle.plugin", + version = actualLib.version.toString() + ) + } + + // Usual hack to get access to 'libs' https://github.com/gradle/gradle/issues/15383#issuecomment-779893192 + implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location)) +} diff --git a/buildSrc/settings.gradle b/buildSrc/settings.gradle.kts similarity index 83% rename from buildSrc/settings.gradle rename to buildSrc/settings.gradle.kts index 6f31e6ef..b5a0fabf 100644 --- a/buildSrc/settings.gradle +++ b/buildSrc/settings.gradle.kts @@ -1,6 +1,6 @@ dependencyResolutionManagement { versionCatalogs { - libs { + create("libs") { from(files("../gradle/libs.versions.toml")) } } diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.base-conventions.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.base-conventions.gradle deleted file mode 100644 index 89ef9a75..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.base-conventions.gradle +++ /dev/null @@ -1,27 +0,0 @@ -plugins { - id 'com.github.ben-manes.versions' - id 'org.cadixdev.licenser' -} - -version = rootProject.version -group = rootProject.group - -// Versions config for the Gradle versions plugin, from the readme -// https://github.com/ben-manes/gradle-versions-plugin - -def isNonStable = { String version -> - def stableKeyword = ['RELEASE', 'FINAL', 'GA'].any { it -> version.toUpperCase().contains(it) } - def regex = /^[0-9,.v-]+(-r)?$/ - return !stableKeyword && !(version ==~ regex) || version.contains("-M") -} - -dependencyUpdates { - // Reject all non stable versions - rejectVersionIf { - isNonStable(it.candidate.version) - } -} - -license { - header = rootProject.file('LICENSE_HEADER') -} diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.coverage-aggregator.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.coverage-aggregator.gradle deleted file mode 100644 index 1e670565..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.coverage-aggregator.gradle +++ /dev/null @@ -1,100 +0,0 @@ -plugins { - id 'jacoco' -} - -repositories { - mavenCentral() -} - -configurations { - aggregatedProjects { - canBeResolved false - canBeConsumed false - } - - aggregatedProjectsExecData { - canBeResolved true - canBeConsumed false - transitive false - - extendsFrom(aggregatedProjects) - - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.JACOCO_RESULTS)) - } - } - - aggregatedProjectsSources { - canBeResolved true - canBeConsumed false - transitive false - - extendsFrom(aggregatedProjects) - - attributes { - attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.MAIN_SOURCES)) - } - } - - aggregatedProjectsClasses { - canBeResolved true - canBeConsumed false - transitive false - - extendsFrom(aggregatedProjects) - - attributes { - attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.CLASSES)) - } - } - - compositeReportExecData { - canBeConsumed true - canBeResolved false - extendsFrom configurations.aggregatedProjectsExecData - - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.JACOCO_RESULTS)) - } - } - - compositeReportSources { - canBeConsumed true - canBeResolved false - - extendsFrom configurations.aggregatedProjectsSources - - attributes { - attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.EXTERNAL)) - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.MAIN_SOURCES)) - } - } - - compositeReportSources { - canBeConsumed true - canBeResolved false - - extendsFrom configurations.aggregatedProjectsClasses - - attributes { - attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements, LibraryElements.CLASSES)) - } - } -} - - -tasks.register("aggregatedCodeCoverage", JacocoReport) { - executionData(configurations.aggregatedProjectsExecData) - sourceDirectories.from(configurations.aggregatedProjectsSources) - classDirectories.from(configurations.aggregatedProjectsClasses) - - reports { - html.required = true - xml.required = true - } -} diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-common-conventions.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-common-conventions.gradle deleted file mode 100644 index 717525da..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-common-conventions.gradle +++ /dev/null @@ -1,42 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.base-conventions' - - id 'org.jetbrains.kotlin.jvm' - id 'io.gitlab.arturbosch.detekt' - - id 'java-library' - id 'jacoco' -} - -repositories { - mavenCentral() -} - -dependencies { - api libs.kotlin.stdlib - - testImplementation libs.kotlin.test - testImplementation libs.mockk - testImplementation libs.kotlin.test.junit5 - testImplementation libs.junit.jupiterApi - testImplementation libs.logback - testRuntimeOnly libs.junit.jupiterEngine - - detektPlugins libs.detekt.formatting -} - -testing { - suites { - // Configure the built-in test suite - test { - // Use JUnit Jupiter test framework - useJUnitJupiter() - } - } -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-published-library-conventions.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-published-library-conventions.gradle deleted file mode 100644 index 1bef2c0f..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.kotlin-published-library-conventions.gradle +++ /dev/null @@ -1,50 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' - id 'guru.zoroark.tegral.publish-conventions' - id 'dev.adamko.dokkatoo' - id 'org.jetbrains.kotlinx.binary-compatibility-validator' - id 'maven-publish' - id 'signing' -} - -project.ext.includeInCatalog = true - -detekt { - config = files(rootProject.layout.projectDirectory.file("detekt-config.published.yaml")) - buildUponDefaultConfig = true -} - -afterEvaluate { - dokkatoo { - dokkatooSourceSets.configureEach { - includes.from("MODULE.md") - } - } -} - -java { - withSourcesJar() - withJavadocJar() -} - -publishing { - publications { - maven(MavenPublication) { - from components.java - } - } -} - - -// https://docs.gradle.org/current/userguide/jacoco_plugin.html#sec:jacoco_getting_started -test { - finalizedBy jacocoTestReport -} - -jacocoTestReport { - dependsOn test - reports { - xml.required = true - html.required = true - } -} diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.pktg-e2e-test.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.pktg-e2e-test.gradle deleted file mode 100644 index 7e2ecd9c..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.pktg-e2e-test.gradle +++ /dev/null @@ -1,107 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' - - id 'com.github.node-gradle.node' - - id 'jacoco' - - id 'project-report' -} - -configurations { - generator { - canBeResolved true - canBeConsumed false - attributes { - attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling, Bundling.SHADOWED)) - } - } -} - -dependencies { - implementation libs.exposed.core - implementation libs.exposed.dao - implementation libs.exposed.jdbc - implementation libs.exposed.javatime - implementation libs.sqlite - - testImplementation project(":tegral-prismakt:tegral-prismakt-generator-tests-support") - - generator project(path: ":tegral-prismakt:tegral-prismakt-generator") -} - -sourceSets { - main { - kotlin { - srcDir layout.buildDirectory.dir("prismaGeneratedSrc") - } - } -} - -tasks.register('prismaGenerate', NpxTask) { - command = "prisma" - args = ["generate"] - - inputs.file("prisma/schema.prisma") - outputs.dir(project.layout.buildDirectory.dir("prismakt-generator")) - outputs.file(layout.buildDirectory.file("jacoco/generator.exec")) - - dependsOn configurations.jacocoAgent - dependsOn configurations.generator - - environment = providers.provider { - // Agent file retrieval based on JacocoAgentJar.getJar from the Gradle JaCoCo plugin - def jacocoAgentFile = zipTree(configurations.jacocoAgent.singleFile).find { it.name.equals("jacocoagent.jar") } - def command = "java " + - "-javaagent:" + jacocoAgentFile + "=destfile=" + layout.buildDirectory.file("jacoco/generator.exec").get().asFile.absolutePath + - " -jar " + configurations.generator.find { it.name.endsWith(".jar") } - println("Generated KT command: " + command) - return ["PRISMAKT_CMD": command] - } -} - -tasks.register('generatorCodeCoverage', JacocoReport) { - executionData layout.buildDirectory.file("jacoco/generator.exec") - sourceSets sourceSets.main - - dependsOn(tasks.prismaGenerate) -} - -configurations { - generatorCodeCoverageOutput { - canBeConsumed = true - canBeResolved = false - - extendsFrom configurations.coverageDataElementsForTest - - attributes { - attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category, Category.VERIFICATION)) - attribute(VerificationType.VERIFICATION_TYPE_ATTRIBUTE, objects.named(VerificationType, VerificationType.JACOCO_RESULTS)) - } - } -} - -artifacts { - generatorCodeCoverageOutput(((JacocoReport)tasks.generatorCodeCoverage).getExecutionData().getFiles()) { - builtBy(prismaGenerate) - } -} - -tasks.compileKotlin.dependsOn prismaGenerate -tasks.compileTestKotlin.dependsOn prismaGenerate - -license { - exclude "prismakt/generated/*.kt" -} - -test { - finalizedBy jacocoTestReport -} - -jacocoTestReport { - dependsOn test - reports { - xml.required = true - html.required = true - } -} diff --git a/buildSrc/src/main/groovy/guru.zoroark.tegral.publish-conventions.gradle b/buildSrc/src/main/groovy/guru.zoroark.tegral.publish-conventions.gradle deleted file mode 100644 index 1bb1e610..00000000 --- a/buildSrc/src/main/groovy/guru.zoroark.tegral.publish-conventions.gradle +++ /dev/null @@ -1,79 +0,0 @@ -plugins { - id 'java-library' - id 'maven-publish' - id 'signing' -} - -publishing { - repositories { - if (project.hasProperty("publishSnapshot")) { - if (project.version.endsWith("-SNAPSHOT")) { - maven { - name = "mavenCentralSnapshots" - url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") - credentials(PasswordCredentials) - } - } else { - logger.warn("-PpublishSnapshot is present, but no -SNAPSHOT suffix: skipping snapshot deployment") - } - } else if (project.hasProperty("publishRelease")) { - if (project.version.endsWith("-SNAPSHOT")) { - throw new Exception("Cannot use -PpublishRelease when version ends in -SNAPSHOT") - } - maven { - name = "mavenCentralRelease" - url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") - credentials(PasswordCredentials) - } - } - } - - publications { - maven(MavenPublication) { - pom { - licenses { - license { - name = 'The Apache License, Version 2.0' - url = 'https://www.apache.org/licenses/LICENSE-2.0.txt' - } - } - - developers { - developer { - id = 'utybo' - name = 'Matthieu S' - email = 'utybodev@gmail.com' - } - } - - scm { - connection = 'scm:git:git://github.com/utybo/Tegral.git' - developerConnection = 'scm:git:ssh://github.com:utybo/Tegral.git' - url = 'https://github.com/utybo/Tegral' - } - - afterEvaluate { - for (requiredExtProp in ['humanName', 'description', 'url']) { - if (!project.extensions.extraProperties.properties.containsKey(requiredExtProp)) { - throw new Exception("Missing project.ext." + requiredExtProp) - } - } - name = project.ext.humanName - description = project.ext.description - url = project.ext.url - } - } - } - } -} - -if (project.properties.containsKey("sign")) { - signing { - if (!project.properties.containsKey("signLocally")) { - def signingKey = findProperty("signingKey") - def signingPassword = findProperty("signingPassword") - useInMemoryPgpKeys(signingKey, signingPassword) - } - sign publishing.publications.maven - } -} diff --git a/buildSrc/src/main/kotlin/tegral.base-conventions.gradle.kts b/buildSrc/src/main/kotlin/tegral.base-conventions.gradle.kts new file mode 100644 index 00000000..4d854015 --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.base-conventions.gradle.kts @@ -0,0 +1,30 @@ +import com.github.benmanes.gradle.versions.updates.DependencyUpdatesTask + +plugins { + id("com.github.ben-manes.versions") + id("dev.yumi.gradle.licenser") +} + +version = rootProject.version +group = rootProject.group + +// Versions config for the Gradle versions plugin, from the readme +// https://github.com/ben-manes/gradle-versions-plugin + +fun isNonStable(version: String): Boolean { + val stableKeyword = listOf("RELEASE", "FINAL", "GA").any { version.uppercase().contains(it) } + val regex = Regex("^[0-9,.v-]+(-r)?$") + return !stableKeyword && !(version.matches(regex)) || version.contains("-M") +} + + +tasks.named("dependencyUpdates").configure { + // Reject all non-stable versions + rejectVersionIf { + isNonStable(candidate.version) + } +} + +license { + rule(rootProject.file("LICENSE_HEADER")) +} diff --git a/buildSrc/src/main/kotlin/tegral.coverage-aggregator.gradle.kts b/buildSrc/src/main/kotlin/tegral.coverage-aggregator.gradle.kts new file mode 100644 index 00000000..a2b1914b --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.coverage-aggregator.gradle.kts @@ -0,0 +1,88 @@ +plugins { + id("jacoco") +} + +repositories { + mavenCentral() +} + +val aggregatedProjects: Configuration by configurations.creating { + isCanBeResolved = false + isCanBeConsumed = false +} + +@Suppress("UnstableApiUsage") // VerificationType is incubating +val aggregatedProjectsExecData: Configuration by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false + isTransitive = false + + extendsFrom(aggregatedProjects) + + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, Category.VERIFICATION)) + attribute( + VerificationType.VERIFICATION_TYPE_ATTRIBUTE, + objects.named(VerificationType::class.java, VerificationType.JACOCO_RESULTS) + ) + } +} + +@Suppress("UnstableApiUsage") // VerificationType is incubating +val aggregatedProjectsSources: Configuration by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false + isTransitive = false + + extendsFrom(aggregatedProjects) + + attributes { + attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling::class.java, Bundling.EXTERNAL)) + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, Category.VERIFICATION)) + attribute( + VerificationType.VERIFICATION_TYPE_ATTRIBUTE, + objects.named(VerificationType::class.java, VerificationType.MAIN_SOURCES) + ) + } +} + +val aggregatedProjectsClasses: Configuration by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false + isTransitive = false + + extendsFrom(aggregatedProjects) + + attributes { + attribute( + LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, + objects.named(LibraryElements::class.java, LibraryElements.CLASSES) + ) + } +} + +@Suppress("UnstableApiUsage") // VerificationType is incubating +val compositeReportExecData: Configuration by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false + extendsFrom(aggregatedProjectsExecData) + + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category::class.java, Category.VERIFICATION)) + attribute( + VerificationType.VERIFICATION_TYPE_ATTRIBUTE, + objects.named(VerificationType::class.java, VerificationType.JACOCO_RESULTS) + ) + } +} + +tasks.register("aggregatedCodeCoverage") { + executionData(aggregatedProjectsExecData) + sourceDirectories.from(aggregatedProjectsSources) + classDirectories.from(aggregatedProjectsClasses) + + reports { + html.required = true + xml.required = true + } +} diff --git a/buildSrc/src/main/kotlin/tegral.kotlin-common-conventions.gradle.kts b/buildSrc/src/main/kotlin/tegral.kotlin-common-conventions.gradle.kts new file mode 100644 index 00000000..6915cfd7 --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.kotlin-common-conventions.gradle.kts @@ -0,0 +1,48 @@ +import org.gradle.accessors.dm.LibrariesForLibs + +plugins { + id("tegral.base-conventions") + + id("org.jetbrains.kotlin.jvm") + id("io.gitlab.arturbosch.detekt") + + id("java-library") + id("jacoco") +} + +val libs = the() + +repositories { + mavenCentral() +} + +dependencies { + api(libs.kotlin.stdlib) + + testImplementation(libs.kotlin.test) + testImplementation(libs.mockk) + testImplementation(libs.kotlin.test.junit5) + testImplementation(libs.junit.jupiterApi) + testImplementation(libs.logback) + testRuntimeOnly(libs.junit.jupiterEngine) + + detektPlugins(libs.detekt.formatting) +} + +testing { + suites { + // Configure the built-in test suite + @Suppress("UnstableApiUsage") + val test by getting(JvmTestSuite::class) { + // Use JUnit Jupiter test framework + useJUnitJupiter() + } + } +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM + } +} diff --git a/buildSrc/src/main/kotlin/tegral.kotlin-published-library-conventions.gradle.kts b/buildSrc/src/main/kotlin/tegral.kotlin-published-library-conventions.gradle.kts new file mode 100644 index 00000000..18a7f46a --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.kotlin-published-library-conventions.gradle.kts @@ -0,0 +1,48 @@ +plugins { + id("tegral.kotlin-common-conventions") + id("tegral.publish-conventions") + id("dev.adamko.dokkatoo") + id("org.jetbrains.kotlinx.binary-compatibility-validator") + id("maven-publish") + id("signing") +} + +extra["includeInCatalog"] = true + +detekt { + config.from(rootProject.layout.projectDirectory.file("detekt-config.published.yaml")) + buildUponDefaultConfig = true +} + +dokkatoo { + dokkatooSourceSets.configureEach { + includes.from("MODULE.md") + } +} + +java { + withSourcesJar() + withJavadocJar() +} + +publishing { + publications { + named("maven") { + from(components["java"]) + } + } +} + + +// https://docs.gradle.org/current/userguide/jacoco_plugin.html#sec:jacoco_getting_started +val test = tasks.named("test") { + finalizedBy(tasks.named("jacocoTestReport")) +} + +tasks.named("jacocoTestReport") { + dependsOn(test) + reports { + xml.required = true + html.required = true + } +} diff --git a/buildSrc/src/main/kotlin/tegral.pktg-e2e-test.gradle.kts b/buildSrc/src/main/kotlin/tegral.pktg-e2e-test.gradle.kts new file mode 100644 index 00000000..b567e339 --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.pktg-e2e-test.gradle.kts @@ -0,0 +1,113 @@ +import com.github.gradle.node.npm.task.NpxTask +import org.gradle.accessors.dm.LibrariesForLibs + +plugins { + id("tegral.kotlin-common-conventions") + id("com.github.node-gradle.node") + id("jacoco") + id("project-report") +} + +val libs = the() + +val generator by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false + + attributes { + attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling::class.java, Bundling.SHADOWED)) + } +} + +dependencies { + implementation(libs.exposed.core) + implementation(libs.exposed.dao) + implementation(libs.exposed.jdbc) + implementation(libs.exposed.javatime) + implementation(libs.sqlite) + + testImplementation(project(":tegral-prismakt:tegral-prismakt-generator-tests-support")) + + generator(project(":tegral-prismakt:tegral-prismakt-generator")) +} + +sourceSets { + main { + kotlin { + srcDir(layout.buildDirectory.dir("prismaGeneratedSrc")) + } + } +} + + +val prismaGenerate = tasks.register("prismaGenerate") { + command = "prisma" + args = listOf("generate") + + inputs.file("prisma/schema.prisma") + outputs.dir(project.layout.buildDirectory.dir("prismakt-generator")) + outputs.file(layout.buildDirectory.file("jacoco/generator.exec")) + + dependsOn(configurations["jacocoAgent"]) + dependsOn(generator) + + environment.putAll(provider { + // Agent file retrieval based on JacocoAgentJar.getJar from the Gradle JaCoCo plugin + val jacocoAgentFile = + zipTree(configurations["jacocoAgent"].singleFile).find { it.name.equals("jacocoagent.jar") } + val command = "java " + + "-javaagent:" + jacocoAgentFile + "=destfile=" + layout.buildDirectory.file("jacoco/generator.exec") + .get().asFile.absolutePath + + " -jar " + generator.find { it.name.endsWith(".jar") } + logger.info("Generated KT command: $command") + mapOf("PRISMAKT_CMD" to command) + }) +} + +val generatorCodeCoverage = tasks.register("generatorCodeCoverage") { + executionData.setFrom(layout.buildDirectory.file("jacoco/generator.exec")) + sourceSets(sourceSets["main"]) + + dependsOn(prismaGenerate) +} + +@Suppress("UnstableApiUsage") +val generatorCodeCoverageOutput by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false + + extendsFrom(configurations["coverageDataElementsForTest"]) + + attributes { + attribute(Category.CATEGORY_ATTRIBUTE, objects.named(Category.VERIFICATION)) + attribute( + VerificationType.VERIFICATION_TYPE_ATTRIBUTE, + objects.named(VerificationType.JACOCO_RESULTS) + ) + } +} + +artifacts { + add(generatorCodeCoverageOutput.name, layout.buildDirectory.file("jacoco/generator.exec")) { + builtBy(prismaGenerate) + } +} + +tasks.named("compileKotlin") { dependsOn(prismaGenerate) } +tasks.named("compileTestKotlin") { dependsOn(prismaGenerate) } + +license { + exclude("prismakt/generated/*.kt") +} + +tasks.named("test") { + finalizedBy(tasks.named("jacocoTestReport")) +} + +tasks.named("jacocoTestReport") { + dependsOn(tasks.named("test")) + reports { + xml.required = true + html.required = true + } +} diff --git a/buildSrc/src/main/kotlin/tegral.publish-conventions.gradle.kts b/buildSrc/src/main/kotlin/tegral.publish-conventions.gradle.kts new file mode 100644 index 00000000..3f191672 --- /dev/null +++ b/buildSrc/src/main/kotlin/tegral.publish-conventions.gradle.kts @@ -0,0 +1,79 @@ +plugins { + id("java-library") + id("maven-publish") + id("signing") +} + +publishing { + repositories { + if (project.hasProperty("publishSnapshot")) { + if (project.version.toString().endsWith("-SNAPSHOT")) { + maven { + name = "mavenCentralSnapshots" + url = uri("https://s01.oss.sonatype.org/content/repositories/snapshots/") + credentials(PasswordCredentials::class.java) + } + } else { + logger.warn("-PpublishSnapshot is present, but no -SNAPSHOT suffix: skipping snapshot deployment") + } + } else if (project.hasProperty("publishRelease")) { + if (project.version.toString().endsWith("-SNAPSHOT")) { + error("Cannot use -PpublishRelease when version ends in -SNAPSHOT") + } + maven { + name = "mavenCentralRelease" + url = uri("https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/") + credentials(PasswordCredentials::class.java) + } + } + } + + publications { + create("maven") { + pom { + licenses { + license { + name = "The Apache License, Version 2.0" + url = "https://www.apache.org/licenses/LICENSE-2.0.txt" + } + } + + developers { + developer { + id = "utybo" + name = "Matthieu S" + email = "utybodev@gmail.com" + } + } + + scm { + connection = "scm:git:git://github.com/utybo/Tegral.git" + developerConnection = "scm:git:ssh://github.com:utybo/Tegral.git" + url = "https://github.com/utybo/Tegral" + } + + afterEvaluate { + for (requiredExtProp in listOf("humanName", "description", "url")) { + if (!project.extensions.extraProperties.properties.containsKey(requiredExtProp)) { + error("Missing project.ext.$requiredExtProp") + } + } + this@pom.name = project.extra["humanName"]!!.toString() + this@pom.description = project.extra["description"]!!.toString() + this@pom.url = project.extra["url"]!!.toString() + } + } + } + } +} + +if (project.properties.containsKey("sign")) { + signing { + if (!project.properties.containsKey("signLocally")) { + val signingKey = findProperty("signingKey")!!.toString() + val signingPassword = findProperty("signingPassword")!!.toString() + useInMemoryPgpKeys(signingKey, signingPassword) + } + sign(publishing.publications["maven"]) + } +} diff --git a/code-coverage/build.gradle b/code-coverage/build.gradle deleted file mode 100644 index 86cf92f9..00000000 --- a/code-coverage/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'base' - id 'guru.zoroark.tegral.coverage-aggregator' -} - -repositories { - mavenCentral() -} - -dependencies { - for (projectPath in gradle.ext.testProjects) { - aggregatedProjects project(projectPath) - } -} - -tasks.named('check') { - dependsOn tasks.aggregatedCodeCoverage -} - diff --git a/code-coverage/build.gradle.kts b/code-coverage/build.gradle.kts new file mode 100644 index 00000000..4aa9bd28 --- /dev/null +++ b/code-coverage/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("base") + id("tegral.coverage-aggregator") +} + +repositories { + mavenCentral() +} + +dependencies { + for (projectPath in gradle.extra["testProjects"] as List<*>) { + aggregatedProjects(project(projectPath.toString())) + } +} + +tasks.named("check") { + dependsOn(tasks["aggregatedCodeCoverage"]) +} + diff --git a/docs/build.gradle b/docs/build.gradle deleted file mode 100644 index f33fbdce..00000000 --- a/docs/build.gradle +++ /dev/null @@ -1,78 +0,0 @@ -plugins { - id 'com.github.node-gradle.node' - id 'base' -} - -configurations { - web { - canBeConsumed = true - canBeResolved = true - } -} - -def docsInputFiles = [ - 'babel.config.js', - 'docusaurus.config.ts', - 'sidebars.js' -] - -def docsInputDirs = [ - 'blog', - 'docs', - 'src', - 'static' -] - -task cleanNodeModules { - doLast { - delete 'node_modules' - } -} - -task docusaurusStart(type: PnpmTask) { - args = [ 'start' ] - - inputs.file('package.json') - inputs.file('pnpm-lock.yaml') - - for (input in docsInputFiles) { - inputs.file(input) - } - for (input in docsInputDirs) { - inputs.files(input) - } -} - -task docusaurusBuild(type: PnpmTask) { - args = [ - 'build' - ] - - inputs.file('package.json') - .withPropertyName("packageJson") - .withPathSensitivity(PathSensitivity.RELATIVE) - inputs.file('pnpm-lock.yaml') - .withPropertyName("pnpmLock") - .withPathSensitivity(PathSensitivity.RELATIVE) - - for (input in docsInputFiles) { - inputs.file(input) - .withPropertyName("docsFile-" + input) - .withPathSensitivity(PathSensitivity.RELATIVE) - } - for (input in docsInputDirs) { - inputs.dir(input) - .withPropertyName("docsDir-" + input) - .withPathSensitivity(PathSensitivity.RELATIVE) - } - - outputs.cacheIf { true } - outputs.dir(layout.buildDirectory.dir('docusaurus')) - .withPropertyName("result") -} - -artifacts { - web(layout.buildDirectory.dir("docusaurus")) { - builtBy docusaurusBuild - } -} diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts new file mode 100644 index 00000000..5a20514c --- /dev/null +++ b/docs/build.gradle.kts @@ -0,0 +1,78 @@ +import com.github.gradle.node.pnpm.task.PnpmTask + +plugins { + id("com.github.node-gradle.node") + id("base") +} + +val web by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false +} + + +val docsInputFiles = listOf( + "babel.config.js", + "docusaurus.config.ts", + "sidebars.js" +) + +val docsInputDirs = listOf( + "blog", + "docs", + "src", + "static" +) + +tasks.register("cleanNodeModules") { + doLast { + delete("node_modules") + } +} + +tasks.register("docusaurusStart") { + args = listOf("start") + + inputs.file("package.json") + inputs.file("pnpm-lock.yaml") + + for (input in docsInputFiles) { + inputs.file(input) + } + for (input in docsInputDirs) { + inputs.files(input) + } +} + +val docusaurusBuild = tasks.register("docusaurusBuild") { + args = listOf( + "build" + ) + + inputs.file("package.json") + .withPropertyName("packageJson") + .withPathSensitivity(PathSensitivity.RELATIVE) + inputs.file("pnpm-lock.yaml") + .withPropertyName("pnpmLock") + .withPathSensitivity(PathSensitivity.RELATIVE) + + for (input in docsInputFiles) { + inputs.file(input) + .withPropertyName("docsFile-$input") + .withPathSensitivity(PathSensitivity.RELATIVE) + } + for (input in docsInputDirs) { + inputs.dir(input) + .withPropertyName("docsDir-$input") + .withPathSensitivity(PathSensitivity.RELATIVE) + } + + outputs.dir(layout.buildDirectory.dir("docusaurus")) + .withPropertyName("result") +} + +artifacts { + add("web", layout.buildDirectory.dir("docusaurus")) { + builtBy(docusaurusBuild) + } +} diff --git a/dokka/build.gradle b/dokka/build.gradle deleted file mode 100644 index 188e8ade..00000000 --- a/dokka/build.gradle +++ /dev/null @@ -1,32 +0,0 @@ -plugins { - id "dev.adamko.dokkatoo" -} - -repositories { - mavenCentral() -} - -configurations { - dokkaHtml { - canBeConsumed = true - canBeResolved = false - } -} - -dokkatoo { - moduleName = "Tegral API reference" -} - -version = rootProject.version - -dependencies { - for (projectPath in gradle.ext.publicProjects) { - dokkatoo project(projectPath) - } -} - -artifacts { - dokkaHtml(tasks.dokkatooGeneratePublicationHtml.outputDirectory) { - builtBy(tasks.dokkatooGeneratePublicationHtml) - } -} \ No newline at end of file diff --git a/dokka/build.gradle.kts b/dokka/build.gradle.kts new file mode 100644 index 00000000..a948e65f --- /dev/null +++ b/dokka/build.gradle.kts @@ -0,0 +1,32 @@ +import dev.adamko.dokkatoo.tasks.DokkatooGeneratePublicationTask + +plugins { + id("dev.adamko.dokkatoo") +} + +repositories { + mavenCentral() +} + +val dokkaHtml by configurations.creating { + isCanBeConsumed = true + isCanBeResolved = false +} + +dokkatoo { + moduleName = "Tegral API reference" +} + +version = rootProject.version + +dependencies { + for (projectPath in gradle.extra["publicProjects"] as List<*>) { + dokkatoo(project(projectPath.toString())) + } +} + +artifacts { + add("dokkaHtml", tasks.named("dokkatooGeneratePublicationHtml").map { it.outputDirectory }) { + builtBy(tasks.named("dokkatooGeneratePublicationHtml")) + } +} \ No newline at end of file diff --git a/e2e-tests/fundef-modules/build.gradle b/e2e-tests/fundef-modules/build.gradle deleted file mode 100644 index 8650bf87..00000000 --- a/e2e-tests/fundef-modules/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' - id 'application' -} - -dependencies { - implementation project(":tegral-web:tegral-web-appdsl") - implementation project(":tegral-openapi:tegral-openapi-feature") - - testImplementation project(":tegral-di:tegral-di-test") - testImplementation project(":tegral-web:tegral-web-apptest") - testImplementation project(":tegral-di:tegral-di-test-mockk") -} diff --git a/e2e-tests/fundef-modules/build.gradle.kts b/e2e-tests/fundef-modules/build.gradle.kts new file mode 100644 index 00000000..2cadfdc6 --- /dev/null +++ b/e2e-tests/fundef-modules/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("tegral.kotlin-common-conventions") + id("application") +} + +dependencies { + implementation(project(":tegral-web:tegral-web-appdsl")) + implementation(project(":tegral-openapi:tegral-openapi-feature")) + + testImplementation(project(":tegral-di:tegral-di-test")) + testImplementation(project(":tegral-web:tegral-web-apptest")) + testImplementation(project(":tegral-di:tegral-di-test-mockk")) +} diff --git a/e2e-tests/run-with-java-11/build.gradle b/e2e-tests/run-with-java-11/build.gradle deleted file mode 100644 index 603ffeae..00000000 --- a/e2e-tests/run-with-java-11/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' -} - -dependencies { - implementation project(":tegral-di:tegral-di-core") -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(11) - } -} - diff --git a/e2e-tests/run-with-java-11/build.gradle.kts b/e2e-tests/run-with-java-11/build.gradle.kts new file mode 100644 index 00000000..c3764bd6 --- /dev/null +++ b/e2e-tests/run-with-java-11/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("tegral.kotlin-common-conventions") +} + +dependencies { + implementation(project(":tegral-di:tegral-di-core")) +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM + } +} + diff --git a/e2e-tests/run-with-java-17/build.gradle b/e2e-tests/run-with-java-17/build.gradle deleted file mode 100644 index 90b74254..00000000 --- a/e2e-tests/run-with-java-17/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' -} - -dependencies { - implementation project(":tegral-di:tegral-di-core") -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} diff --git a/e2e-tests/run-with-java-17/build.gradle.kts b/e2e-tests/run-with-java-17/build.gradle.kts new file mode 100644 index 00000000..3a99278c --- /dev/null +++ b/e2e-tests/run-with-java-17/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("tegral.kotlin-common-conventions") +} + +dependencies { + implementation(project(":tegral-di:tegral-di-core")) +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + vendor = JvmVendorSpec.ADOPTIUM + } +} diff --git a/e2e-tests/run-without-config/build.gradle b/e2e-tests/run-without-config/build.gradle deleted file mode 100644 index 05dbb5e8..00000000 --- a/e2e-tests/run-without-config/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' -} - -dependencies { - testImplementation project(":tegral-web:tegral-web-appdsl") - testImplementation libs.ktor.client.java -} - -java { - toolchain { - languageVersion = JavaLanguageVersion.of(17) - } -} - diff --git a/e2e-tests/run-without-config/build.gradle.kts b/e2e-tests/run-without-config/build.gradle.kts new file mode 100644 index 00000000..544b6542 --- /dev/null +++ b/e2e-tests/run-without-config/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("tegral.kotlin-common-conventions") +} + +dependencies { + testImplementation(project(":tegral-web:tegral-web-appdsl")) + testImplementation(libs.ktor.client.java) +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(17) + } +} + diff --git a/examples/simple-json-api/build.gradle b/examples/simple-json-api/build.gradle deleted file mode 100644 index 86cc57b0..00000000 --- a/examples/simple-json-api/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' - id 'application' -} - -dependencies { - implementation project(":tegral-core") - implementation project(":tegral-web:tegral-web-appdsl") - implementation project(":tegral-openapi:tegral-openapi-feature") - - testImplementation project(":tegral-di:tegral-di-test") - testImplementation project(":tegral-di:tegral-di-test-mockk") - testImplementation project(":tegral-web:tegral-web-controllers-test") - testImplementation project(":tegral-web:tegral-web-apptest") -} - -application { - mainClass = "guru.zoroark.tegral.examples.simplejsonapi.AppKt" -} diff --git a/examples/simple-json-api/build.gradle.kts b/examples/simple-json-api/build.gradle.kts new file mode 100644 index 00000000..421533ce --- /dev/null +++ b/examples/simple-json-api/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("tegral.kotlin-common-conventions") + id("application") +} + +dependencies { + implementation(project(":tegral-core")) + implementation(project(":tegral-web:tegral-web-appdsl")) + implementation(project(":tegral-openapi:tegral-openapi-feature")) + + testImplementation(project(":tegral-di:tegral-di-test")) + testImplementation(project(":tegral-di:tegral-di-test-mockk")) + testImplementation(project(":tegral-web:tegral-web-controllers-test")) + testImplementation(project(":tegral-web:tegral-web-apptest")) +} + +application { + mainClass = "guru.zoroark.tegral.examples.simplejsonapi.AppKt" +} diff --git a/examples/tutorial/step-1/app/build.gradle b/examples/tutorial/step-1/app/build.gradle index 3cac7f46..827f43bc 100644 --- a/examples/tutorial/step-1/app/build.gradle +++ b/examples/tutorial/step-1/app/build.gradle @@ -30,8 +30,9 @@ application { mainClass = 'org.example.tegraltutorial.AppKt' } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = '11' +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM } } diff --git a/examples/tutorial/step-2/app/build.gradle b/examples/tutorial/step-2/app/build.gradle index b72fa828..0245aac9 100644 --- a/examples/tutorial/step-2/app/build.gradle +++ b/examples/tutorial/step-2/app/build.gradle @@ -32,8 +32,9 @@ application { mainClass = 'org.example.tegraltutorial.AppKt' } -tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach { - kotlinOptions { - jvmTarget = '11' +java { + toolchain { + languageVersion = JavaLanguageVersion.of(11) + vendor = JvmVendorSpec.ADOPTIUM } } diff --git a/gradle.properties b/gradle.properties index 79083718..cacc8d79 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,2 +1,3 @@ org.gradle.parallel=true +org.gradle.configuration-cache=true org.gradle.jvmargs=-XX:MaxMetaspaceSize=1024m diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index c120f54e..e2ef0dae 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -15,7 +15,7 @@ mockk = "1.13.13" nodeGradle = "7.1.0" slf4j = "2.0.16" versions = "0.51.0" -licenserPlugin = "0.6.1" +licenserPlugin = "2.0.0" swaggerCore = "2.2.25" swaggerUi = "5.17.14" clikt = "5.0.1" @@ -111,5 +111,5 @@ versions = { id = "com.github.ben-manes.versions", version.ref = "versions" } gradleTestLogger = { id = "com.adarshr.test-logger", version.ref = "gradleTestLogger" } kotlinBcv = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "kotlinBcv" } nodeGradle = { id = "com.github.node-gradle.node", version.ref = "nodeGradle" } -licenser = { id = "org.cadixdev.licenser", version.ref = "licenserPlugin" } +licenser = { id = "dev.yumi.gradle.licenser", version.ref = "licenserPlugin" } shadow = { id = "com.gradleup.shadow", version.ref = "shadow" } diff --git a/settings.gradle b/settings.gradle deleted file mode 100644 index 9d011d6f..00000000 --- a/settings.gradle +++ /dev/null @@ -1,73 +0,0 @@ -plugins { - id "com.gradle.enterprise" version "3.12.2" -} - -def publicProjects = [ - ':tegral-catalog', - ':tegral-config:tegral-config-core', - ':tegral-core', - ':tegral-di:tegral-di-core', - ':tegral-di:tegral-di-services', - ':tegral-di:tegral-di-test', - ':tegral-di:tegral-di-test-mockk', - ':tegral-featureful', - ':tegral-logging', - ':tegral-niwen:tegral-niwen-lexer', - ':tegral-niwen:tegral-niwen-parser', - ':tegral-openapi:tegral-openapi-cli', - ':tegral-openapi:tegral-openapi-dsl', - ':tegral-openapi:tegral-openapi-feature', - ':tegral-openapi:tegral-openapi-ktor', - ':tegral-openapi:tegral-openapi-ktor-resources', - ':tegral-openapi:tegral-openapi-ktorui', - ':tegral-openapi:tegral-openapi-scriptdef', - ':tegral-openapi:tegral-openapi-scripthost', - ':tegral-prismakt:tegral-prismakt-generator', - ':tegral-services:tegral-services-api', - ':tegral-services:tegral-services-feature', - ':tegral-utils:tegral-utils-logtools', - ':tegral-web:tegral-web-appdefaults', - ':tegral-web:tegral-web-appdsl', - ':tegral-web:tegral-web-apptest', - ':tegral-web:tegral-web-config', - ':tegral-web:tegral-web-controllers', - ':tegral-web:tegral-web-controllers-test', - ':tegral-web:tegral-web-greeter', -] - -def testProjects = publicProjects - ":tegral-catalog" + [ - ':tegral-prismakt:tegral-prismakt-generator-tests:mysql-types', - ':tegral-prismakt:tegral-prismakt-generator-tests:pgsql-types', - ':tegral-prismakt:tegral-prismakt-generator-tests:simple-dao', - ':tegral-prismakt:tegral-prismakt-generator-tests:simple-sql', - ':tegral-prismakt:tegral-prismakt-generator-tests-support', - ':e2e-tests:fundef-modules', - ':e2e-tests:run-with-java-11', - ':e2e-tests:run-with-java-17', - ':e2e-tests:run-without-config' -] - -gradle.ext.publicProjects = publicProjects -gradle.ext.testProjects = testProjects - -for (project in publicProjects) { - include project -} -for (project in testProjects) { - include project -} - - -include 'examples:simple-json-api' - -include 'code-coverage' -include 'docs' -include 'dokka' -include 'website' - -gradleEnterprise { - buildScan { - termsOfServiceUrl = "https://gradle.com/terms-of-service" - termsOfServiceAgree = "yes" - } -} diff --git a/settings.gradle.kts b/settings.gradle.kts new file mode 100644 index 00000000..9dae7015 --- /dev/null +++ b/settings.gradle.kts @@ -0,0 +1,76 @@ +plugins { + id("com.gradle.enterprise") version "3.12.2" + id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" +} + +enableFeaturePreview("STABLE_CONFIGURATION_CACHE") + +val publicProjects = listOf( + ":tegral-catalog", + ":tegral-config:tegral-config-core", + ":tegral-core", + ":tegral-di:tegral-di-core", + ":tegral-di:tegral-di-services", + ":tegral-di:tegral-di-test", + ":tegral-di:tegral-di-test-mockk", + ":tegral-featureful", + ":tegral-logging", + ":tegral-niwen:tegral-niwen-lexer", + ":tegral-niwen:tegral-niwen-parser", + ":tegral-openapi:tegral-openapi-cli", + ":tegral-openapi:tegral-openapi-dsl", + ":tegral-openapi:tegral-openapi-feature", + ":tegral-openapi:tegral-openapi-ktor", + ":tegral-openapi:tegral-openapi-ktor-resources", + ":tegral-openapi:tegral-openapi-ktorui", + ":tegral-openapi:tegral-openapi-scriptdef", + ":tegral-openapi:tegral-openapi-scripthost", + ":tegral-prismakt:tegral-prismakt-generator", + ":tegral-services:tegral-services-api", + ":tegral-services:tegral-services-feature", + ":tegral-utils:tegral-utils-logtools", + ":tegral-web:tegral-web-appdefaults", + ":tegral-web:tegral-web-appdsl", + ":tegral-web:tegral-web-apptest", + ":tegral-web:tegral-web-config", + ":tegral-web:tegral-web-controllers", + ":tegral-web:tegral-web-controllers-test", + ":tegral-web:tegral-web-greeter", +) + +val testProjects = publicProjects - ":tegral-catalog" + listOf( + ":tegral-prismakt:tegral-prismakt-generator-tests:mysql-types", + ":tegral-prismakt:tegral-prismakt-generator-tests:pgsql-types", + ":tegral-prismakt:tegral-prismakt-generator-tests:simple-dao", + ":tegral-prismakt:tegral-prismakt-generator-tests:simple-sql", + ":tegral-prismakt:tegral-prismakt-generator-tests-support", + ":e2e-tests:fundef-modules", + ":e2e-tests:run-with-java-11", + ":e2e-tests:run-with-java-17", + ":e2e-tests:run-without-config" +) + +gradle.extra["publicProjects"] = publicProjects +gradle.extra["testProjects"] = testProjects + +for (project in publicProjects) { + include(project) +} +for (project in testProjects) { + include(project) +} + + +include("examples:simple-json-api") + +include("code-coverage") +include("docs") +include("dokka") +include("website") + +gradleEnterprise { + buildScan { + termsOfServiceUrl = "https://gradle.com/terms-of-service" + termsOfServiceAgree = "yes" + } +} diff --git a/tegral-catalog/build.gradle b/tegral-catalog/build.gradle deleted file mode 100644 index 58d06d44..00000000 --- a/tegral-catalog/build.gradle +++ /dev/null @@ -1,70 +0,0 @@ -plugins { - id 'version-catalog' - id 'maven-publish' - - id 'guru.zoroark.tegral.base-conventions' - id 'guru.zoroark.tegral.publish-conventions' -} - -def computeLibrariesToInclude() { - def result = new ArrayList>() - def bundles = new HashMap>() - - def projects = rootProject.getSubprojects() - for (project in projects) { - if (project.extensions.extraProperties.properties.getOrDefault('includeInCatalog', false)) { - def name = project.getName() - if (name.startsWith("tegral-")) { - name = name.substring(7) - } - - result.add(new Tuple(name, project.group + ':' + project.name + ':' + project.version)) - - def relevantBundles = project.getProperties().getOrDefault('includeInBundles', []) - for (bundle in relevantBundles) { - if (!bundles.containsKey(bundle)) { - bundles.put(bundle, new ArrayList()) - } - bundles.get(bundle).add(name) - } - } - } - return new Tuple(result, bundles) -} - - -tasks.register("setupVersionCatalog") { - doLast { - catalog { - versionCatalog { - def (exportedLibraries, exportedBundles) = computeLibrariesToInclude() - for (exportedLibrary in exportedLibraries) { - def (name, dependency) = exportedLibrary - library(name, dependency) - } - - print(exportedBundles) - - for (bundleEntry in exportedBundles.entrySet()) { - def bundleName = bundleEntry.getKey() - def bundleLibraries = bundleEntry.getValue() - bundle(bundleName, bundleLibraries) - } - } - } - } -} - -tasks.generateCatalogAsToml.dependsOn(tasks.setupVersionCatalog) - -publishing { - publications { - maven(MavenPublication) { - from components.versionCatalog - } - } -} - -ext.humanName = "Tegral Catalog" -ext.description = "Gradle Versions Catalog that makes it easy to get dependencies from the Tegral project" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/catalog/" diff --git a/tegral-catalog/build.gradle.kts b/tegral-catalog/build.gradle.kts new file mode 100644 index 00000000..8493c5a1 --- /dev/null +++ b/tegral-catalog/build.gradle.kts @@ -0,0 +1,62 @@ +plugins { + id("version-catalog") + id("maven-publish") + + id("tegral.base-conventions") + id("tegral.publish-conventions") +} + +data class LibEntry(val name: String, val artifact: String) +data class ComputedEntries(val libs: MutableList, val bundles: MutableMap>) + +fun computeLibrariesToInclude(): ComputedEntries { + val computedEntries = ComputedEntries(mutableListOf(), mutableMapOf()) + + for (project in rootProject.subprojects) { + val includeInCatalog = project.extra.properties["includeInCatalog"] as? Boolean ?: false + if (includeInCatalog) { + val name = project.name.let { if (it.startsWith("tegral-")) it.substring(7) else it } + + computedEntries.libs.add( + LibEntry( + name, + project.group.toString() + ':' + project.name + ':' + project.version.toString() + ) + ) + + val relevantBundles = + project.extra.properties["includeInBundles"] as? List<*> ?: listOf() + for (bundle in relevantBundles) { + computedEntries.bundles.computeIfAbsent(bundle.toString()) { mutableListOf() }.add(name) + } + } + } + return computedEntries +} + +gradle.projectsEvaluated { + catalog { + versionCatalog { + val (exportedLibraries, exportedBundles) = computeLibrariesToInclude() + for ((name, dependency) in exportedLibraries) { + library(name, dependency) + } + + for ((bundleName, bundleLibraries) in exportedBundles.entries) { + bundle(bundleName, bundleLibraries) + } + } + } +} + +publishing { + publications { + named("maven") { + from(components["versionCatalog"]) + } + } +} + +extra["humanName"] = "Tegral Catalog" +extra["description"] = "Gradle Versions Catalog that makes it easy to get dependencies from the Tegral project" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/catalog/" diff --git a/tegral-config/tegral-config-core/build.gradle b/tegral-config/tegral-config-core/build.gradle deleted file mode 100644 index 68877307..00000000 --- a/tegral-config/tegral-config-core/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api libs.hoplite.toml - api libs.hoplite.yaml - api libs.hoplite.json - implementation libs.jackson.dataformats.toml - - implementation project(":tegral-core") - - testImplementation libs.jimfs -} - -ext.humanName = "Tegral Config Core" -ext.description = "Provides core configuration mechanisms with Hoplite" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/config" diff --git a/tegral-config/tegral-config-core/build.gradle.kts b/tegral-config/tegral-config-core/build.gradle.kts new file mode 100644 index 00000000..d3f7ac1e --- /dev/null +++ b/tegral-config/tegral-config-core/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(libs.hoplite.toml) + api(libs.hoplite.yaml) + api(libs.hoplite.json) + implementation(libs.jackson.dataformats.toml) + + implementation(project(":tegral-core")) + + testImplementation(libs.jimfs) +} + +extra["humanName"] = "Tegral Config Core" +extra["description"] = "Provides core configuration mechanisms with Hoplite" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/config" diff --git a/tegral-core/build.gradle b/tegral-core/build.gradle deleted file mode 100644 index 2c101f3e..00000000 --- a/tegral-core/build.gradle +++ /dev/null @@ -1,24 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.humanName = "Tegral Core" -ext.description = "Contains a few common Tegral classes, annotations and interfaces required by all other Tegral modules" -ext.url = "https://tegral.zoroark.guru/docs/modules/core" - -task generateKotlin(type: Copy) { - def templateContext = [version: project.version] - inputs.properties templateContext - from 'src/template/kotlin' - into "$buildDir/generated/kotlin" - expand templateContext -} - -sourceSets { - main.kotlin.srcDirs += "$buildDir/generated/kotlin" -} - -compileKotlin.dependsOn generateKotlin -checkLicenseMain.dependsOn generateKotlin -dokkatooGenerateModuleHtml.dependsOn generateKotlin -sourcesJar.dependsOn generateKotlin diff --git a/tegral-core/build.gradle.kts b/tegral-core/build.gradle.kts new file mode 100644 index 00000000..1118f3f5 --- /dev/null +++ b/tegral-core/build.gradle.kts @@ -0,0 +1,29 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["humanName"] = "Tegral Core" +extra["description"] = + "Contains a few common Tegral classes, annotations and interfaces required by all other Tegral modules" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core" + +val generateKotlin = tasks.register("generateKotlin") { + val templateContext = mapOf("version" to project.version) + inputs.properties(templateContext) + from("src/template/kotlin") + into(layout.buildDirectory.dir("generated/kotlin")) + expand(templateContext) +} + +sourceSets { + main { + kotlin { + srcDir(layout.buildDirectory.dir("generated/kotlin")) + } + } +} + +tasks.named("compileKotlin") { dependsOn(generateKotlin) } +tasks.named("checkLicenseMain") { dependsOn(generateKotlin) } +tasks.named("dokkatooGenerateModuleHtml") { dependsOn(generateKotlin) } +tasks.named("sourcesJar") { dependsOn(generateKotlin) } diff --git a/tegral-di/tegral-di-core/build.gradle b/tegral-di/tegral-di-core/build.gradle deleted file mode 100644 index 749f79c4..00000000 --- a/tegral-di/tegral-di-core/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-core") - implementation libs.kotlin.reflect - - testImplementation project(":tegral-di:tegral-di-test") -} - -ext.humanName = "Tegral DI Core" -ext.description = "Main Tegral DI module for use in main source code -- dependency injection framework for Kotlin." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/di" diff --git a/tegral-di/tegral-di-core/build.gradle.kts b/tegral-di/tegral-di-core/build.gradle.kts new file mode 100644 index 00000000..8f3b4360 --- /dev/null +++ b/tegral-di/tegral-di-core/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-core")) + implementation(libs.kotlin.reflect) + + testImplementation(project(":tegral-di:tegral-di-test")) +} + +extra["humanName"] = "Tegral DI Core" +extra["description"] = "Main Tegral DI module for use in main source code -- dependency injection framework for Kotlin." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/di" diff --git a/tegral-di/tegral-di-services/build.gradle b/tegral-di/tegral-di-services/build.gradle deleted file mode 100644 index d50b0647..00000000 --- a/tegral-di/tegral-di-services/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - implementation project(":tegral-di:tegral-di-core") - implementation libs.kotlin.reflect - implementation libs.kotlin.coroutines - api project(":tegral-services:tegral-services-api") -} - -ext.humanName = "Tegral DI Services" -ext.description = "Extension for Tegral DI that provides necessary tooling and hooks for integrating Tegral Services in a Tegral DI environment." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/di/extensions/services" diff --git a/tegral-di/tegral-di-services/build.gradle.kts b/tegral-di/tegral-di-services/build.gradle.kts new file mode 100644 index 00000000..8e77dd65 --- /dev/null +++ b/tegral-di/tegral-di-services/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + implementation(project(":tegral-di:tegral-di-core")) + implementation(libs.kotlin.reflect) + implementation(libs.kotlin.coroutines) + api(project(":tegral-services:tegral-services-api")) +} + +extra["humanName"] = "Tegral DI Services" +extra["description"] = "Extension for Tegral DI that provides necessary tooling and hooks for integrating Tegral Services in a Tegral DI environment." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/di/extensions/services" diff --git a/tegral-di/tegral-di-test-mockk/build.gradle b/tegral-di/tegral-di-test-mockk/build.gradle deleted file mode 100644 index 061eba30..00000000 --- a/tegral-di/tegral-di-test-mockk/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.includeInBundles = ["web-test"] - -dependencies { - api project(":tegral-di:tegral-di-test") - api libs.mockk -} - -ext.humanName = "Tegral DI Test MockK" -ext.description = "Provides integration between Tegral DI and MockK for test code." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/di/testing" diff --git a/tegral-di/tegral-di-test-mockk/build.gradle.kts b/tegral-di/tegral-di-test-mockk/build.gradle.kts new file mode 100644 index 00000000..b6c87807 --- /dev/null +++ b/tegral-di/tegral-di-test-mockk/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} +extra["includeInBundles"] = listOf("web-test") + +dependencies { + api(project(":tegral-di:tegral-di-test")) + api(libs.mockk) +} + +extra["humanName"] = "Tegral DI Test MockK" +extra["description"] = "Provides integration between Tegral DI and MockK for test code." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/di/testing" diff --git a/tegral-di/tegral-di-test/build.gradle b/tegral-di/tegral-di-test/build.gradle deleted file mode 100644 index 252cf3db..00000000 --- a/tegral-di/tegral-di-test/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.includeInBundles = ["web-test"] - -dependencies { - api project(":tegral-di:tegral-di-core") - implementation libs.kotlin.reflect - api libs.kotlin.test - implementation libs.kotlin.coroutines - - testImplementation libs.mockk -} - -ext.humanName = "Tegral DI Test" -ext.description = "Test utilities for Tegrarl DI-powered applications." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/di/testing/" diff --git a/tegral-di/tegral-di-test/build.gradle.kts b/tegral-di/tegral-di-test/build.gradle.kts new file mode 100644 index 00000000..f6131c71 --- /dev/null +++ b/tegral-di/tegral-di-test/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["includeInBundles"] = listOf("web-test") + +dependencies { + api(project(":tegral-di:tegral-di-core")) + implementation(libs.kotlin.reflect) + api(libs.kotlin.test) + implementation(libs.kotlin.coroutines) + + testImplementation(libs.mockk) +} + +extra["humanName"] = "Tegral DI Test" +extra["description"] = "Test utilities for Tegrarl DI-powered applications." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/di/testing/" diff --git a/tegral-featureful/build.gradle b/tegral-featureful/build.gradle deleted file mode 100644 index 38be1add..00000000 --- a/tegral-featureful/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-di:tegral-di-core") - api project(":tegral-config:tegral-config-core") -} - -ext.humanName = "Tegral Featureful" -ext.description = "Contains common classes for writing Tegral features that will get integrated in main applications." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/featureful" diff --git a/tegral-featureful/build.gradle.kts b/tegral-featureful/build.gradle.kts new file mode 100644 index 00000000..de839e97 --- /dev/null +++ b/tegral-featureful/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-di:tegral-di-core")) + api(project(":tegral-config:tegral-config-core")) +} + +extra["humanName"] = "Tegral Featureful" +extra["description"] = "Contains common classes for writing Tegral features that will get integrated in main applications." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/featureful" diff --git a/tegral-logging/build.gradle b/tegral-logging/build.gradle deleted file mode 100644 index a67b5a95..00000000 --- a/tegral-logging/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-di:tegral-di-core") - api project(":tegral-featureful") - - api libs.slf4j - api libs.logback - implementation libs.kotlin.reflect - - testImplementation libs.jimfs - testImplementation project(":tegral-web:tegral-web-appdsl") -} - -ext.humanName = "Tegral Logging" -ext.description = "Logging feature for Tegral apps that makes it easy to create and manage loggers." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/logging/" diff --git a/tegral-logging/build.gradle.kts b/tegral-logging/build.gradle.kts new file mode 100644 index 00000000..0924d095 --- /dev/null +++ b/tegral-logging/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-di:tegral-di-core")) + api(project(":tegral-featureful")) + + api(libs.slf4j) + api(libs.logback) + implementation(libs.kotlin.reflect) + + testImplementation(libs.jimfs) + testImplementation(project(":tegral-web:tegral-web-appdsl")) +} + +extra["humanName"] = "Tegral Logging" +extra["description"] = "Logging feature for Tegral apps that makes it easy to create and manage loggers." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/logging/" diff --git a/tegral-niwen/tegral-niwen-lexer/build.gradle b/tegral-niwen/tegral-niwen-lexer/build.gradle deleted file mode 100644 index 8d77572d..00000000 --- a/tegral-niwen/tegral-niwen-lexer/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-core") -} - -ext.humanName = "Tegral Niwen Lexer" -ext.description = "Tegral Niwen Lexer is an easy-to-use lexer library for Kotlin" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/niwen/lexer" diff --git a/tegral-niwen/tegral-niwen-lexer/build.gradle.kts b/tegral-niwen/tegral-niwen-lexer/build.gradle.kts new file mode 100644 index 00000000..4bade273 --- /dev/null +++ b/tegral-niwen/tegral-niwen-lexer/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-core")) +} + +extra["humanName"] = "Tegral Niwen Lexer" +extra["description"] = "Tegral Niwen Lexer is an easy-to-use lexer library for Kotlin" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/niwen/lexer" diff --git a/tegral-niwen/tegral-niwen-parser/build.gradle b/tegral-niwen/tegral-niwen-parser/build.gradle deleted file mode 100644 index 042902fa..00000000 --- a/tegral-niwen/tegral-niwen-parser/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-core") - api project(":tegral-niwen:tegral-niwen-lexer") - api libs.kotlin.reflect - - implementation libs.jackson.kotlin - implementation libs.jackson.dataformats.yaml -} - -ext.humanName = "Tegral Niwen Parser" -ext.description = "Tegral Niwen Parser is an easy-to-use parser library for Kotlin" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/niwen/parser" diff --git a/tegral-niwen/tegral-niwen-parser/build.gradle.kts b/tegral-niwen/tegral-niwen-parser/build.gradle.kts new file mode 100644 index 00000000..12d24f07 --- /dev/null +++ b/tegral-niwen/tegral-niwen-parser/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-core")) + api(project(":tegral-niwen:tegral-niwen-lexer")) + api(libs.kotlin.reflect) + + implementation(libs.jackson.kotlin) + implementation(libs.jackson.dataformats.yaml) +} + +extra["humanName"] = "Tegral Niwen Parser" +extra["description"] = "Tegral Niwen Parser is an easy-to-use parser library for Kotlin" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/niwen/parser" diff --git a/tegral-openapi/tegral-openapi-cli/build.gradle b/tegral-openapi/tegral-openapi-cli/build.gradle deleted file mode 100644 index debe5622..00000000 --- a/tegral-openapi/tegral-openapi-cli/build.gradle +++ /dev/null @@ -1,28 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' - id 'application' -} - -dependencies { - implementation project(":tegral-openapi:tegral-openapi-scripthost") - implementation project(":tegral-utils:tegral-utils-logtools") - implementation libs.clikt - implementation libs.kotlin.coroutines - implementation libs.logback - - testImplementation libs.jimfs -} - -application { - mainClass = "guru.zoroark.tegral.openapi.cli.MainKt" -} - -ext.humanName = "Tegral OpenAPI CLI" -ext.description = "A handy companion for working with .openapi.kts files." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/cli" - -jar { - manifest { - attributes.put("Main-Class", "guru.zoroark.tegral.openapi.cli.MainKt") - } -} diff --git a/tegral-openapi/tegral-openapi-cli/build.gradle.kts b/tegral-openapi/tegral-openapi-cli/build.gradle.kts new file mode 100644 index 00000000..51944593 --- /dev/null +++ b/tegral-openapi/tegral-openapi-cli/build.gradle.kts @@ -0,0 +1,28 @@ +plugins { + id("tegral.kotlin-published-library-conventions") + id("application") +} + +dependencies { + implementation(project(":tegral-openapi:tegral-openapi-scripthost")) + implementation(project(":tegral-utils:tegral-utils-logtools")) + implementation(libs.clikt) + implementation(libs.kotlin.coroutines) + implementation(libs.logback) + + testImplementation(libs.jimfs) +} + +application { + mainClass = "guru.zoroark.tegral.openapi.cli.MainKt" +} + +extra["humanName"] = "Tegral OpenAPI CLI" +extra["description"] = "A handy companion for working with .openapi.kts files." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/cli" + +tasks.named("jar") { + manifest { + attributes["Main-Class"] = "guru.zoroark.tegral.openapi.cli.MainKt" + } +} diff --git a/tegral-openapi/tegral-openapi-dsl/build.gradle b/tegral-openapi/tegral-openapi-dsl/build.gradle deleted file mode 100644 index 3dba864e..00000000 --- a/tegral-openapi/tegral-openapi-dsl/build.gradle +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api libs.swaggerCore.models - api libs.swaggerCore.core - implementation project(":tegral-core") -} - -ext.humanName = "Tegral OpenAPI DSL" -ext.description = "Provides a DSL for creating OpenAPI 3 documents." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/dsl" - -license { - exclude 'petstore-simple.openapi.yaml' -} diff --git a/tegral-openapi/tegral-openapi-dsl/build.gradle.kts b/tegral-openapi/tegral-openapi-dsl/build.gradle.kts new file mode 100644 index 00000000..6bf0ab9b --- /dev/null +++ b/tegral-openapi/tegral-openapi-dsl/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(libs.swaggerCore.models) + api(libs.swaggerCore.core) + implementation(project(":tegral-core")) +} + +extra["humanName"] = "Tegral OpenAPI DSL" +extra["description"] = "Provides a DSL for creating OpenAPI 3 documents." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/dsl" + +license { + exclude("petstore-simple.openapi.yaml") +} diff --git a/tegral-openapi/tegral-openapi-feature/build.gradle b/tegral-openapi/tegral-openapi-feature/build.gradle deleted file mode 100644 index 7a515b87..00000000 --- a/tegral-openapi/tegral-openapi-feature/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-openapi:tegral-openapi-dsl") - api project(":tegral-openapi:tegral-openapi-ktor") - api project(":tegral-openapi:tegral-openapi-ktorui") - implementation project(":tegral-logging") - implementation project(":tegral-web:tegral-web-controllers") - implementation project(":tegral-featureful") - - testImplementation libs.ktor.server.test -} - -ext.humanName = "Tegral OpenAPI Feature" -ext.description = "Tegral Web feature for OpenAPI integration into your Tegral applications" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/tegral-web" diff --git a/tegral-openapi/tegral-openapi-feature/build.gradle.kts b/tegral-openapi/tegral-openapi-feature/build.gradle.kts new file mode 100644 index 00000000..259ae5b8 --- /dev/null +++ b/tegral-openapi/tegral-openapi-feature/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-openapi:tegral-openapi-dsl")) + api(project(":tegral-openapi:tegral-openapi-ktor")) + api(project(":tegral-openapi:tegral-openapi-ktorui")) + implementation(project(":tegral-logging")) + implementation(project(":tegral-web:tegral-web-controllers")) + implementation(project(":tegral-featureful")) + + testImplementation(libs.ktor.server.test) +} + +extra["humanName"] = "Tegral OpenAPI Feature" +extra["description"] = "Tegral Web feature for OpenAPI integration into your Tegral applications" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/tegral-web" diff --git a/tegral-openapi/tegral-openapi-ktor-resources/build.gradle b/tegral-openapi/tegral-openapi-ktor-resources/build.gradle deleted file mode 100644 index 81cebf50..00000000 --- a/tegral-openapi/tegral-openapi-ktor-resources/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' - - id 'org.jetbrains.kotlin.plugin.serialization' -} - -dependencies { - api project(":tegral-openapi:tegral-openapi-dsl") - api project(":tegral-openapi:tegral-openapi-ktor") - implementation project(":tegral-core") - - api libs.ktor.server.resources - implementation libs.kotlin.reflect - - testImplementation libs.ktor.server.test -} - -ext.humanName = "Tegral OpenAPI Ktor Resources" -ext.description = "Easily create OpenAPI documentation for your Ktor application using Tegral OpenApi Ktor alongisde the Resources plug-in!" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-ktor-resources/build.gradle.kts b/tegral-openapi/tegral-openapi-ktor-resources/build.gradle.kts new file mode 100644 index 00000000..c05d90f4 --- /dev/null +++ b/tegral-openapi/tegral-openapi-ktor-resources/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + id("tegral.kotlin-published-library-conventions") + + id("org.jetbrains.kotlin.plugin.serialization") +} + +dependencies { + api(project(":tegral-openapi:tegral-openapi-dsl")) + api(project(":tegral-openapi:tegral-openapi-ktor")) + implementation(project(":tegral-core")) + + api(libs.ktor.server.resources) + implementation(libs.kotlin.reflect) + + testImplementation(libs.ktor.server.test) +} + +extra["humanName"] = "Tegral OpenAPI Ktor Resources" +extra["description"] = "Easily create OpenAPI documentation for your Ktor application using Tegral OpenApi Ktor alongisde the Resources plug-in!" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-ktor/build.gradle b/tegral-openapi/tegral-openapi-ktor/build.gradle deleted file mode 100644 index 6512d27b..00000000 --- a/tegral-openapi/tegral-openapi-ktor/build.gradle +++ /dev/null @@ -1,16 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-openapi:tegral-openapi-dsl") - implementation project(":tegral-core") - - api libs.ktor.server.core - - testImplementation libs.ktor.server.test -} - -ext.humanName = "Tegral OpenAPI Ktor" -ext.description = "Easily create OpenAPI documentation for your Ktor application using Tegral OpenApi Ktor!" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-ktor/build.gradle.kts b/tegral-openapi/tegral-openapi-ktor/build.gradle.kts new file mode 100644 index 00000000..384aad6d --- /dev/null +++ b/tegral-openapi/tegral-openapi-ktor/build.gradle.kts @@ -0,0 +1,16 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-openapi:tegral-openapi-dsl")) + implementation(project(":tegral-core")) + + api(libs.ktor.server.core) + + testImplementation(libs.ktor.server.test) +} + +extra["humanName"] = "Tegral OpenAPI Ktor" +extra["description"] = "Easily create OpenAPI documentation for your Ktor application using Tegral OpenApi Ktor!" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-ktorui/build.gradle b/tegral-openapi/tegral-openapi-ktorui/build.gradle deleted file mode 100644 index c2b254dc..00000000 --- a/tegral-openapi/tegral-openapi-ktorui/build.gradle +++ /dev/null @@ -1,14 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - implementation libs.swaggerUi - implementation libs.ktor.server.core - - testImplementation libs.ktor.server.test -} - -ext.humanName = "Tegral OpenAPI Ktor UI" -ext.description = "Integrates Swagger UI with Ktor." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-ktorui/build.gradle.kts b/tegral-openapi/tegral-openapi-ktorui/build.gradle.kts new file mode 100644 index 00000000..66f4694f --- /dev/null +++ b/tegral-openapi/tegral-openapi-ktorui/build.gradle.kts @@ -0,0 +1,14 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + implementation(libs.swaggerUi) + implementation(libs.ktor.server.core) + + testImplementation(libs.ktor.server.test) +} + +extra["humanName"] = "Tegral OpenAPI Ktor UI" +extra["description"] = "Integrates Swagger UI with Ktor." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/ktor" diff --git a/tegral-openapi/tegral-openapi-scriptdef/build.gradle b/tegral-openapi/tegral-openapi-scriptdef/build.gradle deleted file mode 100644 index 0e9b498d..00000000 --- a/tegral-openapi/tegral-openapi-scriptdef/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-openapi:tegral-openapi-dsl") - implementation libs.kotlin.scripting.common - implementation libs.kotlin.scripting.jvm -} - -ext.humanName = "Tegral OpenAPI Script (definitions)" -ext.description = "Kotlin Scripting definitions for Tegral OpenAPI files (.openapi.kts)." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/scripting" diff --git a/tegral-openapi/tegral-openapi-scriptdef/build.gradle.kts b/tegral-openapi/tegral-openapi-scriptdef/build.gradle.kts new file mode 100644 index 00000000..0ea23d43 --- /dev/null +++ b/tegral-openapi/tegral-openapi-scriptdef/build.gradle.kts @@ -0,0 +1,13 @@ +plugins { + id ("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-openapi:tegral-openapi-dsl")) + implementation(libs.kotlin.scripting.common) + implementation(libs.kotlin.scripting.jvm) +} + +extra["humanName"] = "Tegral OpenAPI Script (definitions)" +extra["description"] = "Kotlin Scripting definitions for Tegral OpenAPI files (.openapi.kts)." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/scripting" diff --git a/tegral-openapi/tegral-openapi-scripthost/build.gradle b/tegral-openapi/tegral-openapi-scripthost/build.gradle deleted file mode 100644 index 77c59278..00000000 --- a/tegral-openapi/tegral-openapi-scripthost/build.gradle +++ /dev/null @@ -1,19 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-core") - api project(":tegral-openapi:tegral-openapi-dsl") - api project(":tegral-openapi:tegral-openapi-scriptdef") - api libs.kotlin.scripting.common - api libs.kotlin.scripting.jvm - api libs.kotlin.scripting.jvmHost - - testImplementation libs.jimfs - testImplementation libs.kotlin.coroutines -} - -ext.humanName = "Tegral OpenAPI Script (host)" -ext.description = "Host for Tegral OpenAPI scripts. Allows you to compilet .openapi.kts files right from your application." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/openapi/scripting" diff --git a/tegral-openapi/tegral-openapi-scripthost/build.gradle.kts b/tegral-openapi/tegral-openapi-scripthost/build.gradle.kts new file mode 100644 index 00000000..b6a0c6c2 --- /dev/null +++ b/tegral-openapi/tegral-openapi-scripthost/build.gradle.kts @@ -0,0 +1,19 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-core")) + api(project(":tegral-openapi:tegral-openapi-dsl")) + api(project(":tegral-openapi:tegral-openapi-scriptdef")) + api(libs.kotlin.scripting.common) + api(libs.kotlin.scripting.jvm) + api(libs.kotlin.scripting.jvmHost) + + testImplementation(libs.jimfs) + testImplementation(libs.kotlin.coroutines) +} + +extra["humanName"] = "Tegral OpenAPI Script (host)" +extra["description"] = "Host for Tegral OpenAPI scripts. Allows you to compilet .openapi.kts files right from your application." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/openapi/scripting" diff --git a/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle b/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle deleted file mode 100644 index a04bd61b..00000000 --- a/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-common-conventions' -} - -dependencies { - implementation libs.commons.lang3 -} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle.kts new file mode 100644 index 00000000..8e801d40 --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator-tests-support/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("tegral.kotlin-common-conventions") +} + +dependencies { + implementation(libs.commons.lang3) +} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests/build.gradle.kts index 3bcc2199..ee338270 100644 --- a/tegral-prismakt/tegral-prismakt-generator-tests/build.gradle.kts +++ b/tegral-prismakt/tegral-prismakt-generator-tests/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("guru.zoroark.tegral.coverage-aggregator") + id("tegral.coverage-aggregator") } dependencies { diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle b/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle deleted file mode 100644 index 223b4b77..00000000 --- a/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.pktg-e2e-test' -} - -dependencies { - generator project(":tegral-prismakt:tegral-prismakt-generator") - - testImplementation libs.testcontainers - testImplementation libs.testcontainers.junit - testImplementation libs.sqlDrivers.mysql -} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle.kts new file mode 100644 index 00000000..862432f3 --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator-tests/mysql-types/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("tegral.pktg-e2e-test") +} + +dependencies { + generator(project(":tegral-prismakt:tegral-prismakt-generator")) + + testImplementation(libs.testcontainers) + testImplementation(libs.testcontainers.junit) + testImplementation(libs.sqlDrivers.mysql) +} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle b/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle deleted file mode 100644 index 0c790c7c..00000000 --- a/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.pktg-e2e-test' -} - -dependencies { - generator project(":tegral-prismakt:tegral-prismakt-generator") - - testImplementation libs.testcontainers - testImplementation libs.testcontainers.junit - testImplementation libs.sqlDrivers.postgresql -} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle.kts new file mode 100644 index 00000000..3f92d05a --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator-tests/pgsql-types/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("tegral.pktg-e2e-test") +} + +dependencies { + generator(project(":tegral-prismakt:tegral-prismakt-generator")) + + testImplementation(libs.testcontainers) + testImplementation(libs.testcontainers.junit) + testImplementation(libs.sqlDrivers.postgresql) +} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle b/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle deleted file mode 100644 index 0cf61e10..00000000 --- a/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.pktg-e2e-test' -} - -dependencies { - generator project(":tegral-prismakt:tegral-prismakt-generator") - - testImplementation libs.commons.lang3 -} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle.kts new file mode 100644 index 00000000..7bff4d41 --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator-tests/simple-dao/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("tegral.pktg-e2e-test") +} + +dependencies { + generator(project(":tegral-prismakt:tegral-prismakt-generator")) + + testImplementation(libs.commons.lang3) +} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle b/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle deleted file mode 100644 index 0cf61e10..00000000 --- a/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle +++ /dev/null @@ -1,9 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.pktg-e2e-test' -} - -dependencies { - generator project(":tegral-prismakt:tegral-prismakt-generator") - - testImplementation libs.commons.lang3 -} diff --git a/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle.kts new file mode 100644 index 00000000..7bff4d41 --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator-tests/simple-sql/build.gradle.kts @@ -0,0 +1,9 @@ +plugins { + id("tegral.pktg-e2e-test") +} + +dependencies { + generator(project(":tegral-prismakt:tegral-prismakt-generator")) + + testImplementation(libs.commons.lang3) +} diff --git a/tegral-prismakt/tegral-prismakt-generator/build.gradle b/tegral-prismakt/tegral-prismakt-generator/build.gradle deleted file mode 100644 index 67cceded..00000000 --- a/tegral-prismakt/tegral-prismakt-generator/build.gradle +++ /dev/null @@ -1,34 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' - id 'application' - id 'com.gradleup.shadow' -} - -dependencies { - implementation project(":tegral-utils:tegral-utils-logtools") - implementation project(":tegral-di:tegral-di-core") - implementation project(":tegral-niwen:tegral-niwen-parser") - implementation project(":tegral-niwen:tegral-niwen-lexer") - implementation libs.logback - implementation libs.jackson.kotlin - implementation libs.exposed.core - implementation libs.exposed.dao - implementation libs.exposed.javatime - implementation libs.kotlinPoet - - testImplementation libs.jimfs -} - -application { - mainClass = "guru.zoroark.tegral.prismakt.generator.MainKt" -} - -ext.humanName = "Tegral PrismaKT Generator" -ext.description = "A Prisma generator for writing JetBrains Exposed tables & entities" -ext.url = "https://tegral.zoroark.guru/docs/modules/core/prismakt" - -jar { - manifest { - attributes.put("Main-Class", "guru.zoroark.tegral.prismakt.generator.MainKt") - } -} diff --git a/tegral-prismakt/tegral-prismakt-generator/build.gradle.kts b/tegral-prismakt/tegral-prismakt-generator/build.gradle.kts new file mode 100644 index 00000000..6021379c --- /dev/null +++ b/tegral-prismakt/tegral-prismakt-generator/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id("tegral.kotlin-published-library-conventions") + id("application") + id("com.gradleup.shadow") +} + +dependencies { + implementation(project(":tegral-utils:tegral-utils-logtools")) + implementation(project(":tegral-di:tegral-di-core")) + implementation(project(":tegral-niwen:tegral-niwen-parser")) + implementation(project(":tegral-niwen:tegral-niwen-lexer")) + implementation(libs.logback) + implementation(libs.jackson.kotlin) + implementation(libs.exposed.core) + implementation(libs.exposed.dao) + implementation(libs.exposed.javatime) + implementation(libs.kotlinPoet) + + testImplementation(libs.jimfs) +} + +application { + mainClass = "guru.zoroark.tegral.prismakt.generator.MainKt" +} + +extra["humanName"] = "Tegral PrismaKT Generator" +extra["description"] = "A Prisma generator for writing JetBrains Exposed tables & entities" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/prismakt" + +tasks.named("jar") { + manifest { + attributes["Main-Class"] = "guru.zoroark.tegral.prismakt.generator.MainKt" + } +} diff --git a/tegral-services/tegral-services-api/build.gradle b/tegral-services/tegral-services-api/build.gradle deleted file mode 100644 index 3a386462..00000000 --- a/tegral-services/tegral-services-api/build.gradle +++ /dev/null @@ -1,7 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.humanName = "Tegral Services API" -ext.description = "API interfaces you can subclass to create services that will be handled by Tegral." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/services/" diff --git a/tegral-services/tegral-services-api/build.gradle.kts b/tegral-services/tegral-services-api/build.gradle.kts new file mode 100644 index 00000000..f6cc9988 --- /dev/null +++ b/tegral-services/tegral-services-api/build.gradle.kts @@ -0,0 +1,7 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["humanName"] = "Tegral Services API" +extra["description"] = "API interfaces you can subclass to create services that will be handled by Tegral." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/services/" diff --git a/tegral-services/tegral-services-feature/build.gradle b/tegral-services/tegral-services-feature/build.gradle deleted file mode 100644 index 3ebcf336..00000000 --- a/tegral-services/tegral-services-feature/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-di:tegral-di-services") - api project(":tegral-featureful") -} - -ext.humanName = "Tegral Services Feature" -ext.description = "Tegral feature used to load, start and manage Tegral services." -ext.url = "https://tegral.zoroark.guru/docs/modules/core/services/" diff --git a/tegral-services/tegral-services-feature/build.gradle.kts b/tegral-services/tegral-services-feature/build.gradle.kts new file mode 100644 index 00000000..5ad765ea --- /dev/null +++ b/tegral-services/tegral-services-feature/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-di:tegral-di-services")) + api(project(":tegral-featureful")) +} + +extra["humanName"] = "Tegral Services Feature" +extra["description"] = "Tegral feature used to load, start and manage Tegral services." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/core/services/" diff --git a/tegral-utils/tegral-utils-logtools/build.gradle b/tegral-utils/tegral-utils-logtools/build.gradle deleted file mode 100644 index d2de451c..00000000 --- a/tegral-utils/tegral-utils-logtools/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api libs.slf4j - api libs.logback -} - -ext.humanName = "Tegral Utils: LogTools" -ext.description = "Various logging utilities for Logback" -ext.url = "https://tegral.zoroark.guru/docs/modules/utils/logtools" // TODO diff --git a/tegral-utils/tegral-utils-logtools/build.gradle.kts b/tegral-utils/tegral-utils-logtools/build.gradle.kts new file mode 100644 index 00000000..ca136ad0 --- /dev/null +++ b/tegral-utils/tegral-utils-logtools/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(libs.slf4j) + api(libs.logback) +} + +extra["humanName"] = "Tegral Utils: LogTools" +extra["description"] = "Various logging utilities for Logback" +extra["url"] = "https://tegral.zoroark.guru/docs/modules/utils/logtools" // TODO diff --git a/tegral-web/tegral-web-appdefaults/build.gradle b/tegral-web/tegral-web-appdefaults/build.gradle deleted file mode 100644 index abe1f20c..00000000 --- a/tegral-web/tegral-web-appdefaults/build.gradle +++ /dev/null @@ -1,20 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-di:tegral-di-core") - api project(":tegral-web:tegral-web-controllers") - api project(":tegral-web:tegral-web-config") - api project(":tegral-web:tegral-web-greeter") - api project(":tegral-logging") - implementation libs.jackson.time - implementation libs.ktor.server.netty - - testImplementation project(":tegral-di:tegral-di-test") - testImplementation project(":tegral-di:tegral-di-test-mockk") -} - -ext.humanName = "Tegral Web AppDefaults" -ext.description = "Provides basic versions of all necessary classes in a Tegral Web environment." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/appdefaults" diff --git a/tegral-web/tegral-web-appdefaults/build.gradle.kts b/tegral-web/tegral-web-appdefaults/build.gradle.kts new file mode 100644 index 00000000..74b69826 --- /dev/null +++ b/tegral-web/tegral-web-appdefaults/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-di:tegral-di-core")) + api(project(":tegral-web:tegral-web-controllers")) + api(project(":tegral-web:tegral-web-config")) + api(project(":tegral-web:tegral-web-greeter")) + api(project(":tegral-logging")) + implementation(libs.jackson.time) + implementation(libs.ktor.server.netty) + + testImplementation(project(":tegral-di:tegral-di-test")) + testImplementation(project(":tegral-di:tegral-di-test-mockk")) +} + +extra["humanName"] = "Tegral Web AppDefaults" +extra["description"] = "Provides basic versions of all necessary classes in a Tegral Web environment." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/appdefaults" diff --git a/tegral-web/tegral-web-appdsl/build.gradle b/tegral-web/tegral-web-appdsl/build.gradle deleted file mode 100644 index 67e210cc..00000000 --- a/tegral-web/tegral-web-appdsl/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.includeInCatalog = true -ext.includeInBundles = ["web"] - -dependencies { - api project(":tegral-di:tegral-di-core") - api project(":tegral-config:tegral-config-core") - api project(":tegral-featureful") - api project(":tegral-web:tegral-web-controllers") - api project(":tegral-web:tegral-web-appdefaults") - - implementation libs.kotlin.stdlib - implementation libs.kotlin.reflect - - testImplementation libs.ktor.client.java -} - -ext.humanName = "Tegral Web AppDSL" -ext.description = "Contains common classes for writing Tegral features that will get integrated in main applications." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/appdsl" diff --git a/tegral-web/tegral-web-appdsl/build.gradle.kts b/tegral-web/tegral-web-appdsl/build.gradle.kts new file mode 100644 index 00000000..c48c87ca --- /dev/null +++ b/tegral-web/tegral-web-appdsl/build.gradle.kts @@ -0,0 +1,22 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["includeInBundles"] = listOf("web") + +dependencies { + api(project(":tegral-di:tegral-di-core")) + api(project(":tegral-config:tegral-config-core")) + api(project(":tegral-featureful")) + api(project(":tegral-web:tegral-web-controllers")) + api(project(":tegral-web:tegral-web-appdefaults")) + + implementation(libs.kotlin.stdlib) + implementation(libs.kotlin.reflect) + + testImplementation(libs.ktor.client.java) +} + +extra["humanName"] = "Tegral Web AppDSL" +extra["description"] = "Contains common classes for writing Tegral features that will get integrated in main applications." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/appdsl" diff --git a/tegral-web/tegral-web-apptest/build.gradle b/tegral-web/tegral-web-apptest/build.gradle deleted file mode 100644 index 4021f5af..00000000 --- a/tegral-web/tegral-web-apptest/build.gradle +++ /dev/null @@ -1,15 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.includeInBundles = ["web-test"] - -dependencies { - api project(":tegral-di:tegral-di-test") - api project(":tegral-web:tegral-web-appdsl") - api project(":tegral-web:tegral-web-controllers-test") -} - -ext.humanName = "Tegral Web AppTest" -ext.description = "Integration testing utilities for Tegral applications." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/apptest" diff --git a/tegral-web/tegral-web-apptest/build.gradle.kts b/tegral-web/tegral-web-apptest/build.gradle.kts new file mode 100644 index 00000000..8d3e3c18 --- /dev/null +++ b/tegral-web/tegral-web-apptest/build.gradle.kts @@ -0,0 +1,15 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["includeInBundles"] = listOf("web-test") + +dependencies { + api(project(":tegral-di:tegral-di-test")) + api(project(":tegral-web:tegral-web-appdsl")) + api(project(":tegral-web:tegral-web-controllers-test")) +} + +extra["humanName"] = "Tegral Web AppTest" +extra["description"] = "Integration testing utilities for Tegral applications." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/apptest" diff --git a/tegral-web/tegral-web-config/build.gradle b/tegral-web/tegral-web-config/build.gradle deleted file mode 100644 index 691b7111..00000000 --- a/tegral-web/tegral-web-config/build.gradle +++ /dev/null @@ -1,11 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-config:tegral-config-core") -} - -ext.humanName = "Tegral Web Config" -ext.description = "Provides the necessary configuration sections for Tegral Web apps." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/config" diff --git a/tegral-web/tegral-web-config/build.gradle.kts b/tegral-web/tegral-web-config/build.gradle.kts new file mode 100644 index 00000000..d841db14 --- /dev/null +++ b/tegral-web/tegral-web-config/build.gradle.kts @@ -0,0 +1,11 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-config:tegral-config-core")) +} + +extra["humanName"] = "Tegral Web Config" +extra["description"] = "Provides the necessary configuration sections for Tegral Web apps." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/config" diff --git a/tegral-web/tegral-web-controllers-test/build.gradle b/tegral-web/tegral-web-controllers-test/build.gradle deleted file mode 100644 index 0f745a0d..00000000 --- a/tegral-web/tegral-web-controllers-test/build.gradle +++ /dev/null @@ -1,18 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -ext.includeInBundles = ["web-test"] - -dependencies { - api project(":tegral-web:tegral-web-controllers") - api project(":tegral-di:tegral-di-test") - api project(":tegral-web:tegral-web-appdefaults") - - api libs.ktor.server.test - api libs.ktor.client.contentNegotiation -} - -ext.humanName = "Tegral Web Controllers Test" -ext.description = "Test classes for testing Tegral Web Controllers classes easily." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/controllers" diff --git a/tegral-web/tegral-web-controllers-test/build.gradle.kts b/tegral-web/tegral-web-controllers-test/build.gradle.kts new file mode 100644 index 00000000..c3719884 --- /dev/null +++ b/tegral-web/tegral-web-controllers-test/build.gradle.kts @@ -0,0 +1,18 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +extra["includeInBundles"] = listOf("web-test") + +dependencies { + api(project(":tegral-web:tegral-web-controllers")) + api(project(":tegral-di:tegral-di-test")) + api(project(":tegral-web:tegral-web-appdefaults")) + + api(libs.ktor.server.test) + api(libs.ktor.client.contentNegotiation) +} + +extra["humanName"] = "Tegral Web Controllers Test" +extra["description"] = "Test classes for testing Tegral Web Controllers classes easily." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/controllers" diff --git a/tegral-web/tegral-web-controllers/build.gradle b/tegral-web/tegral-web-controllers/build.gradle deleted file mode 100644 index 5d4389e0..00000000 --- a/tegral-web/tegral-web-controllers/build.gradle +++ /dev/null @@ -1,23 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - api project(":tegral-di:tegral-di-core") - api project(":tegral-featureful") - api project(":tegral-services:tegral-services-feature") - - implementation libs.ktor.server.core - implementation libs.ktor.server.host - api libs.ktor.server.contentNegotiation - api libs.ktor.serialization.jackson - - testImplementation libs.ktor.server.netty - testImplementation libs.ktor.client.java - testImplementation libs.ktor.client.contentNegotiation - testImplementation libs.logback -} - -ext.humanName = "Tegral Web Controllers" -ext.description = "Provides necessary classes to integrate the Ktor framework into a Tegral Web application." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/controllers" diff --git a/tegral-web/tegral-web-controllers/build.gradle.kts b/tegral-web/tegral-web-controllers/build.gradle.kts new file mode 100644 index 00000000..c62961ab --- /dev/null +++ b/tegral-web/tegral-web-controllers/build.gradle.kts @@ -0,0 +1,23 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + api(project(":tegral-di:tegral-di-core")) + api(project(":tegral-featureful")) + api(project(":tegral-services:tegral-services-feature")) + + implementation(libs.ktor.server.core) + implementation(libs.ktor.server.host) + api(libs.ktor.server.contentNegotiation) + api(libs.ktor.serialization.jackson) + + testImplementation(libs.ktor.server.netty) + testImplementation(libs.ktor.client.java) + testImplementation(libs.ktor.client.contentNegotiation) + testImplementation(libs.logback) +} + +extra["humanName"] = "Tegral Web Controllers" +extra["description"] = "Provides necessary classes to integrate the Ktor framework into a Tegral Web application." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/controllers" diff --git a/tegral-web/tegral-web-greeter/build.gradle b/tegral-web/tegral-web-greeter/build.gradle deleted file mode 100644 index db0613c4..00000000 --- a/tegral-web/tegral-web-greeter/build.gradle +++ /dev/null @@ -1,12 +0,0 @@ -plugins { - id 'guru.zoroark.tegral.kotlin-published-library-conventions' -} - -dependencies { - implementation project(":tegral-featureful") - implementation project(":tegral-logging") -} - -ext.humanName = "Tegral Web Greeter" -ext.description = "A simple feature that displays a message on startup." -ext.url = "https://tegral.zoroark.guru/docs/modules/web/greeter" diff --git a/tegral-web/tegral-web-greeter/build.gradle.kts b/tegral-web/tegral-web-greeter/build.gradle.kts new file mode 100644 index 00000000..6fab58cb --- /dev/null +++ b/tegral-web/tegral-web-greeter/build.gradle.kts @@ -0,0 +1,12 @@ +plugins { + id("tegral.kotlin-published-library-conventions") +} + +dependencies { + implementation(project(":tegral-featureful")) + implementation(project(":tegral-logging")) +} + +extra["humanName"] = "Tegral Web Greeter" +extra["description"] = "A simple feature that displays a message on startup." +extra["url"] = "https://tegral.zoroark.guru/docs/modules/web/greeter" diff --git a/website/build.gradle b/website/build.gradle deleted file mode 100644 index 814a36b0..00000000 --- a/website/build.gradle +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - -} - -repositories { - mavenCentral() - maven { url 'https://gitlab.com/api/v4/projects/29365238/packages/maven' } -} - -configurations { - servine - docusaurus - dokkaHtml -} - -dependencies { - servine 'guru.zoroark.servine:servine:0.0.2-SNAPSHOT' - docusaurus(project(path: ":docs", configuration: 'web')) - dokkaHtml(project(path: ":dokka", configuration: 'dokkaHtml')) - -} - -task assembleFiles(type: Copy) { - into layout.buildDirectory.dir("output") - - from(configurations.docusaurus) - from(configurations.dokkaHtml) { - into 'dokka' - } - from('_redirects') -} - -task serve(type: JavaExec) { - mainClass = "guru.zoroark.servine.app.AppKt" - classpath = configurations.servine - - dependsOn assembleFiles - - def params = [layout.buildDirectory.dir("output").get().toString()] - args(params) -} diff --git a/website/build.gradle.kts b/website/build.gradle.kts new file mode 100644 index 00000000..18da0690 --- /dev/null +++ b/website/build.gradle.kts @@ -0,0 +1,48 @@ +plugins { +} + +repositories { + mavenCentral() + maven { url = uri("https://gitlab.com/api/v4/projects/29365238/packages/maven") } +} + +val servine by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false +} +val docusaurus by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false +} +val dokkaHtml by configurations.creating { + isCanBeResolved = true + isCanBeConsumed = false +} + + +dependencies { + servine("guru.zoroark.servine:servine:0.0.2-SNAPSHOT") + docusaurus(project(path = ":docs", configuration = "web")) + dokkaHtml(project(path = ":dokka", configuration = "dokkaHtml")) + +} + +val assembleFiles = tasks.register("assembleFiles") { + into(layout.buildDirectory.dir("output")) + + from(docusaurus) + from(dokkaHtml) { + into("dokka") + } + from("_redirects") +} + +val serve = tasks.register("serve") { + mainClass = "guru.zoroark.servine.app.AppKt" + classpath = servine + + dependsOn(assembleFiles) + + val params = listOf(layout.buildDirectory.dir("output").get().toString()) + args(params) +}