Skip to content

Commit

Permalink
use cloud-build-logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jpenilla committed Jan 5, 2024
1 parent 8e3b582 commit fcf6deb
Show file tree
Hide file tree
Showing 16 changed files with 115 additions and 163 deletions.
45 changes: 0 additions & 45 deletions build-logic/build.gradle.kts

This file was deleted.

7 changes: 0 additions & 7 deletions build-logic/settings.gradle.kts

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

3 changes: 2 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
id("cloud-spring.parent-build-logic")
alias(libs.plugins.cloud.buildLogic.rootProject.publishing)
alias(libs.plugins.cloud.buildLogic.rootProject.spotless)
}

spotlessPredeclare {
Expand Down
2 changes: 1 addition & 1 deletion cloud-spring/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ dependencies {
api(libs.spring.shell)
api(platform(libs.spring.shell.dependencies))

compileOnlyApi(libs.cloud.annotations)
compileOnly(libs.cloud.annotations)

testImplementation(libs.spring.boot.starter.test)
testImplementation(libs.spring.shell.test)
Expand Down
20 changes: 12 additions & 8 deletions example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
alias(libs.plugins.graal.native.buildtools)
}

apply(plugin = "io.spring.dependency-management")
plugins.apply("io.spring.dependency-management")

graalvmNative {
binaries.all {
Expand All @@ -26,14 +26,18 @@ graalvmNative {
toolchainDetection = false
}

java {
toolchain {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
}

dependencies {
implementation(project(":cloud-spring"))
implementation(libs.cloud.annotations)
}

spotless {
java {
targetExclude("build/generated/**")
}
}

tasks.compileAotJava {
// I couldn't figure out the warnings in generated code
options.compilerArgs.clear()
}
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ description=cloud-spring

org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx2G
21 changes: 21 additions & 0 deletions gradle/build-logic/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
plugins {
`kotlin-dsl`
alias(libs.plugins.cloud.buildLogic.spotless)
}

repositories {
gradlePluginPortal()
mavenLocal()
}

dependencies {
implementation(libs.cloud.build.logic)
implementation(libs.gradleKotlinJvm)

implementation(files(libs.javaClass.superclass.protectionDomain.codeSource.location))
}

cloudSpotless {
licenseHeaderFile.convention(null as RegularFile?)
ktlintVersion = libs.versions.ktlint
}
16 changes: 16 additions & 0 deletions gradle/build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
rootProject.name = "build-logic"

pluginManagement {
repositories {
gradlePluginPortal()
mavenLocal()
}
}

dependencyResolutionManagement {
versionCatalogs {
create("libs") {
from(files("../libs.versions.toml"))
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
plugins {
id("org.incendo.cloud-build-logic")
id("org.incendo.cloud-build-logic.spotless")
}

indra {
javaVersions {
minimumToolchain(17)
target(17)
testWith().set(setOf(17))
}
checkstyle().set(libs.versions.checkstyle)
}

cloudSpotless {
ktlintVersion = libs.versions.ktlint
}

spotless {
java {
importOrderFile(rootProject.file(".spotless/cloud-spring.importorder"))
}
}

// Common dependencies.
dependencies {

// test dependencies
testImplementation(libs.truth)
testImplementation(libs.awaitility)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import org.incendo.cloudbuildlogic.city

plugins {
id("org.incendo.cloud-build-logic.publishing")
}

indra {
github("Incendo", "cloud-spring") {
ci(true)
}
mitLicense()

configurePublications {
pom {
developers {
city()
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.api.Project
import org.gradle.kotlin.dsl.the

public val Project.libs: LibrariesForLibs
val Project.libs: LibrariesForLibs
get() = the()
14 changes: 5 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
[plugins]
spotless = { id = "com.diffplug.spotless", version.ref = "spotless" }
spring-plugin-boot = { id = "org.springframework.boot", version.ref = "springBoot" }
graal-native-buildtools = { id = "org.graalvm.buildtools.native", version.ref = "graal" }
cloud-buildLogic-spotless = { id = "org.incendo.cloud-build-logic.spotless", version.ref = "cloud-build-logic" }
cloud-buildLogic-rootProject-publishing = { id = "org.incendo.cloud-build-logic.publishing.root-project", version.ref = "cloud-build-logic" }
cloud-buildLogic-rootProject-spotless = { id = "org.incendo.cloud-build-logic.spotless.root-project", version.ref = "cloud-build-logic" }

[versions]
cloud-build-logic = "0.0.1-SNAPSHOT"
springBoot = "3.2.0"
spotless = "6.22.0"
ktlint = "1.0.1"
indra = "3.1.3"
checkstyle = "10.12.5"
kotlin = "1.9.20"
graal = "0.9.28"

checkerQual = "3.40.0"
apiguardian = "1.1.2"
slf4j = "2.0.9"
cloud = "2.0.0-SNAPSHOT"

Expand All @@ -24,12 +23,9 @@ truth = "1.1.4"
awaitility = "4.2.0"

[libraries]
spotless = { group = "com.diffplug.spotless", name = "spotless-plugin-gradle", version.ref = "spotless" }
indraCommon = { group = "net.kyori", name = "indra-common", version.ref = "indra" }
cloud-build-logic = { module = "org.incendo:cloud-build-logic", version.ref = "cloud-build-logic" }
gradleKotlinJvm = { group = "org.jetbrains.kotlin.jvm", name = "org.jetbrains.kotlin.jvm.gradle.plugin", version.ref = "kotlin" }

checkerQual = { group = "org.checkerframework", name = "checker-qual", version.ref = "checkerQual" }
apiguardian = { group = "org.apiguardian", name = "apiguardian-api", version.ref = "apiguardian" }
slf4j = { group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j" }
awaitility = { group = "org.awaitility", name = "awaitility", version.ref = "awaitility" }

Expand Down
8 changes: 6 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")

pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
mavenLocal()
}
includeBuild("build-logic")
includeBuild("gradle/build-logic")
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

dependencyResolutionManagement {
Expand Down

0 comments on commit fcf6deb

Please sign in to comment.