Skip to content
Browse files

add groovy-xml module

  • Loading branch information...
1 parent 96a59de commit dc83a64b196fc77c1e8b276e3037aca6af65924e @paulk-asert paulk-asert committed Jan 7, 2012
Showing with 2,195 additions and 2,034 deletions.
  1. +5 −7 build.gradle
  2. +1 −1 build.xml
  3. BIN gradle/wrapper/gradle-wrapper.jar
  4. +2 −2 gradle/wrapper/gradle-wrapper.properties
  5. +52 −55 gradlew
  6. +30 −22 gradlew.bat
  7. +4 −4 settings.gradle
  8. +2 −2 src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
  9. +14 −2 src/main/org/codehaus/groovy/runtime/InvokerHelper.java
  10. +4 −4 src/tck/src/org/codehaus/groovy/tck/TestGenerator.groovy
  11. +0 −15 src/test/groovy/util/AntTest_import.xml
  12. +0 −19 src/test/groovy/util/FileNameFinderTest.groovy
  13. +0 −177 src/test/org/codehaus/groovy/ant/GroovycTest.xml
  14. +0 −21 src/test/org/codehaus/groovy/ant/GroovycTest1.groovy
  15. +0 −31 src/test/org/codehaus/groovy/ant/GroovycTest2.java
  16. +3 −13 src/test/org/codehaus/groovy/classgen/TestSupport.java
  17. +22 −0 subprojects/groovy-ant/build.gradle
  18. 0 {src/main → subprojects/groovy-ant/src/main/groovy}/groovy/util/FileNameFinder.groovy
  19. +1 −1 {src/main → subprojects/groovy-ant/src/main/java}/groovy/util/AntBuilder.java
  20. 0 ...→ subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/AntProjectPropertiesDelegate.java
  21. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/CompileTaskSupport.java
  22. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/FileIterator.java
  23. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/FileScanner.java
  24. 0 ...ain → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/FileSystemCompilerFacade.java
  25. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/GenerateStubsTask.java
  26. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/Groovy.java
  27. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/Groovyc.java
  28. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/GroovycTask.java
  29. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/Groovydoc.java
  30. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/LoggingHelper.java
  31. +1 −1 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/RootLoaderRef.java
  32. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/UberCompileTask.java
  33. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/VerifyClass.java
  34. 0 {src/main → subprojects/groovy-ant/src/main/java}/org/codehaus/groovy/ant/package.html
  35. +9 −9 {src/test → subprojects/groovy-ant/src/test-resources}/groovy/util/AntTest.xml
  36. +15 −0 subprojects/groovy-ant/src/test-resources/groovy/util/AntTest_import.xml
  37. +5 −7 {src/test → subprojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/GroovyTest.xml
  38. +1 −0 {src/test → subprojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/GroovyTest1.groovy
  39. +1 −0 {src/test → subprojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/GroovyTest2.groovy
  40. +1 −0 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTestBad1.groovy
  41. +1 −0 ...subprojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/GroovyTest_errorMessage.groovy
  42. +190 −0 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
  43. +22 −0 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest1.groovy
  44. +35 −0 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest2.java
  45. +26 −26 ... → subprojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/IncorrectGenericsUsage.java
  46. +1 −1 ...ojects/groovy-ant/src/test-resources}/org/codehaus/groovy/ant/groovytest3/GroovyTest3Class.groovy
  47. +14 −33 {src/test → subprojects/groovy-ant/src/test/groovy}/groovy/util/AntTest.groovy
  48. +35 −0 subprojects/groovy-ant/src/test/groovy/groovy/util/FileNameFinderTest.groovy
  49. 0 {src/test → subprojects/groovy-ant/src/test/groovy}/groovy/util/SpoofTask.java
  50. 0 {src/test → subprojects/groovy-ant/src/test/groovy}/groovy/util/SpoofTaskContainer.java
  51. +17 −6 {src/test → subprojects/groovy-ant/src/test/groovy}/org/codehaus/groovy/ant/GroovyTest.java
  52. +2 −1 {src/test → subprojects/groovy-ant/src/test/groovy}/org/codehaus/groovy/ant/GroovyTest2Class.groovy
  53. +20 −19 {src/test → subprojects/groovy-ant/src/test/groovy}/org/codehaus/groovy/ant/GroovycTest.java
  54. +17 −0 subprojects/groovy-docgenerator/build.gradle
  55. +16 −2 ... → subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/DocGenerator.groovy
  56. 0 {src/tools → subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/groovy.ico
  57. 0 {src/tools → subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/index.html
  58. 0 ... subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/overview-summary.html
  59. 0 ...tools → subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/stylesheet.css
  60. 0 ...cts/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/template.allclasses-frame.html
  61. 0 ... → subprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/template.class.html
  62. 0 ...ubprojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/template.index-all.html
  63. 0 ...jects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/template.overview-frame.html
  64. 0 ...ojects/groovy-docgenerator/src/main/groovy}/org/codehaus/groovy/tools/template.package-frame.html
  65. +17 −0 subprojects/groovy-groovydoc/build.gradle
  66. 0 ...ubprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyAnnotationRef.java
  67. 0 ...n → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyClassDoc.java
  68. 0 ...bprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyConstructorDoc.java
  69. 0 {src/main → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyDoc.java
  70. 0 ...rojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyDocErrorReporter.java
  71. 0 ...ects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyExecutableMemberDoc.java
  72. 0 ...n → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyFieldDoc.java
  73. 0 ... → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyMemberDoc.java
  74. 0 ... → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyMethodDoc.java
  75. 0 ...→ subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyPackageDoc.java
  76. 0 ... → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyParameter.java
  77. 0 ...ojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyProgramElementDoc.java
  78. 0 ...in → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyRootDoc.java
  79. +1 −1 {src/main → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyTag.java
  80. 0 .../main → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/GroovyType.java
  81. 0 {src/main → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/groovydoc/package.html
  82. 0 ...cts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/ArrayClassDocWrapper.java
  83. 0 ...groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/ClasspathResourceManager.java
  84. 0 ...s/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/ExternalGroovyClassDoc.java
  85. 0 ...bprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/FileOutputTool.java
  86. 0 ...roovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/FileSystemResourceManager.java
  87. 0 .../groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/GroovyDocTemplateEngine.java
  88. 0 ...ubprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/GroovyDocTool.java
  89. 0 ...projects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/GroovyDocWriter.java
  90. 0 ...cts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilder.java
  91. +61 −61 ...subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/LinkArgument.java
  92. +239 −239 ...ain → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/Main.groovy
  93. +66 −66 ...→ subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/Main.properties
  94. 0 ...bprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/MockOutputTool.java
  95. 0 ...→ subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/OutputTool.java
  96. 0 ...projects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/ResourceManager.java
  97. 0 ...ovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyAbstractableElementDoc.java
  98. 0 ...roovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyAnnotationRef.java
  99. 0 ...cts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDoc.java
  100. 0 ...y-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyClassDocAssembler.java
  101. 0 ...oovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyConstructorDoc.java
  102. +237 −237 ...projects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyDoc.java
  103. 0 ...groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyExecutableMemberDoc.java
  104. 0 ...cts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyFieldDoc.java
  105. 0 ...ts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyMemberDoc.java
  106. 0 ...ts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyMethodDoc.java
  107. 0 ...s/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyPackageDoc.java
  108. 0 ...ts/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyParameter.java
  109. 0 ...y-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyProgramElementDoc.java
  110. 0 ...ects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyRootDoc.java
  111. +45 −45 ...projects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyTag.java
  112. 0 ...rojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/SimpleGroovyType.java
  113. +40 −40 ...oc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/GroovyDocTemplateInfo.java
  114. 0 .../src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocName.html
  115. 0 .../java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/classLevel/classDocStructuredData.xml
  116. 0 ...c/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/packageLevel/package-frame.html
  117. 0 ...main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/packageLevel/package-summary.html
  118. 0 ...a}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/packageLevel/packageDocStructuredData.xml
  119. 0 ...rc/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/allclasses-frame.html
  120. +182 −182 ...src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/deprecated-list.html
  121. +187 −187 ...ovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/help-doc.html
  122. +152 −152 ...vydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index-all.html
  123. 0 ...groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/index.html
  124. 0 ...roovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/inherit.gif
  125. 0 .../src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/overview-frame.html
  126. 0 ...rc/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/overview-summary.html
  127. 0 ...ain/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/rootDocStructuredData.xml
  128. 0 ...vydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/gstringTemplates/topLevel/stylesheet.css
  129. 0 ...in → subprojects/groovy-groovydoc/src/main/java}/org/codehaus/groovy/tools/groovydoc/package.html
  130. +36 −36 { → subprojects/groovy-groovydoc}/src/test-resources/groovydoc/buildWithCustomGroovyDoc.xml
  131. +31 −31 ...ojects/groovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/CustomGroovyDoc.java
  132. +64 −64 ...projects/groovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/GroovyDocTest.java
  133. 0 ...ects/groovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTest.java
  134. 0 ...oovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/GroovyDocToolTestSampleGroovy.groovy
  135. 0 ...oovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/GroovyRootDocBuilderTest.java
  136. +21 −21 ...y-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/DocumentedClass.groovy
  137. +4 −4 ...st/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyClassWithMultipleInterfaces.groovy
  138. +5 −5 ...-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterface1.groovy
  139. +5 −5 ...roovy}/org/codehaus/groovy/tools/groovydoc/testfiles/GroovyInterfaceWithMultipleInterfaces.groovy
  140. +4 −4 ...c/test/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/JavaClassWithMultipleInterfaces.java
  141. +4 −4 ...oovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/JavaInterface1.java
  142. +4 −4 ...st/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/JavaInterfaceWithMultipleInterfaces.java
  143. +17 −17 ...groovy-groovydoc/src/test/groovy}/org/codehaus/groovy/tools/groovydoc/testfiles/classDocName.html
  144. 0 ...ain → subprojects/groovy-jsr223/src/resources}/META-INF/services/javax.script.ScriptEngineFactory
  145. +2 −0 subprojects/groovy-servlet/build.gradle
  146. +2 −1 subprojects/groovy-servlet/src/test/groovy/groovy/servlet/ServletBindingTest.groovy
  147. +1 −0 ...jects/groovy-sql/src/resources/META-INF/services/org.codehaus.groovy.runtime.DefaultGroovyMethods
  148. +1 −1 subprojects/groovy-sql/src/test/groovy/groovy/sql/SqlWithBuilderTest.groovy
  149. +1 −0 ...cts/groovy-swing/src/resources/META-INF/services/org.codehaus.groovy.runtime.DefaultGroovyMethods
  150. +16 −0 subprojects/groovy-templates/build.gradle
  151. +1 −1 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/GStringTemplateEngine.java
  152. +1 −1 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/SimpleTemplateEngine.java
  153. +1 −1 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/Template.java
  154. +1 −1 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/TemplateEngine.java
  155. +1 −1 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/XmlTemplateEngine.java
  156. 0 {src/main → subprojects/groovy-templates/src/main/java}/groovy/text/package.html
  157. 0 {src/test → subprojects/groovy-templates/src/test/groovy}/groovy/text/SimpleTemplateTest.groovy
  158. 0 {src/test → subprojects/groovy-templates/src/test/java}/groovy/text/TemplateTest.java
  159. 0 {src/test → subprojects/groovy-templates/src/test/java}/groovy/text/XmlTemplateEngineTest.java
  160. +17 −0 subprojects/groovy-xml/build.gradle
  161. 0 {src/main → subprojects/groovy-xml/src/main/groovy}/groovy/xml/Entity.groovy
  162. 0 {src/main → subprojects/groovy-xml/src/main/groovy}/groovy/xml/StaxBuilder.groovy
  163. 0 {src/main → subprojects/groovy-xml/src/main/groovy}/groovy/xml/StreamingDOMBuilder.groovy
  164. 0 {src/main → subprojects/groovy-xml/src/main/groovy}/groovy/xml/StreamingMarkupBuilder.groovy
  165. 0 {src/main → subprojects/groovy-xml/src/main/groovy}/groovy/xml/StreamingSAXBuilder.groovy
  166. 0 ...cts/groovy-xml/src/main/groovy}/groovy/xml/streamingmarkupsupport/AbstractStreamingBuilder.groovy
  167. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/util/XmlNodePrinter.java
  168. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/util/XmlParser.java
  169. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/util/XmlSlurper.java
  170. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/DOMBuilder.java
  171. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/FactorySupport.java
  172. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/MarkupBuilder.java
  173. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/MarkupBuilderHelper.java
  174. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/Namespace.java
  175. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/NamespaceBuilder.java
  176. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/NamespaceBuilderSupport.java
  177. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/SAXBuilder.java
  178. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/XmlUtil.java
  179. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/dom/DOMCategory.java
  180. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/dom/package.html
  181. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/package.html
  182. 0 ... → subprojects/groovy-xml/src/main/java}/groovy/xml/streamingmarkupsupport/BaseMarkupBuilder.java
  183. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/streamingmarkupsupport/Builder.java
  184. 0 ...ubprojects/groovy-xml/src/main/java}/groovy/xml/streamingmarkupsupport/StreamingMarkupWriter.java
  185. 0 {src/main → subprojects/groovy-xml/src/main/java}/groovy/xml/streamingmarkupsupport/package.html
  186. +58 −58 {src/main → subprojects/groovy-xml/src/main/java}/org/codehaus/groovy/runtime/XmlGroovyMethods.java
  187. +1 −0 ...jects/groovy-xml/src/resources/META-INF/services/org.codehaus.groovy.runtime.DefaultGroovyMethods
  188. +9 −9 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/util/CustomNode.java
  189. +19 −19 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/util/CustomXmlParser.java
  190. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/util/XmlNodePrinterTest.groovy
  191. +5 −4 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/util/XmlParserTest.groovy
  192. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/util/XmlSlurperTest.groovy
  193. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/BuilderTestSupport.groovy
  194. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/DOMTest.groovy
  195. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/FactorySupportTest.java
  196. +1 −0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/GpathSyntaxTestSupport.groovy
  197. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/MarkupBuilderTest.groovy
  198. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/MarkupWithWriterTest.groovy
  199. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/MixedMarkupTestSupport.groovy
  200. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/NamespaceNodeGPathTest.groovy
  201. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/NamespaceNodeTest.groovy
  202. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/SAXTest.groovy
  203. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/StreamingMarkupBuilderTest.groovy
  204. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/StreamingSAXBuilderTest.groovy
  205. +3 −3 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/TestXmlSupport.java
  206. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/TraversalTestSupport.groovy
  207. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/UseMarkupWithWriterScript.groovy
  208. 0 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/VerboseDOMTest.groovy
  209. +13 −10 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/XmlTest.java
  210. +2 −2 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/dom/DOMCategoryTest.groovy
  211. +46 −30 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/dom/DOMTest.groovy
  212. +1 −5 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/dom/NamespaceDOMTest.groovy
  213. +1 −1 {src/test → subprojects/groovy-xml/src/test/groovy}/groovy/xml/vm6/StaxBuilderTest.groovy
