Skip to content

Commit

Permalink
use Nebula Extra Configurations plugin for gradle provided/optional c…
Browse files Browse the repository at this point in the history
…onfiguration

- additional changes for master branch
  • Loading branch information
lhotari committed Feb 27, 2015
1 parent d3b5e46 commit 66617f1
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 82 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ subprojects { project ->
sourceCompatibility = "1.7"
targetCompatibility = "1.7"

if(project.name =~ /^(grails-web|grails-plugin-|grails-project-api|grails-test-suite|grails-test)/) {
if(project.name =~ /^(grails-web|grails-plugin-|grails-project-api|grails-test-suite|grails-test|grails-compat)/) {
dependencies {
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
// MockHttpServletRequest/Response/Context used in many classes
Expand Down Expand Up @@ -478,4 +478,4 @@ tciTrigger {
task wrapper(type: Wrapper) {
gradleVersion = '2.3'
jarFile = 'gradle/wrapper/gradle-wrapper.jar'
}
}
28 changes: 4 additions & 24 deletions grails-bootstrap/build.gradle
Original file line number Diff line number Diff line change
@@ -1,38 +1,18 @@
import org.apache.tools.ant.filters.ReplaceTokens

configurations {
optional
}
dependencies {

compile( "org.codehaus.groovy:groovy-xml:$groovyVersion" ){
ext.notInPom = true
}
provided ( "org.codehaus.groovy:groovy-xml:$groovyVersion" )
compile "org.yaml:snakeyaml:1.14"

optional ("org.fusesource.jansi:jansi:$jansiVersion")
optional("jline:jline:$jlineVersion")
optional("net.java.dev.jna:jna:$jnaVersion")
provided ("org.fusesource.jansi:jansi:$jansiVersion")
provided("jline:jline:$jlineVersion")
provided("net.java.dev.jna:jna:$jnaVersion")

// Ant
compile "org.codehaus.groovy:groovy-ant:$groovyVersion"

}


sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
compileClasspath += files(configurations.optional)
runtimeClasspath += files(configurations.optional)
}
}
javadoc.classpath += files(configurations.optional)

processResources {
inputs.property "version", version
filter(ReplaceTokens, tokens:[version:version])
}

26 changes: 5 additions & 21 deletions grails-compat/build.gradle
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
configurations {
optional
}
dependencies {
compile project(':grails-plugin-mimetypes'),
project(':grails-plugin-controllers'),
project(':grails-validation')

// These dependencies are not required, but due to a Groovy compiler bug they are loaded by Groovy and hence
// have to be on the path for compilation even though they shouldn't be
optional "org.apache.ant:ant:${antVersion}"
optional "jline:jline:$jlineVersion"
optional "org.fusesource.jansi:jansi:$jansiVersion"
optional("org.codehaus.gant:gant_groovy1.8:${gantVersion}") {
provided "org.apache.ant:ant:${antVersion}"
provided "jline:jline:$jlineVersion"
provided "org.fusesource.jansi:jansi:$jansiVersion"
provided("org.codehaus.gant:gant_groovy1.8:${gantVersion}") {
exclude group:'commons-cli', module:'commons-cli'
exclude group:'org.apache.ant', module:'ant'
}
optional "org.apache.ivy:ivy:${ivyVersion}"

provided "org.apache.ivy:ivy:${ivyVersion}"
}

sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
compileClasspath += files(configurations.optional)
runtimeClasspath += files(configurations.optional)
}
}
javadoc.classpath += files(configurations.optional)

20 changes: 3 additions & 17 deletions grails-console/build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
configurations {
optional
}

dependencies {
compile project(":grails-core")
compile "org.codehaus.groovy:groovy-console:$groovyVersion"
Expand All @@ -13,19 +9,9 @@ dependencies {
compile("org.springframework.boot:spring-boot:$springBootVersion")
compile "org.springframework:spring-test:${springVersion}"

provided "org.springframework:spring-web:${springVersion}"
optional "org.springframework:spring-web:${springVersion}"

compile 'javax.servlet:javax.servlet-api:3.0.1', provided

}

sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
compileClasspath += files(configurations.optional)
runtimeClasspath += files(configurations.optional)
}
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
optional "javax.servlet:javax.servlet-api:$servletApiVersion"
}
javadoc.classpath += files(configurations.optional)
2 changes: 1 addition & 1 deletion grails-core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ dependencies {
}

// Used by Spring AOP
optional 'aopalliance:aopalliance:1.0',
provided 'aopalliance:aopalliance:1.0',
"org.aspectj:aspectjrt:$aspectjVersion"

runtime ( 'xalan:serializer:2.7.1' ) {
Expand Down
16 changes: 1 addition & 15 deletions grails-plugin-i18n/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
configurations {
optional
}
dependencies {
compile "commons-lang:commons-lang:$commonsLangVersion"
compile project(":grails-web")

optional "org.codehaus.groovy:groovy-ant:$groovyVersion"
}

sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
compileClasspath += files(configurations.optional)
runtimeClasspath += files(configurations.optional)
}
provided "org.codehaus.groovy:groovy-ant:$groovyVersion"
}
javadoc.classpath += files(configurations.optional)
2 changes: 1 addition & 1 deletion grails-test/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
compile "junit:junit:${junitVersion}", {
exclude group:'org.hamcrest', module: 'hamcrest-core'
}
compile("org.spockframework:spock-core:${spockVersion}") {
compile("org.spockframework:spock-core:${spockVersion}") {
transitive = false
exclude group:'junit', module: 'junit-dep'
exclude group:'org.codehaus.groovy', module: 'groovy-all'
Expand Down
2 changes: 1 addition & 1 deletion grails-web/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies {
compile project(":grails-web-common")
compile project(":grails-web-gsp")
compile project(":grails-web-databinding")
optional project(":grails-web-fileupload")
provided project(":grails-web-fileupload")
compile project(":grails-web-url-mappings")
compile project(":grails-web-jsp")
compile project(":grails-web-mvc")
Expand Down

0 comments on commit 66617f1

Please sign in to comment.