Search in sources :

Example 6 with TsArtifact

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

the class DependencyPresentTwiceInTheGraphWithDifferentClassifierAndTypeTestCase method setupDependencies.

@Override
protected void setupDependencies() {
    final TsArtifact common1 = new TsArtifact("common", "1");
    install(common1, true);
    installAsDep(new TsArtifact("required-dep1").addDependency(common1), true);
    final TsArtifact commonClient2 = new TsArtifact(TsArtifact.DEFAULT_GROUP_ID, "common", "client", "txt", "2");
    install(commonClient2, true);
    installAsDep(new TsArtifact("required-dep2").addDependency(commonClient2), true);
    installAsDep(new TsArtifact(TsArtifact.DEFAULT_GROUP_ID, "common", "", "jar", "3"), true);
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact)

Example 7 with TsArtifact

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

the class DirectDependencyVersionOverridesTransitiveVersionTestCase method setupDependencies.

@Override
protected void setupDependencies() {
    installAsDep(new TsArtifact("required-dep1").addDependency(new TsArtifact("common-b", "2")));
    installAsDep(new TsArtifact("common-b", "1"));
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact)

Example 8 with TsArtifact

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

the class ExclusionsTestCase method setupDependencies.

@Override
protected void setupDependencies() {
    final TsArtifact requiredTransitive = new TsArtifact("required-transitive").addDependency(new TsArtifact("excluded-dep", "2").addDependency(new TsArtifact("other-dep")));
    install(requiredTransitive, true);
    final TsArtifact otherDep2 = new TsArtifact("other-dep", "2");
    install(otherDep2, true);
    final TsArtifact otherRequiredTransitive = new TsArtifact("other-required-transitive").addDependency(otherDep2);
    install(otherRequiredTransitive, true);
    installAsDep(new TsArtifact("required-dep1").addDependency(new TsDependency(requiredTransitive).exclude("excluded-dep")).addDependency(otherRequiredTransitive));
}
Also used : TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) TsDependency(io.quarkus.bootstrap.resolver.TsDependency)

Example 9 with TsArtifact

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

the class PackageAppTestBase method platformDescriptor.

protected TsDependency platformDescriptor() {
    if (platformDescriptor == null) {
        TsArtifact platformDescr = new TsArtifact("org.acme", "acme" + BootstrapConstants.PLATFORM_DESCRIPTOR_ARTIFACT_ID_SUFFIX, "1.0", "json", "1.0");
        platformDescr.setContent(new ContentProvider() {

            Path platformJson;

            @Override
            public Path getPath(Path workDir) throws IOException {
                if (platformJson == null) {
                    platformJson = workDir.resolve("platform-descriptor.json");
                    try (BufferedWriter writer = Files.newBufferedWriter(platformJson)) {
                        writer.write("platform descriptor");
                    }
                }
                return platformJson;
            }
        });
        platformDescr.install(repo);
        platformDescriptor = new TsDependency(platformDescr);
    }
    return platformDescriptor;
}
Also used : Path(java.nio.file.Path) TsArtifact(io.quarkus.bootstrap.resolver.TsArtifact) ContentProvider(io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider) IOException(java.io.IOException) TsDependency(io.quarkus.bootstrap.resolver.TsDependency) BufferedWriter(java.io.BufferedWriter)

Example 10 with TsArtifact

use of io.quarkus.bootstrap.resolver.TsArtifact 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)

Aggregations

TsArtifact (io.quarkus.bootstrap.resolver.TsArtifact)30 TsDependency (io.quarkus.bootstrap.resolver.TsDependency)18 TsQuarkusExt (io.quarkus.bootstrap.resolver.TsQuarkusExt)13 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 Activation (org.apache.maven.model.Activation)1 ActivationProperty (org.apache.maven.model.ActivationProperty)1 Dependency (org.apache.maven.model.Dependency)1 Profile (org.apache.maven.model.Profile)1