fixed handling of "output_folder" property
diff --git a/framework/plugins/org.eclipse.app4mc.transformation/src/org/eclipse/app4mc/transformation/TransformationProcessor.java b/framework/plugins/org.eclipse.app4mc.transformation/src/org/eclipse/app4mc/transformation/TransformationProcessor.java
index 6ebe36c..e9cf8b7 100644
--- a/framework/plugins/org.eclipse.app4mc.transformation/src/org/eclipse/app4mc/transformation/TransformationProcessor.java
+++ b/framework/plugins/org.eclipse.app4mc.transformation/src/org/eclipse/app4mc/transformation/TransformationProcessor.java
@@ -179,6 +179,10 @@
if (workDir == null) {
// if no working directory is provided as argument and not in the properties, use the parent of the properties file
workDir = propertiesFile.getParentFile();
+ //if properties doesn't contain 'workingDirectory' and command line parameter is also not specified, then add parent of properties file -> in properties as value for 'workingDirectory'
+ if(!properties.contains("workingDirectory")) {
+ properties.put("workingDirectory", workDir.getPath());
+ }
}
return harmonizeInputParameter(properties, workDir);
@@ -191,10 +195,6 @@
Object inputModelsFolder = properties.get("input_models_folder");
Object outputFolder = properties.get("output_folder");
- Object m2m_outputModelsFolder = properties.get("m2m_output_folder");
- Object m2t_output_folder = properties.get("m2t_output_folder");
- Object logFile = properties.get("log_file");
-
File inputFile = null;
if (inputModelsFolder != null) {
String path = inputModelsFolder.toString();
@@ -221,6 +221,7 @@
rootFolder = inputFile.getParentFile();
}
+
if (outputFolder != null) {
// check for generic output folder setting and derive needed values
Path outputFolderPath = Paths.get(outputFolder.toString());
@@ -229,7 +230,12 @@
properties.put("m2t_output_folder", Paths.get(outputFolderPath.toString(), "m2t_output_text_files").toString());
properties.put("log_file", Paths.get(outputFolderPath.toString(), "transformation.log").toString());
- } else {
+ }
+
+ Object m2m_outputModelsFolder = properties.get("m2m_output_folder");
+ Object m2t_output_folder = properties.get("m2t_output_folder");
+ Object logFile = properties.get("log_file");
+
// check for separate values
if (m2m_outputModelsFolder != null) {
String path = m2m_outputModelsFolder.toString();
@@ -239,9 +245,9 @@
: new File(rootFolder, path).getAbsolutePath();
properties.put("m2m_output_folder", newPath);
- } else {
- throw new IllegalArgumentException("'m2m_output_folder' parameter needs to be set");
- }
+ } else{
+ throw new IllegalArgumentException("'m2m_output_folder' parameter needs to be set");
+ }
if (m2t_output_folder != null) {
String path = m2t_output_folder.toString();
@@ -264,7 +270,7 @@
properties.put("log_file", newPath);
}
- }
+
return properties;
}