jamesfredley commented on code in PR #15698:
URL: https://github.com/apache/grails-core/pull/15698#discussion_r3424575431
##########
grails-core/src/main/groovy/grails/boot/GrailsApp.groovy:
##########
@@ -64,6 +65,16 @@ class GrailsApp extends SpringApplication {
private static final String GRAILS_BANNER = 'grails-banner.txt'
private static final String SPRING_PROFILES = 'spring.profiles.active'
+ /**
+ * System property holding the path of the PID file the application should
write on startup.
+ * It is set by the CLI {@code run-app} command as {@code
grails.cli.pid.file}; the
+ * {@code grails.} prefix is stripped when the property is forwarded into
this forked JVM by
+ * {@code GrailsGradlePlugin}, so it is read here without the prefix. When
present, the PID
+ * file lets {@code stop-app} terminate this process. It is never set for
a normally deployed
+ * application, so production runs are unaffected.
+ */
+ private static final String CLI_PID_FILE_PROPERTY = 'cli.pid.file'
Review Comment:
Done in 9a132a87fa - the property is now `grails.cli.pid.file`. It is set
directly on the `bootRun` task by `GrailsGradlePlugin` and read under the same
scoped name in `GrailsApp.run()`.
##########
grails-profiles/base/commands/stop-app.groovy:
##########
Review Comment:
This should be more robust now in 9a132a87fa. The `bootRun` task always
injects `-Dgrails.cli.pid.file=<build>/run-app.pid` via a
`CommandLineArgumentProvider`, so the forked app writes that PID file and
`stop-app` reads the same hard-coded location - including from interactive mode
and from a separate CLI invocation. Mind giving it another try?
##########
grails-core/src/main/resources/META-INF/spring-configuration-metadata.json:
##########
@@ -78,6 +82,12 @@
"description": "The default package used when generating artefacts
with grails create-* commands.",
"defaultValue": "Set by project template"
},
+ {
+ "name": "grails.cli.pid.file",
Review Comment:
Removed in 9a132a87fa. `grails.cli.pid.file` is internal CLI/Gradle wiring
(a system property set on `bootRun`), not a user-facing config property, so I
dropped the metadata property and the `Command Line` group (plus the matching
`grails-doc` ordering) rather than documenting it.
##########
grails-gradle/plugins/src/main/groovy/org/grails/gradle/plugin/core/GrailsGradlePlugin.groovy:
##########
@@ -593,6 +597,23 @@ class GrailsGradlePlugin extends GroovyPlugin {
configureToolchainForForkTasks(project)
}
+ protected void configureBootRunPidFile(Project project) {
+ project.afterEvaluate {
Review Comment:
Done in 9a132a87fa - replaced `afterEvaluate` with
`project.pluginManager.withPlugin('org.springframework.boot') { ... }`, then
`tasks.withType(BootRun).configureEach { ... }`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]