Permalink
Browse files

whitespace, STS warnings, etc.

  • Loading branch information...
1 parent 5ed3f75 commit 4a6991750aee6bc7c9830b4d84a86631210a519b @burtbeckwith burtbeckwith committed May 27, 2011
Showing with 3,701 additions and 4,018 deletions.
  1. +10 −12 build.gradle
  2. +58 −65 gradle/assemble.gradle
  3. +25 −26 gradle/docs.gradle
  4. +4 −9 grails-bootstrap/build.gradle
  5. +7 −7 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
  6. +1 −1 grails-bootstrap/src/main/groovy/grails/util/Environment.java
  7. +4 −4 grails-bootstrap/src/main/groovy/grails/util/GrailsNameUtils.java
  8. +1 −1 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
  9. +3 −3 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
  10. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineHelper.java
  11. +6 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineInputHandler.java
  12. +40 −23 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  13. +9 −12 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
  14. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsStarter.java
  15. +16 −17 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
  16. +6 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegrationSupport.groovy
  17. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/AstPluginDescriptorReader.java
  18. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/BasicGrailsPluginInfo.java
  19. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/metadata/GrailsPlugin.java
  20. +63 −70 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
  21. +1 −1 ...rap/src/main/groovy/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
  22. +32 −37 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsCoreDependencies.java
  23. +3 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java
  24. +7 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManager.groovy
  25. +4 −4 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/LastModifiedResolvedResource.java
  26. +5 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
  27. +1 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngine.groovy
  28. +25 −34 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/SnapshotAwareM2Resolver.java
  29. +31 −37 ...rap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/AbstractDependenciesConfigurer.java
  30. +5 −5 ...main/groovy/org/codehaus/groovy/grails/resolve/config/AbstractDependencyManagementConfigurer.java
  31. +1 −3 ...rc/main/groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationConfigurer.groovy
  32. +6 −8 ...rap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationContext.java
  33. +5 −4 ...ootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/JarDependenciesConfigurer.java
  34. +5 −4 ...strap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/PluginDependenciesConfigurer.java
  35. +17 −18 ...bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/RepositoriesConfigurer.groovy
  36. +3 −4 grails-core/build.gradle
  37. +1 −1 grails-core/src/main/groovy/grails/artefact/ApiDelegate.java
  38. +1 −1 grails-core/src/main/groovy/grails/persistence/Event.java
  39. +2 −2 grails-core/src/main/groovy/grails/util/DomainBuilder.java
  40. +4 −5 grails-core/src/main/groovy/grails/validation/DeferredBindingActions.java
  41. +1 −1 grails-core/src/main/groovy/grails/web/Action.java
  42. +1 −1 ...odehaus/groovy/grails/aop/framework/autoproxy/GroovyAwareAspectJAwareAdvisorAutoProxyCreator.java
  43. +1 −1 ...ehaus/groovy/grails/aop/framework/autoproxy/GroovyAwareInfrastructureAdvisorAutoProxyCreator.java
  44. +2 −4 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
  45. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/AbstractGrailsClass.java
  46. +2 −2 ...core/src/main/groovy/org/codehaus/groovy/grails/commons/AnnotationDomainClassArtefactHandler.java
  47. +1 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ApplicationHolder.java
  48. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandler.java
  49. +6 −6 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandlerAdapter.java
  50. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ClassPropertyFetcher.java
  51. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultArtefactInfo.java
  52. +9 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java
  53. +7 −7 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
  54. +6 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClass.java
  55. +7 −8 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClassProperty.java
  56. +1 −8 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DomainClassArtefactHandler.java
  57. +0 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplication.java
  58. +5 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplicationFactoryBean.java
  59. +8 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsMetaClassUtils.java
  60. +14 −14 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsResourceUtils.java
  61. +5 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/ConfigurationHelper.groovy
  62. +9 −13 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/GrailsConfig.java
  63. +1 −0 ...core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/AbstractDynamicConstructor.java
  64. +3 −3 .../src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/AbstractStaticMethodInvocation.java
  65. +10 −17 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/BaseApiProvider.java
  66. +1 −1 .../src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/DynamicMethodsExpandoMetaClass.java
  67. +12 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/LazyMetaPropertyMap.java
  68. +3 −1 ...core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/WeakGenericDynamicProperty.java
  69. +13 −12 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsRuntimeConfigurator.java
  70. +3 −5 ...s-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsWebApplicationContext.java
  71. +33 −32 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/DirectoryWatcher.java
  72. +12 −15 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectCompiler.groovy
  73. +18 −17 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java
  74. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/Grailsc.java
  75. +17 −25 .../main/groovy/org/codehaus/groovy/grails/compiler/injection/AbstractGrailsArtefactTransformer.java
  76. +3 −3 ...-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/AllArtefactClassInjector.java
  77. +2 −5 ...core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ApiDelegateTransformation.java
  78. +5 −5 .../src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ArtefactTypeAstTransformation.java
  79. +21 −23 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
  80. +4 −2 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsAwareClassLoader.java
  81. +14 −17 .../src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsAwareInjectionOperation.java
  82. +2 −2 ...core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/PluginAwareAstTransformer.java
  83. +7 −7 ...ain/groovy/org/codehaus/groovy/grails/context/support/PluginAwareResourceBundleMessageSource.java
  84. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/AbstractGrailsPlugin.java
  85. +9 −11 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/AbstractGrailsPluginManager.java
  86. +60 −56 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/BinaryGrailsPlugin.java
  87. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CoreGrailsPlugin.groovy
  88. +18 −8 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CorePluginFinder.java
  89. +30 −32 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java
  90. +39 −18 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPluginManager.java
  91. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginManager.java
  92. +2 −1 ...re/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGenerator.groovy
  93. +81 −89 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginPackager.groovy
  94. +3 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/WatchPattern.groovy
  95. +4 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/WatchPatternParser.java
  96. +1 −1 ...ovy/org/codehaus/groovy/grails/plugins/support/aware/GrailsApplicationAwareBeanPostProcessor.java
  97. +1 −1 .../groovy/org/codehaus/groovy/grails/plugins/support/aware/PluginManagerAwareBeanPostProcessor.java
  98. +4 −12 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/DevelopmentResourceLoader.java
  99. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/MockApplicationContext.java
  100. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/AbstractConstraint.java
  101. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstrainedPropertyBuilder.java
  102. +2 −2 ...s-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstraintsEvaluatorFactoryBean.java
  103. +27 −21 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/DefaultConstraintEvaluator.java
  104. +3 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
  105. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/MatchesConstraint.java
  106. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/MinConstraint.java
  107. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/MinSizeConstraint.java
  108. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/NotEqualConstraint.java
  109. +4 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/RangeConstraint.java
  110. +3 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ValidatorConstraint.java
  111. +1 −1 .../groovy/org/codehaus/groovy/grails/validation/metaclass/ConstraintsEvaluatingDynamicProperty.java
  112. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/routines/UrlValidator.java
  113. +1 −8 grails-core/src/test/groovy/org/codehaus/groovy/grails/plugins/BinaryPluginSpec.groovy
  114. +2 −11 ...est/groovy/org/codehaus/groovy/grails/plugins/publishing/PublishingDescriptorGeneratorSpec.groovy
  115. +4 −7 ...crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/DefaultGrailsTemplateGenerator.groovy
  116. +1 −1 grails-docs/src/main/groovy/grails/doc/DocEngine.groovy
  117. +8 −6 grails-docs/src/main/groovy/grails/doc/DocPublisher.groovy
  118. +1 −1 grails-docs/src/main/groovy/grails/doc/PdfBuilder.groovy
  119. +1 −1 grails-docs/src/main/template/css/main.css
  120. +3 −3 grails-docs/src/main/template/css/menu.css
  121. +0 −1 grails-docs/src/main/template/css/pdf.css
  122. +11 −12 grails-docs/src/main/template/css/ref.css
  123. +5 −8 grails-hibernate/build.gradle
  124. +4 −5 grails-hibernate/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java
  125. +14 −12 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.java
  126. +19 −20 ...hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormValidationTransformer.java
  127. +2 −4 ...src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
  128. +2 −2 ...ibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/GrailsHibernateDomainClass.java
  129. +21 −28 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateDatastore.java
  130. +568 −598 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateGormEnhancer.groovy
  131. +179 −184 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateSession.java
  132. +6 −11 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/SessionFactoryProxy.java
  133. +1 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/CacheConfig.groovy
  134. +18 −23 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java
  135. +29 −15 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsHibernateUtil.java
  136. +2 −2 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/IdentityEnumType.java
  137. +22 −21 ...ovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractClausedStaticPersistentMethod.java
  138. +6 −7 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractFindByPersistentMethod.java
  139. +5 −8 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractSavePersistentMethod.java
  140. +1 −1 ...src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllByPersistentMethod.java
  141. +4 −16 ...te/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindByPersistentMethod.java
  142. +38 −38 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindOrCreateByPersistentMethod.java
  143. +2 −3 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindOrSaveByPersistentMethod.java
  144. +2 −2 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindPersistentMethod.java
  145. +13 −9 .../src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ValidatePersistentMethod.java
  146. +7 −10 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/proxy/GroovyAwareJavassistLazyInitializer.java
  147. +3 −9 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/proxy/GroovyAwareJavassistProxyFactory.java
  148. +390 −402 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateQuery.java
  149. +1 −1 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventListener.java
  150. +96 −96 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventTriggeringInterceptor.java
  151. +3 −5 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/HibernateConstraintsEvaluator.java
  152. +5 −5 ...ate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/PersistentConstraint.java
  153. +2 −2 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/PersistentConstraintFactory.java
  154. +9 −9 ...te/src/main/groovy/org/codehaus/groovy/grails/plugins/orm/hibernate/HibernatePluginSupport.groovy
  155. +2 −2 grails-hibernate/src/main/resources/org/codehaus/groovy/grails/orm/hibernate/cfg/gorm.xsd
  156. +0 −7 grails-hibernate/src/test/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformerSpec.groovy
  157. +1 −1 grails-plugin-codecs/src/main/groovy/org/codehaus/groovy/grails/plugins/codecs/HTMLCodec.java
  158. +2 −2 grails-plugin-controllers/build.gradle
  159. +4 −4 ...trollers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerDomainTransformer.java
  160. +7 −5 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformer.java
  161. +44 −37 ...-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/MethodActionTransformer.java
  162. +7 −7 ...controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy
  163. +9 −9 ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java
  164. +14 −12 ...llers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersDomainBindingApi.java
  165. +1 −1 ...lugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/BindDynamicMethod.java
  166. +1 −1 ...ls-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ChainMethod.groovy
  167. +11 −17 ...n-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RedirectDynamicMethod.java
  168. +1 −1 ...gin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RenderDynamicMethod.java
  169. +1 −1 ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/WithFormMethod.groovy
  170. +2 −2 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/WebMetaUtils.groovy
  171. +4 −4 ...rc/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/CommandObjectEnablingPostProcessor.java
  172. +1 −8 ...trollers/src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformerSpec.groovy
  173. +1 −2 ...ollers/src/test/groovy/org/codehaus/groovy/grails/compiler/web/MethodActionTransformerSpec.groovy
  174. +1 −1 grails-plugin-converters/src/main/groovy/grails/converters/JSON.java
  175. +5 −11 grails-plugin-converters/src/main/groovy/grails/util/GrailsConfig.java
  176. +2 −2 ...n/groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersControllersTransformer.java
  177. +3 −4 ...c/main/groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersDomainTransformer.java
  178. +2 −2 ...ters/src/main/groovy/org/codehaus/groovy/grails/plugins/converters/ConvertersPluginSupport.groovy
  179. +4 −6 ...n-converters/src/main/groovy/org/codehaus/groovy/grails/plugins/converters/api/ConvertersApi.java
  180. +3 −3 ...groovy/org/codehaus/groovy/grails/web/converters/configuration/ChainedConverterConfiguration.java
  181. +4 −4 ...y/org/codehaus/groovy/grails/web/converters/configuration/ConvertersConfigurationInitializer.java
  182. +1 −1 ...groovy/org/codehaus/groovy/grails/web/converters/configuration/DefaultConverterConfiguration.java
  183. +1 −1 ...oovy/org/codehaus/groovy/grails/web/converters/configuration/ImmutableConverterConfiguration.java
  184. +1 −1 ...verters/src/main/groovy/org/codehaus/groovy/grails/web/converters/configuration/configtest.groovy
  185. +1 −2 ...main/groovy/org/codehaus/groovy/grails/web/converters/marshaller/json/ToStringBeanMarshaller.java
  186. +1 −2 .../main/groovy/org/codehaus/groovy/grails/web/converters/marshaller/xml/ToStringBeanMarshaller.java
  187. +1 −8 ...est/groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersControllersApiSpec.groovy
  188. +1 −9 .../groovy/org/codehaus/groovy/grails/compiler/web/converters/ConvertersDomainTransformerSpec.groovy
  189. +4 −4 ...ource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceGrailsPlugin.groovy
  190. +4 −4 grails-plugin-domain-class/build.gradle
  191. +1 −2 grails-plugin-domain-class/src/main/groovy/org/codehaus/groovy/grails/domain/GormApiSupport.groovy
  192. +40 −29 ...main-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassMappingContext.java
  193. +245 −239 ...in-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassPersistentEntity.java
  194. +26 −30 ...-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassPersistentProperty.java
  195. +11 −13 ...in-domain-class/src/main/groovy/org/codehaus/groovy/grails/plugins/DomainClassGrailsPlugin.groovy
  196. +3 −3 ...filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/FiltersGrailsPlugin.groovy
  197. +3 −8 ...in-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/gsp/GroovyPageOptimizerVisitor.java
  198. +8 −6 ...rc/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/ControllerTagLibraryTransformer.java
  199. +14 −14 ...ugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/TagLibraryTransformer.java
  200. +14 −11 ...plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllerTagLibraryApi.java
  201. +21 −18 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/TagLibraryApi.java
  202. +5 −5 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  203. +13 −15 ...plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ApplicationTagLib.groovy
  204. +7 −6 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  205. +3 −3 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormatTagLib.groovy
  206. +4 −4 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/JavascriptTagLib.groovy
  207. +8 −8 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/RenderTagLib.groovy
  208. +7 −7 ...lugin-logging/src/main/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformer.java
  209. +6 −5 grails-plugin-logging/src/main/groovy/org/codehaus/groovy/grails/web/util/Log4jConfigListener.java
  210. +1 −9 ...logging/src/test/groovy/org/codehaus/groovy/grails/compiler/logging/LoggingTransformerSpec.groovy
  211. +1 −1 ...lugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/compiler/web/MimeTypesTransformer.java
  212. +4 −4 ...n-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/MimeTypesApiSupport.groovy
  213. +17 −21 ...in-mimetypes/src/main/groovy/org/codehaus/groovy/grails/web/mime/DefaultAcceptHeaderParser.groovy
  214. +7 −9 grails-plugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/web/mime/DefaultMimeUtility.java
  215. +3 −17 ...mimetypes/src/test/groovy/org/codehaus/groovy/grails/compiler/web/MimeTypesTransformerSpec.groovy
  216. +0 −7 ...etypes/src/test/groovy/org/codehaus/groovy/grails/plugins/web/api/ResponseMimeTypesApiSpec.groovy
  217. +2 −2 ...ing/src/main/groovy/org/codehaus/groovy/grails/plugins/scaffolding/ScaffoldingGrailsPlugin.groovy
  218. +5 −4 grails-plugin-testing/build.gradle
  219. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/GroovyPagesTestCase.groovy
  220. +4 −4 grails-plugin-testing/src/main/groovy/grails/test/MockUtils.groovy
  221. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/Mock.java
  222. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/TestFor.java
  223. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/TestMixin.java
  224. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/domain/DomainClassUnitTestMixin.groovy
  225. +1 −1 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/GrailsUnitTestMixin.groovy
  226. +4 −4 ...ls-plugin-testing/src/main/groovy/grails/test/mixin/support/GroovyPageUnitTestResourceLoader.java
  227. +29 −31 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/LazyTagLibraryLookup.java
  228. +14 −21 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/ControllerUnitTestMixin.groovy
  229. +7 −7 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/FiltersUnitTestMixin.groovy
  230. +5 −6 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/GroovyPageUnitTestMixin.groovy
  231. +6 −8 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/UrlMappingsUnitTestMixin.groovy
  232. +1 −4 ...esting/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/MockTransformation.java
  233. +37 −46 ...ing/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestForTransformation.java
  234. +24 −32 ...g/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestMixinTransformation.java
  235. +4 −14 ...s-plugin-testing/src/test/groovy/grails/test/mixin/AstEnhancedControllerUnitTestMixinTests.groovy
  236. +5 −15 grails-plugin-testing/src/test/groovy/grails/test/mixin/ControllerUnitTestMixinTests.groovy
  237. +0 −8 grails-plugin-testing/src/test/groovy/grails/test/mixin/DomainClassAnnotatedSetupMethodTests.groovy
  238. +0 −7 grails-plugin-testing/src/test/groovy/grails/test/mixin/FiltersUnitTestMixinTests.groovy
  239. +5 −8 grails-plugin-testing/src/test/groovy/grails/test/mixin/GroovyPageUnitTestMixinTests.groovy
  240. +0 −7 grails-plugin-testing/src/test/groovy/grails/test/mixin/MockForConstraintsTests.groovy
  241. +0 −7 grails-plugin-testing/src/test/groovy/grails/test/mixin/TestForSpec.groovy
  242. +2 −3 grails-plugin-testing/src/test/groovy/grails/test/mixin/TestMixinSpec.groovy
  243. +23 −24 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/InlineExplodedTomcatServer.groovy
  244. +85 −92 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/IsolatedTomcat.java
  245. +2 −2 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/IsolatedWarTomcatServer.groovy
  246. +23 −23 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatLoader.groovy
  247. +1 −2 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatServer.groovy
  248. +10 −9 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatServerFactory.groovy
  249. +3 −5 grails-plugin-url-mappings/src/main/groovy/grails/test/GrailsUrlMappingsTestCase.groovy
  250. +1 −2 ...ngs/src/main/groovy/org/codehaus/groovy/grails/plugins/web/mapping/UrlMappingsGrailsPlugin.groovy
  251. +2 −2 ...plugin-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlCreator.java
  252. +2 −2 ...in-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingData.java
  253. +0 −3 ...l-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingEvaluator.java
  254. +1 −1 ...in-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingInfo.java
  255. +1 −1 ...n-url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/ResponseCodeUrlMapping.java
  256. +4 −4 ...mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/UrlMappingsHolderFactoryBean.java
  257. +7 −6 ...url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/filter/UrlMappingsFilter.java
  258. +3 −3 ...gs/src/test/groovy/org/codehaus/groovy/grails/web/mapping/LinkGeneratorWithUrlMappingsSpec.groovy
  259. +1 −1 grails-resources/src/grails/ant/build.xml
  260. +1 −2 grails-resources/src/grails/grails-app/conf/Config.groovy
  261. +2 −2 grails-resources/src/grails/grails-app/i18n/messages_da.properties
  262. +2 −2 grails-resources/src/grails/grails-app/i18n/messages_sv.properties
  263. +2 −2 grails-resources/src/grails/home/bash/grails-debug.bat
  264. +2 −2 grails-resources/src/grails/home/bash/grails.bat
  265. +11 −11 grails-resources/src/grails/home/bash/startGrails
  266. +14 −14 grails-resources/src/grails/home/bash/startGrails.bat
  267. +19 −22 grails-resources/src/grails/home/conf/webdefault.xml
  268. +2 −2 grails-resources/src/grails/home/docs/README
  269. +63 −71 grails-resources/src/grails/home/tests/junit-frames.xsl
  270. +2 −2 grails-resources/src/grails/plugin/grails-app/conf/BuildConfig.groovy
  271. +1 −1 grails-resources/src/grails/plugin/grails-app/conf/Config.groovy
  272. +1 −1 grails-resources/src/grails/templates/artifacts/hibernate.cfg.xml
  273. +1 −1 grails-resources/src/grails/templates/plugins/GrailsPlugin.groovy
  274. +1 −1 grails-resources/src/grails/templates/scaffolding/_form.gsp
  275. +1 −1 grails-resources/src/grails/templates/scaffolding/renderEditor.template
  276. +17 −18 grails-resources/src/war/WEB-INF/applicationContext.xml
  277. +9 −9 grails-resources/src/war/WEB-INF/log4j.properties
  278. +1 −1 grails-resources/src/war/WEB-INF/sitemesh.xml
  279. +0 −1 grails-resources/src/war/WEB-INF/test-applicationContext.xml
  280. +1 −1 grails-resources/src/war/WEB-INF/tld/2.3/fmt.tld
  281. +3 −3 grails-resources/src/war/WEB-INF/tld/2.4/c.tld
  282. +3 −3 grails-resources/src/war/WEB-INF/tld/2.4/fmt.tld
  283. +3 −3 grails-resources/src/war/WEB-INF/tld/2.5/c.tld
  284. +3 −3 grails-resources/src/war/WEB-INF/tld/2.5/fmt.tld
  285. +3 −3 grails-resources/src/war/WEB-INF/tld/3.0/c.tld
  286. +3 −3 grails-resources/src/war/WEB-INF/tld/3.0/fmt.tld
  287. +4 −4 grails-resources/src/war/css/mobile.css
  288. +1 −1 grails-resources/src/war/js/application.js
  289. +11 −10 grails-scripts/build.gradle
  290. +15 −16 grails-spring/src/main/groovy/grails/spring/BeanBuilder.java
  291. +3 −3 ...ls-spring/src/main/groovy/org/codehaus/groovy/grails/commons/spring/DefaultBeanConfiguration.java
  292. +1 −1 .../src/main/groovy/org/codehaus/groovy/grails/commons/spring/DefaultRuntimeSpringConfiguration.java
  293. +5 −5 grails-test-suite-base/src/main/groovy/grails/util/MockHttpServletResponse.java
  294. +1 −2 ...e/src/main/groovy/org/codehaus/groovy/grails/web/servlet/mvc/AbstractGrailsControllerTests.groovy
  295. +5 −5 ...st-suite-base/src/main/groovy/org/codehaus/groovy/grails/web/taglib/AbstractGrailsTagTests.groovy
  296. +9 −7 ...ence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AbstractGrailsHibernateTests.groovy
  297. +0 −7 ...sistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AbstractInheritanceTests.groovy
  298. +1 −2 ...rc/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AdvancedEnumCollectionMappingTests.groovy
  299. +5 −6 ...est/groovy/org/codehaus/groovy/grails/orm/hibernate/BidirectionalOneToManyAndOneToOneTests.groovy
  300. +1 −2 ...e-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/ClosureMappingTests.groovy
