]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Use given base name when exporting tg file along with shared library 98/1998/2
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 9 Aug 2018 10:22:16 +0000 (13:22 +0300)
committerJussi Koskela <jussi.koskela@semantum.fi>
Thu, 9 Aug 2018 10:24:07 +0000 (13:24 +0300)
gitlab #79

Change-Id: I7cec6fe1546475a40de09514d8aeb8b219b290fa

bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java

index ffe174eb943b236be72e4d1a8f26808070828608..27c4b9195522d82291c6374586c0db985d1bfe4b 100644 (file)
@@ -45,13 +45,14 @@ public class FixExportedOntology {
        }
        
        public static void createTGAndPGraph(Path input) throws Exception {
-        Path output1 = input.getParent().resolve("graph.tg");
-        TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
-        String listing = PrettyPrintTG.print(tg, false);
         String newName = input.getFileName().toString();
         if (newName.contains("."))
             newName = newName.split("\\.")[0];
-        Path output2 = input.getParent().resolve(newName + ".pgraph");
+        Path parent = input.getParent();
+        Path output1 = parent.resolve(newName + ".tg");
+        TransferableGraph1 tg = convertExportedSharedOntologyIntoBundleOntology(input, output1);
+        String listing = PrettyPrintTG.print(tg, false);
+        Path output2 = parent.resolve(newName + ".pgraph");
         Files.write(output2, listing.getBytes(),StandardOpenOption.CREATE);
        }