android-sourcesets

Grouping few of many sourceSets having exactly same configuration

亡梦爱人 提交于 2019-12-29 07:51:33
问题 Lets say I have the following sourceSets : sourceSets { flavor1 { assets.srcDirs = ['repo-assets/flavor1'] res.srcDirs = ['repo-res/flavor1'] } flavor2 { assets.srcDirs = ['repo-assets/flavor2'] res.srcDirs = ['repo-res/flavor2'] } flavor3 { assets.srcDirs = ['repo-assets/flavor1'] res.srcDirs = ['repo-res/flavor1'] } flavor4 { assets.srcDirs = ['repo-assets/flavor2'] res.srcDirs = ['repo-res/flavor2'] } } If you notice flavor1 and flavor3 have same srcDirs and so does flavor2 and flavor4 .

Copy constructor using “initWith” for “productFlavors” and “sourceSets”

核能气质少年 提交于 2019-12-10 01:48:02
问题 With reference to this answer. Is it possible to create a copy constructor for productFlavors and sourceSets using initWith just like the one in the linked answer. That one worked great for buildTypes . For buildTypes it was done this way: debugfree.initWith(buildTypes.debug) Is this possible for productFlavors and sourceSets as well? 来源: https://stackoverflow.com/questions/36199741/copy-constructor-using-initwith-for-productflavors-and-sourcesets

The SourceSet 'commonTest' is not recognized by the Android Gradle Plugin. Perhaps you misspelled something?

廉价感情. 提交于 2019-12-04 03:31:03
问题 Seemingly the same root cause as this question, but the answer there will not work for me. I have a custom source set called commonTest that I use for sharing certain test utility code across the test and androidTest source sets. Here is my relevant project config: sourceSets { // This lets us write test utility code that can be used by both unit tests and android tests commonTest { java } test { java.srcDirs += commonTest.java.srcDirs } androidTest { java.srcDirs += commonTest.java.srcDirs }

Dynamically generating productFlavors and sourceSets using a list of names (with properties) in a CSV/TXT file

孤街浪徒 提交于 2019-11-30 17:38:16
问题 This question in continuation of my other question, which i want to improve further. I am being able to group flavors (having common configuration) under sourceSets with the following code : (got it from a genius in the linked question above) import com.android.build.gradle.api.AndroidSourceSet android { sourceSets { [flavor2, flavor4].each { AndroidSourceSet ss -> ss.assets.srcDirs = ['repo-assets/flavor2'] ss.res.srcDirs = ['repo-res/flavor2'] } } } Now, I was wondering if the list [flavor2