import org.gradle.api.Rule

defaultTasks 'dists'

task clean(description: "Deletes the build directory ($buildDirName)")

task dists(dependsOn: { subprojects*.libs })

subprojects {
    configurations {
        compile
    }
    repositories {
        mavenCentral()
    }
    dependencies {
        if (project.name == 'webapp') {
        	compile "commons-io:commons-io:1.2"
		} else {
			compile "junit:junit:4.4"
		}
    }
    task libs
    tasks.addRule(new TestRule())
}

class TestRule implements Rule {
    public String getDescription() {
        'build<ConfigurationName>: builds the artifacts of the given configuration'
    }

    public void apply(String taskName) {
    }
}
