Obsolete
Status Update
Comments
gc...@gmail.com <gc...@gmail.com> #2
In addition to conditionals, Android Studio also doesn't follow "apply from" where you may be including other projects.
ss...@gmail.com <ss...@gmail.com> #3
Looks like this duplicates issue 36949180 .
ss...@gmail.com <ss...@gmail.com> #5
[Comment deleted]
ss...@gmail.com <ss...@gmail.com> #6
Unfortunately, this seems to only be half-way fixed. For example, the "Run/Debug Configurations" window still shows Gradle projects under "Android Application" that are dynamically excluded from settings.gradle. However, the modules for these are all set to "<no module>" (which basically is correct). But IMO these excluded projects should not even show up under "Android Application".
ss...@gmail.com <ss...@gmail.com> #7
Also, for the above example, it does not work to set "-Pexclude.demo=false" as "Command-line Options" in "Settings" -> "Compiler (Gradle-based Android Projects)" in AS 1.1.0, the DemoApp is still excluded in that case.
Description
OS version: Windows 8 x64
Java JRE/JDK version: 1.7.55 x64
If settings.gradle contains a conditional like
---8<---
include ':FunkyApp'
if (properties['exclude.demo'] == 'false') {
include ':DemoApp'
}
---8<---
and "exclude.demo" is set to "false" (either via gradle.properties or "-Pexclude.demo=false") then "DemoApp" is not available as an "Android Application" in the "Run/Debug Configurations".
The use-case can be minimized to the conditional saying just "if (true)", still "DemoApp" is not available.
From the command line, e.g. "./gradlew -Pexclude.demo=false DemoApp:assembleDebug" works just fine.