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.

2 yıl önce
2 yıl önce
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. apply plugin: 'org.springframework.boot'
  2. apply plugin: 'com.gorylenko.gradle-git-properties'
  3. apply plugin: 'com.github.node-gradle.gulp'
  4. dependencies {
  5. testCompile "com.h2database:h2"
  6. }
  7. def profiles = 'prod'
  8. if (project.hasProperty('no-liquibase')) {
  9. profiles += ',no-liquibase'
  10. }
  11. if (project.hasProperty('swagger')) {
  12. profiles += ',swagger'
  13. }
  14. bootRun {
  15. args = []
  16. }
  17. task copySwagger(type: NpmTask, dependsOn: 'npm_install') {
  18. args = ["run", "copy-swagger"]
  19. }
  20. war {
  21. webAppDirName = 'build/www/'
  22. }
  23. task copyIntoStatic (type: Copy) {
  24. from 'build/www/'
  25. into 'build/resources/main/static'
  26. }
  27. processResources {
  28. filesMatching('**/application.yml') {
  29. filter {
  30. it.replace('#project.version#', version)
  31. }
  32. filter {
  33. it.replace('#spring.profiles.active#', profiles)
  34. }
  35. }
  36. }
  37. generateGitProperties {
  38. onlyIf {
  39. !source.isEmpty()
  40. }
  41. }
  42. gitProperties {
  43. keys = ['git.branch', 'git.commit.id.abbrev', 'git.commit.id.describe']
  44. }
  45. processResources.dependsOn copySwagger
  46. copyIntoStatic.dependsOn processResources
  47. bootJar.dependsOn copyIntoStatic