Skip to content
Browse files

whitespace/cleanup

  • Loading branch information...
1 parent b16466c commit a4ebf48e774b6800a62ba90aafb0f81188038452 @burtbeckwith burtbeckwith committed Jul 22, 2011
Showing with 1,538 additions and 1,867 deletions.
  1. +2 −2 grails-bootstrap/build.gradle
  2. +4 −6 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateAll.groovy
  3. +4 −6 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateController.groovy
  4. +4 −6 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateViews.groovy
  5. +10 −33 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
  6. +54 −65 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
  7. +1 −0 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
  8. +47 −48 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
  9. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineInputHandler.java
  10. +6 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  11. +2 −3 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
  12. +1 −1 ...trap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/GrailsInteractiveCompletor.groovy
  13. +7 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
  14. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleAntBuilder.java
  15. +1 −1 ...otstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleErrorPrintStream.java
  16. +1 −1 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsolePrintStream.java
  17. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLine.java
  18. +52 −53 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParser.java
  19. +9 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/DefaultCommandLine.java
  20. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/Option.java
  21. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/ParseException.java
  22. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/BuildSettingsAware.java
  23. +5 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ClasspathConfigurer.java
  24. +1 −1 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/MetaClassRegistryCleaner.java
  25. +2 −3 ...-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/PluginPathDiscoverySupport.java
  26. +5 −4 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ScriptBindingInitializer.java
  27. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
  28. +7 −9 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/GrailsResourceUtils.java
  29. +2 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsVersionUtils.groovy
  30. +15 −13 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
  31. +25 −28 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepository.java
  32. +1 −1 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/LastModifiedResolvedResource.java
  33. +2 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
  34. +3 −2 grails-core/src/main/groovy/grails/artefact/ApiDelegate.java
  35. +2 −2 grails-core/src/main/groovy/grails/artefact/Artefact.java
  36. +3 −3 grails-core/src/main/groovy/grails/artefact/Enhanced.java
  37. +1 −1 grails-core/src/main/groovy/grails/validation/DeferredBindingActions.java
  38. +2 −3 grails-core/src/main/groovy/grails/web/Action.java
  39. +1 −1 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
  40. +5 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ComponentCapableDomainClass.java
  41. +2 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClass.java
  42. +2 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsControllerClass.java
  43. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/ConfigurationHelper.groovy
  44. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/env/GrailsEnvironment.java
  45. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/BaseApiProvider.java
  46. +4 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/MetaClassEnhancer.groovy
  47. +1 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsRuntimeConfigurator.java
  48. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/DirectoryWatcher.java
  49. +8 −12 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectCompiler.groovy
  50. +10 −15 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectPackager.groovy
  51. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java
  52. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/PackagingException.java
  53. +30 −16 .../main/groovy/org/codehaus/groovy/grails/compiler/injection/AbstractGrailsArtefactTransformer.java
  54. +1 −1 ...-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/AllArtefactClassInjector.java
  55. +1 −1 ...core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ApiDelegateTransformation.java
  56. +8 −7 .../src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ArtefactTypeAstTransformation.java
  57. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/AstTransformer.java
  58. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
  59. +2 −2 ...re/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsArtefactClassInjector.java
  60. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GroovyPageInjector.java
  61. +1 −1 ...core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/PluginAwareAstTransformer.java
  62. +5 −8 ...ehaus/groovy/grails/context/annotation/ClosureClassIgnoringComponentScanBeanDefinitionParser.java
  63. +23 −24 grails-core/src/main/groovy/org/codehaus/groovy/grails/core/io/DefaultResourceLocator.java
  64. +22 −25 ...e/src/main/groovy/org/codehaus/groovy/grails/core/io/PluginPathAwareFileSystemResourceLoader.java
  65. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/core/io/ResourceLocator.java
  66. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/core/io/StaticResourceLocator.java
  67. +4 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTraceFilterer.java
  68. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTracePrinter.groovy
  69. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/exceptions/StackTraceFilterer.java
  70. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/exceptions/StackTracePrinter.groovy
  71. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/lifecycle/ShutdownOperations.java
  72. +2 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/AbstractGrailsPluginManager.java
  73. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
  74. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CoreGrailsPlugin.groovy
  75. +14 −13 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java
  76. +9 −11 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPluginManager.java
  77. +5 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPlugin.java
  78. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginManager.java
  79. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/ProfilingGrailsPluginManager.java
  80. +3 −6 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/Servlet3AsyncWebXmlProcessor.groovy
  81. +2 −2 ...re/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGenerator.groovy
  82. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginPackager.groovy
  83. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/WatchPattern.groovy
  84. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/WatchPatternParser.java
  85. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/SimpleMapResourceLoader.java
  86. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstraintsEvaluator.java
  87. +2 −3 ...s-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstraintsEvaluatorFactoryBean.java
  88. +6 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/DefaultConstraintEvaluator.java
  89. +9 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
  90. +10 −17 grails-core/src/test/groovy/org/codehaus/groovy/grails/core/io/ResourceLocatorSpec.groovy
  91. +2 −2 grails-docs/src/main/groovy/grails/doc/DocPublisher.groovy
  92. +1 −1 grails-docs/src/main/groovy/grails/doc/LegacyDocMigrator.groovy
  93. +2 −2 grails-docs/src/main/groovy/grails/doc/internal/YamlTocStrategy.groovy
  94. +1 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.java
  95. +1 −1 ...hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormValidationTransformer.java
  96. +1 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/SessionFactoryHolder.java
  97. +1 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/SessionFactoryProxy.java
  98. +2 −2 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GORMSessionFactoryDefinitionParser.java
  99. +64 −69 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java
  100. +1 −1 ...rnate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/HibernateMappingBuilder.groovy
  101. +3 −2 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ExecuteQueryPersistentMethod.java
  102. +1 −5 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventListener.java
  103. +2 −3 ...n/groovy/org/codehaus/groovy/grails/orm/hibernate/support/GrailsOpenSessionInViewInterceptor.java
  104. +1 −1 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/HibernateConstraintsEvaluator.java
  105. +8 −5 ...s/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ASTBeanPropertyBindingResultHelper.java
  106. +1 −3 ...s-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ASTErrorsHelper.java
  107. +56 −68 ...trollers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformer.java
  108. +1 −1 ...trollers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerDomainTransformer.java
  109. +5 −8 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformer.java
  110. +3 −3 ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java
  111. +2 −2 ...llers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersDomainBindingApi.java
  112. +1 −1 ...gin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RenderDynamicMethod.java
  113. +2 −3 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/WebMetaUtils.groovy
  114. +43 −42 ...roovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerCommandObjectSpec.groovy
  115. +11 −11 ...y/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerCompilationErrorsSpec.groovy
  116. +17 −29 ...vy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerParameterBindingSpec.groovy
  117. +2 −3 ...n/groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersControllersTransformer.java
  118. +1 −1 ...c/main/groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersDomainTransformer.java
  119. +1 −1 ...ters/src/main/groovy/org/codehaus/groovy/grails/plugins/converters/ConvertersPluginSupport.groovy
  120. +1 −1 ...n-converters/src/main/groovy/org/codehaus/groovy/grails/plugins/converters/api/ConvertersApi.java
  121. +2 −3 ...src/main/groovy/org/codehaus/groovy/grails/plugins/converters/api/ConvertersControllersApi.groovy
  122. +4 −4 .../groovy/org/codehaus/groovy/grails/web/converters/AbstractParsingParameterCreationListener.groovy
  123. +2 −2 .../main/groovy/org/codehaus/groovy/grails/web/converters/XMLParsingParameterCreationListener.groovy
  124. +1 −1 ...ers/src/main/groovy/org/codehaus/groovy/grails/web/converters/marshaller/xml/ArrayMarshaller.java
  125. +1 −1 ...rc/main/groovy/org/codehaus/groovy/grails/web/converters/marshaller/xml/CollectionMarshaller.java
  126. +1 −1 ...in-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/gsp/GroovyPageOptimizerVisitor.java
  127. +1 −1 ...rc/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/ControllerTagLibraryTransformer.java
  128. +1 −1 ...ugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/TagLibraryTransformer.java
  129. +2 −2 ...plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllerTagLibraryApi.java
  130. +4 −4 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/TagLibraryApi.java
  131. +3 −2 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  132. +8 −10 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  133. +4 −6 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/JavascriptTagLib.groovy
  134. +2 −3 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/RenderTagLib.groovy
  135. +1 −1 ...lugin-logging/src/main/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformer.java
  136. +1 −1 ...plugin-logging/src/main/groovy/org/codehaus/groovy/grails/plugins/logging/LoggingInitializer.java
  137. +1 −1 ...g/src/main/groovy/org/codehaus/groovy/grails/plugins/logging/appenders/GrailsConsoleAppender.java
  138. +2 −2 grails-plugin-logging/src/main/groovy/org/slf4j/impl/GrailsLog4jLoggerAdapter.java
  139. +1 −1 grails-plugin-logging/src/main/groovy/org/slf4j/impl/GrailsLog4jMDCAdapter.java
  140. +2 −2 grails-plugin-logging/src/main/groovy/org/slf4j/impl/GrailsSlf4jLoggerFactory.java
  141. +2 −2 grails-plugin-logging/src/main/groovy/org/slf4j/impl/StaticLoggerBinder.java
  142. +1 −1 grails-plugin-logging/src/main/groovy/org/slf4j/impl/StaticMDCBinder.java
  143. +1 −1 grails-plugin-logging/src/main/groovy/org/slf4j/impl/StaticMarkerBinder.java
  144. +2 −2 ...lugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/compiler/web/MimeTypesTransformer.java
  145. +4 −4 ...metypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersMimeTypesApi.groovy
  146. +3 −7 ...n-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/MimeTypesApiSupport.groovy
  147. +4 −6 ...n-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/RequestMimeTypesApi.groovy
  148. +2 −2 ...-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ResponseMimeTypesApi.groovy
  149. +18 −17 ...imetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/mimes/MimeTypesFactoryBean.groovy
  150. +14 −11 grails-plugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/web/mime/DefaultMimeUtility.java
  151. +4 −4 grails-plugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/web/mime/MimeUtility.java
  152. +2 −2 ...ervlets/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ServletsGrailsPluginSupport.groovy
  153. +2 −2 ...ugin-servlets/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ServletRequestApi.groovy
  154. +2 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/TestFor.java
  155. +2 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/TestMixin.java
  156. +5 −6 grails-plugin-testing/src/main/groovy/grails/test/mixin/services/ServiceUnitTestMixin.groovy
  157. +2 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/GrailsUnitTestMixin.groovy
  158. +2 −2 ...ls-plugin-testing/src/main/groovy/grails/test/mixin/support/GroovyPageUnitTestResourceLoader.java
  159. +2 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/LazyTagLibraryLookup.java
  160. +2 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/MixinMethod.java
  161. +7 −11 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/ControllerUnitTestMixin.groovy
  162. +1 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/FiltersUnitTestMixin.groovy
  163. +2 −3 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/GroovyPageUnitTestMixin.groovy
  164. +3 −3 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/UrlMappingsUnitTestMixin.groovy
  165. +4 −4 grails-plugin-testing/src/main/groovy/grails/test/mixin/webflow/WebFlowUnitTestMixin.groovy
  166. +18 −18 ...esting/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/MockTransformation.java
  167. +2 −2 ...ing/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestForTransformation.java
  168. +2 −2 ...g/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestMixinTransformation.java
  169. +2 −3 ...s-plugin-testing/src/main/groovy/org/codehaus/groovy/grails/test/compiler/GrailsTestCompiler.java
  170. +9 −19 grails-plugin-testing/src/test/groovy/grails/test/mixin/WebFlowUnitTestMixinTests.groovy
  171. +1 −1 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/IsolatedTomcat.java
  172. +1 −2 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/ParentDelegatingClassLoader.java
  173. +1 −1 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatLoader.groovy
  174. +1 −1 ...ngs/src/main/groovy/org/codehaus/groovy/grails/plugins/web/mapping/UrlMappingsGrailsPlugin.groovy
  175. +2 −5 ...gin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappings.groovy
  176. +3 −3 ...url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/filter/UrlMappingsFilter.java
  177. +1 −1 ...lugin-validation/src/main/groovy/org/codehaus/groovy/grails/plugins/ValidationGrailsPlugin.groovy
  178. +33 −34 grails-resources/src/grails/home/dsl-support/dsld/grails.dsld
  179. +1 −1 grails-resources/src/war/css/errors.css
  180. +1 −8 ...tence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AllDeleteOrphanMappingTests.groovy
  181. +2 −14 ...odehaus/groovy/grails/orm/hibernate/CompositeIdentifierWithCustomColumnNamesAndHasOneTests.groovy
  182. +2 −15 ...ovy/org/codehaus/groovy/grails/orm/hibernate/CompositeIdentifierWithCustomColumnNamesTests.groovy
  183. +0 −9 ...tence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/CustomComponentMappingTests.groovy
  184. +1 −12 ...tence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/DefaultIndexDefinitionTests.groovy
  185. +2 −12 ...est/groovy/org/codehaus/groovy/grails/orm/hibernate/OneToOneAndOneToManyWithBelongsToTests.groovy
  186. +1 −1 ...g/codehaus/groovy/grails/orm/hibernate/support/HibernatePersistenceContextInterceptorTests.groovy
  187. +34 −34 ...src/test/groovy/org/codehaus/groovy/grails/scaffolding/DefaultGrailsTemplateGeneratorTests.groovy
  188. +15 −15 ...ce/src/test/groovy/org/codehaus/groovy/grails/validation/AssociationsValidationErrorsTests.groovy
  189. +1 −1 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManagerTests.groovy
  190. +1 −1 ...ber/src/test/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsLayoutDecoratorMapperTests.java
  191. +1 −5 ...ite-uber/test/test-projects/nested-inline-plugins/plugins/plugin-two/PluginTwoGrailsPlugin.groovy
  192. +4 −10 ...-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/binding/BindingExcludeTests.groovy
  193. +54 −64 ...st-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/binding/JSONBindingToNullTests.groovy
  194. +3 −11 ...est-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/binding/NestedXmlBindingTests.groovy
  195. +4 −14 ...src/test/groovy/org/codehaus/groovy/grails/web/converters/ControllerWithXmlConvertersTests.groovy
  196. +5 −14 ...ls-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/converters/JSONArrayTests.groovy
  197. +8 −8 grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/FormTagLib3Tests.groovy
  198. +1 −1 ...test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/JavascriptTagLibTests.groovy
  199. +11 −12 grails-test-suite-web/src/test/groovy/org/codehaus/groovy/grails/web/taglib/RenderTagLibTests.groovy
  200. +14 −18 ...st/src/main/groovy/org/codehaus/groovy/grails/plugins/testing/GrailsMockHttpServletRequest.groovy
  201. +1 −1 grails-test/src/main/groovy/org/codehaus/groovy/grails/plugins/testing/GrailsMockMultipartFile.java
  202. +1 −1 grails-test/src/main/groovy/org/codehaus/groovy/grails/test/event/GrailsTestRunNotifier.java
  203. +23 −106 grails-web/src/main/groovy/grails/gsp/PageRenderer.groovy
  204. +3 −3 grails-web/src/main/groovy/grails/util/GrailsWebUtil.java
  205. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/compiler/web/pages/GroovyPageClassLoader.java
  206. +1 −1 ...b/src/main/groovy/org/codehaus/groovy/grails/compiler/web/pages/GroovyPageInjectionOperation.java
  207. +2 −3 grails-web/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/CommonWebApi.java
  208. +3 −5 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/binding/CompositeEditor.java
  209. +62 −26 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/binding/GrailsDataBinder.java
  210. +0 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/context/GrailsContextLoader.java
  211. +10 −16 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/errors/ErrorsViewStackTracePrinter.groovy
  212. +1 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/errors/GrailsExceptionResolver.java
  213. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/json/parser/Token.java
  214. +3 −3 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/json/parser/TokenMgrError.java
  215. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/mapping/CachingLinkGenerator.java
  216. +1 −9 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultLinkGenerator.groovy
  217. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/mapping/LinkGenerator.java
  218. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/mime/MimeType.groovy
  219. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GSPResponseWriter.java
  220. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPage.java
  221. +9 −11 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageResourceLoader.java
  222. +7 −7 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageScanner.java
  223. +7 −5 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPageWritable.java
  224. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/GroovyPagesServlet.java
  225. +17 −17 ...oovy/org/codehaus/groovy/grails/web/pages/discovery/CachingGrailsConventionGroovyPageLocator.java
  226. +6 −6 ...-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/discovery/CachingGroovyPageLocator.java
  227. +4 −3 ...groovy/org/codehaus/groovy/grails/web/pages/discovery/CachingGroovyPageStaticResourceLocator.java
  228. +46 −39 ...-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/discovery/DefaultGroovyPageLocator.java
  229. +60 −59 ...main/groovy/org/codehaus/groovy/grails/web/pages/discovery/GrailsConventionGroovyPageLocator.java
  230. +2 −8 ...rc/main/groovy/org/codehaus/groovy/grails/web/pages/discovery/GroovyPageResourceScriptSource.java
  231. +4 −5 ...c/main/groovy/org/codehaus/groovy/grails/web/pages/discovery/GroovyPageStaticResourceLocator.java
  232. +4 −9 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/exceptions/GroovyPagesException.java
  233. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/ext/jsp/TldReader.groovy
  234. +1 −1 ...ls-web/src/main/groovy/org/codehaus/groovy/grails/web/pages/ext/jsp/WebXmlTagLibraryReader.groovy
  235. +4 −5 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/ErrorHandlingServlet.java
  236. +22 −23 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServlet.java
  237. +1 −1 ...eb/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerHelper.java
  238. +2 −2 ...web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/ClosureGrailsControllerHelper.java
  239. +1 −1 ...src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/DefaultRequestStateLookupStrategy.java
  240. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/GrailsParameterMap.groovy
  241. +1 −1 .../src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/GrailsRequestStateLookupStrategy.java
  242. +1 −1 ...-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/MethodGrailsControllerHelper.java
  243. +6 −5 ...s-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/MixedGrailsControllerHelper.java
  244. +2 −3 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/view/GrailsViewResolver.java
  245. +1 −1 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/servlet/view/GroovyPageView.java
  246. +10 −24 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsLayoutDecoratorMapper.java
  247. +27 −20 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsPageFilter.java
  248. +4 −4 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GroovyPageLayoutFinder.java
  249. +2 −2 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/sitemesh/GroovyPageLayoutRenderer.java
  250. +5 −4 grails-web/src/main/groovy/org/codehaus/groovy/grails/web/util/WebUtils.java
  251. +5 −20 ...roovy/org/codehaus/groovy/grails/web/pages/discovery/GrailsConventionGroovyPageLocatorSpec.groovy
  252. +1 −1 grails-webflow/src/main/groovy/grails/test/WebFlowTestCase.groovy
  253. +1 −1 scripts/_GrailsBootstrap.groovy
  254. +2 −1 scripts/_GrailsRun.groovy
  255. +4 −4 scripts/_GrailsTest.groovy
  256. +1 −3 scripts/_GrailsWar.groovy
  257. +3 −4 scripts/_PluginDependencies.groovy
