enrico <lists@...> writes:

> 
> Hi all,
> 
> I'm using gradle for a multi-project (java + grails + android).
> Usually I run a "main build" which builds all projects, but sometimes,
> (ie when I'm working on a pc without android sdk installed), I'd like
> to skip the android project from the build.
> Which is (if any) the best practice to achieve this?
> 
> At the moment, I'm thinking to use something like:
> 
> if (hasProperty("skip.android")) {
>    // skip android project
> } else {
>    // ok, full build with android
> }
> 
> but I don't know how tell gradle to skip a project.
> Tried with allprojects.remove(project('my-android-proj') with no luck.
> 
> Any help is appreciated,
> 
> Enrico
> 
> 

Hey Enrico,

I'm guessing you have a settings.gradle in your rootproject, where you include 
all the subprojects. You could simply conditionally include the android 
subproject based on that "skip.android" property. 

If your Android SDK installation added an ANDROID_HOME environment variable 
(not 
sure if this is the case), you could perhaps use that instead:

In your settings.gradle:

include 'all', 'kinds', 'of-projects'

if (System.getenv()['ANDROID_HOME']) {
    include 'android-project'
}




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

    http://xircles.codehaus.org/manage_email


Reply via email to