Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

move trait injection related classes to grails.compiler.traits

We may not end up sticking with this but for now I am moving all of the trait injectors to the same package.  We may end up wanting a single package or a configurable list of packages which allow plugins to contribute trait injectors.
  • Loading branch information...
commit 765cb8f787d0d7b19408a451b194707ac282b1fa 1 parent 02055df
@jeffbrown jeffbrown authored
View
2  ...ils/compiler/injection/TraitInjector.java → ...grails/compiler/traits/TraitInjector.java
@@ -14,7 +14,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.grails.compiler.injection;
+package grails.compiler.traits;
import java.net.URL;
View
1  grails-core/src/main/groovy/org/grails/compiler/injection/ArtefactTypeAstTransformation.java
@@ -26,6 +26,7 @@
import grails.compiler.ast.AllArtefactClassInjector;
import grails.compiler.ast.ClassInjector;
import grails.compiler.ast.GrailsArtefactClassInjector;
+import grails.compiler.traits.TraitInjector;
import groovy.transform.CompilationUnitAware;
import org.codehaus.groovy.ast.ASTNode;
View
1  grails-core/src/main/groovy/org/grails/compiler/injection/EntityASTTransformation.java
@@ -18,6 +18,7 @@
import grails.build.logging.GrailsConsole;
import grails.compiler.ast.ClassInjector;
import grails.compiler.ast.GrailsDomainClassInjector;
+import grails.compiler.traits.TraitInjector;
import grails.persistence.Entity;
import groovy.transform.CompilationUnitAware;
View
1  grails-core/src/main/groovy/org/grails/compiler/injection/GrailsAwareClassLoader.java
@@ -16,6 +16,7 @@
package org.grails.compiler.injection;
import grails.compiler.ast.ClassInjector;
+import grails.compiler.traits.TraitInjector;
import groovy.lang.GroovyClassLoader;
import org.codehaus.groovy.control.CompilationUnit;
View
11 ...ore/src/main/groovy/org/grails/compiler/injection/GrailsAwareTraitInjectionOperation.java
@@ -15,6 +15,8 @@
*/
package org.grails.compiler.injection;
+import grails.compiler.traits.TraitInjector;
+
import java.net.URL;
import java.util.ArrayList;
import java.util.Collections;
@@ -46,10 +48,7 @@
protected CompilationUnit unit;
protected static List<TraitInjector> classInjectors;
- private static final String[] PACKAGES_TO_SCAN = {
- "org.grails.compiler.web",
- "org.grails.domain.compiler"
- };
+ private static final String PACKAGE_TO_SCAN = "grails.compiler.traits";
public GrailsAwareTraitInjectionOperation(CompilationUnit unit) {
this.unit = unit;
@@ -117,14 +116,14 @@ protected static void initializeState() {
ClassLoader classLoader = Thread.currentThread()
.getContextClassLoader();
scanner.setResourceLoader(new DefaultResourceLoader(classLoader));
- scanner.scan(PACKAGES_TO_SCAN);
+ scanner.scan(PACKAGE_TO_SCAN);
// fallback to current classloader for special cases (e.g. gradle
// classloader isolation with useAnt=false)
if (registry.getBeanDefinitionCount() == 0) {
classLoader = GrailsAwareInjectionOperation.class.getClassLoader();
scanner.setResourceLoader(new DefaultResourceLoader(classLoader));
- scanner.scan(PACKAGES_TO_SCAN);
+ scanner.scan(PACKAGE_TO_SCAN);
}
for (String beanName : registry.getBeanDefinitionNames()) {
View
3  ...mpiler/web/ControllerTraitInjector.groovy → ...ler/traits/ControllerTraitInjector.groovy
@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.grails.compiler.web
+package grails.compiler.traits
import grails.artefact.Controller
import java.util.regex.Pattern
-import org.grails.compiler.injection.TraitInjector
import org.grails.io.support.GrailsResourceUtils
/**
View
6 .../groovy/grails/compiler/web/ControllerActionTransformerClosureActionOverridingSpec.groovy
@@ -1,13 +1,13 @@
package org.codehaus.groovy.grails.compiler.web
import grails.util.GrailsWebUtil
-
import grails.compiler.ast.ClassInjector
+import grails.compiler.traits.ControllerTraitInjector;
+import grails.compiler.traits.TraitInjector;
+
import org.grails.compiler.injection.GrailsAwareClassLoader
-import org.grails.compiler.injection.TraitInjector
import org.grails.plugins.web.controllers.api.ControllersApi
import org.grails.compiler.web.ControllerActionTransformer
-import org.grails.compiler.web.ControllerTraitInjector
import org.grails.compiler.web.ControllerTransformer
import org.springframework.web.context.request.RequestContextHolder
View
6 ...est/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerSpec.groovy
@@ -3,16 +3,18 @@ package org.codehaus.groovy.grails.compiler.web
import grails.util.BuildSettings
import grails.util.GrailsWebUtil
import grails.web.Action
+
import org.grails.compiler.web.ControllerActionTransformer
-import org.grails.compiler.web.ControllerTraitInjector
import org.grails.compiler.web.ControllerTransformer
import java.lang.reflect.Modifier
import grails.web.servlet.context.GrailsWebApplicationContext
import grails.compiler.ast.ClassInjector
+import grails.compiler.traits.ControllerTraitInjector;
+import grails.compiler.traits.TraitInjector;
+
import org.grails.compiler.injection.GrailsAwareClassLoader
-import org.grails.compiler.injection.TraitInjector
import org.springframework.web.context.WebApplicationContext
import org.springframework.web.context.request.RequestContextHolder
View
6 .../src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformerSpec.groovy
@@ -1,15 +1,17 @@
package org.codehaus.groovy.grails.compiler.web
import grails.util.GrailsWebUtil
-import org.grails.compiler.web.ControllerTraitInjector
+
import org.grails.compiler.web.ControllerTransformer
import javax.servlet.http.HttpServletRequest
import grails.core.GrailsApplication
import grails.compiler.ast.ClassInjector
+import grails.compiler.traits.ControllerTraitInjector;
+import grails.compiler.traits.TraitInjector;
+
import org.grails.compiler.injection.GrailsAwareClassLoader
-import org.grails.compiler.injection.TraitInjector
import org.springframework.web.context.request.RequestContextHolder
import spock.lang.Specification
View
3  .../compiler/DomainClassTraitInjector.groovy → ...er/traits/DomainClassTraitInjector.groovy
@@ -13,11 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.grails.domain.compiler
+package grails.compiler.traits
import grails.artefact.DomainClass
-import org.grails.compiler.injection.TraitInjector
import org.grails.core.artefact.DomainClassArtefactHandler
import org.grails.io.support.GrailsResourceUtils
View
3  ...web/taglib/TagLibraryTraitInjector.groovy → ...ler/traits/TagLibraryTraitInjector.groovy
@@ -13,13 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package org.grails.compiler.web.taglib
+package grails.compiler.traits
import grails.artefact.TagLibrary
import java.util.regex.Pattern
-import org.grails.compiler.injection.TraitInjector
import org.grails.io.support.GrailsResourceUtils
/**
Please sign in to comment.
Something went wrong with that request. Please try again.