Skip to content

Commit

Permalink
Gradle build redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Sep 10, 2023
1 parent e35216e commit 775129b
Show file tree
Hide file tree
Showing 28 changed files with 356 additions and 360 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -396,4 +396,4 @@ jobs:
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}

- name: Run ktlint
run: ./gradlew ktlint
run: ./gradlew ktlintCheck
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ backend/app/src/main/resources/application-js-e2e.properties

/backend/*/build
/backend/*/out

/ee/backend/*/build
/ee/backend/*/out
31 changes: 9 additions & 22 deletions backend/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,21 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'java'
id 'io.spring.dependency-management'
id 'org.jetbrains.kotlin.jvm'
id 'org.springframework.boot'
id "kotlin-allopen"

id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
}

group = 'io.tolgee'

apply plugin: 'java'
apply plugin: 'idea'
apply plugin: "org.jetbrains.kotlin.plugin.spring"
apply plugin: 'org.jetbrains.kotlin.plugin.spring'
apply plugin: 'org.springframework.boot'
apply plugin: "kotlin-allopen"
apply plugin: 'org.jetbrains.kotlin.plugin.allopen'
apply plugin: 'io.spring.dependency-management'

repositories {
mavenCentral()
}

kotlin {
jvmToolchain(11)
}
Expand All @@ -41,10 +28,10 @@ allOpen {

dependencies {
implementation libs.kotlinCoroutines
implementation "org.springframework.boot:spring-boot-starter-hateoas"
implementation 'org.springframework.boot:spring-boot-starter-hateoas'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation("org.springframework.boot:spring-boot-starter-security")
implementation "org.springframework.boot:spring-boot-starter-websocket"
implementation 'org.springframework.boot:spring-boot-starter-security'
implementation 'org.springframework.boot:spring-boot-starter-websocket'

implementation(project(':data'))
implementation(project(':misc'))
Expand All @@ -71,7 +58,7 @@ dependencies {
implementation libs.jjwtApi
implementation libs.jjwtImpl
implementation libs.jjwtJackson
implementation("com.github.ben-manes.caffeine:caffeine:3.0.5")
implementation libs.caffeineCaching
api libs.postHog
}

Expand Down
36 changes: 8 additions & 28 deletions backend/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,15 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'io.spring.dependency-management'
id 'org.springframework.boot'
id 'java'
id 'org.jetbrains.kotlin.jvm'
id "kotlin-jpa"
id "org.jetbrains.kotlin.kapt"
id "kotlin-allopen"
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
}

group = 'io.tolgee'

if (System.getenv().containsKey("VERSION")) {
project.version = System.getenv().get("VERSION")
} else {
project.version = 'local'
}

configurations {
developmentOnly
runtimeClasspath {
Expand All @@ -38,14 +23,9 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.jetbrains.kotlin.plugin.jpa"
apply plugin: "kotlin-allopen"
apply plugin: "org.jetbrains.kotlin.plugin.allopen"
apply plugin: "org.jetbrains.kotlin.plugin.spring"

repositories {
mavenCentral()
}


allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
Expand Down Expand Up @@ -91,9 +71,9 @@ dependencies {
implementation libs.springmockk
implementation libs.jsonUnitAssert
testImplementation libs.mockito
testImplementation("io.findify:s3mock_2.13:0.2.6")
testImplementation("io.socket:socket.io-client:1.0.1")
testImplementation group: 'org.springframework.batch', name: 'spring-batch-test', version: '4.3.5'
testImplementation libs.amazonS3Mock
testImplementation libs.socketIoClient
testImplementation 'org.springframework.batch:spring-batch-test'
testImplementation libs.sendInBlue
testImplementation "org.springframework.boot:spring-boot-starter-websocket"

Expand Down
2 changes: 2 additions & 0 deletions backend/app/src/test/resources/application.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#debug: true

spring:
autoconfigure:
exclude:
Expand Down
51 changes: 13 additions & 38 deletions backend/data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,16 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.hibernate:hibernate-gradle-plugin:5.6.10.Final"
}
}

plugins {
id 'io.spring.dependency-management'
id 'org.springframework.boot'
id 'java'
id 'org.liquibase.gradle'
id 'org.jetbrains.kotlin.jvm'
id "kotlin-jpa"
id "org.jetbrains.kotlin.kapt"
id "kotlin-allopen"
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
id 'io.tolgee.gradle.liquibase'
}

group = 'io.tolgee'

if (System.getenv().containsKey("VERSION")) {
project.version = System.getenv().get("VERSION")
} else {
project.version = 'local'
}

configurations {
developmentOnly
runtimeClasspath {
Expand All @@ -45,16 +27,11 @@ apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.jetbrains.kotlin.plugin.jpa"
apply plugin: "org.jetbrains.kotlin.plugin.spring"
apply plugin: "kotlin-allopen"
apply plugin: "kotlin-kapt"
apply plugin: "org.jetbrains.kotlin.plugin.allopen"
apply plugin: "org.jetbrains.kotlin.kapt"
apply plugin: 'kotlin'
apply plugin: 'org.hibernate.orm'

repositories {
mavenCentral()
jcenter()
}

idea {
module {
generatedSourceDirs += files('build/generated/source/kapt/main', 'build/generated/source/kaptKotlin/main')
Expand All @@ -80,9 +57,7 @@ allOpen {
annotation("org.springframework.beans.factory.annotation.Configurable")
}

apply from: "$rootDir/gradle/liquibase.gradle"

configureLiquibase("public", "hibernate:spring:io.tolgee", 'src/main/resources/db/changelog/schema.xml')
//configureLiquibase("public", "hibernate:spring:io.tolgee", 'src/main/resources/db/changelog/schema.xml')

diff.dependsOn compileKotlin
diffChangeLog.dependsOn compileKotlin
Expand Down Expand Up @@ -130,7 +105,7 @@ dependencies {
implementation libs.liquibaseCore
liquibaseRuntime libs.liquibaseCore
liquibaseRuntime 'org.postgresql:postgresql'
liquibaseRuntime('org.liquibase:liquibase-groovy-dsl:3.0.2')
liquibaseRuntime libs.liquibaseGroovyDsl
liquibaseRuntime libs.liquibaseHibernate
liquibaseRuntime libs.kotlinReflect
liquibaseRuntime sourceSets.main.output
Expand Down Expand Up @@ -162,19 +137,19 @@ dependencies {
* MISC
*/
implementation libs.commonsCodec
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.9'
implementation libs.commonsText
implementation libs.icu4j
implementation libs.jjwtApi
implementation libs.jjwtImpl
implementation libs.jjwtJackson
implementation libs.jacksonModuleKotlin
implementation 'net.datafaker:datafaker:1.5.0'
implementation 'jaxen:jaxen:1.2.0'
implementation libs.datafaker
implementation libs.jaxen
implementation libs.sendInBlue
implementation libs.sentry
implementation libs.hibernateTypes
liquibaseRuntime libs.hibernateTypes
implementation 'com.eatthepath:java-otp:0.4.0'
implementation libs.otp
implementation libs.postHog
implementation libs.micrometerPrometheus

Expand Down
25 changes: 6 additions & 19 deletions backend/development/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,11 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'io.spring.dependency-management'
id 'org.springframework.boot'
id 'java'
id 'org.jetbrains.kotlin.jvm'
id "kotlin-jpa"
id "org.jetbrains.kotlin.kapt"
id "kotlin-allopen"
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
}

group = 'io.tolgee'
Expand All @@ -33,12 +24,8 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.jetbrains.kotlin.plugin.jpa"
apply plugin: "kotlin-allopen"
apply plugin: "kotlin-kapt"

repositories {
mavenCentral()
}
apply plugin: "org.jetbrains.kotlin.plugin.allopen"
apply plugin: "org.jetbrains.kotlin.kapt"

kotlin {
jvmToolchain(11)
Expand Down
14 changes: 2 additions & 12 deletions backend/misc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,16 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'java'
id 'org.jetbrains.kotlin.jvm'
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
}

group = 'io.tolgee'

apply plugin: 'java'
apply plugin: 'idea'

repositories {
mavenCentral()
}

kotlin {
jvmToolchain(11)
}
Expand Down
32 changes: 6 additions & 26 deletions backend/testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,30 +2,15 @@
* Copyright (c) 2020. Tolgee
*/

buildscript {
repositories {
mavenCentral()
}
}

plugins {
id 'io.spring.dependency-management'
id 'org.springframework.boot'
id 'java'
id 'org.jetbrains.kotlin.jvm'
id "kotlin-jpa"
id "org.jetbrains.kotlin.kapt"
id "kotlin-allopen"
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
}

group = 'io.tolgee'

if (System.getenv().containsKey("VERSION")) {
project.version = System.getenv().get("VERSION")
} else {
project.version = 'local'
}

configurations {
developmentOnly
runtimeClasspath {
Expand All @@ -39,13 +24,8 @@ apply plugin: 'idea'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: "org.jetbrains.kotlin.plugin.jpa"
apply plugin: "kotlin-allopen"
apply plugin: "kotlin-kapt"

repositories {
mavenCentral()
jcenter()
}
apply plugin: "org.jetbrains.kotlin.plugin.allopen"
apply plugin: "org.jetbrains.kotlin.kapt"

kotlin {
jvmToolchain(11)
Expand Down
Loading

0 comments on commit 775129b

Please sign in to comment.