Search in sources :

Example 6 with TsDependency

use of io.quarkus.bootstrap.resolver.TsDependency in project quarkus by quarkusio.

the class PackageAppTestBase method platformProperties.

protected TsDependency platformProperties() {
    if (platformPropsDep == null) {
        TsArtifact platformProps = new TsArtifact("org.acme", "acme" + BootstrapConstants.PLATFORM_PROPERTIES_ARTIFACT_ID_SUFFIX, null, "properties", "1.0");
        platformProps.setContent(new ContentProvider() {

            Path propsFile;

            @Override
            public Path getPath(Path workDir) throws IOException {
                if (propsFile == null) {
                    Properties props = new Properties();
                    props.setProperty("platform.quarkus.native.builder-image", "builder-image-url");
                    propsFile = workDir.resolve("platform-properties.properties");
                    try (OutputStream os = Files.newOutputStream(propsFile)) {
                        props.store(os, "Test Quarkus platform properties");
                    }
                }
                return propsFile;
            }
        });
        platformProps.install(repo);
        platformPropsDep = new TsDependency(platformProps);
    }
    return platformPropsDep;
}
Also used : Path(java.nio.file.Path) TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) ContentProvider(io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider) OutputStream(java.io.OutputStream) IOException(java.io.IOException) Properties(java.util.Properties) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 7 with TsDependency

use of io.quarkus.bootstrap.resolver.TsDependency in project quarkus by quarkusio.

the class ProvidedExtensionDepsTest method composeApplication.

