Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

ignoring test temporarily, as due to infrastructure issues it is not …

…able to run on the build server
  • Loading branch information...
commit 7995c9f2bc766c57c10f28a06313c191a3f204ad 0 parents
@graemerocher graemerocher authored
Showing with 27,544 additions and 0 deletions.
  1. +5 −0 .cvsignore
  2. +70 −0 .gitignore
  3. +13 −0 .springBeans
  4. +1 −0  INSTALL
  5. +203 −0 LICENSE
  6. +28 −0 README.md
  7. +330 −0 build.gradle
  8. +2 −0  build.properties
  9. +61 −0 buildSrc/src/main/groovy/org/grails/gradle/GrailsBuildPlugin.groovy
  10. +177 −0 dependencies.txt
  11. 0  gradle.properties
  12. +263 −0 gradle/assemble.gradle
  13. +123 −0 gradle/docs.gradle
  14. +29 −0 gradle/findbugs.gradle
  15. +130 −0 gradle/unit-test.gradle
  16. BIN  gradle/wrapper/gradle-wrapper.jar
  17. +6 −0 gradle/wrapper/gradle-wrapper.properties
  18. +164 −0 gradlew
  19. +90 −0 gradlew.bat
  20. +61 −0 grails-bootstrap/build.gradle
  21. +276 −0 grails-bootstrap/src/main/groovy/grails/ant/GrailsTask.java
  22. +26 −0 grails-bootstrap/src/main/groovy/grails/build/GrailsBuildListener.java
  23. +35 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateController.groovy
  24. +27 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateIntegrationTest.groovy
  25. +35 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateScaffoldController.groovy
  26. +35 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateService.groovy
  27. +35 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateTagLib.groovy
  28. +27 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/CreateUnitTest.groovy
  29. +45 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/EscapingFileNameCompletor.groovy
  30. +37 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateAll.groovy
  31. +37 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateController.groovy
  32. +37 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/GenerateViews.groovy
  33. +17 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/Open.groovy
  34. +41 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/RegexCompletor.groovy
  35. +42 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/SimpleOrFileNameCompletor.groovy
  36. +28 −0 grails-bootstrap/src/main/groovy/grails/build/interactive/completors/TestApp.groovy
  37. +806 −0 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsConsole.java
  38. +94 −0 grails-bootstrap/src/main/groovy/grails/build/logging/GrailsEclipseConsole.java
  39. +260 −0 grails-bootstrap/src/main/groovy/grails/util/AbstractBuildSettings.java
  40. +85 −0 grails-bootstrap/src/main/groovy/grails/util/BuildScope.java
  41. +1,567 −0 grails-bootstrap/src/main/groovy/grails/util/BuildSettings.groovy
  42. +37 −0 grails-bootstrap/src/main/groovy/grails/util/BuildSettingsHolder.java
  43. +69 −0 grails-bootstrap/src/main/groovy/grails/util/CollectionUtils.java
  44. +70 −0 grails-bootstrap/src/main/groovy/grails/util/CosineSimilarity.groovy
  45. +454 −0 grails-bootstrap/src/main/groovy/grails/util/Environment.java
  46. +31 −0 grails-bootstrap/src/main/groovy/grails/util/GrailsMain.groovy
  47. +395 −0 grails-bootstrap/src/main/groovy/grails/util/GrailsNameUtils.java
  48. +79 −0 grails-bootstrap/src/main/groovy/grails/util/Holder.java
  49. +338 −0 grails-bootstrap/src/main/groovy/grails/util/Metadata.java
  50. +854 −0 grails-bootstrap/src/main/groovy/grails/util/PluginBuildSettings.groovy
  51. +33 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CachedScript.java
  52. +83 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineHelper.java
  53. +48 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/CommandLineInputHandler.java
  54. +83 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GenerateStubsTask.java
  55. +836 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  56. +32 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/ScriptExitException.java
  57. +39 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/ScriptNameResolver.groovy
  58. +28 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/ScriptNotFoundException.java
  59. +351 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/api/BaseSettingsApi.java
  60. +116 −0 ...ls-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/CandidateListCompletionHandler.java
  61. +91 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/GrailsInteractiveCompletor.groovy
  62. +287 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/InteractiveMode.groovy
  63. +62 −0 ...s-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/interactive/completors/ClassNameCompletor.groovy
  64. +128 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleAntBuilder.java
  65. +106 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleBuildListener.java
  66. +62 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsoleErrorPrintStream.java
  67. +62 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/logging/GrailsConsolePrintStream.java
  68. +134 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/maven/MavenMultiProjectGenerator.groovy
  69. +87 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/maven/MavenPomGenerator.groovy
  70. +98 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLine.java
  71. +212 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParser.java
  72. +174 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/DefaultCommandLine.java
  73. +45 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/Option.java
  74. +35 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/parsing/ParseException.java
  75. +34 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/BuildSettingsAware.java
  76. +279 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ClasspathConfigurer.java
  77. +246 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsBuildEventListener.java
  78. +280 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsBuildHelper.java
  79. +49 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsRootLoader.java
  80. +270 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/GrailsStarter.java
  81. +45 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/JndiBindingHandler.java
  82. +153 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/JndiBindingSupport.java
  83. +174 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/MetaClassRegistryCleaner.java
  84. +28 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/OwnerlessClosure.java
  85. +89 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/PluginPathDiscoverySupport.java
  86. +264 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ScriptBindingInitializer.java
  87. +154 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegration.java
  88. +26 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/UaaIntegrationSupport.groovy
  89. +402 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/io/support/GrailsResourceUtils.java
  90. +137 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/AstPluginDescriptorReader.java
  91. +126 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/BasicGrailsPluginInfo.java
  92. +46 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/CompositePluginDescriptorReader.java
  93. +76 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginInfo.java
  94. +314 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsPluginUtils.groovy
  95. +184 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/GrailsVersionUtils.groovy
  96. +42 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/InvalidVersionException.java
  97. +29 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginDescriptorReader.java
  98. +126 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/PluginInfo.groovy
  99. +47 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/XmlPluginDescriptorReader.java
  100. +52 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/build/scopes/PluginScopeInfo.groovy
  101. +22 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/exceptions/PluginException.java
  102. +34 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/plugins/metadata/GrailsPlugin.java
  103. +853 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/AbstractIvyDependencyManager.java
  104. +35 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/DependencyDefinitionParser.java
  105. +41 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/DependencyResolver.java
  106. +149 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
  107. +340 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsCoreDependencies.java
  108. +63 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsPluginsDirectoryResolver.java
  109. +144 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepoResolver.java
  110. +86 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/GrailsRepository.java
  111. +406 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/IvyDependencyManager.groovy
  112. +50 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/LastModifiedResolvedResource.java
  113. +778 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngine.groovy
  114. +300 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngine.groovy
  115. +47 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/ResolveException.groovy
  116. +248 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/SnapshotAwareM2Resolver.java
  117. +242 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/AbstractDependenciesConfigurer.java
  118. +40 −0 ...strap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/AbstractDependencyManagementConfigurer.java
  119. +147 −0 ...ootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationConfigurer.groovy
  120. +97 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/DependencyConfigurationContext.java
  121. +50 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/InheritanceConfigurer.groovy
  122. +55 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/JarDependenciesConfigurer.java
  123. +68 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/PluginDependenciesConfigurer.java
  124. +263 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/config/RepositoriesConfigurer.groovy
  125. +252 −0 ...rc/main/groovy/org/codehaus/groovy/grails/resolve/maven/GrailsPackagingAwarePomModuleDescriptorBuilder.java
  126. +371 −0 grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/resolve/maven/PomModuleDescriptorParser.java
  127. +1 −0  grails-bootstrap/src/main/resources/grails.build.properties
  128. +40 −0 grails-bootstrap/src/test/groovy/grails/build/interactive/completors/RegexCompletorSpec.groovy
  129. +289 −0 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/cli/parsing/CommandLineParserSpec.groovy
  130. +149 −0 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/resolve/PluginInstallEngineSpec.groovy
  131. +50 −0 grails-bootstrap/src/test/groovy/org/codehaus/groovy/grails/resolve/PluginResolveEngineSpec.groovy
  132. +75 −0 grails-core/build.gradle
  133. +43 −0 grails-core/src/main/groovy/grails/artefact/ApiDelegate.java
  134. +37 −0 grails-core/src/main/groovy/grails/artefact/Artefact.java
  135. +36 −0 grails-core/src/main/groovy/grails/artefact/Enhanced.java
  136. +36 −0 grails-core/src/main/groovy/grails/persistence/Entity.java
  137. +45 −0 grails-core/src/main/groovy/grails/persistence/Event.java
  138. +49 −0 grails-core/src/main/groovy/grails/spring/WebBeanBuilder.java
  139. +90 −0 grails-core/src/main/groovy/grails/ui/Console.java
  140. +76 −0 grails-core/src/main/groovy/grails/util/ClosureToMapPopulator.java
  141. +69 −0 grails-core/src/main/groovy/grails/util/DomainBuilder.java
  142. +65 −0 grails-core/src/main/groovy/grails/util/ExtendedProxy.java
  143. +311 −0 grails-core/src/main/groovy/grails/util/GrailsUtil.java
  144. +189 −0 grails-core/src/main/groovy/grails/util/Holders.java
  145. +81 −0 grails-core/src/main/groovy/grails/validation/DeferredBindingActions.java
  146. +43 −0 grails-core/src/main/groovy/grails/validation/ValidationErrors.groovy
  147. +38 −0 grails-core/src/main/groovy/grails/validation/ValidationException.groovy
  148. +34 −0 grails-core/src/main/groovy/grails/web/Action.java
  149. +35 −0 grails-core/src/main/groovy/grails/web/CamelCaseUrlConverter.java
  150. +28 −0 grails-core/src/main/groovy/grails/web/HyphenatedUrlConverter.java
  151. +22 −0 grails-core/src/main/groovy/grails/web/UrlConverter.java
  152. +20 −0 ...oovy/org/codehaus/groovy/grails/aop/framework/autoproxy/GroovyAwareAspectJAwareAdvisorAutoProxyCreator.java
  153. +35 −0 ...vy/org/codehaus/groovy/grails/aop/framework/autoproxy/GroovyAwareInfrastructureAdvisorAutoProxyCreator.java
  154. +133 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/beans/factory/GenericBeanFactoryAccessor.java
  155. +46 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/cli/agent/GrailsPluginManagerReloadPlugin.java
  156. +313 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/AbstractGrailsClass.java
  157. +43 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/AbstractInjectableGrailsClass.java
  158. +59 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/AnnotationDomainClassArtefactHandler.java
  159. +25 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ApplicationAttributes.java
  160. +49 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ApplicationHolder.java
  161. +84 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandler.java
  162. +135 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactHandlerAdapter.java
  163. +73 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ArtefactInfo.java
  164. +29 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/BootstrapArtefactHandler.java
  165. +350 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ClassPropertyFetcher.java
  166. +35 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/CodecArtefactHandler.java
  167. +40 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ComponentCapableDomainClass.java
  168. +72 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ConfigurationHolder.java
  169. +107 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ControllerArtefactHandler.java
  170. +115 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultArtefactInfo.java
  171. +919 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java
  172. +70 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsBootstrapClass.java
  173. +40 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsClass.java
  174. +63 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsCodecClass.java
  175. +348 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsControllerClass.java
  176. +838 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClass.java
  177. +720 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsDomainClassProperty.java
  178. +60 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsServiceClass.java
  179. +87 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsTagLibClass.java
  180. +45 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DefaultGrailsUrlMappingsClass.java
  181. +107 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/DomainClassArtefactHandler.java
  182. +25 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/ExternalGrailsDomainClass.java
  183. +428 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplication.java
  184. +136 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsApplicationFactoryBean.java
  185. +53 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsBootstrapClass.java
  186. +151 −0 grails-core/src/main/groovy/org/codehaus/groovy/grails/commons/GrailsClass.java
