Skip to content

Commit

Permalink
Introduced skipPreInstall system variable to skip pre-installation of…
Browse files Browse the repository at this point in the history
… addons
  • Loading branch information
gastaldi committed Mar 8, 2013
1 parent 9339dd2 commit 6118c4c
Showing 1 changed file with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,29 @@ public class InstallRequiredAddonsListener implements ContainerLifecycleListener
@Override
public void beforeStart(Forge forge) throws ContainerException
{
AddonRepository repository = forge.getRepository();
List<AddonId> addons = new ArrayList<AddonId>();
for (String addonCoordinate : REQUIRED_ADDON_COORDINATES)
if (Boolean.getBoolean("skipPreInstall"))
{
AddonId addonId = toAddonId(addonCoordinate);
if (repository.isDeployed(addonId))
{
logger.fine("Addon " + addonId + " is already deployed");
}
else
logger.info("Skipping pre-installation of required addons");
}
else
{
logger.info("Pre-installing required addons...");
AddonRepository repository = forge.getRepository();
List<AddonId> addons = new ArrayList<AddonId>();
for (String addonCoordinate : REQUIRED_ADDON_COORDINATES)
{
addons.add(addonId);
AddonId addonId = toAddonId(addonCoordinate);
if (repository.isDeployed(addonId))
{
logger.fine("Addon " + addonId + " is already deployed");
}
else
{
addons.add(addonId);
}
}
install(forge, addons);
}
install(forge, addons);
}

@Override
Expand All @@ -93,6 +101,7 @@ private void install(Forge forge, Iterable<AddonId> addons)

for (AddonId addon : addons)
{
logger.info("Installing " + addon);
InstallRequest request = addonManager.install(addon);
logger.info(request.toString());
request.perform();
Expand Down

0 comments on commit 6118c4c

Please sign in to comment.