Upgrade to gradle 1.0-M3.

This commit is contained in:
Luke Taylor 2011-04-27 16:21:46 +01:00
parent 6c9ab570a2
commit 767f5b2423
6 changed files with 25 additions and 20 deletions

View File

@ -75,5 +75,5 @@ task uploadDist(type: S3DistroUpload) {
apply from: "$rootDir/gradle/ide-integration.gradle" apply from: "$rootDir/gradle/ide-integration.gradle"
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = '1.0-milestone-1' gradleVersion = '1.0-milestone-3'
} }

View File

@ -9,9 +9,9 @@ import org.gradle.api.tasks.SourceSet
import org.gradle.api.DefaultTask import org.gradle.api.DefaultTask
import org.gradle.api.GradleException import org.gradle.api.GradleException
import org.gradle.plugins.eclipse.EclipseClasspath import org.gradle.plugins.ide.eclipse.GenerateEclipseClasspath
import org.gradle.plugins.eclipse.EclipseProject import org.gradle.plugins.ide.eclipse.model.BuildCommand
import org.gradle.plugins.eclipse.model.ProjectDependency import org.gradle.tooling.model.ProjectDependency
/** /**
* *
@ -52,14 +52,14 @@ class AspectJPlugin implements Plugin<Project> {
aspectPath = project.files(project.configurations.aspectpath, project.jar.archivePath) aspectPath = project.files(project.configurations.aspectpath, project.jar.archivePath)
} }
project.tasks.withType(EclipseProject).all { project.tasks.withType(GenerateEclipseClasspath).all {
whenConfigured { p -> whenConfigured { p ->
p.natures.add(0, 'org.eclipse.ajdt.ui.ajnature') p.natures.add(0, 'org.eclipse.ajdt.ui.ajnature')
p.buildCommands = [new org.gradle.plugins.eclipse.model.BuildCommand('org.eclipse.ajdt.core.ajbuilder',[:])] p.buildCommands = [new BuildCommand('org.eclipse.ajdt.core.ajbuilder',[:])]
} }
} }
project.tasks.withType(EclipseClasspath).all { project.tasks.withType(GenerateEclipseClasspath).all {
whenConfigured { classpath -> whenConfigured { classpath ->
def entries = classpath.entries.findAll { it instanceof ProjectDependency}.findAll { entry -> def entries = classpath.entries.findAll { it instanceof ProjectDependency}.findAll { entry ->
def projectPath = entry.path.replaceAll('/',':') def projectPath = entry.path.replaceAll('/',':')

View File

@ -12,7 +12,7 @@ configure(javaProjects) {
testOutputDir = "$rootProject.projectDir/intellij/testOut" as File testOutputDir = "$rootProject.projectDir/intellij/testOut" as File
whenConfigured { module -> whenConfigured { module ->
def allClasses = module.dependencies.findAll() { dep -> def allClasses = module.dependencies.findAll() { dep ->
if (dep instanceof org.gradle.plugins.idea.model.ModuleLibrary if (dep instanceof org.gradle.plugins.ide.idea.model.ModuleLibrary
&& dep.classes.find { path -> && dep.classes.find { path ->
path.url.matches('.*jcl-over-slf4j.*') || path.url.matches('.*jcl-over-slf4j.*') ||
path.url.matches('.*servlet-api.*') || path.url.matches('.*servlet-api.*') ||
@ -32,7 +32,7 @@ configure(javaProjects) {
eclipseClasspath.whenConfigured { classpath -> eclipseClasspath.whenConfigured { classpath ->
def includeDeps = project.configurations.getByName('runtime')?.collect { f-> f.absolutePath } as Set def includeDeps = project.configurations.getByName('runtime')?.collect { f-> f.absolutePath } as Set
classpath.entries.each { cp -> classpath.entries.each { cp ->
if(cp instanceof org.gradle.plugins.eclipse.model.Library) { if(cp instanceof org.gradle.plugins.ide.eclipse.model.Library) {
def include = includeDeps.contains(cp.path) def include = includeDeps.contains(cp.path)
def attr = 'org.eclipse.jst.component.dependency' def attr = 'org.eclipse.jst.component.dependency'
if(include && project.hasProperty('war')) { if(include && project.hasProperty('war')) {
@ -49,14 +49,14 @@ configure(javaProjects) {
// GRADLE-1426 (part b) // GRADLE-1426 (part b)
project.plugins.withType(org.gradle.api.plugins.WarPlugin.class).all { project.plugins.withType(org.gradle.api.plugins.WarPlugin.class).all {
eclipseWtpComponent.whenConfigured { wtpComp -> eclipseWtpComponent.whenConfigured { wtpComp ->
wtpComp.wbModuleEntries.findAll { it instanceof org.gradle.plugins.eclipse.model.WbDependentModule }.each { e -> wtpComp.wbModuleEntries.findAll { it instanceof org.gradle.plugins.ide.eclipse.model.WbDependentModule }.each { e ->
if(!e.handle.startsWith('module:/resource/')) { if(!e.handle.startsWith('module:/resource/')) {
wtpComp.wbModuleEntries.remove(e) wtpComp.wbModuleEntries.remove(e)
} }
} }
} }
} }
tasks.withType(org.gradle.plugins.eclipse.EclipseWtpComponent) { tasks.withType(org.gradle.plugins.ide.eclipse.GenerateEclipseWtpComponent) {
whenConfigured { wtpComponent -> whenConfigured { wtpComponent ->
wtpComponent.contextPath = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','') wtpComponent.contextPath = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','')
} }

View File

@ -61,11 +61,16 @@ uploadArchives {
installer = install.repositories.mavenInstaller installer = install.repositories.mavenInstaller
def optionalDeps = ['ehcache', 'log4j', 'apacheds-core', 'jsp-api', 'jsr250-api', 'ldapsdk'] def optionalDeps = ['ehcache', 'log4j', 'apacheds-core', 'jsp-api', 'jsr250-api', 'ldapsdk']
def clogging = new org.apache.maven.model.Dependency()
clogging.artifactId = clogging.groupId = "commons-logging" // Workaround for GRADLE-1497
clogging.scope = 'compile' def cloggingDep(Class cl) {
clogging.optional = true clogging = cl.newInstance()
clogging.version = '1.1.1' clogging.artifactId = clogging.groupId = "commons-logging"
clogging.scope = 'compile'
clogging.optional = true
clogging.version = '1.1.1'
clogging
}
[installer, deployer]*.pom.collect { pom -> [installer, deployer]*.pom.collect { pom ->
pom.scopeMappings.addMapping(10, configurations.provided, 'provided') pom.scopeMappings.addMapping(10, configurations.provided, 'provided')
@ -80,7 +85,7 @@ clogging.version = '1.1.1'
dep.groupId.startsWith('org.slf4j') dep.groupId.startsWith('org.slf4j')
}*.optional = true }*.optional = true
pom.dependencies.add(clogging) pom.dependencies.add(cloggingDep(pom.dependencies[0].class))
if (pom.artifactId == 'spring-security-config') { if (pom.artifactId == 'spring-security-config') {
pom.dependencies.find { dep -> dep.artifactId == 'spring-security-web'}.optional = true pom.dependencies.find { dep -> dep.artifactId == 'spring-security-web'}.optional = true

View File

@ -1,6 +1,6 @@
#Tue Mar 01 20:16:05 CST 2011 #Wed Apr 27 16:17:28 BST 2011
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=http\://gradle.artifactoryonline.com/gradle/distributions/gradle-1.0-milestone-1-bin.zip distributionUrl=http\://repo.gradle.org/gradle/distributions/gradle-1.0-milestone-3-bin.zip

2
gradlew vendored
View File

@ -7,7 +7,7 @@
############################################################################## ##############################################################################
# Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together. # Uncomment those lines to set JVM options. GRADLE_OPTS and JAVA_OPTS can be used together.
GRADLE_OPTS="$GRADLE_OPTS -Xmx512m" # GRADLE_OPTS="$GRADLE_OPTS -Xmx512m"
# JAVA_OPTS="$JAVA_OPTS -Xmx512m" # JAVA_OPTS="$JAVA_OPTS -Xmx512m"
GRADLE_APP_NAME=Gradle GRADLE_APP_NAME=Gradle