From b323098167c0cf1020f25c5b54219e16ed381b10 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sun, 10 Jan 2010 23:31:23 +0000 Subject: [PATCH] Added gradle build files for taglibs, tutorial, contacts and openid. Changed build file names to match module names (by manipulating the project objects in the settings.gradle file). --- .gitignore | 3 +- acl/{build.gradle => acl.gradle} | 2 +- build.gradle | 31 +++++++++++++------- cas/{build.gradle => cas.gradle} | 4 +-- config/{build.gradle => config.gradle} | 12 ++++---- core/{build.gradle => core.gradle} | 0 docs/manual/build.gradle | 12 ++++---- ldap/{build.gradle => ldap.gradle} | 2 +- openid/{build.gradle => openid.gradle} | 7 +++-- samples/cas/cas.gradle | 12 ++++++++ samples/contacts/contacts.gradle | 25 ++++++++++++++++ samples/openid/openid.gradle | 13 +++++++++ samples/tutorial/tutorial.gradle | 19 ++++++++++++ settings.gradle | 40 +++++++++++++++++++++++++- taglibs/taglibs.gradle | 20 +++++++++++++ web/{build.gradle => web.gradle} | 2 +- 16 files changed, 171 insertions(+), 33 deletions(-) rename acl/{build.gradle => acl.gradle} (92%) rename cas/{build.gradle => cas.gradle} (84%) rename config/{build.gradle => config.gradle} (70%) rename core/{build.gradle => core.gradle} (100%) rename ldap/{build.gradle => ldap.gradle} (95%) rename openid/{build.gradle => openid.gradle} (79%) create mode 100644 samples/cas/cas.gradle create mode 100644 samples/contacts/contacts.gradle create mode 100644 samples/openid/openid.gradle create mode 100644 samples/tutorial/tutorial.gradle create mode 100644 taglibs/taglibs.gradle rename web/{build.gradle => web.gradle} (94%) diff --git a/.gitignore b/.gitignore index fd9252ddbf..4d7a9b9ee3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ target/ .project .settings/ build/ -*.log \ No newline at end of file +*.log +.gradle/ \ No newline at end of file diff --git a/acl/build.gradle b/acl/acl.gradle similarity index 92% rename from acl/build.gradle rename to acl/acl.gradle index 63b9c38832..5d95d8caa9 100644 --- a/acl/build.gradle +++ b/acl/acl.gradle @@ -1,7 +1,7 @@ // Acl Module build file dependencies { - compile project(':core'), + compile project(':spring-security-core'), "net.sf.ehcache:ehcache:$ehcacheVersion", "org.springframework:spring-context:$springVersion", "org.springframework:spring-core:$springVersion", diff --git a/build.gradle b/build.gradle index 5c837464b2..5353503a97 100644 --- a/build.gradle +++ b/build.gradle @@ -1,8 +1,4 @@ -import org.gradle.api.tasks.diagnostics.GraphvizReportRenderer - -usePlugin('java') - version = '3.0.0.CI-SNAPSHOT' allprojects { @@ -13,19 +9,25 @@ allprojects { } subprojects { - usePlugin 'java' - usePlugin 'project-reports' - + apply id: 'java' + + group = 'org.springframework.security' + springVersion = '3.0.0.RELEASE' springLdapVersion = '1.3.0.RELEASE' ehcacheVersion = '1.6.2' aspectjVersion = '1.6.5' - apacheDsVersion = '1.5.5' + apacheDsVersion = '1.5.5' + jstlVersion = '1.1.2' /* dependencyReport { renderer = new GraphvizReportRenderer() }*/ + configurations { + provided + } + dependencies { compile 'commons-logging:commons-logging:1.1.1' @@ -37,11 +39,18 @@ subprojects { 'org.hamcrest:hamcrest-library:1.1', "org.springframework:spring-test:$springVersion" } - + + sourceSets { + main { + compileClasspath = compileClasspath + configurations.provided + } + test { + compileClasspath = compileClasspath + configurations.provided + } + } + test { options.fork(forkMode: ForkMode.ONCE, jvmArgs: ["-ea", '-Xms128m', '-Xmx1g', '-XX:MaxPermSize=128m', '-XX:+HeapDumpOnOutOfMemoryError']) } - - group = 'org.springframework.security' } diff --git a/cas/build.gradle b/cas/cas.gradle similarity index 84% rename from cas/build.gradle rename to cas/cas.gradle index 14119a5107..d692ae1905 100644 --- a/cas/build.gradle +++ b/cas/cas.gradle @@ -1,7 +1,7 @@ dependencies { - compile project(':core'), - project(':web'), + compile project(':spring-security-core'), + project(':spring-security-web'), "javax.servlet:servlet-api:2.5", "org.springframework:spring-core:$springVersion", "org.springframework:spring-context:$springVersion", diff --git a/config/build.gradle b/config/config.gradle similarity index 70% rename from config/build.gradle rename to config/config.gradle index 78645a823a..0049d66423 100644 --- a/config/build.gradle +++ b/config/config.gradle @@ -1,10 +1,10 @@ // Config Module build file -compileTestJava.dependsOn(':core:compileTestJava') +compileTestJava.dependsOn(':spring-security-core:compileTestJava') dependencies { - compile project(':core'), - project(':web'), + compile project(':spring-security-core'), + project(':spring-security-web'), "javax.servlet:servlet-api:2.5", "org.aspectj:aspectjweaver:$aspectjVersion", "org.springframework:spring-aop:$springVersion", @@ -14,9 +14,9 @@ dependencies { "org.springframework:spring-beans:$springVersion", "org.springframework:spring-tx:$springVersion" - testCompile project(':ldap'), - project(':openid'), - files(this.project(':core').sourceSets.test.classesDir), + testCompile project(':spring-security-ldap'), + project(':spring-security-openid'), + files(this.project(':spring-security-core').sourceSets.test.classesDir), 'javax.annotation:jsr250-api:1.0', 'aopalliance:aopalliance:1.0', "org.springframework.ldap:spring-ldap-core:$springLdapVersion", diff --git a/core/build.gradle b/core/core.gradle similarity index 100% rename from core/build.gradle rename to core/core.gradle diff --git a/docs/manual/build.gradle b/docs/manual/build.gradle index cbaa08a650..e2ff316497 100644 --- a/docs/manual/build.gradle +++ b/docs/manual/build.gradle @@ -7,12 +7,12 @@ docbookHtml.stylesheet = new File(projectDir, 'src/xsl/html-custom.xsl') docbookFoPdf.stylesheet = new File(projectDir, 'src/xsl/pdf-custom.xsl') docbookHtml.doLast { - resourcesDir = new File(projectDir, 'src/resources') - ant { - docsDir = new File(buildDir, 'docs') - copy(toDir: docsDir) {fileset(dir: resourcesDir)} - copy(toDir: new File(docsDir, 'images')) {fileset(dir: new File(projectDir, 'src/docbook/images'))} - } + resourcesDir = new File(projectDir, 'src/resources') + ant { + docsDir = new File(buildDir, 'docs') + copy(toDir: docsDir) {fileset(dir: resourcesDir)} + copy(toDir: new File(docsDir, 'images')) {fileset(dir: new File(projectDir, 'src/docbook/images'))} + } } /*docbookSrc = new File(project.buildDir, 'docbook/src') diff --git a/ldap/build.gradle b/ldap/ldap.gradle similarity index 95% rename from ldap/build.gradle rename to ldap/ldap.gradle index de00e54c27..c7de42711a 100644 --- a/ldap/build.gradle +++ b/ldap/ldap.gradle @@ -3,7 +3,7 @@ test.exclude('**/OpenLDAPIntegrationTestSuite.class') dependencies { - compile project(':core'), + compile project(':spring-security-core'), "org.springframework:spring-core:$springVersion", "org.springframework:spring-beans:$springVersion", "org.springframework:spring-context:$springVersion", diff --git a/openid/build.gradle b/openid/openid.gradle similarity index 79% rename from openid/build.gradle rename to openid/openid.gradle index 0bcd139694..e1810b32dc 100644 --- a/openid/build.gradle +++ b/openid/openid.gradle @@ -1,9 +1,8 @@ // OpenID Module build file dependencies { - compile project(':core'), - project(':web'), - "javax.servlet:servlet-api:2.5", + compile project(':spring-security-core'), + project(':spring-security-web'), 'org.openid4java:openid4java-nodeps:0.9.5', "org.springframework:spring-aop:$springVersion", "org.springframework:spring-core:$springVersion", @@ -12,5 +11,7 @@ dependencies { "org.springframework:spring-tx:$springVersion", "org.springframework:spring-web:$springVersion" + provided "javax.servlet:servlet-api:2.5" + runtime 'commons-httpclient:commons-httpclient:3.1' } \ No newline at end of file diff --git a/samples/cas/cas.gradle b/samples/cas/cas.gradle new file mode 100644 index 0000000000..bff5dc0e99 --- /dev/null +++ b/samples/cas/cas.gradle @@ -0,0 +1,12 @@ +apply id: 'war' +apply id: 'jetty' + +dependencies { +// providedCompile 'javax.servlet:servlet-api:2.5@jar' + + runtime project(':spring-security-core'), + project(':spring-security-web'), + project(':spring-security-config'), +// project(':taglibs'), + 'log4j:log4j:1.2.15@jar' +} \ No newline at end of file diff --git a/samples/contacts/contacts.gradle b/samples/contacts/contacts.gradle new file mode 100644 index 0000000000..38ddb0660c --- /dev/null +++ b/samples/contacts/contacts.gradle @@ -0,0 +1,25 @@ +// Contacts sample build file + +apply id: 'war' +apply id: 'jetty' + +dependencies { + providedCompile 'javax.servlet:servlet-api:2.5@jar' + compile project(':spring-security-core'), + project(':spring-security-acl'), + "org.springframework:spring-core:$springVersion", + "org.springframework:spring-beans:$springVersion", + "org.springframework:spring-context:$springVersion", + "org.springframework:spring-jdbc:$springVersion", + "org.springframework:spring-tx:$springVersion", + "org.springframework:spring-web:$springVersion", + "org.springframework:spring-webmvc:$springVersion", + "org.aspectj:aspectjrt:$aspectjVersion" + + runtime project(':spring-security-web'), + project(':spring-security-config'), + project(':spring-security-taglibs'), + "org.springframework:spring-context-support:$springVersion", + "net.sf.ehcache:ehcache:$ehcacheVersion", + 'log4j:log4j:1.2.15@jar' +} \ No newline at end of file diff --git a/samples/openid/openid.gradle b/samples/openid/openid.gradle new file mode 100644 index 0000000000..0ca27df705 --- /dev/null +++ b/samples/openid/openid.gradle @@ -0,0 +1,13 @@ +// OpenID sample build file + +apply id: 'war' +apply id: 'jetty' + +dependencies { + providedCompile 'javax.servlet:servlet-api:2.5@jar' + + runtime project(':spring-security-web'), + project(':spring-security-config'), + project(':spring-security-openid'), + 'log4j:log4j:1.2.15@jar' +} \ No newline at end of file diff --git a/samples/tutorial/tutorial.gradle b/samples/tutorial/tutorial.gradle new file mode 100644 index 0000000000..52623feb13 --- /dev/null +++ b/samples/tutorial/tutorial.gradle @@ -0,0 +1,19 @@ +// Tutorial sample build file + +apply id: 'war' +apply id: 'jetty' + +dependencies { + providedCompile 'javax.servlet:servlet-api:2.5@jar' + compile project(':spring-security-core'), + "org.springframework:spring-core:$springVersion", + "org.springframework:spring-beans:$springVersion", + "org.springframework:spring-web:$springVersion", + "org.springframework:spring-webmvc:$springVersion", + "org.aspectj:aspectjrt:$aspectjVersion" + + runtime project(':spring-security-web'), + project(':spring-security-config'), + project(':spring-security-taglibs'), + 'log4j:log4j:1.2.15@jar' +} \ No newline at end of file diff --git a/settings.gradle b/settings.gradle index 6a13b13651..44bedc9064 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1 +1,39 @@ -include 'core', 'web', 'ldap', 'acl', 'config', 'cas', 'openid' +String[] modules = [ + 'core', + 'web', + 'ldap', + 'acl', + 'config', + 'cas', + 'openid', + 'taglibs' +] + +String[] samples = [ + 'tutorial', + 'contacts', + 'openid' +] + +include modules + +modules.each {name -> + p = findProject(":${name}") + p.name = "spring-security-${name}" + p.buildFileName = "${name}.gradle" +} + +include samples + +samples.each {name -> + p = findProject(":${name}") + p.name = "spring-security-samples-${name}" + p.buildFileName = "${name}.gradle" + p.projectDir = new File(settingsDir, "samples/${name}"); +} + + +rootProject.children.each {project -> + assert project.buildFile.isFile() + assert project.projectDir.isDirectory() +} \ No newline at end of file diff --git a/taglibs/taglibs.gradle b/taglibs/taglibs.gradle new file mode 100644 index 0000000000..32c53ba710 --- /dev/null +++ b/taglibs/taglibs.gradle @@ -0,0 +1,20 @@ +// Taglibs build file + +dependencies { + compile project(':spring-security-core'), + project(':spring-security-web'), + project(':spring-security-acl'), + "org.springframework:spring-core:$springVersion", + "org.springframework:spring-beans:$springVersion", + "org.springframework:spring-context:$springVersion", + "org.springframework:spring-expression:$springVersion", + "org.springframework:spring-web:$springVersion" + + provided 'javax.servlet:jsp-api:2.0' + + testCompile 'javax.servlet:servlet-api:2.5', + 'javax.servlet:jsp-api:2.0' + + testRuntime "taglibs:standard:$jstlVersion" + +} \ No newline at end of file diff --git a/web/build.gradle b/web/web.gradle similarity index 94% rename from web/build.gradle rename to web/web.gradle index 425613b48b..3fed485c78 100644 --- a/web/build.gradle +++ b/web/web.gradle @@ -1,7 +1,7 @@ // Web module build file dependencies { - compile project(':core'), + compile project(':spring-security-core'), 'aopalliance:aopalliance:1.0', 'javax.servlet:servlet-api:2.5', 'org.aspectj:aspectjweaver:1.6.5',