Skip to content

chore: port demos builds to Gradle #604

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions demos/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
plugins {
id 'java'
}

apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'

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

// Don't publish this module
bootJar { enabled = false }
jar { enabled = false }
tasks.matching { it.name.startsWith('publish') }.configureEach {
enabled = false
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = 'Spring Milestones'
url = 'https://repo.spring.io/milestone'
}
maven {
name = 'Spring Snapshots'
url = 'https://repo.spring.io/snapshot'
}
}

// Tell gradle to add the generated sources directory
sourceSets {
main {
java {
srcDir file("${buildDir}/generated/sources/annotationProcessor/java/main")
}
}
test {
java {
srcDir file("${buildDir}/generated/sources/annotationProcessor/java/test")
}
}
}

dependencies {
implementation project(':redis-om-spring')

// Important for RedisOM annotation processing!
annotationProcessor project(':redis-om-spring')
testAnnotationProcessor project(':redis-om-spring')

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// Spring Boot starters
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-devtools'

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.jupiter:junit-jupiter'
testImplementation 'org.assertj:assertj-core'
testImplementation 'org.mockito:mockito-core'
testImplementation "com.redis:testcontainers-redis:${testcontainersRedisVersion}"
testImplementation "org.testcontainers:junit-jupiter"

// Optional dependencies used by some demos
implementation 'com.github.javafaker:javafaker:1.0.2'
implementation 'org.springframework:spring-context-support'
}

// Use -parameters flag for Spring
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-parameters'
options.fork = true
options.forkOptions.jvmArgs << '-Xshare:off'
}

// Configure annotation processing
compileJava {
options.annotationProcessorPath = configurations.annotationProcessor
options.generatedSourceOutputDirectory = file("${buildDir}/generated/sources/annotationProcessor/java/main")
}

compileTestJava {
options.annotationProcessorPath = configurations.testAnnotationProcessor
options.generatedSourceOutputDirectory = file("${buildDir}/generated/sources/annotationProcessor/java/test")
}

// Fix task dependencies for sourcesJar
sourcesJar {
dependsOn compileJava
}

test {
useJUnitPlatform()
maxHeapSize = "1g"

testLogging {
events "passed", "skipped", "failed"
exceptionFormat = 'full'
}
}
60 changes: 60 additions & 0 deletions demos/roms-amr-entraid/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
plugins {
id 'java'
id 'org.springframework.boot'
id 'io.spring.dependency-management'
}

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

// Don't publish this module
tasks.matching { it.name.startsWith('publish') }.configureEach {
enabled = false
}

repositories {
mavenLocal()
mavenCentral()
maven {
name = 'Spring Milestones'
url = 'https://repo.spring.io/milestone'
}
maven {
name = 'Spring Snapshots'
url = 'https://repo.spring.io/snapshot'
}
}

dependencies {
implementation project(':redis-om-spring')

// Important for RedisOM annotation processing!
annotationProcessor project(':redis-om-spring')
testAnnotationProcessor project(':redis-om-spring')

// Lombok
compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testCompileOnly 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

// Spring Boot starters
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-web'
implementation 'org.springframework.boot:spring-boot-starter-actuator'

// Test dependencies
testImplementation 'org.springframework.boot:spring-boot-starter-test'
}

// Use -parameters flag for Spring
tasks.withType(JavaCompile).configureEach {
options.compilerArgs << '-parameters'
}

test {
useJUnitPlatform()
}
Loading