Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Compiler errors, updated to newest java version, updated travis, updated to newest featureIDE #53

Merged
merged 42 commits into from
Feb 18, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
b3bd504
Deleted setPossibleWords(...)
wurstbroteater Nov 25, 2020
06560c0
Merge pull request #1 from wurstbroteater/issue-48
tcerny Nov 25, 2020
8a41e4e
fixed #46
tcerny Nov 25, 2020
6a02b88
bugfix issue-47
jeremiaheinle Nov 25, 2020
3b77828
Merge remote-tracking branch 'origin/issue47' into issue-45
tcerny Nov 26, 2020
963271b
Merge remote-tracking branch 'origin/issue-48' into issue-45
tcerny Nov 26, 2020
826b307
added missing method initExtension()
tcerny Nov 26, 2020
250a2ca
DeltaFactoryManager update
jeremiaheinle Nov 26, 2020
ef529c5
updated travis and pom
wurstbroteater Dec 1, 2020
c92109d
forgotten commit in issue-45
wurstbroteater Dec 1, 2020
32487de
Tests do not trigger has been fixed
wurstbroteater Dec 1, 2020
764be5a
this branch fixed #42
wurstbroteater Dec 1, 2020
1d64214
Issue initExtension & DeltaFactoryManager
jeremiaheinle Dec 3, 2020
4471f5c
updated travis services to run with bionic and increased tycho versio…
wurstbroteater Dec 4, 2020
bfb65e7
deleted unnecessary depdency
wurstbroteater Dec 4, 2020
75ee471
Casted Path to IFile in order to keep the old code.
tcerny Dec 4, 2020
c28616c
Merge branch 'issue-46' into issue-45
tcerny Dec 4, 2020
b51d8ca
Merge branch 'issue-45' of github.com:tcerny/VariantSync into issue-45
tcerny Dec 4, 2020
08c1b78
Update .travis.yml
wurstbroteater Dec 4, 2020
9c7c2a3
win32 x86 no longer supported
wurstbroteater Dec 5, 2020
9464e20
works on my machine with tests and java >= 11
wurstbroteater Dec 6, 2020
b6d4102
Merge branch 'issue-42' into issue-45
tcerny Dec 8, 2020
30f3c25
Update .gitignore
tcerny Dec 8, 2020
003f7be
del .idea
jeremiaheinle Dec 8, 2020
2c59bb0
Update .gitignore
tcerny Dec 9, 2020
c84a9d1
Merge pull request #2 from tcerny/issue-45
wurstbroteater Dec 10, 2020
cbfe2a3
adressed: Pauls review: remove openjdk10
wurstbroteater Dec 10, 2020
02b4399
adressed Pauls review: remove empy line
wurstbroteater Dec 10, 2020
ae949ba
update .gitignore
tcerny Dec 23, 2020
7785e27
addressed Tobi's review
tcerny Dec 23, 2020
0c9ddd7
adressed Tobis review
wurstbroteater Dec 24, 2020
3c8410c
Adressing reviewer suggetions now in correct branch for #53
wurstbroteater Jan 16, 2021
a454db8
Adressing reviewer suggetions for travis
wurstbroteater Jan 21, 2021
95df99f
Adressing reviewer suggestion to remove commented import
wurstbroteater Jan 21, 2021
bb57936
Fixed Code Style
wurstbroteater Jan 21, 2021
bb7368b
added build status to readme
wurstbroteater Jan 21, 2021
38d9296
Delete de.tubs.variantsync.core-test/.settings directory
tcerny Jan 28, 2021
0159db8
Delete de.tubs.variantsync.core/.settings directory
tcerny Jan 28, 2021
00950e6
fixed code style and added all optional brackets
tcerny Jan 28, 2021
b069cd4
changed String to StringBuilder
wurstbroteater Feb 2, 2021
774e9a5
Auto format VariantSyncComposer
wurstbroteater Feb 2, 2021
381e491
addressing reviewer suggestion: replaced ternary operator with ifElse…
wurstbroteater Feb 2, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ language: java
jdk:
- openjdk11

#-----start GUI testing stuff
#-----start GUI testing
services:
- xvfb
#-----end GUI testing stuff
#-----end GUI testing
cache:
directories:
- "$HOME/.m2"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# VariantSync
# VariantSync [![Build Status](https://travis-ci.org/tthuem/VariantSync.svg?branch=seproj_ulm_2020)](https://travis-ci.org/tthuem/VariantSync)
=== Automating the Synchronization of Software Variants ===

