Skip to content
This repository has been archived by the owner on Jan 5, 2021. It is now read-only.

Commit

Permalink
#899 merged core and base library, feature library helper and constants
Browse files Browse the repository at this point in the history
  • Loading branch information
andreasmuelder committed Aug 12, 2016
1 parent b752546 commit 8396c48
Show file tree
Hide file tree
Showing 21 changed files with 95 additions and 271 deletions.
3 changes: 1 addition & 2 deletions META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Export-Package: org.yakindu.sct.generator.core,
org.yakindu.sct.generator.core.extensions,
org.yakindu.sct.generator.core.features,
org.yakindu.sct.generator.core.features.impl,
org.yakindu.sct.generator.core.library.impl,
org.yakindu.sct.generator.core.filesystem,
org.yakindu.sct.generator.core.impl,
org.yakindu.sct.generator.core.library,
Expand Down
14 changes: 14 additions & 0 deletions library/CoreFeatureTypeLibrary.xmi
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,18 @@
<parameters
name="licenseText"/>
</types>
<types name="Debug" optional="true">
<parameters name="dumpSexec" parameterType="BOOLEAN"/>
</types>
<types name="FunctionInlining" optional="true">
<parameters name="inlineReactions" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineEntryActions" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineExitActions" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineEnterSequences" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineExitSequences" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineChoices" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineEnterRegion" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineExitRegion" optional="true" parameterType="BOOLEAN"/>
<parameters name="inlineEntries" optional="true" parameterType="BOOLEAN"/>
</types>
</sgen:FeatureTypeLibrary>
17 changes: 0 additions & 17 deletions library/SCTBaseFeatureLibrary.xmi

This file was deleted.

9 changes: 2 additions & 7 deletions plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,14 @@
point="org.yakindu.sct.generator.core.featuretypes">
<FeatureLibrary
library_id="org.yakindu.generator.core.features"
defaultProvider="org.yakindu.sct.generator.core.features.impl.CoreLibraryDefaultFeatureValueProvider"
defaultProvider="org.yakindu.sct.generator.core.library.impl.CoreLibraryDefaultFeatureValueProvider"
uri="platform:/plugin/org.yakindu.sct.generator.core/library/CoreFeatureTypeLibrary.xmi">
</FeatureLibrary>
<FeatureLibrary
library_id="org.yakindu.generator.core.features.generic"
defaultProvider="org.yakindu.sct.generator.core.features.impl.GenericJavaLibraryDefaultValueProvider"
defaultProvider="org.yakindu.sct.generator.core.library.impl.GenericJavaLibraryDefaultValueProvider"
uri="platform:/plugin/org.yakindu.sct.generator.core/library/GenericJavaFeatureTypeLibrary.xmi">
</FeatureLibrary>
<FeatureLibrary
library_id="org.yakindu.generator.core.features.sctbase"
defaultProvider="org.yakindu.sct.generator.core.features.impl.SCTBaseLibaryDefaultFeatureValueProvider"
uri="platform:/plugin/org.yakindu.sct.generator.core/library/SCTBaseFeatureLibrary.xmi">
</FeatureLibrary>
</extension>
<extension
point="org.yakindu.sct.generator.core.generator">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,22 @@ public final void refreshTargetProject(GeneratorEntry entry) {
}

public final File getTargetProject(GeneratorEntry entry) {
URI uri = sctFsa.getURI(outletFeatureHelper.getTargetProjectValue(entry).getStringValue());
URI uri = sctFsa.getURI(coreFeatureHelper.getTargetProjectValue(entry).getStringValue());
return new File(uri.toFileString());
}

public final File getTargetFolder(GeneratorEntry entry) {
URI uri = sctFsa.getURI(outletFeatureHelper.getRelativeTargetFolder(entry));
URI uri = sctFsa.getURI(coreFeatureHelper.getRelativeTargetFolder(entry));
return new File(uri.toFileString());
}

public final File getLibraryTargetFolder(GeneratorEntry entry) {
URI uri = sctFsa.getURI(outletFeatureHelper.getRelativeLibraryFolder(entry));
URI uri = sctFsa.getURI(coreFeatureHelper.getRelativeLibraryFolder(entry));
return new File(uri.toFileString());
}

