From: Jussi Koskela Date: Thu, 9 Aug 2018 10:22:16 +0000 (+0300) Subject: Use given base name when exporting tg file along with shared library X-Git-Tag: v1.43.0~136^2~412 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=cdfd997cc5118a9fb08a73f35c6f7306308abd86;p=simantics%2Fplatform.git Use given base name when exporting tg file along with shared library gitlab #79 Change-Id: I7cec6fe1546475a40de09514d8aeb8b219b290fa --- diff --git a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java index ffe174eb9..27c4b9195 100644 --- a/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java +++ b/bundles/org.simantics.graph/src/org/simantics/graph/refactoring/FixExportedOntology.java @@ -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); }