]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Use given base name when exporting tg file along with shared library 99/1999/1
authorJussi Koskela <jussi.koskela@semantum.fi>
Thu, 9 Aug 2018 10:22:16 +0000 (13:22 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Thu, 9 Aug 2018 14:19:39 +0000 (14:19 +0000)
gitlab #79

Change-Id: I7cec6fe1546475a40de09514d8aeb8b219b290fa
(cherry picked from commit cdfd997cc5118a9fb08a73f35c6f7306308abd86)

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);
        }