How a sourceSets definition internally works in gr

2019-08-09 04:18发布

I want to make a proof of concept. I want to try if gradle supports sourceSets from other projects (no referenced in dependencies) or even external paths.

To do this I want to understand how it normally works with resourcesd defined in dependencies. So, for example, lets suppose we do a definition of:

sourceSets {
    main.resources.srcDirs += '/src/flavour1/res'
}

What this definition means? How this resources are copied to either intermediates, generated, output or tmp folder? Anyone knows?

I have tried to find out experimentally but I cannot explain what this definition of sourceSets internally implies...

By knowing this I would be able to test if resources from another project can also be imported, e.g.

sourceSets {
    main.resources.srcDirs += '../../Lib/lib/src/main/assets'
}

UPDATE: as there is not a clear answer for this issue, I opened a bug request in gradle's forum. Follow here: https://discuss.gradle.org/t/sourcesets-for-paths-not-belonging-to-projects-added-as-dependencies/12720/2

0条回答
登录 后发表回答