View
4 grails-bootstrap/build.gradle
@@ -1,7 +1,7 @@
import org.apache.tools.ant.filters.ReplaceTokens
dependencies {
- compile( "org.springframework:spring-core:${springVersion}") {
+ compile("org.springframework:spring-core:${springVersion}") {
exclude module:"commons-logging"
}
compile("org.springframework:spring-beans:${springVersion}") {
@@ -36,7 +36,7 @@ dependencies {
// Ant
compile "org.fusesource.jansi:jansi:$jansiVersion",
"jline:jline:$jlineVersion",
- "net.java.dev.jna:jna:$jnaVersion"
+ "net.java.dev.jna:jna:$jnaVersion"
compile "org.apache.ant:ant:${antVersion}",
"org.apache.ant:ant-launcher:${antVersion}",
View
10 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateAll.groovy
@@ -20,20 +20,18 @@ import org.springframework.core.io.Resource
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
/**
- * Completor for the generate-all command
+ * Completor for the generate-all command.
*
* @author Graeme Rocher
- * @since 1.4
- *
+ * @since 2.0
*/
-class GenerateAll extends ClassNameCompletor{
+class GenerateAll extends ClassNameCompletor {
+
@Override
String getCommandName() { "generate-all" }
@Override
boolean shouldInclude(Resource res) {
GrailsResourceUtils.isDomainClass(res.getURL())
}
-
-
}
View
10 ...s-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateController.groovy
@@ -20,20 +20,18 @@ import org.springframework.core.io.Resource
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
/**
- * Completor for the generate-controller command
+ * Completor for the generate-controller command.
*
* @author Graeme Rocher
- * @since 1.4
- *
+ * @since 2.0
*/
-class GenerateController extends ClassNameCompletor{
+class GenerateController extends ClassNameCompletor {
+
@Override
String getCommandName() { "generate-controller" }
@Override
boolean shouldInclude(Resource res) {
GrailsResourceUtils.isDomainClass(res.getURL())
}
-
-
}
View
10 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateViews.groovy
@@ -20,20 +20,18 @@ import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
import org.springframework.core.io.Resource
/**
- * Completor for the generate-views command
+ * Completor for the generate-views command.
*
* @author Graeme Rocher
- * @since 1.4
- *
+ * @since 2.0
*/
-class GenerateViews extends ClassNameCompletor{
+class GenerateViews extends ClassNameCompletor {
+
@Override
String getCommandName() { "generate-views" }
@Override
boolean shouldInclude(Resource res) {
GrailsResourceUtils.isDomainClass(res.getURL())
}
-
-
}
View
43 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -51,7 +51,7 @@
* Utility class for delivering console output in a nicely formatted way.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class GrailsConsole {
@@ -113,6 +113,7 @@ public String toString() {
* Whether ANSI should be enabled for output
*/
private boolean ansiEnabled = true;
+
/**
* Whether user input is currently active
*/
@@ -125,7 +126,6 @@ protected GrailsConsole() throws IOException {
System.setOut(new GrailsConsolePrintStream(out));
System.setErr(new GrailsConsoleErrorPrintStream(new PrintStream(AnsiConsole.wrapOutputStream(System.err))));
-
if (isWindows()) {
terminal = new WindowsTerminal() {
@Override
@@ -330,7 +330,7 @@ private void outputMessage(String msg, int replaceCount) {
lastStatus = outputCategory(erasePreviousLine(CATEGORY_SEPARATOR), CATEGORY_SEPARATOR)
.fg(Color.DEFAULT).a(msg).reset();
out.println(lastStatus);
- if(userInputActive) {
+ if (userInputActive) {
out.print(ansi().cursorRight(PROMPT.length()).reset());
}
@@ -355,19 +355,6 @@ private void postPrintMessage() {
progressIndicatorActive = false;
}
- private void replayPromptIfActive() {
- if (!userInputActive) {
- return;
- }
-
- if (isAnsiEnabled()) {
- out.println(ansiPrompt(PROMPT));
- }
- else {
- out.println(PROMPT);
- }
- }
-
/**
* Keeps doesn't replace the status message
*
@@ -427,7 +414,7 @@ public void error(String msg, Throwable error) {
try {
if ((verbose||stacktrace) && error != null) {
printStackTrace(msg, error);
- error(ERROR, msg );
+ error(ERROR, msg);
}
else {
error(ERROR, msg + STACKTRACE_MESSAGE);
@@ -443,20 +430,20 @@ public void error(String msg, Throwable error) {
* @param error The error
*/
public void error(Throwable error) {
-
printStackTrace(null, error);
}
private void printStackTrace(String message, Throwable error) {
- if(error instanceof ScriptExitException) {
+ if (error instanceof ScriptExitException) {
return; // don't bother with exit exceptions
}
- if((error instanceof BuildException) && error.getCause() != null) {
+ if ((error instanceof BuildException) && error.getCause() != null) {
error = error.getCause();
}
- if(!isVerbose())
+ if (!isVerbose()) {
StackTraceUtils.deepSanitize(error);
+ }
StringWriter sw = new StringWriter();
PrintWriter ps = new PrintWriter(sw);
if (message != null) {
@@ -611,16 +598,6 @@ private String createQuestion(String message, String[] validResponses) {
return message + "[" + DefaultGroovyMethods.join(validResponses, ",") + "] ";
}
- private void printMessageOnNewLine(String msg) {
- out.println(outputCategory(ansi(), "|")
- .newline()
- .fg(DEFAULT).a(msg).reset());
- }
-
- private boolean hasNewLines(String msg) {
- return msg.contains(LINE_SEPARATOR);
- }
-
private Ansi outputCategory(Ansi ansi, String categoryName) {
return ansi
.a(Ansi.Attribute.INTENSITY_BOLD)
@@ -645,7 +622,7 @@ private Ansi outputErrorLabel(Ansi ansi, String label) {
private Ansi erasePreviousLine(String categoryName) {
if (cursorMove > 0) {
int moveLeftLength = categoryName.length() + lastMessage.length();
- if(userInputActive) {
+ if (userInputActive) {
moveLeftLength += PROMPT.length();
}
return ansi()
@@ -658,7 +635,7 @@ private Ansi erasePreviousLine(String categoryName) {
}
public void error(String label, String message) {
- if(message != null) {
+ if (message != null) {
cursorMove = 0;
try {
if (isAnsiEnabled()) {
View
119 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
@@ -15,23 +15,23 @@
*/
package grails.util
+import static grails.build.logging.GrailsConsole.instance as CONSOLE
import grails.build.logging.GrailsConsole
+
import java.util.concurrent.ConcurrentHashMap
import java.util.regex.Pattern
+
+import org.apache.ivy.core.report.ResolveReport
import org.apache.ivy.plugins.repository.TransferEvent
import org.apache.ivy.plugins.repository.TransferListener
import org.apache.ivy.util.ChecksumHelper
import org.apache.ivy.util.DefaultMessageLogger
import org.apache.ivy.util.Message
+import org.codehaus.groovy.grails.cli.support.ClasspathConfigurer
import org.codehaus.groovy.grails.cli.support.OwnerlessClosure
import org.codehaus.groovy.grails.resolve.GrailsCoreDependencies
import org.codehaus.groovy.grails.resolve.IvyDependencyManager
import org.codehaus.groovy.runtime.StackTraceUtils
-import static grails.build.logging.GrailsConsole.instance as CONSOLE
-import org.codehaus.groovy.grails.resolve.ResolveException
-import org.codehaus.groovy.grails.cli.support.ClasspathConfigurer
-import org.apache.ivy.core.report.ResolveReport
-import org.apache.ivy.core.report.ArtifactDownloadReport
/**
* <p>Represents the project paths and other build settings
@@ -45,6 +45,7 @@ import org.apache.ivy.core.report.ArtifactDownloadReport
* to ensure consistent behaviour.</p>
*/
class BuildSettings extends AbstractBuildSettings {
+
static final Pattern JAR_PATTERN = ~/^\S+\.jar$/
/**
@@ -297,16 +298,13 @@ class BuildSettings extends AbstractBuildSettings {
if (potentialScript.exists()) {
return potentialScript
}
- else {
- try {
- return classLoader.loadClass("${name}_")
- }
- catch (e) {
- return classLoader.loadClass(name)
- }
+ try {
+ return classLoader.loadClass("${name}_")
+ }
+ catch (e) {
+ return classLoader.loadClass(name)
}
}
-
}
}
@@ -392,7 +390,7 @@ class BuildSettings extends AbstractBuildSettings {
if (internalCompileDependencies) return internalCompileDependencies
Message.info "Resolving [compile] dependencies..."
List<File> jarFiles
- if(shouldResolve()) {
+ if (shouldResolve()) {
def resolveReport = dependencyManager.resolveDependencies(IvyDependencyManager.COMPILE_CONFIGURATION)
jarFiles = resolveReport.getArtifactsReports(null, false).localFile + applicationJars
@@ -409,8 +407,9 @@ class BuildSettings extends AbstractBuildSettings {
private List<File> findAndRemovePluginDependencies(String scope, List<File> jarFiles, List<File> scopePluginDependencies) {
def pluginZips = jarFiles.findAll { it.name.endsWith(".zip") }
for (z in pluginZips) {
- if (!pluginDependencies.contains(z))
+ if (!pluginDependencies.contains(z)) {
pluginDependencies.add(z)
+ }
}
scopePluginDependencies.addAll(pluginZips)
resolveCache[scope] = jarFiles
@@ -442,7 +441,7 @@ class BuildSettings extends AbstractBuildSettings {
@Lazy List<File> defaultTestDependencies = {
Message.info "Resolving [test] dependencies..."
if (internalTestDependencies) return internalTestDependencies
- if(shouldResolve()) {
+ if (shouldResolve()) {
testResolveReport = dependencyManager.resolveDependencies(IvyDependencyManager.TEST_CONFIGURATION)
def jarFiles = testResolveReport.getArtifactsReports(null, false).localFile + applicationJars
@@ -479,7 +478,7 @@ class BuildSettings extends AbstractBuildSettings {
@Lazy List<File> defaultRuntimeDependencies = {
Message.info "Resolving [runtime] dependencies..."
if (internalRuntimeDependencies) return internalRuntimeDependencies
- if(shouldResolve()) {
+ if (shouldResolve()) {
runtimeResolveReport = dependencyManager.resolveDependencies(IvyDependencyManager.RUNTIME_CONFIGURATION)
def jarFiles = runtimeResolveReport.getArtifactsReports(null, false).localFile + applicationJars
@@ -488,9 +487,7 @@ class BuildSettings extends AbstractBuildSettings {
return jarFiles
}
- else {
- return []
- }
+ return []
}()
private List<File> providedDependencies = []
@@ -520,7 +517,7 @@ class BuildSettings extends AbstractBuildSettings {
}
if (internalProvidedDependencies) return internalProvidedDependencies
- if(shouldResolve()) {
+ if (shouldResolve()) {
Message.info "Resolving [provided] dependencies..."
providedResolveReport = dependencyManager.resolveDependencies(IvyDependencyManager.PROVIDED_CONFIGURATION)
@@ -530,9 +527,7 @@ class BuildSettings extends AbstractBuildSettings {
Message.debug("Resolved jars for [provided]: ${{-> jarFiles.join('\n')}}")
return jarFiles
}
- else {
- return []
- }
+ return []
}()
private List<File> buildDependencies = []
@@ -554,9 +549,9 @@ class BuildSettings extends AbstractBuildSettings {
*/
List<File> getPluginCompileDependencies() {
// ensure initialization
- if (!internalPluginCompileDependencies)
+ if (!internalPluginCompileDependencies) {
getCompileDependencies()
-
+ }
return internalPluginCompileDependencies
}
@@ -568,9 +563,9 @@ class BuildSettings extends AbstractBuildSettings {
*/
List<File> getPluginProvidedDependencies() {
// ensure initialization
- if (!internalPluginProvidedDependencies)
+ if (!internalPluginProvidedDependencies) {
getProvidedDependencies()
-
+ }
return internalPluginProvidedDependencies
}
@@ -581,9 +576,9 @@ class BuildSettings extends AbstractBuildSettings {
*/
List<File> getPluginRuntimeDependencies() {
// ensure initialization
- if (!internalPluginRuntimeDependencies)
+ if (!internalPluginRuntimeDependencies) {
getRuntimeDependencies()
-
+ }
return internalPluginRuntimeDependencies
}
@@ -595,9 +590,9 @@ class BuildSettings extends AbstractBuildSettings {
*/
List<File> getPluginTestDependencies() {
// ensure initialization
- if (!internalPluginTestDependencies)
+ if (!internalPluginTestDependencies) {
getTestDependencies()
-
+ }
return internalPluginTestDependencies
}
@@ -609,9 +604,9 @@ class BuildSettings extends AbstractBuildSettings {
*/
List<File> getPluginBuildDependencies() {
// ensure initialization
- if (!internalPluginBuildDependencies)
+ if (!internalPluginBuildDependencies) {
getBuildDependencies()
-
+ }
return internalPluginBuildDependencies
}
@@ -622,6 +617,7 @@ class BuildSettings extends AbstractBuildSettings {
void setBuildDependencies(List<File> deps) {
buildDependencies = deps
}
+
/**
* List containing the dependencies required for the build system only
*/
@@ -632,7 +628,7 @@ class BuildSettings extends AbstractBuildSettings {
}
if (internalBuildDependencies) return internalBuildDependencies
- if(shouldResolve()) {
+ if (shouldResolve()) {
Message.info "Resolving [build] dependencies..."
buildResolveReport = dependencyManager.resolveDependencies(IvyDependencyManager.BUILD_CONFIGURATION)
@@ -643,9 +639,7 @@ class BuildSettings extends AbstractBuildSettings {
return jarFiles
}
- else {
- return []
- }
+ return []
}()
protected boolean shouldResolve() {
@@ -724,7 +718,7 @@ class BuildSettings extends AbstractBuildSettings {
// Update the base directory. This triggers some extra config.
setBaseDir(baseDir)
- if(![Environment.DEVELOPMENT, Environment.TEST].contains(Environment.current)) {
+ if (![Environment.DEVELOPMENT, Environment.TEST].contains(Environment.current)) {
modified = true
}
@@ -733,23 +727,20 @@ class BuildSettings extends AbstractBuildSettings {
// otherwise it loads the script class using the Gant classloader.
}
- public void storeDependencyCache() {
+ void storeDependencyCache() {
projectWorkDir.mkdirs()
if (resolveChecksum) {
try {
- if(resolveCache.size() == 5 && !readFromCache) {
+ if (resolveCache.size() == 5 && !readFromCache) {
def cachedResolve = new File(projectWorkDir, "${resolveChecksum}.resolve")
cachedResolve.withOutputStream { output ->
- def oos = new ObjectOutputStream(output)
- oos.writeObject(resolveCache)
-
+ new ObjectOutputStream(output).writeObject(resolveCache)
}
}
}
catch (e) {
ClasspathConfigurer.cleanResolveCache(this)
}
-
}
}
@@ -961,7 +952,6 @@ class BuildSettings extends AbstractBuildSettings {
StackTraceUtils.deepSanitize e
throw e
}
-
}
ConfigObject loadConfig(ConfigObject config) {
@@ -1058,7 +1048,7 @@ class BuildSettings extends AbstractBuildSettings {
modified = true
}
- if(!modified) {
+ if (!modified) {
readFromCache = true
}
}
@@ -1108,7 +1098,6 @@ class BuildSettings extends AbstractBuildSettings {
catch (e) {
CONSOLE.error "WARNING: Error configuring proxy settings: ${e.message}", e
}
-
}
settingsFileLoaded = true
@@ -1146,7 +1135,6 @@ class BuildSettings extends AbstractBuildSettings {
}
} as TransferListener
-
def grailsConfig = config.grails
if (!dependenciesExternallyConfigured) {
@@ -1230,7 +1218,6 @@ class BuildSettings extends AbstractBuildSettings {
catch (e) {
CONSOLE.error "WARNING: Dependencies cannot be resolved for plugin [$pluginName] due to error: ${e.message}", e
}
-
}
}
return handlePluginDirectory
@@ -1352,23 +1339,25 @@ class BuildSettings extends AbstractBuildSettings {
}
protected void parseGrailsBuildListeners() {
- if (!buildListenersSet) {
- def listenersValue = System.getProperty(BUILD_LISTENERS) ?: config.grails.build.listeners // Anyway to use the constant to do this?
- if (listenersValue) {
- def add = {
- if (it instanceof String) {
- it.split(',').each { this.@buildListeners << it }
- } else if (it instanceof Class) {
- this.@buildListeners << it
- } else {
- throw new IllegalArgumentException("$it is not a valid value for $BUILD_LISTENERS")
- }
+ if (buildListenersSet) {
+ return
+ }
+
+ def listenersValue = System.getProperty(BUILD_LISTENERS) ?: config.grails.build.listeners // Anyway to use the constant to do this?
+ if (listenersValue) {
+ def add = {
+ if (it instanceof String) {
+ it.split(',').each { this.@buildListeners << it }
+ } else if (it instanceof Class) {
+ this.@buildListeners << it
+ } else {
+ throw new IllegalArgumentException("$it is not a valid value for $BUILD_LISTENERS")
}
-
- (listenersValue instanceof Collection) ? listenersValue.each(add) : add(listenersValue)
}
- buildListenersSet = true
+
+ (listenersValue instanceof Collection) ? listenersValue.each(add) : add(listenersValue)
}
+ buildListenersSet = true
}
private getPropertyValue(String propertyName, Properties props, String defaultValue) {
@@ -1430,7 +1419,7 @@ class BuildSettings extends AbstractBuildSettings {
System.getProperty(FUNCTIONAL_BASE_URL_PROPERTY)
}
- public File getBasePluginDescriptor () {
+ File getBasePluginDescriptor() {
File basePluginFile = baseDir?.listFiles()?.find { it.name.endsWith("GrailsPlugin.groovy")}
if (basePluginFile?.exists()) {
View
1 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
@@ -216,6 +216,7 @@ public String getApplicationName() {
*
* @deprecated Use {@link BuildSettings#servletVersion} instead
*/
+ @Deprecated
public String getServletVersion() {
final String servletVersion = (String) get(SERVLET_VERSION);
if (servletVersion == null) {
View
95 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
@@ -15,19 +15,21 @@
package grails.util
import groovy.util.slurpersupport.GPathResult
+
import java.util.concurrent.ConcurrentHashMap
+import java.util.zip.ZipEntry
+import java.util.zip.ZipFile
+
import org.apache.commons.lang.ArrayUtils
+import org.codehaus.groovy.grails.plugins.BasicGrailsPluginInfo
import org.codehaus.groovy.grails.plugins.CompositePluginDescriptorReader
import org.codehaus.groovy.grails.plugins.GrailsPluginInfo
import org.codehaus.groovy.grails.plugins.PluginInfo
+import org.codehaus.groovy.grails.plugins.build.scopes.PluginScopeInfo
import org.springframework.core.io.FileSystemResource
import org.springframework.core.io.Resource
import org.springframework.core.io.support.PathMatchingResourcePatternResolver
import org.springframework.util.AntPathMatcher
-import org.codehaus.groovy.grails.plugins.BasicGrailsPluginInfo
-import java.util.zip.ZipEntry
-import java.util.zip.ZipFile
-import org.codehaus.groovy.grails.plugins.build.scopes.PluginScopeInfo
/**
* Uses the project BuildSettings object to discover information about the installed plugin
@@ -100,54 +102,53 @@ class PluginBuildSettings {
this.pluginDirPath = buildSettings?.projectPluginsDir?.absolutePath
this.pluginLocations = buildSettings?.config?.grails?.plugin?.location
- if(buildSettings != null) {
- populateSourceDirectories(compileScopePluginInfo, buildSettings.pluginCompileDependencies)
- populateSourceDirectories(compileScopePluginInfo, buildSettings.pluginRuntimeDependencies)
+ if (buildSettings == null) {
+ return
+ }
- final inlinePlugins = getInlinePluginDirectories()
- for(pluginDir in inlinePlugins) {
- final pluginInfo = getPluginInfo(pluginDir.file.absolutePath)
- if(pluginInfo != null) {
- addPluginScopeInfoForDirAndInfo(compileScopePluginInfo, pluginInfo, pluginDir)
- }
- }
+ populateSourceDirectories(compileScopePluginInfo, buildSettings.pluginCompileDependencies)
+ populateSourceDirectories(compileScopePluginInfo, buildSettings.pluginRuntimeDependencies)
- populateSourceDirectories(buildScopePluginInfo, buildSettings.pluginBuildDependencies)
- populateSourceDirectories(providedScopePluginInfo, buildSettings.pluginProvidedDependencies)
- populateSourceDirectories(testScopePluginInfo, buildSettings.pluginTestDependencies)
- testScopePluginInfo = testScopePluginInfo - compileScopePluginInfo
+ for (pluginDir in getInlinePluginDirectories()) {
+ final pluginInfo = getPluginInfo(pluginDir.file.absolutePath)
+ if (pluginInfo != null) {
+ addPluginScopeInfoForDirAndInfo(compileScopePluginInfo, pluginInfo, pluginDir)
+ }
}
+ populateSourceDirectories(buildScopePluginInfo, buildSettings.pluginBuildDependencies)
+ populateSourceDirectories(providedScopePluginInfo, buildSettings.pluginProvidedDependencies)
+ populateSourceDirectories(testScopePluginInfo, buildSettings.pluginTestDependencies)
+ testScopePluginInfo = testScopePluginInfo - compileScopePluginInfo
}
- public void registerNewPluginInstall(File zip) {
+ void registerNewPluginInstall(File zip) {
switch(zip) {
case buildSettings.pluginCompileDependencies:
- registePluginZipWithScope(zip, compileScopePluginInfo)
- break
+ registerPluginZipWithScope(zip, compileScopePluginInfo)
+ break
case buildSettings.pluginRuntimeDependencies:
- registePluginZipWithScope(zip, compileScopePluginInfo)
- break
+ registerPluginZipWithScope(zip, compileScopePluginInfo)
+ break
case buildSettings.pluginTestDependencies:
- registePluginZipWithScope(zip, testScopePluginInfo)
- break
+ registerPluginZipWithScope(zip, testScopePluginInfo)
+ break
case buildSettings.pluginProvidedDependencies:
- registePluginZipWithScope(zip, providedScopePluginInfo)
- break
+ registerPluginZipWithScope(zip, providedScopePluginInfo)
+ break
case buildSettings.pluginBuildDependencies:
- registePluginZipWithScope(zip, buildScopePluginInfo)
- break
+ registerPluginZipWithScope(zip, buildScopePluginInfo)
+ break
}
}
private populateSourceDirectories(PluginScopeInfo compileInfo, List<File> pluginDependencies) {
-
for (zip in pluginDependencies) {
- registePluginZipWithScope(zip, compileInfo)
+ registerPluginZipWithScope(zip, compileInfo)
}
}
- protected def registePluginZipWithScope(File pluginZip, PluginScopeInfo scopeInfo) {
+ protected registerPluginZipWithScope(File pluginZip, PluginScopeInfo scopeInfo) {
def info = readPluginInfoFromZip(pluginZip.absolutePath)
if (info != null) {
def existingInfo = getPluginInfoForName(info.name)
@@ -163,8 +164,7 @@ class PluginBuildSettings {
compileInfo.sourceDirectories.addAll(
getPluginSourceDirectories(dir.file.canonicalFile).findAll {
!excludedPaths.contains(it.file.name) && it.file.isDirectory()
- }
- )
+ })
compileInfo.pluginDescriptors << getPluginDescriptor(dir)
compileInfo.artefactResources.addAll(getArtefactResourcesForOne(dir.file.absolutePath))
}
@@ -316,7 +316,7 @@ class PluginBuildSettings {
Resource pluginDir = getPluginDirForName(pluginName)
GPathResult result = getMetadataForPlugin(pluginDir)
- if(result != null) {
+ if (result != null) {
pluginMetaDataMap[pluginName] = result
}
return result
@@ -539,10 +539,10 @@ class PluginBuildSettings {
*/
List<Resource> getCompileScopedArtefactResources() {
List<Resource> artefactResources = cache['compileScopedArtefactResources']
- if(artefactResources == null) {
+ if (artefactResources == null) {
artefactResources = []
artefactResources.addAll compileScopePluginInfo.artefactResources
- artefactResources.addAll( getArtefactResourcesForOne(buildSettings.baseDir.path) )
+ artefactResources.addAll getArtefactResourcesForOne(buildSettings.baseDir.path)
cache['compileScopedArtefactResources'] = artefactResources
}
return artefactResources
@@ -553,7 +553,7 @@ class PluginBuildSettings {
*/
List<GrailsPluginInfo> getCompileScopedSupportedPluginInfos() {
List<GrailsPluginInfo> compileScopePluginInfos = cache['compileScopePluginInfos']
- if(compileScopePluginInfos == null) {
+ if (compileScopePluginInfos == null) {
def pluginInfos = supportedPluginInfos
compileScopePluginInfos = []
compileScopePluginInfos.addAll compileScopePluginInfo.pluginInfos
@@ -570,18 +570,18 @@ class PluginBuildSettings {
*/
Resource[] getArtefactResourcesForCurrentEnvironment() {
def artefactResources = cache['allArtefactResourcesForEnvironment']
- if(artefactResources == null) {
+ if (artefactResources == null) {
artefactResources = []
artefactResources.addAll compileScopePluginInfo.getArtefactResources()
artefactResources.addAll providedScopePluginInfo.getArtefactResources()
- artefactResources.addAll( getArtefactResourcesForOne(buildSettings.baseDir.path))
- if(Environment.getCurrent() == Environment.TEST) {
+ artefactResources.addAll getArtefactResourcesForOne(buildSettings.baseDir.path)
+ if (Environment.getCurrent() == Environment.TEST) {
artefactResources.addAll testScopePluginInfo.getArtefactResources()
}
def inlineDirectories = getInlinePluginDirectories()
- for(dir in inlineDirectories) {
- artefactResources.addAll( getArtefactResourcesForOne(dir.file.absolutePath))
+ for (dir in inlineDirectories) {
+ artefactResources.addAll getArtefactResourcesForOne(dir.file.absolutePath)
}
artefactResources = artefactResources as Resource[];
@@ -601,7 +601,7 @@ class PluginBuildSettings {
Resource[] getPluginDescriptorsForCurrentEnvironment() {
def descriptorList = cache['pluginDescriptorsForCurrentEnvironment']
- if(descriptorList == null) {
+ if (descriptorList == null) {
if (Environment.current == Environment.TEST) {
descriptorList = pluginScopeInfoMap.values()*.pluginDescriptors.flatten()
@@ -614,8 +614,7 @@ class PluginBuildSettings {
if (baseDescriptor != null) {
descriptorList << baseDescriptor
}
- def inlinePlugins = getInlinePluginDirectories()
- for (inlinePluginDir in inlinePlugins) {
+ for (inlinePluginDir in getInlinePluginDirectories()) {
descriptorList << getPluginDescriptor(inlinePluginDir)
}
@@ -750,10 +749,10 @@ class PluginBuildSettings {
GrailsPluginInfo readPluginInfoFromZip(String zipLocation) {
def key = "pluginInfo:$zipLocation".toString()
GrailsPluginInfo info = cache[key]
- if(info == null) {
+ if (info == null) {
def result = readMetadataFromZip(zipLocation)
- if(result != null) {
+ if (result != null) {
def (name, version, xml) = result
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineInputHandler.java
@@ -28,7 +28,7 @@
* Custom input handler mechanism for Ant that ignores case of input.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class CommandLineInputHandler implements InputHandler {
View
12 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
@@ -105,8 +105,6 @@
private File scriptCacheDir;
private final List<Resource> scriptsAllowedOutsideOfProject = new ArrayList<Resource>();
- private boolean useDefaultEnv = true;
-
public GrailsScriptRunner() {
this(new BuildSettings());
@@ -172,7 +170,7 @@ public static void main(String[] args) {
BuildSettings build = null;
try {
build = new BuildSettings(new File(grailsHome));
- if(commandLine.hasOption(RESOLVE_DEPENDENCIES_ARGUMENT)) {
+ if (commandLine.hasOption(RESOLVE_DEPENDENCIES_ARGUMENT)) {
build.setModified(true);
}
if (build.getRootLoader() == null) {
@@ -211,7 +209,7 @@ public static void main(String[] args) {
console.updateStatus("Loading Grails " + (version != null ? version : build.getGrailsVersion()));
build.loadConfig();
- if(commandLine.hasOption(RESOLVE_DEPENDENCIES_ARGUMENT)) {
+ if (commandLine.hasOption(RESOLVE_DEPENDENCIES_ARGUMENT)) {
ClasspathConfigurer.cleanResolveCache(build);
}
scriptRunner.initializeState();
@@ -254,10 +252,12 @@ public static CommandLineParser getCommandLineParser() {
}
private static void exitWithError(String error, Throwable t) {
- if(t != null)
+ if (t != null) {
GrailsConsole.getInstance().error(error, t);
- else
+ }
+ else {
GrailsConsole.getInstance().error(error);
+ }
System.exit(1);
}
View
5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
@@ -280,11 +280,10 @@ public void profile(String name, Closure<?> callable) {
}
}
-
public String makeRelative(String path) {
- if(buildSettings != null && path != null) {
+ if (buildSettings != null && path != null) {
String absolutePath = buildSettings.getBaseDir().getAbsolutePath();
- if(path.startsWith(absolutePath)) {
+ if (path.startsWith(absolutePath)) {
return path.substring(absolutePath.length()+1);
}
}
View
2 .../main/groovy/org/codehaus/groovy/grails/cli/interactive/GrailsInteractiveCompletor.groovy
@@ -28,7 +28,7 @@ import org.codehaus.groovy.grails.cli.support.BuildSettingsAware
* A JLine completor for Grails' interactive mode.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
class GrailsInteractiveCompletor extends SimpleCompletor {
View
15 ...otstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
@@ -18,20 +18,20 @@ package org.codehaus.groovy.grails.cli.interactive
import grails.build.logging.GrailsConsole
import grails.util.BuildSettings
import grails.util.BuildSettingsHolder
-import grails.util.Environment
-import grails.util.GrailsNameUtils
+
+import java.awt.Desktop
+
import org.codehaus.groovy.grails.cli.GrailsScriptRunner
+import org.codehaus.groovy.grails.cli.ScriptExitException
import org.codehaus.groovy.grails.cli.ScriptNotFoundException
-import org.codehaus.groovy.grails.cli.support.MetaClassRegistryCleaner
import org.codehaus.groovy.grails.cli.parsing.ParseException
-import org.codehaus.groovy.grails.cli.ScriptExitException
-import java.awt.Desktop
+import org.codehaus.groovy.grails.cli.support.MetaClassRegistryCleaner
/**
* Provides the implementation of interactive mode in Grails.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
class InteractiveMode {
@@ -70,7 +70,7 @@ class InteractiveMode {
interactiveModeActive = true
addStatus("Enter a script name to run. Use TAB for completion: ")
- while(interactiveModeActive) {
+ while (interactiveModeActive) {
def scriptName = showPrompt()
try {
def trimmed = scriptName.trim()
@@ -129,7 +129,6 @@ class InteractiveMode {
error "Invalid command: ${e.message}"
}
}
-
}
else {
error "No script name specified"
View
2 ...strap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleAntBuilder.java
@@ -29,7 +29,7 @@
* Silences ant builder output.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class GrailsConsoleAntBuilder extends AntBuilder {
View
2 ...src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleErrorPrintStream.java
@@ -24,7 +24,7 @@
* Used to replace default System.err with one that routes calls through GrailsConsole.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class GrailsConsoleErrorPrintStream extends PrintStream {
View
2 ...trap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsolePrintStream.java
@@ -24,7 +24,7 @@
* Used to replace default System.out with one that routes calls through GrailsConsole.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class GrailsConsolePrintStream extends PrintStream {
View
4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLine.java
@@ -20,10 +20,10 @@
import java.util.Properties;
/**
- * Represents the parsed command line options
+ * Represents the parsed command line options.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public interface CommandLine {
View
105 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParser.java
@@ -22,14 +22,14 @@
import java.util.Map;
/**
+ * Command line parser that parses arguments to the command line. Written as a
+ * replacement for Commons CLI because it doesn't support unknown arguments and
+ * requires all arguments to be declared up front.
*
- * Command line parser that parses arguments to the command line. Written as a replacement for Commons CLI
- * because it doesn't support unknown arguments and requires all arguments to be declared up front.
- *
- * It also doesn't support command options with hyphens. This class gets around those problems.
+ * It also doesn't support command options with hyphens. This class gets around those problems.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class CommandLineParser {
@@ -57,7 +57,7 @@
*/
public void addOption(String name, String description) {
int length = name.length();
- if(length >longestOptionNameLength) {
+ if (length >longestOptionNameLength) {
longestOptionNameLength = length;
}
declaredOptions.put(name, new Option(name, description));
@@ -71,8 +71,7 @@ public void addOption(String name, String description) {
*/
public CommandLine parseString(String string) {
// stupid implementation right now that doesn't take into account quoted argument values
- String[] args = string.split(" ");
- return parse(args);
+ return parse(string.split(" "));
}
/**
@@ -87,25 +86,25 @@ public CommandLine parse(String... args) {
DefaultCommandLine cl = createCommandLine();
boolean beforeCommand = true;
for (String arg : args) {
- if(arg == null) continue;
+ if (arg == null) continue;
String trimmed = arg.trim();
- if(trimmed != null && trimmed.length()>0) {
- if(trimmed.charAt(0) == '-') {
+ if (trimmed != null && trimmed.length()>0) {
+ if (trimmed.charAt(0) == '-') {
processOption(cl, trimmed);
}
else {
- if(beforeCommand && ENV_ARGS.containsKey(trimmed)) {
- cl.setEnvironment(ENV_ARGS.get(trimmed));
- }
- else {
- if(beforeCommand) {
- cl.setCommandName(trimmed);
- beforeCommand = false;
- }
- else {
- cl.addRemainingArg(trimmed);
- }
- }
+ if (beforeCommand && ENV_ARGS.containsKey(trimmed)) {
+ cl.setEnvironment(ENV_ARGS.get(trimmed));
+ }
+ else {
+ if (beforeCommand) {
+ cl.setCommandName(trimmed);
+ beforeCommand = false;
+ }
+ else {
+ cl.addRemainingArg(trimmed);
+ }
+ }
}
}
}
@@ -128,7 +127,6 @@ public String getHelpMessage() {
sb.append(DEFAULT_PADDING).append(option.getDescription()).append(ls);
}
-
return sb.toString();
}
@@ -137,41 +135,42 @@ protected DefaultCommandLine createCommandLine() {
}
protected void processOption(DefaultCommandLine cl, String arg) {
- if(arg.length()>1) {
- if(arg.charAt(1) == 'D' && arg.contains("=")) {
- processSystemArg(cl, arg);
+ if (arg.length() < 2) {
+ return;
+ }
+
+ if (arg.charAt(1) == 'D' && arg.contains("=")) {
+ processSystemArg(cl, arg);
+ return;
+ }
+
+ arg = (arg.charAt(1) == '-' ? arg.substring(2, arg.length()) : arg.substring(1, arg.length())).trim();
+
+ if (arg.contains("=")) {
+ String[] split = arg.split("=");
+ String name = split[0].trim();
+ validateOptionName(name);
+ String value = split[1].trim();
+ if (declaredOptions.containsKey(name)) {
+ cl.addDeclaredOption(name, declaredOptions.get(name), value);
}
else {
- arg = (arg.charAt(1) == '-' ? arg.substring(2, arg.length()) : arg.substring(1, arg.length())).trim();
-
- if(arg.contains("=")) {
- String[] split = arg.split("=");
- String name = split[0].trim();
- valideOptionName(name);
- String value = split[1].trim();
- if(declaredOptions.containsKey(name)) {
- cl.addDeclaredOption(name, declaredOptions.get(name), value);
- }
- else {
- cl.addUndeclaredOption(name, value);
- }
- }
- else {
- valideOptionName(arg);
- if(declaredOptions.containsKey(arg)) {
- cl.addDeclaredOption(arg, declaredOptions.get(arg));
- }
- else {
- cl.addUndeclaredOption(arg);
- }
- }
-
+ cl.addUndeclaredOption(name, value);
}
+ return;
+ }
+
+ validateOptionName(arg);
+ if (declaredOptions.containsKey(arg)) {
+ cl.addDeclaredOption(arg, declaredOptions.get(arg));
+ }
+ else {
+ cl.addUndeclaredOption(arg);
}
}
- private void valideOptionName(String name) {
- if(name.contains(" ")) throw new ParseException("Invalid argument: " + name);
+ private void validateOptionName(String name) {
+ if (name.contains(" ")) throw new ParseException("Invalid argument: " + name);
}
protected void processSystemArg(DefaultCommandLine cl, String arg) {
View
14 ...-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/DefaultCommandLine.java
@@ -2,13 +2,17 @@
import grails.util.Environment;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
/**
- * Implementation of the {@link CommandLine} interface
+ * Implementation of the {@link CommandLine} interface.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class DefaultCommandLine implements CommandLine {
@@ -95,11 +99,11 @@ public boolean hasOption(String name) {
}
public Object optionValue(String name) {
- if(declaredOptions.containsKey(name)) {
+ if (declaredOptions.containsKey(name)) {
SpecifiedOption specifiedOption = declaredOptions.get(name);
return specifiedOption.value;
}
- else if(undeclaredOptions.containsKey(name)) {
+ if (undeclaredOptions.containsKey(name)) {
return undeclaredOptions.get(name);
}
return null;
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/Option.java
@@ -19,7 +19,7 @@
* Represents a command line option.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class Option {
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/ParseException.java
@@ -19,7 +19,7 @@
* Exception that is thrown in command line parsing fails.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class ParseException extends RuntimeException {
View
4 ...-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/BuildSettingsAware.java
@@ -21,7 +21,7 @@
* Marker interface for classes interested in BuildSettings. Build time only. Do not use in production!
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public interface BuildSettingsAware {
@@ -30,5 +30,5 @@
*
* @param settings The BuildSettings instance
*/
- public void setBuildSettings(BuildSettings settings);
+ void setBuildSettings(BuildSettings settings);
}
View
9 ...bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ClasspathConfigurer.java
@@ -36,10 +36,10 @@
import org.codehaus.groovy.grails.resolve.ResolveException;
/**
- * Support class that configures the Grails classpath when executing command line scripts
+ * Support class that configures the Grails classpath when executing command line scripts.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class ClasspathConfigurer {
@@ -159,12 +159,13 @@ public URLClassLoader configuredClassLoader() {
return urls.toArray(new URL[urls.size()]);
}
- private void handleResolveError(BuildSettings settings, ResolveReport buildResolveReport) {
+ private void handleResolveError(@SuppressWarnings("hiding") BuildSettings settings, ResolveReport buildResolveReport) {
settings.storeDependencyCache();
cleanResolveCache(settings);
GrailsConsole.getInstance().error(new ResolveException(buildResolveReport).getMessage());
- if (exitOnResolveError)
+ if (exitOnResolveError) {
System.exit(1);
+ }
}
public static void cleanResolveCache(BuildSettings settings) {
View
2 ...trap/src/main/groovy/org/codehaus/groovy/grails/cli/support/MetaClassRegistryCleaner.java
@@ -27,7 +27,7 @@
* Allows clean-up of changes made to the MetaClassRegistry.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
@SuppressWarnings("rawtypes")
public class MetaClassRegistryCleaner implements MetaClassRegistryChangeEventListener {
View
5 ...ap/src/main/groovy/org/codehaus/groovy/grails/cli/support/PluginPathDiscoverySupport.java
@@ -24,11 +24,10 @@
import java.util.List;
/**
- * Utility methods for plugin discovery when running the Grails command line
+ * Utility methods for plugin discovery when running the Grails command line.
*
- * @since 1.4
+ * @since 2.0
* @author Graeme Rocher
- *
*/
public class PluginPathDiscoverySupport {
View
9 ...trap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ScriptBindingInitializer.java
@@ -46,11 +46,10 @@
import org.springframework.util.ReflectionUtils;
/**
- * Configures the binding used when running Grails scripts
+ * Configures the binding used when running Grails scripts.
*
* @author Graeme Rocher
- * @since 1.4
- *
+ * @since 2.0
*/
public class ScriptBindingInitializer {
@@ -82,9 +81,11 @@ public ScriptBindingInitializer(CommandLine commandLine, BuildSettings settings,
* will load the "Init" script from $GRAILS_HOME/scripts if it
* exists there; otherwise it will load the Init class.
*/
- public GantBinding initBinding(final GantBinding binding, String scriptName) {
+ @SuppressWarnings("unchecked")
+ public GantBinding initBinding(final GantBinding binding, String scriptName) {
Closure<?> c = settings.getGrailsScriptClosure();
c.setDelegate(binding);
+ @SuppressWarnings("rawtypes")
Map argsMap = new LinkedHashMap(commandLine.getUndeclaredOptions());
argsMap.put("params", commandLine.getRemainingArgs());
binding.setVariable("argsMap", argsMap);
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
@@ -38,7 +38,7 @@
* Integrates UAA usage tracking with Grails.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
public class UaaIntegration {
View
16 ...-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/GrailsResourceUtils.java
@@ -31,14 +31,12 @@
import java.util.regex.Pattern;
/**
- *
- * Utility methods for resource handling / figuring out class names
+ * Utility methods for resource handling / figuring out class names.
*
* @author Graeme Rocher
- * @since 1.4
+ * @since 2.0
*/
-public class GrailsResourceUtils
-{
+public class GrailsResourceUtils {
/**
* The relative path to the WEB-INF directory
@@ -62,16 +60,16 @@
/*
Domain path is always matched against the normalized File representation of an URL and
- can therefore work with slashes as separators.
+ can therefore work with slashes as separators.
*/
- public static Pattern DOMAIN_PATH_PATTERN = Pattern.compile(".+/"+GRAILS_APP_DIR+"/domain/(.+)\\.(groovy|java)");
+ public static Pattern DOMAIN_PATH_PATTERN = Pattern.compile(".+/" + GRAILS_APP_DIR + "/domain/(.+)\\.(groovy|java)");
/*
This pattern will match any resource within a given directory inside grails-app
*/
- public static Pattern RESOURCE_PATH_PATTERN = Pattern.compile(".+?/"+GRAILS_APP_DIR+"/(.+?)/(.+?\\.(groovy|java))");
+ public static Pattern RESOURCE_PATH_PATTERN = Pattern.compile(".+?/" + GRAILS_APP_DIR + "/(.+?)/(.+?\\.(groovy|java))");
- public static Pattern SPRING_SCRIPTS_PATH_PATTERN = Pattern.compile(".+?/"+GRAILS_APP_DIR+"/conf/spring/(.+?\\.groovy)");
+ public static Pattern SPRING_SCRIPTS_PATH_PATTERN = Pattern.compile(".+?/" + GRAILS_APP_DIR + "/conf/spring/(.+?\\.groovy)");
public static Pattern[] COMPILER_ROOT_PATTERNS = {
SPRING_SCRIPTS_PATH_PATTERN,
View
10 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsVersionUtils.groovy
@@ -2,14 +2,8 @@ package org.codehaus.groovy.grails.plugins
import org.codehaus.groovy.grails.plugins.metadata.GrailsPlugin
-/**
- * Created by IntelliJ IDEA.
- * User: graemerocher
- * Date: 7/7/11
- * Time: 11:56 AM
- * To change this template use File | Settings | File Templates.
- */
class GrailsVersionUtils {
+
/**
* Get the name of the a plugin for a particular class.
*/
@@ -102,6 +96,7 @@ class GrailsVersionUtils {
return tokens.findAll { it ==~ /\d+/ || it =='*'}.join(".")
}
}
+
class VersionComparator implements Comparator {
static private final SNAPSHOT_SUFFIXES = ["-SNAPSHOT", ".BUILD-SNAPSHOT"].asImmutable()
@@ -187,4 +182,3 @@ class VersionComparator implements Comparator {
SNAPSHOT_SUFFIXES.any { version.endsWith(it) }
}