|
@@ -11,14 +11,14 @@
|
|
|
*/
|
|
*/
|
|
|
package org.yakindu.sct.generator.core.impl;
|
|
package org.yakindu.sct.generator.core.impl;
|
|
|
|
|
|
|
|
|
|
+import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.OUTLET_FEATURE_TARGET_PROJECT;
|
|
|
|
|
+
|
|
|
import org.eclipse.emf.ecore.EObject;
|
|
import org.eclipse.emf.ecore.EObject;
|
|
|
import org.eclipse.xtext.generator.IFileSystemAccess;
|
|
import org.eclipse.xtext.generator.IFileSystemAccess;
|
|
|
import org.eclipse.xtext.generator.OutputConfiguration;
|
|
import org.eclipse.xtext.generator.OutputConfiguration;
|
|
|
import org.yakindu.sct.generator.core.ISCTGenerator;
|
|
import org.yakindu.sct.generator.core.ISCTGenerator;
|
|
|
-import org.yakindu.sct.generator.core.features.ICoreFeatureConstants;
|
|
|
|
|
import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
|
|
import org.yakindu.sct.generator.core.filesystem.ISCTFileSystemAccess;
|
|
|
-import org.yakindu.sct.generator.core.library.IDebugFeatureHelper;
|
|
|
|
|
-import org.yakindu.sct.generator.core.library.IOutletFeatureHelper;
|
|
|
|
|
|
|
+import org.yakindu.sct.generator.core.library.ICoreLibraryHelper;
|
|
|
import org.yakindu.sct.model.sexec.ExecutionFlow;
|
|
import org.yakindu.sct.model.sexec.ExecutionFlow;
|
|
|
import org.yakindu.sct.model.sgen.FeatureParameterValue;
|
|
import org.yakindu.sct.model.sgen.FeatureParameterValue;
|
|
|
import org.yakindu.sct.model.sgen.GeneratorEntry;
|
|
import org.yakindu.sct.model.sgen.GeneratorEntry;
|
|
@@ -33,7 +33,7 @@ import com.google.inject.util.Modules;
|
|
|
* abstract base class for all code generators that want to generate code based
|
|
* abstract base class for all code generators that want to generate code based
|
|
|
* on the {@link ExecutionFlow}
|
|
* on the {@link ExecutionFlow}
|
|
|
*
|
|
*
|
|
|
- * @author Andreas Mülder - Initial contribution and API
|
|
|
|
|
|
|
+ * @author Andreas Mülder - Initial contribution and API
|
|
|
* @author Johannes Dicks - decouple EFS
|
|
* @author Johannes Dicks - decouple EFS
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
@@ -42,9 +42,7 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
@Inject
|
|
@Inject
|
|
|
protected IGeneratorLog log;
|
|
protected IGeneratorLog log;
|
|
|
@Inject
|
|
@Inject
|
|
|
- protected IOutletFeatureHelper outletFeatureHelper;
|
|
|
|
|
- @Inject
|
|
|
|
|
- protected IDebugFeatureHelper debugFeatureHelper;
|
|
|
|
|
|
|
+ protected ICoreLibraryHelper coreFeatureHelper;
|
|
|
@Inject
|
|
@Inject
|
|
|
protected ISCTFileSystemAccess sctFsa;
|
|
protected ISCTFileSystemAccess sctFsa;
|
|
|
|
|
|
|
@@ -116,7 +114,8 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
* includes a {@link Statechart}. Sub-classes may override this method if
|
|
* includes a {@link Statechart}. Sub-classes may override this method if
|
|
|
* they handle elements with type other than @link {@link Statechart}.
|
|
* they handle elements with type other than @link {@link Statechart}.
|
|
|
*
|
|
*
|
|
|
- * @param entry the upcomming GeneratorEntry
|
|
|
|
|
|
|
+ * @param entry
|
|
|
|
|
+ * the upcomming GeneratorEntry
|
|
|
* @return true if this instance can handle the given {@link GeneratorEntry}
|
|
* @return true if this instance can handle the given {@link GeneratorEntry}
|
|
|
*/
|
|
*/
|
|
|
protected boolean canHandle(GeneratorEntry entry) {
|
|
protected boolean canHandle(GeneratorEntry entry) {
|
|
@@ -146,11 +145,11 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* Sub-classes might override this method to add custom bindings for a
|
|
* Sub-classes might override this method to add custom bindings for a
|
|
|
- * specific {@link GeneratorEntry}.
|
|
|
|
|
|
|
+ * specific {@link GeneratorEntry}.
|
|
|
*
|
|
*
|
|
|
- * In normal case sub-classes will just
|
|
|
|
|
- * override or add custom bindings and ensure all other bindings of
|
|
|
|
|
- * super-class implementations are still available.
|
|
|
|
|
|
|
+ * In normal case sub-classes will just override or add custom bindings and
|
|
|
|
|
+ * ensure all other bindings of super-class implementations are still
|
|
|
|
|
+ * available.
|
|
|
*
|
|
*
|
|
|
* @param entry
|
|
* @param entry
|
|
|
* the next generator entry
|
|
* the next generator entry
|
|
@@ -192,7 +191,7 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected void initLibraryTargetFolder(GeneratorEntry entry) {
|
|
protected void initLibraryTargetFolder(GeneratorEntry entry) {
|
|
|
- FeatureParameterValue libraryTargetFolderValue = outletFeatureHelper.getLibraryTargetFolderValue(entry);
|
|
|
|
|
|
|
+ FeatureParameterValue libraryTargetFolderValue = coreFeatureHelper.getLibraryTargetFolderValue(entry);
|
|
|
if (libraryTargetFolderValue != null) {
|
|
if (libraryTargetFolderValue != null) {
|
|
|
sctFsa.setOutputPath(IExecutionFlowGenerator.LIBRARY_TARGET_FOLDER_OUTPUT,
|
|
sctFsa.setOutputPath(IExecutionFlowGenerator.LIBRARY_TARGET_FOLDER_OUTPUT,
|
|
|
libraryTargetFolderValue.getStringValue());
|
|
libraryTargetFolderValue.getStringValue());
|
|
@@ -208,9 +207,9 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
librarytargetFolderOutputConfiguration.setOverrideExistingResources(false);
|
|
librarytargetFolderOutputConfiguration.setOverrideExistingResources(false);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
protected void initApiTargetFolder(GeneratorEntry entry) {
|
|
protected void initApiTargetFolder(GeneratorEntry entry) {
|
|
|
- FeatureParameterValue apiTargetFolderValue = outletFeatureHelper.getApiTargetFolderValue(entry);
|
|
|
|
|
|
|
+ FeatureParameterValue apiTargetFolderValue = coreFeatureHelper.getApiTargetFolderValue(entry);
|
|
|
if (apiTargetFolderValue != null) {
|
|
if (apiTargetFolderValue != null) {
|
|
|
sctFsa.setOutputPath(IExecutionFlowGenerator.API_TARGET_FOLDER_OUTPUT,
|
|
sctFsa.setOutputPath(IExecutionFlowGenerator.API_TARGET_FOLDER_OUTPUT,
|
|
|
apiTargetFolderValue.getStringValue());
|
|
apiTargetFolderValue.getStringValue());
|
|
@@ -224,12 +223,12 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
|
|
|
|
|
|
|
|
protected void initDefaultOutput(GeneratorEntry entry) {
|
|
protected void initDefaultOutput(GeneratorEntry entry) {
|
|
|
sctFsa.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT,
|
|
sctFsa.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT,
|
|
|
- outletFeatureHelper.getTargetFolderValue(entry).getExpression().toString());
|
|
|
|
|
|
|
+ coreFeatureHelper.getTargetFolderValue(entry).getExpression().toString());
|
|
|
sctFsa.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true);
|
|
sctFsa.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
protected void initFsaTargetProject(GeneratorEntry entry) {
|
|
protected void initFsaTargetProject(GeneratorEntry entry) {
|
|
|
- sctFsa.setOutputPath(ICoreFeatureConstants.OUTLET_FEATURE_TARGET_PROJECT,
|
|
|
|
|
- outletFeatureHelper.getTargetProjectValue(entry).getStringValue());
|
|
|
|
|
|
|
+ sctFsa.setOutputPath(OUTLET_FEATURE_TARGET_PROJECT,
|
|
|
|
|
+ coreFeatureHelper.getTargetProjectValue(entry).getStringValue());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|