Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Feat/quarkus #122

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/codacy_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ permissions: read-all
- main
jobs:
codacy-security-scan:
if: github.repository == 'truthencode/ddo-calc'
name: Codacy Security Scan
runs-on: ubuntu-latest
steps:
Expand All @@ -28,6 +29,7 @@ jobs:
with:
sarif_file: results.sarif
codacy-analysis-cli:
if: github.repository == 'truthencode/ddo-calc'
name: Codacy Analysis CLI
runs-on: ubuntu-latest
steps:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/sonar_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on:
- master
pull_request:
types: [opened, synchronize, reopened]
env:
GRADLE_OPTS: -Xmx1g -XX:MaxMetaspaceSize=512m
permissions: read-all
jobs:
build:
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -214,3 +214,5 @@ local.properties
/subprojects/common/ddo-modeling/src/main/avro/
/subprojects/common/ddo-core/src/generated/java/io/truthencode/ddo/core/GeneratedVersion.java
fixle.sh
/.env
/.envrc
1 change: 1 addition & 0 deletions .trunk/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
plugins
user_trunk.yaml
user.yaml
tmp
36 changes: 18 additions & 18 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
version: 0.1
cli:
version: 1.16.0
version: 1.22.3

plugins:
sources:
- id: trunk
ref: v1.2.3
ref: v1.6.1
uri: https://github.com/trunk-io/plugins
lint:
enabled:
- hadolint@2.12.0
- terrascan@1.18.3
- checkov@2.4.9
- osv-scanner@1.4.0
- trivy@0.45.1
- trufflehog@3.56.1
- taplo@0.8.1
- actionlint@1.6.25
- terrascan@1.19.1
- checkov@3.2.225
- osv-scanner@1.8.3
- trivy@0.54.1
- trufflehog@3.81.8
- taplo@0.9.3
- actionlint@1.7.1
- dotenv-linter@3.3.0
- git-diff-check
- gitleaks@8.18.0
- ktlint@1.0.0
- markdownlint@0.37.0
- oxipng@8.0.0
- prettier@3.0.3
- renovate@36.97.3
- scalafmt@3.7.14
- shellcheck@0.9.0
- gitleaks@8.18.4
- ktlint@1.3.1
- markdownlint@0.41.0
- oxipng@9.1.2
- prettier@3.3.3
- renovate@38.33.0
- scalafmt@3.8.3
- shellcheck@0.10.0
- shfmt@3.6.0
- yamllint@1.32.0
- yamllint@1.35.1
ignore:
- linters: [ALL]
paths:
Expand Down
8 changes: 5 additions & 3 deletions build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ val defaultJavaToolChainVersion: String? by project
val kasechangeVersion: String by project

