Browse files

Merge remote-tracking branch 'upstream/master'

  • Loading branch information...
2 parents 682b97a + d8a8b5a commit ce7811c275fcd76a09ab7c69ce54b82d91bc0182 @sarmbruster sarmbruster committed Dec 14, 2011
Showing with 7,157 additions and 2,709 deletions.
  1. +73 −45 build.gradle
  2. +5 −5 build.properties
  3. +61 −0 buildSrc/src/main/groovy/org/grails/gradle/GrailsBuildPlugin.groovy
  4. +13 −13 dependencies.txt
  5. +78 −37 gradle/assemble.gradle
  6. +1 −1 gradle/unit-test.gradle
  7. BIN gradle/wrapper/gradle-wrapper.jar
  8. +2 −2 gradle/wrapper/gradle-wrapper.properties
  9. +52 −55 gradlew
  10. +30 −22 gradlew.bat
  11. +5 −7 grails-bootstrap/build.gradle
  12. +45 −0 ...ls-bootstrap/src/main/groovy/grails/build/interactive/completors/EscapingFileNameCompletor.groovy
  13. +6 −5 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/Open.groovy
  14. +41 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/RegexCompletor.groovy
  15. +42 −0 ...ls-bootstrap/src/main/groovy/grails/build/interactive/completors/SimpleOrFileNameCompletor.groovy
  16. +28 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/TestApp.groovy
  17. +6 −6 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
  18. +5 −1 grails-bootstrap/src/main/groovy/grails/util/AbstractBuildSettings.java
  19. +31 −1 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
  20. +47 −14 grails-bootstrap/src/main/groovy/grails/util/Environment.java
  21. +79 −0 grails-bootstrap/src/main/groovy/grails/util/Holder.java
  22. +77 −56 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
  23. +18 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  24. +1 −1 ...ap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/CandidateListCompletionHandler.java
  25. +7 −3 ...trap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/GrailsInteractiveCompletor.groovy
  26. +67 −9 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
  27. +5 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLine.java
  28. +28 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParser.java
  29. +18 −7 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/DefaultCommandLine.java
  30. +3 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/JndiBindingSupport.java
  31. +27 −8 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/MetaClassRegistryCleaner.java
  32. +9 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
  33. +27 −30 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/GrailsResourceUtils.java
  34. +13 −13 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
  35. +8 −2 ...rap/src/main/groovy/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
  36. +75 −17 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsCoreDependencies.java
  37. +11 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManager.groovy
  38. +88 −62 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
  39. +126 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngine.groovy
  40. +17 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/ResolveException.groovy
  41. +24 −13 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/SnapshotAwareM2Resolver.java
  42. +4 −1 ...bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/RepositoriesConfigurer.groovy
  43. +40 −0 grails-bootstrap/src/test/groovy/grails/build/interactive/completors/RegexCompletorSpec.groovy
  44. +43 −0 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParserSpec.groovy
  45. +54 −0 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngineSpec.groovy
  46. +48 −11 grails-core/build.gradle
  47. +3 −1 grails-core/src/main/groovy/grails/artefact/Enhanced.java
  48. +11 −11 grails-core/src/main/groovy/grails/util/GrailsUtil.java
  49. +189 −0 grails-core/src/main/groovy/grails/util/Holders.java
  50. +1 −3 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
  51. +3 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ApplicationHolder.java
  52. +14 −14 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ClassPropertyFetcher.java
  53. +5 −15 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ConfigurationHolder.java
  54. +14 −29 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
  55. +4 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DomainClassArtefactHandler.java
  56. +21 −6 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsClassUtils.java
  57. +5 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsControllerClass.java
  58. +1 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java
  59. +1 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainConfigurationUtil.java
  60. +5 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsMetaClassUtils.java
  61. +15 −13 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsResourceLoaderFactoryBean.java
  62. +25 −14 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/ConfigurationHelper.groovy
  63. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/GrailsConfig.java
  64. +7 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/BaseApiProvider.java
  65. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/StaticMethodInvocation.java
  66. +11 −11 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsRuntimeConfigurator.java
  67. +227 −194 .../main/groovy/org/codehaus/groovy/grails/commons/spring/ReloadAwareAutowireCapableBeanFactory.java
  68. +10 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/DirectoryWatcher.java
  69. +22 −10 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectCompiler.groovy
  70. +18 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java
  71. +4 −1 .../main/groovy/org/codehaus/groovy/grails/compiler/injection/AbstractGrailsArtefactTransformer.java
  72. +106 −28 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
  73. +1 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTraceFilterer.java
  74. +3 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/lifecycle/ShutdownOperations.java
  75. +2 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/orm/support/TransactionManagerAware.java
  76. +21 −16 ...-core/src/main/groovy/org/codehaus/groovy/grails/orm/support/TransactionManagerPostProcessor.java
  77. +8 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/AbstractGrailsPluginManager.java
  78. +5 −10 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPluginManager.java
  79. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginManagerFactoryBean.java
  80. +3 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginManagerAware.java
  81. +1 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginManagerHolder.java
  82. +58 −3 ...re/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGenerator.groovy
  83. +6 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginPackager.groovy
  84. +3 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/aware/ClassLoaderAware.java
  85. +2 −1 ...core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/aware/GrailsApplicationAware.java
  86. +3 −1 ...re/src/main/groovy/org/codehaus/groovy/grails/plugins/support/aware/GrailsConfigurationAware.java
  87. +2 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/ParentApplicationContextAware.java
  88. +28 −0 ...re/src/main/groovy/org/codehaus/groovy/grails/support/internal/tools/MetaClassChangeReporter.java
  89. +9 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/AbstractConstraint.java
  90. +110 −35 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstrainedProperty.java
  91. +38 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstrainedPropertyBuilder.java
  92. +7 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/Constraint.java
  93. +2 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/DefaultConstraintEvaluator.java
  94. +3 −11 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
  95. +21 −19 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/RangeConstraint.java
  96. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ScaleConstraint.java
  97. +23 −13 ...rc/test/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsArtefactTransformerSpec.groovy
  98. +62 −0 ...rc/test/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGeneratorSpec.groovy
  99. +0 −28 ...est/groovy/org/codehaus/groovy/grails/plugins/publishing/PublishingDescriptorGeneratorSpec.groovy
  100. +5 −3 ...ls-crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/view/ScaffoldedGroovyPageView.java
  101. +30 −6 grails-docs/build.gradle
  102. +41 −0 grails-docs/src/main/groovy/grails/doc/gradle/MigrateLegacyDocs.groovy
  103. +97 −0 grails-docs/src/main/groovy/grails/doc/gradle/PublishGuide.groovy
  104. +46 −0 grails-docs/src/main/groovy/grails/doc/gradle/PublishPdf.groovy
  105. +12 −0 grails-docs/src/main/groovy/grails/doc/macros/HiddenMacro.groovy
  106. +4 −5 grails-docs/src/main/template/css/main.css
  107. +4 −4 grails-docs/src/test/groovy/grails/doc/internal/LegacyTocStrategySpec.groovy
  108. +2 −2 grails-docs/src/test/groovy/grails/doc/internal/YamlTocStrategySpec.groovy
  109. +27 −9 grails-hibernate/build.gradle
  110. +156 −107 grails-hibernate/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java
  111. +39 −7 grails-hibernate/src/main/groovy/grails/orm/PagedResultList.java
  112. +3 −19 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.java
  113. +25 −15 ...src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
  114. +39 −35 ...ibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/EventTriggeringInterceptor.java
  115. +17 −6 ...ibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/GrailsHibernateDomainClass.java
  116. +64 −0 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/GrailsHibernateTemplate.java
  117. +55 −46 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateGormEnhancer.groovy
  118. +50 −39 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateSession.java
  119. +7 −4 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/SessionFactoryProxy.java
  120. +2 −1 ...e/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsAnnotationConfiguration.java
  121. +18 −10 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java
  122. +37 −13 ...s-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsHibernateUtil.java
  123. +10 −0 .../src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/HibernateNamedQueriesBuilder.groovy
  124. +27 −20 ...ovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractClausedStaticPersistentMethod.java
  125. +2 −2 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractDynamicPersistentMethod.java
  126. +29 −11 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractFindByPersistentMethod.java
  127. +13 −5 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractSavePersistentMethod.java
  128. +38 −12 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractStaticPersistentMethod.java
  129. +88 −0 ...e/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/CountByPersistentMethod.java
  130. +13 −16 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ExecuteQueryPersistentMethod.java
  131. +12 −11 ...main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ExecuteUpdatePersistentMethod.java
  132. +49 −0 .../org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllByBooleanPropertyPersistentMethod.java
  133. +39 −11 ...src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllByPersistentMethod.java
  134. +10 −0 ...e/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllPersistentMethod.java
  135. +49 −0 ...ovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindByBooleanPropertyPersistentMethod.java
  136. +5 −4 ...te/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindByPersistentMethod.java
  137. +11 −10 ...ain/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindOrCreateByPersistentMethod.java
  138. +3 −2 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindOrSaveByPersistentMethod.java
  139. +9 −0 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindPersistentMethod.java
  140. +96 −0 ...c/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ListOrderByPersistentMethod.java
  141. +15 −17 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ListPersistentMethod.java
  142. +11 −4 .../src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ValidatePersistentMethod.java
  143. +30 −40 ...ate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateCriterionAdapter.java
  144. +2 −2 ...te/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateProjectionAdapter.java
  145. +112 −111 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateQuery.java
  146. +3 −1 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventListener.java
  147. +3 −5 ...in/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventTriggeringInterceptor.java
  148. +2 −2 ...rc/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/FlushOnRedirectEventListener.java
  149. +14 −3 ...n/groovy/org/codehaus/groovy/grails/orm/hibernate/support/GrailsOpenSessionInViewInterceptor.java
  150. +49 −8 ...main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/AbstractPersistentConstraint.java
  151. +0 −2 ...ate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/PersistentConstraint.java
  152. +0 −8 .../main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/PersistentConstraintFactory.java
  153. +17 −11 ...bernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/UniqueConstraint.java
  154. +61 −19 ...te/src/main/groovy/org/codehaus/groovy/grails/plugins/orm/hibernate/HibernatePluginSupport.groovy
  155. +24 −2 grails-hibernate/src/test/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformerSpec.groovy
  156. +1 −1 grails-logging/build.gradle
  157. +1 −1 ...ugin-async/src/main/groovy/org/codehaus/groovy/grails/plugins/web/async/GrailsAsyncContext.groovy
  158. +1 −0 grails-plugin-codecs/src/test/groovy/org/codehaus/groovy/grails/web/codecs/HTMLCodecTests.groovy
  159. +3 −1 grails-plugin-controllers/build.gradle
  160. +22 −34 ...trollers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformer.java
  161. +12 −0 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformer.java
  162. +25 −38 ...controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy
  163. +0 −4 ...-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy
  164. +12 −3 ...gin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RenderDynamicMethod.java
  165. +16 −1 ...in-controllers/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/WebMetaUtils.groovy
  166. +115 −60 ...roovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerCommandObjectSpec.groovy
  167. +6 −2 grails-plugin-datasource/build.gradle
  168. +2 −2 ...ource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceGrailsPlugin.groovy
  169. +1 −0 grails-plugin-domain-class/build.gradle
  170. +13 −2 ...main-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassMappingContext.java
  171. +3 −1 ...in-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassPersistentEntity.java
  172. +6 −1 ...in-domain-class/src/main/groovy/org/codehaus/groovy/grails/plugins/DomainClassGrailsPlugin.groovy
  173. +27 −15 grails-plugin-gsp/build.gradle
  174. +23 −18 ...ugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/TagLibraryTransformer.java
  175. +24 −10 ...plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllerTagLibraryApi.java
  176. +34 −10 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/TagLibraryApi.java
  177. +64 −143 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  178. +46 −39 ...plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ApplicationTagLib.groovy
  179. +11 −6 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  180. +31 −13 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/JavascriptTagLib.groovy
  181. +6 −6 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/RenderTagLib.groovy
  182. +5 −1 ...ls-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/SitemeshTagLib.groovy
  183. +2 −2 ...-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ValidationTagLib.groovy
  184. +3 −1 grails-plugin-log4j/build.gradle
  185. +24 −26 grails-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/Log4jConfig.groovy
  186. +1 −1 ...-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/LoggingGrailsPlugin.groovy
  187. +2 −0 ...g4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/appenders/GrailsConsoleAppender.java
  188. +0 −4 ...-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/web/util/Log4jConfigListener.java
  189. +1 −1 ...s-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/logging/LoggingInitializer.java
  190. +6 −4 ...ing/src/main/groovy/org/codehaus/groovy/grails/plugins/scaffolding/ScaffoldingGrailsPlugin.groovy
  191. +1 −0 grails-plugin-testing/src/main/groovy/grails/test/GrailsUnitTestCase.groovy
  192. +3 −2 grails-plugin-testing/src/main/groovy/grails/test/MockUtils.groovy
  193. +13 −2 grails-plugin-testing/src/main/groovy/grails/test/mixin/domain/DomainClassUnitTestMixin.groovy
  194. +10 −10 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/GrailsUnitTestMixin.groovy
  195. +14 −9 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/LazyTagLibraryLookup.java
  196. +37 −45 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/ControllerUnitTestMixin.groovy
  197. +1 −0 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/FiltersUnitTestMixin.groovy
  198. +13 −8 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/GroovyPageUnitTestMixin.groovy
  199. +41 −9 ...ing/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestForTransformation.java
  200. +4 −2 grails-plugin-testing/src/test/groovy/grails/test/mixin/FiltersUnitTestMixinTests.groovy
  201. +7 −0 grails-plugin-testing/src/test/groovy/grails/test/mixin/GroovyPageUnitTestMixinTests.groovy
  202. +42 −0 grails-plugin-testing/src/test/groovy/grails/test/mixin/MetaClassCleanupSpec.groovy
  203. +32 −0 grails-plugin-testing/src/test/groovy/grails/test/mixin/RegisterMetaClassTests.groovy
  204. +5 −1 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/InlineExplodedTomcatServer.groovy
  205. +3 −1 grails-plugin-url-mappings/build.gradle
  206. +6 −3 ...ngs/src/main/groovy/org/codehaus/groovy/grails/plugins/web/mapping/UrlMappingsGrailsPlugin.groovy
  207. +16 −1 ...l-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/DefaultUrlMappingEvaluator.java
  208. +12 −13 ...mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/UrlMappingsHolderFactoryBean.java
  209. +29 −14 ...url-mappings/src/main/groovy/org/codehaus/groovy/grails/web/mapping/filter/UrlMappingsFilter.java
  210. +12 −18 ...gs/src/test/groovy/org/codehaus/groovy/grails/web/mapping/LinkGeneratorWithUrlMappingsSpec.groovy
  211. +42 −0 ...url-mappings/src/test/groovy/org/codehaus/groovy/grails/web/mapping/UrlMappingsBindingSpec.groovy
  212. +62 −6 grails-plugin-validation/src/main/groovy/grails/validation/DefaultASTValidateableHelper.java
  213. +10 −3 ...lugin-validation/src/main/groovy/org/codehaus/groovy/grails/plugins/ValidationGrailsPlugin.groovy
  214. +15 −12 ...alidation/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/ValidationSupport.groovy
  215. +32 −2 grails-plugin-validation/src/test/groovy/grails/validation/DefaultASTValidateableHelperSpec.groovy
  216. +5 −0 grails-resources/src/grails/grails-app/conf/ApplicationResources.groovy
  217. +6 −4 grails-resources/src/grails/grails-app/conf/BuildConfig.groovy
  218. +4 −1 grails-resources/src/grails/grails-app/conf/Config.groovy
  219. +12 −12 grails-resources/src/grails/grails-app/conf/DataSource.groovy
  220. +23 −3 grails-resources/src/grails/grails-app/i18n/messages_th.properties
  221. +1 −0 grails-resources/src/grails/grails-app/views/index.gsp
  222. +2 −0 grails-resources/src/grails/grails-app/views/layouts/main.gsp
  223. +285 −136 grails-resources/src/grails/home/dsl-support/dsld/grails.dsld
  224. +0 −1 grails-resources/src/grails/plugin/grails-app/conf/BuildConfig.groovy
  225. +2 −2 grails-resources/src/grails/templates/artifacts/Filters.groovy
  226. +8 −1 grails-resources/src/grails/templates/ide-support/git/grailsProject.gitignore
  227. +21 −23 grails-resources/src/grails/templates/scaffolding/Controller.groovy
  228. +0 −17 grails-resources/src/grails/templates/scaffolding/Test.groovy
  229. +1 −1 grails-resources/src/war/css/main.css
  230. +18 −1 grails-scripts/build.gradle
  231. +25 −11 ...st-suite-base/src/main/groovy/org/codehaus/groovy/grails/web/taglib/AbstractGrailsTagTests.groovy
  232. +6 −2 grails-test-suite-persistence/build.gradle
  233. +11 −0 ...rc/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AdvancedEnumCollectionMappingTests.groovy
  234. +6 −3 ...ite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/AttachMethodTests.groovy
  235. +15 −11 ...rsistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/ConstraintPropertyTests.groovy
  236. +24 −2 ...e-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/CreateCriteriaTests.groovy
  237. +3 −3 .../org/codehaus/groovy/grails/orm/hibernate/{DeepHeirarchyTests.groovy → DeepHierarchyTests.groovy}
  238. +20 −0 ...ersistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/DerivedPropertiesTests.groovy
  239. +57 −5 ...test-suite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/DirtyTests.groovy
  240. +2 −2 ...-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/DynamicFinderOrTests.groovy
  241. +47 −0 .../src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/EmbeddedNonDomainClassEntitySpec.groovy
  242. +25 −3 ...ite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/FindByInListTests.groovy
  243. +6 −9 ...ite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/FindByMethodTests.groovy
  244. +6 −6 ...rc/test/groovy/org/codehaus/groovy/grails/orm/hibernate/FindOrSaveByPersistenceMethodTests.groovy
  245. +129 −2 ...nce/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateCriteriaBuilderTests.groovy
  246. +14 −3 ...suite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/ListMethodTests.groovy
  247. +48 −0 ...rsistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/MultipleDataSourceTests.groovy
  248. +30 −1 ...te-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/NamedCriteriaTests.groovy
  249. +1 −1 ...ersistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/PersistenceMethodTests.groovy
  250. +59 −0 ...rsistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/TotalCountWithOrderSpec.groovy
  251. +44 −0 ...istence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/UniqueConstraintStateSpec.groovy
  252. +8 −8 ...ersistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/ValidationFailureTests.groovy
  253. +131 −0 ...suite-persistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/WhereMethodSpec.groovy
  254. +3 −2 ...ersistence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/WithSessionMethodTests.groovy
  255. +29 −0 ...st/groovy/org/codehaus/groovy/grails/orm/hibernate/binding/DataBindingWithInverseListTests.groovy
  256. +24 −0 ...tence/src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinderTests.groovy
  257. +1 −1 .../src/test/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/UniqueConstraintTests.groovy
  258. +1 −0 ...rc/test/groovy/org/codehaus/groovy/grails/plugins/scaffolding/ScaffoldingGrailsPluginTests.groovy
  259. +10 −11 ...istence/src/test/groovy/org/codehaus/groovy/grails/scaffolding/GrailsTemplateGeneratorsTests.java
  260. +1 −1 .../src/test/groovy/org/codehaus/groovy/grails/scaffolding/view/ScaffoldedGroovyPageViewTests.groovy
  261. +2 −2 grails-test-suite-uber/build.gradle
  262. +23 −0 grails-test-suite-uber/src/test/groovy/grails/persistence/EntityTransformTests.groovy
  263. +4 −1 grails-test-suite-uber/src/test/groovy/grails/test/MockUtilsTests.groovy
  264. +36 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/AutowireServiceViaDefineBeansTests.groovy
  265. +46 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/ControllerAndMockForTests.groovy
  266. +24 −0 ...est-suite-uber/src/test/groovy/grails/test/mixin/ControllerMockWithMultipleControllersSpec.groovy
  267. +17 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/ControllerUnitTestMixinTests.groovy
  268. +0 −1 ...-test-suite-uber/src/test/groovy/grails/test/mixin/DomainClassControllerUnitTestMixinTests.groovy
  269. +36 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/DomainClassWithCustomValidatorTests.groovy
  270. +32 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/DomainClassWithUniqueConstraintSpec.groovy
  271. +37 −0 ...-test-suite-uber/src/test/groovy/grails/test/mixin/TestForControllerWithoutMockDomainTests.groovy
  272. +1 −0 grails-test-suite-uber/src/test/groovy/grails/test/mixin/UrlMappingsTestMixinTests.groovy
  273. +1 −1 grails-test-suite-uber/src/test/groovy/grails/util/GrailsUtilTests.java
  274. +39 −2 ...e-uber/src/test/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass2Tests.java
  275. +1 −0 ...-uber/src/test/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClassTests.groovy
  276. +15 −0 grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/GrailsClassUtilsTests.java
  277. +3 −3 ...-suite-uber/src/test/groovy/org/codehaus/groovy/grails/commons/metaclass/DynamicMethodsTests.java
  278. +30 −3 .../src/test/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceGrailsPluginTests.groovy
  279. +5 −5 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManagerTests.groovy
  280. +26 −26 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/ConstrainedPropertyTests.java
  281. +1 −1 ...test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/MatchesConstraintTests.java
  282. +11 −21 grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/MaxConstraintTests.java
  283. +9 −9 ...test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/MaxSizeConstraintTests.java
  284. +11 −21 grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/MinConstraintTests.java
  285. +9 −9 ...test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/MinSizeConstraintTests.java
  286. +6 −14 ...est-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/NotEqualConstraintTests.java
  287. +4 −6 ...s-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/RangeConstraintTests.java
  288. +2 −2 ...s-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/ScaleConstraintTests.java
  289. +2 −2 ...ls-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/SizeConstraintTests.java
  290. +109 −0 ...est-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/TestingValidationSpec.groovy
  291. +1 −1 grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/UrlConstraintTests.java
  292. +1 −1 ...st-suite-uber/src/test/groovy/org/codehaus/groovy/grails/validation/ValidatorConstraintTests.java
  293. +7 −1 ...ite-uber/src/test/groovy/org/codehaus/groovy/grails/web/servlet/GrailsDispatcherServletTests.java
  294. +1 −0 .../src/test/groovy/org/codehaus/groovy/grails/web/servlet/mvc/ControllersDynamicMethodsTests.groovy
  295. +5 −0 ...-uber/src/test/groovy/org/codehaus/groovy/grails/web/servlet/mvc/SimpleGrailsControllerTests.java
  296. +1 −1 ...test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/web/sitemesh/FactoryHolderTests.groovy
  297. +14 −7 ...ber/src/test/groovy/org/codehaus/groovy/grails/web/sitemesh/GrailsLayoutDecoratorMapperTests.java
  298. +62 −0 grails-test-suite-uber/src/test/groovy/org/codehaus/groovy/grails/web/util/CodecPrintWriterTest.java
  299. +1 −1 grails-test-suite-web/src/test/groovy/grails/gsp/PageRendererSpec.groovy
  300. +73 −0 grails-test-suite-web/src/test/groovy/grails/test/AbstractGrailsEnvChangingSpec.groovy