Sorry, we could not display the entire diff because too many files (2,191) changed.
5 .cvsignore
@@ -0,0 +1,5 @@
+dist
+target
+classes
+test-classes
+etc
70 .gitignore
@@ -0,0 +1,70 @@
+/src
+/out
+/bin
+/conf
+/dsl-support
+*.ipr
+*.iml
+*.iws
+idea
+/lib
+/doc
+/cobertura.ser
+/cruise/coverage/report
+/downloads
+/test/groovy/grails/config
+/test/grails-app
+stacktrace.log
+/dist
+/idea-target
+target
+/build
+/grails.iws
+.gradle
+.DS_Store
+.classpath
+.project
+.settings
+/*/build/*
+/*/.settings/*
+/*/out/*
+/*/*.iml
+/eclipse-build
+
+/.idea/
+/grails-bootstrap/bin/
+/grails-core/bin/
+/grails-crud/bin/
+/grails-docs/bin/
+/grails-hibernate/bin/
+/grails-plugin-async/bin/
+/grails-plugin-codecs/bin/
+/grails-plugin-controllers/bin/
+/grails-plugin-converters/bin/
+/grails-plugin-datasource/bin/
+/grails-plugin-domain-class/bin/
+/grails-plugin-filters/bin/
+/grails-plugin-gsp/bin/
+/grails-plugin-i18n/bin/
+/grails-plugin-logging/bin/
+/grails-plugin-mimetypes/bin/
+/grails-plugin-scaffolding/bin/
+/grails-plugin-services/bin/
+/grails-plugin-servlets/bin/
+/grails-plugin-testing/bin/
+/grails-plugin-url-mappings/bin/
+/grails-plugin-validation/bin/
+/grails-scripts/bin/
+/grails-spring/bin/
+/grails-test-suite-base/bin/
+/grails-test-suite-persistence/bin/
+/grails-test-suite-uber/bin/
+/grails-test-suite-uber/configured/
+/grails-test-suite-web/bin/
+/grails-test/bin/
+/grails-web/bin/
+/grails-webflow/bin/
+/grails-wrapper/bin/
+/grails-plugin-log4j/bin/
+/grails-plugin-logging/bin/
+/grails-logging/bin/
13 .springBeans
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beansProjectDescription>
+ <version>1</version>
+ <pluginVersion><![CDATA[2.5.0.201010221000-RELEASE]]></pluginVersion>
+ <configSuffixes>
+ <configSuffix><![CDATA[xml]]></configSuffix>
+ </configSuffixes>
+ <enableImports><![CDATA[false]]></enableImports>
+ <configs>
+ </configs>
+ <configSets>
+ </configSets>
+</beansProjectDescription>
1  INSTALL
@@ -0,0 +1 @@
+For installation instructions see the manual in the docs subdirectory or online at <http://grails.org/Installation>.
203 LICENSE
@@ -0,0 +1,203 @@
+/*
+* Apache License
+* Version 2.0, January 2004
+* http://www.apache.org/licenses/
+*
+* TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+*
+* 1. Definitions.
+*
+* "License" shall mean the terms and conditions for use, reproduction,
+* and distribution as defined by Sections 1 through 9 of this document.
+*
+* "Licensor" shall mean the copyright owner or entity authorized by
+* the copyright owner that is granting the License.
+*
+* "Legal Entity" shall mean the union of the acting entity and all
+* other entities that control, are controlled by, or are under common
+* control with that entity. For the purposes of this definition,
+* "control" means (i) the power, direct or indirect, to cause the
+* direction or management of such entity, whether by contract or
+* otherwise, or (ii) ownership of fifty percent (50%) or more of the
+* outstanding shares, or (iii) beneficial ownership of such entity.
+*
+* "You" (or "Your") shall mean an individual or Legal Entity
+* exercising permissions granted by this License.
+*
+* "Source" form shall mean the preferred form for making modifications,
+* including but not limited to software source code, documentation
+* source, and configuration files.
+*
+* "Object" form shall mean any form resulting from mechanical
+* transformation or translation of a Source form, including but
+* not limited to compiled object code, generated documentation,
+* and conversions to other media types.
+*
+* "Work" shall mean the work of authorship, whether in Source or
+* Object form, made available under the License, as indicated by a
+* copyright notice that is included in or attached to the work
+* (an example is provided in the Appendix below).
+*
+* "Derivative Works" shall mean any work, whether in Source or Object
+* form, that is based on (or derived from) the Work and for which the
+* editorial revisions, annotations, elaborations, or other modifications
+* represent, as a whole, an original work of authorship. For the purposes
+* of this License, Derivative Works shall not include works that remain
+* separable from, or merely link (or bind by name) to the interfaces of,
+* the Work and Derivative Works thereof.
+*
+* "Contribution" shall mean any work of authorship, including
+* the original version of the Work and any modifications or additions
+* to that Work or Derivative Works thereof, that is intentionally
+* submitted to Licensor for inclusion in the Work by the copyright owner
+* or by an individual or Legal Entity authorized to submit on behalf of
+* the copyright owner. For the purposes of this definition, "submitted"
+* means any form of electronic, verbal, or written communication sent
+* to the Licensor or its representatives, including but not limited to
+* communication on electronic mailing lists, source code control systems,
+* and issue tracking systems that are managed by, or on behalf of, the
+* Licensor for the purpose of discussing and improving the Work, but
+* excluding communication that is conspicuously marked or otherwise
+* designated in writing by the copyright owner as "Not a Contribution."
+*
+* "Contributor" shall mean Licensor and any individual or Legal Entity
+* on behalf of whom a Contribution has been received by Licensor and
+* subsequently incorporated within the Work.
+*
+* 2. Grant of Copyright License. Subject to the terms and conditions of
+* this License, each Contributor hereby grants to You a perpetual,
+* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+* copyright license to reproduce, prepare Derivative Works of,
+* publicly display, publicly perform, sublicense, and distribute the
+* Work and such Derivative Works in Source or Object form.
+*
+* 3. Grant of Patent License. Subject to the terms and conditions of
+* this License, each Contributor hereby grants to You a perpetual,
+* worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+* (except as stated in this section) patent license to make, have made,
+* use, offer to sell, sell, import, and otherwise transfer the Work,
+* where such license applies only to those patent claims licensable
+* by such Contributor that are necessarily infringed by their
+* Contribution(s) alone or by combination of their Contribution(s)
+* with the Work to which such Contribution(s) was submitted. If You
+* institute patent litigation against any entity (including a
+* cross-claim or counterclaim in a lawsuit) alleging that the Work
+* or a Contribution incorporated within the Work constitutes direct
+* or contributory patent infringement, then any patent licenses
+* granted to You under this License for that Work shall terminate
+* as of the date such litigation is filed.
+*
+* 4. Redistribution. You may reproduce and distribute copies of the
+* Work or Derivative Works thereof in any medium, with or without
+* modifications, and in Source or Object form, provided that You
+* meet the following conditions:
+*
+* (a) You must give any other recipients of the Work or
+* Derivative Works a copy of this License; and
+*
+* (b) You must cause any modified files to carry prominent notices
+* stating that You changed the files; and
+*
+* (c) You must retain, in the Source form of any Derivative Works
+* that You distribute, all copyright, patent, trademark, and
+* attribution notices from the Source form of the Work,
+* excluding those notices that do not pertain to any part of
+* the Derivative Works; and
+*
+* (d) If the Work includes a "NOTICE" text file as part of its
+* distribution, then any Derivative Works that You distribute must
+* include a readable copy of the attribution notices contained
+* within such NOTICE file, excluding those notices that do not
+* pertain to any part of the Derivative Works, in at least one
+* of the following places: within a NOTICE text file distributed
+* as part of the Derivative Works; within the Source form or
+* documentation, if provided along with the Derivative Works; or,
+* within a display generated by the Derivative Works, if and
+* wherever such third-party notices normally appear. The contents
+* of the NOTICE file are for informational purposes only and
+* do not modify the License. You may add Your own attribution
+* notices within Derivative Works that You distribute, alongside
+* or as an addendum to the NOTICE text from the Work, provided
+* that such additional attribution notices cannot be construed
+* as modifying the License.
+*
+* You may add Your own copyright statement to Your modifications and
+* may provide additional or different license terms and conditions
+* for use, reproduction, or distribution of Your modifications, or
+* for any such Derivative Works as a whole, provided Your use,
+* reproduction, and distribution of the Work otherwise complies with
+* the conditions stated in this License.
+*
+* 5. Submission of Contributions. Unless You explicitly state otherwise,
+* any Contribution intentionally submitted for inclusion in the Work
+* by You to the Licensor shall be under the terms and conditions of
+* this License, without any additional terms or conditions.
+* Notwithstanding the above, nothing herein shall supersede or modify
+* the terms of any separate license agreement you may have executed
+* with Licensor regarding such Contributions.
+*
+* 6. Trademarks. This License does not grant permission to use the trade
+* names, trademarks, service marks, or product names of the Licensor,
+* except as required for reasonable and customary use in describing the
+* origin of the Work and reproducing the content of the NOTICE file.
+*
+* 7. Disclaimer of Warranty. Unless required by applicable law or
+* agreed to in writing, Licensor provides the Work (and each
+* Contributor provides its Contributions) on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+* implied, including, without limitation, any warranties or conditions
+* of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+* PARTICULAR PURPOSE. You are solely responsible for determining the
+* appropriateness of using or redistributing the Work and assume any
+* risks associated with Your exercise of permissions under this License.
+*
+* 8. Limitation of Liability. In no event and under no legal theory,
+* whether in tort (including negligence), contract, or otherwise,
+* unless required by applicable law (such as deliberate and grossly
+* negligent acts) or agreed to in writing, shall any Contributor be
+* liable to You for damages, including any direct, indirect, special,
+* incidental, or consequential damages of any character arising as a
+* result of this License or out of the use or inability to use the
+* Work (including but not limited to damages for loss of goodwill,
+* work stoppage, computer failure or malfunction, or any and all
+* other commercial damages or losses), even if such Contributor
+* has been advised of the possibility of such damages.
+*
+* 9. Accepting Warranty or Additional Liability. While redistributing
+* the Work or Derivative Works thereof, You may choose to offer,
+* and charge a fee for, acceptance of support, warranty, indemnity,
+* or other liability obligations and/or rights consistent with this
+* License. However, in accepting such obligations, You may act only
+* on Your own behalf and on Your sole responsibility, not on behalf
+* of any other Contributor, and only if You agree to indemnify,
+* defend, and hold each Contributor harmless for any liability
+* incurred by, or claims asserted against, such Contributor by reason
+* of your accepting any such warranty or additional liability.
+*
+* END OF TERMS AND CONDITIONS
+*
+* APPENDIX: How to apply the Apache License to your work.
+*
+* To apply the Apache License to your work, attach the following
+* boilerplate notice, with the fields enclosed by brackets "[]"
+* replaced with your own identifying information. (Don't include
+* the brackets!) The text should be enclosed in the appropriate
+* comment syntax for the file format. We also recommend that a
+* file or class name and description of purpose be included on the
+* same "printed page" as the copyright notice for easier
+* identification within third-party archives.
+*
+* Copyright [yyyy] [name of copyright owner]
+*
+* 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.
+*/
28 README.md
@@ -0,0 +1,28 @@
+Grails
+===
+
+[Grails][Grails] is a framework used to build web applications with the [Groovy][Groovy] programming language. The core framework is very extensible and there are numerous [plugins][plugins] available that provide easy integration of add-on features.
+[Grails]: http://grails.org/
+[Groovy]: http://groovy.codehaus.org/
+[plugins]: http://grails.org/plugins/
+
+Getting Started
+---
+
+You need a Java Development Kit (JDK) installed, but it is not necessary to install Groovy because it's bundled with the Grails distribution.
+
+To install Grails, visit http://grails.org/Download and download the version you would like to use. Set a GRAILS_HOME environment variable to point to the root of the extracted download and add GRAILS_HOME/bin to your executable PATH. Then in a shell, type the following:
+
+ grails create-app sampleapp
+ cd sampleapp
+ grails run-app
+
+To build Grails, clone this GitHub repository and then in a shell, type the following:
+
+ ./gradlew install
+
+License
+---
+
+Grails and Groovy are licensed under the terms of the [Apache License, Version 2.0][Apache License, Version 2.0].
+[Apache License, Version 2.0]: http://www.apache.org/licenses/LICENSE-2.0.html
330 build.gradle
@@ -0,0 +1,330 @@
+import org.apache.tools.ant.filters.ReplaceTokens
+
+buildscript {
+ repositories {
+ maven { url "http://repo.grails.org/grails/core" }
+ //mavenRepo(urls: 'http://evgeny-goldin.org/artifactory/repo/')
+ }
+ dependencies {
+ 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'
+
+ext {
+ grailsVersion = '2.1.0.RC3'
+ isBuildSnapshot = grailsVersion.endsWith(".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.1"
+ commonsLangVersion = "2.6"
+ datastoreVersion = "1.0.9.RELEASE"
+ gantVersion = "1.9.6"
+ gdocEngineVersion = "1.0.1"
+ groovyVersion = "1.8.6"
+ 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 = "1.0.6"
+ springVersion = "3.1.0.RELEASE"
+ springWebflowVersion= "2.0.8.RELEASE"
+ hibernateVersion = "3.6.10.Final"
+ ehcacheVersion = "2.4.6"
+ junitVersion = "4.10"
+ concurrentlinkedhashmapVersion = "1.2_jdk5"
+}
+
+version = grailsVersion
+
+// directories created during the build which are related
+// to turning the workspace root into a GRAILS_HOME
+ext {
+ homeDistDir = file("dist")
+ homeBinDir = file("bin")
+ homeConfDir = file("conf")
+ homeDslSupportDir = file("dsl-support")
+ homeLibDir = file("lib")
+ homeSrcDir = file("src")
+}
+
+// Groovy is added as a dependency to both the 'groovy' and 'compile'
+// configurations, so place the dependency in a shared variable. The
+// 'compile' is required so that Groovy appears as a dependency in the
+// artifacts' POMs.
+ext.jointBuildGroovyJarProperty = System.getProperty('groovy.jar')
+ext.groovyDependency = null
+if (jointBuildGroovyJarProperty) {
+ jointBuildGroovyJar = file(jointBuildGroovyJarProperty)
+ if (jointBuildGroovyJar.exists()) {
+ groovyDependency = dependencies.create(files(jointBuildGroovyJar))
+ } else {
+ throw new GradleException("The groovy.jar system property points to ${jointBuildGroovyJar.absolutePath} which does not exist.")
+ }
+} else {
+ groovyDependency = dependencies.create("org.codehaus.groovy:groovy-all:${groovyVersion}") {
+ exclude module:"commons-cli"
+ exclude module:"ant"
+ }
+}
+
+allprojects {
+ repositories {
+ maven { url "http://repo.grails.org/grails/core" }
+ }
+
+ configurations {
+ all {
+ resolutionStrategy {
+ def cacheHours = isCiBuild ? 1 : 24
+ cacheDynamicVersionsFor cacheHours, 'hours'
+ cacheChangingModulesFor cacheHours, 'hours'
+ }
+ }
+ }
+}
+
+
+idea {
+ project {
+ jdkName "1.6"
+ ipr {
+ withXml { provider ->
+ def node = provider.asNode()
+ node.component.find { it.'@name' == 'VcsDirectoryMappings' }?.mapping[0].'@vcs' = 'Git'
+ }
+ }
+ }
+}
+subprojects { project ->
+ apply plugin: 'groovy'
+ apply plugin: 'maven'
+ apply plugin: 'eclipse'
+ apply plugin: 'idea'
+ apply plugin: 'project-report'
+ apply plugin: 'signing'
+ //apply plugin: 'duplicates'
+
+ sourceCompatibility = "1.5"
+ targetCompatibility = "1.5"
+ archivesBaseName = 'grails'
+ version = grailsVersion
+ group = "org.grails"
+
+ ext.isCiBuild = project.hasProperty("isCiBuild")
+
+ manifest.mainAttributes(
+ "Built-By": System.properties['user.name'],
+ "Created-By": System.properties['java.vm.version'] + " (" + System.properties['java.vm.vendor'] + ")",
+ "Implementation-Title": "Grails",
+ "Implementation-Version": grailsVersion,
+ "Implementation-Vendor": 'grails.org')
+
+
+ configure([compileGroovy, compileTestGroovy]) {
+ groovyOptions.fork(memoryInitialSize: '128M', memoryMaximumSize: '1G')
+ groovyOptions.encoding = "UTF-8"
+ }
+
+ configure([compileJava, compileTestJava]) {
+ options.deprecation = true
+ options.debug = true
+ }
+
+ 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 {
+ groovy groovyDependency
+
+ if (project.name != "grails-docs") {
+ // Logging
+ compile "org.slf4j:slf4j-api:$slf4jVersion"
+ compile "org.slf4j:jcl-over-slf4j:$slf4jVersion"
+
+ // Specs
+ compile 'javax.servlet:javax.servlet-api:3.0.1'
+ 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
+ }
+ }
+ }
+
+ test {
+ excludes = ["**/*TestCase.class", "**/*\$*.class"]
+ }
+
+ task sourcesJar(type: Jar) {
+ classifier = 'sources'
+ appendix = project.name[7..-1]
+ from sourceSets.main.allSource
+ }
+
+ task javadocJar(type: Jar, dependsOn:javadoc) {
+ classifier = 'javadoc'
+ appendix = project.name[7..-1]
+ from javadoc.destinationDir
+ }
+
+ groovydoc.doLast {
+ delete("${buildDir}/tmp")
+ }
+
+ configurations {
+ meta
+ published.extendsFrom archives, meta
+ all*.exclude group:'commons-logging', module: 'commons-logging'
+ }
+
+ artifacts {
+ archives jar
+ archives sourcesJar
+ archives javadocJar
+ }
+
+ signing {
+ sign configurations.archives
+ required { !isBuildSnapshot && gradle.taskGraph.hasTask(uploadPublished) }
+ }
+
+ uploadPublished {
+ repositories {
+ final url = project.version.endsWith("SNAPSHOT") ? "http://repo.grails.org/grails/libs-snapshots-local" :
+ "http://repo.grails.org/grails/libs-releases-local"
+
+ repositories {
+ mavenDeployer {
+ repository(url: url) {
+ 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);
+ }
+
+ authentication(userName: username, password: password)
+ }
+ }
+ project.ext.deployer = mavenDeployer {
+ beforeDeployment { MavenDeployment deployment -> signPom(deployment) }
+
+ repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
+ authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
+ password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
+ }
+ snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
+ authentication(userName: project.hasProperty("sonatypeUsername") ? project.sonatypeUsername : null,
+ password: project.hasProperty("sonatypePassword") ? project.sonatypePassword : null)
+ }
+
+ pom.project {
+ name 'Grails'
+ packaging 'jar'
+ description 'Grails Web Application Framework'
+ delegate.url 'http://grails.org/'
+
+ scm {
+ delegate.url 'scm:git@github.com:grails/grails-core.git'
+ connection 'scm:git@github.com:grails/grails-core.git'
+ developerConnection 'scm:git@github.com:grails/grails-core.git'
+ }
+
+ licenses {
+ license {
+ name 'The Apache Software License, Version 2.0'
+ delegate.url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
+ distribution 'repo'
+ }
+ }
+
+ developers {
+ developer {
+ id 'graemerocher'
+ name 'Graeme Rocher'
+ }
+ developer {
+ id 'jeffscottbrown'
+ name 'Jeff Brown'
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ Install a method that can be used to fine tune the poms, e.g…
+
+ modifyPom { pom ->
+ pom.dependencies.removeAll(pom.dependencies.findAll { it.scope == "test" })
+ }
+
+ Mods are run in order they are encountered in the build script.
+
+ The pom argument is of the following type:
+ http://maven.apache.org/ref/2.2.1/maven-model/apidocs/org/apache/maven/model/Model.html
+ */
+ ext {
+ poms = [project.install.repositories.mavenInstaller.pom, project.deployer.pom]
+ pomModifications = []
+ modifyPom = { Closure modification -> project.pomModifications << modification }
+ poms*.whenConfigured {
+ pomModifications*.call(it)
+ }
+ }
+
+ // Remove any dependencies that shouldn't be included in the POM
+ modifyPom { pom ->
+ configurations.runtime.allDependencies.each { dependency ->
+ if (dependency.hasProperty("notInPom") && dependency.notInPom) {
+ pom.dependencies.removeAll { it.groupId == dependency.group && it.artifactId == dependency.name }
+ }
+ }
+ }
+}
+
+task clean(type: Delete) {
+ delete buildDir,
+ homeBinDir,
+ homeConfDir,
+ homeDistDir,
+ homeDslSupportDir,
+ homeLibDir,
+ 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) {
+ gradleVersion "1.0-milestone-9"
+}
2  build.properties
@@ -0,0 +1,2 @@
+grails.version=2.1.0.RC3
+
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.ext.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[])
+ }
+ }
+
+}
177 dependencies.txt
@@ -0,0 +1,177 @@
+The following libraries are included in Grails because they are required either for building the framework or for running the command line tools or for running Grails applications themselves.
+
+* ant.jar, ant-junit.jar, ant-launcher.jar, ant-trax.jar
+- Ant 1.8.2 (http://ant.apache.org) Apache 2.0 License
+- used to build the framework and for the command line tools (Gant)
+- required for running Grails applications when using AntBuilder
+
+* 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
+- AspectJ 1.6.8 (http://www.eclipse.org/aspectj/) Eclipse Public License (EPL)
+- required for running Grails applications
+
+* cglib-nodep-2.1_3.jar
+- CGLIB 2.1_3 with ObjectWeb ASM 1.5.3 (http://cglib.sourceforge.net) Apache 1.1 License
+- required for running Grails applications (Spring AOP & Hibernate)
+
+* concurrentlinkedhashmap-lru-1.0_jdk5.jar
+- ConcurrentLinkedHashMap policy: least-recently-used, jdk: 5 (https://code.google.com/p/concurrentlinkedhashmap) Apache License 2.0
+- required for building Grails core
+- required for running Grails applications
+
+* commons-beanutils-1.8.0.jar
+- Commons BeanUtils 1.8.0 (http://commons.apache.org/beanutils/) Apache 2.0 License
+- required for running Grails applications
+
+* commons-codec-1.4.jar
+- Commons Codec 1.4 (http://commons.apache.org/codec/) Apache 2.0 License
+- required for running Grails applications
+
+* commons-cli-1.0.jar
+- Commons CLI 1.0 (http://commons.apache.org/cli/) Apache 2.0 License
+- required for the command line tools (Gant)
+
+* commons-collections-3.2.1.jar
+- Commons Collections 3.2.1 (http://commons.apache.org/collections/) Apache 2.0 License
+- required for building Grails core
+- required for running Grails applications
+
+* commons-dbcp-1.3.jar
+- Commons DBCP 1.3 (http://commons.apache.org/dbcp/) Apache 2.0 License
+- required for building Grails core
+- required for running Grails applications
+
+* commons-el-1.0.jar
+- Commons Expression Language 1.0 (http://commons.apache.org/el/) Apache 2.0 License
+- required for running Grails applications
+
+* commons-fileupload-1.2.1.jar
+- Commons File Upload 1.2.1 (http://commons.apache.org/fileupload/) Apache 2.0 License
+- required for running Grails applications (When using file uploads)
+
+* commons-io-1.4.jar
+- Commons I/O 1.4 (http://commons.apache.org/io/) Apache 2.0 License
+- required for running Grails applications
+
+* commons-lang-2.4.jar
+- Commons Lang 2.4 (http://commons.apache.org/lang/) Apache 2.0 License
+- required for building Grails core
+- required for running Grails application
+
+* commons-pool-1.5.5.jar
+- Commons Pool 1.5.5 (http://commons.apache.org/pool/) Apache 2.0 License
+- required for running Grails applications
+
+* commons-validator-1.3.1.jar
+- Commons Validator 1.3.1 (http://commons.apache.org/validator/) Apache 2.0 License
+- required for building Grails core
+- required for running Grails applications
+
+* dom4j-1.6.1.jar
+- Dom4J 1.6.1 (http://dom4j.org/) BSD Style License (see http://www.dom4j.org/license.html)
+- required for building Grails core
+- required for running Grails applications
+
+* ejb3-persistence-1.0.2.GA.jar
+- EJB 3.0 Final Release
+- required for running Grails applications (When using Hibernate EJB3 annotations)
+
+* ehcache-1.5.0.jar
+- EHCache 1.5.0 (http://ehcache.sourceforge.net/) Apache 2.0 License
+- required if you want to use EHCache as your second-level cache
+- optional otherwise
+
+* gant_groovy1.8-1.9.5.jar
+- Gant 1.9.5 (http://gant.codehaus.org) Apache 2.0 License
+- required for the command line tools (Gant)
+
+* groovy-all-1.8.6.jar
+- Groovy 1.8.6 (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-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)
+
+* hibernate-core-3.6.10.Final.jar
+- Hibernate 3.6.8 GA (http://www.hibernate.org) LGPL License
+- required for building Grails core
+- required for running Grails applications
+
+* hsqldb-1.8.0.10.jar
+- HSQLDB 1.8.0.10 (http://hsqldb.org/) HSQLDB License (see http://hsqldb.org/web/hsqlLicense.html)
+- required for building Grails core
+- required for running Grails applications (With an in-memory database)
+
+* h2-1.3.164.jar
+- H2 1.3.164 (http://www.h2database.com/) H2 License (see http://www.h2database.com/html/license.html)
+- required for building Grails core
+- required for running Grails applications (With an in-memory database)
+
+* 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
+- JLine 0.9.94 (http://jline.sourceforge.net/)
+- required for the Grails shell
+
+* jsp-api-2.1.jar
+- Java Server Pages 2.1 Spec
+- required for building Grails core
+- required for running Grails applications
+
+* jta-1.1.jar
+- Java Transaction API
+- required for running Grails applications
+
+* junit-4.8.1.jar
+- JUnit 4.8.1 (http://junit.org) CPL 1.0 License
+- required for building Grails core
+- required for the command line tools (Gant)
+
+* log4j-1.2.16.jar
+- Log4J 1.2.16 (http://logging.apache.org/log4j/) Apache 2.0 License
+- required for running Grails applications
+
+* ognl-2.7.3.jar
+- OGNL 2.7.3 (http://www.ognl.org/) OGNL License (http://www.ognl.org/copyright.html)
+- required for running Grails applications (When using Web Flows)
+
+* oro-2.0.8.jar
+- Jakarta ORO 2.0.8 (http://jakarta.apache.org/oro/) Apache 2.0 License
+- required for running Grails applications
+
+* protobuf-java-2.4.1.jar
+- Google's language-neutral, platform-neutral, extensible mechanism or serializing structured data
+
+* sitemesh-2.4.jar
+- Sitemesh 2.4 (http://www.opensymphony.com/sitemesh) OpenSymphony Software License (see http://www.opensymphony.com/sitemesh/license.action)
+- required for building Grails core
+- required for running Grails applications
+
+* slf4j-api-1.5.6.jar, slf4j-log4j12-1.5.6.jar
+- Simple Logging Facade for Java 1.5.6 (http://www.slf4j.org/) MIT License (http://www.slf4j.org/license.html)
+- required for building Grails core
+- required for running Grails applications
+
+* org.springframework.*.jar
+- 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
+
+* org.springframework.webflow-2.0.8.RELEASE.jar, org.springframework.binding-2.0.8.RELEASE.jar, org.springframework.js-2.0.8.RELEASE.jar
+- Spring Web Flow 2.0.8 (http://www.springframework.org) Apache 2.0 License
+- required for building Grails core
+- required for running Grails applications (When using Web flows)
+
+* xpp3_min-1.1.3.4.O.jar
+- XML Pull Parser (XPP) 1.1.3.4.O (http://www.extreme.indiana.edu/xgws/xsoap/xpp/) Indiana University Extreme! Lab Software License (see http://www.extreme.indiana.edu/viewcvs/~checkout~/XPP3/java/LICENSE.txt)
+- required for running Grails applications (dependency of XStream 1.2.1)
+
0  gradle.properties
No changes.
263 gradle/assemble.gradle
@@ -0,0 +1,263 @@
+import org.apache.tools.ant.filters.ReplaceTokens
+
+apply plugin: org.grails.gradle.GrailsBuildPlugin
+
+def libsConfigurations = []
+subprojects { subproject ->
+ configurations {
+ libsConfigurations << libs {
+ extendsFrom compile, runtime
+ ["jsp21"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
+ }
+ }
+}
+
+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 configurePopulateDependencies << {
+ def projectNames = rootProject.subprojects*.name
+
+ ext {
+ baseCachesDir = "$gradle.gradleUserHomeDir/caches"
+ cacheDir = "$baseCachesDir/artifacts-8"
+ metadata = "$cacheDir/module-metadata"
+ filestore = "$cacheDir/filestore"
+ }
+
+ def seen = []
+ libsConfigurations.each { configuration ->
+ for (artifact in configuration.resolvedConfiguration.resolvedArtifacts) {
+ if (artifact in seen) continue
+ seen << artifact
+ def dependency = artifact.moduleVersion.id
+ if (!projectNames.contains(dependency.name)) {
+ populateDependencies.into("$dependency.group/$dependency.name/jars") {
+ from artifact.file // this will trigger the actual download if necessary
+ }
+
+ populateDependencies.from ("${metadata}/${dependency.group}/${dependency.name}/${dependency.version}") {
+ include "*.ivy.xml"
+ eachFile { it.path = "$dependency.group/$dependency.name/ivy-${dependency.version}.xml" }
+
+ }
+ }
+ }
+ }
+}
+
+task populateDependencies(type: Sync, dependsOn: configurePopulateDependencies) {
+ into homeLibDir
+ includeEmptyDirs = false
+}
+
+// Can't use sync task here because this directory contains other things as well.
+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 pluginsFromRepo {
+ ext.plugins = [
+ hibernate: grailsVersion,
+ tomcat: grailsVersion,
+ resources: "1.1.6",
+ webxml: "1.4.1",
+ jquery: "1.7.1"
+ ]
+
+ ext.dir = file("$buildDir/pluginsFromRepo")
+ outputs.files { dir.listFiles().findAll { it.name.endsWith(".zip") } }
+ doFirst {
+ ant {
+ mkdir(dir: dir)
+ plugins.each { name, version ->
+ 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)
+ }
+ }
+ }
+}
+
+task installResources(type: Copy) {
+ into "$buildDir/home-dir" // 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])
+ }
+
+ into(homeBinDir.name) {
+ from("grails-resources/src/grails/home/bash")
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ filter(ReplaceTokens, tokens: ['starter.main.class': 'org.codehaus.groovy.grails.cli.support.GrailsStarter'])
+ filter(ReplaceTokens, tokens: ['windows.starter.classpath': "%GRAILS_HOME%\\lib\\org.codehaus.groovy\\groovy-all\\jars\\groovy-all-${groovyVersion}.jar;%GRAILS_HOME%\\dist\\grails-bootstrap-${grailsVersion}.jar".toString()])
+ filter(ReplaceTokens, tokens: ['starter.classpath': "\$GRAILS_HOME/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-${groovyVersion}.jar:\$GRAILS_HOME/dist/grails-bootstrap-${grailsVersion}.jar".toString()])
+ filter(ReplaceTokens, tokens: ['agent.string': "-javaagent:\$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-${springLoadedVersion}.jar -noverify -Dspringloaded=\$SPRINGLOADED_PARAMS".toString()])
+ filter(ReplaceTokens, tokens: ['windows.agent.string': "-javaagent:%GRAILS_HOME:\\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-${springLoadedVersion}.jar -noverify -Dspringloaded=%SPRINGLOADED_PARAMS%".toString()])
+ filter(ReplaceTokens, tokens: ['startup.command': ''])
+ fileMode = 0755
+ }
+
+ // the fileMode property above should take care of the chmod work, but
+ // it doesn't per http://jira.codehaus.org/browse/GRADLE-971
+ doLast {
+ ant.copy(todir:projectDir) {
+ fileset(dir:"$buildDir/home-dir")
+ }
+
+ ant.chmod(dir: homeBinDir, perm: '755', includes: '*')
+ }
+
+ 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])
+ filter(ReplaceTokens, tokens: ['jansi.version': jansiVersion])
+ filter(ReplaceTokens, tokens: ['jna.version': jnaVersion])
+ filter(ReplaceTokens, tokens: ['commons.cli.version': commonsCliVersion])
+ filter(ReplaceTokens, tokens: ['ant.version': antVersion])
+ 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 {
+ task installToHomeDist(type: Copy) {
+ from jar.outputs.files
+ into homeDistDir
+ }
+
+ install.dependsOn installToHomeDist
+}
+
+task install(dependsOn: [populateDependencies, installResources] + subprojects*.install)
+
+task zipDist(type: Zip, dependsOn: [sourcesJars, install]) {
+ destinationDir = "${buildDir}/distributions" as File
+ baseName = 'grails'
+ appendix = grailsVersion
+
+ exclude "**/CVS/**"
+
+ into("grails-$grailsVersion") {
+ from(projectDir) {
+ include 'lib/', 'gradle/', 'media/', 'samples/', 'scripts/', 'build.gradle', 'build.properties', 'dependencies.txt',
+ 'LICENSE', 'INSTALL', "src/", "gradlew.bat","gradle.properties"
+ exclude 'ant/bin', 'src/grails', 'src/war'
+ }
+ from("grails-resources") {
+ include 'src/grails/**', 'src/war/**'
+ // this file is accounted for later with special handling to do some token replacement
+ exclude 'src/grails/grails-macros.xml'
+ }
+ from(projectDir) {
+ include "gradlew"
+ fileMode = 0755
+ }
+ from(docs.destinationDir) {
+ into "doc"
+ }
+ from(pluginsFromRepo.outputs.files) {
+ into "plugins"
+ rename { it - "grails-" }
+ }
+ from('grails-resources/src/grails/home/docs/README') {
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ }
+ from('grails-resources/src/grails/home/tests') {
+ into "src/resources/tests"
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ }
+ from("grails-resources/src/grails/home/bash") {
+ into "bin"
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ filter(ReplaceTokens, tokens: ['starter.main.class': 'org.codehaus.groovy.grails.cli.support.GrailsStarter'])
+ filter(ReplaceTokens, tokens: ['windows.starter.classpath': "%GRAILS_HOME%\\lib\\org.codehaus.groovy\\groovy-all\\jars\\groovy-all-${groovyVersion}.jar;%GRAILS_HOME%\\dist\\grails-bootstrap-${grailsVersion}.jar".toString()])
+ filter(ReplaceTokens, tokens: ['starter.classpath': "\$GRAILS_HOME/lib/org.codehaus.groovy/groovy-all/jars/groovy-all-${groovyVersion}.jar:\$GRAILS_HOME/dist/grails-bootstrap-${grailsVersion}.jar".toString()])
+ filter(ReplaceTokens, tokens: ['agent.string': "-javaagent:\$AGENT_GRAILS_HOME/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-${springLoadedVersion}.jar -noverify -Dspringloaded=\$SPRINGLOADED_PARAMS".toString()])
+ filter(ReplaceTokens, tokens: ['windows.agent.string': "-javaagent:%GRAILS_HOME:\\=/%/lib/com.springsource.springloaded/springloaded-core/jars/springloaded-core-${springLoadedVersion}.jar -noverify -Dspringloaded=%SPRINGLOADED_PARAMS%".toString()])
+ filter(ReplaceTokens, tokens: ['startup.command': ''])
+ fileMode = 0755
+ }
+ from("grails-resources/src/grails/home/conf") {
+ into "conf"
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
+ filter(ReplaceTokens, tokens: ['jline.version': jlineVersion])
+ filter(ReplaceTokens, tokens: ['jansi.version': jansiVersion])
+ filter(ReplaceTokens, tokens: ['jna.version': jnaVersion])
+ filter(ReplaceTokens, tokens: ['commons.cli.version': commonsCliVersion])
+ filter(ReplaceTokens, tokens: ['ant.version': antVersion])
+ filter(ReplaceTokens, tokens: ['gant.version': gantVersion])
+ filter(ReplaceTokens, tokens: ['ivy.version': ivyVersion])
+ filter(ReplaceTokens, tokens: ['jline.version': jlineVersion])
+ filter(ReplaceTokens, tokens: ['jansi.version': jansiVersion])
+ filter(ReplaceTokens, tokens: ['jna.version': jnaVersion])
+ filter(ReplaceTokens, tokens: ['commons.cli.version': commonsCliVersion])
+ }
+ from(homeDistDir) {
+ into "dist"
+ exclude "*.zip"
+ }
+ from("grails-resources/src/grails/grails-macros.xml") {
+ into "src/grails"
+ filter(ReplaceTokens, tokens: ['grails.version': grailsVersion])
+ filter(ReplaceTokens, tokens: ['groovy.version': groovyVersion])
+ }
+ from('grails-resources/src/grails/home/dsl-support') {
+ into "dsl-support"
+ }
+ }
+}
+
+/*task zipDoc(type: Zip) {
+ appendix = 'docs'
+ from docs.destinationDir
+}*/
+
+
+task assemble(dependsOn: zipDist)
123 gradle/docs.gradle
@@ -0,0 +1,123 @@
+/**
+ * Since Grails is a mixed Groovy/Java codebase the javadoc tool needs stubs in order for javadoc compilation to pass
+ * This target generates a set of stubs for the Groovy sources
+ */
+task stubs {
+ ext.destinationDir = "$buildDir/docs/stubs"
+ doFirst {
+ def isolatedAnt = services.get(org.gradle.api.internal.project.IsolatedAntBuilder)
+ isolatedAnt.execute {
+ mkdir(dir: destinationDir)
+ taskdef(name: "generatestubs", classname: "org.codehaus.groovy.grails.cli.GenerateStubsTask") {
+ classpath {
+ for(sub in subprojects) {
+ pathelement path: sub.sourceSets.main.compileClasspath.asPath
+ }
+ }
+ }
+
+ generatestubs(destdir: destinationDir) {
+ classpath {
+ for(sub in subprojects) {
+ pathelement path: sub.sourceSets.main.compileClasspath.asPath
+ }
+ }
+ src {
+ for (sub in subprojects) {
+ sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
+ if (srcDir.exists()) {
+ dirset(dir: srcDir) {
+ exclude name: "**/*.properties"
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+}
+
+task docs {
+ ext.destinationDir = file("${projectDir}/doc")
+}
+
+task javadoc(type:Javadoc) {
+ classpath = files(subprojects.configurations.compile)
+ dependsOn stubs
+ maxMemory = '256M'
+ destinationDir = file("$docs.destinationDir/javadoc")
+ source subprojects.sourceSets.main.groovy.srcDirs + stubs.destinationDir
+ include "org/codehaus/groovy/grails/**", "grails/**"
+ exclude "**/**.groovy"
+ project.configure(options) {
+ windowTitle = "Grails $grailsVersion"
+ docTitle = "<h1>Grails</h1>"
+ encoding = "UTF-8"
+ memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PACKAGE
+ author = true
+ version = true
+ use = true
+ breakIterator = true
+ links("http://java.sun.com/j2ee/1.4/docs/api", "http://java.sun.com/j2se/1.5.0/docs/api", "http://static.springframework.org/spring/docs/2.5.x/api")
+// tags("todo:a:To do") todo fix the javadoc task to accept this option
+ }
+ verbose = false
+}
+
+task groovydoc(type:Groovydoc) {
+ classpath = files(subprojects.configurations.compile)
+ groovyClasspath = files(subprojects.configurations.compile)
+ destinationDir = file("$docs.destinationDir/api")
+ windowTitle = "Grails $grailsVersion"
+ docTitle = "Grails $grailsVersion"
+ source subprojects.sourceSets.main.groovy.srcDirs
+ use = true
+// Can't make these link methods to work
+// link("http://static.springsource.org/spring/docs/3.0.x/javadoc-api", "org.springframework.")
+// link("http://download.oracle.com/javase/1.5.0/docs/api", "java." , "javax.")
+// link("http://download.oracle.com/javaee/5/api", "javax.")
+ doLast {
+ delete("${buildDir}/tmp")
+ }
+}
+
+task fetchGrailsDocsSource << {
+ ant {
+ mkdir dir: buildDir
+ get src:"http://nodeload.github.com/grails/grails-doc/zipball/master", dest:"${buildDir}/grails-docs-src.zip", verbose:"true"
+ unzip(src: "${buildDir}/grails-docs-src.zip", dest: buildDir) {
+ mapper type: 'regexp', from:/(grails-grails-doc-[\w]*\/)(.*)/, to:/grails-docs-src\/\2/
+ }
+ }
+}
+
+task gdoc(type: GradleBuild, dependsOn: ["groovydoc", "fetchGrailsDocsSource"]) {
+ buildFile = "${buildDir}/grails-docs-src/build.gradle"
+ tasks = ["clean", "assemble"]
+
+ doFirst {
+ project.oldGrailsHome = System.getProperty("grails.home")
+ System.setProperty("grails.home", projectDir.absolutePath)
+ System.setProperty("disable.groovydocs", "true")
+ }
+
+ doLast {
+ if (project.oldGrailsHome) System.setProperty("grails.home", project.oldGrailsHome)
+ else System.clearProperty("grails.home")
+ System.clearProperty("disable.groovydocs")
+
+ ant.mkdir dir: "${projectDir}/dist"
+ copy {
+ from "${buildDir}/grails-docs-src/build/distributions"
+ into "${projectDir}/dist"
+ }
+
+ copy {
+ from file("${buildDir}/grails-docs-src/build/docs")
+ into docs.destinationDir
+ }
+ }
+}
+
+docs.dependsOn gdoc
29 gradle/findbugs.gradle
@@ -0,0 +1,29 @@
+// To use findbugs you must have findbugs installed. Additionally you need a property called findbugsHome. You can define this
+// in ~/.gradle/gradle.properties
+
+task findbugs(dependsOn: install) << {
+ ant {
+ taskdef(name: "findbugs", classname: "edu.umd.cs.findbugs.anttask.FindBugsTask", classpath: "$findbugsHome/lib/findbugs-ant.jar")
+ mkdir dir: "$buildDir/findbugs-report"
+ findbugs(home: findbugsHome, output: "xml:withMessages", outputFile: "$buildDir/findbugs-report/grails-fb.xml", jvmargs: "-Xmx768M") {
+ auxClasspath() {
+ for(sub in subprojects) {
+ pathElement(path: sub.sourceSets.main.compileClasspath.asPath)
+ }
+ }
+ sourcePath() {
+ for (sub in subprojects) {
+ sub.sourceSets.main.groovy.srcDirs.each { srcDir ->
+ if (srcDir.exists()) {
+ pathElement(path: srcDir.absolutePath)
+ }
+ }
+ }
+ }
+ auxAnalyzepath() {
+ fileset dir: homeDistDir, includes: "grails-*.jar"
+ }
+ }
+ xslt(in: "$buildDir/findbugs-report/grails-fb.xml", out: "$buildDir/findbugs-report/grails-fb.html", style: "$findbugsHome/src/xsl/fancy.xsl")
+ }
+}
130 gradle/unit-test.gradle
@@ -0,0 +1,130 @@
+// todo Unify test tasks into one multithreaded execution unit with a custom fork frequency
+// todo Add test progress listener with dot notation.
+
+configurations {
+ coverage
+}
+
+dependencies {
+ testRuntime files('src/test', 'src/grails/grails-app/utils', projectDir, "src/war/WEB-INF", coreJar.archivePath)
+ coverage "net.sourceforge.cobertura:cobertura:1.9.3"
+}
+
+// we disable the default test task of the java plugin as we use a bunch of custom ones.
+// todo remove this line as soon as the java plugin is split up in two.
+test.enabled = false
+
+task instrumentForCoverage {
+ instrumentedClassesDir = "${sourceSets.main.classesDir}-instrumented" as File
+
+ inputs.dir sourceSets.test.classesDir
+ outputs.files instrumentedClassesDir
+
+ cobSerFile = "${project.buildDir}/cobertura.ser"
+ doFirst {
+ ant {
+ // delete data file for cobertura, otherwise coverage would be added
+ delete(file: cobSerFile, failonerror: false)
+ // delete copy of original classes
+ delete(dir: instrumentedClassesDir, failonerror: false)
+ // import cobertura task, so it is available in the script
+ taskdef(resource: 'tasks.properties', classpath: configurations.coverage.asPath)
+ }
+ copy {
+ from sourceSets.main.output
+ into instrumentedClassesDir
+ }
+ ant {
+ 'cobertura-instrument'(datafile: cobSerFile) {
+ fileset(dir: instrumentedClassesDir) { include(name: "**/*.class") }
+ }
+ }
+ }
+}
+
+task coverageReport {
+ destinationDir = "${project.buildDirName}/reports/coverage" as File
+ inputs.files instrumentForCoverage.cobSerFile
+ outputs.files destinationDir
+
+ doFirst {
+ project.ant.taskdef(resource: 'tasks.properties', classpath: configurations.coverage.asPath)
+ ant.'cobertura-report'(destdir: destinationDir,
+ format: 'xml', datafile: instrumentForCoverage.cobSerFile) {
+ sourceSets.main.allJava.addToAntBuilder(ant, 'fileset')
+ }
+ }
+}
+
+test {
+ systemProperties = ['grails.cli.testing': "true"]
+ jvmArgs = ["-server", "-Xmx1G", "-Xms256m", "-XX:MaxPermSize=256m", "-Dgroovy.grails.joint=true"] // todo, "-Dgroovy.grails.joint=${groovy.grails.joint}"
+}
+
+createTestTask("contentFormat", ["org/codehaus/groovy/grails/web/mime/ContentFormatControllerTests.class"], [])
+createTestTask("transactionalService", ["org/codehaus/groovy/grails/reload/TransactionalServiceReloadTests.class"], [])
+createTestTask("packagePlugins", ["org/codehaus/groovy/grails/cli/PackagePluginTests.class"], [])
+createTestTask("installTemplates", ["org/codehaus/groovy/grails/cli/InstallTemplatesTests.class"], [])
+createTestTask("generateAll", ["org/codehaus/groovy/grails/cli/GenerateAllTests.class"], [])
+createTestTask("cli", ["org/codehaus/groovy/grails/cli/**/*Tests.class"], ["org/codehaus/groovy/grails/cli/**/*Tests.class", "**/PackagePluginTests", "**/InstallTemplatesTests"])
+createTestTask("hibernate", ["**/orm/hibernate/*Tests.class",
+ "**/orm/hibernate/binding/*Tests.class",
+ "**/orm/hibernate/cfg/*Tests.class",
+ "**/orm/hibernate/validation/*Tests.class"], ["**/Abstract*", "**/UniqueConstraint*"])
+createTestTask("uniqueConstraints", ["**/UniqueConstraintTests.class"], [])
+createTestTask("webflow", ["**/webflow/**/*Tests.class"], ["**/Abstract*"])
+createTestTask("taglib", ["**/web/taglib/**/*Tests.class"], ["**/Abstract*"])
+createTestTask("other", ["**/*Tests.class"], ["**/Abstract*", "**/TransactionalServiceReloadTests*",
+ "**/ContentFormatControllerTests*", "**/orm/hibernate/**", "**/webflow/**", "**/web/taglib/**", "**/cli/**Tests.class"])
+
+def createTestTask(name, includes, excludes) {
+ createTestTaskWithoutSuffix("${name}Test", includes, excludes)
+}
+
+def createTestTaskWithoutSuffix(String name, includes, excludes) {
+ task = tasks.add(name: name, type: Test) {
+ doFirst dependencyCache
+ systemProperties = ['grails.cli.testing': "true"]
+ jvmArgs = ["-server", "-Xmx1500m", "-Xms256m", "-XX:MaxPermSize=256m", "-Dgroovy.grails.joint=true"] // todo, "-Dgroovy.grails.joint=${groovy.grails.joint}"
+ systemProperties['net.sourceforge.cobertura.datafile'] = instrumentForCoverage.cobSerFile
+ include includes as String[]
+ exclude excludes as String[]
+ testReport = true
+ ignoreFailures = false
+ coverageHtmlReport = false
+/* classpath = classpath + project.rootProject.configurations.coverage*/
+ classpath = sourceSets.test.runtimeClasspath + project.rootProject.configurations.coverage
+ testClassesDir = sourceSets.test.classesDir
+ }
+ test.dependsOn task
+ task.dependsOn coreJar
+}
+
+tasks.addRule("Pattern: <testTaskName>Coverage will execute the corresponding test task with coverage") {String taskName ->
+ String coverageName = 'Coverage'
+ if (taskName.endsWith(coverageName)) {
+ def testTaskName = taskName.substring(0, taskName.length() - coverageName.length())
+ def testTask = tasks.findByName(testTaskName)
+ if (testTask) {
+ def testTasks = testTask == tasks.test ? tasks.withType(Test) : testTask
+ applyCoveragetToTestTasks(testTasks)
+ tasks.add(name: taskName).dependsOn testTask, coverageReport
+ }
+ }
+}
+
+def applyCoveragetToTestTasks(def testTasks) {
+ testTasks.each {testTask ->
+ testTask.dependsOn instrumentForCoverage
+ testTask.classpath = project.files(tasks.instrumentForCoverage.instrumentedClassesDir) + testTask.classpath + project.rootProject.configurations.coverage
+ coverageReport.dependsOn testTask
+ }
+}
+
+tasks.addRule("Pattern: testSingle<Name> will test **/<Name>Tests.class") {String taskName ->
+ if (taskName.startsWith("testSingle") && !taskName.endsWith('Coverage')) {
+ createTestTaskWithoutSuffix(taskName, ['**/' + taskName.substring(10) + 'Tests.class'], [])
+ }
+}
+
+
BIN  gradle/wrapper/gradle-wrapper.jar
Binary file not shown
6 gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+#Tue Mar 27 16:49:12 BST 2012
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
+distributionUrl=http\://services.gradle.org/distributions/gradle-1.0-milestone-9-bin.zip
164 gradlew
@@ -0,0 +1,164 @@
+#!/bin/bash
+
+##############################################################################
+##
+## Gradle start up script for UN*X
+##
+##############################################################################
+
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
+
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD="maximum"
+
+warn ( ) {
+ echo "$*"
+}
+
+die ( ) {
+ echo
+ echo "$*"
+ echo
+ exit 1
+}
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+case "`uname`" in
+ CYGWIN* )
+ cygwin=true
+ ;;
+ Darwin* )
+ darwin=true
+ ;;
+ MINGW* )
+ msys=true
+ ;;
+esac
+
+# For Cygwin, ensure paths are in UNIX format before anything is touched.
+if $cygwin ; then
+ [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
+fi
+
+# 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 [ -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 [ ! -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
+
+# Increase the maximum file descriptors if we can.
+if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
+ MAX_FD_LIMIT=`ulimit -H -n`
+ if [ $? -eq 0 ] ; then
+ if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
+ MAX_FD="$MAX_FD_LIMIT"
+ fi
+ ulimit -n $MAX_FD
+ if [ $? -ne 0 ] ; then
+ warn "Could not set maximum file descriptor limit: $MAX_FD"
+ fi
+ else
+ warn "Could not query businessSystem maximum file descriptor limit: $MAX_FD_LIMIT"
+ fi
+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\""
+fi
+
+# For Cygwin, switch paths to Windows format before running java
+if $cygwin ; then
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
+ CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
+
+ # We build the pattern for arguments to be converted via cygpath
+ ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
+ SEP=""
+ for dir in $ROOTDIRSRAW ; do
+ ROOTDIRS="$ROOTDIRS$SEP$dir"
+ SEP="|"
+ done
+ OURCYGPATTERN="(^($ROOTDIRS))"
+ # Add a user-defined pattern to the cygpath arguments
+ if [ "$GRADLE_CYGPATTERN" != "" ] ; then
+ OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
+ fi
+ # Now convert the arguments - kludge to limit ourselves to /bin/sh
+ i=0
+ for arg in "$@" ; do
+ CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
+ CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
+
+ if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
+ eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
+ else
+ eval `echo args$i`="\"$arg\""
+ fi
+ i=$((i+1))
+ done
+ case $i in
+ (0) set -- ;;
+ (1) set -- "$args0" ;;
+ (2) set -- "$args0" "$args1" ;;
+ (3) set -- "$args0" "$args1" "$args2" ;;
+ (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
+ (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
+ (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
+ (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
+ (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
+ (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
+ esac
+fi
+
+# 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" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
90 gradlew.bat
@@ -0,0 +1,90 @@
+@if "%DEBUG%" == "" @echo off
+@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 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=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%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
+
+if exist "%JAVA_EXE%" goto init
+
+echo.
+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.
+
+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
+
+:win9xME_args
+@rem Slurp the command line arguments.
+set CMD_LINE_ARGS=
+set _SKIP=2
+
+:win9xME_args_slurp
+if "x%~1" == "x" goto execute
+
+set CMD_LINE_ARGS=%*
+goto execute
+
+:4NT_args
+@rem Get arguments from the 4NT Shell from JP Software
+set CMD_LINE_ARGS=%$
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+@rem Execute Gradle
+"%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
+
+: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 1
+exit /b 1
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
61 grails-bootstrap/build.gradle
@@ -0,0 +1,61 @@
+import org.apache.tools.ant.filters.ReplaceTokens
+
+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
+ ["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"
+
+ 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}",
+ "org.apache.ant:ant-trax:${antTraxVersion}",
+ "org.apache.ivy:ivy:${ivyVersion}"
+
+ compile("org.apache.ant:ant-junit:${antVersion}") {
+ 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])
+}
+
+jar.appendix = 'bootstrap'
276 grails-bootstrap/src/main/groovy/grails/ant/GrailsTask.java
@@ -0,0 +1,276 @@
+/* Copyright 2004-2005 Graeme Rocher
+ *
+ * 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.ant;
+
+import grails.util.GrailsNameUtils;
+
+import java.io.File;
+import java.io.FilenameFilter;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.tools.ant.BuildException;
+import org.apache.tools.ant.Task;
+import org.apache.tools.ant.types.Path;
+import org.apache.tools.ant.types.Reference;
+import org.codehaus.groovy.grails.cli.support.GrailsBuildHelper;
+import org.codehaus.groovy.grails.cli.support.GrailsRootLoader;
+
+/**
+ * <p>Ant task for executing Grails scripts. To use it, first create a
+ * task definition for it:
+ * <pre>
+ * &lt;path id="grails.classpath"&gt;
+ * &lt;fileset dir="${grails.home}/dist" includes="grails-bootstrap-*.jar"/&gt;
+ * &lt;fileset dir="${grails.home}/lib"&gt;
+ * &lt;include name="groovy-all*.jar"/&gt;
+ * &lt;include name="ivy*.jar"/&gt;
+ * &lt;include name="gant_groovy*.jar"/&gt;
+ * &lt;/fileset&gt;
+ * &lt;/path&gt;
+ *
+ * &lt;taskdef name="grails"
+ * classname="grails.ant.GrailsTask"
+ * classpathref="grails.classpath"/&gt;
+ * </pre>
+ * You must have the "grails-bootstrap", "groovy-all", Ivy, and GPars JARs on
+ * the <code>taskdef<code>'s classpath, otherwise the task won't load.
+ * </p>
+ * <p>Once the task is defined, you can use it like this:
+ * <pre>
+ * &lt;grails home="${grails.home}" script="Clean"/&gt;
+ * </pre>
+ * The <code>home</code> attribute contains the location of a local
+ * Grails installation, while <code>script</code> is the name of the
+ * Grails script to run. Note that it's the <em>script</em> name not
+ * the equivalent command name.
+ * </p>
+ * <p>If you want to use the Ant task without a Grails installation,
+ * then you can use the <code>classpathref</code> attribute or
+ * <code>classpath</code> nested element instead of <code>home</code>.
+ * This allows you to control precisely which JARs and versions are
+ * used to execute the Grails scripts. Typically you would use this
+ * option in conjunction with something like Ivy.
+ * </p>
+ */
+public class GrailsTask extends Task {
+
+ private File home;
+ private String script;
+ private String args;
+ private String environment;
+ private boolean includeRuntimeClasspath = true;
+ private Path classpath;
+
+ private Path compileClasspath;
+ private Path testClasspath;
+ private Path runtimeClasspath;
+
+ @Override
+ public void execute() throws BuildException {
+ // The "script" must be specified.
+ if (script == null) throw new BuildException("'script' must be provided.");
+
+ // Check that one, and only one, of Grails home and classpath are set.
+ if (home == null && classpath == null) {
+ throw new BuildException("One of 'home' or 'classpath' must be provided.");
+ }
+
+ if (home != null && classpath != null) {
+ throw new BuildException("You cannot use both 'home' and 'classpath' with the Grails task.");
+ }
+
+ runGrails(script, args);
+ }
+
+ protected void runGrails(String targetName, @SuppressWarnings("hiding") String args) {
+ // First get the dependencies from the classpath.
+ List<URL> urls = new ArrayList<URL>();
+ if (classpath != null) {
+ urls.addAll(pathsToUrls(classpath));
+ }
+ else {
+ urls.addAll(getRequiredLibsFromHome());
+ }
+
+ try {
+ URL[] loaderUrls = urls.toArray(new URL[urls.size()]);
+ GrailsRootLoader rootLoader = new GrailsRootLoader(loaderUrls, getClass().getClassLoader());
+
+ GrailsBuildHelper helper;
+ if (getProject().getBaseDir() != null) {
+ helper = new GrailsBuildHelper(rootLoader, home == null ? null :
+ home.getCanonicalPath(), getProject().getBaseDir().getCanonicalPath());
+ }
+ else {
+ helper = new GrailsBuildHelper(rootLoader, home == null ? null : home.getCanonicalPath());
+ }
+
+ int retval;
+ if (environment == null) {
+ retval = helper.execute(targetName, args);
+ }
+ else {
+ retval = helper.execute(targetName, args, environment);
+ }
+
+ if (retval != 0) {
+ throw new BuildException("Grails returned non-zero value: " + retval);
+ }
+ }
+ catch (Exception ex) {
+ throw new BuildException("Unable to start Grails: " + ex.getMessage(), ex);
+ }
+ }
+
+ private List<URL> getRequiredLibsFromHome() {
+ List<URL> urls = new ArrayList<URL>();
+
+ try {
+ // Make sure Groovy, Gant, Ivy and GPars are on the classpath if we are using "grailsHome".
+ File[] files = new File(home, "lib").listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.startsWith("gant_") || name.startsWith("groovy-all") ||
+ name.startsWith("ivy");
+ }
+ });
+
+ for (File file : files) {
+ urls.add(file.toURI().toURL());
+ }
+
+ // Also make sure the bootstrap JAR is on the classpath.
+ files = new File(home, "dist").listFiles(new FilenameFilter() {
+ public boolean accept(File dir, String name) {
+ return name.startsWith("grails-bootstrap");
+ }
+ });
+
+ for (File file : files) {
+ urls.add(file.toURI().toURL());
+ }
+
+ return urls;
+ }
+ catch (MalformedURLException e) {
+ throw new RuntimeException(e);
+ }
+ }
+
+ private List<URL> pathsToUrls(Path path) {
+ if (path == null) return Collections.emptyList();
+
+ List<URL> urls = new ArrayList<URL>(path.size());
+ for (String filePath : path.list()) {
+ try { urls.add(new File(filePath).toURI().toURL()); }
+ catch (MalformedURLException ex) { throw new RuntimeException(ex); }
+ }
+
+ return urls;
+ }
+
+ public String getCommand() {
+ return GrailsNameUtils.getScriptName(script);
+ }
+
+ public void setCommand(String command) {
+ script = GrailsNameUtils.getNameFromScript(command);
+ }
+
+ public File getHome() {
+ return home;
+ }
+
+ public void setHome(File home) {
+ this.home = home;
+ }
+
+ public String getScript() {
+ return script;
+ }
+
+ public void setScript(String script) {
+ this.script = script;
+ }
+
+ public String getArgs() {