123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- configure(allprojects) {
- apply plugin: 'idea'
- apply plugin: 'eclipse-wtp'
- eclipse.project.name = "${project.name}-3.1.x"
- }
- configure(javaProjects) {
- eclipse.classpath.downloadSources = true
- // GRADLE-1116
- project.eclipse.classpath.file.whenMerged { classpath ->
- classpath.entries.removeAll { entry -> entry.path.endsWith('/build/classes/test') }
- }
- // GRADLE-1422
- project.eclipseClasspath.doFirst {
- // delay adding whenMerged till the entryAttributes are added (must be the last whenMerged)
- project.eclipse.classpath.file.whenMerged { classpath ->
- def includeDeps = project.configurations.getByName('runtime').collect {f -> f.absolutePath } as Set
- classpath.entries.each { cp ->
- if(cp instanceof org.gradle.plugins.ide.eclipse.model.Library) {
- def include = includeDeps.contains(cp.path)
- def attr = 'org.eclipse.jst.component.dependency'
- if(!include) {
- cp.entryAttributes.remove(attr)
- }
- }
- }
- }
- }
- tasks.withType(org.gradle.plugins.ide.eclipse.GenerateEclipseWtpComponent) {
- project.eclipse.classpath.file.whenMerged { classpath->
- project.eclipse.wtp.component.file.whenMerged { wtpComponent ->
- wtpComponent.contextPath = project.tasks.findByName('jettyRun')?.contextPath?.replaceFirst('/','')
- }
- }
- }
- }
- // STS-2723
- project(':spring-security-samples-aspectj') {
- task afterEclipseImport {
- ext.srcFile = file('.classpath')
- inputs.file srcFile
- outputs.dir srcFile
- onlyIf { srcFile.exists() }
- doLast {
- def classpath = new XmlParser().parse(srcFile)
- classpath.classpathentry.findAll{ it.@path.startsWith('/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)
- }
- }
- }
|