Sorry, we could not display the entire diff because too many files (563) changed.
View
22 build.gradle
@@ -55,7 +55,7 @@ subprojects { project ->
targetCompatibility = "1.5"
archivesBaseName = 'grails'
version = grailsVersion
- group = "org.grails"
+ group = "org.grails"
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
@@ -81,7 +81,6 @@ subprojects { project ->
mavenRepo(urls: "http://repo.grails.org/grails/core") {
if (project.hasProperty('snapshotTimeout')) {
setSnapshotTimeout(Long.parseLong(project.snapshotTimeout))
-
}
}
}
@@ -105,7 +104,6 @@ subprojects { project ->
testCompile('org.spockframework:spock-core:0.5-groovy-1.8') {
transitive = false
}
-
}
install.doLast {
@@ -133,9 +131,9 @@ subprojects { project ->
from javadoc.destinationDir
}
- groovydoc.doLast {
- delete("${buildDir}/tmp")
- }
+ groovydoc.doLast {
+ delete("${buildDir}/tmp")
+ }
configurations {
meta
@@ -156,11 +154,11 @@ subprojects { project ->
project.deployer = repositories.mavenDeployer {
repository(url: url) {
- beforeDeployment { deployment ->
- ["sources", "javadoc"].each { type ->
- deployment.addArtifact configurations.meta.artifacts.find { it.classifier == type }
- }
- }
+ beforeDeployment { deployment ->
+ ["sources", "javadoc"].each { type ->
+ deployment.addArtifact configurations.meta.artifacts.find { it.classifier == type }
+ }
+ }
final username = project.properties["artifactoryPublishUsername"]
final password = project.properties["artifactoryPublishPassword"]
@@ -173,8 +171,8 @@ subprojects { project ->
}
}
}
- uploadArchives.dependsOn sourcesJar, javadocJar
+ uploadArchives.dependsOn sourcesJar, javadocJar
/*
Install a method that can be used to fine tune the poms, e.g…
View
123 gradle/assemble.gradle
@@ -1,69 +1,66 @@
import org.apache.tools.ant.filters.ReplaceTokens
dependencyCache = {
- def cacheLocation = new File(gradle.gradleUserHomeDir, "cache")
- copy {
- from( cacheLocation ) {
- def dependencyIncludes = [] as Set
- def includeClosure = { artifact ->
- def dependency = artifact.getResolvedDependency()
- def file = artifact.file
+ def cacheLocation = new File(gradle.gradleUserHomeDir, "cache")
+ copy {
+ from(cacheLocation) {
+ def dependencyIncludes = [] as Set
+ def includeClosure = { artifact ->
+ def dependency = artifact.getResolvedDependency()
+ def file = artifact.file
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/*-${dependency.moduleVersion}.*"
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/jars/${dependency.moduleName}-${dependency.moduleVersion}.jar"
dependencyIncludes << "${dependency.moduleGroup}/${dependency.moduleName}/bundles/${dependency.moduleName}-${dependency.moduleVersion}.jar"
}
- for(project in subprojects) {
- project.configurations.compile.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
- project.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
- project.configurations.findByName("jsp21")?.resolvedConfiguration?.resolvedArtifacts?.each(includeClosure)
- project.configurations.findByName("agent")?.resolvedConfiguration?.resolvedArtifacts?.each(includeClosure)
- }
- includes = dependencyIncludes as List
- exclude "org.grails/**"
- }
- into "$projectDir/lib"
- }
- copy {
- from ( cacheLocation ) {
- includes = ['org.grails/grails-datastore-gorm/jars/grails-datastore-gorm-*.jar',
- 'org.grails/grails-gdoc-engine/jars/grails-gdoc-engine-*.jar']
- }
- into "$projectDir/lib"
- }
-
+ for (project in subprojects) {
+ project.configurations.compile.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
+ project.configurations.runtime.resolvedConfiguration.resolvedArtifacts.each(includeClosure)
+ project.configurations.findByName("jsp21")?.resolvedConfiguration?.resolvedArtifacts?.each(includeClosure)
+ project.configurations.findByName("agent")?.resolvedConfiguration?.resolvedArtifacts?.each(includeClosure)
+ }
+ includes = dependencyIncludes as List
+ exclude "org.grails/**"
+ }
+ into "$projectDir/lib"
+ }
+ copy {
+ from (cacheLocation) {
+ includes = ['org.grails/grails-datastore-gorm/jars/grails-datastore-gorm-*.jar',
+ 'org.grails/grails-gdoc-engine/jars/grails-gdoc-engine-*.jar']
+ }
+ into "$projectDir/lib"
+ }
}
task populateDependencies {
- doFirst dependencyCache
+ doFirst dependencyCache
}
task libs(dependsOn: getTasksByName("assemble", true)) {
- doFirst dependencyCache
+ doFirst dependencyCache
destinationDir = 'dist'
- doLast {
- copy {
- for(project in subprojects) {
- from( project.libsDir ) {
- include "*-${grailsVersion}.jar"
- }
- }
- into 'dist'
- }
- copy {
- from("$projectDir/grails-resources") {
- include 'src/grails', 'src/war'
- }
- into projectDir
- }
-
- }
+ doLast {
+ copy {
+ for (project in subprojects) {
+ from(project.libsDir) {
+ include "*-${grailsVersion}.jar"
+ }
+ }
+ into 'dist'
+ }
+ copy {
+ from("$projectDir/grails-resources") {
+ include 'src/grails', 'src/war'
+ }
+ into projectDir
+ }
+ }
}
libs.inputs.files(subprojects.configurations.compile, subprojects.configurations.runtime)
libs.outputs.files(fileTree("lib"))
-
task pluginsFromSvn {
dir = "$buildDir/pluginsFromSvn"
grailsHibernateDest = "$dir/grails-hibernate-${grailsVersion}.zip"
@@ -72,12 +69,11 @@ task pluginsFromSvn {
doFirst {
ant {
mkdir(dir: dir)
- def versionTag = grailsVersion.replaceAll(/\./, '_').toUpperCase()
+ def versionTag = grailsVersion.replaceAll(/\./, '_').toUpperCase()
get(src: "http://svn.codehaus.org/grails-plugins/grails-hibernate/tags/RELEASE_${versionTag}/grails-hibernate-${grailsVersion}.zip",
- dest: grailsHibernateDest, verbose: true, usetimestamp: true)
+ dest: grailsHibernateDest, verbose: true, usetimestamp: true)
get(src: "http://svn.codehaus.org/grails-plugins/grails-tomcat/tags/RELEASE_${versionTag}/grails-tomcat-${grailsVersion}.zip",
- dest: grailsTomcatDest, verbose: true, usetimestamp: true)
-
+ dest: grailsTomcatDest, verbose: true, usetimestamp: true)
}
}
}
@@ -90,19 +86,17 @@ distSpec = copySpec {
include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'build.gradle', 'build.properties', 'dependencies.txt',
'LICENSE', 'INSTALL', "src/", "gradlew.bat","gradle.properties"
exclude 'ant/bin'
-
}
- from("grails-resources") {
- into "grails-$grailsVersion"
- include 'src/grails/**', 'src/war/**'
+ from("grails-resources") {
+ into "grails-$grailsVersion"
+ include 'src/grails/**', 'src/war/**'
// this file is accounted for later with special handling to do some token replacement
exclude 'src/grails/grails-macros.xml'
-
- }
+ }
from(projectDir) {
- into "grails-$grailsVersion"
- include "gradlew"
- fileMode = 0755
+ into "grails-$grailsVersion"
+ include "gradlew"
+ fileMode = 0755
}
from(docs.destinationDir) {
into "grails-$grailsVersion/doc"
@@ -122,18 +116,17 @@ distSpec = copySpec {
from("grails-resources/src/grails/home/bash") {
into "grails-$grailsVersion/bin"
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
- filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
+ filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
filter(ReplaceTokens, tokens: ['spring.loaded.version': springLoadedVersion])
fileMode = 0755
}
from("grails-resources/src/grails/home/conf") {
into "grails-$grailsVersion/conf"
- filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
filter(ReplaceTokens, tokens: ['ant.version': antVersion])
filter(ReplaceTokens, tokens: ['gant.version': gantVersion])
filter(ReplaceTokens, tokens: ['ivy.version': ivyVersion])
-
}
from(libs.destinationDir) {
into "grails-$grailsVersion/dist"
@@ -147,9 +140,9 @@ distSpec = copySpec {
task zipDist(type: Zip,dependsOn:libs) {
from distSpec
- destinationDir = "${buildDir}/distributions" as File
- baseName = 'grails'
- appendix = grailsVersion
+ destinationDir = "${buildDir}/distributions" as File
+ baseName = 'grails'
+ appendix = grailsVersion
}
/*task zipDoc(type: Zip) {
View
51 gradle/docs.gradle
@@ -10,29 +10,28 @@ task stubs {
mkdir(dir: destinationDir)
taskdef(name: "generatestubs", classname: "org.codehaus.groovy.grails.cli.GenerateStubsTask") {
classpath {
- for(sub in subprojects) {
- pathelement path: sub.sourceSets.main.compileClasspath.asPath
- }
- }
- }
+ for(sub in subprojects) {
+ pathelement path: sub.sourceSets.main.compileClasspath.asPath
+ }
+ }
+ }
+
generatestubs(destdir: destinationDir) {
classpath {
- for(sub in subprojects) {
- pathelement path: sub.sourceSets.main.compileClasspath.asPath
- }
+ for(sub in subprojects) {
+ pathelement path: sub.sourceSets.main.compileClasspath.asPath
+ }
}
src {
- for(sub in subprojects) {
- sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
- if(srcDir.exists()) {
- dirset(dir: srcDir) {
- exclude name: "**/*.properties"
- }
-
- }
- }
- }
-
+ for (sub in subprojects) {
+ sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
+ if (srcDir.exists()) {
+ dirset(dir: srcDir) {
+ exclude name: "**/*.properties"
+ }
+ }
+ }
+ }
}
}
}
@@ -44,13 +43,13 @@ task docs {
}
task javadoc(type:Javadoc) {
- classpath = files(subprojects.configurations.compile)
+ classpath = files(subprojects.configurations.compile)
dependsOn stubs
maxMemory = '256M'
destinationDir = file("$docs.destinationDir/javadoc")
source subprojects.sourceSets.main.groovy.srcDirs + stubs.destinationDir
include "org/codehaus/groovy/grails/**", "grails/**"
- exclude "**/**.groovy"
+ exclude "**/**.groovy"
project.configure(options) {
windowTitle = "Grails $grailsVersion"
docTitle = "<h1>Grails</h1>"
@@ -67,8 +66,8 @@ task javadoc(type:Javadoc) {
}
task groovydoc(type:Groovydoc) {
- classpath = files(subprojects.configurations.compile)
- groovyClasspath = files(subprojects.configurations.compile)
+ classpath = files(subprojects.configurations.compile)
+ groovyClasspath = files(subprojects.configurations.compile)
destinationDir = file("$docs.destinationDir/api")
windowTitle = "Grails $grailsVersion"
docTitle = "Grails $grailsVersion"
@@ -78,9 +77,9 @@ task groovydoc(type:Groovydoc) {
// link("http://static.springsource.org/spring/docs/3.0.x/javadoc-api", "org.springframework.")
// link("http://download.oracle.com/javase/1.5.0/docs/api", "java." , "javax.")
// link("http://download.oracle.com/javaee/5/api", "javax.")
- doLast {
- delete("${buildDir}/tmp")
- }
+ doLast {
+ delete("${buildDir}/tmp")
+ }
}
task fetchGrailsDocsSource << {
View
13 grails-bootstrap/build.gradle
@@ -1,4 +1,5 @@
import org.apache.tools.ant.filters.ReplaceTokens
+
dependencies {
compile "org.springframework:spring-core:${springVersion}",
"org.springframework:spring-beans:${springVersion}",
@@ -7,7 +8,7 @@ dependencies {
"org.springframework:spring-context-support:${springVersion}"
- compile( "org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE" ) {
+ compile("org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE") {
// Explicitly exclude OSGIified dependencies - GRAILS-7525
// Have to use excludes instead of transitive = false - GRADLE-1574
["protobuf-java-lite", "json-simple", "bcpg-jdk15", "bcprov-jdk15"].each { dep ->
@@ -19,18 +20,14 @@ dependencies {
compile 'com.google.protobuf:protobuf-java:2.3.0',
'com.googlecode.json-simple:json-simple:1.1',
"org.bouncycastle:bcpg-jdk15:1.45"
-
-
+
compile "commons-lang:commons-lang:$commonsLangVersion"
compile 'commons-cli:commons-cli:1.2'
-
-
- compile( 'org.codehaus.gpars:gpars:0.9' ) {
+ compile('org.codehaus.gpars:gpars:0.9') {
exclude module:'netty'
}
-
// Ant
compile "org.apache.ant:ant:${antVersion}",
"org.apache.ant:ant-launcher:${antVersion}",
@@ -42,8 +39,6 @@ dependencies {
runtime 'org.coconut.forkjoin:jsr166y:070108', // Dependency for parallel execution in Gpars
'org.fusesource.jansi:jansi:1.2.1',
'jline:jline:0.9.94'
-
-
}
processResources{
View
14 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
@@ -278,12 +278,12 @@ class BuildSettings extends AbstractBuildSettings {
* Setting for whether or not to enable verbose compilation, can be overridden via -verboseCompile(=[true|false])?
*/
boolean verboseCompile = false
-
+
/**
* Return whether the BuildConfig has been modified
*/
boolean modified = false
-
+
final GrailsCoreDependencies coreDependencies
private List<File> compileDependencies = []
@@ -521,7 +521,7 @@ class BuildSettings extends AbstractBuildSettings {
}
coreDependencies = new GrailsCoreDependencies(grailsVersion)
-
+
// If 'grailsHome' is set, add the JAR file dependencies.
defaultPluginMap = [hibernate:grailsVersion, tomcat:grailsVersion]
defaultPluginSet = defaultPluginMap.keySet()
@@ -648,9 +648,9 @@ class BuildSettings extends AbstractBuildSettings {
projectWarExplodedDirSet = true
}
- boolean getConvertClosuresArtefacts(){ convertClosuresArtefacts }
+ boolean getConvertClosuresArtefacts() { convertClosuresArtefacts }
- void setConvertClosuresArtefacts(boolean convert){
+ void setConvertClosuresArtefacts(boolean convert) {
convertClosuresArtefacts = convert
convertClosuresArtefactsSet = true
}
@@ -767,7 +767,7 @@ class BuildSettings extends AbstractBuildSettings {
ConfigObject loadConfig(ConfigObject config) {
try {
this.config.merge(config)
- return this.config
+ return config
}
finally {
postLoadConfig()
@@ -799,7 +799,7 @@ class BuildSettings extends AbstractBuildSettings {
def ois = new ObjectInputStream(input)
Map dependencyMap = ois.readObject()
- if(dependencyMap?.values()*.any { !it.exists() }) {
+ if (dependencyMap?.values()*.any { !it.exists() }) {
modified = true
}
else {
View
2 grails-bootstrap/src/main/groovy/grails/util/Environment.java
@@ -332,7 +332,7 @@ private static boolean isBlank(String value) {
*/
public String getName() {
if (name == null) {
- return this.toString().toLowerCase(Locale.getDefault());
+ return toString().toLowerCase(Locale.getDefault());
}
return name;
}
View
8 grails-bootstrap/src/main/groovy/grails/util/GrailsNameUtils.java
@@ -44,8 +44,8 @@ public static String getSetterName(String propertyName) {
*/
public static String getGetterName(String propertyName) {
final String suffix;
- if(propertyName.length() > 1 &&
- Character.isLowerCase(propertyName.charAt(0)) &&
+ if (propertyName.length() > 1 &&
+ Character.isLowerCase(propertyName.charAt(0)) &&
Character.isUpperCase(propertyName.charAt(1))) {
suffix = propertyName;
} else {
@@ -97,9 +97,9 @@ public static String getClassNameRepresentation(String name) {
for (String token1 : tokens) {
String token = token1.trim();
int length = token.length();
- if(length > 0) {
+ if (length > 0) {
buf.append(token.substring(0, 1).toUpperCase(Locale.ENGLISH));
- if(length > 1) {
+ if (length > 1) {
buf.append(token.substring(1));
}
}
View
2 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
@@ -239,7 +239,7 @@ public void persist() {
store(out, "Grails Metadata file");
}
catch (Exception e) {
- throw new RuntimeException("Error persisting metadata to file ["+metadataFile+"]: " + e.getMessage(),e );
+ throw new RuntimeException("Error persisting metadata to file ["+metadataFile+"]: " + e.getMessage(), e);
}
finally {
closeQuietly(out);
View
6 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
@@ -205,11 +205,11 @@ class PluginBuildSettings {
}
def baseDir = buildSettings?.getBaseDir()?.getCanonicalPath()
- if(baseDir != null) {
+ if (baseDir != null) {
- if(sourceFile.startsWith(baseDir)) {
+ if (sourceFile.startsWith(baseDir)) {
def basePluginInfo = getPluginInfo(baseDir)
- if(basePluginInfo != null) {
+ if (basePluginInfo != null) {
pluginInfoToSourceMap[sourceFile] = basePluginInfo
return basePluginInfo
}
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineHelper.java
@@ -103,7 +103,7 @@ public String userInput(String message, String[] validResponses) {
out.println();
}
catch (IOException ex) {
- System.out.println("ERROR: Could not read System.in due to:" + ex.getMessage() );
+ System.out.println("ERROR: Could not read System.in due to:" + ex.getMessage());
return null;
}
}
View
12 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineInputHandler.java
@@ -26,11 +26,10 @@
import java.util.Vector;
/**
- * Custom input handler mechanism for Ant that ignores case of input
+ * Custom input handler mechanism for Ant that ignores case of input.
*
* @author Graeme Rocher
* @since 1.4
- *
*/
public class CommandLineInputHandler implements InputHandler {
private CommandLineHelper commandLineHelper;
@@ -40,14 +39,15 @@ public CommandLineInputHandler() {
}
public CommandLineInputHandler(InputStream input, PrintStream out) {
- this.commandLineHelper = new CommandLineHelper(input, System.out);
+ this.commandLineHelper = new CommandLineHelper(input, out);
}
public void handleInput(InputRequest inputRequest) throws BuildException {
String[] validInputs = null;
- if(inputRequest instanceof MultipleChoiceInputRequest) {
- Vector choices = ((MultipleChoiceInputRequest) inputRequest).getChoices();
- validInputs = (String[]) choices.toArray(new String[choices.size()]);
+ if (inputRequest instanceof MultipleChoiceInputRequest) {
+ @SuppressWarnings("unchecked")
+ Vector<String> choices = ((MultipleChoiceInputRequest) inputRequest).getChoices();
+ validInputs = choices.toArray(new String[choices.size()]);
}
String result = commandLineHelper.userInput(inputRequest.getPrompt(), validInputs);
inputRequest.setInput(result);
View
63 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
@@ -16,38 +16,56 @@
package org.codehaus.groovy.grails.cli;
import gant.Gant;
-import grails.util.*;
+import grails.util.BuildSettings;
+import grails.util.BuildSettingsHolder;
+import grails.util.CosineSimilarity;
+import grails.util.Environment;
+import grails.util.GrailsNameUtils;
import groovy.lang.Closure;
import groovy.lang.ExpandoMetaClass;
import groovy.util.AntBuilder;
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.BuildLogger;
-import org.apache.tools.ant.Project;
-import org.codehaus.gant.GantBinding;
-import org.codehaus.groovy.grails.cli.api.BaseSettingsApi;
-import org.codehaus.groovy.grails.resolve.IvyDependencyManager;
-import org.codehaus.groovy.runtime.DefaultGroovyMethods;
-import org.codehaus.groovy.runtime.MethodClosure;
-import org.springframework.core.io.FileSystemResource;
-import org.springframework.core.io.Resource;
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
-import org.springframework.util.Log4jConfigurer;
-import org.springframework.util.ReflectionUtils;
import java.beans.IntrospectionException;
import java.beans.Introspector;
import java.beans.PropertyDescriptor;
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.PrintStream;
import java.lang.reflect.Method;
import java.lang.reflect.Modifier;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLClassLoader;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import org.apache.tools.ant.Project;
+import org.codehaus.gant.GantBinding;
+import org.codehaus.groovy.grails.cli.api.BaseSettingsApi;
+import org.codehaus.groovy.grails.resolve.IvyDependencyManager;
+import org.codehaus.groovy.runtime.DefaultGroovyMethods;
+import org.codehaus.groovy.runtime.MethodClosure;
+import org.springframework.core.io.FileSystemResource;
+import org.springframework.core.io.Resource;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
+import org.springframework.util.Log4jConfigurer;
+import org.springframework.util.ReflectionUtils;
+
/**
* Handles Grails command line interface for running scripts.
*
@@ -203,7 +221,7 @@ private static String processSystemArguments(String allArgs) {
int i = allArgs.lastIndexOf(lastMatch) + lastMatch.length();
allArgs = allArgs.substring(i);
}
- if(allArgs.contains(AGENT_FLAG)) {
+ if (allArgs.contains(AGENT_FLAG)) {
allArgs = allArgs.replace(AGENT_FLAG, "");
}
return allArgs;
@@ -231,7 +249,7 @@ public GrailsScriptRunner(BuildSettings settings) {
}
public PrintStream getOut() {
- return this.out;
+ return out;
}
public void setOut(PrintStream outputStream) {
@@ -493,8 +511,7 @@ private int callPluginOrGrailsScript(String scriptName, String env) throws IOExc
if (!isGrailsProject() && !isExternalScript(scriptFile)) {
out.println(settings.getBaseDir().getPath() + " does not appear to be part of a Grails application.");
out.println("The following commands are supported outside of a project:");
- Collections.sort(scriptsAllowedOutsideOfProject, new Comparator<Resource>(){
-
+ Collections.sort(scriptsAllowedOutsideOfProject, new Comparator<Resource>() {
public int compare(Resource resource, Resource resource1) {
return resource.getFilename().compareTo(resource1.getFilename());
}
@@ -590,7 +607,7 @@ public int compare(Resource resource, Resource resource1) {
private void setDefaultInputStream(GantBinding binding) {
- if(this.orignalIn == null) {
+ if (this.orignalIn == null) {
this.orignalIn = System.in;
}
// Gant does not initialise the default input stream for
@@ -772,7 +789,7 @@ private GantBinding initBinding(final GantBinding binding, String scriptName) {
final BaseSettingsApi cla = new BaseSettingsApi(settings, isInteractive);
// Enable UAA for run-app because it is likely that the container will be running long enough to report useful info
- if(scriptName.equals("RunApp")) {
+ if (scriptName.equals("RunApp")) {
cla.enableUaa();
}
View
21 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
@@ -37,13 +37,12 @@
import java.util.Properties;
/**
- * Utility methods used on the command line
+ * Utility methods used on the command line.
*
* @author Graeme Rocher
*/
public class BaseSettingsApi {
-
private static final Resource[] NO_RESOURCES = new Resource[0];
private BuildSettings buildSettings;
private Properties buildProps;
@@ -88,14 +87,12 @@ public BaseSettingsApi(final BuildSettings buildSettings, boolean interactive) {
}
this.configSlurper = buildSettings.createConfigSlurper();
this.configSlurper.setEnvironment(buildSettings.getGrailsEnv());
-
}
public void enableUaa() {
- if(UaaIntegration.isAvailable()) {
+ if (UaaIntegration.isAvailable()) {
UaaIntegration.enable(buildSettings, pluginSettings, isInteractive);
}
-
}
public ConfigSlurper getConfigSlurper() {
@@ -124,21 +121,21 @@ public String getServerHost() {
return (String)getPropertyValue("grails.server.host", null);
}
- public String getGrailsAppName() { return this.grailsAppName; }
+ public String getGrailsAppName() { return grailsAppName; }
public String getGrailsAppVersion() { return metadata.getApplicationVersion(); }
public String getAppGrailsVersion() { return metadata.getGrailsVersion(); }
public String getServletVersion() { return metadata.getServletVersion() != null ? metadata.getServletVersion() : "2.5"; }
public String getPluginsHome() {
- return this.pluginsHome;
+ return pluginsHome;
}
public PluginBuildSettings getPluginBuildSettings() {
- return this.pluginSettings;
+ return pluginSettings;
}
public PluginBuildSettings getPluginSettings() {
- return this.pluginSettings;
+ return pluginSettings;
}
public BuildSettings getBuildSettings() {
@@ -200,7 +197,7 @@ public void copyGrailsResource(Object targetFile, Resource resource) throws File
copyGrailsResource(targetFile, resource, true);
}
- public void copyGrailsResource(Object targetFile, Resource resource, boolean overwrite ) throws FileNotFoundException, IOException {
+ public void copyGrailsResource(Object targetFile, Resource resource, boolean overwrite) throws FileNotFoundException, IOException {
File file = new File(targetFile.toString());
if (overwrite || !file.exists()) {
FileCopyUtils.copy(resource.getInputStream(), new FileOutputStream(file));
@@ -227,7 +224,7 @@ public void copyGrailsResources(Object destDir, Object pattern, boolean overwrit
* system property, then in the BuildSettings configuration, and finally
* uses the given default value if other options are exhausted.
*/
- public Object getPropertyValue( String propName, Object defaultValue ) {
+ public Object getPropertyValue(String propName, Object defaultValue) {
// First check whether we have a system property with the given name.
Object value = System.getProperty(propName);
if (value != null) return value;
@@ -263,7 +260,7 @@ public void updateMetadata(@SuppressWarnings("rawtypes") Map entries) {
*
* where 'compile' is the target.
*/
- public void profile(String name, Closure<?> callable ) {
+ public void profile(String name, Closure<?> callable) {
if (enableProfile) {
long now = System.currentTimeMillis();
System.out.println("Profiling ["+name+"] start");
View
2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsStarter.java
@@ -203,7 +203,7 @@ else if (args[argsOffset].equals("--conf")) {
}
}
catch (IOException e) {
- System.out.println("WARNING: I/O error reading VM specific classpath ["+vmConfig+"]: " + e.getMessage() );
+ System.out.println("WARNING: I/O error reading VM specific classpath ["+vmConfig+"]: " + e.getMessage());
}
finally {
try {
View
33 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
@@ -66,19 +66,19 @@ public static void enable(final BuildSettings settings, final PluginBuildSetting
final UaaService uaaService = UaaServiceFactory.getUaaService();
final UaaClient.Privacy.PrivacyLevel privacyLevel = uaaService.getPrivacyLevel();
- if(!uaaService.isUaaTermsOfUseAccepted() && interactive) {
+ if (!uaaService.isUaaTermsOfUseAccepted() && interactive) {
// prompt for UAA choice
- if(privacyLevel.equals( UaaClient.Privacy.PrivacyLevel.UNDECIDED_TOU )) {
+ if (privacyLevel.equals(UaaClient.Privacy.PrivacyLevel.UNDECIDED_TOU)) {
while (true) {
System.out.print(MESSAGE);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try {
String selection = br.readLine().trim();
- if("y".equalsIgnoreCase(selection)) {
+ if ("y".equalsIgnoreCase(selection)) {
uaaService.setPrivacyLevel(UaaClient.Privacy.PrivacyLevel.ENABLE_UAA);
break;
}
- else if("n".equalsIgnoreCase(selection)) {
+ else if ("n".equalsIgnoreCase(selection)) {
uaaService.setPrivacyLevel(UaaClient.Privacy.PrivacyLevel.DECLINE_TOU);
break;
}
@@ -89,53 +89,52 @@ else if("n".equalsIgnoreCase(selection)) {
}
}
}
- else if(isUaaAccepted(privacyLevel)) {
+ else if (isUaaAccepted(privacyLevel)) {
Runnable r = new Runnable() {
public void run() {
final UaaClient.Product product = VersionHelper.getProduct("Grails", settings.getGrailsVersion());
uaaService.registerProductUsage(product);
final ChainResolver chainResolver = settings.getDependencyManager().getChainResolver();
GrailsRepoResolver centralRepo = findCentralRepoResolver(chainResolver);
- if(centralRepo != null) {
+ if (centralRepo != null) {
final GPathResult pluginList = centralRepo.getPluginList(new File(settings.getGrailsWorkDir() + "/plugin-list-" + centralRepo.getName() + ".xml"));
final GrailsPluginInfo[] pluginInfos = pluginSettings.getPluginInfos(pluginSettings.getPluginDirPath());
for (GrailsPluginInfo pluginInfo : pluginInfos) {
boolean registerUsage = false;
- if(settings.getDefaultPluginSet().contains(pluginInfo.getName())) {
+ if (settings.getDefaultPluginSet().contains(pluginInfo.getName())) {
registerUsage = true;
}
else {
final Object plugin = UaaIntegrationSupport.findPlugin(pluginList, pluginInfo.getName());
- if(plugin != null) {
+ if (plugin != null) {
registerUsage = true;
}
}
- if(registerUsage) {
+ if (registerUsage) {
uaaService.registerFeatureUsage(product, VersionHelper.getFeatureUse(pluginInfo.getName(), pluginInfo.getVersion()));
}
}
}
}
};
-
ConcurrentTaskScheduler scheduler = new ConcurrentTaskScheduler();
-
- scheduler.schedule(r, new Date(System.currentTimeMillis()+ ONE_MINUTE));
+ scheduler.schedule(r, new Date(System.currentTimeMillis() + ONE_MINUTE));
}
}
private static GrailsRepoResolver findCentralRepoResolver(ChainResolver chainResolver) {
- final List resolvers = chainResolver.getResolvers();
+ @SuppressWarnings("unchecked")
+ final List<Object> resolvers = chainResolver.getResolvers();
for (Object resolver : resolvers) {
- if(resolver instanceof GrailsRepoResolver) {
+ if (resolver instanceof GrailsRepoResolver) {
final GrailsRepoResolver grailsRepoResolver = (GrailsRepoResolver) resolver;
final String resolverName = grailsRepoResolver.getName();
- if(resolverName != null && resolverName.equals("grailsCentral")) {
+ if (resolverName != null && resolverName.equals("grailsCentral")) {
return grailsRepoResolver;
}
}
@@ -144,7 +143,7 @@ private static GrailsRepoResolver findCentralRepoResolver(ChainResolver chainRes
}
private static boolean isUaaAccepted(UaaClient.Privacy.PrivacyLevel privacyLevel) {
- return privacyLevel.equals( UaaClient.Privacy.PrivacyLevel.ENABLE_UAA ) || privacyLevel.equals( UaaClient.Privacy.PrivacyLevel.LIMITED_DATA );
+ return privacyLevel.equals(UaaClient.Privacy.PrivacyLevel.ENABLE_UAA) ||
+ privacyLevel.equals(UaaClient.Privacy.PrivacyLevel.LIMITED_DATA);
}
-
}
View
14 ...strap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegrationSupport.groovy
@@ -1,24 +1,22 @@
package org.codehaus.groovy.grails.cli.support
/**
- * Groovy XML support class for UaaIntegration
+ * Groovy XML support class for UaaIntegration.
*/
class UaaIntegrationSupport {
/**
- * Finds a plugin in the given plugin list
+ * Finds a plugin in the given plugin list.
*
* @param pluginList The plugin list
* @param pluginName The plugin name
* @return The plugin node
*/
static findPlugin(pluginList, String pluginName) {
- if(pluginList != null) {
- def plugin = pluginList.plugin.find { it.@name == pluginName }
- if(plugin) {
- return plugin
- }
+ if (pluginList == null) {
+ return null
}
- return null
+
+ pluginList.plugin.find { it.@name == pluginName }
}
}
View
2 ...otstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/AstPluginDescriptorReader.java
@@ -92,7 +92,7 @@ public void visitProperty(PropertyNode node) {
String name = node.getName();
final Expression expr = node.getField().getInitialExpression();
- if(expr != null) {
+ if (expr != null) {
Object value;
if (expr instanceof ListExpression) {
final List<String> list = new ArrayList<String>();
View
4 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/BasicGrailsPluginInfo.java
@@ -83,12 +83,12 @@ public String getFullName() {
}
public Resource getDescriptor() {
- return this.descriptor;
+ return descriptor;
}
public Resource getPluginDir() {
try {
- return this.descriptor.createRelative(".");
+ return descriptor.createRelative(".");
}
catch (IOException e) {
return null;
View
4 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/metadata/GrailsPlugin.java
@@ -21,8 +21,8 @@
import java.lang.annotation.ElementType;
/**
- * Annotation that appears on classes of a particular plugin
- *
+ * Annotation that appears on classes of a particular plugin.
+ *
* @author Graeme Rocher
* @since 1.2
*/
View
133 ...trap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
@@ -14,11 +14,14 @@
*/
package org.codehaus.groovy.grails.resolve;
-import groovy.lang.Closure;
-
import grails.util.BuildSettings;
import grails.util.Metadata;
+import groovy.lang.Closure;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.text.ParseException;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
@@ -28,29 +31,22 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.text.ParseException;
-import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.core.module.descriptor.Configuration;
-import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
-import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor;
+import org.apache.ivy.core.module.descriptor.DefaultDependencyArtifactDescriptor;
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor;
+import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor;
import org.apache.ivy.core.module.descriptor.DependencyDescriptor;
import org.apache.ivy.core.module.descriptor.ExcludeRule;
import org.apache.ivy.core.module.descriptor.ModuleDescriptor;
-import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor;
-import org.apache.ivy.core.module.descriptor.DefaultDependencyArtifactDescriptor;
import org.apache.ivy.core.module.id.ArtifactId;
import org.apache.ivy.core.module.id.ModuleId;
import org.apache.ivy.core.module.id.ModuleRevisionId;
+import org.apache.ivy.core.settings.IvySettings;
import org.apache.ivy.plugins.matcher.PatternMatcher;
import org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser;
-
-import org.codehaus.groovy.grails.resolve.config.DependencyConfigurationContext;
import org.codehaus.groovy.grails.resolve.config.DependencyConfigurationConfigurer;
+import org.codehaus.groovy.grails.resolve.config.DependencyConfigurationContext;
/**
* Base class for IvyDependencyManager with some logic implemented in Java.
@@ -138,14 +134,14 @@
new ConcurrentHashMap<String, DependencyDescriptor>();
protected String applicationName;
protected String applicationVersion;
- protected DefaultModuleDescriptor moduleDescriptor;
+ protected DefaultModuleDescriptor moduleDescriptor;
protected boolean hasApplicationDependencies = false;
protected boolean readPom = false;
final protected IvySettings ivySettings;
final protected BuildSettings buildSettings;
final protected Metadata metadata;
-
+
public AbstractIvyDependencyManager(IvySettings ivySettings, BuildSettings buildSettings, Metadata metadata) {
this.ivySettings = ivySettings;
this.buildSettings = buildSettings;
@@ -169,18 +165,18 @@ public void setModuleDescriptor(DefaultModuleDescriptor moduleDescriptor) {
* from the framework or other plugins
*/
public boolean hasApplicationDependencies() {
- return hasApplicationDependencies;
- }
-
- public Collection<String> getUsedConfigurations() {
- return usedConfigurations;
- }
-
- public void setUsedConfigurations(Collection<String> usedConfigurations) {
- this.usedConfigurations = usedConfigurations;
- }
-
- /**
+ return hasApplicationDependencies;
+ }
+
+ public Collection<String> getUsedConfigurations() {
+ return usedConfigurations;
+ }
+
+ public void setUsedConfigurations(Collection<String> usedConfigurations) {
+ this.usedConfigurations = usedConfigurations;
+ }
+
+ /**
* Obtains a set of dependency descriptors defined in the project
*/
Set<DependencyDescriptor> getDependencyDescriptors() {
@@ -238,7 +234,7 @@ public DependencyDescriptor getPluginDependencyDescriptor(String pluginName) {
/**
* Obtains a list of dependencies defined in the project
*/
- public Set<ModuleRevisionId> getDependencies() { return this.dependencies; }
+ public Set<ModuleRevisionId> getDependencies() { return dependencies; }
/**
* Tests whether the given ModuleId is defined in the list of dependencies
@@ -253,7 +249,7 @@ boolean hasDependency(ModuleId mid) {
boolean hasDependency(String group, String name) {
return hasDependency(ModuleId.newInstance(group, name));
}
-
+
public String getApplicationName() {
return applicationName;
}
@@ -281,11 +277,11 @@ public void setApplicationVersion(String applicationVersion) {
public boolean getReadPom() {
return readPom;
}
-
+
public void setReadPom(boolean flag) {
readPom = flag;
}
-
+
/**
* Returns whether a plugin is transitive, ie whether its dependencies are resolved transitively
*
@@ -310,13 +306,15 @@ public boolean isPluginTransitivelyIncluded(String pluginName) {
/**
* @deprecated use registerDependency(String, EnhancedDefaultDependencyDescriptor)
*/
+ @Deprecated
public void configureDependencyDescriptor(EnhancedDefaultDependencyDescriptor dependencyDescriptor, String scope) {
configureDependencyDescriptor(dependencyDescriptor, scope, false);
}
-
+
/**
* @deprecated use registerDependency(String, EnhancedDefaultDependencyDescriptor) or registerPluginDependency(String EnhancedDefaultDependencyDescriptor)
*/
+ @Deprecated
public void configureDependencyDescriptor(EnhancedDefaultDependencyDescriptor dependencyDescriptor, String scope, boolean pluginMode) {
if (pluginMode) {
registerPluginDependency(scope, dependencyDescriptor);
@@ -327,12 +325,12 @@ public void configureDependencyDescriptor(EnhancedDefaultDependencyDescriptor de
/**
* Registers a JAR dependency with the dependency manager.
- *
+ *
* @see #registerPluginDependency(String, EnhancedDefaultDependencyDescriptor)
*/
public void registerDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor) {
registerDependencyCommon(scope, descriptor);
-
+
ModuleRevisionId revisionId = descriptor.getDependencyRevisionId();
modules.add(revisionId.getModuleId());
dependencies.add(revisionId);
@@ -344,7 +342,7 @@ public void registerDependency(String scope, EnhancedDefaultDependencyDescriptor
deps.add(revisionId);
orgToDepMap.put(org, deps);
}
-
+
dependencyDescriptors.add(descriptor);
if (descriptor.isExportedToApplication()) {
moduleDescriptor.addDependency(descriptor);
@@ -353,41 +351,41 @@ public void registerDependency(String scope, EnhancedDefaultDependencyDescriptor
/**
* Registers a plugin dependency (as in Grails plugin).
- *
+ *
* @see #registerDependency(String, EnhancedDefaultDependencyDescriptor)
*/
public void registerPluginDependency(String scope, EnhancedDefaultDependencyDescriptor descriptor) {
String name = descriptor.getDependencyId().getName();
-
+
String classifierAttribute = descriptor.getExtraAttribute("m:classifier");
String packaging;
if (classifierAttribute != null && classifierAttribute.equals("plugin")) {
packaging = "xml";
} else {
packaging = "zip";
}
-
+
DependencyArtifactDescriptor artifact = new DefaultDependencyArtifactDescriptor(descriptor, name, packaging, packaging, null, null);
descriptor.addDependencyArtifact(scope, artifact);
-
+
registerDependencyCommon(scope, descriptor);
-
+
pluginDependencyNames.add(name);
pluginDependencyDescriptors.add(descriptor);
pluginNameToDescriptorMap.put(name, descriptor);
}
-
+
/**
* Parses the Ivy DSL definition
*/
- public void parseDependencies(Closure definition) {
+ public void parseDependencies(@SuppressWarnings("rawtypes") Closure definition) {
if (definition != null && applicationName != null && applicationVersion != null) {
if (moduleDescriptor == null) {
setModuleDescriptor((DefaultModuleDescriptor)createModuleDescriptor());
}
doParseDependencies(definition, null);
-
+
// The dependency config can use the pom(Boolean) method to declare
// that this project has a POM and it has the dependencies, which means
// we now have to inspect it for the dependencies to use.
@@ -407,12 +405,12 @@ public void parseDependencies(Closure definition) {
}
/**
- * Parses dependencies of a plugin
+ * Parses dependencies of a plugin.
*
* @param pluginName the name of the plugin
* @param definition the Ivy DSL definition
*/
- public void parseDependencies(String pluginName,Closure definition) throws IllegalStateException {
+ public void parseDependencies(String pluginName, Closure<?> definition) throws IllegalStateException {
if (definition != null) {
if (moduleDescriptor == null) {
throw new IllegalStateException("Call parseDependencies(Closure) first to parse the application dependencies");
@@ -421,56 +419,56 @@ public void parseDependencies(String pluginName,Closure definition) throws Illeg
doParseDependencies(definition, pluginName);
}
}
-
+
/**
* Evaluates the given DSL definition.
- *
+ *
* If pluginName is not null, all dependencies will record that they were defined by this plugin.
- *
+ *
* @see EnhancedDefaultDependencyDescriptor#plugin
*/
- private void doParseDependencies(Closure definition, String pluginName) {
+ private void doParseDependencies(Closure<?> definition, String pluginName) {
DependencyConfigurationContext context;
-
+
// Temporary while we move all of the Groovy super class here
IvyDependencyManager dependencyManager = (IvyDependencyManager)this;
-
- if (pluginName != null) {
+
+ if (pluginName != null) {
context = DependencyConfigurationContext.forPlugin(dependencyManager, pluginName);
} else {
context = DependencyConfigurationContext.forApplication(dependencyManager);
}
-
+
definition.setDelegate(new DependencyConfigurationConfigurer(context));
definition.setResolveStrategy(Closure.DELEGATE_FIRST);
definition.call();
}
-
+
/**
* Aspects of registering a dependency common to both plugins and jar dependencies.
*/
private void registerDependencyCommon(String scope, EnhancedDefaultDependencyDescriptor descriptor) {
registerUsedConfigurationIfNecessary(scope);
-
+
if (descriptor.getModuleConfigurations().length == 0) {
addDefaultModuleConfigurations(descriptor, scope);
}
-
+
if (!descriptor.isInherited()) {
hasApplicationDependencies = true;
}
}
-
+
private void registerUsedConfigurationIfNecessary(String configurationName) {
if (!usedConfigurations.contains(configurationName)) {
usedConfigurations.add(configurationName);
}
}
-
+
private void addDefaultModuleConfigurations(EnhancedDefaultDependencyDescriptor descriptor, String configurationName) {
List<String> mappings = configurationMappings.get(configurationName);
if (mappings != null) {
- for(String m : mappings) {
+ for (String m : mappings) {
descriptor.addDependencyConfiguration(configurationName, m);
}
}
@@ -539,14 +537,14 @@ public boolean isExcludedFromPlugin(DependencyDescriptor currentPlugin, Artifact
}
return excludes;
}
-
+
public DependencyDescriptor[] readDependenciesFromPOM() {
DependencyDescriptor[] fixedDependencies = null;
File pom = new File(buildSettings.getBaseDir().getPath(), "pom.xml");
if (pom.exists()) {
PomModuleDescriptorParser parser = PomModuleDescriptorParser.getInstance();
try {
- ModuleDescriptor md = parser.parseDescriptor(ivySettings, pom.toURL(), false);
+ ModuleDescriptor md = parser.parseDescriptor(ivySettings, pom.toURI().toURL(), false);
fixedDependencies = md.getDependencies();
} catch (MalformedURLException e) {
// Ignore (effectively returns null)
@@ -568,14 +566,11 @@ private void registerPomDependencies() {
}
}
}
-
+
private void registerPomDependency(DependencyDescriptor dependencyDescriptor) {
ModuleRevisionId moduleRevisionId = dependencyDescriptor.getDependencyRevisionId();
ModuleId moduleId = moduleRevisionId.getModuleId();
- String groupId = moduleRevisionId.getOrganisation();
- String artifactId = moduleRevisionId.getName();
- String version = moduleRevisionId.getRevision();
String scope = Arrays.asList(dependencyDescriptor.getModuleConfigurations()).get(0);
if (!hasDependency(moduleId)) {
@@ -584,16 +579,16 @@ private void registerPomDependency(DependencyDescriptor dependencyDescriptor) {
ModuleId excludedModule = excludeRule.getId().getModuleId();
enhancedDependencyDescriptor.addRuleForModuleId(excludedModule, scope);
}
-
+
registerDependency(scope, enhancedDependencyDescriptor);
}
}
-
+
private void addMetadataPluginDependencies(Map<String, String> plugins) {
for (Map.Entry<String, String> plugin : plugins.entrySet()) {
String name = plugin.getKey();
String version = plugin.getValue();
-
+
if (!pluginDependencyNames.contains(name)) {
String scope = "runtime";
metadataRegisteredPluginNames.add(name);
@@ -604,8 +599,6 @@ private void addMetadataPluginDependencies(Map<String, String> plugins) {
registerPluginDependency(scope, enhancedDescriptor);
}
-
}
}
-
}
View
2 ...main/groovy/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
@@ -137,5 +137,5 @@ class EnhancedDefaultDependencyDescriptor extends DefaultDependencyDescriptor {
configurer.delegate = this
configurer.call()
this