Permalink
Browse files

Revert recent changes related to #10270

This reverts commit da38359.
This reverts commit 81cdf10.
This reverts commit 3a053bb.
  • Loading branch information...
1 parent 1c8c92d commit 721289b35a89cbf84775e3ea7da409c59e7041c7 @jeffbrown jeffbrown committed Oct 25, 2016
Showing with 346 additions and 12 deletions.
  1. +0 −1 grails-plugin-async/src/main/groovy/grails/artefact/AsyncController.groovy
  2. +33 −0 grails-plugin-async/src/main/groovy/grails/compiler/traits/AsyncControllerTraitInjector.groovy
  3. +1 −0 grails-plugin-async/src/main/resources/META-INF/grails.factories
  4. +0 −1 grails-plugin-controllers/src/main/groovy/grails/artefact/Controller.groovy
  5. +43 −0 grails-plugin-controllers/src/main/groovy/grails/compiler/traits/ControllerTraitInjector.groovy
  6. +1 −0 grails-plugin-controllers/src/main/resources/META-INF/grails.factories
  7. +2 −0 ...codehaus/groovy/grails/compiler/web/ControllerActionTransformerClosureActionOverridingSpec.groovy
  8. +2 −0 ...rs/src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerSpec.groovy
  9. +0 −1 grails-plugin-domain-class/src/main/groovy/grails/artefact/DomainClass.groovy
  10. +38 −0 grails-plugin-domain-class/src/main/groovy/grails/compiler/traits/DomainClassTraitInjector.groovy
  11. +1 −0 grails-plugin-domain-class/src/main/resources/META-INF/grails.factories
  12. +36 −0 grails-plugin-gsp/src/ast/groovy/grails/compiler/traits/ControllerTagLibraryTraitInjector.groovy
  13. +1 −0 grails-plugin-gsp/src/main/resources/META-INF/grails.factories
  14. +0 −1 grails-plugin-interceptors/src/main/groovy/grails/artefact/Interceptor.groovy
  15. +39 −0 grails-plugin-interceptors/src/main/groovy/grails/compiler/traits/InterceptorTraitInjector.groovy
  16. +1 −0 grails-plugin-interceptors/src/main/resources/META-INF/grails.factories
  17. +0 −2 grails-plugin-rest/src/main/groovy/grails/artefact/controller/RestResponder.groovy
  18. +32 −0 grails-plugin-rest/src/main/groovy/grails/compiler/traits/RestResponderTraitInjector.groovy
  19. +1 −0 grails-plugin-rest/src/main/resources/META-INF/grails.factories
  20. +0 −1 grails-plugin-services/src/main/groovy/grails/artefact/Service.groovy
  21. +38 −0 grails-plugin-services/src/main/groovy/grails/compiler/traits/ServiceTraitInjector.groovy
  22. +1 −0 grails-plugin-services/src/main/resources/META-INF/grails.factories
  23. +37 −0 grails-web-databinding/src/main/groovy/grails/compiler/traits/WebDataBindingTraitInjector.groovy
  24. +0 −2 grails-web-databinding/src/main/groovy/grails/web/databinding/WebDataBinding.groovy
  25. +1 −0 grails-web-databinding/src/main/resources/META-INF/grails.factories
  26. +0 −1 grails-web-taglib/src/main/groovy/grails/artefact/TagLibrary.groovy
  27. +0 −2 grails-web-taglib/src/main/groovy/grails/artefact/gsp/TagLibraryInvoker.groovy
  28. +37 −0 grails-web-taglib/src/main/groovy/grails/compiler/traits/TagLibraryTraitInjector.groovy
  29. +1 −0 grails-web-taglib/src/main/resources/META-INF/grails.factories
