ExtendedBuildModel now exposes the project's build directory.

Change-Id: I174de21c907ed1b3ca046cc5b9b58543c50ecc39
This commit is contained in:
Alex Ruiz
2014-05-26 14:48:02 +04:00
committed by Vladislav.Soroka
parent 9786fa2d20
commit bfd4b28aba
3 changed files with 17 additions and 2 deletions
@@ -60,4 +60,11 @@ public interface ModuleExtendedModel extends Serializable {
* @return content roots
*/
DomainObjectSet<? extends ExtIdeaContentRoot> getContentRoots();
/**
* The build directory.
*
* @return the build directory.
*/
File getBuildDir();
}
@@ -59,8 +59,9 @@ public class ModuleExtendedModelBuilderImpl implements ModelBuilderService {
final String moduleName = project.getName();
final String moduleGroup = project.getGroup().toString();
final String moduleVersion = project.getVersion().toString();
final File buildDir = project.getBuildDir();
final ModuleExtendedModelImpl moduleVersionModel = new ModuleExtendedModelImpl(moduleName, moduleGroup, moduleVersion);
final ModuleExtendedModelImpl moduleVersionModel = new ModuleExtendedModelImpl(moduleName, moduleGroup, moduleVersion, buildDir);
final List<File> artifacts = new ArrayList<File>();
for (Task task : project.getTasks()) {
@@ -33,13 +33,15 @@ public class ModuleExtendedModelImpl implements ModuleExtendedModel {
private final String myName;
private final String myGroup;
private final String myVersion;
private final File myBuildDir;
private List<File> myArtifacts;
private Set<ExtIdeaContentRoot> myContentRoots;
public ModuleExtendedModelImpl(String name, String group, String version) {
public ModuleExtendedModelImpl(String name, String group, String version, File buildDir) {
myName = name;
myGroup = group;
myVersion = version;
myBuildDir = buildDir;
myArtifacts = Collections.emptyList();
myContentRoots = Collections.emptySet();
}
@@ -73,6 +75,11 @@ public class ModuleExtendedModelImpl implements ModuleExtendedModel {
return ImmutableDomainObjectSet.of(myContentRoots);
}
@Override
public File getBuildDir() {
return myBuildDir;
}
public void setContentRoots(Set<ExtIdeaContentRoot> contentRoots) {
myContentRoots = contentRoots == null ? Collections.<ExtIdeaContentRoot>emptySet() : contentRoots;
}