dependencies {

implementation(libs.quarkus.gradle.plugin)
implementation(libs.kotlin.gradle.plugin)
implementation(libs.kotlin.allopen.plugin)
implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.3.1.3277")
// enable gradle catalog for included convention plugins
implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
Expand Down Expand Up @@ -68,8 +70,8 @@ dependencies {
implementation("io.spring.gradle:dependency-management-plugin:1.0.15.RELEASE")

// kotlin
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("com.google.devtools.ksp:symbol-processing-gradle-plugin:$kotlinVersion-1.0.13")
// implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
implementation("com.google.devtools.ksp:symbol-processing-gradle-plugin:$kotlinVersion-1.0.24")
// not finding jitpacked resource
// implementation("com.strumenta.antlr-kotlin:antlr-kotlin-gradle-plugin:70d79b7eb1")

Expand Down
2 changes: 1 addition & 1 deletion build-logic/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
# Jvm
# Used for toolchains

kotlinVersion=1.9.10
kotlinVersion=2.0.0
koTestVersion=5.5.5

scalaVersions=2.12.18,2.11.12,2.13.12
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
plugins {
id("io.quarkus")
id("djaxonomy.common-conventions")
}

val quarkusPlatformGroupId: String by project
val quarkusPlatformArtifactId: String by project
val quarkusPlatformVersion: String by project

dependencies {
implementation(enforcedPlatform("$quarkusPlatformGroupId:$quarkusPlatformArtifactId:$quarkusPlatformVersion"))
implementation("io.quarkus:quarkus-arc")
implementation("io.quarkus:quarkus-smallrye-health")
implementation("io.quarkus:quarkus-hibernate-validator") {
because("Hibernate Validator is an implementation of the Jakarta Bean Validation specification. Not specific to JPA.")
}
// implementation("io.quarkus:quarkus-rest")
testImplementation("io.quarkus:quarkus-junit5")
// testImplementation("io.rest-assured:rest-assured")
}

tasks.withType<Test> {
systemProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/*
* SPDX-License-Identifier: Apache-2.0
*
* Copyright 2022-2023 Andre White.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
plugins {
id("org.kordamp.gradle.jandex")
id("buildlogic.quarkus-common-conventions")
}

/*
APPLIES TO:

This convention should be applied to any project that
- Does NOT directly create a quarkus instance
- uses quarkus components
- is to be 'discovered' / injected via a supported CDI or other annotation Quarkus needs to
be aware of at compile time.

DOES NOT APPLY TO:
(Mutually exclusive) actual quarkus application

You should instead apply 'buildlogic.quarkus-application-conventions' if the module actually invokes
the quarkus engine directly.

WHAT THIS DOES:

Defines Quarkus version information (Bom)

Adds Jandex plugin to provide index of classes / objects / beans Main Quarkus app needs to register.
*/
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("buildlogic.quarkus-common-conventions") apply false
}

dependencies {
implementation("io.quarkus:quarkus-kotlin")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
plugins {
id("buildlogic.quarkus-common-conventions")
}

dependencies {
implementation("io.quarkus:quarkus-arc")
implementation("io.quarkus:quarkus-rest")
implementation("io.quarkus:quarkus-rest-client")
implementation("io.quarkus:quarkus-rest-jackson")
testImplementation("io.quarkus:quarkus-junit5")
testImplementation("io.rest-assured:rest-assured")
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ java {
}
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}

// jacoco {
// toolVersion = jacocoToolVersion
// // reportsDirectory.set(layout.buildDirectory.dir("customJacocoReportDir"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ kte.useKotlinTestKit.convention(KotlinTestKits.KoTest)
afterEvaluate {

val testMode =
findProperty("kotlinTestMode")?.toString()
findProperty("kotlinTestMode")
?.toString()
?.let(io.truthencode.djaxonomy.etc.TestMode::valueOf)
?: io.truthencode.djaxonomy.etc.TestMode.REFLECT
logger.warn("${project.name} kotlinTestMode: $testMode (dependencies)")
Expand Down Expand Up @@ -97,10 +98,11 @@ afterEvaluate {

afterEvaluate {
val testMode =
findProperty("kotlinTestSuite")?.toString()
findProperty("kotlinTestSuite")
?.toString()
?.let(KotlinTestKits::valueOf)
?: KotlinTestKits.KoTest
logger.warn("${project.name} kotlinTestMode: $testMode (JvmTestSuite)")
logger.warn("after evaluate ${project.name} kotlinTestMode: $testMode (JvmTestSuite)")
testing {

val ts = TestBuildSupport(project)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,18 @@ repositories {
// Use Maven Central for resolving dependencies.
mavenCentral()
}

dependencies {
constraints {
// Define dependency versions as constraints
implementation("org.apache.commons:commons-text:1.10.0")
}

// Use JUnit Jupiter for testing.
testImplementation("org.junit.jupiter:junit-jupiter:5.9.3")

testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
//
// dependencies {
// constraints {
// // Define dependency versions as constraints
// implementation("org.apache.commons:commons-text:1.10.0")
// }
//
// // Use JUnit Jupiter for testing.
// testImplementation("org.junit.jupiter:junit-jupiter:5.9.3")
//
// testRuntimeOnly("org.junit.platform:junit-platform-launcher")
// }

tasks.named<Test>("test") {
// Use JUnit Platform for unit tests.
Expand Down
9 changes: 9 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@
# limitations under the License.
#

# JVM / System args
kotlin.daemon.jvm.options="-Xmx1g"

# Quarkus Related
quarkusPluginId=io.quarkus
quarkusPluginVersion=3.13.2
quarkusPlatformGroupId=io.quarkus.platform
quarkusPlatformArtifactId=quarkus-bom
quarkusPlatformVersion=3.13.2

defaultJavaToolChainVersion=17

Expand Down
40 changes: 38 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ junit-jupiter = "5.10.0"
junit-platform = "1.10.0"
kotest = "5.7.2"
# @pin We all move together
kotlin = "1.9.0"
kotlin = "2.0.0"
logback = "1.5.6"
mockito = "5.5.0"
monix = "3.4.1"
Expand All @@ -27,7 +27,20 @@ scalatestplus = "3.2.17.0"
scoverage = "2.0.11"
quarkus-s3 = "0.0.1"
scala3-version = "3.1.0"
quarkus = "3.4.0"
quarkus = "3.13.2"
quarkus-gradle-plugin = "3.13.2"

kordamp-jandex-gradle-plugin = "2.0.0"
freefair-lombok-plugin = "8.7.1"
assertj = "3.22.0"

jakarta-servlet-jakarta-servlet-api = "6.0.0"
org-cometd-java = "8.0.2"
org-eclipse-jetty = "12.0.10"
jetbrains-xodus = "2.0.1"
allure = "2.25.0"
hypersistence = "3.8.2"


# Scala Jackson at time of writing doesn't support Scala 3 Enum's natively. It requires another library.
# That library doesn't support same version of Jackson that Quarkus BOM uses (2.12.5), so this is the best compromise
Expand All @@ -37,6 +50,9 @@ jackson = "2.12.3"

[libraries]
#Gradle properties
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-allopen-plugin = { module = "org.jetbrains.kotlin:kotlin-allopen", version.ref = "kotlin" }

quarkiverse-scala-s3 = { module = "io.quarkiverse.scala:quarkus-scala3", version.ref = "quarkus-s3" }
quarkus-bom = { module = "io.quarkus.platform:quarkus-bom", version.ref = "quarkus" }
quarkus-arc = { module = "io.quarkus:quarkus-arc", version.ref = "quarkus" }
Expand Down Expand Up @@ -102,6 +118,26 @@ typesafe-config = "com.typesafe:config:1.4.2"
typesafe-scala-logging-s213 = "com.typesafe.scala-logging:scala-logging_2.13:3.9.5"
wix-accord-core-s213 = { module = "com.wix:accord-core_2.13", version.ref = "accord" }
wix-accord-scalatest-s213 = { module = "com.wix:accord-scalatest_2.13", version.ref = "accord" }
quarkus-gradle-plugin = { module = "io.quarkus:gradle-application-plugin", version.ref = "quarkus-gradle-plugin" }
freefair-lombok-plugin = { module = "io.freefair.gradle:lombok-plugin", version.ref = "freefair-lombok-plugin" }
testing-assertj = { module = "org.assertj:assertj-core", version.ref = "assertj" }
testing-mockito = { module = "org.mockito:mockito-core", version.ref = "mockito" }
jakarta-servlet-jakarta-servlet-api = { module = "jakarta.servlet:jakarta.servlet-api", version.ref = "jakarta-servlet-jakarta-servlet-api" }
org-cometd-java-cometd-java-api-server = { module = "org.cometd.java:cometd-java-api-server", version.ref = "org-cometd-java" }
org-cometd-java-client = { module = "org.cometd.java:cometd-java-client", version.ref = "org-cometd-java" }
org-cometd-java-client-http-jetty = { module = "org.cometd.java:cometd-java-client-http-jetty", version.ref = "org-cometd-java" }
org-cometd-java-client-websocket-jakarta = { module = "org.cometd.java:cometd-java-client-websocket-jakarta", version.ref = "org-cometd-java" }
org-cometd-java-cometd-java-server-http-jakarta = { module = "org.cometd.java:cometd-java-server-http-jakarta", version.ref = "org-cometd-java" }
org-cometd-java-cometd-java-server-websocket-jakarta = { module = "org.cometd.java:cometd-java-server-websocket-jakarta", version.ref = "org-cometd-java" }
org-cometd-javascript-cometd-javascript-common = { module = "org.cometd.javascript:cometd-javascript-common", version.ref = "org-cometd-java" }
org-eclipse-jetty-ee10-jetty-ee10-servlets = { module = "org.eclipse.jetty.ee10:jetty-ee10-servlets", version.ref = "org-eclipse-jetty" }
org-eclipse-jetty-jetty-jmx = { module = "org.eclipse.jetty:jetty-jmx", version.ref = "org-eclipse-jetty" }
org-eclipse-jetty-jetty-slf4j-impl = { module = "org.eclipse.jetty:jetty-slf4j-impl", version.ref = "org-eclipse-jetty" }
org-eclipse-jetty-jetty-util = { module = "org.eclipse.jetty:jetty-util", version.ref = "org-eclipse-jetty" }
org-eclipse-jetty-jetty-util-ajax = { module = "org.eclipse.jetty:jetty-util-ajax", version.ref = "org-eclipse-jetty" }
jetbrains-xodus-xodus-openAPI = { module = "org.jetbrains.xodus:xodus-openAPI", version.ref = "jetbrains-xodus" }
allure-bom = { module = "io.qameta.allure:allure-bom", version.ref = "allure" }
hypersistence-utils = { module = "io.hypersistence:hypersistence-utils-hibernate-63", version.ref = "hypersistence" }

[bundles]
concordion = [
Expand Down
3 changes: 2 additions & 1 deletion include/ddo-avro/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ dependencies {
unsure how helpful this will be as most data will need runtime validation (aka wix)
*/
// Use Scala $scalaMajorVersion in our library project
implementation("org.scala-lang:scala-library:2.13.10")
implementation("org.scala-lang:scala-library:2.13.14")
// implementation("org.scala-lang:scala-library:2.12.19")

// val scalaLibraryVersion: String by project
// val scalaMajorVersion: String by project
Expand Down
4 changes: 2 additions & 2 deletions include/ddo-avro/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# TODO: Replace with Catalog reference
#Avro related
avroHuggerPluginVersion = 0.7.0
avroHuggerPluginVersion = 0.8.1
foojayResolverPluginVersionversion=0.4.0

# semver and deployment
mooltiverseNyxPluginVersion=1.0.1-fix81.1
mooltiverseNyxPluginVersion=3.0.5
Loading
Loading