compile exclusion

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

compile exclusion

JerodLass
What is the best way to exclude files during the compile task?  I tried variations of:

compile{
  exclude '**/*DoNotCompile'
}

with no luck.  Compile doesn't seem to have an excludes method the way resources does.  Some files and directories are generated by an IDE plugin but I do not want them to be compiled.  Any thoughts would be appreciated.

Thanks,
Jerod
Reply | Threaded
Open this post in threaded view
|

Re: compile exclusion

hans_d
Administrator

On Aug 5, 2008, at 6:12 PM, JerodLass wrote:

>
> What is the best way to exclude files during the compile task?  I  
> tried
> variations of:
>
> compile{
>   exclude '**/*DoNotCompile'
> }
>
> with no luck.

The patterns you can pass to the include/exclude method are Ant  
patterns.

For example:

compile {
    include('org.mypackage1/', 'org.mypackage2/')
    exclude('org.mypackage2/I*.java/')
}

This should work. You probably need to to say exclude '**/
DoNotCompile.java'. in your example or you may simply exclude whole  
packages.

- Hans

--
Hans Dockter
Gradle Project lead
http://www.gradle.org





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

    http://xircles.codehaus.org/manage_email