Skip to content

Commit

Permalink
Improve CreateAppCommand
Browse files Browse the repository at this point in the history
Remove some unnecessary directories and extra configurations when creating a minimal application

Closes gh-712
  • Loading branch information
rainboyan committed Nov 15, 2024
1 parent 2523639 commit 5293487
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1086,15 +1086,20 @@ group """
protected void generateMinimalProject(GrailsConsoleAntBuilder ant, String grailsVersion, File targetDirectory) {
ant.sequential {
delete dir: "app/assets"
delete dir: "app/conf/spring"
delete dir: "app/controllers"
delete dir: "app/domain"
delete dir: "app/i18n"
delete {
fileset dir: "app/init", includes: "**/BootStrap.groovy"
}
delete dir: "app/services"
delete dir: "app/taglib"
delete dir: "app/utils"
delete dir: "app/views"
delete dir: "db"
delete dir: "src/integration-test"
delete dir: "src/main/webapp"
replace(file: 'build.gradle') {
replacetoken ' implementation "org.springframework.boot:spring-boot-starter-actuator"\n'
replacevalue ''
Expand Down Expand Up @@ -1126,6 +1131,9 @@ group """
replaceregexp(match: '^environments((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
fileset(dir: "app/conf", includes: 'application.yml')
}
replaceregexp(match: '^management((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
fileset(dir: "app/conf", includes: 'application.yml')
}
replaceregexp(match: '^grails(.\\n\\s+)mime:((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
fileset(dir: "app/conf", includes: 'application.yml')
}
Expand Down

0 comments on commit 5293487

Please sign in to comment.