Skip to content

Commit

Permalink
FORGE-1662 Use given --projectRoot as root path for Addon
Browse files Browse the repository at this point in the history
  • Loading branch information
aslakknutsen committed Mar 9, 2014
1 parent e02c0c3 commit 7cfa57f
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@ public class AddonBuildAndInstallCommand extends AbstractUICommand implements Ad
@Inject
private AddonRegistry registry;

private Project project;

@Override
public Metadata getMetadata(UIContext context)
{
Expand All @@ -64,7 +62,7 @@ public boolean isEnabled(UIContext context)
@Override
public void initializeUI(UIBuilder builder) throws Exception
{
project = getSelectedProject(builder.getUIContext());
Project project = getSelectedProject(builder.getUIContext());
if (project != null)
{
projectRoot.setDefaultValue(project.getRootDirectory());
Expand All @@ -75,6 +73,10 @@ public void initializeUI(UIBuilder builder) throws Exception
@Override
public Result execute(UIExecutionContext context)
{
Project project = projectFactory.findProject(projectRoot.getValue());
if(project == null) {
return Results.fail("No project found in root " + projectRoot.getValue().getFullyQualifiedName());
}
Coordinate coordinate = project.getFacet(MetadataFacet.class).getOutputDependency().getCoordinate();
try
{
Expand Down

0 comments on commit 7cfa57f

Please sign in to comment.