Permalink
Browse files

First cut of Ivy support and dependency resolution DSL

  • Loading branch information...
graemerocher committed Sep 7, 2009
1 parent a111680 commit 4da84baf40153d43473048aee39083bfb51b6b4b
Showing with 939 additions and 179 deletions.
  1. +5 −8 .classpath
  2. +11 −0 Grails.iml
  3. +0 −7 JSP21.iml
  4. +1 −0 ant/build/bundle.xml
  5. +1 −0 conf/groovy-starter.conf
  6. +20 −20 grails.ipr
  7. BIN lib/{ant-trax.jar → ant-trax-1.7.1.jar}
  8. BIN lib/{aspectjrt.jar → aspectjrt-1.6.2.jar}
  9. BIN lib/{aspectjweaver.jar → aspectjweaver-1.6.2.jar}
  10. BIN lib/{jstl-2.4.jar → jstl-1.1.2.jar}
  11. BIN lib/jstl-2.3.jar
  12. BIN lib/{radeox.jar → radeox-1.0-b2.jar}
  13. BIN lib/{serializer.jar → serializer-2.7.1.jar}
  14. BIN lib/{servlet-api-2.5-6.1.14.jar → servlet-api-2.5.jar}
  15. BIN lib/{standard-2.4.jar → standard-1.1.2.jar}
  16. BIN lib/standard-2.3.jar
  17. BIN lib/start.jar
  18. +1 −29 scripts/_GrailsClasspath.groovy
  19. +2 −2 scripts/_GrailsTest.groovy
  20. +121 −0 src/grails/grails-app/conf/BuildConfig.groovy
  21. +97 −66 src/java/grails/util/BuildSettings.groovy
  22. +24 −29 src/java/org/codehaus/groovy/grails/cli/GrailsScriptRunner.java
  23. +2 −15 src/java/org/codehaus/groovy/grails/commons/DefaultGrailsApplication.java
  24. +36 −0 src/java/org/codehaus/groovy/grails/resolve/DependencyDefinitionParser.java
  25. +41 −0 src/java/org/codehaus/groovy/grails/resolve/DependencyResolver.java
  26. +63 −0 src/java/org/codehaus/groovy/grails/resolve/EnhancedDefaultDependencyDescriptor.groovy
  27. +370 −0 src/java/org/codehaus/groovy/grails/resolve/IvyDependencyManager.groovy
  28. +141 −0 src/java/org/codehaus/groovy/grails/resolve/IvyDependencyManagerTests.groovy
  29. +1 −1 src/java/org/codehaus/groovy/grails/web/pages/ext/jsp/IterativeJspTagTests.groovy
  30. +1 −1 src/test/org/codehaus/groovy/grails/web/pages/ext/jsp/GroovyPageWithJSPTagsTests.groovy
  31. +1 −1 src/test/org/codehaus/groovy/grails/web/pages/ext/jsp/MockRootLoaderTagLibraryResolver.groovy