Sorry, we could not display the entire diff because too many files (426) changed.
View
118 build.gradle
@@ -2,43 +2,44 @@ import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
- mavenRepo(urls: "http://repo.grails.org/grails/core")
+ maven { url "http://repo.grails.org/grails/core" }
//mavenRepo(urls: 'http://evgeny-goldin.org/artifactory/repo/')
}
dependencies {
- classpath "commons-io:commons-io:2.0.1"
+ classpath "commons-io:commons-io:2.1"
//classpath "com.goldin.plugins:gradle:0.1-RC3" // http://evgeny-goldin.com/wiki/Gradle-duplicates-plugin
}
}
apply plugin: 'idea'
-grailsVersion = '2.0.0.BUILD-SNAPSHOT'
+grailsVersion = '2.1.0.BUILD-SNAPSHOT'
antTraxVersion = "1.7.1"
antVersion = "1.8.2"
aspectjVersion = "1.6.10"
commonsBeanUtilsVersion = "1.8.3"
commonsCliVersion = "1.2"
commonsCollectionsVersion = "3.2.1"
-commonsIOVersion = "2.0.1"
+commonsIOVersion = "2.1"
commonsLangVersion = "2.6"
datastoreVersion = "1.0.0.BUILD-SNAPSHOT"
gantVersion = "1.9.6"
gdocEngineVersion = "1.0.1"
-groovyVersion = "1.8.3-SNAPSHOT"
+groovyVersion = "1.8.4"
gradleGroovyVersion = groovyVersion
gradleGroovyVersion = "1.8.2"
ivyVersion = "2.2.0"
jansiVersion = "1.2.1"
jlineVersion = "1.0"
jnaVersion = "3.2.3"
slf4jVersion = "1.6.2"
-springLoadedVersion = "0.9.2.BUILD-SNAPSHOT"
-springVersion = "3.1.0.M2"
+springLoadedVersion = "1.0.2"
+springVersion = "3.1.0.RELEASE"
springWebflowVersion= "2.0.8.RELEASE"
-hibernateVersion = "3.6.5.Final"
-ehcacheVersion = "2.4.5"
-junitVersion = "4.9"
+hibernateVersion = "3.6.8.Final"
+ehcacheVersion = "2.4.6"
+junitVersion = "4.10"
+concurrentlinkedhashmapVersion = "1.2_jdk5"
archivesBaseName = 'grails'
version = grailsVersion
@@ -58,12 +59,43 @@ homeSrcDir = file("src")
// artifacts' POMs.
if(System.getProperty('groovy.jar')) {
groovyDependency = files(System.getProperty('groovy.jar'))
- gradleGroovyDependency = groovyDependency
+ gradleGroovyDependency = "org.codehaus.groovy:groovy-all:${gradleGroovyVersion}"
} else {
groovyDependency = "org.codehaus.groovy:groovy-all:${groovyVersion}"
gradleGroovyDependency = "org.codehaus.groovy:groovy-all:${gradleGroovyVersion}"
}
+// Prevent multiple repositories being used, commented out as currently doesn't work.
+/*gradle.taskGraph.whenReady { taskGraph ->
+ if (taskGraph.hasTask(populateDependencies)) {
+ def projectsWithMultipleRepos = allprojects.findAll { repositories.size() > 1 }
+ println "projectsWithMultipleRepos: $projectsWithMultipleRepos"
+ if (projectsWithMultipleRepos) {
+ throw new GradleException(
+ "There are projects with more than one repository defined. \n" +
+ "This isn't allowed as it breaks the populateDependencies task. You can only use the grails central repo. \n" +
+ "This is a temporary workaround for the Gradle issue: http://issues.gradle.org/browse/GRADLE-1989"
+ )
+ }
+ }
+}
+*/
+
+allprojects {
+ repositories {
+ maven { url "http://repo.grails.org/grails/core" }
+ }
+
+ configurations {
+ all {
+ resolutionStrategy {
+ def cacheHours = isCiBuild ? 1 : 24
+ cacheDynamicVersionsFor cacheHours, 'hours'
+ cacheChangingModulesFor cacheHours, 'hours'
+ }
+ }
+ }
+}
subprojects { project ->
apply plugin: 'groovy'
@@ -79,6 +111,8 @@ subprojects { project ->
version = grailsVersion
group = "org.grails"
+ isCiBuild = project.hasProperty("isCiBuild")
+
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
"Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
@@ -97,22 +131,11 @@ subprojects { project ->
options.debug = true
}
- ideaModule {
- // pathVariables GRADLE_USER_HOME: file('/home/myuser/.gradle') // that does not work
- whenConfigured { module ->
- // adding slf4j-simple with scope TEST to .iml
- module.dependencies << new org.gradle.plugins.ide.idea.model.ModuleLibrary(
- [new org.gradle.plugins.ide.idea.model.Path("jar://\$GRADLE_USER_HOME/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-${slf4jVersion}.jar!/")], [], [], [], "TEST"
- )
- }
- }
-
- repositories {
- mavenRepo(urls: "http://repo.grails.org/grails/core") {
- if (project.hasProperty('snapshotTimeout')) {
- setSnapshotTimeout(Long.parseLong(project.snapshotTimeout))
- }
- }
+ idea.module.iml.whenMerged { module ->
+ // adding slf4j-simple with scope TEST to .iml
+ module.dependencies << new org.gradle.plugins.ide.idea.model.ModuleLibrary(
+ [new org.gradle.plugins.ide.idea.model.Path("jar://\$GRADLE_USER_HOME/cache/org.slf4j/slf4j-simple/jars/slf4j-simple-${slf4jVersion}.jar!/")], [], [], [], "TEST"
+ )
}
dependencies {
@@ -129,27 +152,29 @@ subprojects { project ->
}
compile groovyDependency
- // Logging
- compile "org.slf4j:slf4j-api:$slf4jVersion"
- compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
+ if (project.name != "grails-docs") {
+ // Logging
+ compile "org.slf4j:slf4j-api:$slf4jVersion"
+ compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
- // Specs
- compile 'javax.servlet:servlet-api:2.5'
- compile 'org.hibernate.java-persistence:jpa-api:2.0-cr-1'
+ // Specs
+ compile 'javax.servlet:servlet-api:2.5'
+ compile 'org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final'
- // Testing
- testCompile "junit:junit:${junitVersion}"
- testCompile('org.spockframework:spock-core:0.6-groovy-1.8-SNAPSHOT') {
- transitive = false
+ // Testing
+ testCompile "junit:junit:${junitVersion}"
+ testCompile('org.spockframework:spock-core:0.6-groovy-1.8-SNAPSHOT') {
+ transitive = false
+ }
}
}
test {
excludes = ["**/*TestCase.class", "**/*\$*.class"]
}
- task sourcesJar(type: Jar, dependsOn:classes) {
+ task sourcesJar(type: Jar) {
classifier = 'sources'
appendix = project.name[7..-1]
from sourceSets.main.allSource
@@ -168,7 +193,7 @@ subprojects { project ->
configurations {
meta
published.extendsFrom archives, meta
- all*.exclude group:'commons-logging', module: 'commons-logging'
+ all*.exclude group:'commons-logging', module: 'commons-logging'
}
artifacts {
@@ -181,13 +206,10 @@ subprojects { project ->
final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
"http://repo.grails.org/grails/libs-releases-local"
-
- mavenRepo urls: url
-
project.deployer = repositories.mavenDeployer {
repository(url: url) {
- final username = project.properties["artifactoryPublishUsername"]
- final password = project.properties["artifactoryPublishPassword"]
+ final username = project.hasProperty("artifactoryPublishUsername") ? project.artifactoryPublishUsername : null
+ final password = project.hasProperty("artifactoryPublishPassword") ? project.artifactoryPublishPassword : null
if(username && password) {
org.apache.ivy.util.url.CredentialsStore.INSTANCE.addCredentials("Artifactory Realm", "repo.grails.org", username, password);
@@ -229,11 +251,17 @@ task clean(type: Delete) {
homeSrcDir
}
+task allDependencies(dependsOn: { subprojects*.implicitTasks*.dependencies })
+
// From this point on we need the subprojects to be fully configured, so force their full evaluation
subprojects.each { evaluationDependsOn it.path }
apply {
from 'gradle/docs.gradle' // tasks for building the documentation (e.g. user guide, javadocs)
from 'gradle/assemble.gradle' // tasks for creating an installation or distribution
from 'gradle/findbugs.gradle'
-}
+}
+
+task wrapper(type: Wrapper) {
+ distributionUrl "http://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-7-20111214110828+0100-bin.zip"
+}
View
10 build.properties
@@ -1,20 +1,20 @@
-grails.version=2.0.0.BUILD-SNAPSHOT
+grails.version=2.1.0.BUILD-SNAPSHOT
# Bundlor dependency versions
bundlor.javax.persistence.version=1.0.2.GA
bundlor.webflow.version=2.0.8
bundlor.xpp.version=1.1.3
bundlor.log4j.version=1.2.16
bundlor.sitemesh.version=2.4.0
-bundlor.hibernate.version=3.3.1.GA
+bundlor.hibernate.version=3.6.8.GA
bundlor.javassist.version=3.9.0
-bundlor.svnkit.version=1.3.1
+bundlor.svnkit.version=1.3.5
bundlor.servlet.version=2.5.0
bundlor.jndi.version=1.2.0
bundlor.servlet.jsp.version=2.1.0
bundlor.radeox.version=1.0.0.b2
-bundlor.groovy.version=1.8.0.rc-1
-bundlor.spring.version=3.0.5.RELEASE
+bundlor.groovy.version=1.8.4
+bundlor.spring.version=3.1.0.RELEASE
bundlor.ant.version=1.8.2
bundlor.ivy.version=2.0.0
bundlor.gant.version=1.9.5
View
61 buildSrc/src/main/groovy/org/grails/gradle/GrailsBuildPlugin.groovy
@@ -0,0 +1,61 @@
+package org.grails.gradle
+
+import org.gradle.api.Plugin
+import org.gradle.api.Project
+import org.gradle.api.internal.artifacts.dependencies.DefaultExternalModuleDependency
+import org.gradle.api.artifacts.ResolvedDependency
+import org.gradle.api.artifacts.Dependency
+import org.gradle.api.artifacts.Configuration
+import org.gradle.api.artifacts.ExternalDependency
+import org.gradle.api.DefaultTask
+import org.gradle.api.specs.Spec
+import org.gradle.api.specs.Specs
+
+class GrailsBuildPlugin implements Plugin<Project> {
+
+ void apply(Project project) {
+
+ // Add utility for getting sources, returns a configuration containing the source jar versions
+ // of the dependencies in the given configuration(s)
+ project.sourcesFor = { configurations ->
+
+ // We can't use varargs for the closure signature due to an issue in the mixin mechanism in this
+ // version of Gradle.
+ if (configurations instanceof Configuration) {
+ configurations = [configurations]
+ }
+
+ def addChildren
+ addChildren = { Collection deps, Set allDeps = new LinkedHashSet() ->
+ deps.each { ResolvedDependency resolvedDependency ->
+ def notSeenBefore = allDeps.add(resolvedDependency)
+ if (notSeenBefore) { // defend against circular dependencies
+ addChildren(resolvedDependency.children, allDeps)
+ }
+ }
+ allDeps
+ }
+
+ def dependencies = new LinkedHashSet()
+ for (configuration in configurations) {
+ addChildren(configuration.resolvedConfiguration.getFirstLevelModuleDependencies({ it instanceof ExternalDependency } as Spec), dependencies)
+ }
+
+ def sourceDependencies = dependencies.collect { ResolvedDependency resolvedDependency ->
+ def dependency = new DefaultExternalModuleDependency(resolvedDependency.moduleGroup, resolvedDependency.moduleName, resolvedDependency.moduleVersion,
+ resolvedDependency.configuration)
+ dependency.transitive = false
+ dependency.artifact { artifact ->
+ artifact.name = dependency.name
+ artifact.type = 'source'
+ artifact.extension = 'jar'
+ artifact.classifier = 'sources'
+ }
+ dependency
+ }
+
+ project.configurations.detachedConfiguration(sourceDependencies as Dependency[])
+ }
+ }
+
+}
View
26 dependencies.txt
@@ -5,8 +5,8 @@ The following libraries are included in Grails because they are required either
- used to build the framework and for the command line tools (Gant)
- required for running Grails applications when using AntBuilder
-* antlr-2.7.6.jar
-- ANTLR 2.7.6 (http://www.antlr.org) BSD License
+* antlr-2.7.7.jar
+- ANTLR 2.7.7 (http://www.antlr.org) BSD License
- required for running Grails applications (Hibernate)
* aspectjrt-1.6.8.jar, aspectjweaver-1.6.8.jar
@@ -88,18 +88,18 @@ The following libraries are included in Grails because they are required either
- Gant 1.9.5 (http://gant.codehaus.org) Apache 2.0 License
- required for the command line tools (Gant)
-* groovy-all-1.8.0.jar
-- Groovy 1.8.0 (http://groovy.codehaus.org) Apache 2.0 License
+* groovy-all-1.8.4.jar
+- Groovy 1.8.4 (http://groovy.codehaus.org) Apache 2.0 License
- required for the command line tools (Gant)
- required for building Grails core
- required for running Grails applications
-* hibernate-annotations.jar, hibernate-commons-annotations.jar
-- Hibernate Annotations 3.4.0 GA (http://annotations.hibernate.org) LGPL License
+* hibernate-commons-annotations-3.2.0.Final.jar
+- Hibernate Annotations 3.2.0 GA (http://annotations.hibernate.org) LGPL License
- required for running Grails applications (When using Hibernate EJB3 annotations)
-* hibernate3.jar
-- Hibernate 3.3.1 GA (http://www.hibernate.org) LGPL License
+* hibernate-core-3.6.8.Final.jar
+- Hibernate 3.6.8 GA (http://www.hibernate.org) LGPL License
- required for building Grails core
- required for running Grails applications
@@ -113,8 +113,8 @@ The following libraries are included in Grails because they are required either
- required for building Grails core
- required for running Grails applications (With an in-memory database)
-* javassist-3.8.0.GA.jar
-- Javassist 3.8 (http://www.jboss.org/javassist/) MPL or LGPL License
+* javassist-3.12.0.GA.jar
+- Javassist 3.12.0 (http://www.jboss.org/javassist/) MPL or LGPL License
- required for running Grails applications
* jline-0.9.94.jar
@@ -158,7 +158,7 @@ The following libraries are included in Grails because they are required either
- required for running Grails applications
* org.springframework.*.jar
-- Spring Framework 3.0.5 (http://www.springframework.org) Apache 2.0 License
+- Spring Framework 3.1.0.RELEASE (http://www.springframework.org) Apache 2.0 License
- required for building Grails core
- required for the command line tools (Gant)
- required for running Grails applications
@@ -168,8 +168,8 @@ The following libraries are included in Grails because they are required either
- required for building Grails core
- required for running Grails applications (When using Web flows)
-* svnkit-1.3.1.jar
-- SVNKit 1.3.1 (http://svnkit.com/) TMate Open Source License (see http://svnkit.com/license.html)
+* svnkit-1.3.5.jar
+- SVNKit 1.3.5 (http://svnkit.com/) TMate Open Source License (see http://svnkit.com/license.html)
- required for the command line tools (Gant)
* xpp3_min-1.1.3.4.O.jar
View
115 gradle/assemble.gradle
@@ -1,59 +1,100 @@
import org.apache.tools.ant.filters.ReplaceTokens
-// This is a little fragile, need to find a way to ask Gradle for this info.
-def gradleArtifactCache = new File(gradle.gradleUserHomeDir, "cache")
+apply plugin: org.grails.gradle.GrailsBuildPlugin
-// The configurations of which we collect all the dependencies of for our lib dir.
-// Notice that we exclude all project dependencies as we do NOT want jars built by this project
-// to be part of the configuration. This also avoids building those jars when running this task.
def libsConfigurations = []
-subprojects {
+subprojects { subproject ->
configurations {
- libsConfigurations << libs {
+ libsConfigurations << libs {
extendsFrom compile, runtime
["jsp21", "agent"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
- }.copyRecursive {
- !(it instanceof org.gradle.api.artifacts.ProjectDependency)
}
}
}
-task populateDependencies(type: Sync, dependsOn: libsConfigurations) {
+task checkDuplicateDependencies(description: 'Checks the dependency graph for multiple versions of the same dependency',
+ dependsOn: libsConfigurations) << {
+ def moduleToVersionsMap = [:]
+ libsConfigurations.each { configuration ->
+ configuration.resolvedConfiguration.resolvedArtifacts.each { artifact ->
+ def dependency = artifact.resolvedDependency
+
+ def key = "${dependency.moduleGroup}/${dependency.moduleName}".toString()
+ def value = dependency.moduleVersion
+
+ def versions = moduleToVersionsMap[key]
+ if(!versions) {
+ versions = [] as Set
+ moduleToVersionsMap[key] = versions
+ }
+ versions << value
+ }
+ }
+ def dups = moduleToVersionsMap.findAll { k, v ->
+ v.size() > 1
+ }
+ if(dups) {
+ def msg = 'Multiple versions of some dependencies have been identified in the dependency graph'
+ println msg
+ dups.each { k, v ->
+ println "Dependency: ${k}, Versions: $v"
+ }
+ throw new GradleException(msg)
+ }
+}
+
+task populateDependencies(type: Sync) {
into homeLibDir
-
+ includeEmptyDirs = false
+
+ grailsRepoCacheHash = "0176b65cdea0460180d870500d4c646f"
+ eachFile { file -> file.path -= "$grailsRepoCacheHash/" }
+
// Only configure this task if we are indeed going to run it because it forces a resolution of all of the subproject
// dependencies which is very costly and we want to avoid it if we aren't going to run this task. Because we do this
// after the task graph is ready we have to add the explicit dependency on the configurations as per above.
gradle.taskGraph.whenReady { taskGraph ->
- if (taskGraph.hasTask(':populateDependencies')) {
- from(gradleArtifactCache) {
- libsConfigurations*.resolvedConfiguration*.resolvedArtifacts*.each { artifact ->
- def dependency = artifact.getResolvedDependency()
-
- def file = artifact.file
- include "${dependency.moduleGroup}/${dependency.moduleName}/*-${dependency.moduleVersion}.*"
- include "${dependency.moduleGroup}/${dependency.moduleName}/jars/${dependency.moduleName}-${dependency.moduleVersion}.jar"
- include "${dependency.moduleGroup}/${dependency.moduleName}/bundles/${dependency.moduleName}-${dependency.moduleVersion}.jar"
- }
- }
- }
+ if (taskGraph.hasTask(':populateDependencies')) {
+ def projectNames = rootProject.subprojects*.name
+
+ baseCacheDir = "$gradle.gradleUserHomeDir/caches"
+ versionedCacheDir = "$baseCacheDir/artifacts-4"
+
+ from versionedCacheDir
+ libsConfigurations.each { configuration ->
+ configuration.resolvedConfiguration.resolvedArtifacts.each { artifact ->
+ def dependency = artifact.moduleVersion.id
+
+ if (!projectNames.contains(dependency.name)) {
+ def base = "${dependency.group}/${dependency.name}/$grailsRepoCacheHash"
+ include "${base}/*-${dependency.version}.*"
+ include "${base}/jars/${dependency.name}-${dependency.version}.jar"
+ include "${base}/bundles/${dependency.name}-${dependency.version}.jar"
+ }
+ }
+ }
+ }
}
}
// Can't use sync task here because this directory contains other things as well.
-task sourcesJars(type: Copy) {
+task sourcesJars(type: Sync) {
into homeSrcDir
from subprojects*.sourcesJar*.outputs*.files
+
+ // sourcesFor comes from GrailsBuildPlugin
+ from { sourcesFor(libsConfigurations*.copyRecursive { it.name.startsWith('grails-datastore') }.collect { it.transitive = false; it }) }
}
task pluginsFromSvn {
plugins = [
hibernate: grailsVersion,
tomcat: grailsVersion,
- resources: "1.0.2",
- jquery: "1.6.1.1"
+ resources: "1.1.5",
+ webxml: "1.4.1",
+ jquery: "1.7.1"
]
-
+
dir = file("$buildDir/pluginsFromSvn")
outputs.files { dir.listFiles().findAll { it.name.endsWith(".zip") } }
doFirst {
@@ -70,7 +111,7 @@ task pluginsFromSvn {
task installResources(type: Copy) {
into projectDir // not actually used, but has to be set to something
-
+
into(homeLibDir.name) {
from('grails-resources/src/grails/home/tests')
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
@@ -92,7 +133,7 @@ task installResources(type: Copy) {
into(homeConfDir.name) {
from("grails-resources/src/grails/home/conf")
-
+
filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
filter(ReplaceTokens, tokens: ['jline.version': jlineVersion])
@@ -103,24 +144,24 @@ task installResources(type: Copy) {
filter(ReplaceTokens, tokens: ['gant.version': gantVersion])
filter(ReplaceTokens, tokens: ['ivy.version': ivyVersion])
}
-
+
into(homeDslSupportDir.name) {
from 'grails-resources/src/grails/home/dsl-support'
}
-
+
into ("$homeSrcDir.name/war/WEB-INF") {
from "grails-resources/src/war/WEB-INF"
}
}
// Make the install task for each subproject place the output jar into the dist dir
subprojects {
- install.doLast {
- copy {
- from jar.outputs.files
- into homeDistDir
- }
+ task installToHomeDist(type: Copy) {
+ from jar.outputs.files
+ into homeDistDir
}
+
+ install.dependsOn installToHomeDist
}
task install(dependsOn: [populateDependencies, installResources] + subprojects*.install)
@@ -131,7 +172,7 @@ task zipDist(type: Zip, dependsOn: [sourcesJars, install]) {
appendix = grailsVersion
exclude "**/CVS/**"
-
+
into("grails-$grailsVersion") {
from(projectDir) {
include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'build.gradle', 'build.properties', 'dependencies.txt',
View
2 gradle/unit-test.gradle
@@ -31,7 +31,7 @@ task instrumentForCoverage {
taskdef(resource: 'tasks.properties', classpath: configurations.coverage.asPath)
}
copy {
- from sourceSets.main.classes
+ from sourceSets.main.output
into instrumentedClassesDir
}
ant {
View
BIN gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
View
4 gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Jun 17 14:56:10 BST 2011
+#Wed Dec 14 13:10:02 GMT 2011
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip
+distributionUrl=http\://repo.gradle.org/gradle/distributions-snapshots/gradle-1.0-milestone-7-20111214110828+0100-bin.zip
View
107 gradlew
@@ -1,16 +1,16 @@
#!/bin/bash
##############################################################################
-## ##
-## Gradle wrapper script for UN*X ##
-## ##
+##
+## Gradle start up script for UN*X
+##
##############################################################################
-# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-export GRADLE_OPTS="$GRADLE_OPTS -Xmx1024m -XX:MaxPermSize=256m"
-export JAVA_OPTS="$JAVA_OPTS -Xmx512m"
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
-GRADLE_APP_NAME=Gradle
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -42,54 +42,51 @@ case "`uname`" in
;;
esac
-# Attempt to set JAVA_HOME if it's not already set.
-if [ -z "$JAVA_HOME" ] ; then
- if $darwin ; then
- [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home"
- [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
- else
- javaExecutable="`which javac`"
- [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME."
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- export JAVA_HOME="$javaHome"
- fi
-fi
-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
- [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
-STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
-CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar
-WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/"
+APP_HOME="`pwd -P`"
+cd "$SAVED"
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
else
- JAVACMD="java"
+ JAVACMD="$JAVA_HOME/bin/java"
fi
-fi
-if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
-fi
-if [ -z "$JAVA_HOME" ] ; then
- warn "JAVA_HOME environment variable is not set"
fi
# Increase the maximum file descriptors if we can.
@@ -108,15 +105,15 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
fi
fi
-# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
+# For Darwin, add APP_NAME to the JAVA_OPTS as -Xdock:name
if $darwin; then
- JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
+ JAVA_OPTS="$JAVA_OPTS -Xdock:name=$APP_NAME"
# we may also want to set -Xdock:image
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
- JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
@@ -143,7 +140,7 @@ if $cygwin ; then
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
- done
+ done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
@@ -158,11 +155,11 @@ if $cygwin ; then
esac
fi
-GRADLE_APP_BASE_NAME=`basename "$0"`
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
- -classpath "$CLASSPATH" \
- -Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
- -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
- $STARTER_MAIN_CLASS \
- "$@"
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
View
52 gradlew.bat
@@ -1,24 +1,37 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
-@rem ##
-@rem Gradle startup script for Windows ##
-@rem ##
+@rem
+@rem Gradle startup script for Windows
+@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-@rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m
-@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512m
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.\
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
set JAVA_EXE=java.exe
-if not defined JAVA_HOME goto init
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+goto fail
+
+:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
@@ -29,14 +42,14 @@ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
-echo.
-goto end
+
+goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%eval[2+2]" == "4" goto 4NT_args
+if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -56,27 +69,22 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
-set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
-set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
-set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
-
-set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
-if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
-
+:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%"
-exit /b "%ERRORLEVEL%"
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
-:omega
+:omega
View
12 grails-bootstrap/build.gradle
@@ -17,7 +17,6 @@ dependencies {
exclude module:"commons-logging"
}
-
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
@@ -39,25 +38,24 @@ dependencies {
compile "junit:junit:${junitVersion}"
- // Ant
+ // Ant
compile "org.apache.ant:ant:${antVersion}",
"org.apache.ant:ant-launcher:${antVersion}",
"org.apache.ant:ant-trax:${antTraxVersion}",
"org.apache.ivy:ivy:${ivyVersion}"
-
+
compile("org.apache.ant:ant-junit:${antVersion}") {
- exclude module:'junit'
+ exclude module:'junit'
}
compile("org.codehaus.gant:gant_groovy1.8:${gantVersion}") {
exclude module:'commons-cli'
}
-
}
processResources {
- inputs.property "version", version
- filter(ReplaceTokens, tokens:[version:version])
+ inputs.property "version", version
+ filter(ReplaceTokens, tokens:[version:version])
}
jar.appendix = 'bootstrap'
View
45 ...trap/src/main/groovy/grails/build/interactive/completors/EscapingFileNameCompletor.groovy
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011 SpringSource.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.build.interactive.completors
+
+import jline.FileNameCompletor
+
+/**
+ * JLine Completor that does file path matching like FileNameCompletor,
+ * but in addition it escapes whitespace in completions with the '\'
+ * character.
+ *
+ * @author Peter Ledbrook
+ * @since 2.0
+ */
+class EscapingFileNameCompletor extends FileNameCompletor {
+ /**
+ * <p>Gets FileNameCompletor to create a list of candidates and then
+ * inserts '\' before any whitespace characters in each of the candidates.
+ * If a candidate ends in a whitespace character, then that is <em>not</em>
+ * escaped.</p>
+ */
+ int complete(String buffer, int cursor, List candidates) {
+ int retval = super.complete(buffer, cursor, candidates)
+
+ int count = candidates.size()
+ for (int i = 0; i < count; i++) {
+ candidates[i] = candidates[i].replaceAll(/(\s)(?!$)/, '\\\\$1')
+ }
+
+ return retval
+ }
+}
View
11 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/Open.groovy
@@ -1,16 +1,17 @@
package grails.build.interactive.completors
-import jline.SimpleCompletor
import jline.ArgumentCompletor
-import jline.FileNameCompletor
+import jline.SimpleCompletor
+
+import org.codehaus.groovy.grails.cli.interactive.InteractiveMode
/**
* @author Graeme Rocher
* @since 2.0
*/
-class Open extends ArgumentCompletor{
+class Open extends ArgumentCompletor {
- Open(String[] candidateStrings) {
- super([new SimpleCompletor("open"), new FileNameCompletor()] )
+ Open() {
+ super([ new SimpleCompletor("open"), new SimpleOrFileNameCompletor(InteractiveMode.FIXED_OPEN_OPTIONS) ])
}
}
View
41 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/RegexCompletor.groovy
@@ -0,0 +1,41 @@
+package grails.build.interactive.completors
+
+import jline.Completor
+
+import java.util.regex.Pattern
+
+/**
+ * JLine Completor that accepts a string if it matches a given regular
+ * expression pattern.
+ *
+ * @author Peter Ledbrook
+ * @since 2.0
+ */
+class RegexCompletor implements Completor {
+ Pattern pattern
+
+ RegexCompletor(String pattern) {
+ this(Pattern.compile(pattern))
+ }
+
+ RegexCompletor(Pattern pattern) {
+ this.pattern = pattern
+ }
+
+ /**
+ * <p>Check whether the whole buffer matches the configured pattern.
+ * If it does, the buffer is added to the <tt>candidates</tt> list
+ * (which indicates acceptance of the buffer string) and returns 0,
+ * i.e. the start of the buffer. This mimics the behaviour of SimpleCompletor.
+ * </p>
+ * <p>If the buffer doesn't match the configured pattern, this returns
+ * -1 and the <tt>candidates</tt> list is left empty.</p>
+ */
+ int complete(String buffer, int cursor, List candidates) {
+ if (buffer ==~ pattern) {
+ candidates << buffer
+ return 0
+ }
+ else return -1
+ }
+}
View
42 ...trap/src/main/groovy/grails/build/interactive/completors/SimpleOrFileNameCompletor.groovy
@@ -0,0 +1,42 @@
+package grails.build.interactive.completors
+
+import jline.Completor
+import jline.SimpleCompletor
+
+/**
+ * JLine Completor that mixes a fixed set of options with file path matches.
+ * Fixed options that match will appear first, followed by file path matches.
+ *
+ * @author Peter Ledbrook
+ * @since 2.0
+ */
+class SimpleOrFileNameCompletor implements Completor {
+ private simpleCompletor
+ private fileNameCompletor
+
+ SimpleOrFileNameCompletor(List fixedOptions) {
+ this(fixedOptions as String[])
+ }
+
+ SimpleOrFileNameCompletor(String[] fixedOptions) {
+ this.simpleCompletor = new SimpleCompletor(fixedOptions)
+ this.fileNameCompletor = new EscapingFileNameCompletor()
+ }
+
+ int complete(String buffer, int cursor, List candidates) {
+ // Try the simple completor first...
+ def retval = this.simpleCompletor.complete(buffer, cursor, candidates)
+
+ // ...and then the file path completor. By using the given candidate
+ // list with both completors we aggregate the results automatically.
+ def fileRetval = this.fileNameCompletor.complete(buffer, cursor, candidates)
+
+ // If the simple completor has matched, we return its value, otherwise
+ // we return whatever the file path matcher returned. This ensures that
+ // both simple completor and file path completor candidates appear
+ // correctly in the command prompt. If neither competors have matches,
+ // we of course return -1.
+ if (retval == -1) retval = fileRetval
+ return candidates ? retval : -1
+ }
+}
View
28 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/TestApp.groovy
@@ -0,0 +1,28 @@
+/*
+ * Copyright 2011 SpringSource
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.build.interactive.completors
+
+import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
+
+/**
+ * Completor for test-app
+ */
+class TestApp extends ClassNameCompletor {
+ @Override
+ String getCommandName() {
+ "test-app"
+ }
+}
View
12 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -56,6 +56,7 @@
public static final String SPACE = " ";
public static final String ERROR = "Error";
public static final String WARNING = "Warning";
+ public static final String STACKTRACE_FILTERED_MESSAGE = " (NOTE: Stack trace has been filtered. Use --verbose to see entire trace.)";
public static final String STACKTRACE_MESSAGE = " (Use --stacktrace to see the full trace)";
private StringBuilder maxIndicatorString;
private int cursorMove;
@@ -506,12 +507,11 @@ private void printStackTrace(String message, Throwable error) {
}
StringWriter sw = new StringWriter();
PrintWriter ps = new PrintWriter(sw);
- if (message != null) {
- ps.println(message);
- }
- else {
- ps.println(error.getMessage());
+ message = message != null ? message : error.getMessage();
+ if(!isVerbose()) {
+ message = message + STACKTRACE_FILTERED_MESSAGE;
}
+ ps.println(message);
error.printStackTrace(ps);
error(sw.toString());
}
@@ -688,7 +688,7 @@ private Ansi outputErrorLabel(Ansi ansi, String label) {
}
private Ansi erasePreviousLine(String categoryName) {
- int cursorMove = this.cursorMove;
+ @SuppressWarnings("hiding") int cursorMove = this.cursorMove;
if(userInputActive) cursorMove++;
if (cursorMove > 0) {
int moveLeftLength = categoryName.length() + lastMessage.length();
View
6 grails-bootstrap/src/main/groovy/grails/util/AbstractBuildSettings.java
@@ -86,6 +86,7 @@ public void setGlobalPluginsDir(File globalPluginsDir) {
* @param location The plugin's locatino
*/
public void addPluginDirectory(File location, boolean isInline) {
+ getPluginDirectories();
if (location != null) {
Collection<File> directories = getPluginDirectories();
if (!directories.contains(location)) {
@@ -110,7 +111,10 @@ public void addPluginDirectory(File location, boolean isInline) {
// BuildConfig setting "grails.plugin.location.<name>"
Collection<File> inlinePlugins = getInlinePluginsFromConfiguration(config);
cache.put(KEY_INLINE_PLUGIN_LOCATIONS, inlinePlugins);
- pluginDirectoryResources.addAll(inlinePlugins);
+ ArrayList<File> list = new ArrayList<File>(pluginDirectoryResources);
+ list.addAll(inlinePlugins);
+ Collections.reverse(list);
+ pluginDirectoryResources = new ConcurrentLinkedQueue<File>(list);
cache.put(KEY_PLUGIN_DIRECTORY_RESOURCES, pluginDirectoryResources);
}
View
32 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
@@ -50,6 +50,14 @@ class BuildSettings extends AbstractBuildSettings {
static final Pattern JAR_PATTERN = ~/^\S+\.jar$/
/**
+ * The compiler source level to use
+ */
+ public static final String COMPILER_SOURCE_LEVEL = "grails.project.source.level"
+ /**
+ * The compiler source level to use
+ */
+ public static final String COMPILER_TARGET_LEVEL = "grails.project.target.level"
+ /**
* The version of the servlet API
*/
public static final String SERVLET_VERSION = "grails.servlet.version"
@@ -129,7 +137,7 @@ class BuildSettings extends AbstractBuildSettings {
public static final String PROJECT_TEST_REPORTS_DIR = "grails.project.test.reports.dir"
/**
- * The name of the system property for {@link #testReportsDir}.
+ * The name of the system property for {@link #docsOutputDir}.
*/
public static final String PROJECT_DOCS_OUTPUT_DIR = "grails.project.docs.output.dir"
@@ -205,6 +213,16 @@ class BuildSettings extends AbstractBuildSettings {
/** The environment for the current script. */
String grailsEnv
+ /**
+ * The compiler source level to use
+ */
+ String compilerSourceLevel
+
+ /**
+ * The compiler target level to use
+ */
+ String compilerTargetLevel = "1.6"
+
/** <code>true</code> if the default environment for a script should be used. */
boolean defaultEnv
@@ -1158,8 +1176,14 @@ class BuildSettings extends AbstractBuildSettings {
def grailsConfig = config.grails
+ // If grails.dependency.cache.dir is set, use it for Ivy.
+ if (grailsConfig.dependency.cache.dir) {
+ dependencyManager.ivySettings.defaultCache = grailsConfig.dependency.cache.dir as File
+ }
+
if (!dependenciesExternallyConfigured) {
coreDependencies = new GrailsCoreDependencies(grailsVersion, servletVersion)
+ coreDependencies.java5compatible = !org.codehaus.groovy.grails.plugins.GrailsVersionUtils.isVersionGreaterThan("1.5", compilerTargetLevel)
grailsConfig.global.dependency.resolution = coreDependencies.createDeclaration()
def credentials = grailsConfig.project.ivy.authentication
if (credentials instanceof Closure) {
@@ -1219,6 +1243,10 @@ class BuildSettings extends AbstractBuildSettings {
def matcher = pluginName =~ /(\S+?)-(\d\S+)/
pluginName = matcher ? matcher[0][1] : pluginName
+
+ // The logic here tries to establish if the plugin has been declared anywhere by the application. Only plugins that have
+ // been declared should have their transitive dependencies resolved. Unfortunately it is fairly complicated to establish what plugins are declared since
+ // there may be a mixture of plugins defined in BuildConfig, inline plugins and plugins installed via install-plugin
if(!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
return
}
@@ -1292,6 +1320,8 @@ class BuildSettings extends AbstractBuildSettings {
}
servletVersion = getPropertyValue(SERVLET_VERSION, props, "2.5")
+ compilerSourceLevel = getPropertyValue(COMPILER_SOURCE_LEVEL, props, null)
+ compilerTargetLevel = getPropertyValue(COMPILER_TARGET_LEVEL, props, "1.6")
if (!projectWorkDirSet) {
def workingDirName = metadata.getApplicationName() ?: CORE_WORKING_DIR_NAME
View
61 grails-bootstrap/src/main/groovy/grails/util/Environment.java
@@ -26,7 +26,7 @@
import org.springframework.util.StringUtils;
/**
- * An enum that represents the current environment
+ * Represents the current environment.
*
* @author Graeme Rocher
* @since 1.1
@@ -81,23 +81,44 @@
PRODUCTION_ENV_SHORT_NAME, Environment.PRODUCTION.getName(),
TEST_ENVIRONMENT_SHORT_NAME, Environment.TEST.getName());
+ private static Holder<Environment> cachedCurrentEnvironment = new Holder<Environment>("Environment");
+ private static final boolean cachedHasGrailsHome = System.getProperty("grails.home") != null;
+ private String name;
+
+ Environment() {
+ initialize();
+ }
+
+ private void initialize() {
+ name = toString().toLowerCase(Locale.getDefault());
+ }
+
/**
* Returns the current environment which is typcally either DEVELOPMENT, PRODUCTION or TEST.
* For custom environments CUSTOM type is returned.
*
* @return The current environment.
*/
public static Environment getCurrent() {
+ Environment current = cachedCurrentEnvironment.get();
+ if (current != null) {
+ return current;
+ }
+
+ return resolveCurrentEnvironment();
+ }
+
+ private static Environment resolveCurrentEnvironment() {
String envName = System.getProperty(Environment.KEY);
if (isBlank(envName)) {
- Metadata metadata = Metadata.getCurrent();
- if(metadata != null) {
- envName = metadata.getEnvironment();
- }
- if(isBlank(envName)) {
- return DEVELOPMENT;
- }
+ Metadata metadata = Metadata.getCurrent();
+ if (metadata != null) {
+ envName = metadata.getEnvironment();
+ }
+ if (isBlank(envName)) {
+ return DEVELOPMENT;
+ }
}
Environment env = getEnvironment(envName);
@@ -116,6 +137,10 @@ public static Environment getCurrent() {
return env;
}
+ public static void cacheCurrentEnvironment() {
+ cachedCurrentEnvironment.set(resolveCurrentEnvironment());
+ }
+
/**
* @see #getCurrent()
* @return the current environment
@@ -130,7 +155,7 @@ public static Environment getCurrentEnvironment() {
*/
public static boolean isDevelopmentMode() {
return getCurrent() == DEVELOPMENT && !(Metadata.getCurrent().isWarDeployed()) &&
- System.getProperty("grails.home") != null;
+ cachedHasGrailsHome;
}
/**
@@ -325,15 +350,10 @@ private static boolean isBlank(String value) {
return value == null || value.trim().length() == 0;
}
- private String name;
-
/**
* @return the name of the environment
*/
public String getName() {
- if (name == null) {
- return toString().toLowerCase(Locale.getDefault());
- }
return name;
}
@@ -358,6 +378,19 @@ public boolean isReloadEnabled() {
}
/**
+ * @return true if the reloading agent is active
+ */
+ public static boolean isReloadingAgentEnabled() {
+ try {
+ Class.forName("com.springsource.loaded.TypeRegistry");
+ return true;
+ }
+ catch (ClassNotFoundException e) {
+ return false;
+ }
+ }
+
+ /**
* @return Obtains the location to reload resources from
*/
public String getReloadLocation() {
View
79 grails-bootstrap/src/main/groovy/grails/util/Holder.java
@@ -0,0 +1,79 @@
+/* Copyright 2011 SpringSource.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package grails.util;
+
+import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
+
+/**
+ * @author Burt Beckwith
+ * @since 2.0
+ */
+public class Holder<T> {
+
+ private Map<Integer, T> instances = new ConcurrentHashMap<Integer, T>();
+ // TODO remove mappedOnly and singleton
+ private T singleton;
+ private String name;
+
+ public Holder(String name) {
+ this.name = name;
+ }
+
+ public T get() {
+ return get(false);
+ }
+
+ public T get(boolean mappedOnly) {
+ T t = instances.get(getClassLoaderId());
+ if (t != null) {
+ return t;
+ }
+
+ t = lookupSecondary();
+ if (t != null) {
+ return t;
+ }
+
+// t = instances.get(System.identityHashCode(getClass().getClassLoader()));
+ if (t == null && !mappedOnly) {
+ t = singleton;
+ }
+ return t;
+ }
+
+ protected T lookupSecondary() {
+ // override in subclass if needed
+ return null;
+ }
+
+ public void set(T t) {
+ int id = getClassLoaderId();
+ int thisClassLoaderId = System.identityHashCode(getClass().getClassLoader());
+ if (t == null) {
+ instances.remove(id);
+ instances.remove(thisClassLoaderId);
+ }
+ else {
+ instances.put(id, t);
+ instances.put(thisClassLoaderId, t);
+ }
+ singleton = t;
+ }
+
+ private int getClassLoaderId() {
+ return System.identityHashCode(Thread.currentThread().getContextClassLoader());
+ }
+}
View
133 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
@@ -37,7 +37,6 @@
* @since 1.1
*/
public class Metadata extends Properties {
-
private static final long serialVersionUID = -582452926111226898L;
public static final String FILE = "application.properties";
public static final String APPLICATION_VERSION = "app.version";
@@ -47,17 +46,27 @@
public static final String WAR_DEPLOYED = "grails.war.deployed";
public static final String DEFAULT_SERVLET_VERSION = "2.5";
- private static Reference<Metadata> metadata = new SoftReference<Metadata>(new Metadata());
+ private static Holder<Reference<Metadata>> holder = new Holder<Reference<Metadata>>("Metadata");