Skip to content

Commit

Permalink
Instead of using a separate configuration for the agent to avoid it b…
Browse files Browse the repository at this point in the history
…eing exported in the POM, use a dynamic property on dependencies to determine what should be exported.

To have any dependency not be exported in the POM, define it like this…

dependencies {
  «scope» («notation») {
    notInPom = true
  }
}
  • Loading branch information
ldaley committed Jan 10, 2012
1 parent 8fba66c commit 8333442
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 22 deletions.
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,15 @@ subprojects { project ->
project.poms*.whenConfigured {
project.pomModifications*.call(it)
}

// Remove any dependencies that shouldn't be included in the POM
modifyPom { pom ->
configurations.runtime.allDependencies.each { dependency ->
if (dependency.hasProperty("notInPom") && dependency.notInPom) {
pom.dependencies.removeAll { it.groupId == dependency.group && it.artifactId == dependency.name }
}
}
}
}

task clean(type: Delete) {
Expand Down
2 changes: 1 addition & 1 deletion gradle/assemble.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ subprojects { subproject ->
configurations {
libsConfigurations << libs {
extendsFrom compile, runtime
["jsp21", "agent"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
["jsp21"].collect { configurations.findByName(it) }.findAll { it != null }.each { extendsFrom it }
}
}
}
Expand Down
25 changes: 4 additions & 21 deletions grails-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
configurations {
agent.extendsFrom compile
}

eclipse {
classpath {
plusConfigurations += configurations.agent
}
}
dependencies {
compile "commons-collections:commons-collections:${commonsCollectionsVersion}"
compile "commons-io:commons-io:${commonsIOVersion}"
Expand Down Expand Up @@ -62,22 +53,14 @@ dependencies {
exclude group: 'xml-apis', module:'xml-apis'
}

agent "com.springsource.springloaded:springloaded-core:$springLoadedVersion"
compile ("com.springsource.springloaded:springloaded-core:$springLoadedVersion") {
notInPom = true
}

compile "org.springframework:spring-tx:${springVersion}"
compile project(":grails-bootstrap"), project(":grails-spring")
}

sourceSets {
main {
compileClasspath = configurations.agent
}
}

javadoc {
classpath += configurations.agent
}

compileGroovy.doFirst {
delete("${buildDir}/classes/main/META-INF")
ant.mkdir(dir:sourceSets.main.output.classesDir)
Expand All @@ -86,4 +69,4 @@ compileGroovy.doFirst {
}
}

jar.appendix = 'core'
jar.appendix = 'core'

0 comments on commit 8333442

Please sign in to comment.