Skip to content

Commit 5762c8e

Browse files
committed
Add feature to profiles to show instructions
1 parent 938b07c commit 5762c8e

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

grails-shell/src/main/groovy/org/grails/cli/profile/AbstractProfile.groovy

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ abstract class AbstractProfile implements Profile {
6666
final ClassLoader classLoader
6767
protected ExclusionDependencySelector exclusionDependencySelector = new ExclusionDependencySelector()
6868
protected String description = "";
69+
protected String instructions = "";
6970
protected String version = BuildSettings.package.implementationVersion
7071

7172
AbstractProfile(Resource profileDir) {
@@ -108,6 +109,7 @@ abstract class AbstractProfile implements Profile {
108109

109110
name = profileConfig.get("name")?.toString()
110111
description = profileConfig.get("description")?.toString() ?: ''
112+
instructions = profileConfig.get("instructions")?.toString() ?: ''
111113

112114
def parents = profileConfig.get("extends")
113115
if(parents) {

grails-shell/src/main/groovy/org/grails/cli/profile/Profile.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ public interface Profile {
5151
*/
5252
String getDescription();
5353

54+
55+
/**
56+
* @return Text to display after an application has been created with the profile
57+
*/
58+
String getInstructions();
59+
5460
/**
5561
* @return The features for this profile
5662
*/

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,9 @@ class CreateAppCommand extends ArgumentCompletingCommand implements ProfileRepos
275275
executionContext.console.addStatus(
276276
"${name == 'create-plugin' ? 'Plugin' : 'Application'} created at $projectTargetDirectory.absolutePath"
277277
)
278+
if (profileInstance.instructions) {
279+
executionContext.console.addStatus(profileInstance.instructions)
280+
}
278281
GrailsCli.tiggerAppLoad()
279282
return true
280283
}

0 commit comments

Comments
 (0)