Skip to content

Commit 5293487

Browse files
committed
Improve CreateAppCommand
Remove some unnecessary directories and extra configurations when creating a minimal application Closes gh-712
1 parent 2523639 commit 5293487

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

grace-shell/src/main/groovy/org/grails/cli/profile/commands/CreateAppCommand.groovy

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1086,15 +1086,20 @@ group """
10861086
protected void generateMinimalProject(GrailsConsoleAntBuilder ant, String grailsVersion, File targetDirectory) {
10871087
ant.sequential {
10881088
delete dir: "app/assets"
1089+
delete dir: "app/conf/spring"
10891090
delete dir: "app/controllers"
10901091
delete dir: "app/domain"
10911092
delete dir: "app/i18n"
1093+
delete {
1094+
fileset dir: "app/init", includes: "**/BootStrap.groovy"
1095+
}
10921096
delete dir: "app/services"
10931097
delete dir: "app/taglib"
10941098
delete dir: "app/utils"
10951099
delete dir: "app/views"
10961100
delete dir: "db"
10971101
delete dir: "src/integration-test"
1102+
delete dir: "src/main/webapp"
10981103
replace(file: 'build.gradle') {
10991104
replacetoken ' implementation "org.springframework.boot:spring-boot-starter-actuator"\n'
11001105
replacevalue ''
@@ -1126,6 +1131,9 @@ group """
11261131
replaceregexp(match: '^environments((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
11271132
fileset(dir: "app/conf", includes: 'application.yml')
11281133
}
1134+
replaceregexp(match: '^management((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
1135+
fileset(dir: "app/conf", includes: 'application.yml')
1136+
}
11291137
replaceregexp(match: '^grails(.\\n\\s+)mime:((.)*\\n\\s+.*)*', replace: "", flags: "gm") {
11301138
fileset(dir: "app/conf", includes: 'application.yml')
11311139
}

0 commit comments

Comments
 (0)