Skip to content

Commit

Permalink
Grails Bootstrap: adding new BuildSettings.GRAILS_APP_PATH property, …
Browse files Browse the repository at this point in the history
…it may be 'app' or 'grails-app' as default.
  • Loading branch information
rainboyan committed May 25, 2023
1 parent 0adeb49 commit a6f6d1c
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,11 @@ class BuildSettings {
*/
public static final File GRAILS_APP_DIR

/**
* The Path of the Grails app directory
*/
public static final String GRAILS_APP_PATH

/**
* Whether the application is running inside the development environment or deployed
*/
Expand Down Expand Up @@ -268,14 +273,12 @@ class BuildSettings {
if (new File(BASE_DIR, 'app').exists()) {
GRAILS_APP_DIR = new File(BASE_DIR, 'app')
}
else if (new File(BASE_DIR, 'grails-app').exists()) {
GRAILS_APP_DIR = new File(BASE_DIR, 'grails-app')
}
else {
GRAILS_APP_DIR = null
GRAILS_APP_DIR = new File(BASE_DIR, 'grails-app')
}
}
GRAILS_APP_DIR_PRESENT = GRAILS_APP_DIR?.exists()
GRAILS_APP_PATH = GRAILS_APP_DIR.absolutePath.substring(GRAILS_APP_DIR.absolutePath.lastIndexOf(File.separator) + 1)
GRAILS_APP_DIR_PRESENT = GRAILS_APP_DIR.exists()

String projectTargetDir = System.getProperty(PROJECT_TARGET_DIR)
if (projectTargetDir) {
Expand Down

0 comments on commit a6f6d1c

Please sign in to comment.