2011-04-21 06:57:18 -04:00
|
|
|
apply plugin: 'idea'
|
|
|
|
|
|
|
|
configure(javaProjects) {
|
|
|
|
apply plugin: 'idea'
|
2012-06-29 13:59:22 -04:00
|
|
|
apply plugin: 'eclipse-wtp'
|
|
|
|
|
|
|
|
eclipse.classpath.downloadSources = true
|
2011-04-21 06:57:18 -04:00
|
|
|
|
2011-04-27 11:21:46 -04:00
|
|
|
tasks.withType(org.gradle.plugins.ide.eclipse.GenerateEclipseWtpComponent) {
|
2012-06-29 13:59:22 -04:00
|
|
|
project.eclipse.classpath.file.whenMerged { classpath->
|
|
|
|
project.eclipse.wtp.component.file.whenMerged { wtpComponent ->
|
|
|
|
wtpComponent.contextPath = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','')
|
|
|
|
}
|
2011-04-21 06:57:18 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-06-29 13:59:22 -04:00
|
|
|
project(':spring-security-samples-aspectj') {
|
|
|
|
task afterEclipseImport {
|
|
|
|
ext.srcFile = file('.classpath')
|
|
|
|
inputs.file srcFile
|
|
|
|
outputs.dir srcFile
|
|
|
|
|
|
|
|
onlyIf { srcFile.exists() }
|
2011-04-21 06:57:18 -04:00
|
|
|
|
2012-06-29 13:59:22 -04:00
|
|
|
doLast {
|
|
|
|
def classpath = new XmlParser().parse(srcFile)
|
|
|
|
|
|
|
|
classpath.classpathentry.findAll{ it.@path == '/spring-security-aspects' }.each { node ->
|
|
|
|
if(node.children().size() == 0) {
|
|
|
|
def attrs = new Node(node,'attributes')
|
|
|
|
def adjtAttr = new Node(attrs,'attributes',[name: 'org.eclipse.ajdt.aspectpath', value: 'org.eclipse.ajdt.aspectpath'])
|
|
|
|
node.appendNode(adjtAttr)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def writer = new FileWriter(srcFile)
|
|
|
|
new XmlNodePrinter(new PrintWriter(writer)).print(classpath)
|
|
|
|
}
|
2011-04-21 06:57:18 -04:00
|
|
|
}
|
|
|
|
}
|