Search in sources :

Example 11 with FeaturePackCreator

use of org.jboss.galleon.creator.FeaturePackCreator in project galleon by wildfly.

the class AdvancedLayersTestCase method buildFPWithOptionalLayers.

public static void buildFPWithOptionalLayers(CliWrapper cli, UniverseSpec universeSpec, String producer, String version) throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, producer, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).addFeatureSpec(FeatureSpec.builder(producer + "-FeatureA").addParam(FeatureParameterSpec.createId("id")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("base-" + producer).addFeature(new FeatureConfig(producer + "-FeatureA").setParam("id", "base")).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerA-" + producer).addLayerDep("base-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerB-" + producer).addLayerDep("layerA-" + producer, true).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerC-" + producer).addLayerDep("layerB-" + producer, true).build());
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeatureConfig(org.jboss.galleon.config.FeatureConfig) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Example 12 with FeaturePackCreator

use of org.jboss.galleon.creator.FeaturePackCreator in project galleon by wildfly.

the class AdvancedLayersTestCase method buildFPWithDependency.

private static void buildFPWithDependency(CliWrapper cli, UniverseSpec universeSpec, String producer, String version) throws ProvisioningException {
    FeaturePackLocation fpDep = new FeaturePackLocation(universeSpec, PRODUCER3, "1", null, version);
    FeaturePackCreator creatorDep = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    creatorDep.newFeaturePack(fpDep.getFPID()).addFeatureSpec(FeatureSpec.builder().addPackageDep("p0-required3").setName("feat0").build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layer0-" + PRODUCER3).addConfigItem(FeatureConfig.newConfig("feat0")).build()).newPackage("p0-required1", false).writeContent(PRODUCER3 + "/p0-required1.txt", "fp1 p1").getFeaturePack().newPackage("p0-required2", false).writeContent(PRODUCER3 + "/p0-required2.txt", "fp1 p1").getFeaturePack().newPackage("p0-required3", false).writeContent(PRODUCER3 + "/p0-required3.txt", "fp1 p1").getFeaturePack();
    creatorDep.install();
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    FeaturePackLocation fp1 = new FeaturePackLocation(universeSpec, producer, "1", null, version);
    creator.newFeaturePack(fp1.getFPID()).addDependency(PRODUCER3, fpDep).addFeatureSpec(FeatureSpec.builder().addPackageDep("p1-required").addPackageDep("p1-optional", true).addPackageDep(PackageDependencySpec.newInstance("p1-passive", PackageDependencySpec.PASSIVE)).setName("feat1").build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("base-" + producer).build()).addConfigLayer(ConfigLayerSpec.builder().setModel("testmodel").setName("layerA-" + producer).addLayerDep("base-" + producer).addConfigItem(FeatureConfig.newConfig("feat1")).build()).newPackage("p1-required", false).addDependency("p1-ref-from-required").addDependency(PRODUCER3, "p0-required1").writeContent("fp1/p1-required.txt", "fp1 p1").getFeaturePack().newPackage("p1-ref-from-required", false).writeContent("fp1/p1-ref-from-required.txt", "fp1 p1").getFeaturePack().newPackage("p1-passive", false).addDependency(PRODUCER3, "p0-required3").writeContent("fp1/p1-optional.txt", "fp1 p1").getFeaturePack().newPackage("p1-optional", false).addDependency("p1-ref-from-optional").addDependency(PRODUCER3, "p0-required2").writeContent("fp1/p1-optional.txt", "fp1 p1").getFeaturePack().newPackage("p1-ref-from-optional", false).writeContent("fp1/p1-ref-from-optional.txt", "fp1 p1").getFeaturePack();
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Example 13 with FeaturePackCreator

use of org.jboss.galleon.creator.FeaturePackCreator in project galleon by wildfly.

the class CliTestUtils method legacyInstall.

public static void legacyInstall(CliWrapper cli, Path directory, FeaturePackLocation loc) throws ProvisioningException {
    FeaturePackCreator creator = new FeaturePackCreator();
    creator.newFeaturePack(loc.getFPID()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1");
    creator.install(directory);
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator)

Example 14 with FeaturePackCreator

use of org.jboss.galleon.creator.FeaturePackCreator in project galleon by wildfly.

the class PatchTransitiveDepTestCase method install.

private static void install() throws ProvisioningException {
    FeaturePackCreator creator = FeaturePackCreator.getInstance().addArtifactResolver(cli.getSession().getMavenRepoManager());
    fp1 = new FeaturePackLocation(universeSpec, PRODUCER1, "1", null, "1.0.0.Final");
    creator.newFeaturePack(fp1.getFPID()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1");
    fp1Patch = new FeaturePackLocation(universeSpec, PRODUCER1, "1", null, "1.0.0.Patch.Final");
    creator.newFeaturePack(fp1Patch.getFPID()).setPatchFor(fp1.getFPID()).newPackage("p1", true).writeContent("fp1/p1.txt", "fp1 p1 patch");
    fp2 = new FeaturePackLocation(universeSpec, PRODUCER2, "1", null, "1.0.0.Final");
    creator.newFeaturePack(fp2.getFPID()).addDependency(fp1);
    creator.install();
}
Also used : FeaturePackCreator(org.jboss.galleon.creator.FeaturePackCreator) FeaturePackLocation(org.jboss.galleon.universe.FeaturePackLocation)

Aggregations

FeaturePackCreator (org.jboss.galleon.creator.FeaturePackCreator)14 FeaturePackLocation (org.jboss.galleon.universe.FeaturePackLocation)12 FeatureConfig (org.jboss.galleon.config.FeatureConfig)5 ProvisioningManager (org.jboss.galleon.ProvisioningManager)1 FeaturePackConfig (org.jboss.galleon.config.FeaturePackConfig)1 StateDiffPlugin (org.jboss.galleon.plugin.StateDiffPlugin)1 BasicStateDiffPlugin (org.jboss.galleon.userchanges.persist.test.BasicStateDiffPlugin)1