Skip to content

Commit

Permalink
fix(sqlgen): revamp
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 30, 2024
1 parent c4b0a3e commit a444ed7
Show file tree
Hide file tree
Showing 20 changed files with 748 additions and 640 deletions.
4 changes: 2 additions & 2 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:jdk17 as builder
FROM gradle:jdk21 as builder
WORKDIR /build
COPY . .
RUN gradle assemble

FROM gradle:jdk17
FROM gradle:jdk21
WORKDIR /app
COPY --from=builder /build/build/libs .
COPY --from=builder /build/src/main/resources/application.yml .
Expand Down
7 changes: 5 additions & 2 deletions api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,17 @@ dependencies {
implementation("org.springframework.boot:spring-boot-starter-validation")
implementation("org.springframework.boot:spring-boot-devtools")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("io.projectreactor.kotlin:reactor-kotlin-extensions")
implementation("org.sqids:sqids:0.1.0")
runtimeOnly("mysql:mysql-connector-java:8.0.33")
runtimeOnly("org.postgresql:postgresql")
runtimeOnly("com.oracle.database.jdbc:ojdbc11:23.5.0.24.07")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("io.projectreactor:reactor-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

kotlin {
Expand Down
4 changes: 2 additions & 2 deletions sqlgen/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:jdk17 as build-env
FROM gradle:jdk21 as build-env
WORKDIR /build
COPY . .
RUN gradle assemble

FROM gradle:jdk17
FROM gradle:jdk21
WORKDIR /app
COPY --from=build-env /build/build/libs .
COPY --from=build-env /build/src/main/resources/application.yml .
Expand Down
14 changes: 14 additions & 0 deletions sqlgen/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Rolldebee SQL Generator

Install [klint](https://ktlint.github.io).

Format code:

```shell
ktlint --format
```

Lint:

```shell
ktlint --format
```

Build and run with Docker:

```shell
Expand Down
50 changes: 29 additions & 21 deletions sqlgen/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
id("org.springframework.boot") version "2.6.4"
id("io.spring.dependency-management") version "1.0.11.RELEASE"
kotlin("jvm") version "1.6.10"
kotlin("plugin.spring") version "1.6.10"
id("org.springframework.boot") version "3.3.5"
id("io.spring.dependency-management") version "1.1.6"
kotlin("jvm") version "1.9.25"
kotlin("plugin.spring") version "1.9.25"
}

group = "com.rolldebee.sqlgen"
version = "1.0.0"
java.sourceCompatibility = JavaVersion.VERSION_17

java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}

repositories {
mavenCentral()
mavenCentral()
}

dependencies {
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.jetbrains.kotlin:kotlin-reflect")
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.github.javafaker:javafaker:1.0.2")
implementation("org.apache.commons:commons-math3:3.6.1")
implementation("commons-io:commons-io:2.11.0")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("org.jetbrains.kotlin:kotlin-reflect")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation("org.jetbrains.kotlin:kotlin-test-junit5")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation("com.github.javafaker:javafaker:1.0.2") {
exclude(group = "org.yaml", module = "snakeyaml")
}
implementation("org.yaml:snakeyaml:2.3")
implementation("org.apache.commons:commons-math3:3.6.1")
implementation("commons-io:commons-io:2.17.0")
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = "17"
}
kotlin {
compilerOptions {
freeCompilerArgs.addAll("-Xjsr305=strict")
}
}

tasks.withType<Test> {
useJUnitPlatform()
}
useJUnitPlatform()
}
Binary file modified sqlgen/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion sqlgen/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit a444ed7

Please sign in to comment.