This commit is contained in:
2026-04-07 05:40:03 +01:00
parent 5b03fe6cfd
commit f251e9112e
4 changed files with 1 additions and 65 deletions
@@ -5,13 +5,5 @@ plugins {
dependencies {
implementation(project(":prometeu-infra"))
implementation(project(":prometeu-packer:prometeu-packer-api"))
implementation("org.apache.tika:tika-core:3.2.1")
}
tasks.register<JavaExec>("runPackMain") {
group = "application"
description = "Runs p.packer.PackMain against test-projects/main."
classpath = sourceSets.main.get().runtimeClasspath
mainClass = "p.packer.PackMain"
workingDir = rootDir
implementation("org.apache.tika:tika-core:3.2.2")
}
@@ -1,32 +0,0 @@
package p.packer;
import com.fasterxml.jackson.databind.ObjectMapper;
import p.packer.messages.PackWorkspaceRequest;
import p.packer.messages.PackerOperationStatus;
import p.packer.messages.PackerProjectContext;
import p.studio.utilities.PConstants;
import java.nio.file.Path;
public final class PackMain {
private PackMain() {
}
public static void main(String[] args) {
final Path projectRoot = args.length == 0
? Path.of("test-projects/%s".formatted(PConstants.PROJECT))
: Path.of(args[0]);
final String projectId = projectRoot.getFileName() == null
? "project"
: projectRoot.getFileName().toString();
try (var packer = Packer.bootstrap(new ObjectMapper(), event -> { })) {
final var result = packer.workspaceService().packWorkspace(
new PackWorkspaceRequest(new PackerProjectContext(projectId, projectRoot)));
System.out.println(result.summary());
if (result.status() != PackerOperationStatus.SUCCESS) {
throw new IllegalStateException("pack failed with status: " + result.status());
}
}
}
}