Passing configuration properties to custom plugin


(Mujahed) #1

I recently built a maven plugin and used MavenProject to build a jar by usingPreformatted text

MavenProject project; project.addCompileSourceRoot(Path to project Root); in my java file

I was wondering if there is a similar functionality within Gradle.

For instance, in my pom file i have configurations that I apply to my plugin and this in turn builds a jar with specific class files based on the configs.

POM plugin:

dictFile>FIX44-bolt.xmlmyproject.api myproject.api.field </configuration This would create a jar with package classes within the jar namely package myproject.api and myproject.api.fields

I want similar functionality within my build.gradle file:

buildscript {
repositories {
maven {
url uri(‘C:/git/repo/’)
}
mavenLocal()

}

dependencies {
classpath group: ‘myproject.api’, name: ‘quick-plugin’,
version: ‘1.0-SNAPSHOT’
}
}

apply plugin: ‘quick-plugin’

FIX44-bolt.xml myproject.api myproject.api.field </configuration

This would create a jar with package classes within the jar namely package myproject.api and myproject.api.fields

I want similar functionality within my build.gradle file:

buildscript {
repositories {
maven {
url uri(‘C:/git/repo/’)
}
mavenLocal()

}

dependencies {
classpath group: ‘myproject.api’, name: ‘quick-plugin’,
version: ‘1.0-SNAPSHOT’
}
}

apply plugin: ‘quick-plugin’