You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1KB

  1. import org.gradle.internal.os.OperatingSystem
  2. apply plugin: 'org.springframework.boot'
  3. apply plugin: 'com.moowork.node'
  4. dependencies {
  5. compile "org.springframework.boot:spring-boot-devtools"
  6. }
  7. def profiles = 'dev'
  8. if (project.hasProperty('no-liquibase')) {
  9. profiles += ',no-liquibase'
  10. }
  11. if (project.hasProperty('tls')) {
  12. profiles += ',tls'
  13. }
  14. bootRun {
  15. args = []
  16. }
  17. task copySwaggerDev(type: NpmTask, dependsOn: 'npm_install') {
  18. inputs.dir("src/main/webapp/")
  19. inputs.files(fileTree('src/main/webapp/'))
  20. outputs.dir("build/www/")
  21. outputs.file("build/www/app/main.bundle.js")
  22. args = ["run", "copy-swagger"]
  23. }
  24. war {
  25. webAppDirName = 'build/www/'
  26. }
  27. task copyIntoStatic (type: Copy) {
  28. from 'build/www/'
  29. into 'build/resources/main/static'
  30. }
  31. processResources {
  32. filesMatching('**/application.yml') {
  33. filter {
  34. it.replace('#project.version#', version)
  35. }
  36. filter {
  37. it.replace('#spring.profiles.active#', profiles)
  38. }
  39. }
  40. }
  41. processResources.dependsOn copySwaggerDev
  42. copyIntoStatic.dependsOn processResources
  43. bootJar.dependsOn copyIntoStatic