Last active
April 13, 2016 04:46
-
-
Save cbeams/b9cc29ea0fed9c3175eb61c6f813c8ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AndroidLanguageSourceSet extends BaseLanguageSourceSet { | |
} | |
class Rules { | |
@Defaults | |
public static void addDefaultAndroidSourceSet(@Path("android.sources") ModelMap<FunctionalSourceSet> sources) { | |
sources.all(new Action<FunctionalSourceSet>() { | |
@Override | |
public void execute(FunctionalSourceSet functionalSourceSet) { | |
functionalSourceSet.create( | |
"resources", AndroidLanguageSourceSet.class, new Action<AndroidLanguageSourceSet>() { | |
@Override | |
public void execute(AndroidLanguageSourceSet sourceSet) { | |
ComponentSpecIdentifier componentId = sourceSet.getIdentifier(); | |
String parentName = componentId.getParent().getName(); | |
String name = componentId.getParent().getName(); | |
String srcDirPath = String.format("src/%s/%s", parentName, name); | |
sourceSet.getSource().srcDir(srcDirPath); | |
} | |
}); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment