Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'master' into i18n-in-jar

Conflicts:
	grails-plugin-i18n/src/main/groovy/org/codehaus/groovy/grails/plugins/i18n/I18nGrailsPlugin.groovy
  • Loading branch information...
commit 1bfb45d03623bca7d1887fb3e7da463b5fdd56b5 2 parents 3a0bffa + 4e897ea
@sjhorn sjhorn authored
Showing with 8,546 additions and 4,220 deletions.
  1. +1 −0  .gitignore
  2. +6 −4 build.gradle
  3. +1 −1  build.properties
  4. +2 −2 dependencies.txt
  5. +5 −4 gradle/assemble.gradle
  6. BIN  gradle/wrapper/gradle-wrapper.jar
  7. +2 −2 gradle/wrapper/gradle-wrapper.properties
  8. +1 −1  gradlew
  9. +18 −22 grails-bootstrap/build.gradle
  10. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateController.groovy
  11. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateScaffoldController.groovy
  12. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateService.groovy
  13. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateTagLib.groovy
  14. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateAll.groovy
  15. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateController.groovy
  16. +1 −1  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateViews.groovy
  17. +4 −4 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/SimpleOrFileNameCompletor.groovy
  18. +53 −6 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
  19. +8 −2 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
  20. +2 −2 grails-bootstrap/src/main/groovy/grails/util/BuildScope.java
  21. +110 −66 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
  22. +13 −0 grails-bootstrap/src/main/groovy/grails/util/BuildSettingsHolder.java
  23. +29 −17 grails-bootstrap/src/main/groovy/grails/util/Environment.java
  24. +1 −1  grails-bootstrap/src/main/groovy/grails/util/Metadata.java
  25. +133 −108 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
  26. 0  {grails-web → grails-bootstrap}/src/main/groovy/grails/web/container/EmbeddableServer.java
  27. 0  {grails-web → grails-bootstrap}/src/main/groovy/grails/web/container/EmbeddableServerFactory.java
  28. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CachedScript.java
  29. +100 −77 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  30. +106 −18 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
  31. +267 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/fork/ForkedGrailsProcess.groovy
  32. +4 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/GrailsInteractiveCompletor.groovy
  33. +3 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
  34. +2 −1  ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/completors/ClassNameCompletor.groovy
  35. +14 −17 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/maven/MavenMultiProjectGenerator.groovy
  36. +8 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/maven/MavenPomGenerator.groovy
  37. +16 −1 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/DefaultCommandLine.java
  38. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/Option.java
  39. +10 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ClasspathConfigurer.java
  40. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsBuildEventListener.java
  41. +2 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsRootLoader.java
  42. +3 −4 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/MetaClassRegistryCleaner.java
  43. +14 −52 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ScriptBindingInitializer.java
  44. +34 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/exceptions/CodeSnippetPrinter.groovy
  45. +2 −3 ...arr; grails-bootstrap}/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTraceFilterer.java
  46. +147 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/exceptions/DefaultStackTracePrinter.groovy
  47. 0  ...ls-core → grails-bootstrap}/src/main/groovy/org/codehaus/groovy/grails/exceptions/SourceCodeAware.java
  48. 0  ...core → grails-bootstrap}/src/main/groovy/org/codehaus/groovy/grails/exceptions/StackTraceFilterer.java
  49. +1 −7 ...ore → grails-bootstrap}/src/main/groovy/org/codehaus/groovy/grails/exceptions/StackTracePrinter.groovy
  50. +149 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/AbstractFileResolvingResource.java
  51. +553 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/AntPathMatcher.java
  52. +51 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/ByteArrayResource.groovy
  53. +266 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/ClassPathResource.java
  54. +120 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/DefaultResourceLoader.java
  55. +207 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/FileSystemResource.java
  56. +452 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/GrailsResourceUtils.java
  57. +268 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/IOUtils.java
  58. +560 −0 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/PathMatchingResourcePatternResolver.java
  59. +109 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/Resource.java
  60. +49 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/ResourceLoader.java
  61. +193 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/UrlResource.java
  62. +9 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/AstPluginDescriptorReader.java
  63. +2 −8 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/BasicGrailsPluginInfo.java
  64. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/CompositePluginDescriptorReader.java
  65. +2 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginInfo.java
  66. +8 −7 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginUtils.groovy
  67. +2 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginDescriptorReader.java
  68. +1 −2  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginInfo.groovy
  69. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/XmlPluginDescriptorReader.java
  70. +3 −5 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/build/scopes/PluginScopeInfo.groovy
  71. +21 −25 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
  72. +6 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
  73. +5 −11 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsCoreDependencies.java
  74. +1 −1  grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java
  75. +24 −33 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManager.groovy
  76. +86 −74 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
  77. +10 −9 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngine.groovy
  78. +9 −13 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/ResolveException.groovy
  79. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/SnapshotAwareM2Resolver.java
  80. +29 −26 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/AbstractDependenciesConfigurer.java
  81. +2 −2 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationContext.java
  82. +4 −7 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/JarDependenciesConfigurer.java
  83. +99 −54 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/RepositoriesConfigurer.groovy
  84. +29 −23 ...rc/main/groovy/org/codehaus/groovy/grails/resolve/maven/GrailsPackagingAwarePomModuleDescriptorBuilder.java
  85. +7 −6 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/maven/PomModuleDescriptorParser.java
  86. +1 −0  grails-bootstrap/src/main/resources/springloaded.properties
  87. +2 −2 grails-bootstrap/src/test/groovy/grails/build/interactive/completors/RegexCompletorSpec.groovy
  88. +2 −2 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParserSpec.groovy
  89. +8 −7 ...rg/codehaus/groovy/grails/cli/support → uaa/groovy/org/codehaus/groovy/grails/cli}/UaaIntegration.java
  90. +2 −3 ...us/groovy/grails/cli/support → uaa/groovy/org/codehaus/groovy/grails/cli}/UaaIntegrationSupport.groovy
  91. +1 −1  grails-core/build.gradle
  92. +2 −2 grails-core/src/main/groovy/grails/artefact/Enhanced.java
  93. +3 −5 grails-core/src/main/groovy/grails/validation/ValidationException.groovy
  94. +5 −6 grails-core/src/main/groovy/grails/web/HyphenatedUrlConverter.java
  95. +2 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
  96. +1 −1  ...cli/support → grails-core/src/main/groovy/org/codehaus/groovy/grails/cli/jndi}/JndiBindingHandler.java
  97. +1 −1  ...cli/support → grails-core/src/main/groovy/org/codehaus/groovy/grails/cli/jndi}/JndiBindingSupport.java
  98. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandler.java
  99. +5 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandlerAdapter.java
  100. +74 −39 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ControllerArtefactHandler.java
  101. +45 −133 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java
  102. +58 −49 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
  103. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClass.java
  104. +7 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClassProperty.java
  105. +9 −8 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplication.java
  106. +23 −20 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplicationFactoryBean.java
  107. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsClass.java
  108. +28 −23 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsClassUtils.java
  109. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsControllerClass.java
  110. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDataSource.java
  111. +4 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainClass.java
  112. +9 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainClassProperty.java
  113. +10 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsDomainConfigurationUtil.java
  114. +3 −0  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsResourceLoaderFactoryBean.java
  115. +7 −38 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsResourceUtils.java
  116. +29 −13 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/cfg/ConfigurationHelper.groovy
  117. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/AbstractDynamicConstructor.java
  118. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/BaseApiProvider.java
  119. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/ClosureInvokingDynamicMethod.java
  120. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/DynamicConstructor.java
  121. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/DynamicProperty.java
  122. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/metaclass/MetaClassEnhancer.groovy
  123. +9 −1 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsResourceHolder.java
  124. +10 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsRuntimeConfigurator.java
  125. +8 −18 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/GrailsWebApplicationContext.java
  126. +27 −40 ...s-core/src/main/groovy/org/codehaus/groovy/grails/commons/spring/ReloadAwareAutowireCapableBeanFactory.java
  127. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/DirectoryWatcher.java
  128. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsClassLoader.java
  129. +16 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectCompiler.groovy
  130. +0 −381 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectPackager.groovy
  131. +57 −26 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcher.java
  132. +5 −6 ...s-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/AbstractGrailsArtefactTransformer.java
  133. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ArtefactTypeAstTransformation.java
  134. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/ClassInjector.java
  135. +4 −25 ...ls-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java
  136. +94 −54 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsASTUtils.java
  137. +7 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsAwareInjectionOperation.java
  138. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/PluginAwareAstTransformer.java
  139. +3 −0  grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/support/GrailsResourceLoader.java
  140. +3 −3 ...vy/org/codehaus/groovy/grails/context/annotation/ClosureClassIgnoringComponentScanBeanDefinitionParser.java
  141. +10 −10 ...core/src/main/groovy/org/codehaus/groovy/grails/context/support/PluginAwareResourceBundleMessageSource.java
  142. +6 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/core/io/DefaultResourceLocator.java
  143. +87 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/core/io/SpringResource.java
  144. +3 −18 grails-core/src/main/groovy/org/codehaus/groovy/grails/documentation/DocumentationContext.groovy
  145. +3 −15 ...ore/src/main/groovy/org/codehaus/groovy/grails/documentation/MetadataGeneratingMetaClassCreationHandle.java
  146. +3 −122 .../org/codehaus/groovy/grails/exceptions/{DefaultStackTracePrinter.groovy → DefaultErrorsPrinter.groovy}
  147. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/orm/support/TransactionManagerPostProcessor.java
  148. +11 −10 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/AbstractGrailsPluginManager.java
  149. +4 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CoreGrailsPlugin.groovy
  150. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/CorePluginFinder.java
  151. +28 −52 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPlugin.java
  152. +49 −1,052 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/DefaultGrailsPluginManager.java
  153. +5 −5 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPlugin.java
  154. +8 −8 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginManager.java
  155. +48 −35 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginManagerFactoryBean.java
  156. +9 −9 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/MockGrailsPluginManager.java
  157. +9 −22 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginManagerHolder.java
  158. +28 −24 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/DefaultPluginPublisher.groovy
  159. +13 −14 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGenerator.groovy
  160. +4 −4 grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginPackager.groovy
  161. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/plugins/support/WatchPatternParser.java
  162. +555 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/project/packaging/GrailsProjectPackager.groovy
  163. +541 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/project/packaging/GrailsProjectWarCreator.groovy
  164. +118 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/project/plugins/GrailsProjectPluginLoader.groovy
  165. +37 −36 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/DevelopmentResourceLoader.java
  166. +3 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/support/proxy/ProxyHandler.java
  167. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/AbstractConstraint.java
  168. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/BlankConstraint.java
  169. +56 −98 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstrainedProperty.java
  170. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstrainedPropertyBuilder.java
  171. +2 −2 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/Constraint.java
  172. +2 −3 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ConstraintEvalUtils.groovy
  173. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/CreditCardConstraint.java
  174. +14 −15 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/DefaultConstraintEvaluator.java
  175. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/EmailConstraint.java
  176. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/GrailsDomainClassValidator.java
  177. +10 −6 grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/MatchesConstraint.java
  178. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/NullableConstraint.java
  179. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/UrlConstraint.java
  180. +1 −1  grails-core/src/main/groovy/org/codehaus/groovy/grails/validation/ValidatorConstraint.java
  181. +1 −1  grails-core/src/test/groovy/grails/web/CamelCaseUrlConverterSpec.groovy
  182. +1 −1  grails-core/src/test/groovy/grails/web/HyphenatedUrlConverterSpec.groovy
  183. +158 −0 grails-core/src/test/groovy/org/codehaus/groovy/grails/compiler/GrailsProjectWatcherSpec.groovy
  184. +1 −1  grails-core/src/test/groovy/org/codehaus/groovy/grails/compiler/injection/GrailsArtefactTransformerSpec.groovy
  185. +12 −12 grails-core/src/test/groovy/org/codehaus/groovy/grails/exceptions/StackTracePrinterSpec.groovy
  186. +1 −1  grails-core/src/test/groovy/org/codehaus/groovy/grails/plugins/publishing/PluginDescriptorGeneratorSpec.groovy
  187. +1 −2  grails-crud/src/main/groovy/grails/util/GenerateUtils.java
  188. +5 −5 grails-crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/DefaultGrailsTemplateGenerator.groovy
  189. +1 −1  grails-crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/DomainClassPropertyComparator.java
  190. +1 −1  grails-crud/src/main/groovy/org/codehaus/groovy/grails/scaffolding/view/ScaffoldingViewResolver.java
  191. +1 −1  grails-docs/build.gradle
  192. +1 −1  grails-docs/src/main/groovy/grails/doc/DocEngine.groovy
  193. +1 −2  grails-docs/src/main/groovy/grails/doc/internal/YamlTocStrategy.groovy
  194. +9 −9 grails-docs/src/test/groovy/grails/doc/internal/YamlTocStrategySpec.groovy
  195. +93 −18 grails-hibernate/src/main/groovy/grails/orm/HibernateCriteriaBuilder.java
  196. +3 −3 grails-hibernate/src/main/groovy/grails/orm/PagedResultList.java
  197. +1 −1  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/compiler/gorm/GormTransformer.java
  198. +46 −15 ...hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/ConfigurableLocalSessionFactoryBean.java
  199. +1 −1  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/GrailsHibernateDomainClass.java
  200. +6 −6 ...-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/GrailsHibernateDomainClassProperty.java
  201. +27 −25 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/HibernateGormEnhancer.groovy
  202. +2 −0  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/ColumnConfig.groovy
  203. +4 −5 ...ibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GORMEnhancingBeanPostProcessor.groovy
  204. +96 −26 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsDomainBinder.java
  205. +16 −13 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/GrailsHibernateUtil.java
  206. +11 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/HibernateMappingBuilder.groovy
  207. +3 −3 ...-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/HibernateNamedQueriesBuilder.groovy
  208. +6 −1 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/Mapping.groovy
  209. +0 −3  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/cfg/PropertyConfig.groovy
  210. +2 −2 ...ate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractDynamicPersistentMethod.java
  211. +11 −8 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractFindByPersistentMethod.java
  212. +14 −11 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractSavePersistentMethod.java
  213. +5 −6 ...nate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/AbstractStaticPersistentMethod.java
  214. +5 −5 ...ernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ExecuteQueryPersistentMethod.java
  215. +1 −1  ...hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/FindAllByPersistentMethod.java
  216. +1 −1  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ListPersistentMethod.java
  217. +1 −1  ...-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/metaclass/ValidatePersistentMethod.java
  218. +2 −2 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateProjectionAdapter.java
  219. +6 −4 grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/query/HibernateQuery.java
  220. +1 −1  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventListener.java
  221. +20 −18 ...ate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/ClosureEventTriggeringInterceptor.java
  222. +1 −1  ...te/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/support/GrailsOpenSessionInViewInterceptor.java
  223. +1 −1  grails-hibernate/src/main/groovy/org/codehaus/groovy/grails/orm/hibernate/validation/UniqueConstraint.java
  224. +60 −36 ...ls-hibernate/src/main/groovy/org/codehaus/groovy/grails/plugins/orm/hibernate/HibernatePluginSupport.groovy
  225. +1 −2  grails-plugin-async/src/main/groovy/org/codehaus/groovy/grails/plugins/web/async/GrailsAsyncContext.groovy
  226. +150 −101 ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformer.java
  227. +1 −2  ...plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerDomainTransformer.java
  228. +1 −1  grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/compiler/web/ControllerTransformer.java
  229. +33 −28 ...ls-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/ControllersGrailsPlugin.groovy
  230. +1 −1  grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllersApi.java
  231. +1 −1  grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/BindDynamicMethod.java
  232. +3 −2 grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ChainMethod.groovy
  233. +25 −0 grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/ForwardMethod.groovy
  234. +1 −1  grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RedirectDynamicMethod.java
  235. +28 −16 grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/metaclass/RenderDynamicMethod.java
  236. +6 −7 grails-plugin-controllers/src/main/groovy/org/codehaus/groovy/grails/web/plugins/support/WebMetaUtils.groovy
  237. +9 −13 ...src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerCommandObjectSpec.groovy
  238. +10 −12 ...-controllers/src/test/groovy/org/codehaus/groovy/grails/compiler/web/ControllerActionTransformerSpec.groovy
  239. +3 −3 grails-plugin-converters/src/main/groovy/grails/converters/JSON.java
  240. +1 −1  grails-plugin-converters/src/main/groovy/grails/converters/XML.java
  241. +6 −4 grails-plugin-converters/src/main/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtil.java
  242. +7 −7 .../src/main/groovy/org/codehaus/groovy/grails/web/converters/configuration/DefaultConverterConfiguration.java
  243. +2 −2 ...lugin-converters/src/test/groovy/org/codehaus/groovy/grails/plugins/converters/api/ConvertersApiSpec.groovy
  244. +2 −3 grails-plugin-converters/src/test/groovy/org/codehaus/groovy/grails/web/converters/ConverterUtilSpec.groovy
  245. +6 −0 ...ugin-datasource/src/main/groovy/org/codehaus/groovy/grails/plugins/datasource/DataSourceGrailsPlugin.groovy
  246. +5 −4 ...lugin-domain-class/src/main/groovy/org/codehaus/groovy/grails/domain/GrailsDomainClassPersistentEntity.java
  247. +11 −13 grails-plugin-domain-class/src/main/groovy/org/codehaus/groovy/grails/plugins/DomainClassGrailsPlugin.groovy
  248. +5 −5 ...s-plugin-filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/CompositeInterceptor.groovy
  249. +34 −10 grails-plugin-filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/DelegateMetaMethod.java
  250. +18 −22 grails-plugin-filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/FilterConfig.groovy
  251. +21 −5 ...ain/groovy/org/codehaus/groovy/grails/plugins/web/filters/FilterConfigDelegateMetaMethodTargetStrategy.java
  252. +8 −1 ...plugin-filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/FilterToHandlerAdapter.groovy
  253. +28 −28 ...ls-plugin-filters/src/main/groovy/org/codehaus/groovy/grails/plugins/web/filters/FiltersGrailsPlugin.groovy
  254. +2 −2 grails-plugin-gsp/build.gradle
  255. +2 −0  grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/gsp/GroovyPageOptimizerVisitor.java
  256. +2 −2 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/compiler/web/taglib/TagLibraryTransformer.java
  257. +7 −7 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/ControllerTagLibraryApi.java
  258. +5 −6 grails-plugin-gsp/src/ast/groovy/org/codehaus/groovy/grails/plugins/web/api/TagLibraryApi.java
  259. +5 −4 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/GroovyPagesGrailsPlugin.groovy
  260. +10 −36 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ApplicationTagLib.groovy
  261. +22 −20 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/FormTagLib.groovy
  262. +2 −0  grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/JavascriptTagLib.groovy
  263. +7 −7 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/RenderTagLib.groovy
  264. +1 −1  grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/SitemeshTagLib.groovy
  265. +3 −4 grails-plugin-gsp/src/main/groovy/org/codehaus/groovy/grails/plugins/web/taglib/ValidationTagLib.groovy
  266. +16 −16 grails-plugin-i18n/src/main/groovy/org/codehaus/groovy/grails/plugins/i18n/I18nGrailsPlugin.groovy
  267. +13 −6 grails-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/Log4jConfig.groovy
  268. +8 −7 grails-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/LoggingGrailsPlugin.groovy
  269. +30 −14 ...-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/appenders/GrailsConsoleAppender.java
  270. +31 −9 grails-plugin-log4j/src/main/groovy/org/codehaus/groovy/grails/plugins/log4j/web/util/Log4jConfigListener.java
  271. +7 −6 grails-plugin-log4j/src/main/groovy/org/slf4j/impl/GrailsLog4jLoggerAdapter.java
  272. +1 −5 grails-plugin-log4j/src/main/groovy/org/slf4j/impl/StaticLoggerBinder.java
  273. +2 −4 grails-plugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/RequestMimeTypesApi.groovy
  274. +2 −4 grails-plugin-mimetypes/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ResponseMimeTypesApi.groovy
  275. +1 −1  ...n-scaffolding/src/main/groovy/org/codehaus/groovy/grails/plugins/scaffolding/ScaffoldingGrailsPlugin.groovy
  276. +20 −3 grails-plugin-services/src/main/groovy/org/codehaus/groovy/grails/plugins/services/ServicesGrailsPlugin.groovy
  277. +3 −2 grails-plugin-servlets/src/main/groovy/org/codehaus/groovy/grails/plugins/web/api/ServletRequestApi.groovy
  278. +27 −2 grails-plugin-testing/build.gradle
  279. +3 −2 grails-plugin-testing/src/main/groovy/grails/test/GrailsUnitTestCase.groovy
  280. +1 −1  grails-plugin-testing/src/main/groovy/grails/test/MockUtils.groovy
  281. +5 −9 grails-plugin-testing/src/main/groovy/grails/test/MvcUnitTestCase.groovy
  282. +2 −1  grails-plugin-testing/src/main/groovy/grails/test/mixin/domain/DomainClassUnitTestMixin.groovy
  283. +7 −7 grails-plugin-testing/src/main/groovy/grails/test/mixin/support/GrailsUnitTestMixin.groovy
  284. +1 −1  grails-plugin-testing/src/main/groovy/grails/test/mixin/support/LazyTagLibraryLookup.java
  285. +48 −45 grails-plugin-testing/src/main/groovy/grails/test/mixin/web/ControllerUnitTestMixin.groovy
  286. +36 −17 ...lugin-testing/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/test/TestForTransformation.java
  287. +4 −6 grails-plugin-testing/src/test/groovy/grails/test/mixin/GroovyPageUnitTestMixinTests.groovy
  288. +4 −6 grails-plugin-testing/src/test/groovy/grails/test/mixin/MetaClassCleanupSpec.groovy
  289. +6 −7 grails-plugin-testing/src/test/groovy/grails/test/mixin/TestForSpec.groovy
  290. +5 −5 grails-plugin-testing/src/test/groovy/grails/test/mixin/WebFlowUnitTestMixinTests.groovy
  291. +24 −22 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/InlineExplodedTomcatServer.groovy
  292. +2 −6 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/IsolatedTomcat.java
  293. +7 −5 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/IsolatedWarTomcatServer.groovy
  294. +17 −4 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/ParentDelegatingClassLoader.java
  295. +2 −2 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatKillSwitch.java
  296. +26 −5 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatServer.groovy
  297. +75 −2 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/TomcatServerFactory.groovy
  298. +212 −0 grails-plugin-tomcat/src/main/groovy/org/grails/plugins/tomcat/fork/ForkedTomcatServer.groovy
  299. +1 −0  grails-plugin-url-mappings/build.gradle
  300. +2 −1  grails-plugin-url-mappings/src/main/groovy/grails/test/GrailsUrlMappingsTestCase.groovy
