Skip to content
Browse files

Added logging to AddonModuleLoader

  • Loading branch information...
1 parent c62e6c6 commit baea41c833c3e3cefe8ce8a964d7378245efe2dd @gastaldi gastaldi committed
View
30 addons/src/main/java/org/jboss/forge/addons/ForgeAddonSetupStep.java
@@ -6,12 +6,20 @@
*/
package org.jboss.forge.addons;
+import java.util.HashSet;
+import java.util.Set;
+
import javax.inject.Inject;
+import org.jboss.forge.container.Forge;
+import org.jboss.forge.container.addons.AddonId;
+import org.jboss.forge.container.repositories.AddonRepository;
+import org.jboss.forge.projects.Project;
import org.jboss.forge.ui.context.UIBuilder;
import org.jboss.forge.ui.context.UIContext;
import org.jboss.forge.ui.context.UIValidationContext;
import org.jboss.forge.ui.input.UIInput;
+import org.jboss.forge.ui.input.UISelectMany;
import org.jboss.forge.ui.metadata.UICommandMetadata;
import org.jboss.forge.ui.result.NavigationResult;
import org.jboss.forge.ui.result.Result;
@@ -28,6 +36,12 @@
@Inject
private UIInput<Boolean> splitApiImpl;
+ @Inject
+ private UISelectMany<AddonId> addons;
+
+ @Inject
+ private Forge forge;
+
@Override
public UICommandMetadata getMetadata()
{
@@ -45,8 +59,18 @@ public boolean isEnabled(UIContext context)
@Override
public void initializeUI(UIBuilder builder) throws Exception
{
- splitApiImpl.setLabel("Split API and Implementation projects");
- builder.add(splitApiImpl);
+ splitApiImpl.setLabel("Split API and Implementation projects?");
+ addons.setLabel("Depend on these addons:");
+ Set<AddonId> choices = new HashSet<AddonId>();
+ for (AddonRepository repository : forge.getRepositories())
+ {
+ for (AddonId id : repository.listEnabled())
+ {
+ choices.add(id);
+ }
+ }
+ addons.setValueChoices(choices);
+ builder.add(splitApiImpl).add(addons);
}
@Override
@@ -58,6 +82,8 @@ public void validate(UIValidationContext validator)
@Override
public Result execute(UIContext context) throws Exception
{
+ Project project = (Project) context.getAttribute(Project.class);
+
return null;
}
View
3 container/src/main/java/org/jboss/forge/container/modules/AddonModuleLoader.java
@@ -13,6 +13,7 @@
import java.util.ServiceLoader;
import java.util.Set;
import java.util.jar.JarFile;
+import java.util.logging.Logger;
import org.jboss.forge.container.addons.AddonId;
import org.jboss.forge.container.exception.ContainerException;
@@ -41,6 +42,7 @@
private final Iterable<ModuleSpecProvider> moduleProviders;
private AddonRepository repository;
private AddonModuleIdentifierCache moduleCache;
+ private static final Logger logger = Logger.getLogger(AddonModuleLoader.class.getName());
public AddonModuleLoader(AddonRepository repository, ClassLoader loader)
{
@@ -137,6 +139,7 @@ public ModuleSpec findAddonModule(ModuleIdentifier id)
catch (ContainerException e)
{
// TODO implement proper fault handling. For now, abort.
+ logger.warning(e.getMessage());
return null;
}

0 comments on commit baea41c

Please sign in to comment.
Something went wrong with that request. Please try again.