v2.1 extended analysis render update
This commit is contained in:
@@ -55,6 +55,10 @@ public class ExportService {
|
||||
}
|
||||
|
||||
public void runExporter(Path inputDir, Path outputDir, List<String> selectedFormats, boolean renderChoicesAsDiamonds, List<String> activeProfiles) throws IOException {
|
||||
runExporter(inputDir, outputDir, selectedFormats, renderChoicesAsDiamonds, activeProfiles, null, null);
|
||||
}
|
||||
|
||||
public void runExporter(Path inputDir, Path outputDir, List<String> selectedFormats, boolean renderChoicesAsDiamonds, List<String> activeProfiles, Path flowsOverride, String machineFilter) throws IOException {
|
||||
CodebaseContext context = new CodebaseContext();
|
||||
context.setActiveProfiles(activeProfiles);
|
||||
context.setSourcepath(List.of(inputDir.toString()));
|
||||
@@ -71,10 +75,11 @@ public class ExportService {
|
||||
}
|
||||
|
||||
List<BusinessFlow> flows = new ArrayList<>();
|
||||
Path flowsFile = inputDir.resolve("flows.json");
|
||||
if (!Files.exists(flowsFile)) {
|
||||
Path flowsFile = flowsOverride != null ? flowsOverride : inputDir.resolve("flows.json");
|
||||
if (flowsOverride == null && !Files.exists(flowsFile)) {
|
||||
flowsFile = inputDir.resolve("src/main/resources/flows.json");
|
||||
}
|
||||
|
||||
if (Files.exists(flowsFile)) {
|
||||
log.info("Loading business flows from {}", flowsFile.toAbsolutePath());
|
||||
try {
|
||||
@@ -88,7 +93,7 @@ public class ExportService {
|
||||
context.scan(inputDir);
|
||||
|
||||
CodebaseIntelligenceProvider intelligence = new JdtIntelligenceProvider(context, inputDir);
|
||||
exportAll(context, intelligence, outputDir, selectedFormats, renderChoicesAsDiamonds, flows);
|
||||
exportAll(context, intelligence, outputDir, selectedFormats, renderChoicesAsDiamonds, flows, machineFilter);
|
||||
}
|
||||
|
||||
public void runJsonExporter(Path jsonFile, Path outputDir, List<String> selectedFormats) throws IOException {
|
||||
@@ -98,13 +103,14 @@ public class ExportService {
|
||||
generateOutputs(outputDir, result, selectedFormats);
|
||||
}
|
||||
|
||||
private void exportAll(CodebaseContext context, CodebaseIntelligenceProvider intelligence, Path outputDir, List<String> selectedFormats, boolean renderChoicesAsDiamonds, List<BusinessFlow> flows) throws IOException {
|
||||
private void exportAll(CodebaseContext context, CodebaseIntelligenceProvider intelligence, Path outputDir, List<String> selectedFormats, boolean renderChoicesAsDiamonds, List<BusinessFlow> flows, String machineFilter) throws IOException {
|
||||
Set<String> processedLocations = new HashSet<>();
|
||||
|
||||
// 1. Find entry point classes (annotated or extending adapter)
|
||||
List<TypeDeclaration> entryPoints = context.findEntryPointClasses(TARGET_ANNOTATIONS);
|
||||
for (TypeDeclaration td : entryPoints) {
|
||||
String fqn = context.getFqn(td);
|
||||
if (machineFilter != null && !fqn.contains(machineFilter)) continue;
|
||||
if (processedLocations.add(fqn)) {
|
||||
processEntryPoint(td, outputDir, context, intelligence, selectedFormats, renderChoicesAsDiamonds, flows);
|
||||
}
|
||||
@@ -118,6 +124,7 @@ public class ExportService {
|
||||
String methodName = m.getName().getIdentifier();
|
||||
String uniqueId = parentFqn + "#" + methodName;
|
||||
|
||||
if (machineFilter != null && !uniqueId.contains(machineFilter)) continue;
|
||||
if (processedLocations.add(uniqueId)) {
|
||||
processBeanMethod(m, outputDir, context, intelligence, selectedFormats, renderChoicesAsDiamonds, flows);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user