Last active
April 13, 2016 04:50
-
-
Save cbeams/a50d9dcf5c2188272642981c76f591be 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.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