-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extracted from Optravis platform-lib
- Loading branch information
0 parents
commit aab4e4c
Showing
22 changed files
with
910 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
titleOnly: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
env: | ||
GRADLE_OPTS: "-Dorg.gradle.workers.max=2 -Dorg.gradle.console=plain" | ||
|
||
jobs: | ||
# Verifies all tests pass | ||
verify: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: corretto | ||
java-version: 17 | ||
cache: gradle | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: just@1 | ||
- run: just verify | ||
|
||
# Prepare a release PR or release | ||
release: | ||
if: github.ref == 'refs/heads/main' | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
pull-requests: write | ||
outputs: | ||
released: ${{ steps.release.outputs.release_created }} | ||
steps: | ||
- id: release | ||
uses: googleapis/release-please-action@v4 | ||
with: | ||
release-type: simple | ||
|
||
# Publish the artifacts (only if `verify` passed, and `release` created release) | ||
publish: | ||
needs: [ verify, release ] | ||
if: needs.verify.result == 'success' && needs.release.outputs.released | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
permissions: | ||
contents: write | ||
packages: write | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: corretto | ||
java-version: 17 | ||
cache: gradle | ||
- uses: taiki-e/install-action@v2 | ||
with: | ||
tool: just@1 | ||
- run: just publish | ||
env: | ||
GITHUB_USERNAME: ${{ github.actor }} | ||
GITHUB_TOKEN: ${{ github.token }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: Dependency Submission | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
dependency-submission: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v4 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 17 | ||
- uses: gradle/actions/dependency-submission@v3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gradle/ | ||
.idea/ | ||
.kotlin/ | ||
build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @Optravis-LLC/saas-platform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Jooq generator plugin | ||
|
||
An opinionated gradle plugin generate jOOQ classes from Flyway migrations. | ||
|
||
The goal is to be very easy to set up jOOQ generation for projects using Kotlin, flyway and postgres. | ||
|
||
The minimal setup for projects using Postgres (and the default flyway migration directory) is: | ||
|
||
```kotlin | ||
plugins { | ||
kotlin("jvm") version "<kotlin version>" // The Kotlin plugin is required | ||
id("com.optravis.platform.jooq") version "<platformlib version>" // Install the gradle plugin | ||
} | ||
``` | ||
|
||
It is possible to use other databases by configuring the (experimental) 'JooqGeneratorExtension' | ||
|
||
```kotlin | ||
@OptIn(ExperimentalJooqGeneratorConfig::class) | ||
configure<JooqGeneratorExtension> { | ||
//... | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import org.jetbrains.kotlin.gradle.dsl.JvmTarget | ||
|
||
plugins { | ||
alias(libs.plugins.kotlin.jvm) | ||
alias(libs.plugins.detekt) | ||
`java-gradle-plugin` | ||
} | ||
|
||
group = "com.optravis.jooq.gradle" | ||
|
||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
implementation(gradleKotlinDsl()) | ||
implementation(libs.jooq.codegen) | ||
implementation(libs.flyway.core) | ||
implementation(libs.testcontainers.core) | ||
implementation(libs.hikari) | ||
|
||
runtimeOnly(libs.jooq.meta.kotlin) | ||
runtimeOnly(libs.flyway.postgres) | ||
runtimeOnly(libs.postgresql) | ||
|
||
testImplementation(rootProject.libs.kotest.runner) | ||
testImplementation(rootProject.libs.kotest.assertions) | ||
} | ||
|
||
gradlePlugin { | ||
plugins { | ||
create("jooqGenerator") { | ||
id = "com.optravis.jooq.gradle" | ||
implementationClass = "com.optravis.jooq.gradle.JooqGeneratorPlugin" | ||
} | ||
} | ||
} | ||
|
||
java { | ||
withSourcesJar() | ||
withJavadocJar() | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
kotlin { | ||
explicitApi() | ||
compilerOptions { | ||
jvmTarget.set(JvmTarget.JVM_17) | ||
} | ||
} | ||
|
||
detekt { | ||
config.setFrom(rootDir.resolve("detekt.yml")) | ||
} | ||
|
||
tasks.withType<Test>().configureEach { | ||
useJUnitPlatform() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
config: | ||
validation: true | ||
warningsAsErrors: true | ||
|
||
style: | ||
ReturnCount: | ||
active: false | ||
ThrowsCount: | ||
active: false | ||
MaxLineLength: | ||
excludeCommentStatements: true | ||
|
||
exceptions: | ||
TooGenericExceptionCaught: | ||
active: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
org.gradle.parallel=true | ||
org.gradle.daemon=true | ||
org.gradle.configuration-cache=true | ||
org.gradle.caching=true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
[versions] | ||
kotlin = "2.0.0" | ||
detekt = "1.23.6" | ||
kotest = "5.9.1" | ||
flyway = "10.15.0" | ||
jooq = "3.19.10" | ||
testcontainers = "1.19.8" | ||
postgres = "42.7.3" | ||
hikari = "5.1.0" | ||
|
||
[plugins] | ||
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | ||
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" } | ||
jooq = { id = "org.jooq.jooq-codegen-gradle", version.ref = "jooq" } | ||
|
||
[libraries] | ||
# jOOQ | ||
jooq-core = { module = "org.jooq:jooq", version.ref = "jooq" } | ||
jooq-kotlin = { module = "org.jooq:jooq-kotlin", version.ref = "jooq" } | ||
jooq-coroutines = { module = "org.jooq:jooq-kotlin-coroutines", version.ref = "jooq" } | ||
jooq-meta-core = { module = "org.jooq:jooq-meta", version.ref = "jooq" } | ||
jooq-meta-kotlin = { module = "org.jooq:jooq-meta-kotlin", version.ref = "jooq" } | ||
jooq-codegen = { module = "org.jooq:jooq-codegen", version.ref = "jooq" } | ||
|
||
# Flyway | ||
flyway-core = { module = "org.flywaydb:flyway-core", version.ref = "flyway" } | ||
flyway-postgres = { module = "org.flywaydb:flyway-database-postgresql", version.ref = "flyway" } | ||
|
||
# Test Containers | ||
testcontainers-core = { module = "org.testcontainers:testcontainers", version.ref = "testcontainers" } | ||
testcontainers-postgresql = { module = "org.testcontainers:postgresql", version.ref = "testcontainers" } | ||
|
||
# DB access | ||
postgresql = { module = "org.postgresql:postgresql", version.ref = "postgres" } | ||
hikari = { module = "com.zaxxer:HikariCP", version.ref = "hikari" } | ||
|
||
# Test | ||
kotest-assertions = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" } | ||
kotest-datatest = { module = "io.kotest:kotest-framework-datatest", version.ref = "kotest" } | ||
kotest-runner = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" } |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
Oops, something went wrong.