As I said, the Java Source Sets make it impossible to actually use
different source sets because each sourcesets generate new compile task and
jar.

In the mean time you'll only create a single SourceSet for each variant but
configure it to look for source files in the multiple source folders you
indicated.
It's not as good because users can go and change where those folders are,
but its better than nothing for now.

On the model (and API) side. It doesn't really matter what you do. We have
the concept of build type, or flavor -specific source sets so that we can
later do advanced refactoring.

But whether you use the api to pass a sourceset for each build type, build
flavor and each variant or if you only give us a single composite sourceset
that's already a combination  of all the folder doesn't matter. In the
former case we'll compose them ourselves (it's easy since artifacts are
tied to a variant so we know what build type and flavors make up the
variant. This is also why the order doesn't matter).

In the IDE, anyway, we'll enable all the source folder when you switch to
the artifact.
And remember the Gradle plugin actually doesn't use any of this information
except when building the model that is sent to the IDE.


On Thu, Dec 19, 2013 at 2:42 PM, Jürgen Cruz <[email protected]> wrote:

> I missed the part about registering the source folders. Shouldn't you need
> the artifact first to then associate the folders to that artifact?
>
> For example lets say I have 4 flavors divided in two flavor groups, Free,
> Paid and Beta, Normal.
>
> so the normal structure for this would be:
>
> src
>   - main
>   - free
>   - paid
>   - beta
>   - normal
>
> But then my plugin adds the following source directories (can be empty):
>
> src
>   - test (main equivalent)
>   - testDebug (for tests that need to be under debug)
>   - testFree (flavor 1)
>   - testFreeBeta (for variant)
>   - testFreeDebug (For test that need to be both in debug and for flavor 1)
>   - testFreeBetaDebug (the combination of variant and build type)
>   - ... and so on for the rest of the combinations.
>
> But obviously only a task for variant and build type is made. so if i run
> check, it will run testFreeBetaDebug, testFreeNormalDebug,
> testPaidBetaDebug and testPaidNormalDebug (I ignore release build by
> default since debug should be enough).
>
> So each of this tasks will have as source set a combination of dirs. My
> idea would be to define only 4 extra artifacts but each artifact gets the
> right combination. For example:
>
> testFreeBetaDebug should have as sourceSet:
> "src/test;src/testFree;src/testDebug;src/testBeta;src/testFreeBeta;src/testFreeDebug;src/testBetaDebug;src/testFreeBetaDebug"
>
> so how exactly do I build a artifact with these folders?.
>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "adt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Xavier Ducrohet
Android SDK Tech Lead
Google Inc.
http://developer.android.com | http://tools.android.com

Please do not send me questions directly. Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to