Skip to content

Commit

Permalink
fixup! Gradle build redesign
Browse files Browse the repository at this point in the history
  • Loading branch information
fprochazka committed Oct 29, 2023
1 parent a80084b commit 622fcdd
Show file tree
Hide file tree
Showing 14 changed files with 38 additions and 111 deletions.
6 changes: 0 additions & 6 deletions backend/api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
*/

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

group = 'io.tolgee'

allOpen {
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.boot.test.context.SpringBootTest")
}

dependencies {
implementation libs.kotlinCoroutines
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
13 changes: 0 additions & 13 deletions backend/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
Expand All @@ -18,18 +17,6 @@ configurations {
}
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.beans.factory.annotation.Configurable")
annotation("org.springframework.boot.test.context.SpringBootTest")
}

dependencies {
/**
* SPRING
Expand Down
17 changes: 0 additions & 17 deletions backend/data/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
Expand All @@ -20,12 +19,6 @@ configurations {
ktlint
}

idea {
module {
generatedSourceDirs += files('build/generated/source/kapt/main', 'build/generated/source/kaptKotlin/main')
}
}

hibernate {
enhance {
enableLazyInitialization = true
Expand All @@ -35,16 +28,6 @@ hibernate {
}
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.beans.factory.annotation.Configurable")
}

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

diff.dependsOn compileKotlin
Expand Down
17 changes: 0 additions & 17 deletions backend/development/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
Expand All @@ -19,22 +18,6 @@ configurations {
ktlint
}

idea {
module {
generatedSourceDirs += files('build/generated/source/kapt/main', 'build/generated/source/kaptKotlin/main')
}
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.beans.factory.annotation.Configurable")
}

dependencies {
/**
* SPRING
Expand Down
1 change: 0 additions & 1 deletion backend/misc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
}

Expand Down
6 changes: 0 additions & 6 deletions backend/security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
*/

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

group = 'io.tolgee.security'

allOpen {
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.boot.test.context.SpringBootTest")
}

dependencies {
implementation libs.kotlinCoroutines
implementation 'org.springframework.boot:spring-boot-starter-web'
Expand Down
17 changes: 0 additions & 17 deletions backend/testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
Expand All @@ -19,22 +18,6 @@ configurations {
ktlint
}

idea {
module {
generatedSourceDirs += files('build/generated/source/kapt/main', 'build/generated/source/kaptKotlin/main')
}
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.beans.factory.annotation.Configurable")
}

dependencies {
/**
* SPRING
Expand Down
6 changes: 3 additions & 3 deletions buildSrc/src/main/kotlin/io/tolgee/gradle/base.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ repositories {
maven(url = "https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
}

apply(plugin = "java")
apply(plugin = "idea")
apply(plugin = "eclipse")
//apply(plugin = "java")
//apply(plugin = "idea")
//apply(plugin = "eclipse")

if (System.getenv().containsKey("VERSION")) {
project.version = System.getenv().get("VERSION") as String
Expand Down
12 changes: 10 additions & 2 deletions buildSrc/src/main/kotlin/io/tolgee/gradle/hibernate.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
package io.tolgee.gradle

plugins {
id("base")
id("kotlin")
id("org.jetbrains.kotlin.plugin.jpa")
id("org.hibernate.orm")
}

apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
apply(plugin = "org.hibernate.orm")
//apply(plugin = "org.jetbrains.kotlin.plugin.jpa")
//apply(plugin = "org.hibernate.orm")

configure<org.jetbrains.kotlin.allopen.gradle.AllOpenExtension> {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
}
14 changes: 11 additions & 3 deletions buildSrc/src/main/kotlin/io/tolgee/gradle/kotlin.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
package io.tolgee.gradle

import gradle.kotlin.dsl.plugins._1bc66e29931c9cc95ac26dbbe0d9f615.org
import org.gradle.kotlin.dsl.kotlin

plugins {
id("base")
java
kotlin("jvm")
id("org.jetbrains.kotlin.kapt")
id("org.jetbrains.kotlin.plugin.allopen")
id("org.jlleitschuh.gradle.ktlint")
}

apply(plugin = "kotlin")
apply(plugin = "org.jetbrains.kotlin.kapt")
apply(plugin = "org.jetbrains.kotlin.plugin.allopen")
//apply(plugin = "kotlin")
//apply(plugin = "org.jetbrains.kotlin.kapt")
//apply(plugin = "org.jetbrains.kotlin.plugin.allopen")

kotlin {
jvmToolchain(11)
Expand All @@ -34,3 +36,9 @@ ktlint {
// attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
// }
//}

idea {
module {
generatedSourceDirs += files("${project.buildDir}/generated/source/kapt/main", "${project.buildDir}/generated/source/kaptKotlin/main")
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.tolgee.gradle

plugins {
id("base")
id("org.liquibase.gradle")
}

Expand Down
16 changes: 13 additions & 3 deletions buildSrc/src/main/kotlin/io/tolgee/gradle/spring.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package io.tolgee.gradle

plugins {
id("base")
id("kotlin")
id("io.spring.dependency-management")

// Classes annotated with @Configuration, @Controller, @RestController, @Service or @Repository are automatically opened
Expand All @@ -10,6 +12,14 @@ plugins {
id("org.springframework.boot")
}

apply(plugin = "org.jetbrains.kotlin.plugin.spring")
apply(plugin = "org.springframework.boot")
apply(plugin = "io.spring.dependency-management")
//apply(plugin = "org.jetbrains.kotlin.plugin.spring")
//apply(plugin = "org.springframework.boot")
//apply(plugin = "io.spring.dependency-management")

configure<org.jetbrains.kotlin.allopen.gradle.AllOpenExtension> {
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.beans.factory.annotation.Configurable")
annotation("org.springframework.boot.test.context.SpringBootTest")
}
12 changes: 0 additions & 12 deletions ee/backend/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,11 @@

plugins {
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'
}

allOpen {
annotation("javax.persistence.Entity")
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.beans.factory.annotation.Configurable")
annotation("org.springframework.boot.test.context.SpringBootTest")
}

test {
useJUnitPlatform()
maxHeapSize = "2048m"
Expand Down
11 changes: 0 additions & 11 deletions ee/backend/tests/build.gradle
Original file line number Diff line number Diff line change
@@ -1,21 +1,10 @@

plugins {
id 'io.tolgee.gradle.base'
id 'io.tolgee.gradle.kotlin'
id 'io.tolgee.gradle.spring'
id 'io.tolgee.gradle.hibernate'
}

allOpen {
annotation("javax.persistence.MappedSuperclass")
annotation("javax.persistence.Embeddable")
annotation("org.springframework.stereotype.Service")
annotation("org.springframework.stereotype.Component")
annotation("org.springframework.transaction.annotation.Transactional")
annotation("org.springframework.beans.factory.annotation.Configurable")
annotation("org.springframework.boot.test.context.SpringBootTest")
}

test {
useJUnitPlatform()
maxHeapSize = "2048m"
Expand Down

0 comments on commit 622fcdd

Please sign in to comment.