use of io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider 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;
}
use of io.quarkus.bootstrap.resolver.TsArtifact.ContentProvider 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;
}
Aggregations