On 02/11/2011, at 9:19 AM, pranav wrote:

> There are about 50 modules and hence 50 build files. These are common for
> all the build files -
> 
> sourceSets {
>    main {
>        java {
>            srcDir 'src/main'
>        }
>    }
>    test {
>            java {
>                srcDir 'src/test'
>            }
>    }
> }
> 
> version = "1.0"
> group = "com.xxx.inhouse"
> 
> repositories {
>    mavenRepo name: 'myCo', urls:
> "http://speke.xxx.co.in:8080/artifactory/myCo";
> }
> 
> I want to move this common code to custom plug-in (Say MyPlugin)
> 
> All the 50 build files would then use MyPlugin and give only the
> dependencies like
> 
> apply plugin: 'myPlugin'
> 
> dependencies {
>    compile group: 'log4j', name: 'log4j', version: '1.2.15', transitive:
> false    
>    testCompile group: 'junit', name: 'junit', version: '4.9', transitive:
> false
> }
> 
> I am using Java to write custom plugin in similar lines to JavaPlugin.
> Something like
> 
> public class MyGradlePlugin implements Plugin<Project>{
>       public void apply(Project project) {
>               project.getPlugins().apply(JavaPlugin.class);
>                         ............
>            }
> }
> 
> Now how do I set sourceSets, repositories, version, group etc using Java?

Hi Pranav,

Any chance you could raise this on the forum? http://forums.gradle.org/

It's a good question, and having it on the forum increases the visibility for 
future users who have exactly the same question.

-- 
Luke Daley
Principal Engineer, Gradleware 
http://gradleware.com


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to