View
12 build.gradle
@@ -59,21 +59,18 @@ dependencies {
compile("org.apache.ivy:ivy:2.2.0") {
transitive = false
}
- runtime "org.apache.ant:ant-junit:1.8.2"
- runtime "org.apache.ant:ant-launcher:1.8.2"
- runtime "org.apache.ant:ant-antlr:1.8.2"
runtime("commons-logging:commons-logging:1.1.1") {
exclude(group: 'log4j', module: 'log4j')
exclude(group: 'logkit', module: 'logkit')
exclude(group: 'avalon-framework', module: 'avalon-framework')
}
testCompile "jmock:jmock:1.2.0"
testCompile "jmock:jmock-cglib:1.2.0"
- testCompile "xmlunit:xmlunit:1.3"
+// testCompile "xmlunit:xmlunit:1.3"
testCompile "ch.qos.logback:logback-classic:0.9.21"
testCompile "log4j:log4j:1.2.16"
testCompile "org.slf4j:jcl-over-slf4j:1.6.0"
- testCompile "com.thoughtworks.qdox:qdox:1.12"
+// testCompile "com.thoughtworks.qdox:qdox:1.12"
testCompile "org.apache.ant:ant-testutil:1.8.2"
runtime "org.codehaus.gpars:gpars:0.12"
@@ -88,7 +85,6 @@ dependencies {
exclude(module: 'ant')
}
tools "asm:asm:3.3.1"
- tools "com.thoughtworks.qdox:qdox:1.12"
tools "biz.aQute:bnd:0.0.401"
examplesCompile "lucene:lucene:1.4.3"
@@ -109,6 +105,8 @@ dependencies {
antlr "org.apache.ant:ant-antlr:1.8.2"
+// groovy project(':subprojects:groovy-ant')
+ groovy localGroovy()
testCompile project(':subprojects:groovy-bsf')
testCompile project(':subprojects:groovy-jsr223')
testCompile project(':subprojects:groovy-jmx')
@@ -284,5 +282,5 @@ apply from: "$projectDir/gradle/upload.gradle"
task wrapper(type: Wrapper) {
// gradleVersion = '1.0-milestone-5-20110929000016+0200'
// distributionUrl = "http://repo.gradle.org/gradle/distributions-snapshots/gradle-${gradleVersion}-bin.zip"
- gradleVersion = '1.0-milestone-6'
+ gradleVersion = '1.0-milestone-7'
}
View
2 build.xml
@@ -836,7 +836,7 @@ $Date$
footer="${docFooter}"
overview="src/main/overview.html">
<link packages="javax.servlet.,javax.management." href="http://java.sun.com/j2ee/1.4/docs/api"/>
- <link packages="java.,org.xml.,javax.,org.xml." href="http://java.sun.com/javase/6/docs/api"/>
+ <link packages="java.,org.xml.,javax.,org.w3c." href="http://java.sun.com/javase/6/docs/api"/>
<link packages="org.apache.ant.,org.apache.tools.ant." href="http://www.dpml.net/api/ant/1.7.0"/>
<link packages="org.junit.,junit." href="http://junit.sourceforge.net/junit3.8.1/javadoc"/>
<link packages="org.apache.commons.cli." href="http://commons.apache.org/cli/api-release"/>
View
BIN gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
View
4 gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Sat Dec 10 20:34:52 EST 2011
+#Fri Jan 06 21:23:31 EST 2012
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=http\://gradle.artifactoryonline.com/gradle/distributions/gradle-1.0-milestone-6-bin.zip
+distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-7-bin.zip
View
107 gradlew
@@ -1,16 +1,16 @@
#!/bin/bash
##############################################################################
-## ##
-## Gradle wrapper script for UN*X ##
-## ##
+##
+## Gradle start up script for UN*X
+##
##############################################################################
-# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-# GRADLE_OPTS="$GRADLE_OPTS -Xmx512m"
-# JAVA_OPTS="$JAVA_OPTS -Xmx512m"
+# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+DEFAULT_JVM_OPTS=""
-GRADLE_APP_NAME=Gradle
+APP_NAME="Gradle"
+APP_BASE_NAME=`basename "$0"`
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
@@ -42,54 +42,51 @@ case "`uname`" in
;;
esac
-# Attempt to set JAVA_HOME if it's not already set.
-if [ -z "$JAVA_HOME" ] ; then
- if $darwin ; then
- [ -z "$JAVA_HOME" -a -d "/Library/Java/Home" ] && export JAVA_HOME="/Library/Java/Home"
- [ -z "$JAVA_HOME" -a -d "/System/Library/Frameworks/JavaVM.framework/Home" ] && export JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Home"
- else
- javaExecutable="`which javac`"
- [ -z "$javaExecutable" -o "`expr \"$javaExecutable\" : '\([^ ]*\)'`" = "no" ] && die "JAVA_HOME not set and cannot find javac to deduce location, please set JAVA_HOME."
- # readlink(1) is not available as standard on Solaris 10.
- readLink=`which readlink`
- [ `expr "$readLink" : '\([^ ]*\)'` = "no" ] && die "JAVA_HOME not set and readlink not available, please set JAVA_HOME."
- javaExecutable="`readlink -f \"$javaExecutable\"`"
- javaHome="`dirname \"$javaExecutable\"`"
- javaHome=`expr "$javaHome" : '\(.*\)/bin'`
- export JAVA_HOME="$javaHome"
- fi
-fi
-
# For Cygwin, ensure paths are in UNIX format before anything is touched.
if $cygwin ; then
- [ -n "$JAVACMD" ] && JAVACMD=`cygpath --unix "$JAVACMD"`
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
fi
-STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
-CLASSPATH=`dirname "$0"`/gradle/wrapper/gradle-wrapper.jar
-WRAPPER_PROPERTIES=`dirname "$0"`/gradle/wrapper/gradle-wrapper.properties
+# Attempt to set APP_HOME
+# Resolve links: $0 may be a link
+PRG="$0"
+# Need this for relative symlinks.
+while [ -h "$PRG" ] ; do
+ ls=`ls -ld "$PRG"`
+ link=`expr "$ls" : '.*-> \(.*\)$'`
+ if expr "$link" : '/.*' > /dev/null; then
+ PRG="$link"
+ else
+ PRG=`dirname "$PRG"`"/$link"
+ fi
+done
+SAVED="`pwd`"
+cd "`dirname \"$PRG\"`/"
+APP_HOME="`pwd -P`"
+cd "$SAVED"
+
+CLASSPATH=$APP_HOME/gradle\wrapper\gradle-wrapper.jar
+
# Determine the Java command to use to start the JVM.
-if [ -z "$JAVACMD" ] ; then
- if [ -n "$JAVA_HOME" ] ; then
- if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
- # IBM's JDK on AIX uses strange locations for the executables
- JAVACMD="$JAVA_HOME/jre/sh/java"
- else
- JAVACMD="$JAVA_HOME/bin/java"
- fi
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD="$JAVA_HOME/jre/sh/java"
else
- JAVACMD="java"
+ JAVACMD="$JAVA_HOME/bin/java"
fi
-fi
-if [ ! -x "$JAVACMD" ] ; then
- die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ JAVACMD="java"
+ which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
-fi
-if [ -z "$JAVA_HOME" ] ; then
- warn "JAVA_HOME environment variable is not set"
fi
# Increase the maximum file descriptors if we can.
@@ -108,15 +105,15 @@ if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
fi
fi
-# For Darwin, add GRADLE_APP_NAME to the JAVA_OPTS as -Xdock:name
+# For Darwin, add APP_NAME to the JAVA_OPTS as -Xdock:name
if $darwin; then
- JAVA_OPTS="$JAVA_OPTS -Xdock:name=$GRADLE_APP_NAME"
+ JAVA_OPTS="$JAVA_OPTS -Xdock:name=$APP_NAME"
# we may also want to set -Xdock:image
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
- JAVA_HOME=`cygpath --path --mixed "$JAVA_HOME"`
+ APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
# We build the pattern for arguments to be converted via cygpath
@@ -143,7 +140,7 @@ if $cygwin ; then
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
- done
+ done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
@@ -158,11 +155,11 @@ if $cygwin ; then
esac
fi
-GRADLE_APP_BASE_NAME=`basename "$0"`
+# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
+function splitJvmOpts() {
+ JVM_OPTS=("$@")
+}
+eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
+JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
-exec "$JAVACMD" $JAVA_OPTS $GRADLE_OPTS \
- -classpath "$CLASSPATH" \
- -Dorg.gradle.appname="$GRADLE_APP_BASE_NAME" \
- -Dorg.gradle.wrapper.properties="$WRAPPER_PROPERTIES" \
- $STARTER_MAIN_CLASS \
- "$@"
+exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
View
52 gradlew.bat
@@ -1,24 +1,37 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
-@rem ##
-@rem Gradle startup script for Windows ##
-@rem ##
+@rem
+@rem Gradle startup script for Windows
+@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
-@rem Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
-@rem set GRADLE_OPTS=%GRADLE_OPTS% -Xmx512m
-@rem set JAVA_OPTS=%JAVA_OPTS% -Xmx512m
+@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
+set DEFAULT_JVM_OPTS=
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.\
+if "%DIRNAME%" == "" set DIRNAME=.
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
@rem Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
set JAVA_EXE=java.exe
-if not defined JAVA_HOME goto init
+%JAVA_EXE% -version >NUL 2>&1
+if "%ERRORLEVEL%" == "0" goto init
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+goto fail
+
+:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
@@ -29,14 +42,14 @@ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
-echo.
-goto end
+
+goto fail
:init
@rem Get command-line arguments, handling Windowz variants
if not "%OS%" == "Windows_NT" goto win9xME_args
-if "%eval[2+2]" == "4" goto 4NT_args
+if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
@@ -56,27 +69,22 @@ set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
-set STARTER_MAIN_CLASS=org.gradle.wrapper.GradleWrapperMain
-set CLASSPATH=%DIRNAME%\gradle\wrapper\gradle-wrapper.jar
-set WRAPPER_PROPERTIES=%DIRNAME%\gradle\wrapper\gradle-wrapper.properties
-
-set GRADLE_OPTS=%JAVA_OPTS% %GRADLE_OPTS% -Dorg.gradle.wrapper.properties="%WRAPPER_PROPERTIES%"
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
-"%JAVA_EXE%" %GRADLE_OPTS% -classpath "%CLASSPATH%" %STARTER_MAIN_CLASS% %CMD_LINE_ARGS%
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
-if not "%OS%"=="Windows_NT" echo 1 > nul | choice /n /c:1
-
+:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit "%ERRORLEVEL%"
-exit /b "%ERRORLEVEL%"
+if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
+exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
-:omega
+:omega
View
8 settings.gradle
@@ -1,4 +1,4 @@
-include 'subprojects:groovy-bsf', 'subprojects:groovy-console', 'subprojects:groovy-jmx',
- 'subprojects:groovy-json', 'subprojects:groovy-jsr223', 'subprojects:groovy-servlet',
- 'subprojects:groovy-shell', 'subprojects:groovy-sql', 'subprojects:groovy-swing',
- 'subprojects:groovy-test'
+include 'subprojects:groovy-ant', 'subprojects:groovy-bsf', 'subprojects:groovy-console', 'subprojects:groovy-docgenerator',
+ 'subprojects:groovy-groovydoc', 'subprojects:groovy-jmx', 'subprojects:groovy-json', 'subprojects:groovy-jsr223',
+ 'subprojects:groovy-servlet', 'subprojects:groovy-shell', 'subprojects:groovy-sql', 'subprojects:groovy-swing',
+ 'subprojects:groovy-templates', 'subprojects:groovy-test', 'subprojects:groovy-xml'
View
4 src/main/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
@@ -133,9 +133,9 @@
public static final Class[] DGM_LIKE_CLASSES = new Class[]{
DefaultGroovyMethods.class,
// TODO provide alternative way for these to be registered
- //SwingGroovyMethods.class,
+// SwingGroovyMethods.class,
// SqlGroovyMethods.class,
- XmlGroovyMethods.class,
+// XmlGroovyMethods.class,
EncodingGroovyMethods.class,
DateGroovyMethods.class,
ProcessGroovyMethods.class
View
16 src/main/org/codehaus/groovy/runtime/InvokerHelper.java
@@ -16,7 +16,6 @@
package org.codehaus.groovy.runtime;
import groovy.lang.*;
-import groovy.xml.XmlUtil;
import org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl;
import org.codehaus.groovy.runtime.metaclass.MissingMethodExecutionFailed;
import org.codehaus.groovy.runtime.powerassert.PowerAssertionError;
@@ -26,6 +25,8 @@
import java.beans.Introspector;
import java.io.*;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
@@ -522,7 +523,18 @@ public static String format(Object arguments, boolean verbose, int maxSize) {
return formatMap((Map) arguments, verbose, maxSize);
}
if (arguments instanceof Element) {
- return XmlUtil.serialize((Element) arguments);
+ try {
+ Method serialize = Class.forName("groovy.xml.XmlUtil").getMethod("serialize", Element.class);
+ return (String) serialize.invoke(null, arguments);
+ } catch (ClassNotFoundException e) {
+ throw new RuntimeException(e);
+ } catch (NoSuchMethodException e) {
+ throw new RuntimeException(e);
+ } catch (InvocationTargetException e) {
+ throw new RuntimeException(e);
+ } catch (IllegalAccessException e) {
+ throw new RuntimeException(e);
+ }
}
if (arguments instanceof String) {
if (verbose) {
View
8 src/tck/src/org/codehaus/groovy/tck/TestGenerator.groovy
@@ -142,7 +142,7 @@ class TestGenerator{
* Common setup code for each test method
*/
void printCommonTestMethodStart(result, fullMethodName,someSrcText) {
- def buffer = new java.io.StringReader(someSrcText)
+ def buffer = new StringReader(someSrcText)
result.println(" public void ${fullMethodName}() throws Throwable {")
result.println(" StringBuffer srcBuffer = new StringBuffer();")
@@ -170,21 +170,21 @@ class TestGenerator{
}
}
- //remove nonalphanumeric characters
+ //remove non-alphanumeric characters
methodName = methodName.replaceAll("[^A-Za-z0-9]","")
return methodName
}
/**
- * Fetches a list of all the occurances of text between a string delimiter.
+ * Fetches a list of all the occurrences of text between a string delimiter.
*/
List scrape(String txt, String tag) {
return scrape(txt,tag,tag)
}
/**
- * Fetches a list of all the occurances of text between two string delimiters (tags).
+ * Fetches a list of all the occurrences of text between two string delimiters (tags).
*/
List scrape(String txt, String openTag, String closeTag) {
def i = 0; def j = 0; def k = 0;
View
15 src/test/groovy/util/AntTest_import.xml
@@ -1,15 +0,0 @@
-<!--
-Sample file to test AntBuilder import feature
- -->
-<project default="firstTarget">
-
- <echo message="outside targets, at the top"/>
-
- <target name="firstTarget">
- <echo message="inside firstTarget"/>
- </target>
-
- <target name="2ndTarget">
- <echo message="inside 2ndTarget"/>
- </target>
-</project>
View
19 src/test/groovy/util/FileNameFinderTest.groovy
@@ -1,19 +0,0 @@
-package groovy.util
-
-/**
- Make sure FileNameFinder uses Ant filesets correctly.
- @author Dierk Koenig
- @author Paul King
-*/
-class fileNameFinderTest extends GroovyLogTestCase {
-
- void testFilesInTestDirArePickedUp() {
- def finder = new FileNameFinder()
- def files1 = finder.getFileNames('src/test','*')
- assert files1, 'There should be files in src/test'
- // now collect all those not starting with the letter 'J'
- def files2 = finder.getFileNames('src/test','*','J*')
- assert files2, 'There should be files in src/test'
- assert files1.size() > files2.size()
- }
-}
View
177 src/test/org/codehaus/groovy/ant/GroovycTest.xml
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-
-<!--
-
- Copyright © 2008-9 Russel Winder
-
- 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.
-
--->
-
-<project name="Test Groovyc Task" default="test1">
-
- <property name="srcPath" value="."/>
- <property name="destPath" value="${user.dir}/target/test-classes"/>
-
- <property name="javaVersion" value="5"/>
-
- <path id="groovyMaterials">
- <pathelement path="${java.class.path}"/>
- </path>
-
- <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovyMaterials"/>
-
- <target name="GroovycTest1_NoFork_NoClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_NoFork_WithGroovyClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_NoFork_WithJavaClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_NoFork_WithBothClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_NoClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithGroovyClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials" fork="true"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithJavaClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithBothClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials" fork="true"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_Joint_NoFork_NoClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
- </target>
-
- <target name="GroovycTest1_Joint_NoFork_WithGroovyClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" classpathref="groovyMaterials">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
- </target>
-
- <target name="Groovyc_Joint_NoFork_NestedCompilerArg_WithGroovyClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="IncorrectGenericsUsage.java" classpathref="groovyMaterials">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true">
- <compilerarg value="-Xlint"/>
- </javac>
- </groovyc>
- </target>
-
- <target name="GroovycTest1_Joint_NoFork_WithJavaClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_Joint_NoFork_WithBothClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" classpathref="groovyMaterials">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_Joint_ForkGroovy_NoClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" fork="true">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
- </target>
-
- <target name="GroovycTest1_Joint_ForkGroovy_WithGroovyClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" classpathref="groovyMaterials" fork="true">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
- </target>
-
- <target name="GroovycTest1_Joint_ForkGroovy_WithJavaClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" fork="true">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_Joint_ForkGroovy_WithBothClasspath">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" classpathref="groovyMaterials" fork="true">
- <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
- </groovyc>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_NoClasspath_WithJavaHome">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true" javahome="${alt.java.home}"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithGroovyClasspath_WithJavaHome">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials" fork="true" javahome="${alt.java.home}"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithJavaClasspath_WithJavaHome">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true" javahome="${alt.java.home}"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_WithBothClasspath_WithJavaHome">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials" fork="true" javahome="${alt.java.home}"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
- </target>
-
- <target name="GroovycTest1_ForkGroovy_NoClasspath_Fail">
- <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovyTestBad1.groovy" fork="true"/>
- <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
- </target>
-
- <target name="clean">
- <delete quiet="true">
- <fileset dir="${destPath}/org/codehaus/groovy/ant">
- <include name="GroovycTest1*.class"/>
- <include name="IncorrectGenericsUsage.class"/>
- </fileset>
- </delete>
- </target>
-
-</project>
View
21 src/test/org/codehaus/groovy/ant/GroovycTest1.groovy
@@ -1,21 +0,0 @@
-/*
- * Copyright © 2008 Russel Winder
- *
- * 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 org.codehaus.groovy.ant ;
-
-class GroovycTest1 {
- static void main ( String[] args ) {
- ( new File ( 'target/test-classes/org/codehaus/groovy/ant/GroovycTest1_Result.txt' ) ).write ( 'OK.' )
- }
-}
View
31 src/test/org/codehaus/groovy/ant/GroovycTest2.java
@@ -1,31 +0,0 @@
-/*
- * Copyright © 2008 Russel Winder
- *
- * 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 org.codehaus.groovy.ant ;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-class GroovycTest2 {
- static void main ( String[] args ) throws IOException {
- File f = new File("target/test-classes/org/codehaus/groovy/ant/GroovycTest2_Result.txt");
- FileOutputStream fout = new FileOutputStream(f);
- try {
- fout.write("OK.".getBytes());
- } finally {
- try { fout.close(); } catch (IOException ioe) { }
- }
- }
-}
View
16 src/test/org/codehaus/groovy/classgen/TestSupport.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2011 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -70,12 +70,9 @@ protected void assertSetProperty(Object bean, String property, Object newValue)
PropertyDescriptor descriptor = getDescriptor(bean, property);
Method method = descriptor.getWriteMethod();
assertTrue("has setter method", method != null);
-
Object[] args = {newValue};
Object value = invokeMethod(bean, method, args);
-
assertEquals("should return null", null, value);
-
assertGetProperty(bean, property, newValue);
}
@@ -84,8 +81,7 @@ protected void assertGetProperty(Object bean, String property, Object expected)
Method method = descriptor.getReadMethod();
assertTrue("has getter method", method != null);
- Object[] args = {
- };
+ Object[] args = { };
Object value = invokeMethod(bean, method, args);
/*
@@ -112,8 +108,7 @@ protected Object invokeMethod(Object bean, Method method, Object[] args) throws
protected PropertyDescriptor getDescriptor(Object bean, String property) throws Exception {
BeanInfo info = Introspector.getBeanInfo(bean.getClass());
PropertyDescriptor[] descriptors = info.getPropertyDescriptors();
- for (int i = 0; i < descriptors.length; i++) {
- PropertyDescriptor descriptor = descriptors[i];
+ for (PropertyDescriptor descriptor : descriptors) {
if (descriptor.getName().equals(property)) {
return descriptor;
}
@@ -124,7 +119,6 @@ protected PropertyDescriptor getDescriptor(Object bean, String property) throws
protected void assertField(Class aClass, String name, int modifiers, ClassNode type) throws Exception {
Field field = aClass.getDeclaredField(name);
-
assertTrue("Found field called: " + name, field != null);
assertEquals("Name", name, field.getName());
assertEquals("Type", type.getName(), field.getType().getName());
@@ -161,19 +155,15 @@ public Object run() {
protected void assertScriptFile(String fileName) throws Exception {
log.info("About to execute script: " + fileName);
-
Class groovyClass = loader.parseClass(new GroovyCodeSource(new File(fileName)));
Script script = InvokerHelper.createScript(groovyClass, new Binding());
script.run();
}
protected GroovyObject compile(String fileName) throws Exception {
Class groovyClass = loader.parseClass(new GroovyCodeSource(new File(fileName)));
-
GroovyObject object = (GroovyObject) groovyClass.newInstance();
-
assertTrue(object != null);
-
return object;
}
}
View
22 subprojects/groovy-ant/build.gradle
@@ -0,0 +1,22 @@
+apply plugin: 'groovy'
+apply plugin: 'code-quality'
+
+// TODO set these using subprojects?
+checkstyleConfigFileName = "../../config/checkstyle/checkstyle.xml"
+codeNarcConfigFileName = "../../config/codenarc/codenarc.groovy"
+
+repositories {
+ mavenCentral()
+}
+
+dependencies {
+ compile project(':')
+ groovy project(':')
+ compile "org.apache.ant:ant:1.8.2"
+ runtime "org.apache.ant:ant-junit:1.8.2"
+ runtime "org.apache.ant:ant-launcher:1.8.2"
+ runtime "org.apache.ant:ant-antlr:1.8.2"
+ // for groovydoc ant command
+ compile project(':subprojects:groovy-groovydoc')
+ testCompile project(':subprojects:groovy-test')
+}
View
0 src/main/groovy/util/FileNameFinder.groovy → .../groovy/groovy/util/FileNameFinder.groovy
File renamed without changes.
View
2 src/main/groovy/util/AntBuilder.java → ...src/main/java/groovy/util/AntBuilder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2011 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
View
0 ...ovy/ant/AntProjectPropertiesDelegate.java → ...ovy/ant/AntProjectPropertiesDelegate.java
File renamed without changes.
View
0 ...dehaus/groovy/ant/CompileTaskSupport.java → ...dehaus/groovy/ant/CompileTaskSupport.java
File renamed without changes.
View
0 ...org/codehaus/groovy/ant/FileIterator.java → ...org/codehaus/groovy/ant/FileIterator.java
File renamed without changes.
View
0 .../org/codehaus/groovy/ant/FileScanner.java → .../org/codehaus/groovy/ant/FileScanner.java
File renamed without changes.
View
0 .../groovy/ant/FileSystemCompilerFacade.java → .../groovy/ant/FileSystemCompilerFacade.java
File renamed without changes.
View
0 ...odehaus/groovy/ant/GenerateStubsTask.java → ...odehaus/groovy/ant/GenerateStubsTask.java
File renamed without changes.
View
0 src/main/org/codehaus/groovy/ant/Groovy.java → .../java/org/codehaus/groovy/ant/Groovy.java
File renamed without changes.
View
0 ...main/org/codehaus/groovy/ant/Groovyc.java → ...java/org/codehaus/groovy/ant/Groovyc.java
File renamed without changes.
View
0 .../org/codehaus/groovy/ant/GroovycTask.java → .../org/codehaus/groovy/ant/GroovycTask.java
File renamed without changes.
View
0 ...in/org/codehaus/groovy/ant/Groovydoc.java → ...va/org/codehaus/groovy/ant/Groovydoc.java
File renamed without changes.
View
0 ...rg/codehaus/groovy/ant/LoggingHelper.java → ...rg/codehaus/groovy/ant/LoggingHelper.java
File renamed without changes.
View
2 ...rg/codehaus/groovy/ant/RootLoaderRef.java → ...rg/codehaus/groovy/ant/RootLoaderRef.java
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
package org.codehaus.groovy.ant;
import org.apache.tools.ant.AntClassLoader;
View
0 .../codehaus/groovy/ant/UberCompileTask.java → .../codehaus/groovy/ant/UberCompileTask.java
File renamed without changes.
View
0 .../org/codehaus/groovy/ant/VerifyClass.java → .../org/codehaus/groovy/ant/VerifyClass.java
File renamed without changes.
View
0 ...main/org/codehaus/groovy/ant/package.html → ...java/org/codehaus/groovy/ant/package.html
File renamed without changes.
View
18 src/test/groovy/util/AntTest.xml → ...rc/test-resources/groovy/util/AntTest.xml 100755 → 100644
@@ -15,13 +15,13 @@ as what we expect from the AntBuilder
<spoof foo="123"/>
</spoofcontainer>
</target>
-
- <target name="testAntBuilderWithinGroovyTask" description="Test for GROOVY-1602">
- <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
- <echo message="before groovy task"/>
- <groovy>
- ant.echo(message: 'ant builder within groovy task')
- </groovy>
- <echo message="after groovy task"/>
- </target>
+
+ <target name="testAntBuilderWithinGroovyTask" description="Test for GROOVY-1602">
+ <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
+ <echo message="before groovy task"/>
+ <groovy>
+ ant.echo(message: 'ant builder within groovy task')
+ </groovy>
+ <echo message="after groovy task"/>
+ </target>
</project>
View
15 subprojects/groovy-ant/src/test-resources/groovy/util/AntTest_import.xml
@@ -0,0 +1,15 @@
+<!--
+Sample file to test AntBuilder import feature
+ -->
+<project default="firstTarget">
+
+ <echo message="outside targets, at the top"/>
+
+ <target name="firstTarget">
+ <echo message="inside firstTarget"/>
+ </target>
+
+ <target name="2ndTarget">
+ <echo message="inside 2ndTarget"/>
+ </target>
+</project>
View
12 ...st/org/codehaus/groovy/ant/GroovyTest.xml → ...es/org/codehaus/groovy/ant/GroovyTest.xml
@@ -61,13 +61,11 @@
<target name="groovyErrorMsg" depends="defineTask">
<groovy>
- // should produce an error message
-
- def f = {
- t.notExisting()
- }
-
- f()
+ // should produce an error message
+ def f = {
+ t.notExisting()
+ }
+ f()
</groovy>
</target>
View
1 ...rg/codehaus/groovy/ant/GroovyTest1.groovy → ...rg/codehaus/groovy/ant/GroovyTest1.groovy
@@ -1,2 +1,3 @@
+package org.codehaus.groovy.ant
org.codehaus.groovy.ant.GroovyTest.FLAG = "from groovy file called from ant"
View
1 ...rg/codehaus/groovy/ant/GroovyTest2.groovy → ...rg/codehaus/groovy/ant/GroovyTest2.groovy
@@ -1,3 +1,4 @@
+package org.codehaus.groovy.ant
def foo = new GroovyTest2Class()
foo.doSomething()
View
1 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovyTestBad1.groovy
@@ -0,0 +1 @@
+class GroovyTest1Bad { Thi$ $hould Fail! (somehow) };:??''+_|\|
View
1 ...groovy/ant/GroovyTest_errorMessage.groovy → ...groovy/ant/GroovyTest_errorMessage.groovy
@@ -1,3 +1,4 @@
+package org.codehaus.groovy.ant
// should produce an error message
def f = {
t.notExisting()
View
190 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest.xml
@@ -0,0 +1,190 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<!--
+
+ Copyright 2003-2012 the original author or authors.
+
+ 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.
+
+-->
+
+<project name="Test Groovyc Task" default="test1">
+
+ <property name="srcPath" value="."/>
+ <property name="destPath" value="${user.dir}/target/test-classes"/>
+
+ <property name="javaVersion" value="5"/>
+
+ <path id="groovyMaterials">
+ <pathelement path="${java.class.path}"/>
+ </path>
+
+ <taskdef name="groovyc" classname="org.codehaus.groovy.ant.Groovyc" classpathref="groovyMaterials"/>
+
+ <target name="GroovycTest1_NoFork_NoClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_NoFork_WithGroovyClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"
+ classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_NoFork_WithJavaClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_NoFork_WithBothClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy"
+ classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_NoClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithGroovyClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"
+ fork="true"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithJavaClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithBothClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"
+ fork="true"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_NoFork_NoClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_NoFork_WithGroovyClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java"
+ classpathref="groovyMaterials">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
+ </target>
+
+ <target name="Groovyc_Joint_NoFork_NestedCompilerArg_WithGroovyClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="IncorrectGenericsUsage.java"
+ classpathref="groovyMaterials">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true">
+ <compilerarg value="-Xlint"/>
+ </javac>
+ </groovyc>
+ </target>
+
+ <target name="GroovycTest1_Joint_NoFork_WithJavaClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_NoFork_WithBothClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java"
+ classpathref="groovyMaterials">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_ForkGroovy_NoClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" fork="true">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_ForkGroovy_WithGroovyClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java"
+ classpathref="groovyMaterials" fork="true">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_ForkGroovy_WithJavaClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java" fork="true">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_Joint_ForkGroovy_WithBothClasspath">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy,Groovyc2.java"
+ classpathref="groovyMaterials" fork="true">
+ <javac source="${javaVersion}" target="${javaVersion}" debug="true"/>
+ </groovyc>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest2" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_NoClasspath_WithJavaHome">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"
+ javahome="${alt.java.home}"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithGroovyClasspath_WithJavaHome">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"
+ fork="true" javahome="${alt.java.home}"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithJavaClasspath_WithJavaHome">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" fork="true"
+ javahome="${alt.java.home}"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_WithBothClasspath_WithJavaHome">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovycTest1.groovy" classpathref="groovyMaterials"
+ fork="true" javahome="${alt.java.home}"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1" classpathref="groovyMaterials"/>
+ </target>
+
+ <target name="GroovycTest1_ForkGroovy_NoClasspath_Fail">
+ <groovyc srcdir="${srcPath}" destdir="${destPath}" includes="GroovyTestBad1.groovy" fork="true"/>
+ <java classname="org.codehaus.groovy.ant.GroovycTest1"/>
+ </target>
+
+ <target name="clean">
+ <delete quiet="true">
+ <fileset dir="${destPath}/org/codehaus/groovy/ant">
+ <include name="GroovycTest1*.class"/>
+ <include name="IncorrectGenericsUsage.class"/>
+ </fileset>
+ </delete>
+ </target>
+
+</project>
View
22 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest1.groovy
@@ -0,0 +1,22 @@
+/*
+ * Copyright 2003-2012 the original author or authors.
+ *
+ * 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 org.codehaus.groovy.ant
+
+class GroovycTest1 {
+ static void main ( String[] args ) {
+ ( new File ( 'build/test-classes/org/codehaus/groovy/ant/GroovycTest1_Result.txt' ) ).write ( 'OK.' )
+ }
+}
View
35 subprojects/groovy-ant/src/test-resources/org/codehaus/groovy/ant/GroovycTest2.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2003-2012 the original author or authors.
+ *
+ * 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 org.codehaus.groovy.ant;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+class GroovycTest2 {
+ static void main(String[] args) throws IOException {
+ File f = new File("build/test-classes/org/codehaus/groovy/ant/GroovycTest2_Result.txt");
+ FileOutputStream fout = new FileOutputStream(f);
+ try {
+ fout.write("OK.".getBytes());
+ } finally {
+ try {
+ fout.close();
+ } catch (IOException ioe) {
+ }
+ }
+ }
+}
View
52 ...us/groovy/ant/IncorrectGenericsUsage.java → ...us/groovy/ant/IncorrectGenericsUsage.java
@@ -1,27 +1,27 @@
-/*
- * Copyright 2003-2011 the original author or authors.
- *
- * 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 org.codehaus.groovy.ant;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class IncorrectGenericsUsage {
- private ArrayList<String> x = new ArrayList<String>();
-
- public void doIt(final List<?> z) {
- x = (ArrayList) z;
- }
+/*
+ * Copyright 2003-2012 the original author or authors.
+ *
+ * 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 org.codehaus.groovy.ant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class IncorrectGenericsUsage {
+ private ArrayList<String> x = new ArrayList<String>();
+
+ public void doIt(final List<?> z) {
+ x = (ArrayList) z;
+ }
}
View
2 ...y/ant/groovytest3/GroovyTest3Class.groovy → ...y/ant/groovytest3/GroovyTest3Class.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2010 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
View
47 src/test/groovy/util/AntTest.groovy → ...rc/test/groovy/groovy/util/AntTest.groovy
@@ -1,5 +1,5 @@
/*
- * Copyright 2003-2010 the original author or authors.
+ * Copyright 2003-2012 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,48 +31,38 @@ class AntTest extends GroovyTestCase {
void testAnt() {
def ant = new AntBuilder()
-
// let's just call one task
ant.echo("hello")
-
// here's an example of a block of Ant inside GroovyMarkup
ant.sequential {
echo("inside sequential")
-
- def myDir = "target/AntTest/"
-
+ def myDir = "build/AntTest/"
mkdir(dir: myDir)
copy(todir: myDir) {
- fileset(dir: "src/test") {
+ fileset(dir: "src/test/groovy") {
include(name: "**/*.groovy")
}
}
-
echo("done")
}
-
// now let's do some normal Groovy again
- def file = new File("target/AntTest/groovy/util/AntTest.groovy")
+ def file = new File("build/AntTest/groovy/util/AntTest.groovy")
assert file.exists()
}
void testFileIteration() {
def ant = new AntBuilder()
-
// let's create a scanner of filesets
def scanner = ant.fileScanner {
- fileset(dir: "src/test") {
+ fileset(dir: "src/test/groovy") {
include(name: "**/Ant*.groovy")
}
}
-
// now let's iterate over
def found = false
for (f in scanner) {
println("Found file ${f}")
-
found = true
-
assert f instanceof File
assert f.name.endsWith(".groovy")
}
@@ -81,31 +71,26 @@ class AntTest extends GroovyTestCase {
void testJunitTask() {
def ant = new AntBuilder()
-
ant.junit {
test(name: 'groovy.util.SomethingThatDoesNotExist')
}
}
void testPathBuilding() {
def ant = new AntBuilder()
-
def value = ant.path {
fileset(dir: "xdocs") {
include(name: "*.wiki")
}
}
-
assert value != null
assertEquals org.apache.tools.ant.types.Path, value.getClass()
}
void testTaskContainerExecutionSequence() {
SpoofTaskContainer.getSpoof().length = 0
-
- def antFile = new File("src/test/groovy/util/AntTest.xml")
+ def antFile = new File("src/test-resources/groovy/util/AntTest.xml")
assertTrue "Couldn't find ant test script", antFile.exists()
-
// run it with ant, to be sure that our assumptions are correct
def project = new Project()
project.init()
@@ -133,11 +118,11 @@ end SpoofTaskContainer execute
def PATH = 'task.path'
// and now run it with the AntBuilder
- ant.path(id: PATH) {ant.pathelement(location: 'classes')}
+ ant.path(id: PATH) { ant.pathelement(location: 'classes') }
['spoofcontainer': SpoofTaskContainer, 'spoof': SpoofTask].each { pair ->
ant.taskdef(name: pair.key, classname: pair.value.name, classpathref: PATH)
}
- ant.spoofcontainer() {
+ ant.spoofcontainer {
ant.spoof(foo: 123)
}
assertEquals expectedSpoof, SpoofTaskContainer.getSpoof().toString()
@@ -153,7 +138,7 @@ end SpoofTaskContainer execute
uri: 'testNS')
}
def testNS = NamespaceBuilder.newInstance(antNS, "testNS", "testNSprefix");
- testNS.spoofcontainer() {
+ testNS.spoofcontainer {
testNS.spoof(foo: 123)
}
assertEquals expectedSpoof, SpoofTaskContainer.getSpoof().toString()
@@ -162,12 +147,10 @@ end SpoofTaskContainer execute
/** Checks that we can access dynamically (through Ant's property task) defined properties in Groovy scriptlets */
void testDynamicProperties() {
def antBuilder = new AntBuilder()
-
antBuilder.property(name: "testProp1", value: "TEST 1")
antBuilder.taskdef(name: "groovy", classname: "org.codehaus.groovy.ant.Groovy")
antBuilder.groovy("""
ant.property(name: "testProp2", value: "TEST 2")
-
assert properties.testProp1 == project.properties.testProp1
assert properties.testProp2 == project.properties.testProp2
""")
@@ -178,10 +161,9 @@ end SpoofTaskContainer execute
*/
void testAntBuilderProperties() {
def ant = new AntBuilder()
-
assertNull ant.project.properties.'myProp'
ant.property(name: 'myProp', value: 'blabla')
- assertEquals 'blabla', ant.project.properties.'myProp'
+ assert ant.project.properties.'myProp' == 'blabla'
}
/**
@@ -193,20 +175,19 @@ end SpoofTaskContainer execute
ant.condition(property: "containsHi") {
contains([string: "hi", substring: "hi"])
}
- assertEquals "true", ant.project.properties["containsHi"]
-
+ assert ant.project.properties["containsHi"] == 'true'
ant.condition(property: "equalsHi", else: "false") {
Equals([arg1: "hi", arg2: "bye"])
}
- assertEquals "false", ant.project.properties["equalsHi"]
+ assert ant.project.properties["equalsHi"] == 'false'
}
/**
* Tests that using the AntBuilder within the <groovy> task doesn't cause double execution
* (test for GROOVY-1602)
*/
void testAntBuilderWithinGroovyTask() {
- def antFile = new File("src/test/groovy/util/AntTest.xml")
+ def antFile = new File("src/test-resources/groovy/util/AntTest.xml")
assertTrue "Couldn't find ant test script", antFile.exists()
def project = new Project()
@@ -238,7 +219,7 @@ finished: echo[message:after groovy task]
* Test usage of import
*/
void testImport() {
- def antFile = new File("src/test/groovy/util/AntTest_import.xml")
+ def antFile = new File("src/test-resources/groovy/util/AntTest_import.xml")
assertTrue "Couldn't find ant test script", antFile.exists()
def ant = new AntBuilder()
View
35 subprojects/groovy-ant/src/test/groovy/groovy/util/FileNameFinderTest.groovy
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2003-2012 the original author or authors.
+ *
+ * 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 groovy.util
+
+/**
+ * Make sure FileNameFinder uses Ant filesets correctly.
+ *
+ * @author Dierk Koenig
+ * @author Paul King
+ */
+class FileNameFinderTest extends GroovyLogTestCase {
+
+ void testFilesInTestDirArePickedUp() {
+ def finder = new FileNameFinder()
+ def groovyFiles = finder.getFileNames('src/test/groovy', '**/*.groovy')
+ assert groovyFiles, 'There should be groovy files in src/test/groovy'
+ // now collect all those not starting with the 'Ant'
+ def nonAntFiles = finder.getFileNames('src/test/groovy', '**/*.groovy', '**/Ant*')
+ assert nonAntFiles, 'There should be non-Ant files in src/test/groovy'
+ assert groovyFiles.size() > nonAntFiles.size()
+ }
+}
View
0 src/test/groovy/util/SpoofTask.java → ...rc/test/groovy/groovy/util/SpoofTask.java
File renamed without changes.
View
0 src/test/groovy/util/SpoofTaskContainer.java → ...roovy/groovy/util/SpoofTaskContainer.java
File renamed without changes.
View
23 ...t/org/codehaus/groovy/ant/GroovyTest.java → ...y/org/codehaus/groovy/ant/GroovyTest.java
@@ -1,3 +1,18 @@
+/*
+ * Copyright 2003-2012 the original author or authors.
+ *
+ * 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 org.codehaus.groovy.ant;
import groovy.lang.GroovyRuntimeException;
@@ -21,7 +36,7 @@
*/
public class GroovyTest extends GroovyTestCase {
public static String FLAG = null;
- private final File antFile = new File("src/test/org/codehaus/groovy/ant/GroovyTest.xml");
+ private final File antFile = new File("src/test-resources/org/codehaus/groovy/ant/GroovyTest.xml");
private Project project;
protected void setUp() throws Exception {
@@ -34,8 +49,6 @@ protected void setUp() throws Exception {
protected void tearDown() throws Exception {
super.tearDown();
- // helps if we don't do a clean between runs
- new File("target/test-classes/GroovyTest3Class.class").delete();
}
public void testGroovyCodeWithinTag() {
@@ -60,11 +73,9 @@ public void testClasspath_missing() {
try {
project.executeTarget("groovyClasspath_missing");
fail();
- }
- catch (final Exception e) {
+ } catch (final Exception e) {
assertEquals(BuildException.class, e.getClass());
}
-
}
public void testClasspath_classpathAttribute() {
View
3 ...dehaus/groovy/ant/GroovyTest2Class.groovy → ...dehaus/groovy/ant/GroovyTest2Class.groovy