com.admc.gradle.JavaPropFilePlugin.groovy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gradle-javaPropFile-plugin Show documentation
Show all versions of gradle-javaPropFile-plugin Show documentation
Load Gradle Project with properties from Java properties files
package com.admc.gradle
import org.gradle.api.Project
import org.gradle.api.Plugin
class JavaPropFilePlugin implements Plugin {
def void apply(Project p) {
def ddTask = p.task('displayDeps')
ddTask.description =
'''Lists Ivy deps only for specified 'config.name'.'''
ddTask << {
assert project.hasProperty('config.name'):
'''Project property 'config.name' required by task 'echoDeps'.
'''
println (p.configurations[project['config.name']]
.allDependencies.size() + ' dependencies for '
+ p.project['config.name'] + '\n '
+ p.configurations[p.project['config.name']].asPath
.replace(System.properties['path.separator'], '\n '))
}
p.extensions.propFileLoader = new JavaPropFile(p)
}
}