View
@@ -48,31 +48,28 @@
<classpathentry kind="lib" path="lib/jasper-runtime-5.5.15.jar"/>
<classpathentry kind="lib" path="lib/jcl-over-slf4j-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/jsp-api-2.0.jar"/>
- <classpathentry kind="lib" path="lib/jstl-2.3.jar"/>
- <classpathentry kind="lib" path="lib/jstl-2.4.jar"/>
+ <classpathentry kind="lib" path="lib/jstl-1.1.2.jar"/>
<classpathentry kind="lib" path="lib/jta-1.1.jar"/>
<classpathentry kind="lib" path="lib/junit-3.8.2.jar"/>
<classpathentry kind="lib" path="lib/log4j-1.2.15.jar"/>
<classpathentry kind="lib" path="lib/ognl-2.6.9.jar"/>
<classpathentry kind="lib" path="lib/oro-2.0.8.jar"/>
- <classpathentry kind="lib" path="lib/serializer.jar"/>
- <classpathentry kind="lib" path="lib/servlet-api-2.5-6.1.14.jar"/>
+ <classpathentry kind="lib" path="lib/serializer-2.7.1.jar"/>
+ <classpathentry kind="lib" path="lib/servlet-api-2.5.jar"/>
<classpathentry kind="lib" path="lib/sitemesh-2.4.jar"/>
<classpathentry kind="lib" path="lib/slf4j-api-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/slf4j-log4j12-1.5.6.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.binding-2.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.js-2.0.3.RELEASE.jar"/>
<classpathentry kind="lib" path="lib/org.springframework.webflow-2.0.3.RELEASE.jar"/>
- <classpathentry kind="lib" path="lib/standard-2.3.jar"/>
- <classpathentry kind="lib" path="lib/standard-2.4.jar"/>
- <classpathentry kind="lib" path="lib/start.jar"/>
+ <classpathentry kind="lib" path="lib/standard-1.1.2.jar"/>
<classpathentry kind="lib" path="lib/svnkit-1.2.0.jar"/>
<classpathentry kind="lib" path="lib/xpp3_min-1.1.3.4.O.jar"/>
<classpathentry kind="lib" path="ant/lib/ant.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="con" path="GROOVY_SUPPORT"/>
<classpathentry kind="lib" path="lib/aopalliance-1.0.jar"/>
- <classpathentry kind="lib" path="lib/radeox.jar"/>
+ <classpathentry kind="lib" path="lib/radeox-1.0-b2.jar"/>
<classpathentry kind="lib" path="lib/javassist-3.4.GA.jar"/>
<classpathentry kind="lib" path="lib/hibernate-annotations-3.4.0.jar"/>
<classpathentry kind="lib" path="lib/hibernate-commons-annotations-3.4.0.jar"/>
View
@@ -130,6 +130,17 @@
<SOURCES />
</library>
</orderEntry>
+ <orderEntry type="module-library">
+ <library name="Apache Ivy">
+ <CLASSES>
+ <root url="jar://$MODULE_DIR$/lib/ivy-2.0.0.jar!/" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://$MODULE_DIR$/../../../../apache/ivy-2.0.0/src/java" />
+ </SOURCES>
+ </library>
+ </orderEntry>
<javadoc-paths>
<root url="file://$MODULE_DIR$/../spring-framework-2.0/docs/api" />
<root url="file://$MODULE_DIR$/../hibernate-3.2/doc/api" />
View
@@ -1,17 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<module relativePaths="true" type="JAVA_MODULE" version="4">
- <component name="FacetManager">
- <facet type="Groovy" name="Groovy">
- <configuration />
- </facet>
- </component>
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$/src/jsp21">
<sourceFolder url="file://$MODULE_DIR$/src/jsp21" isTestSource="false" />
</content>
- <orderEntry type="library" name="groovy-1.6" level="application" />
- <orderEntry type="library" name="groovy-1.6.0" level="application" />
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
View
@@ -92,6 +92,7 @@
<include name="grails/util/GrailsMain*"/>
<include name="grails/ant/**/*"/>
<include name="**/groovy/grails/cli/**/*" />
+ <include name="**/groovy/grails/resolve/**/*" />
</fileset>
<file file="${basedir}/build.properties"/>
</jar>
View
@@ -11,5 +11,6 @@
# Load required libraries
load ${grails.home}/dist/grails-bootstrap-${grails.version}.jar
load ${grails.home}/lib/groovy-all-1.6.4.jar
+ load ${grails.home}/lib/ivy-2.0.0.jar
load ${grails.home}/lib/gant_groovy1.6-1.6.0.jar
load ${tools.jar}
View
@@ -540,26 +540,26 @@
</CLASSES>
<JAVADOC />
<SOURCES>
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.beans-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.expression-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.instrument.classloading-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.web-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.oxm-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.web.servlet-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.aspects-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.test-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.transaction-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.integration-tests-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.jms-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.context.support-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.context-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.jdbc-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.aop-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.core-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.asm-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.instrument-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.web.portlet-sources-3.0.0.CI-325.jar!/" />
- <root url="jar:///Users/graemerocher/Downloads/spring-framework-3.0.0.CI-325/src/org.springframework.orm-sources-3.0.0.CI-325.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.oxm-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.test-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.asm-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.web-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.web.portlet-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.expression-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.core-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.web.servlet-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.jdbc-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.aspects-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.jms-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.instrument-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.transaction-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.context.support-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.beans-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.orm-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.instrument.classloading-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.context-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.aop-sources-3.0.0.M4.jar!/" />
+ <root url="jar://$PROJECT_DIR$/../../../../spring-framework-3.0.0.M4/src/org.springframework.integration-tests-sources-3.0.0.M4.jar!/" />
</SOURCES>
</library>
<library name="dom4j">
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
View
Binary file not shown.
View
Binary file not shown.
@@ -21,6 +21,7 @@ import org.codehaus.groovy.grails.plugins.GrailsPluginUtils
* Gant script containing the Grails classpath setup.
*
* @author Peter Ledbrook
+ * @author Graeme Rocher
*
* @since 1.1
*/
@@ -161,35 +162,6 @@ classpathToUrls = { String classpathId ->
return ant.project.properties.get(propName).split(":").collect { new File(it).toURI().toURL() }
}
-// I don't think this is needed anymore, but keeping around just in
-// case the paths specified are actually important!
-//
-//grailsClasspath = {pluginLibs, grailsDir ->
-// pathelement(location: "${classesDir.absolutePath}")
-// pathelement(location: "${basedir}/test/unit")
-// pathelement(location: "${basedir}/test/integration")
-// pathelement(location: "${basedir}")
-// pathelement(location: "${basedir}/web-app")
-// pathelement(location: "${basedir}/web-app/WEB-INF")
-// pathelement(location: "${basedir}/web-app/WEB-INF/classes")
-//
-// if (new File("${basedir}/web-app/WEB-INF/lib").exists()) {
-// fileset(dir: "${basedir}/web-app/WEB-INF/lib")
-// }
-// for (d in grailsDir) {
-// pathelement(location: "${d.file.absolutePath}")
-// }
-//
-// if(preInitConfig.grails.compiler.dependencies) {
-// def callable = preInitConfig.grails.compiler.dependencies
-// callable.delegate = delegate
-// callable.resolveStrategy = Closure.DELEGATE_FIRST
-// callable()
-// }
-// else {
-// defaultCompilerDependencies(delegate)
-// }
-//}
void setClasspath() {
// Make sure the following code is only executed once.
@@ -20,7 +20,7 @@ import org.codehaus.groovy.grails.test.DefaultGrailsTestRunner
import org.codehaus.groovy.grails.test.GrailsIntegrationTestHelper
import org.codehaus.groovy.grails.support.PersistenceContextInterceptor
import org.codehaus.groovy.grails.web.context.GrailsConfigUtils
-import org.springframework.mock.web.MockServletContext
+
/**
* Gant script that runs the Grails unit tests
@@ -277,7 +277,7 @@ integrationTestsPreparation = {
def beanNames = appCtx.getBeanNamesForType(PersistenceContextInterceptor)
if (beanNames.size() > 0) appCtx.getBean(beanNames[0]).init()
- MockServletContext servletContext = new org.springframework.mock.web.MockServletContext()
+ def servletContext = classLoader.loadClass("org.springframework.mock.web.MockServletContext").newInstance()
GrailsConfigUtils.configureServletContextAttributes(servletContext, app, pluginManager, appCtx)
GrailsConfigUtils.executeGrailsBootstraps(app, appCtx, servletContext );
@@ -0,0 +1,121 @@
+grails.project.class.dir = "target/classes"
+grails.project.test.class.dir = "target/test-classes"
+grails.project.test.reports.dir = "target/test-reports"
+
+grails.dependency.resolution = {
+ // log level of Ivy resolver
+ log "info"
+ repositories {
+ grailsHome()
+
+ // uncomment the below to enable remote dependency resolution
+ // from public Maven repositories
+ //mavenCentral()
+ //mavenRepo "http://snapshots.repository.codehaus.org"
+ //mavenRepo "http://repository.codehaus.org"
+ //mavenRepo "http://download.java.net/maven/2/"
+ //mavenRepo "http://repository.jboss.com/maven2/
+ }
+ dependencies {
+
+ // dependencies needed by the Grails build system
+ build "org.tmatesoft.svnkit:svnkit:1.2.0",
+ "org.apache.ant:ant:1.7.1",
+ "org.apache.ant:ant-launcher:1.7.1",
+ "org.apache.ant:ant-junit:1.7.1",
+ "org.apache.ant:ant-nodeps:1.7.1",
+ "org.apache.ant:ant-trax:1.7.1",
+ "radeox:radeox:1.0-b2",
+ "apache-tomcat:jasper-compiler:5.5.15",
+ "jline:jline:0.9.91",
+ "xalan:serializer:2.7.1",
+ "org.grails:grails-scripts:$grailsVersion",
+ "org.grails:grails-core:$grailsVersion",
+ "org.grails:grails-resources:$grailsVersion",
+ "org.grails:grails-web:$grailsVersion",
+ "org.sl4j:slf4j-log4j12:1.5.6"
+
+ // dependencies needed during development, but not for deployment
+ provided "javax.servlet:servlet-api:2.5",
+ "javax.servlet:jsp-api:2.1",
+ "javax.servlet:jstl:1.1.2"
+
+ // dependencies needed for compilation
+ compile "aopalliance:aopalliance:1.0",
+ "commons-validator:commons-validator:1.3.1",
+ "commons-el:commons-el:1.0",
+ "commons-beanutils:commons-beanutils:1.8.0",
+ "commons-collections:commons-collections:3.2.1",
+ "commons-io:commons-io:1.4",
+ "commons-lang:commons-lang:2.4",
+ "javax.transaction:jta:1.1",
+ "opensymphony:sitemesh:2.4",
+ "org.grails:grails-core:$grailsVersion",
+ "org.grails:grails-crud:$grailsVersion",
+ "org.grails:grails-docs:$grailsVersion",
+ "org.grails:grails-gorm:$grailsVersion",
+ "org.grails:grails-resources:$grailsVersion",
+ "org.grails:grails-spring:$grailsVersion",
+ "org.grails:grails-web:$grailsVersion",
+ "org.springframework:org.springframework.core:3.0.0.M4",
+ "org.springframework:org.springframework.aop:3.0.0.M4",
+ "org.springframework:org.springframework.aspects:3.0.0.M4",
+ "org.springframework:org.springframework.asm:3.0.0.M4",
+ "org.springframework:org.springframework.beans:3.0.0.M4",
+ "org.springframework:org.springframework.context:3.0.0.M4",
+ "org.springframework:org.springframework.context.support:3.0.0.M4",
+ "org.springframework:org.springframework.expression:3.0.0.M4",
+ "org.springframework:org.springframework.instrument:3.0.0.M4",
+ "org.springframework:org.springframework.instrument.classloading:3.0.0.M4",
+ "org.springframework:org.springframework.jdbc:3.0.0.M4",
+ "org.springframework:org.springframework.jms:3.0.0.M4",
+ "org.springframework:org.springframework.orm:3.0.0.M4",
+ "org.springframework:org.springframework.oxm:3.0.0.M4",
+ "org.springframework:org.springframework.transaction:3.0.0.M4",
+ "org.springframework:org.springframework.web:3.0.0.M4",
+ "org.springframework:org.springframework.web.servlet:3.0.0.M4",
+ [transitive:false]
+
+ // dependencies needed for running tests
+ test "junit:junit:3.8.2",
+ "org.grails:grails-test:$grailsVersion",
+ "org.springframework:org.springframework.integration-tests:3.0.0.M4",
+ "org.springframework:org.springframework.test:3.0.0.M4"
+
+ // dependencies needed at runtime only
+ runtime "aspectj:aspectjweaver:1.6.2",
+ "aspectj:aspectjrt:1.6.2",
+ "cglib:cglib-nodep:2.1_3",
+ "commons-fileupload:commons-fileupload:1.2.1",
+ "oro:oro:2.0.8"
+
+ // data source
+ runtime "commons-dbcp:commons-dbcp:1.2.2",
+ "commons-pool:commons-pool:1.5.2",
+ "hsqldb:hsqldb:1.8.0.10"
+
+ // caching
+ runtime ("net.sf.ehcache:ehcache:1.6.1",
+ "opensymphony:oscache:2.4.1") {
+ excludes 'jms', 'commons-logging', 'servlet-api'
+ }
+
+ // logging
+ runtime "log4j:log4j:1.2.15",
+ "org.slf4j:jcl-over-slf4j:1.5.6",
+ "org.slf4j:jul-to-slf4j:1.5.6",
+ "org.slf4j:slf4j-api:1.5.6",
+ "org.sl4j:slf4j-log4j12:1.5.6"
+
+ // JSP support
+ runtime "apache-taglibs:standard:1.1.2",
+ "xpp3:xpp3_min:1.1.3.4.O"
+
+
+ // override per plugin dependencies
+// plugin("hibernate") {
+// runtime "org.hibernate:hibernate-core:3.2.6"
+// }
+ }
+}
+
Oops, something went wrong.

0 comments on commit 4da84ba

Please sign in to comment.