@Override
protected TsArtifact composeApplication() {
    final TsArtifact extADep = TsArtifact.jar("ext-a-dep");
    addToExpectedLib(extADep);
    final TsArtifact extAProvidedDep = TsArtifact.jar("ext-a-provided-dep");
    final TsArtifact extADeploymentDep = TsArtifact.jar("ext-a-deployment-dep");
    final TsArtifact extAOptionalDeploymentDep = TsArtifact.jar("ext-a-provided-deployment-dep");
    final TsQuarkusExt extA = new TsQuarkusExt("ext-a");
    addToExpectedLib(extA.getRuntime());
    extA.getRuntime().addDependency(new TsDependency(extADep)).addDependency(new TsDependency(extAProvidedDep, "provided"));
    extA.getDeployment().addDependency(new TsDependency(extADeploymentDep)).addDependency(new TsDependency(extAOptionalDeploymentDep, "provided"));
    final TsQuarkusExt extB = new TsQuarkusExt("ext-b");
    this.install(extB);
    final TsArtifact someProvidedDep = TsArtifact.jar("some-provided-dep");
    return TsArtifact.jar("app").addManagedDependency(platformDescriptor()).addManagedDependency(platformProperties()).addDependency(extA).addDependency(extB, "provided").addDependency(new TsDependency(someProvidedDep, "provided"));
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 8 with TsDependency

use of io.quarkus.bootstrap.resolver.TsDependency in project quarkus by quarkusio.

the class ExcludeLibDepsTest method composeApplication.

@Override
protected TsArtifact composeApplication() {
    final TsArtifact extADep1 = TsArtifact.jar("ext-a-dep-1");
    addToExpectedLib(extADep1);
    final TsArtifact extADep2 = TsArtifact.jar("ext-a-dep-2");
    addToExpectedLib(extADep2);
    final TsArtifact extADepTrans1 = TsArtifact.jar("ext-a-dep-trans-1");
    addToExpectedLib(extADepTrans1);
    final TsArtifact extADepTrans2 = TsArtifact.jar("ext-a-dep-trans-2");
    addToExpectedLib(extADepTrans2);
    final TsArtifact depToExclude1 = TsArtifact.jar("ext-dep-exclude-1");
    final TsArtifact depToExclude2 = TsArtifact.jar("ext-dep-exclude-2");
    final TsArtifact depToExclude3 = TsArtifact.jar("ext-dep-exclude-3");
    final TsArtifact depToExclude4 = TsArtifact.jar("ext-dep-exclude-4");
    final TsArtifact depToExclude5 = TsArtifact.jar("ext-dep-exclude-5");
    final TsArtifact depToExclude6 = TsArtifact.jar("ext-dep-exclude-6");
    extADepTrans2.addDependency(new TsDependency(extADep2));
    extADepTrans2.addDependency(new TsDependency(depToExclude6));
    extADepTrans1.addDependency(new TsDependency(extADepTrans2));
    extADepTrans1.addDependency(new TsDependency(depToExclude2));
    extADepTrans1.addDependency(new TsDependency(depToExclude5));
    extADep1.addDependency(extADepTrans1, depToExclude5);
    extADep1.addDependency(new TsDependency(depToExclude1));
    final TsQuarkusExt extA = new TsQuarkusExt("ext-a");
    addToExpectedLib(extA.getRuntime());
    extA.getRuntime().addDependency(extADep1, depToExclude6).addDependency(depToExclude3);
    extA.getDeployment().addDependency(depToExclude4);
    return TsArtifact.jar("app").addManagedDependency(platformDescriptor()).addManagedDependency(platformProperties()).addDependency(extA, depToExclude1, depToExclude2, depToExclude3, depToExclude4);
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 9 with TsDependency

use of io.quarkus.bootstrap.resolver.TsDependency in project quarkus by quarkusio.

the class OptionalDepsTest method composeApplication.

@Override
protected TsArtifact composeApplication() {
    final TsArtifact extADep = TsArtifact.jar("ext-a-dep");
    addToExpectedLib(extADep);
    final TsArtifact extAOptionalDep = TsArtifact.jar("ext-a-optional-dep");
    final TsArtifact extAOptionalDeploymentDep = TsArtifact.jar("ext-a-optional-deployment-dep");
    final TsQuarkusExt extA = new TsQuarkusExt("ext-a");
    addToExpectedLib(extA.getRuntime());
    extA.getRuntime().addDependency(extADep).addDependency(new TsDependency(extAOptionalDep, true));
    extA.getDeployment().addDependency(new TsDependency(extAOptionalDeploymentDep, true));
    final TsArtifact extBOptionalDep = TsArtifact.jar("ext-b-optional-dep");
    final TsArtifact extBDeploymentDep = TsArtifact.jar("ext-b-deployment-dep");
    install(extBDeploymentDep);
    final TsArtifact extBOptionalDeploymentDep = TsArtifact.jar("ext-b-optional-deployment-dep");
    install(extBOptionalDeploymentDep);
    final TsQuarkusExt extB = new TsQuarkusExt("ext-b");
    extB.getRuntime().addDependency(new TsDependency(extBOptionalDep, true));
    addToExpectedLib(extB.getRuntime());
    extB.getDeployment().addDependency(new TsDependency(extBOptionalDeploymentDep, true));
    extB.getDeployment().addDependency(new TsDependency(extBDeploymentDep, false));
    install(extB);
    final TsArtifact appOptionalDep = TsArtifact.jar("app-optional-dep").addDependency(extB.getRuntime());
    addToExpectedLib(appOptionalDep);
    final TsQuarkusExt extC = new TsQuarkusExt("ext-c");
    install(extC);
    final TsQuarkusExt extD = new TsQuarkusExt("ext-d");
    extD.getRuntime().addDependency(new TsDependency(extC.getRuntime(), true));
    extD.getDeployment().addDependency(new TsDependency(extC.getDeployment(), true));
    install(extD);
    addToExpectedLib(extD.getRuntime());
    return TsArtifact.jar("app").addManagedDependency(platformDescriptor()).addManagedDependency(platformProperties()).addDependency(extA, true).addDependency(new TsDependency(appOptionalDep, true)).addDependency(extD.getRuntime());
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 10 with TsDependency

use of io.quarkus.bootstrap.resolver.TsDependency in project quarkus by quarkusio.

the class ProvidedExtensionDepsInTestModeTest method composeApplication.

@Override
protected TsArtifact composeApplication() {
    final TsArtifact extADep = TsArtifact.jar("ext-a-dep");
    addToExpectedLib(extADep);
    final TsArtifact extAProvidedDep = TsArtifact.jar("ext-a-provided-dep");
    final TsArtifact extADeploymentDep = TsArtifact.jar("ext-a-deployment-dep");
    final TsArtifact extAOptionalDeploymentDep = TsArtifact.jar("ext-a-provided-deployment-dep");
    final TsQuarkusExt extA = new TsQuarkusExt("ext-a");
    addToExpectedLib(extA.getRuntime());
    extA.getRuntime().addDependency(new TsDependency(extADep)).addDependency(new TsDependency(extAProvidedDep, "provided"));
    extA.getDeployment().addDependency(new TsDependency(extADeploymentDep)).addDependency(new TsDependency(extAOptionalDeploymentDep, "provided"));
    final TsQuarkusExt extB = new TsQuarkusExt("ext-b");
    addToExpectedLib(extB.getRuntime());
    this.install(extB);
    final TsArtifact someProvidedDep = TsArtifact.jar("some-provided-dep");
    addToExpectedLib(someProvidedDep);
    return TsArtifact.jar("app").addManagedDependency(platformDescriptor()).addManagedDependency(platformProperties()).addDependency(extA).addDependency(extB, "provided").addDependency(new TsDependency(someProvidedDep, "provided"));
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsQuarkusExt(io.quarkus.bootstrap.resolver.TsQuarkusExt) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Aggregations

TsArtifact (io.quarkus.bootstrap.resolver.TsArtifact)18 TsDependency (io.quarkus.bootstrap.resolver.TsDependency)18 TsQuarkusExt (io.quarkus.bootstrap.resolver.TsQuarkusExt)9 ContentProvider (io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider)2 IOException (java.io.IOException)2 Path (java.nio.file.Path)2 WorkspaceModule (io.quarkus.bootstrap.workspace.WorkspaceModule)1 BufferedWriter (java.io.BufferedWriter)1 OutputStream (java.io.OutputStream)1 Properties (java.util.Properties)1