Skip to content

Commit

Permalink
Grails Console: Rename GrailsApplicationContextCommandRunner to Grail…
Browse files Browse the repository at this point in the history
…sApplicationCommandRunner

Rename DevelopmentGrailsApplication DevelopmentGrails

Rename DevelopmentWebApplicationContext to DevelopmentGrailsApplicationContext
  • Loading branch information
rainboyan committed May 21, 2023
1 parent 59e153c commit f8962c9
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import grails.config.Settings
import grails.dev.commands.ApplicationCommand
import grails.dev.commands.ApplicationContextCommandRegistry
import grails.dev.commands.ExecutionContext
import grails.ui.support.DevelopmentGrailsApplication
import grails.ui.support.DevelopmentGrails

import org.grails.build.parsing.CommandLine
import org.grails.build.parsing.CommandLineParser
Expand All @@ -33,11 +33,11 @@ import org.grails.build.parsing.CommandLineParser
* @since 3.0
*/
@CompileStatic
class GrailsApplicationContextCommandRunner extends DevelopmentGrailsApplication {
class GrailsApplicationCommandRunner extends DevelopmentGrails {

String commandName

protected GrailsApplicationContextCommandRunner(String commandName, Class<?>... sources) {
protected GrailsApplicationCommandRunner(String commandName, Class<?>... sources) {
super(sources)
this.commandName = commandName
}
Expand Down Expand Up @@ -102,7 +102,7 @@ class GrailsApplicationContextCommandRunner extends DevelopmentGrailsApplication
System.exit(1)
}

GrailsApplicationContextCommandRunner runner = new GrailsApplicationContextCommandRunner(args[0], applicationClass)
GrailsApplicationCommandRunner runner = new GrailsApplicationCommandRunner(args[0], applicationClass)
runner.run(args.init() as String[])
}
else {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,7 +18,7 @@ package grails.ui.console.support
import groovy.transform.CompileStatic
import groovy.transform.InheritConstructors

import grails.ui.support.DevelopmentWebApplicationContext
import grails.ui.support.DevelopmentGrailsApplicationContext

/**
* A {@org.springframework.web.context.WebApplicationContext} for use in the embedded Grails console
Expand All @@ -28,6 +28,6 @@ import grails.ui.support.DevelopmentWebApplicationContext
*/
@InheritConstructors
@CompileStatic
class GroovyConsoleWebApplicationContext extends DevelopmentWebApplicationContext {
class GroovyConsoleWebApplicationContext extends DevelopmentGrailsApplicationContext {

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import org.springframework.context.ConfigurableApplicationContext
import grails.config.Config
import grails.core.GrailsApplication
import grails.persistence.support.PersistenceContextInterceptor
import grails.ui.support.DevelopmentGrailsApplication
import grails.ui.support.DevelopmentGrails

/**
* Used to run Grails scripts within the context of a Grails application
Expand All @@ -32,7 +32,7 @@ import grails.ui.support.DevelopmentGrailsApplication
* @since 3.0
*/
@CompileStatic
class GrailsApplicationScriptRunner extends DevelopmentGrailsApplication {
class GrailsApplicationScriptRunner extends DevelopmentGrails {

List<File> scripts

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -18,15 +18,15 @@ package grails.ui.shell.support
import groovy.transform.CompileStatic
import groovy.transform.InheritConstructors

import grails.ui.support.DevelopmentWebApplicationContext
import grails.ui.support.DevelopmentGrailsApplicationContext

/**
* @author Graeme Rocher
* @since 3.0
*/
@CompileStatic
@InheritConstructors
class GroovyshWebApplicationContext extends DevelopmentWebApplicationContext {
class GroovyshWebApplicationContext extends DevelopmentGrailsApplicationContext {

@Override
protected void finishRefresh() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,16 +27,16 @@ import grails.boot.Grails
* @since 3.0
*/
@CompileStatic
class DevelopmentGrailsApplication extends Grails {
class DevelopmentGrails extends Grails {

protected DevelopmentGrailsApplication(Class<?>... sources) {
protected DevelopmentGrails(Class<?>... sources) {
super(sources)
configureApplicationContextClass()
}

protected configureApplicationContextClass() {
if (ClassUtils.isPresent('javax.servlet.ServletContext', Thread.currentThread().contextClassLoader)) {
setApplicationContextFactory(ApplicationContextFactory.ofContextClass(DevelopmentWebApplicationContext))
setApplicationContextFactory(ApplicationContextFactory.ofContextClass(DevelopmentGrailsApplicationContext))
}
else {
setApplicationContextFactory(ApplicationContextFactory.ofContextClass(GenericWebApplicationContext))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebSe
* @since
*/
@InheritConstructors
class DevelopmentWebApplicationContext extends AnnotationConfigServletWebServerApplicationContext {
class DevelopmentGrailsApplicationContext extends AnnotationConfigServletWebServerApplicationContext {

}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2022 the original author or authors.
* Copyright 2014-2023 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -28,7 +28,7 @@ import org.gradle.api.tasks.JavaExec
class ApplicationContextCommandTask extends JavaExec {

ApplicationContextCommandTask() {
getMainClass().set('grails.ui.command.GrailsApplicationContextCommandRunner')
getMainClass().set('grails.ui.command.GrailsApplicationCommandRunner')
dependsOn('classes', 'findMainClass')
systemProperties(System.properties.findAll { it.key.toString().startsWith('grails.') } as Map<String, Object>)
}
Expand Down

0 comments on commit f8962c9

Please sign in to comment.