Sorry, we could not display the entire diff because too many files (515) changed.
View
1  .gitignore
@@ -69,3 +69,4 @@ target
/grails-plugin-log4j/bin/
/grails-plugin-logging/bin/
/grails-logging/bin/
+
View
10 build.gradle
@@ -14,7 +14,7 @@ buildscript {
apply plugin: 'idea'
ext {
- grailsVersion = '2.1.1'
+ grailsVersion = '2.3.0.BUILD-SNAPSHOT'
isBuildSnapshot = grailsVersion.endsWith(".BUILD-SNAPSHOT")
antTraxVersion = "1.7.1"
antVersion = "1.8.2"
@@ -27,7 +27,7 @@ ext {
datastoreVersion = "1.1.0.RELEASE"
gantVersion = "1.9.6"
gdocEngineVersion = "1.0.1"
- groovyVersion = "1.8.8"
+ groovyVersion = "2.0.4"
gradleGroovyVersion = groovyVersion
gradleGroovyVersion = "1.8.2"
ivyVersion = "2.2.0"
@@ -80,6 +80,8 @@ if (jointBuildGroovyJarProperty) {
allprojects {
repositories {
maven { url "http://repo.grails.org/grails/core" }
+ // TODO configure this as a remote for repo.grails.org so we don't need this here...
+ maven { url 'http://oss.sonatype.org/content/repositories/snapshots' }
}
configurations {
@@ -166,7 +168,7 @@ subprojects { project ->
// Testing
testCompile "junit:junit:${junitVersion}"
- testCompile('org.spockframework:spock-core:0.6-groovy-1.8-SNAPSHOT') {
+ testCompile('org.spockframework:spock-core:0.7-groovy-2.0-SNAPSHOT') {
transitive = false
}
}
@@ -328,6 +330,6 @@ apply {
}
task wrapper(type: Wrapper) {
- gradleVersion = '1.1-rc-1'
+ gradleVersion = '1.1'
jarFile = 'gradle/wrapper/gradle-wrapper.jar'
}
View
2  build.properties
@@ -1,2 +1,2 @@
-grails.version=2.1.1
+grails.version=2.3.0.BUILD-SNAPSHOT
View
4 dependencies.txt
@@ -88,8 +88,8 @@ 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.8.jar
-- Groovy 1.8.8 (http://groovy.codehaus.org) Apache 2.0 License
+* groovy-all-2.0.4.jar
+- Groovy 2.0.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
View
9 gradle/assemble.gradle
@@ -7,7 +7,7 @@ subprojects { subproject ->
configurations {
libsConfigurations << libs {
extendsFrom compile, runtime
- ["jsp21"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
+ ["jsp21", "uaa"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
}
}
}
@@ -23,7 +23,7 @@ task checkDuplicateDependencies(description: 'Checks the dependency graph for mu
def value = dependency.moduleVersion
def versions = moduleToVersionsMap[key]
- if(!versions) {
+ if (!versions) {
versions = [] as Set
moduleToVersionsMap[key] = versions
}
@@ -33,7 +33,7 @@ task checkDuplicateDependencies(description: 'Checks the dependency graph for mu
def dups = moduleToVersionsMap.findAll { k, v ->
v.size() > 1
}
- if(dups) {
+ if (dups) {
def msg = 'Multiple versions of some dependencies have been identified in the dependency graph'
println msg
dups.each { k, v ->
@@ -105,7 +105,8 @@ task pluginsFromRepo {
ant {
mkdir(dir: dir)
plugins.each { name, version ->
- get(src: "http://repo.grails.org/grails/plugins/org/grails/plugins/${name}/$version/${name}-${version}.zip",
+ def versionTag = version.replaceAll(/\./, '_').toUpperCase()
+ get(src: "http://grails.org/plugins/grails-${name}/tags/RELEASE_${versionTag}/grails-${name}-${version}.zip",
dest: dir, verbose: true, usetimestamp: true)
}
}
View
BIN  gradle/wrapper/gradle-wrapper.jar
Binary file not shown
View
4 gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Wed Jul 25 18:35:48 CDT 2012
+#Fri Aug 17 16:00:22 CDT 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-rc-1-bin.zip
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.1-bin.zip
View
2  gradlew
@@ -107,7 +107,7 @@ fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
- JAVA_OPTS="$JAVA_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
+ GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
View
40 grails-bootstrap/build.gradle
@@ -1,43 +1,29 @@
import org.apache.tools.ant.filters.ReplaceTokens
+configurations {
+ uaa.extendsFrom compile
+}
dependencies {
compile("org.springframework:spring-core:${springVersion}") {
exclude module:"commons-logging"
}
- compile("org.springframework:spring-beans:${springVersion}") {
- exclude module:"commons-logging"
- }
- compile("org.springframework:spring-test:${springVersion}") {
- exclude module:"commons-logging"
- }
- compile("org.springframework:spring-context:${springVersion}") {
- exclude module:"commons-logging"
- }
- compile("org.springframework:spring-context-support:${springVersion}") {
- 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
+ // UAA client dependency, optional
+ uaa("org.springframework.uaa:org.springframework.uaa.client:1.0.1.RELEASE") {
["protobuf-java-lite", "json-simple", "bcpg-jdk15", "bcprov-jdk15"].each { dep ->
exclude group: "org.springframework.roo.wrapping", module: "org.springframework.roo.wrapping." + dep
}
}
// These 3 are required by UAA but not Grails (non OSGI version of excludes above)
- compile 'com.google.protobuf:protobuf-java:2.4.1',
- 'com.googlecode.json-simple:json-simple:1.1',
- "org.bouncycastle:bcpg-jdk15:1.45"
-
- compile "commons-lang:commons-lang:$commonsLangVersion"
+ uaa 'com.google.protobuf:protobuf-java:2.4.1',
+ 'com.googlecode.json-simple:json-simple:1.1',
+ "org.bouncycastle:bcpg-jdk15:1.45"
compile "org.fusesource.jansi:jansi:$jansiVersion",
"jline:jline:$jlineVersion",
"net.java.dev.jna:jna:$jnaVersion"
- compile "junit:junit:${junitVersion}"
-
// Ant
compile "org.apache.ant:ant:${antVersion}",
"org.apache.ant:ant-launcher:${antVersion}",
@@ -53,9 +39,19 @@ dependencies {
}
}
+sourceSets {
+ uaa {
+ compileClasspath = files(configurations.uaa, main.output)
+ groovy.srcDirs = ['src/uaa/groovy']
+ resources.srcDirs = []
+ }
+}
processResources {
inputs.property "version", version
filter(ReplaceTokens, tokens:[version:version])
}
jar.appendix = 'bootstrap'
+jar {
+ from compileUaaGroovy.outputs.files
+}
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateController.groovy
@@ -17,7 +17,7 @@ package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.io.support.Resource
/**
* A completor for the create-controller command
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateScaffoldController.groovy
@@ -17,7 +17,7 @@ package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.io.support.Resource
/**
* A completor for the create-scaffold-controller command
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateService.groovy
@@ -17,7 +17,7 @@ package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.io.support.Resource
/**
* A completor for the create-service command
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateTagLib.groovy
@@ -17,7 +17,7 @@ package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.io.support.Resource
/**
* A completor for the create-tag-lib command
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateAll.groovy
@@ -16,8 +16,8 @@
package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
-import org.springframework.core.io.Resource
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
+import org.codehaus.groovy.grails.io.support.Resource
/**
* Completor for the generate-all command.
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateController.groovy
@@ -16,8 +16,8 @@
package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
-import org.springframework.core.io.Resource
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
+import org.codehaus.groovy.grails.io.support.Resource
/**
* Completor for the generate-controller command.
View
2  grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateViews.groovy
@@ -17,7 +17,7 @@ package grails.build.interactive.completors
import org.codehaus.groovy.grails.cli.interactive.completors.ClassNameCompletor
import org.codehaus.groovy.grails.io.support.GrailsResourceUtils
-import org.springframework.core.io.Resource
+import org.codehaus.groovy.grails.io.support.Resource
/**
* Completor for the generate-views command.
View
8 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/SimpleOrFileNameCompletor.groovy
@@ -19,17 +19,17 @@ class SimpleOrFileNameCompletor implements Completor {
}
SimpleOrFileNameCompletor(String[] fixedOptions) {
- this.simpleCompletor = new SimpleCompletor(fixedOptions)
- this.fileNameCompletor = new EscapingFileNameCompletor()
+ simpleCompletor = new SimpleCompletor(fixedOptions)
+ fileNameCompletor = new EscapingFileNameCompletor()
}
int complete(String buffer, int cursor, List candidates) {
// Try the simple completor first...
- def retval = this.simpleCompletor.complete(buffer, cursor, candidates)
+ def retval = 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)
+ def fileRetval = 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
View
59 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
@@ -32,7 +32,6 @@
import org.fusesource.jansi.Ansi;
import org.fusesource.jansi.Ansi.Color;
import org.fusesource.jansi.AnsiConsole;
-import org.springframework.util.StringUtils;
import java.io.*;
import java.lang.reflect.Field;
@@ -70,7 +69,7 @@
/**
* Whether to enable verbose mode
*/
- private boolean verbose;
+ private boolean verbose = Boolean.getBoolean("grails.verbose");;
/**
* Whether to show stack traces
@@ -242,16 +241,19 @@ private boolean isWindows() {
public static synchronized GrailsConsole getInstance() {
if (instance == null) {
try {
- instance = createInstance();
+ setInstance(createInstance());
} catch (IOException e) {
throw new RuntimeException("Cannot create grails console: " + e.getMessage(), e);
}
}
-
+ return instance;
+ }
+
+ public static void setInstance(GrailsConsole newConsole) {
+ instance = newConsole;
if (!(System.out instanceof GrailsConsolePrintStream)) {
System.setOut(new GrailsConsolePrintStream(instance.out));
}
- return instance;
}
public static GrailsConsole createInstance() throws IOException {
@@ -299,6 +301,14 @@ public boolean isVerbose() {
}
/**
+ *
+ * @return Whether to show stack traces
+ */
+ public boolean isStacktrace() {
+ return stacktrace;
+ }
+
+ /**
* @return The input stream being read from
*/
public InputStream getInput() {
@@ -345,7 +355,7 @@ public PrintStream getOut() {
public void indicateProgress() {
progressIndicatorActive = true;
if (isAnsiEnabled()) {
- if (StringUtils.hasText(lastMessage)) {
+ if (lastMessage != null && lastMessage.length() > 0) {
if (!lastMessage.contains(maxIndicatorString)) {
updateStatus(lastMessage + indicator);
}
@@ -463,6 +473,7 @@ private Ansi moveDownToSkipPrompt() {
private void postPrintMessage() {
progressIndicatorActive = false;
+ appendCalled = false;
if (userInputActive) {
showPrompt();
}
@@ -576,6 +587,9 @@ private void printStackTrace(String message, Throwable error) {
public void log(String msg) {
PrintStream printStream = out;
try {
+ if (userInputActive) {
+ erasePrompt(printStream);
+ }
if (msg.endsWith(LINE_SEPARATOR)) {
printStream.print(msg);
}
@@ -584,10 +598,42 @@ public void log(String msg) {
}
cursorMove = 0;
} finally {
+ printStream.flush();
postPrintMessage();
}
}
+ private void erasePrompt(PrintStream printStream) {
+ printStream.print(ansi()
+ .eraseLine(Ansi.Erase.BACKWARD).cursorLeft(PROMPT.length()));
+ }
+
+ /**
+ * Logs a message below the current status message
+ *
+ * @param msg The message to log
+ */
+ private boolean appendCalled = false;
+ public void append(String msg) {
+ PrintStream printStream = out;
+ try {
+ if (userInputActive && !appendCalled) {
+ printStream.print(moveDownToSkipPrompt());
+ appendCalled = true;
+ }
+ if (msg.endsWith(LINE_SEPARATOR)) {
+ printStream.print(msg);
+ }
+ else {
+ printStream.println(msg);
+ }
+ cursorMove = 0;
+ } finally {
+ progressIndicatorActive = false;
+ }
+ }
+
+
/**
* Synonym for #log
*
@@ -668,6 +714,7 @@ private String showPrompt(String prompt) {
}
out.print(prompt);
+ out.flush();
return null;
}
View
10 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
@@ -45,8 +45,14 @@
private Boolean eclipseSupportsAnsi = null; //lazy initialized because implicitly used from super constructor.
- protected GrailsEclipseConsole() throws IOException {
- super();
+ /**
+ * Create a GrailsConsole that has some customizations to work better with STS. Note that
+ * this console implicitly captures and redirects System.out, System.err and System.in in the
+ * super class. So extreme care must be taken to ensure these streams are setup correctly
+ * before creating an instance.
+ */
+ public GrailsEclipseConsole() throws IOException {
+ super();
}
@Override
View
4 grails-bootstrap/src/main/groovy/grails/util/BuildScope.java
@@ -64,7 +64,7 @@ public static BuildScope getCurrent() {
* Returns whether the specified scope name(s) are valid given the current scope.
*
* @param scopeNames The list of scope names
- * @return True if they are valid
+ * @return true if they are valid
*/
public static boolean isValid(String... scopeNames) {
BuildScope currentScope = getCurrent();
@@ -80,6 +80,6 @@ public static boolean isValid(String... scopeNames) {
* Enables this build scope as the curent system wide instance.
*/
public void enable() {
- System.setProperty(KEY, this.toString());
+ System.setProperty(KEY, toString());
}
}
View
176 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
@@ -17,10 +17,12 @@ package grails.util
import static grails.build.logging.GrailsConsole.instance as CONSOLE
import grails.build.logging.GrailsConsole
+import groovy.transform.CompileStatic
import java.util.concurrent.ConcurrentHashMap
import java.util.regex.Pattern
+import org.apache.ivy.core.module.descriptor.ExcludeRule
import org.apache.ivy.core.report.ResolveReport
import org.apache.ivy.plugins.repository.TransferEvent
import org.apache.ivy.plugins.repository.TransferListener
@@ -29,11 +31,10 @@ import org.apache.ivy.util.DefaultMessageLogger
import org.apache.ivy.util.Message
import org.codehaus.groovy.grails.cli.support.ClasspathConfigurer
import org.codehaus.groovy.grails.cli.support.OwnerlessClosure
+import org.codehaus.groovy.grails.resolve.EnhancedDefaultDependencyDescriptor
import org.codehaus.groovy.grails.resolve.GrailsCoreDependencies
import org.codehaus.groovy.grails.resolve.IvyDependencyManager
import org.codehaus.groovy.runtime.StackTraceUtils
-import org.codehaus.groovy.grails.resolve.EnhancedDefaultDependencyDescriptor
-import org.apache.ivy.core.module.descriptor.ExcludeRule
/**
* <p>Represents the project paths and other build settings
@@ -158,6 +159,11 @@ class BuildSettings extends AbstractBuildSettings {
public static final String PROJECT_WAR_FILE = "grails.project.war.file"
/**
+ * The name of the WAR file of the project
+ */
+ public static final String PROJECT_AUTODEPLOY_DIR = "grails.project.autodeploy.dir"
+
+ /**
* The name of the system property for enabling osgi headers in the WAR Manifest
*/
public static final String PROJECT_WAR_OSGI_HEADERS = "grails.project.war.osgi.headers"
@@ -186,10 +192,14 @@ class BuildSettings extends AbstractBuildSettings {
/**
* A property name to enable/disable AST conversion of closures actions&tags to methods
*/
-
public static final String CONVERT_CLOSURES_KEY = "grails.compile.artefacts.closures.convert"
/**
+ * Property name to enable/disable script event time logging.
+ */
+ public static final String LOG_SCRIPT_TIMING_KEY = 'grails.script.logTiming'
+
+ /**
* The base directory for the build, which is normally the root
* directory of the current project. If a command is run outside
* of a project, then this will be the current working directory
@@ -264,6 +274,11 @@ class BuildSettings extends AbstractBuildSettings {
File projectWarFile
/**
+ * Directory where additional war files to be autodeployed are located
+ */
+ File autodeployDir
+
+ /**
* Setting for whether or not to enable OSGI headers in the WAR Manifest, can be overridden via -verboseCompile(=[true|false])?
*/
boolean projectWarOsgiHeaders = false
@@ -320,6 +335,11 @@ class BuildSettings extends AbstractBuildSettings {
*/
File proxySettingsFile;
+ /**
+ * Fork Settings. These are the default settings used to control forked mode, and what
+ */
+ Map<String, Object> forkSettings = [run:false, test:false, console:false, shell:false]
+
/** Implementation of the "grailsScript()" method used in Grails scripts. */
Closure getGrailsScriptClosure() {
return new OwnerlessClosure() {
@@ -380,6 +400,8 @@ class BuildSettings extends AbstractBuildSettings {
*/
boolean offline = false
+ boolean logScriptTiming = false
+
GrailsCoreDependencies coreDependencies
private List<File> compileDependencies = []
@@ -392,6 +414,7 @@ class BuildSettings extends AbstractBuildSettings {
private List<File> internalPluginProvidedDependencies = []
/** List containing the compile-time dependencies of the app as File instances. */
+ @CompileStatic
List<File> getCompileDependencies() {
if (!defaultCompileDepsAdded) {
compileDependencies += defaultCompileDependencies
@@ -403,6 +426,7 @@ class BuildSettings extends AbstractBuildSettings {
/**
* Sets the compile time dependencies for the project
*/
+ @CompileStatic
void setCompileDependencies(List<File> deps) {
def jarFiles = findAndRemovePluginDependencies("compile", deps, internalPluginCompileDependencies)
compileDependencies = jarFiles
@@ -445,6 +469,7 @@ class BuildSettings extends AbstractBuildSettings {
return jarFiles
}()
+
private List<File> findAndRemovePluginDependencies(String scope, List<File> jarFiles, List<File> scopePluginDependencies) {
jarFiles = jarFiles?.findAll { it != null} ?: []
def pluginZips = jarFiles.findAll { it.name.endsWith(".zip") }
@@ -463,6 +488,7 @@ class BuildSettings extends AbstractBuildSettings {
private boolean defaultTestDepsAdded = false
/** List containing the test-time dependencies of the app as File instances. */
+ @CompileStatic
List<File> getTestDependencies() {
if (!defaultTestDepsAdded) {
testDependencies += defaultTestDependencies
@@ -474,6 +500,7 @@ class BuildSettings extends AbstractBuildSettings {
/**
* Sets the test time dependencies for the project
*/
+ @CompileStatic
void setTestDependencies(List<File> deps) {
def jarFiles = findAndRemovePluginDependencies("test", deps, internalPluginTestDependencies)
@@ -506,6 +533,7 @@ class BuildSettings extends AbstractBuildSettings {
private boolean defaultRuntimeDepsAdded = false
/** List containing the runtime dependencies of the app as File instances. */
+ @CompileStatic
List<File> getRuntimeDependencies() {
if (!defaultRuntimeDepsAdded) {
runtimeDependencies += defaultRuntimeDependencies
@@ -517,6 +545,7 @@ class BuildSettings extends AbstractBuildSettings {
/**
* Sets the runtime dependencies for the project
*/
+ @CompileStatic
void setRuntimeDependencies(List<File> deps) {
def jarFiles = findAndRemovePluginDependencies("runtime", deps, internalPluginRuntimeDependencies)
runtimeDependencies = jarFiles
@@ -547,6 +576,7 @@ class BuildSettings extends AbstractBuildSettings {
private boolean defaultProvidedDepsAdded = false
/** List containing the runtime dependencies of the app as File instances. */
+ @CompileStatic
List<File> getProvidedDependencies() {
if (!defaultProvidedDepsAdded) {
providedDependencies += defaultProvidedDependencies
@@ -558,6 +588,7 @@ class BuildSettings extends AbstractBuildSettings {
/**
* Sets the runtime dependencies for the project
*/
+ @CompileStatic
void setProvidedDependencies(List<File> deps) {
def jarFiles = findAndRemovePluginDependencies("provided", deps, internalPluginProvidedDependencies)
providedDependencies = jarFiles
@@ -588,6 +619,7 @@ class BuildSettings extends AbstractBuildSettings {
private boolean defaultBuildDepsAdded = false
/** List containing the runtime dependencies of the app as File instances. */
+ @CompileStatic
List<File> getBuildDependencies() {
if (!defaultBuildDepsAdded) {
buildDependencies += defaultBuildDependencies
@@ -601,6 +633,7 @@ class BuildSettings extends AbstractBuildSettings {
*
* @return A list of the source zips
*/
+ @CompileStatic
List<File> getPluginCompileDependencies() {
// ensure initialization
if (!internalPluginCompileDependencies) {
@@ -615,6 +648,7 @@ class BuildSettings extends AbstractBuildSettings {
*
* @return A list of the source zips
*/
+ @CompileStatic
List<File> getPluginProvidedDependencies() {
// ensure initialization
if (!internalPluginProvidedDependencies) {
@@ -628,6 +662,7 @@ class BuildSettings extends AbstractBuildSettings {
*
* @return A list of the source zips
*/
+ @CompileStatic
List<File> getPluginRuntimeDependencies() {
// ensure initialization
if (!internalPluginRuntimeDependencies) {
@@ -642,6 +677,7 @@ class BuildSettings extends AbstractBuildSettings {
*
* @return A list of the source zips
*/
+ @CompileStatic
List<File> getPluginTestDependencies() {
// ensure initialization
if (!internalPluginTestDependencies) {
@@ -656,6 +692,7 @@ class BuildSettings extends AbstractBuildSettings {
*
* @return A list of the source zips
*/
+ @CompileStatic
List<File> getPluginBuildDependencies() {
// ensure initialization
if (!internalPluginBuildDependencies) {
@@ -668,6 +705,7 @@ class BuildSettings extends AbstractBuildSettings {
/**
* Sets the runtime dependencies for the project
*/
+ @CompileStatic
void setBuildDependencies(List<File> deps) {
def jarFiles = findAndRemovePluginDependencies("build", deps, internalPluginBuildDependencies)
buildDependencies = jarFiles
@@ -733,10 +771,12 @@ class BuildSettings extends AbstractBuildSettings {
private boolean docsOutputDirSet
private boolean testSourceDirSet
private boolean projectWarFileSet
+ private boolean autodeployDirSet
private boolean projectWarOsgiHeadersSet
private boolean buildListenersSet
private boolean verboseCompileSet
private boolean convertClosuresArtefactsSet
+ private boolean logScriptTimingSet
private String resolveChecksum
private Map resolveCache = new ConcurrentHashMap()
private boolean readFromCache = false
@@ -782,13 +822,14 @@ class BuildSettings extends AbstractBuildSettings {
// otherwise it loads the script class using the Gant classloader.
}
+ @CompileStatic
void storeDependencyCache() {
projectWorkDir.mkdirs()
if (resolveChecksum) {
try {
if (resolveCache.size() == 5 && !readFromCache) {
def cachedResolve = new File(projectWorkDir, "${resolveChecksum}.resolve")
- cachedResolve.withOutputStream { output ->
+ cachedResolve.withOutputStream { OutputStream output ->
new ObjectOutputStream(output).writeObject(resolveCache)
}
}
@@ -799,6 +840,7 @@ class BuildSettings extends AbstractBuildSettings {
}
}
+ @CompileStatic
protected def loadBuildPropertiesFromClasspath(Properties buildProps) {
InputStream stream = getClass().classLoader.getResourceAsStream("grails.build.properties")
if (stream == null) {
@@ -823,6 +865,7 @@ class BuildSettings extends AbstractBuildSettings {
* they have been set manually by the caller, then that information
* will be lost!</p>
*/
+ @CompileStatic
void setBaseDir(File newBaseDir) {
baseDir = newBaseDir ?: establishBaseDir()
// Initialize Metadata
@@ -887,6 +930,11 @@ class BuildSettings extends AbstractBuildSettings {
convertClosuresArtefactsSet = true
}
+ void setLogScriptTiming(boolean b) {
+ logScriptTiming = b
+ logScriptTimingSet = true
+ }
+
boolean getProjectWarOsgiHeaders() { projectWarOsgiHeaders }
void setProjectWarOsgiHeaders(boolean flag) {
@@ -983,19 +1031,18 @@ class BuildSettings extends AbstractBuildSettings {
* corresponding config object. If the file does not exist, this
* returns an empty config.
*/
+ @CompileStatic
ConfigObject loadConfig(File configFile) {
try {
loadSettingsFile()
if (configFile.exists()) {
- // To avoid class loader issues, we make sure that the
- // Groovy class loader used to parse the config file has
- // the root loader as its parent. Otherwise we get something
- // like NoClassDefFoundError for Script.
+ // To avoid class loader issues, we make sure that the Groovy class loader used to parse the config file has
+ // the root loader as its parent. Otherwise we get something like NoClassDefFoundError for Script.
GroovyClassLoader gcl = obtainGroovyClassLoader()
ConfigSlurper slurper = createConfigSlurper()
URL configUrl = configFile.toURI().toURL()
- Script script = gcl.parseClass(configFile)?.newInstance()
+ Script script = (Script)gcl.parseClass(configFile)?.newInstance()
config.setConfigFile(configUrl)
loadConfig(slurper.parse(script))
@@ -1009,6 +1056,7 @@ class BuildSettings extends AbstractBuildSettings {
}
}
+ @CompileStatic
ConfigObject loadConfig(ConfigObject config) {
try {
this.config.merge(config)
@@ -1052,7 +1100,6 @@ class BuildSettings extends AbstractBuildSettings {
return
}
-
if (dependencyMap?.isEmpty()) {
modified = true
}
@@ -1067,7 +1114,7 @@ class BuildSettings extends AbstractBuildSettings {
compileDeps = findAndRemovePluginDependencies("compile", compileDeps, internalPluginCompileDependencies)
if (compileDeps.any({ File f -> !f.exists() })) modified = true
internalCompileDependencies = compileDeps
- }else {
+ } else {
modified = true
}
@@ -1075,7 +1122,7 @@ class BuildSettings extends AbstractBuildSettings {
runtimeDeps = findAndRemovePluginDependencies("runtime", runtimeDeps, internalPluginRuntimeDependencies)
if (runtimeDeps.any({ File f -> !f.exists() })) modified = true
internalRuntimeDependencies = runtimeDeps
- }else {
+ } else {
modified = true
}
@@ -1083,7 +1130,7 @@ class BuildSettings extends AbstractBuildSettings {
testDeps = findAndRemovePluginDependencies("test", testDeps, internalPluginTestDependencies)
if (testDeps.any({ File f -> !f.exists() })) modified = true
internalTestDependencies = testDeps
- }else {
+ } else {
modified = true
}
@@ -1091,7 +1138,7 @@ class BuildSettings extends AbstractBuildSettings {
buildDeps = findAndRemovePluginDependencies("build", buildDeps, internalPluginBuildDependencies)
if (buildDeps.any({ File f -> !f.exists() })) modified = true
internalBuildDependencies = buildDeps
- }else {
+ } else {
modified = true
}
@@ -1099,7 +1146,7 @@ class BuildSettings extends AbstractBuildSettings {
providedDeps = findAndRemovePluginDependencies("provided", providedDeps, internalPluginProvidedDependencies)
if (providedDeps.any({ File f -> !f.exists() })) modified = true
internalProvidedDependencies = providedDeps
- }else {
+ } else {
modified = true
}
@@ -1123,13 +1170,14 @@ class BuildSettings extends AbstractBuildSettings {
protected boolean settingsFileLoaded = false
+ @CompileStatic
protected ConfigObject loadSettingsFile() {
if (!settingsFileLoaded) {
def settingsFile = new File("$userHome/.grails/settings.groovy")
def gcl = obtainGroovyClassLoader()
def slurper = createConfigSlurper()
if (settingsFile.exists()) {
- Script script = gcl.parseClass(settingsFile)?.newInstance()
+ Script script = (Script)gcl.parseClass(settingsFile)?.newInstance()
if (script) {
config = slurper.parse(script)
}
@@ -1139,18 +1187,18 @@ class BuildSettings extends AbstractBuildSettings {
if (proxySettingsFile.exists()) {
slurper = createConfigSlurper()
try {
- Script script = gcl.parseClass(proxySettingsFile)?.newInstance()
+ Script script = (Script)gcl.parseClass(proxySettingsFile)?.newInstance()
if (script) {
proxySettings = slurper.parse(script)
def current = proxySettings.currentProxy
if (current) {
- proxySettings[current]?.each { key, value ->
+ proxySettings[current]?.each { String key, String value ->
System.setProperty(key, value)
}
}
}
}
- catch (e) {
+ catch (Throwable e) {
CONSOLE.error "WARNING: Error configuring proxy settings: ${e.message}", e
}
}
@@ -1188,7 +1236,7 @@ class BuildSettings extends AbstractBuildSettings {
switch (e.eventType) {
case TransferEvent.TRANSFER_STARTED:
def resourceName = e.resource.name
- if(!resourceName?.endsWith('plugins-list.xml')) {
+ if (!resourceName?.endsWith('plugins-list.xml')) {
resourceName = resourceName[resourceName.lastIndexOf('/') + 1..-1]
console.updateStatus "Downloading: ${resourceName}"
}
@@ -1269,14 +1317,14 @@ class BuildSettings extends AbstractBuildSettings {
// 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)) {
+ if (!isRegisteredInMetadata(pluginName) && notDefinedInBuildConfig(pluginName) && !isInlinePluginLocation(dir)) {
return
}
def pdd = dependencyManager.getPluginDependencyDescriptor(pluginName)
- if(isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
+ if (isInlinePluginLocation(dir) || (pdd && pdd.transitive)) {
// bail out of the dependencies handled by external tool
- if(isDependenciesExternallyConfigured()) return
+ if (isDependenciesExternallyConfigured()) return
// Try BuildConfig.groovy first, which should work
// work for in-place plugins.
def path = dir.absolutePath
@@ -1335,13 +1383,19 @@ class BuildSettings extends AbstractBuildSettings {
return slurper
}
+ @CompileStatic
private void establishProjectStructure() {
// The third argument to "getPropertyValue()" is either the
// existing value of the corresponding field, or if that's
// null, a default value. This ensures that we don't override
// settings provided by, for example, the Maven plugin.
def props = config.toProperties()
- def metadata = Metadata.current
+
+ final forkConfig = getForkConfig()
+ if ((forkConfig instanceof Map) && forkConfig) {
+ forkSettings = (Map)forkConfig
+ }
+ Metadata metadata = Metadata.getCurrent()
offline = Boolean.valueOf(getPropertyValue(OFFLINE_MODE, props, String.valueOf(offline)))
@@ -1359,10 +1413,7 @@ class BuildSettings extends AbstractBuildSettings {
}
if (!projectTargetDirSet) {
- projectTargetDir = new File(getPropertyValue(PROJECT_TARGET_DIR, props, "$baseDir/target"))
- if(!projectTargetDir.absolute) {
- projectTargetDir = new File(baseDir, projectTargetDir.path)
- }
+ projectTargetDir = makeAbsolute(new File(getPropertyValue(PROJECT_TARGET_DIR, props, "$baseDir/target")))
}
if (!projectWarFileSet) {
@@ -1370,10 +1421,11 @@ class BuildSettings extends AbstractBuildSettings {
def appName = metadata.getApplicationName() ?: baseDir.name
def warName = version ? "$baseDir/target/${appName}-${version}.war" : "$baseDir/target/${appName}.war"
- projectWarFile = new File(getPropertyValue(PROJECT_WAR_FILE, props, warName))
- if(!projectWarFile.absolute) {
- projectWarFile = new File(baseDir, projectWarFile.path)
- }
+ projectWarFile = makeAbsolute(new File(getPropertyValue(PROJECT_WAR_FILE, props, warName)))
+ }
+
+ if (!autodeployDirSet) {
+ autodeployDir = makeAbsolute(new File(getPropertyValue(PROJECT_AUTODEPLOY_DIR, props, "$baseDir/src/autodeploy")))
}
if (!projectWarExplodedDirSet) {
@@ -1382,7 +1434,10 @@ class BuildSettings extends AbstractBuildSettings {
if (!convertClosuresArtefactsSet) {
convertClosuresArtefacts = getPropertyValue(CONVERT_CLOSURES_KEY, props, 'false').toBoolean()
- System.setProperty(CONVERT_CLOSURES_KEY, "$convertClosuresArtefacts")
+ }
+
+ if (!logScriptTimingSet) {
+ logScriptTiming = getPropertyValue(LOG_SCRIPT_TIMING_KEY, props, 'false').toBoolean()
}
if (!projectWarOsgiHeadersSet) {
@@ -1390,42 +1445,23 @@ class BuildSettings extends AbstractBuildSettings {
}
if (!classesDirSet) {
- classesDir = new File(getPropertyValue(PROJECT_CLASSES_DIR, props, "$projectWorkDir/classes"))
- if(!classesDir.absolute) {
- classesDir = new File(baseDir, classesDir.path)
- }
+ classesDir = makeAbsolute(new File(getPropertyValue(PROJECT_CLASSES_DIR, props, "$projectWorkDir/classes")))
}
if (!testClassesDirSet) {
- testClassesDir = new File(getPropertyValue(PROJECT_TEST_CLASSES_DIR, props, "$projectWorkDir/test-classes"))
- if(!testClassesDir.absolute) {
- testClassesDir = new File(baseDir, testClassesDir.path)
- }
-
+ testClassesDir = makeAbsolute(new File(getPropertyValue(PROJECT_TEST_CLASSES_DIR, props, "$projectWorkDir/test-classes")))
}
if (!pluginClassesDirSet) {
- pluginClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_CLASSES_DIR, props, "$projectWorkDir/plugin-classes"))
- if(!pluginClassesDir.absolute) {
- pluginClassesDir = new File(baseDir, pluginClassesDir.path)
- }
-
+ pluginClassesDir = makeAbsolute(new File(getPropertyValue(PROJECT_PLUGIN_CLASSES_DIR, props, "$projectWorkDir/plugin-classes")))
}
if (!pluginBuildClassesDirSet) {
- pluginBuildClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_BUILD_CLASSES_DIR, props, "$projectWorkDir/plugin-build-classes"))
- if(!pluginBuildClassesDir.absolute) {
- pluginBuildClassesDir = new File(baseDir, pluginBuildClassesDir.path)
- }
-
+ pluginBuildClassesDir = makeAbsolute(new File(getPropertyValue(PROJECT_PLUGIN_BUILD_CLASSES_DIR, props, "$projectWorkDir/plugin-build-classes")))
}
if (!pluginProvidedClassesDirSet) {
- pluginProvidedClassesDir = new File(getPropertyValue(PROJECT_PLUGIN_PROVIDED_CLASSES_DIR, props, "$projectWorkDir/plugin-provided-classes"))
- if(!pluginProvidedClassesDir.absolute) {
- pluginProvidedClassesDir = new File(baseDir, pluginProvidedClassesDir.path)
- }
-
+ pluginProvidedClassesDir = makeAbsolute(new File(getPropertyValue(PROJECT_PLUGIN_PROVIDED_CLASSES_DIR, props, "$projectWorkDir/plugin-provided-classes")))
}
if (!resourcesDirSet) {
@@ -1449,17 +1485,11 @@ class BuildSettings extends AbstractBuildSettings {
}
if (!testReportsDirSet) {
- testReportsDir = new File(getPropertyValue(PROJECT_TEST_REPORTS_DIR, props, "${projectTargetDir}/test-reports"))
- if(!testReportsDir.absolute) {
- testReportsDir = new File(baseDir, testReportsDir.path)
- }
+ testReportsDir = makeAbsolute(new File(getPropertyValue(PROJECT_TEST_REPORTS_DIR, props, "${projectTargetDir}/test-reports")))
}
if (!docsOutputDirSet) {
- docsOutputDir = new File(getPropertyValue(PROJECT_DOCS_OUTPUT_DIR, props, "${projectTargetDir}/docs"))
- if(!docsOutputDir.absolute) {
- docsOutputDir = new File(baseDir, docsOutputDir.path)
- }
+ docsOutputDir = makeAbsolute(new File(getPropertyValue(PROJECT_DOCS_OUTPUT_DIR, props, "${projectTargetDir}/docs")))
}
if (!testSourceDirSet) {
@@ -1471,6 +1501,17 @@ class BuildSettings extends AbstractBuildSettings {
}
}
+ private getForkConfig() {
+ config.grails.project.fork
+ }
+
+ protected File makeAbsolute(File dir) {
+ if (!dir.absolute) {
+ dir = new File(baseDir, dir.path)
+ }
+ dir
+ }
+
protected void parseGrailsBuildListeners() {
if (buildListenersSet) {
return
@@ -1493,7 +1534,8 @@ class BuildSettings extends AbstractBuildSettings {
buildListenersSet = true
}
- private getPropertyValue(String propertyName, Properties props, String defaultValue) {
+ @CompileStatic
+ private String getPropertyValue(String propertyName, Properties props, String defaultValue) {
// First check whether we have a system property with the given name.
def value = getValueFromSystemOrBuild(propertyName, props)
@@ -1502,6 +1544,7 @@ class BuildSettings extends AbstractBuildSettings {
return value != null ? value : defaultValue
}
+ @CompileStatic
private getValueFromSystemOrBuild(String propertyName, Properties props) {
def value = System.getProperty(propertyName)
if (value != null) return value
@@ -1511,6 +1554,7 @@ class BuildSettings extends AbstractBuildSettings {
return value
}
+ @CompileStatic
private File establishBaseDir() {
def sysProp = System.getProperty(APP_BASE_DIR)
def baseDir
View
13 grails-bootstrap/src/main/groovy/grails/util/BuildSettingsHolder.java
@@ -15,6 +15,8 @@
*/
package grails.util;
+import org.codehaus.groovy.grails.plugins.GrailsPluginUtils;
+
/**
* Static singleton holder for the BuildSettings instance. Should only
* be initialised once (in {@link org.codehaus.groovy.grails.cli.GrailsScriptRunner}.
@@ -29,6 +31,17 @@ public static BuildSettings getSettings() {
public static void setSettings(BuildSettings newSettings) {
settings = newSettings;
+ try {
+ // test if classpath has been initialized already
+ Class.forName("org.springframework.core.io.Resource");
+ if(settings != null) {
+ GrailsPluginUtils.getPluginBuildSettings(settings);
+ } else {
+ GrailsPluginUtils.setPluginBuildSettings(null);
+ }
+ } catch (ClassNotFoundException e) {
+ // ignore error that comes in Grails startup before the classpath has been initialized
+ }
}
private BuildSettingsHolder() {
View
46 grails-bootstrap/src/main/groovy/grails/util/Environment.java
@@ -23,7 +23,6 @@
import java.util.Map;
import org.codehaus.groovy.runtime.DefaultGroovyMethods;
-import org.springframework.util.StringUtils;
/**
* Represents the current environment.
@@ -162,7 +161,7 @@ public static Environment getCurrentEnvironment() {
/**
* Returns true if the application is running in development mode (within grails run-app)
- * @return True if the application is running in development mode
+ * @return true if the application is running in development mode
*/
public static boolean isDevelopmentMode() {
return getCurrent() == DEVELOPMENT && !(Metadata.getCurrent().isWarDeployed()) &&
@@ -171,15 +170,23 @@ public static boolean isDevelopmentMode() {
/**
* Check whether the application is deployed
- * @return True if is
+ * @return true if is
*/
public static boolean isWarDeployed() {
return Metadata.getCurrent().isWarDeployed();
}
/**
+ * Whether this is a fork of the Grails command line environment
+ * @return True if it is a fork
+ */
+ public static boolean isFork() {
+ return Boolean.getBoolean("grails.fork.active");
+ }
+
+ /**
* Returns whether the environment is running within the Grails shell (executed via the 'grails' command line in a terminal window)
- * @return True if is
+ * @return true if is
*/
public static boolean isWithinShell() {
return DefaultGroovyMethods.getRootLoader(Environment.class.getClassLoader()) != null;
@@ -315,7 +322,7 @@ Object execute() {
}
private EnvironmentBlockEvaluator(Environment e) {
- this.current = e;
+ current = e;
}
@SuppressWarnings("unused")
@@ -328,19 +335,19 @@ public void environments(Closure<?> c) {
@SuppressWarnings("unused")
public void production(Closure<?> c) {
if (current == Environment.PRODUCTION) {
- this.callable = c;
+ callable = c;
}
}
@SuppressWarnings("unused")
public void development(Closure<?> c) {
if (current == Environment.DEVELOPMENT) {
- this.callable = c;
+ callable = c;
}
}
@SuppressWarnings("unused")
public void test(Closure<?> c) {
if (current == Environment.TEST) {
- this.callable = c;
+ callable = c;
}
}
@@ -349,7 +356,7 @@ public Object methodMissing(String name, Object args) {
Object[] argsArray = (Object[])args;
if (args != null && argsArray.length > 0 && (argsArray[0] instanceof Closure)) {
if (current == Environment.CUSTOM && current.getName().equals(name)) {
- this.callable = (Closure<?>) argsArray[0];
+ callable = (Closure<?>) argsArray[0];
}
return null;
}
@@ -383,7 +390,7 @@ public boolean isReloadEnabled() {
final boolean reloadOverride = Boolean.getBoolean(RELOAD_ENABLED);
final String reloadLocation = getReloadLocationInternal();
- final boolean reloadLocationSpecified = StringUtils.hasLength(reloadLocation);
+ final boolean reloadLocationSpecified = hasLocation(reloadLocation);
return this == DEVELOPMENT && reloadLocationSpecified && !Metadata.getCurrent().isWarDeployed() ||
reloadOverride && reloadLocationSpecified;
}
@@ -403,12 +410,12 @@ public static boolean isInteractiveMode() {
public static boolean isInitializing() {
return initializingState;
}
-
+
public static void setInitializing(boolean initializing) {
- initializingState=initializing;
+ initializingState = initializing;
System.setProperty(INITIALIZING, String.valueOf(initializing));
}
-
+
/**
* @return true if the reloading agent is active
*/
@@ -427,23 +434,28 @@ public static boolean isReloadingAgentEnabled() {
*/
public String getReloadLocation() {
String location = getReloadLocationInternal();
- if (StringUtils.hasLength(location)) {
+ if (hasLocation(location)) {
return location;
}
return "."; // default to the current directory
}
+ private boolean hasLocation(String location) {
+ return location != null && location.length() > 0;
+ }
+
/**
* @return Whether a reload location is specified
*/
public boolean hasReloadLocation() {
- return StringUtils.hasLength(getReloadLocationInternal());
+ String reloadingLocation = getReloadLocationInternal();
+ return hasLocation(reloadingLocation);
}
private String getReloadLocationInternal() {
String location = System.getProperty(RELOAD_LOCATION);
- if (!StringUtils.hasLength(location)) location = System.getProperty(BuildSettings.APP_BASE_DIR);
- if (!StringUtils.hasLength(location)) {
+ if (!hasLocation(location)) location = System.getProperty(BuildSettings.APP_BASE_DIR);
+ if (!hasLocation(location)) {
BuildSettings settings = BuildSettingsHolder.getSettings();
if (settings != null) {
location = settings.getBaseDir().getAbsolutePath();
View
2  grails-bootstrap/src/main/groovy/grails/util/Metadata.java
@@ -56,7 +56,7 @@ private Metadata() {
}
private Metadata(File f) {
- this.metadataFile = f;
+ metadataFile = f;
loadFromFile(f);
}
View
241 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
@@ -14,22 +14,23 @@
*/
package grails.util
+import groovy.transform.CompileStatic
import groovy.util.slurpersupport.GPathResult
import java.util.concurrent.ConcurrentHashMap
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
-import org.apache.commons.lang.ArrayUtils
+import org.codehaus.groovy.grails.io.support.AntPathMatcher
+import org.codehaus.groovy.grails.io.support.FileSystemResource
+import org.codehaus.groovy.grails.io.support.IOUtils
+import org.codehaus.groovy.grails.io.support.PathMatchingResourcePatternResolver
+import org.codehaus.groovy.grails.io.support.Resource
import org.codehaus.groovy.grails.plugins.BasicGrailsPluginInfo
import org.codehaus.groovy.grails.plugins.CompositePluginDescriptorReader
import org.codehaus.groovy.grails.plugins.GrailsPluginInfo
import org.codehaus.groovy.grails.plugins.PluginInfo
import org.codehaus.groovy.grails.plugins.build.scopes.PluginScopeInfo
-import org.springframework.core.io.FileSystemResource
-import org.springframework.core.io.Resource
-import org.springframework.core.io.support.PathMatchingResourcePatternResolver
-import org.springframework.util.AntPathMatcher
/**
* Uses the project BuildSettings object to discover information about the installed plugin
@@ -41,6 +42,7 @@ import org.springframework.util.AntPathMatcher
class PluginBuildSettings {
private static final List<String> PLUGIN_EXCLUDE_PATHS = ["views", "i18n"] // conf gets special handling
+
/**
* Resources to be excluded from the final packaged plugin. Defined as Ant paths.
*/
@@ -88,19 +90,22 @@ class PluginBuildSettings {
PluginScopeInfo providedScopePluginInfo = new PluginScopeInfo("provided")
PluginScopeInfo testScopePluginInfo = new PluginScopeInfo("test")
- private Map<String, PluginScopeInfo> pluginScopeInfoMap = [compile:compileScopePluginInfo, build:buildScopePluginInfo, provided: providedScopePluginInfo, test:testScopePluginInfo]
+ private Map<String, PluginScopeInfo> pluginScopeInfoMap = [
+ compile: compileScopePluginInfo,
+ build: buildScopePluginInfo,
+ provided: providedScopePluginInfo,
+ test: testScopePluginInfo]
PluginBuildSettings(BuildSettings buildSettings) {
this(buildSettings, null)
}
PluginBuildSettings(BuildSettings buildSettings, pluginManager) {
- // We use null-safe navigation on buildSettings because otherwise
- // lots of unit tests will fail.
+ // We use null-safe navigation on buildSettings because otherwise lots of unit tests will fail
this.buildSettings = buildSettings
this.pluginManager = pluginManager
- this.pluginDirPath = buildSettings?.projectPluginsDir?.absolutePath
- this.pluginLocations = buildSettings?.config?.grails?.plugin?.location
+ pluginDirPath = buildSettings?.projectPluginsDir?.absolutePath
+ pluginLocations = buildSettings?.config?.grails?.plugin?.location
if (buildSettings == null) {
return
@@ -122,6 +127,7 @@ class PluginBuildSettings {
testScopePluginInfo = testScopePluginInfo - compileScopePluginInfo
}
+ @CompileStatic
void registerNewPluginInstall(File zip) {
switch(zip) {
case buildSettings.pluginBuildDependencies:
@@ -139,31 +145,35 @@ class PluginBuildSettings {
case buildSettings.pluginProvidedDependencies:
registerPluginZipWithScope(zip, providedScopePluginInfo)
break
-
}
}
+ @CompileStatic
private populateSourceDirectories(PluginScopeInfo compileInfo, List<File> pluginDependencies) {
for (zip in pluginDependencies) {
registerPluginZipWithScope(zip, compileInfo)
}
}
- protected registerPluginZipWithScope(File pluginZip, PluginScopeInfo scopeInfo) {
+ protected void registerPluginZipWithScope(File pluginZip, PluginScopeInfo scopeInfo) {
def info = readPluginInfoFromZip(pluginZip.absolutePath)
- if (info != null) {
- def existingInfo = getPluginInfoForName(info.name)
- if (existingInfo != null && existingInfo.version == info.version)
- addPluginScopeInfoForDirAndInfo(scopeInfo, info, existingInfo.pluginDir)
+ if (info == null) {
+ return
+ }
+
+ def existingInfo = getPluginInfoForName(info.name)
+ if (existingInfo != null && existingInfo.version == info.version) {
+ addPluginScopeInfoForDirAndInfo(scopeInfo, info, existingInfo.pluginDir)
}
}
- protected def addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, Resource dir) {
+ @CompileStatic
+ protected void addPluginScopeInfoForDirAndInfo(PluginScopeInfo compileInfo, GrailsPluginInfo info, Resource dir) {
def excludedPaths = PLUGIN_EXCLUDE_PATHS // conf gets special handling
compileInfo.pluginInfos << info
compileInfo.pluginNames << info.name
compileInfo.sourceDirectories.addAll(
- getPluginSourceDirectories(dir.file.canonicalFile).findAll {
+ getPluginSourceDirectories(dir.file.canonicalFile).findAll { Resource it ->
!excludedPaths.contains(it.file.name) && it.file.isDirectory()
})
compileInfo.pluginDescriptors << getPluginDescriptor(dir)
@@ -185,10 +195,11 @@ class PluginBuildSettings {
/**
* Returns an array of PluginInfo objects
*/
- GrailsPluginInfo[] getPluginInfos(String pluginDirPath=this.pluginDirPath) {
+ GrailsPluginInfo[] getPluginInfos(String pluginDirPath = this.pluginDirPath) {
if (pluginInfosMap) {
- return cache['pluginInfoList']
+ return cache.pluginInfoList
}
+
def pluginInfos = []
Resource[] pluginDescriptors = getPluginDescriptors()
def pluginDescriptorReader = new CompositePluginDescriptorReader(this)
@@ -205,7 +216,7 @@ class PluginBuildSettings {
// ignore, not a valid plugin directory
}
}
- cache['pluginInfoList'] = pluginInfos as GrailsPluginInfo[]
+ cache.pluginInfoList = pluginInfos as GrailsPluginInfo[]
return pluginInfos as GrailsPluginInfo[]
}
@@ -219,14 +230,17 @@ class PluginBuildSettings {
/**
* Returns an array of the inplace plugin locations.
*/
+ @CompileStatic
Resource[] getInlinePluginDirectories() {
- def locations = cache['inlinePluginLocations']
+ Resource[] locations = (Resource[])cache['inlinePluginLocations']
if (locations == null) {
- if (buildSettings)
- locations = buildSettings.getInlinePluginDirectories().collect { new FileSystemResource(it) }
- else
+ if (buildSettings) {
+ locations = buildSettings.getInlinePluginDirectories().collect { File it -> new FileSystemResource(it) }
+ }
+ else {
locations = [] as Resource[]
+ }
cache['inlinePluginLocations'] = locations
}
@@ -236,22 +250,25 @@ class PluginBuildSettings {
/**
* Obtains a PluginInfo for the installed plugin directory.
*/
+ @CompileStatic
GrailsPluginInfo getPluginInfo(String pluginBaseDir) {
if (!pluginInfosMap) getPluginInfos() // initialize the infos
def dir = new FileSystemResource(pluginBaseDir)
def descLocation = getDescriptorForPlugin(dir)
if (descLocation) {
def pluginName = GrailsNameUtils.getPluginName(descLocation.filename)
- return pluginInfosMap[pluginName]
+ return (GrailsPluginInfo)pluginInfosMap[pluginName]
}
+ return null
}
/**
* Obtains a PluginInfo for the installed plugin directory.
*/
+ @CompileStatic
GrailsPluginInfo getPluginInfoForName(String pluginName) {
if (!pluginInfosMap) getPluginInfos() // initialize the infos
- return pluginInfosMap[pluginName]
+ return (GrailsPluginInfo)pluginInfosMap[pluginName]
}
/**
@@ -262,38 +279,32 @@ class PluginBuildSettings {
return pluginInfoToSourceMap[sourceFile]
}
- def pluginDirs = getPluginDirectories()
- if (pluginDirs) {
- for (Resource pluginDir in pluginDirs) {
- def pluginPath = pluginDir.file.canonicalPath + File.separator
- def sourcePath = new File(sourceFile).canonicalPath
- if (sourcePath.startsWith(pluginPath)) {
- // Check the path of the source file relative to the