public final File getApiTargetFolder(GeneratorEntry entry) {
URI uri = sctFsa.getURI(outletFeatureHelper.getRelativeApiFolder(entry));
URI uri = sctFsa.getURI(coreFeatureHelper.getRelativeApiFolder(entry));
return new File(uri.toFileString());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.yakindu.sct.generator.core.extensions;

import org.eclipse.emf.common.util.URI;
import org.yakindu.sct.generator.core.features.IDefaultFeatureValueProvider;
import org.yakindu.sct.generator.core.library.IDefaultFeatureValueProvider;

public interface ILibraryDescriptor {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.Platform;
import org.eclipse.emf.common.util.URI;
import org.yakindu.sct.generator.core.features.IDefaultFeatureValueProvider;
import org.yakindu.sct.generator.core.library.IDefaultFeatureValueProvider;
import org.yakindu.sct.model.sgen.FeatureTypeLibrary;

import com.google.common.base.Predicate;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
*/
package org.yakindu.sct.generator.core.impl;

import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_CHOICES;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTER_REGION;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTER_SEQUENCES;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTRIES;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTRY_ACTIONS;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_ACTIONS;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_REGION;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_SEQUENCES;
import static org.yakindu.sct.generator.core.features.ISCTBaseFeatureConstants.FUNCTION_INLINING_FEATURE_INLINE_REACTIONS;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_CHOICES;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTER_REGION;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTER_SEQUENCES;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTRIES;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_ENTRY_ACTIONS;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_ACTIONS;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_REGION;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_EXIT_SEQUENCES;
import static org.yakindu.sct.generator.core.library.ICoreLibraryConstants.FUNCTION_INLINING_FEATURE_INLINE_REACTIONS;

import java.io.IOException;
import java.util.Collections;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
*/
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.xtext.generator.IFileSystemAccess;
import org.eclipse.xtext.generator.OutputConfiguration;
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.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.sgen.FeatureParameterValue;
import org.yakindu.sct.model.sgen.GeneratorEntry;
Expand All @@ -33,7 +33,7 @@
* abstract base class for all code generators that want to generate code based
* 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
*
*/
Expand All @@ -42,9 +42,7 @@ public abstract class AbstractSGraphModelGenerator implements ISCTGenerator {
@Inject
protected IGeneratorLog log;
@Inject
protected IOutletFeatureHelper outletFeatureHelper;
@Inject
protected IDebugFeatureHelper debugFeatureHelper;
protected ICoreLibraryHelper coreFeatureHelper;
@Inject
protected ISCTFileSystemAccess sctFsa;

Expand Down Expand Up @@ -116,7 +114,8 @@ protected void doGenerate(GeneratorEntry entry) {
* includes a {@link Statechart}. Sub-classes may override this method if
* 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}
*/
protected boolean canHandle(GeneratorEntry entry) {
Expand Down Expand Up @@ -146,11 +145,11 @@ protected void finishGenerator(GeneratorEntry entry) {

/**
* 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
* the next generator entry
Expand Down Expand Up @@ -192,7 +191,7 @@ protected void initFileSystemAccess(GeneratorEntry entry) {
}

protected void initLibraryTargetFolder(GeneratorEntry entry) {
FeatureParameterValue libraryTargetFolderValue = outletFeatureHelper.getLibraryTargetFolderValue(entry);
FeatureParameterValue libraryTargetFolderValue = coreFeatureHelper.getLibraryTargetFolderValue(entry);
if (libraryTargetFolderValue != null) {
sctFsa.setOutputPath(IExecutionFlowGenerator.LIBRARY_TARGET_FOLDER_OUTPUT,
libraryTargetFolderValue.getStringValue());
Expand All @@ -208,9 +207,9 @@ protected void initLibraryTargetFolder(GeneratorEntry entry) {
librarytargetFolderOutputConfiguration.setOverrideExistingResources(false);
}
}

protected void initApiTargetFolder(GeneratorEntry entry) {
FeatureParameterValue apiTargetFolderValue = outletFeatureHelper.getApiTargetFolderValue(entry);
FeatureParameterValue apiTargetFolderValue = coreFeatureHelper.getApiTargetFolderValue(entry);
if (apiTargetFolderValue != null) {
sctFsa.setOutputPath(IExecutionFlowGenerator.API_TARGET_FOLDER_OUTPUT,
apiTargetFolderValue.getStringValue());
Expand All @@ -224,12 +223,12 @@ protected void initApiTargetFolder(GeneratorEntry entry) {

protected void initDefaultOutput(GeneratorEntry entry) {
sctFsa.setOutputPath(IFileSystemAccess.DEFAULT_OUTPUT,
outletFeatureHelper.getTargetFolderValue(entry).getExpression().toString());
coreFeatureHelper.getTargetFolderValue(entry).getExpression().toString());
sctFsa.getOutputConfigurations().get(IFileSystemAccess.DEFAULT_OUTPUT).setCreateOutputDirectory(true);
}

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());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void runGenerator(Statechart statechart, GeneratorEntry entry) {

ExecutionFlow flow = createExecutionFlow(statechart, entry);

if (debugFeatureHelper.isDumpSexec(entry)) {
if (coreFeatureHelper.isDumpSexec(entry)) {
dumpSexec(entry, flow);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Contributors:
* committers of YAKINDU - initial API and implementation
*/
package org.yakindu.sct.generator.core.features;
package org.yakindu.sct.generator.core.library;

import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
Expand Down
Loading

0 comments on commit 8396c48

Please sign in to comment.