From: Hannu Niemistö Date: Fri, 2 Jun 2017 13:39:28 +0000 (+0300) Subject: (refs #7250) Merging master, minor CHR bugfixes X-Git-Tag: v1.31.0~339^2~3 X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=commitdiff_plain;h=fad36d463b75c3a9944d875fc627c3533f6da74d;hp=78f577368ba4c71ad6fb3d9f16c03c634585cf7b (refs #7250) Merging master, minor CHR bugfixes Change-Id: I11c76beee0e73ff78370f72bbfb88fdbdf6c7616 --- diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceCollectionVariableMap.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceCollectionVariableMap.java new file mode 100644 index 000000000..9f0326831 --- /dev/null +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/ResourceCollectionVariableMap.java @@ -0,0 +1,49 @@ +/******************************************************************************* + * Copyright (c) 2017 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Semantum Oy - initial API and implementation + *******************************************************************************/ +package org.simantics.db.layer0.variable; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.simantics.db.ReadGraph; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; + +/** + * Used for defining custom variable spaces in SCL. + * See SCL module Simantics/Variables function + * createVariableMap :: [Resource] -> VariableMap. + * + * @author Antti Villberg + * @since 1.29.0 + */ +public class ResourceCollectionVariableMap extends VariableMapImpl { + + final private Collection resources; + + public ResourceCollectionVariableMap(Collection resources) { + this.resources = resources; + } + + @Override + public Map getVariables(ReadGraph graph, Variable context, Map map) + throws DatabaseException { + for(Resource resource : resources) { + if(map == null) map = new HashMap<>(); + Variable child = new StandardGraphChildVariable(context, null, resource); + map.put(child.getName(graph), child); + } + return map; + } + +} diff --git a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java index 17fc21ebb..cffd74727 100644 --- a/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java +++ b/bundles/org.simantics.db.layer0/src/org/simantics/db/layer0/variable/StandardGraphChildVariable.java @@ -264,7 +264,9 @@ public class StandardGraphChildVariable extends AbstractChildVariable { protected VariableMap getPossibleChildVariableMap(ReadGraph graph) throws DatabaseException { if(resource == null) return All.standardChildDomainChildren; - return graph.getPossibleRelatedValue2(resource, Layer0.getInstance(graph).domainChildren, this); + Resource domainChildren = Layer0.getInstance(graph).domainChildren; + return graph.getPossibleRelatedValue2(resource, domainChildren, + new StandardGraphPropertyVariable(graph, this, domainChildren)); } @Override diff --git a/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph b/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph index e71c13997..cd3f1f31f 100644 --- a/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph +++ b/bundles/org.simantics.modeling.ontology/graph/ModelingViewpoint.pgraph @@ -365,6 +365,13 @@ IMAGES.ComponentLock : IMAGE.PngImage MBC @VP.dropActionContribution MOD.Subscription MAC.Actions.SubscriptionDropAction 1.0 +MOD.sclChildRule : L0.Template + @template %action %expression + %action : MOD.SCLChildRule + MOD.SCLChildRule.getChildren _ : MOD.SCLValue + L0.SCLValue.expression %expression + L0.HasValueType "Resource -> [Resource]" + MOD.sclAction : L0.Template @template %action %expression %action : MOD.SCLAction diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java index a8dca8c11..5d258dd9e 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java @@ -17,6 +17,7 @@ import org.simantics.scl.compiler.constants.ThisConstant; import org.simantics.scl.compiler.elaboration.contexts.SimplificationContext; import org.simantics.scl.compiler.elaboration.expressions.Expression; import org.simantics.scl.compiler.elaboration.macros.StandardMacroRule; +import org.simantics.scl.compiler.elaboration.modules.DerivedProperty; import org.simantics.scl.compiler.elaboration.modules.InlineProperty; import org.simantics.scl.compiler.elaboration.modules.MethodImplementation; import org.simantics.scl.compiler.elaboration.modules.PrivateProperty; @@ -124,13 +125,18 @@ public class CodeGeneration { decomposed.typeParameters, decomposed.returnType, decomposed.parameterTypes));*/ + boolean isDerived = false; for(SCLValueProperty prop : value.getProperties()) { if(prop instanceof InlineProperty) { InlineProperty inlineProperty = (InlineProperty)prop; constant.setInlineArity(inlineProperty.arity, inlineProperty.phaseMask); } else if(prop == PrivateProperty.INSTANCE) - constant.setPrivate(true); + constant.setPrivate(!isDerived); + else if(prop == DerivedProperty.INSTANCE) { + constant.setPrivate(false); + isDerived = true; + } } } // This is quite hackish optimization that can be possibly removed when diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java index 6499ab4fe..359448e1d 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java @@ -41,6 +41,7 @@ import org.simantics.scl.compiler.elaboration.fundeps.Fundep; import org.simantics.scl.compiler.elaboration.java.JavaMethodDeclaration; import org.simantics.scl.compiler.elaboration.macros.StandardMacroRule; import org.simantics.scl.compiler.elaboration.modules.DeprecatedProperty; +import org.simantics.scl.compiler.elaboration.modules.DerivedProperty; import org.simantics.scl.compiler.elaboration.modules.InlineProperty; import org.simantics.scl.compiler.elaboration.modules.MethodImplementation; import org.simantics.scl.compiler.elaboration.modules.PrivateProperty; @@ -602,6 +603,7 @@ public class Elaboration { String fullName = instancePrefix + valueName; long loc = valueDefs.getDefinition(valueName).get(0).location; valueDefinitionsAst.addFrom(valueDefs, valueName, fullName); + valueDefinitionsAst.setDerived(fullName); /*valueDefinitionsAst.addAnnotation(fullName, new DAnnotationAst(new EVar("@private"), Collections.emptyList()));*/ TypeClassMethod method = typeClass.methods.get(valueName); @@ -1171,6 +1173,8 @@ public class Elaboration { value.definitionLocation = location; if(module.addValue(value)) errorLog.log(location, "Value " + name + " is already defined."); + if(valueDefinitionsAst.isDerived(name)) + value.addProperty(DerivedProperty.INSTANCE); } for(DValueTypeAst valueTypeAst : typeAnnotationsAst) for(EVar name : valueTypeAst.names) { diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java index d5f619654..bb00f0885 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/chr/CHRRuleset.java @@ -215,6 +215,7 @@ public class CHRRuleset extends Symbol { int max = 1 << constraint.parameterTypes.length; for(int i=0;i 0) diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java new file mode 100644 index 000000000..b4872904d --- /dev/null +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java @@ -0,0 +1,5 @@ +package org.simantics.scl.compiler.elaboration.modules; + +public enum DerivedProperty implements SCLValueProperty { + INSTANCE; +} diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java index a38191501..b9b0269e9 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java @@ -6,19 +6,9 @@ public class MethodImplementation { public final Name name; public final boolean isDefault; - private SCLValue value; public MethodImplementation(Name name, boolean isDefault) { this.name = name; this.isDefault = isDefault; } - - public SCLValue getValue() { - return value; - } - - public void setValue(SCLValue value) { - this.value = value; - } - } diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java index ab643f9a1..b9e8bfbb3 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/SSAFunction.java @@ -359,6 +359,8 @@ public final class SSAFunction extends SSAClosure { } public void mergeBlocks(SSAFunction function) { + if(this == function) + throw new InternalCompilerError(); SSABlock block = function.firstBlock; while(block != null) { SSABlock next = block.next; diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java index 6d139a4d6..400cb6e4e 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/codegen/ssa/statements/LetApply.java @@ -399,7 +399,7 @@ public class LetApply extends LetStatement implements ValRefBinder { tailBlock.setExit(headBlock.getExit()); // Merge blocks - thisFunction.mergeBlocks(function); + thisFunction.mergeBlocks(function); headBlock.setExit(new Jump(function.getFirstBlock().createOccurrence(), parameters)); diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java index d0e81402d..a0d570222 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java @@ -12,12 +12,14 @@ import org.simantics.scl.compiler.internal.parsing.declarations.DValueAst; import gnu.trove.impl.Constants; import gnu.trove.map.hash.THashMap; import gnu.trove.map.hash.TObjectLongHashMap; +import gnu.trove.set.hash.THashSet; public class ValueRepository { THashMap> values = new THashMap>(); THashMap> annotations = new THashMap>(); + THashSet derived = new THashSet(); TObjectLongHashMap locations = new TObjectLongHashMap(Constants.DEFAULT_CAPACITY, Constants.DEFAULT_LOAD_FACTOR, Locations.NO_LOCATION); @@ -85,4 +87,12 @@ public class ValueRepository { public long getLocation(String name) { return locations.get(name); } + + public boolean isDerived(String name) { + return derived.contains(name); + } + + public void setDerived(String name) { + derived.add(name); + } } diff --git a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl index 54696a83d..b725d6c74 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/DB.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/DB.scl @@ -43,6 +43,8 @@ importJava "org.simantics.db.Statement" where @JavaName getObject objectOf :: Statement -> Resource + isAsserted :: Statement -> Resource -> Boolean + importJava "org.simantics.db.ReadGraph" where "Converts an absolute URI to a resource or returns `Nothing` if there is no such resource." @JavaName getPossibleResource @@ -85,6 +87,9 @@ importJava "org.simantics.db.ReadGraph" where @JavaName getSingleStatement singleStatement :: Resource -> Resource -> Statement + @JavaName getPossibleStatement + possibleStatement :: Resource -> Resource -> Maybe Statement + @JavaName getRelatedVariantValue relatedVariantValue :: Resource -> Resource -> Variant diff --git a/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl b/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl index 1def7102c..a8ffd13db 100644 --- a/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl +++ b/bundles/org.simantics.scl.db/scl/Simantics/Variables.scl @@ -90,6 +90,10 @@ importJava "org.simantics.db.layer0.function.All" where importJava "org.simantics.db.layer0.variable.VariableMap" where data VariableMap +importJava "org.simantics.db.layer0.variable.ResourceCollectionVariableMap" where + @JavaName "" + createVariableMap :: [Resource] -> VariableMap + importJava "org.simantics.db.layer0.variable.ValueAccessor" where data ValueAccessor diff --git a/bundles/org.simantics.scl.runtime/scl/Iterator.scl b/bundles/org.simantics.scl.runtime/scl/Iterator.scl index be7fb90e0..19e51a0d5 100644 --- a/bundles/org.simantics.scl.runtime/scl/Iterator.scl +++ b/bundles/org.simantics.scl.runtime/scl/Iterator.scl @@ -27,6 +27,19 @@ iterB f it = loop () else False else True +@inline +filter :: (a -> Boolean) -> T a -> () +filter f it = loop () + where + loop _ = + if hasNext it + then do + if f (next it) + then () + else remove it + loop () + else () + @inline mapFirst :: (a -> Maybe b) -> T a -> Maybe b mapFirst f it = loop () diff --git a/bundles/org.simantics.scl.runtime/scl/MSet.scl b/bundles/org.simantics.scl.runtime/scl/MSet.scl index 9f543101f..3e280d6b5 100644 --- a/bundles/org.simantics.scl.runtime/scl/MSet.scl +++ b/bundles/org.simantics.scl.runtime/scl/MSet.scl @@ -80,3 +80,6 @@ concatMap f s = result all :: (a -> Boolean) -> T a -> Boolean all f s = Iterator.iterB f (iterator s) + +filterInPlace :: (a -> Boolean) -> T a -> () +filterInPlace p s = Iterator.filter p (iterator s) diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java index 33b5fc7e9..c37a9421f 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/info/SCLInfo.java @@ -36,6 +36,7 @@ public class SCLInfo { "forall", "rule", "ruleset", + "constraint", "extends", "by", "select", diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/ModuleNameTreeEntry.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/ModuleNameTreeEntry.java index 6f657b351..4c3bf1a2c 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/ModuleNameTreeEntry.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/ModuleNameTreeEntry.java @@ -1,8 +1,8 @@ package org.simantics.scl.ui.modulebrowser; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; +import java.util.Arrays; +import java.util.Iterator; +import java.util.Map.Entry; import gnu.trove.map.hash.THashMap; @@ -44,10 +44,16 @@ public class ModuleNameTreeEntry implements Comparable { return entry; } - public Collection children() { - ArrayList children = new ArrayList(childMap.values()); - Collections.sort(children); - return children; + public Object[] children() { + Object[] result = childMap.values().toArray(); + Arrays.sort(result); + return result; + } + + public void clearModuleFlags() { + isModule = false; + for(ModuleNameTreeEntry child : childMap.values()) + child.clearModuleFlags(); } @Override @@ -55,8 +61,13 @@ public class ModuleNameTreeEntry implements Comparable { return name.compareTo(o.name); } - @Override - public String toString() { - return name; + public boolean prune() { + Iterator it = childMap.values().iterator(); + while(it.hasNext()) { + ModuleNameTreeEntry entry = it.next(); + if(!entry.prune()) + it.remove(); + } + return isModule || !childMap.isEmpty(); } } diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java index acaffd0f5..8355c6dd3 100644 --- a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTree.java @@ -1,75 +1,28 @@ package org.simantics.scl.ui.modulebrowser; -import java.util.Collection; - -import org.eclipse.jface.viewers.ITreeContentProvider; import org.eclipse.jface.viewers.LabelProvider; import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.widgets.Composite; import org.simantics.scl.compiler.module.repository.ModuleRepository; public class SCLModuleTree extends TreeViewer { - - private final ModuleRepository repository; - - private ITreeContentProvider contentProvider = new ITreeContentProvider() { - ModuleNameTreeEntry rootEntry; - - @Override - public void dispose() { - } - - @Override - public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { - if(newInput != null) - this.rootEntry = createModuleTreeEntry((Collection)newInput); - } - - @Override - public Object[] getElements(Object inputElement) { - if(rootEntry == null) - return new Object[0]; - return rootEntry.children().toArray(); - } - - @Override - public Object[] getChildren(Object parentElement) { - return ((ModuleNameTreeEntry)parentElement).children().toArray(); - } - - @Override - public Object getParent(Object element) { - return ((ModuleNameTreeEntry)element).parent; - } - - @Override - public boolean hasChildren(Object element) { - return !((ModuleNameTreeEntry)element).childMap.isEmpty(); - } - }; - - private LabelProvider labelProvider = new LabelProvider(); + private LabelProvider labelProvider = new SCLModuleTreeLabelProvider(); + private SCLModuleTreeContentProvider contentProvider; public SCLModuleTree(Composite parent, int style, ModuleRepository repository) { super(parent, style); - this.repository = repository; + this.contentProvider = new SCLModuleTreeContentProvider(); + setUseHashlookup(true); setLabelProvider(labelProvider); setContentProvider(contentProvider); setAutoExpandLevel(1); - recalculateInput(); - } - - private static ModuleNameTreeEntry createModuleTreeEntry(Collection names) { - ModuleNameTreeEntry root = new ModuleNameTreeEntry(null, "", ""); - for(String name : names) - root.addModule(name); - return root; + setInput(repository); } public void recalculateInput() { - setInput(repository.getSourceRepository().getModuleNames()); + contentProvider.update(); + refresh(); } } diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeContentProvider.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeContentProvider.java new file mode 100644 index 000000000..d73639c70 --- /dev/null +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeContentProvider.java @@ -0,0 +1,54 @@ +package org.simantics.scl.ui.modulebrowser; + +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.Viewer; +import org.simantics.scl.compiler.module.repository.ModuleRepository; + +public class SCLModuleTreeContentProvider implements ITreeContentProvider { + private ModuleRepository repository; + private final ModuleNameTreeEntry rootEntry = new ModuleNameTreeEntry(null, "", ""); + + public void update() { + rootEntry.clearModuleFlags(); + if(repository != null) { + for(String moduleName : repository.getSourceRepository().getModuleNames()) { + rootEntry.addModule(moduleName); + } + } + rootEntry.prune(); + } + + @Override + public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { + this.repository = (ModuleRepository)newInput; + update(); + } + + @Override + public Object[] getElements(Object inputElement) { + return rootEntry.children(); + } + + @Override + public Object[] getChildren(Object parentElement) { + ModuleNameTreeEntry entry = (ModuleNameTreeEntry)parentElement; + return entry.children(); + } + + @Override + public Object getParent(Object element) { + ModuleNameTreeEntry entry = (ModuleNameTreeEntry)element; + return entry.parent; + } + + @Override + public boolean hasChildren(Object element) { + ModuleNameTreeEntry entry = (ModuleNameTreeEntry)element; + return !entry.childMap.isEmpty(); + } + + @Override + public void dispose() { + } + +} diff --git a/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeLabelProvider.java b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeLabelProvider.java new file mode 100644 index 000000000..057cd68f1 --- /dev/null +++ b/bundles/org.simantics.scl.ui/src/org/simantics/scl/ui/modulebrowser/SCLModuleTreeLabelProvider.java @@ -0,0 +1,11 @@ +package org.simantics.scl.ui.modulebrowser; + +import org.eclipse.jface.viewers.LabelProvider; + +public class SCLModuleTreeLabelProvider extends LabelProvider { + @Override + public String getText(Object element) { + ModuleNameTreeEntry entry = (ModuleNameTreeEntry)element; + return entry.name; + } +} diff --git a/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/TreeTableCell.java b/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/TreeTableCell.java index fb80d0760..baf3b83de 100644 --- a/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/TreeTableCell.java +++ b/bundles/org.simantics.spreadsheet.common/src/org/simantics/spreadsheet/common/TreeTableCell.java @@ -47,7 +47,6 @@ public class TreeTableCell extends TableCell implements ITreeTableCell { String style = ""; int size = 12; for(FontData d : descriptor.getFontData()) { - System.err.println("data: " + d); family = d.getName(); if((d.getStyle() & SWT.ITALIC) != 0) style += "Italic"; if((d.getStyle() & SWT.BOLD) != 0) style += "Bold"; diff --git a/features/org.simantics.sdk.feature/feature.xml b/features/org.simantics.sdk.feature/feature.xml index 603c6834c..c5bc965b5 100644 --- a/features/org.simantics.sdk.feature/feature.xml +++ b/features/org.simantics.sdk.feature/feature.xml @@ -13,7 +13,7 @@ diff --git a/releng/doc/release.html b/releng/doc/release.html index 6f0fd9753..df0f9d70f 100644 --- a/releng/doc/release.html +++ b/releng/doc/release.html @@ -396,15 +396,39 @@ the version numbers in target name and org.simantics.sdk.feature.group
  • -

    Edit version number of `org.simantics.sdk` feature in `features/org.simantics.sdk.feature/feature.xml` to `x.y.z[.w]`.

    -
    
    -<feature
    +

    Edit version number of org.simantics.sdk feature in features/org.simantics.sdk.feature/feature.xml to x.y.z[.w].

    +
    <feature
           id="org.simantics.sdk"
           label="Simantics SDK"
           version="x.y.z"
           provider-name="VTT Technical Research Centre of Finland">
     
    -

    Now commit and push the changes to the release branch.

    +

    An example of these changes can be seen in gitweb.

    +
  • +
  • +

    Ensure that Redmine has a release engineering issue for the branched release, such as Simantics 1.30.0 release engineering. Make a copy of the previous release issue to create the new one. Include link to original issue while copying.

    +
  • +
  • +

    Commit the changes made

    +
     git commit -a
    +
    +

    with the commit message

    +
     Configured release/x.y.z[.w] branch for SDK builds.
    +
    + refs #xxxx
    +
    +

    where #xxxx is the number of the x.y.z[.w] release engineering issue and push them to remote

    +
     git push origin release/x.y.z[.w]
    +
    +
  • +
  • +

    If you are branching from master, bump the revision of master right now to start the next release cycle in master. +An example of these changes can be seen in gitweb.

    +

    Commit the changes with the following commit message

    +
    Bumped master target and org.simantics.sdk feature versions to x.y.z[.w].
    +refs #yyyy
    +
    +

    where #yyyy is the number of the next release's release engineering issue.

  • Initialize release branch distribution web site

    @@ -481,7 +505,7 @@ is to back up the mysql database backing the wiki. Should the wiki be required at a later time for some reason, we'll put the documentation up then in a separate Mediawiki installation.

      -
    1. Dump documentation wiki databases using [dump-wikis.sh](./dump-wikis.sh) script.
    2. +
    3. Dump documentation wiki databases using dump-wikis.sh script.
    4. Put the generated backup x.y.z.tar.gz at /var/backup/simantics-releases/x.y.z/wiki/

    Compile change log entry

    diff --git a/releng/doc/release.md b/releng/doc/release.md index 6d55c144d..b16736e80 100644 --- a/releng/doc/release.md +++ b/releng/doc/release.md @@ -120,6 +120,34 @@ With service releases, branch from an existing `release/*` branch instead. provider-name="VTT Technical Research Centre of Finland"> ~~~ + An example of these changes can be seen in [gitweb](https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commit;h=bab5c9bd68277c76dc5c20bc7a60a9896cbd1540). + +4. Ensure that Redmine has a release engineering issue for the branched release, such as [Simantics 1.30.0 release engineering](https://www.simantics.org/redmine/issues/7263). Make a copy of the previous release issue to create the new one. Include link to original issue while copying. + +5. Commit the changes made + + git commit -a + + with the commit message + + Configured release/x.y.z[.w] branch for SDK builds. + + refs #xxxx + + where `#xxxx` is the number of the x.y.z[.w] release engineering issue and push them to remote + + git push origin release/x.y.z[.w] + +6. If you are branching from `master`, bump the revision of master right now to start the next release cycle in master. + An example of these changes can be seen in [gitweb](https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commitdiff;h=ae93c9930c6345c32219e6845b9e72e9d9d2d28c). + + Commit the changes with the following commit message + + Bumped master target and org.simantics.sdk feature versions to x.y.z[.w]. + refs #yyyy + + where `#yyyy` is the number of the next release's release engineering issue. + ### Initialize release branch distribution web site * Run [SDK/Deploy External Components to Web](https://www.simantics.org/jenkins/job/SDK/job/Deploy%20External%20Components%20to%20Web/) build with parameters: diff --git a/releng/org.simantics.sdk.build.targetdefinition/simantics.target b/releng/org.simantics.sdk.build.targetdefinition/simantics.target index 7b97949a6..faad6d455 100644 --- a/releng/org.simantics.sdk.build.targetdefinition/simantics.target +++ b/releng/org.simantics.sdk.build.targetdefinition/simantics.target @@ -1,10 +1,10 @@ - + - - + + diff --git a/releng/org.simantics.sdk.repository/pom.xml b/releng/org.simantics.sdk.repository/pom.xml index b3d1dc628..a72cb5e12 100644 --- a/releng/org.simantics.sdk.repository/pom.xml +++ b/releng/org.simantics.sdk.repository/pom.xml @@ -2,7 +2,7 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 org.simantics.sdk.repository - 1.29.0-SNAPSHOT + 1.30.0-SNAPSHOT eclipse-repository diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java index 1c0100425..769a1bde9 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java @@ -140,6 +140,7 @@ public class ModuleRegressionTests extends TestBase { @Test public void LocalDefinitions4() { test(); } @Test public void LocalDefinitions5() { test(); } @Test public void Logger() { test(); } + @Test public void LP() { test(); } @Test public void Macros1() { test(); } @Test public void Macros2() { test(); } @Test public void Macros4() { test(); } @@ -223,6 +224,7 @@ public class ModuleRegressionTests extends TestBase { @Test public void SinConst1() { test(); } @Test public void Sort() { test(); } @Test public void Sort2() { test(); } + @Test public void SpecConstr1() { test(); } @Test public void SSATypingBug() { test(); } @Test public void StreamFusion() { test(); } @Test public void StringEscape() { test(); } diff --git a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java index 612a3ab1e..ede9d008b 100644 --- a/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java +++ b/tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java @@ -13,16 +13,13 @@ public class UnimplementedTests extends TestBase { @Test public void FunctionalDependencies2() { test(); } @Test public void InlineLoop() { test(); } @Test public void InstanceTypeVariables() { test(); } - @Test public void LP() { test(); } @Test public void Macros3() { test(); } @Test public void MissingTypeParameter() { test(); } @Test(timeout=100L) public void RecursiveValues() { test(); } @Test public void Set1() { test(); } @Test public void Signals() { test(); } - @Test public void SpecConstr1() { test(); } @Test public void StackTrace() { test(); } - @Test public void StringInterpolation2() { test(); } @Test public void Timing() { test(); } }