VariantSync is a tool to develop variants separately as in clone-and-own and to automate change propagation by using domain knowledge of developers. VariantSync detects and logs changes during development, tags these changes to feature expressions and automates the synchronization
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public void testPatch2() throws DiffException {
assertTrue(patch.getDeltas().size() == 1);
}

}
}
388 changes: 388 additions & 0 deletions de.tubs.variantsync.core/.settings/org.eclipse.jdt.core.prefs

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,13 @@

public class VariantSyncComposer extends ComposerExtensionClass {

@Override public void performFullBuild(Path config) {
@Override
public void performFullBuild(Path config) {
VariantSyncPlugin.getConfigurationProjectManager().reinitialize();
}

@Override public void addCompiler(IProject project, String sourcePath, String configPath, String buildPath) {
@Override
public void addCompiler(IProject project, String sourcePath, String configPath, String buildPath) {
File featureContextFile = new File(project.getFile(FeatureContextFormat.FILENAME).getLocationURI());
try {
featureContextFile.createNewFile();
Expand All @@ -30,60 +32,74 @@ public class VariantSyncComposer extends ComposerExtensionClass {
}
}

@Override public boolean hasSourceFolder() {
@Override
public boolean hasSourceFolder() {
return false;
}

@Override public boolean hasFeatureFolder() {
@Override
public boolean hasFeatureFolder() {
return false;
}

@Override public boolean hasBuildFolder() {
@Override
public boolean hasBuildFolder() {
return false;
}

@Override public boolean createFolderForFeatures() {
@Override
public boolean createFolderForFeatures() {
return false;
}

@Override public boolean showContextFieldsAndMethods() {
@Override
public boolean showContextFieldsAndMethods() {
return false;
}

@Override public boolean hasMetaProductGeneration() {
@Override
public boolean hasMetaProductGeneration() {
return false;
}

@Override public Mechanism getGenerationMechanism() {
@Override
public Mechanism getGenerationMechanism() {
return null;
}

@Override public boolean supportsAndroid() {
@Override
public boolean supportsAndroid() {
return false;
}

@Override public boolean supportsMigration() {
@Override
public boolean supportsMigration() {
return false;
}

@Override public boolean clean() {
@Override
public boolean clean() {
return false;
}

@Override public void postCompile(IResourceDelta delta, IFile buildFile) {
@Override
public void postCompile(IResourceDelta delta, IFile buildFile) {

}

@Override public void copyNotComposedFiles(Configuration config, IFolder destination) {
@Override
public void copyNotComposedFiles(Configuration config, IFolder destination) {

}

@Override public void buildPartialFeatureProjectAssets(IFolder sourceFolder, ArrayList<String> removedFeatures, ArrayList<String> mandatoryFeatures)
throws IOException, CoreException {
@Override
public void buildPartialFeatureProjectAssets(IFolder sourceFolder, ArrayList<String> removedFeatures,
ArrayList<String> mandatoryFeatures) throws IOException, CoreException {

}

@Override public boolean supportsPartialFeatureProject() {
@Override
public boolean supportsPartialFeatureProject() {
return false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indent all over the place (tabsize = 8?)

Copy link
Collaborator

@h3ssto h3ssto Jan 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Edit by @pmbittner : Responding to this comment is impossible in Github. The same comment was made earlier here (#53 (comment)).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this has already been fixed, but Github doesn't track the changes for some reason

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,21 @@ public class VariantSyncPlugin extends AbstractUIPlugin {
/**
* The constructor
*/
public VariantSyncPlugin() {}
public VariantSyncPlugin() {
}

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework. BundleContext)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.
* BundleContext)
*/
public void start(BundleContext ctxt) throws Exception {
super.start(ctxt);
plugin = this;

DeltaFactoryManager
.setExtensionLoader(new EclipseExtensionLoader<>(PLUGIN_ID, IDeltaFactory.extensionPointID, IDeltaFactory.extensionID, IDeltaFactory.class));
DeltaFactoryManager.setExtensionLoader(new EclipseExtensionLoader<>(PLUGIN_ID, IDeltaFactory.extensionPointID,
IDeltaFactory.extensionID, IDeltaFactory.class));
tcerny marked this conversation as resolved.
Show resolved Hide resolved

configurationProjectManager.initalize();

Expand All @@ -87,7 +90,9 @@ public void run() {

/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework. BundleContext)
*
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.
* BundleContext)
*/
public void stop(BundleContext ctxt) throws Exception {
configurationProjectManager.terminate();
Expand Down Expand Up @@ -137,7 +142,8 @@ public static PatchesManager getActivePatchesManager() {
}

/**
* Returns an image descriptor for the image file at the given plug-in relative path.
* Returns an image descriptor for the image file at the given plug-in relative
* path.
*
* @param path the path
* @return the image descriptor
Expand All @@ -147,7 +153,8 @@ public ImageDescriptor getImageDescriptor(String path) {
}

/**
* Always good to have this static method as when dealing with IResources having a interface to get the editor is very handy
* Always good to have this static method as when dealing with IResources having
* a interface to get the editor is very handy
*
* @return
*/
Expand All @@ -160,9 +167,11 @@ public static ITextEditor getEditor() {
}

public static IFile getEditorInput() {
if (VariantSyncPlugin.getActiveWorkbenchWindow() == null) return null;
if (VariantSyncPlugin.getActiveWorkbenchWindow() == null)
return null;
tcerny marked this conversation as resolved.
Show resolved Hide resolved
IEditorPart editorPart = VariantSyncPlugin.getActiveWorkbenchWindow().getActivePage().getActiveEditor();
if (editorPart == null || !(editorPart instanceof IFileEditorInput)) return null;
if (editorPart == null || !(editorPart instanceof IFileEditorInput))
return null;
tcerny marked this conversation as resolved.
Show resolved Hide resolved
return ((IFileEditorInput) editorPart.getEditorInput()).getFile();
}

Expand Down Expand Up @@ -191,7 +200,8 @@ public void listenForActiveClass() {
}

public static void addNature(IProject project) {
VariantSyncProgressMonitor progressMonitor = new VariantSyncProgressMonitor("Adding VariantSync nature to " + project.getName());
VariantSyncProgressMonitor progressMonitor = new VariantSyncProgressMonitor(
"Adding VariantSync nature to " + project.getName());
try {
IProjectDescription description = project.getDescription();
String[] natures = description.getNatureIds();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,28 @@
public class ProjectNotFoundException extends NoSuchElementException {

private static final long serialVersionUID = 1L;

public enum Type {CONFIGURATION, VARIANT};


public enum Type {
CONFIGURATION, VARIANT
};

private Type type;

public ProjectNotFoundException(Type type) {
super("");
this.type = type;

}

public ProjectNotFoundException(Type type, String message) {
super(message);
this.type = type;
}

@Override
public String toString() {
return "A " + (type==Type.CONFIGURATION?"configuration project":"variant") + " does not exist in the workspace. " + getMessage();
return "A " + (type == Type.CONFIGURATION ? "configuration project" : "variant")
+ " does not exist in the workspace. " + getMessage();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK for now, please use StringBuilder in the future.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This problem will be addressed by the following issue #56

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
import de.tubs.variantsync.core.utilities.event.VariantSyncEvent;
import de.tubs.variantsync.core.utilities.event.VariantSyncEvent.EventType;

public class ConfigurationProjectManager extends AManager implements IEventListener, de.ovgu.featureide.fm.core.base.event.IEventListener {
public class ConfigurationProjectManager extends AManager
implements IEventListener, de.ovgu.featureide.fm.core.base.event.IEventListener {

private static HashMap<IFeatureProject, ConfigurationProject> INSTANCES = new HashMap<>();
private static ConfigurationProject lastRequestedConfiguration = null;
Expand All @@ -39,15 +40,17 @@ public void initalize() {
} catch (CoreException e) {
LogOperations.logError("A marker could not be deleted", e);
}
if (project.getProjectName().equals(VariantSyncPlugin.getDefault().getPreferenceStore().getString("lastRequestedConfiguration"))) {
if (project.getProjectName().equals(
VariantSyncPlugin.getDefault().getPreferenceStore().getString("lastRequestedConfiguration"))) {
lastConfiguration = getConfigurationProject(project);
} else {
getConfigurationProject(project);
}
}
if (lastConfiguration != null && lastRequestedConfiguration != lastConfiguration) {
lastRequestedConfiguration = lastConfiguration;
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null, lastRequestedConfiguration));
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null,
lastRequestedConfiguration));
}
for (ConfigurationProject configurationProject : INSTANCES.values()) {
findVariants(configurationProject);
Expand Down Expand Up @@ -82,7 +85,8 @@ public ConfigurationProject getConfigurationProject(IFeatureProject project) {
ConfigurationProject configurationProject = INSTANCES.get(featureProject);
if (lastRequestedConfiguration != configurationProject) {
lastRequestedConfiguration = configurationProject;
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null, lastRequestedConfiguration));
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null,
lastRequestedConfiguration));
}
return configurationProject;
}
Expand All @@ -92,7 +96,8 @@ public ConfigurationProject getConfigurationProject(IFeatureProject project) {
INSTANCES.put(project, configurationProject);
if (lastRequestedConfiguration != configurationProject) {
lastRequestedConfiguration = configurationProject;
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null, lastRequestedConfiguration));
fireEvent(new VariantSyncEvent(this, EventType.CONFIGURATIONPROJECT_CHANGED, null,
lastRequestedConfiguration));
}
return configurationProject;
}
Expand All @@ -103,16 +108,16 @@ public ConfigurationProject getConfigurationProject(IFeatureProject project) {
* Loads all contexts which are saved in a XML-file.
*/
private List<IFeatureProject> findConfigurationProjects() {
//System.out.println("[ConfigurationProjectManager.findConfigurationProjects]");
// System.out.println("[ConfigurationProjectManager.findConfigurationProjects]");
List<IFeatureProject> projects = new ArrayList<>();
for (IFeatureProject project : CorePlugin.getFeatureProjects()) {
//System.out.print(" project " + project.getProjectName());
// System.out.print(" project " + project.getProjectName());
if (project.getComposerID().equals("de.tubs.variantsync.core.composer")) {
LogOperations.logInfo("Found configuration project with name: " + project.getProjectName());
projects.add(project);
//System.out.println(" is variant composing");
// System.out.println(" is variant composing");
} else {
//System.out.println(" is NOT variant composing");
// System.out.println(" is NOT variant composing");
}
}
return projects;
Expand Down Expand Up @@ -142,8 +147,10 @@ private void findVariants(ConfigurationProject configurationProject) {

public IFeatureProject getFeatureProject(IProject project) {
for (IFeatureProject featureProject : INSTANCES.keySet()) {
if (project.getName().equals(featureProject.getProjectName())) return featureProject;
if (featureProject.getProject().exists() && INSTANCES.get(featureProject).getVariants().contains(project)) return featureProject;
if (project.getName().equals(featureProject.getProjectName()))
return featureProject;
if (featureProject.getProject().exists() && INSTANCES.get(featureProject).getVariants().contains(project))
return featureProject;
tcerny marked this conversation as resolved.
Show resolved Hide resolved
}
return null;
}
Expand All @@ -164,7 +171,8 @@ public ConfigurationProject getConfigurationProject(IProject project) {
* @return
*/
public ConfigurationProject getActiveConfigurationProject() {
if (VariantSyncPlugin.getEditorInput() == null) return lastRequestedConfiguration;
if (VariantSyncPlugin.getEditorInput() == null)
return lastRequestedConfiguration;
return getConfigurationProject(VariantSyncPlugin.getEditorInput().getProject());
}

Expand All @@ -177,7 +185,8 @@ public void propertyChange(FeatureIDEEvent event) {
LogOperations.logInfo("Model Event" + event);
if (event.getSource() instanceof IFeatureModel) {
IFeatureModel model = (IFeatureModel) event.getSource();
List<String> featureExpressions = getActiveConfigurationProject().getFeatureContextManager().getContextsAsStrings();
List<String> featureExpressions = getActiveConfigurationProject().getFeatureContextManager()
.getContextsAsStrings();
for (IFeature feature : model.getFeatures()) {
if (!featureExpressions.contains(feature.getName())) {
getActiveConfigurationProject().getFeatureContextManager().addContext(feature.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public void importFeaturesFromModel() throws ProjectNotFoundException {
fireEvent(new VariantSyncEvent(this, EventType.FEATURECONTEXT_ADDED, null, fe));
}
}
} else throw new ProjectNotFoundException(Type.CONFIGURATION);
} else
throw new ProjectNotFoundException(Type.CONFIGURATION);
tcerny marked this conversation as resolved.
Show resolved Hide resolved
}

public FeatureContext getContext(String name) {
Expand All @@ -108,8 +109,8 @@ public void reset() {
@Override
public void load() {
List<FeatureContext> contexts = new ArrayList<>();
FileHandler.load(Paths.get(configurationProject.getFeatureProject().getProject().getFile(FeatureContextFormat.FILENAME).getLocationURI()), contexts,
new FeatureContextFormat());
FileHandler.load(Paths.get(configurationProject.getFeatureProject().getProject()
.getFile(FeatureContextFormat.FILENAME).getLocationURI()), contexts, new FeatureContextFormat());
if (contexts.isEmpty()) {
try {
importFeaturesFromModel();
Expand All @@ -124,8 +125,8 @@ public void load() {

@Override
public void save() {
FileHandler.save(Paths.get(configurationProject.getFeatureProject().getProject().getFile(FeatureContextFormat.FILENAME).getLocationURI()),
getContexts(), new FeatureContextFormat());
FileHandler.save(Paths.get(configurationProject.getFeatureProject().getProject()
.getFile(FeatureContextFormat.FILENAME).getLocationURI()), getContexts(), new FeatureContextFormat());
}

}
Loading