@@ -37,7 +37,6 @@ import org.springframework.web.context.request.RequestContextHolder
*
*/
@CompileStatic
-@Enhances('Controller')
trait AsyncController extends Events {
/**
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.AsyncController
+
+/**
+ *
+ * @author Jeff Brown
+ * @since 3.0
+ *
+ */
+class AsyncControllerTraitInjector extends ControllerTraitInjector {
+
+ @Override
+ Class getTrait() {
+ AsyncController
+ }
+
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.AsyncControllerTraitInjector
@@ -66,7 +66,6 @@ import java.lang.reflect.Method
*
*/
@CompileStatic
-@Enhances('Controller')
trait Controller implements ResponseRenderer, ResponseRedirector, RequestForwarder, DataBinder, WebAttributes, ServletAttributes {
private MimeTypesApiSupport mimeTypesSupport = new MimeTypesApiSupport()
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.Controller
+import groovy.transform.CompileStatic
+
+/**
+ *
+ * A {@link TraitInjector} that injects controllers with the {@link Controller} trait
+ *
+ * @author Jeff Brown
+ * @author Graeme Rocher
+ *
+ * @since 3.0
+ *
+ */
+@CompileStatic
+class ControllerTraitInjector implements TraitInjector {
+
+ @Override
+ Class getTrait() {
+ Controller
+ }
+
+ @Override
+ String[] getArtefactTypes() {
+ ['Controller'] as String[]
+ }
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.ControllerTraitInjector
@@ -1,6 +1,8 @@
package org.codehaus.groovy.grails.compiler.web
import grails.compiler.ast.ClassInjector
+import grails.compiler.traits.ControllerTraitInjector
+import grails.compiler.traits.TraitInjector
import grails.util.GrailsWebMockUtil
import org.grails.compiler.injection.GrailsAwareClassLoader
@@ -1,6 +1,8 @@
package org.codehaus.groovy.grails.compiler.web
import grails.compiler.ast.ClassInjector
+import grails.compiler.traits.ControllerTraitInjector
+import grails.compiler.traits.TraitInjector
import grails.util.BuildSettings
import grails.util.GrailsWebMockUtil
import grails.web.Action
@@ -32,7 +32,6 @@ import org.grails.core.artefact.DomainClassArtefactHandler
*
*/
@CompileStatic
-@Enhances('Domain')
trait DomainClass {
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.DomainClass
+import org.grails.core.artefact.DomainClassArtefactHandler
+
+/**
+ *
+ * @author Jeff Brown
+ * @since 3.0
+ *
+ */
+class DomainClassTraitInjector implements TraitInjector {
+
+ Class getTrait() {
+ DomainClass
+ }
+
+
+ @Override
+ String[] getArtefactTypes() {
+ [DomainClassArtefactHandler.TYPE]
+ }
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.DomainClassTraitInjector
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2014 original authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.gsp.TagLibraryInvoker
+import groovy.transform.CompileStatic
+
+
+
+/**
+ * A {@link TraitInjector} that adds the ability to invoke tag libraries from a controller
+ *
+ * @author Graeme Rocher
+ * @since 3.0
+ */
+@CompileStatic
+class ControllerTagLibraryTraitInjector extends ControllerTraitInjector {
+
+ @Override
+ Class getTrait() {
+ TagLibraryInvoker
+ }
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.ControllerTagLibraryTraitInjector
@@ -50,7 +50,6 @@ import java.util.regex.Pattern
* @since 3.0
*/
@CompileStatic
-@Enhances('Interceptor')
trait Interceptor implements ResponseRenderer, ResponseRedirector, RequestForwarder, DataBinder, WebAttributes, ServletAttributes, Ordered {
/**
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2015 original authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.Interceptor
+import groovy.transform.CompileStatic
+
+/**
+ * Injects the {@link Interceptor} trait by convention
+ *
+ * @author Graeme Rocher
+ * @since 3.0
+ */
+@CompileStatic
+class InterceptorTraitInjector implements TraitInjector {
+
+ @Override
+ Class getTrait() {
+ Interceptor
+ }
+
+ @Override
+ String[] getArtefactTypes() {
+ ['Interceptor'] as String[]
+ }
+}
@@ -1 +1,2 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.InterceptorTraitInjector
grails.core.ArtefactHandler=org.grails.plugins.web.interceptors.InterceptorArtefactHandler
@@ -15,7 +15,6 @@
*/
package grails.artefact.controller
-import grails.artefact.Enhances
import groovy.transform.CompileDynamic
import grails.artefact.Controller
import grails.artefact.controller.support.ResponseRenderer
@@ -45,7 +44,6 @@ import org.springframework.validation.Errors
*
*/
@CompileStatic
-@Enhances('Controller')
trait RestResponder {
private String PROPERTY_RESPONSE_FORMATS = "responseFormats"
@@ -0,0 +1,32 @@
+/*
+ * Copyright 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.artefact.controller.RestResponder
+
+/**
+ *
+ * @author Jeff Brown
+ * @since 3.0
+ *
+ */
+class RestResponderTraitInjector extends ControllerTraitInjector {
+
+ @Override
+ Class getTrait() {
+ RestResponder
+ }
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.RestResponderTraitInjector
@@ -24,6 +24,5 @@ import grails.events.Events
* @author Graeme Rocher
* @since 3.0
*/
-@Enhances('Service')
trait Service extends Events {
}
@@ -0,0 +1,38 @@
+/*
+ * Copyright 2015 original authors
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package grails.compiler.traits
+
+import grails.artefact.Service
+
+/**
+ * A {@link TraitInjector} for services
+ *
+ * @author Graeme Rocher
+ * @since 3.0
+ */
+class ServiceTraitInjector implements TraitInjector {
+
+ @Override
+ Class getTrait() {
+ Service
+ }
+
+ @Override
+ String[] getArtefactTypes() {
+ ['Service'] as String[]
+ }
+}
@@ -0,0 +1 @@
+grails.compiler.traits.TraitInjector=grails.compiler.traits.ServiceTraitInjector
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2014 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.compiler.traits
+
+import grails.web.databinding.WebDataBinding
+import org.grails.core.artefact.DomainClassArtefactHandler
+
+/**
+ *
+ * @author Jeff Brown
+ * @since 3.0
+ *
+ */
+class WebDataBindingTraitInjector implements TraitInjector {
+
+ Class getTrait() {
+ WebDataBinding
+ }
+
+ @Override
+ String[] getArtefactTypes() {
+ [DomainClassArtefactHandler.TYPE]
+ }
+}
Oops, something went wrong.

0 comments on commit 721289b

Please sign in to comment.