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

compileJava.dependsOn(processResources)

dependencies {
  implementation "org.springframework.cloud:spring-cloud-function-web:$springCloudFunctionVersion"
  implementation 'org.springframework.boot:spring-boot-starter-web'
  implementation 'org.springframework.boot:spring-boot-starter-actuator'
  runtime 'org.springframework.boot:spring-boot-devtools'

  annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
  testAnnotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'

  testImplementation 'org.springframework.boot:spring-boot-starter-test'
  testImplementation 'io.projectreactor:reactor-test'

  //// JPA (+embedded)
  //runtime 'com.h2database:h2'
  //implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
  //implementation 'org.springframework.boot:spring-boot-starter-data-rest'

  //// Kafka (+embedded)
  //implementation 'org.springframework.cloud:spring-cloud-stream'
  //implementation 'org.springframework.cloud:spring-cloud-stream-binder-kafka'
  //implementation 'org.springframework.kafka:spring-kafka'
  //implementation 'org.springframework.kafka:spring-kafka-test'
  //testImplementation 'org.springframework.cloud:spring-cloud-stream-test-support'
}

dependencyManagement {
  imports {
    mavenBom "org.springframework.boot:spring-boot-dependencies:$springBootVersion"
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:$springCloudVersion"
  }
}

bootJar {
  launchScript()
}

/*
// spring-boot multi-module preamble:
// this in dependencies closure really doesn't work:
// compile project(':submodule').sourceSets.main.output // dot't do this!

// 1. in spring-boot submodules use next configs:

bootJar {
  enabled = false
}
jar {
  enabled = true
}

// 2. in spring-boot target main module to fix gradle compile build + lombok issue use all of these:

dependencies {
  annotationProcessor(project(':submodule'))
  compileOnly(project(':submodule'))
  compile(project(':submodule'))
}
*/
