File: core-impl.gradle

package info (click to toggle)
gradle 1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 36,408 kB
  • ctags: 34,655
  • sloc: java: 148,313; xml: 23,958; sh: 291; makefile: 53; cpp: 30; jsp: 11
file content (72 lines) | stat: -rw-r--r-- 2,407 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
apply plugin: "groovy"

import org.gradle.build.*

configurations {
    mvn3Input
}

dependencies {
    groovy libraries.groovy

    compile project(":core")

    compile libraries.commons_httpclient
    compile libraries.commons_lang
    compile libraries.commons_io
    compile libraries.ivy
    compile libraries.slf4j_api
    compile libraries.maven_ant_tasks
    compile libraries.nekohtml
    runtime libraries.xbean //maven3 classes dependency

    compile fileTree("$buildDir/libs/jarjar") {
        builtBy 'jarJarMaven3'
    }

    mvn3Input libraries.maven3

    //this dependency is necessary to run IvySFtpResolverIntegrationTest on ibm jdk
    integTestRuntime "org.bouncycastle:bcprov-jdk15:1.46@jar"
}

task jarJarMaven3(type: JarJar) {
    inputJars = configurations.mvn3Input
    outputDir = file("$buildDir/libs/jarjar")

    //unfortunately, all those need to be jarjarred.
    // Even if some library (like aether) is not included in maven-ant-tasks it has
    // META-INF/plexus/components.xml that to jarjarred components.
    rule('org.apache.maven.**', 'org.gradle.mvn3.org.apache.maven.@1')
    rule('org.codehaus.**', 'org.gradle.mvn3.org.codehaus.@1')
    rule('org.sonatype.**', 'org.gradle.mvn3.org.sonatype.@1')

    avoidConflictingPlexusComponents(it)
}

classpathManifest.dependsOn jarJarMaven3 //see GRADLE-2521

//adding explicit task dependencies due to http://issues.gradle.org/browse/GRADLE-2481
def allJarJars = tasks.withType(JarJar)
ideaModule.dependsOn allJarJars
eclipseClasspath.dependsOn allJarJars
useTestFixtures()

def avoidConflictingPlexusComponents(JarJar task) {
    //DefaultSecDispatcher component is configured in 2 different jars (META-INF/plexus/components.xml).
    //The implementation is the same but the 'hint' is different and this makes plexus fail to start.
    //I'm removing the components.xml file from the sec-dispatcher jar.
    //This file contains only single component so I think we can remove it.
    task.doLast {
        def plexusSec = "$outputDir/jarjar-plexus-sec-dispatcher.jar"
        def plexusSecNoComps = "$plexusSec-noComps"
        ant {
            zip(destfile: plexusSecNoComps, update: true) {
                zipfileset(src: plexusSec) {
                    exclude(name: 'META-INF/plexus/components.xml')
                }
            }
            move(file: plexusSecNoComps, tofile: plexusSec)
        }
    }
}