From d334f6fa09e90d71cc7c0b35f0e50cb7eb834d83 Mon Sep 17 00:00:00 2001 From: Luke Taylor Date: Sun, 28 Mar 2010 23:54:41 +0100 Subject: [PATCH] Latest gradle syntax updates. --- build.gradle | 10 +++++----- buildSrc/build.gradle | 2 +- buildSrc/src/main/groovy/docbook/DocbookPlugin.groovy | 2 +- docs/faq/faq.gradle | 4 ++-- docs/manual/manual.gradle | 4 ++-- gradle/aspectj.gradle | 2 +- gradle/bundlor.gradle | 10 +++------- gradle/javaprojects.gradle | 4 ++-- gradle/maven.gradle | 2 +- samples/cas/cas.gradle | 4 ++-- samples/contacts/contacts.gradle | 4 ++-- samples/openid/openid.gradle | 4 ++-- samples/tutorial/tutorial.gradle | 4 ++-- 13 files changed, 26 insertions(+), 30 deletions(-) diff --git a/build.gradle b/build.gradle index 2c3ceb4317..1f7dadbba1 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,4 @@ -apply id: 'base' +apply plugin: 'base' allprojects { version = '3.1.0.CI-SNAPSHOT' @@ -18,18 +18,18 @@ allprojects { } configure(javaProjects) { - apply url: "$rootDir/gradle/javaprojects.gradle" - apply url: "$rootDir/gradle/maven.gradle" + apply from: "$rootDir/gradle/javaprojects.gradle" + apply from: "$rootDir/gradle/maven.gradle" } configure(coreModuleProjects) { - apply url: "$rootDir/gradle/bundlor.gradle" + apply from: "$rootDir/gradle/bundlor.gradle" // Gives better names in structure101 jar diagram sourceSets.main.classesDir = new File(buildDir, "classes/" + project.name.substring("spring-security".length() + 1)) } configure (aspectjProjects) { - apply url: "$rootDir/gradle/aspectj.gradle" + apply from: "$rootDir/gradle/aspectj.gradle" } configurations { diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index aee47393c5..35c34f3279 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -1,4 +1,4 @@ -apply id: 'groovy' +apply plugin: 'groovy' repositories { mavenRepo name:'localRepo', urls: "file://" + System.properties['user.home'] + "/.m2/repository" diff --git a/buildSrc/src/main/groovy/docbook/DocbookPlugin.groovy b/buildSrc/src/main/groovy/docbook/DocbookPlugin.groovy index 856f467320..24e84de9ad 100644 --- a/buildSrc/src/main/groovy/docbook/DocbookPlugin.groovy +++ b/buildSrc/src/main/groovy/docbook/DocbookPlugin.groovy @@ -36,7 +36,7 @@ import com.icl.saxon.TransformerFactoryImpl; * which it operates. */ class DocbookPlugin implements Plugin { - public void use(Project project) { + public void apply(Project project) { // Add the plugin tasks to the project Task docbookHtml = project.tasks.add('docbookHtml', DocbookHtml.class); docbookHtml.setDescription('Generates chunked docbook html output'); diff --git a/docs/faq/faq.gradle b/docs/faq/faq.gradle index 86d80c0947..8fe6bd807e 100644 --- a/docs/faq/faq.gradle +++ b/docs/faq/faq.gradle @@ -1,5 +1,5 @@ -apply id: 'base' -apply id: 'docbook' +apply plugin: 'base' +apply plugin: 'docbook' defaultTasks 'docbookHtmlSingle' diff --git a/docs/manual/manual.gradle b/docs/manual/manual.gradle index 336978718b..a1f7b6f28a 100644 --- a/docs/manual/manual.gradle +++ b/docs/manual/manual.gradle @@ -1,5 +1,5 @@ -apply id: 'base' -apply id: 'docbook' +apply plugin: 'base' +apply plugin: 'docbook' [docbookHtml, docbookFoPdf, docbookHtmlSingle]*.sourceFileName = 'springsecurity.xml'; diff --git a/gradle/aspectj.gradle b/gradle/aspectj.gradle index e366e6dc0c..0d7cab37e4 100644 --- a/gradle/aspectj.gradle +++ b/gradle/aspectj.gradle @@ -1,4 +1,4 @@ -apply id: 'java' +apply plugin: 'java' configurations { ajtools diff --git a/gradle/bundlor.gradle b/gradle/bundlor.gradle index def88dce81..b081c9e1d4 100644 --- a/gradle/bundlor.gradle +++ b/gradle/bundlor.gradle @@ -1,7 +1,4 @@ -import java.util.jar.Manifest -import org.gradle.api.tasks.bundling.GradleManifest - -apply id: 'java' +apply plugin: 'java' configurations { bundlor @@ -20,14 +17,13 @@ task bundlor(dependsOn: compileJava) { doFirst { ant.taskdef(resource: 'com/springsource/bundlor/ant/antlib.xml', classpath: configurations.bundlor.asPath) File template = new File(projectDir, 'template.mf') - mkdir(buildDir, 'bundlor') + mkdir("$buildDir/bundlor") if (template.exists()) { ant.bundlor(inputPath: sourceSets.main.classesDir, outputPath: "$buildDir/bundlor", manifestTemplatePath: template) { property(name: 'version', value: "$version") property(name: 'spring.version', value: "$springVersion") } - // See GRADLE-395 for support for using an existing manifest - jar.manifest = new GradleManifest(new Manifest(new File("$buildDir/bundlor/META-INF/MANIFEST.MF").newInputStream())) + jar.manifest.from("$buildDir/bundlor/META-INF/MANIFEST.MF") } } } diff --git a/gradle/javaprojects.gradle b/gradle/javaprojects.gradle index ea1645ad02..3b729e4fda 100644 --- a/gradle/javaprojects.gradle +++ b/gradle/javaprojects.gradle @@ -1,5 +1,5 @@ -apply id: 'java' -apply id: 'eclipse' +apply plugin: 'java' +apply plugin: 'eclipse' springVersion = '3.0.1.RELEASE' springLdapVersion = '1.3.0.RELEASE' diff --git a/gradle/maven.gradle b/gradle/maven.gradle index 0a7ee45d6a..6f5b31b294 100644 --- a/gradle/maven.gradle +++ b/gradle/maven.gradle @@ -1,4 +1,4 @@ -apply id: 'maven' +apply plugin: 'maven' // Create a source jar for uploading task sourceJar(type: Jar) { diff --git a/samples/cas/cas.gradle b/samples/cas/cas.gradle index 0bd7994d8d..ebd59e42aa 100644 --- a/samples/cas/cas.gradle +++ b/samples/cas/cas.gradle @@ -1,5 +1,5 @@ -apply id: 'war' -apply id: 'jetty' +apply plugin: 'war' +apply plugin: 'jetty' dependencies { runtime project(':spring-security-core'), diff --git a/samples/contacts/contacts.gradle b/samples/contacts/contacts.gradle index 4e0f4a3a1f..cec064b13b 100644 --- a/samples/contacts/contacts.gradle +++ b/samples/contacts/contacts.gradle @@ -1,7 +1,7 @@ // Contacts sample build file -apply id: 'war' -apply id: 'jetty' +apply plugin: 'war' +apply plugin: 'jetty' dependencies { providedCompile 'javax.servlet:servlet-api:2.5@jar' diff --git a/samples/openid/openid.gradle b/samples/openid/openid.gradle index 0ca27df705..e22ef503f5 100644 --- a/samples/openid/openid.gradle +++ b/samples/openid/openid.gradle @@ -1,7 +1,7 @@ // OpenID sample build file -apply id: 'war' -apply id: 'jetty' +apply plugin: 'war' +apply plugin: 'jetty' dependencies { providedCompile 'javax.servlet:servlet-api:2.5@jar' diff --git a/samples/tutorial/tutorial.gradle b/samples/tutorial/tutorial.gradle index c8c0643abb..ec2a90d014 100644 --- a/samples/tutorial/tutorial.gradle +++ b/samples/tutorial/tutorial.gradle @@ -1,7 +1,7 @@ // Tutorial sample build file -apply id: 'war' -apply id: 'jetty' +apply plugin: 'war' +apply plugin: 'jetty' dependencies { providedCompile 'javax.servlet:servlet-api:2.5@jar'