Skip to content
Snippets Groups Projects
Commit b9c2a308 authored by Joy Clark's avatar Joy Clark
Browse files

Merge remote-tracking branch 'origin/develop' into feature/newcore

parents fbafb305 a9199f2c
No related branches found
No related tags found
No related merge requests found
...@@ -252,13 +252,14 @@ public class NewBMotionProjectWizardPage extends WizardPage { ...@@ -252,13 +252,14 @@ public class NewBMotionProjectWizardPage extends WizardPage {
gd.grabExcessHorizontalSpace = true; gd.grabExcessHorizontalSpace = true;
Label label = new Label(container, SWT.NULL); Label label = new Label(container, SWT.NULL);
label.setText("&Project name:"); label.setText("&Project folder:");
projectRootText = new Text(container, SWT.BORDER | SWT.SINGLE); projectRootText = new Text(container, SWT.BORDER | SWT.SINGLE);
projectRootText.setLayoutData(gd); projectRootText.setLayoutData(gd);
if (selectedProject != null) { if (selectedProject != null) {
projectRootText.setText(selectedProject.getFullPath().toOSString()); projectRootText.setText(selectedProject.getFullPath().toOSString());
} }
projectRootText.setEditable(false);
projectRootText.addModifyListener(listener); projectRootText.addModifyListener(listener);
final Button button = new Button(container, SWT.NULL); final Button button = new Button(container, SWT.NULL);
...@@ -285,7 +286,7 @@ public class NewBMotionProjectWizardPage extends WizardPage { ...@@ -285,7 +286,7 @@ public class NewBMotionProjectWizardPage extends WizardPage {
}); });
label = new Label(container, SWT.NULL); label = new Label(container, SWT.NULL);
label.setText("&BMotion Studio Visualization filename:"); label.setText("&Project name:");
projectText = new Text(container, SWT.BORDER | SWT.SINGLE); projectText = new Text(container, SWT.BORDER | SWT.SINGLE);
projectText.setText(DEFAULT_PROJECT_NAME); projectText.setText(DEFAULT_PROJECT_NAME);
...@@ -297,7 +298,7 @@ public class NewBMotionProjectWizardPage extends WizardPage { ...@@ -297,7 +298,7 @@ public class NewBMotionProjectWizardPage extends WizardPage {
gd.horizontalSpan = 3; gd.horizontalSpan = 3;
label = new Label(container, SWT.NULL); label = new Label(container, SWT.NULL);
label.setText("&B-Machine:"); label.setText("&Formal model:");
label.setLayoutData(gd); label.setLayoutData(gd);
gd = new GridData(GridData.FILL_VERTICAL); gd = new GridData(GridData.FILL_VERTICAL);
...@@ -312,7 +313,7 @@ public class NewBMotionProjectWizardPage extends WizardPage { ...@@ -312,7 +313,7 @@ public class NewBMotionProjectWizardPage extends WizardPage {
table.setLinesVisible(true); table.setLinesVisible(true);
table.setLayoutData(gd); table.setLayoutData(gd);
final String[] columnsNames = new String[] { "Machine", "Language" }; final String[] columnsNames = new String[] { "Model", "Language" };
final int[] columnWidths = new int[] { 250, 100 }; final int[] columnWidths = new int[] { 250, 100 };
final int[] columnAlignments = new int[] { SWT.LEFT, SWT.LEFT }; final int[] columnAlignments = new int[] { SWT.LEFT, SWT.LEFT };
......
...@@ -10,8 +10,10 @@ import java.util.List; ...@@ -10,8 +10,10 @@ import java.util.List;
import java.util.Set; import java.util.Set;
import org.apache.commons.lang.ObjectUtils; import org.apache.commons.lang.ObjectUtils;
import org.eventb.core.IContextRoot;
import org.eventb.core.IEventBRoot; import org.eventb.core.IEventBRoot;
import org.eventb.core.IMachineRoot; import org.eventb.core.IMachineRoot;
import org.eventb.core.ISCContextRoot;
import org.eventb.core.ISCEvent; import org.eventb.core.ISCEvent;
import org.eventb.core.ISCIdentifierElement; import org.eventb.core.ISCIdentifierElement;
import org.eventb.core.ISCMachineRoot; import org.eventb.core.ISCMachineRoot;
...@@ -60,8 +62,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -60,8 +62,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
public void parseExpression(final IPrologTermOutput pto, public void parseExpression(final IPrologTermOutput pto,
final String expression1, final boolean wrap) final String expression1, final boolean wrap)
throws ProBParseException { throws ProBParseException {
final String expression = FormulaTranslator.translate( final String expression = FormulaTranslator.translate(expression1);
expression1);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parseExpression(expression, final IParseResult parseResult = ff.parseExpression(expression,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
...@@ -77,8 +78,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -77,8 +78,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
public void parsePredicate(final IPrologTermOutput pto, public void parsePredicate(final IPrologTermOutput pto,
final String predicate1, final boolean wrap) final String predicate1, final boolean wrap)
throws ProBParseException { throws ProBParseException {
final String predicate = FormulaTranslator.translate( final String predicate = FormulaTranslator.translate(predicate1);
predicate1);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parsePredicate(predicate, final IParseResult parseResult = ff.parsePredicate(predicate,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
...@@ -127,9 +127,18 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -127,9 +127,18 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
private ITypeEnvironment getTypeEnvironment(final FormulaFactory ff) private ITypeEnvironment getTypeEnvironment(final FormulaFactory ff)
throws ProBParseException { throws ProBParseException {
final ITypeEnvironment typeEnv; ITypeEnvironment typeEnv = null;
try { try {
if (root instanceof IMachineRoot)
typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff);
if (root instanceof ISCMachineRoot)
typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff); typeEnv = root.getSCMachineRoot().getTypeEnvironment(ff);
if (root instanceof IContextRoot)
typeEnv = root.getSCContextRoot().getTypeEnvironment(ff);
if (root instanceof ISCContextRoot)
typeEnv = root.getSCContextRoot().getTypeEnvironment(ff);
} catch (RodinDBException e) { } catch (RodinDBException e) {
throw rodin2parseException(e); throw rodin2parseException(e);
} }
...@@ -190,8 +199,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart { ...@@ -190,8 +199,7 @@ public class EventBAnimatorPart implements LanguageDependendAnimationPart {
private Predicate parseTransPredicate(final String predicateString, private Predicate parseTransPredicate(final String predicateString,
final ISCEvent event) throws ProBParseException { final ISCEvent event) throws ProBParseException {
final String utf8String = FormulaTranslator.translate( final String utf8String = FormulaTranslator.translate(predicateString);
predicateString);
final FormulaFactory ff = FormulaFactory.getDefault(); final FormulaFactory ff = FormulaFactory.getDefault();
final IParseResult parseResult = ff.parsePredicate(utf8String, final IParseResult parseResult = ff.parsePredicate(utf8String,
LanguageVersion.LATEST, null); LanguageVersion.LATEST, null);
......
...@@ -128,8 +128,36 @@ def groupId(){ ...@@ -128,8 +128,36 @@ def groupId(){
* This Group ID will be used in every sub project * This Group ID will be used in every sub project
*/ */
def addLibToCP(def project, File filePar, def libPar){
boolean notYetAdded = true
filePar.eachLine{ line ->
def pattern = ".*${dependencyFolder}${libPar}.*"
if(line ==~ /${pattern}/){
notYetAdded = false
}
}
if(notYetAdded){
File newCP = new File(project+'/.cp')
filePar.eachLine{ line ->
if(line ==~ /.*<\/classpath>.*/){
String entry = '<classpathentry exported="true" kind="lib" path="lib/dependencies/'+libPar+'"/>'+'\n</classpath>\n'
line = line.replaceAll(/<\/classpath>/, entry)
println line
newCP << line+"\n"
}else{
newCP << line+"\n"
}
}
filePar.delete()
newCP.renameTo(project+'/.classpath')
}else{
println project + " : "+ libPar +" classpath entry already present"
}
}
///////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////
// -- !!! DEFINING SUB PROJECTS !!! -- // // -- !!! DEFINING SUB PROJECTS !!! -- //
...@@ -155,17 +183,37 @@ subprojects { ...@@ -155,17 +183,37 @@ subprojects {
} }
eclipse { task setClassPath(dependsOn: 'collectDependencies'){
classpath { def dependencyList = []
//adding extra configurations: try{
plusConfigurations += configurations.compile def dir = new File(project.name+"/"+dependencyFolder).eachFile() { file->
dependencyList << file.getName()
}
if(features.every{ it != project.name }){
def cpFile = new File(project.name+"/.classpath")
for(int icp = 0; icp < dependencyList.size; icp++){
addLibToCP(project.name, cpFile, dependencyList[icp])
}
/*dependencyList.each{ dep->
println project.name+": "+ dep
}*/
//default settings for dependencies sources/javadoc download:
downloadSources = true
downloadJavadoc = false
} }
}catch(Exception e){
println project.name+" has no dependencies in '${dependencyFolder}' defined: Classpath will not be changed"
} }
}// setClassPath
eclipse.classpath.file {
whenMerged { classpath ->
classpath.entries.findAll { entry -> entry.kind == 'lib' }*.exported = true
}
}
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
task deploy() <<{ task deploy() <<{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment