Created
December 21, 2011 12:12
-
-
Save skhatri/1505804 to your computer and use it in GitHub Desktop.
Gradle Dependency Task configuration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mybuild | |
import org.gradle.api.DefaultTask | |
import org.gradle.api.tasks.TaskAction | |
class AddDependencyTask extends DefaultTask { | |
def libMap | |
@TaskAction | |
void addLibrariesInBulk() { | |
libMap.each { groupName, dependencySet -> | |
dependencySet.each { | |
def fileName = "${it}.lib.properties" | |
project.file(fileName).eachLine { | |
project.dependencies.add(groupName, it) | |
} | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
task addlibs(type: LibProviderTask) | |
configure(addlibs) { | |
libMap = ['compile':["compile", "gwt", "web"], 'testCompile' : ["test"]] | |
} | |
dependencies { | |
project.addlibs.execute() | |
groovy 'org.codehaus.groovy:groovy-all:1.8.2' | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment