Fixed
Status Update
Comments
cm...@google.com <cm...@google.com>
je...@google.com <je...@google.com>
wk...@google.com <wk...@google.com> #2
One additional comment that would improve usability of working with custom source sets:
The source sets created by default don't require the directories to exist. That is src/free/my_type
will be used for input when it exists, but if it doesn't then it's safely ignored.
However, when using the addStaticSourceDirectory
API to register your own directory, a check is performed and IllegalArgumentException
is thrown when the directory doesn't exist already, requiring something like:
try {
variant.sources.getByName(SOURCE_TYPE)
.addStaticSourceDirectory(
project
.layout
.projectDirectory
.dir("src/${variant.name}/google-services").toString()
)
} catch (e: IllegalArgumentException) {
// directory doesn't exist, ignore
}
Perhaps it would be OK to remove this check and let plugins register directories that can potentially contain sources, but not do a hard failure if they don't exist?
wk...@google.com <wk...@google.com> #3
I sent two CLs for these, PTAL when you have some time :)
wk...@google.com <wk...@google.com>
ta...@gmail.com <ta...@gmail.com> #4
#1
aa...@gmail.com <aa...@gmail.com> #5
Ooo
aa...@gmail.com <aa...@gmail.com> #6
ADNVN 11
im...@gmail.com <im...@gmail.com> #7
Help. I. Need. Fast
Description
I'm trying out the
AndroidComponentsExtension.registerSourceType("my_type")
API and was wondering why it registers the following paths automatically (in a module with two flavor dimensions and flavors abc and free):src/main/my_type
src/free/my_type
src/abc/my_type
src/debug/my_type
but it doesn't register, for example:
src/freeAbc/my_type
or
src/freeDebug/my_type
Similar paths exist by default for java/kotlin sources and any other sources in AGP, as there are configurations created for every permutation of flavors/build types