Commit 88d0c697 authored by Leonard Faecke's avatar Leonard Faecke
Browse files

* Added relative filename of features to output json

parent aec5f6f5
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -319,11 +319,18 @@ public class TTCN3ResourceProvider {
			pool.shutdown();
			System.out.print('\n');
			List<Map<String, Long>> maps = new ArrayList<>();
			String name = new File(paths.get(0)).getName();
			for (Future<TTCN3Usage> f : output) {
				TTCN3Usage o = f.get();
				//System.out.println("Usage analysis output of " + o.getResource().getURI().lastSegment());
				//printOutput(o.getResource(), o.getOutput());
				maps.add(o.getOutput());
				String pathName = String.join("/", o.getResource().getURI().segments());
				pathName = pathName.replace("\\", "/");
				Map<String, Long> newMap = new HashMap<String, Long>();
				pathName = pathName.substring(pathName.indexOf(name) + name.length() + 1);
				for(String k : o.getOutput().keySet()) {
					newMap.put(k + "|" + pathName, o.getOutput().get(k));
				}
				//printOutput(o.getResource(), newMap);
				maps.add(newMap);
			}
			
			Map<String, Long> unified = unifyMaps(maps);
@@ -331,7 +338,7 @@ public class TTCN3ResourceProvider {
			System.out.println("Total usage analysis output:");
			//printOutput(unified);
			
			saveJson(unified, new File(paths.get(0)).getName() + ".json");
			saveJson(unified, name + ".json");

		} catch (InterruptedException | ExecutionException e) {
			// TODO Auto-generated catch block