]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Merge "Removed print"
authorTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Fri, 2 Jun 2017 09:29:50 +0000 (12:29 +0300)
committerGerrit Code Review <gerrit2@www.simantics.org>
Fri, 2 Jun 2017 09:29:50 +0000 (12:29 +0300)
14 files changed:
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/CodeGeneration.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/compilation/Elaboration.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java [new file with mode: 0644]
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/MethodImplementation.java
bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/parsing/translation/ValueRepository.java
bundles/org.simantics.scl.runtime/scl/Iterator.scl
bundles/org.simantics.scl.runtime/scl/MSet.scl
features/org.simantics.sdk.feature/feature.xml
releng/doc/release.html
releng/doc/release.md
releng/org.simantics.sdk.build.targetdefinition/simantics.target
releng/org.simantics.sdk.repository/pom.xml
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/ModuleRegressionTests.java
tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/UnimplementedTests.java

index 9c7c77470c55b57a91c7dc768d49ff3408e2c9ff..cc883c0eafc9ceefd03212975777a54377419beb 100644 (file)
@@ -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
index 1cba44207ee7c124de787ceff3b7631421084c1b..7887ed717f032b7d29aed50782a69e0f6b42c916 100644 (file)
@@ -39,6 +39,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;
@@ -587,6 +588,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.<Expression>emptyList()));*/
                     TypeClassMethod method = typeClass.methods.get(valueName);
@@ -1144,6 +1146,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/modules/DerivedProperty.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/modules/DerivedProperty.java
new file mode 100644 (file)
index 0000000..b487290
--- /dev/null
@@ -0,0 +1,5 @@
+package org.simantics.scl.compiler.elaboration.modules;
+
+public enum DerivedProperty implements SCLValueProperty {
+    INSTANCE;
+}
index a381915014364e6ea63ec62f04790cfc819146ca..b9b0269e967b9daa9bb52f027568b07c9bb13366 100644 (file)
@@ -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;
-    }
-    
 }
index d0e81402d17fa6e07636f0bd685fef830ba64017..a0d5702222c5a157eb10a49169872f8f18ff7b08 100644 (file)
@@ -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<String, ArrayList<DValueAst>> values = 
             new THashMap<String, ArrayList<DValueAst>>();
     THashMap<String, ArrayList<DAnnotationAst>> annotations = 
             new THashMap<String, ArrayList<DAnnotationAst>>();
+    THashSet<String> derived = new THashSet<String>(); 
     TObjectLongHashMap<String> locations = new TObjectLongHashMap<String>(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);
+    }
 }
index be7fb90e06e7f7517486275bdfc7614b79a3551c..19e51a0d5836d23cb2447daabdb1d2093e6d093a 100644 (file)
@@ -27,6 +27,19 @@ iterB f it = loop ()
              else False
         else True
 
+@inline
+filter :: (a -> <e> Boolean) -> T a -> <Proc,e> ()
+filter f it = loop ()
+  where
+    loop _ = 
+        if hasNext it
+        then do
+            if f (next it)
+            then ()
+            else remove it
+            loop ()
+        else ()
+
 @inline
 mapFirst :: (a -> <e> Maybe b) -> T a -> <Proc,e> Maybe b
 mapFirst f it = loop ()
index 9f543101fd50ca8d9555f15118327bf51c72e36d..3e280d6b5ca4758d8a99f864419ec60d731a793e 100644 (file)
@@ -80,3 +80,6 @@ concatMap f s = result
 
 all :: (a -> <e> Boolean) -> T a -> <e,Proc> Boolean
 all f s = Iterator.iterB f (iterator s) 
+
+filterInPlace :: (a -> <e> Boolean) -> T a -> <e,Proc> ()
+filterInPlace p s = Iterator.filter p (iterator s) 
index 603c6834cbb4d9e01054673d328e3550899fe60e..c5bc965b573d312b50c1779bdc05ebdb63b0e7dc 100644 (file)
@@ -13,7 +13,7 @@
 <feature
       id="org.simantics.sdk"
       label="Simantics SDK"
-      version="1.29.0"
+      version="1.30.0"
       provider-name="VTT Technical Research Centre of Finland">
 
    <description url="http://www.example.com/description">
index 6f0fd975306c2bdf486efac5ef01c1ca685c0247..df0f9d70f5cc3da78118f903ebd3e552e905e192 100644 (file)
@@ -396,15 +396,39 @@ the version numbers in target name and <code>org.simantics.sdk.feature.group</co
 </code></pre>
 </li>
 <li>
-<p>Edit version number of `org.simantics.sdk` feature in `features/org.simantics.sdk.feature/feature.xml` to `x.y.z[.w]`.</p>
-<pre><code>
-&lt;feature
+<p>Edit version number of <code>org.simantics.sdk</code> feature in <code>features/org.simantics.sdk.feature/feature.xml</code> to <code>x.y.z[.w]</code>.</p>
+<pre><code>&lt;feature
       id=&quot;org.simantics.sdk&quot;
       label=&quot;Simantics SDK&quot;
       version=&quot;x.y.z&quot;
       provider-name=&quot;VTT Technical Research Centre of Finland&quot;&gt;
 </code></pre>
-<p>Now commit and push the changes to the release branch.</p>
+<p>An example of these changes can be seen in <a href="https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commit;h=bab5c9bd68277c76dc5c20bc7a60a9896cbd1540">gitweb</a>.</p>
+</li>
+<li>
+<p>Ensure that Redmine has a release engineering issue for the branched release, such as <a href="https://www.simantics.org/redmine/issues/7263">Simantics 1.30.0 release engineering</a>. Make a copy of the previous release issue to create the new one. Include link to original issue while copying.</p>
+</li>
+<li>
+<p>Commit the changes made</p>
+<pre><code> git commit -a
+</code></pre>
+<p>with the commit message</p>
+<pre><code> Configured release/x.y.z[.w] branch for SDK builds.
+
+ refs #xxxx
+</code></pre>
+<p>where <code>#xxxx</code> is the number of the x.y.z[.w] release engineering issue and push them to remote</p>
+<pre><code> git push origin release/x.y.z[.w]
+</code></pre>
+</li>
+<li>
+<p>If you are branching from <code>master</code>, bump the revision of master right now to start the next release cycle in master.
+An example of these changes can be seen in <a href="https://www.simantics.org:8088/r/gitweb?p=simantics/platform.git;a=commitdiff;h=ae93c9930c6345c32219e6845b9e72e9d9d2d28c">gitweb</a>.</p>
+<p>Commit the changes with the following commit message</p>
+<pre><code>Bumped master target and org.simantics.sdk feature versions to x.y.z[.w].
+refs #yyyy
+</code></pre>
+<p>where <code>#yyyy</code> is the number of the next release's release engineering issue.</p>
 </li>
 </ol>
 <h3>Initialize release branch distribution web site</h3>
@@ -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.</p>
 <ol>
-<li>Dump documentation wiki databases using [dump-wikis.sh](./dump-wikis.sh) script.</li>
+<li>Dump documentation wiki databases using <a href="./dump-wikis.sh">dump-wikis.sh</a> script.</li>
 <li>Put the generated backup x.y.z.tar.gz at /var/backup/simantics-releases/x.y.z/wiki/</li>
 </ol>
 <h2>Compile change log entry</h2>
index 6d55c144db228408b2b2daf2aa1bf96a6b41ade9..b16736e80aeed1e5cef81c33852eed98d0a115ac 100644 (file)
@@ -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:
index 7b97949a6fc62fe6e831898696b8372e89325533..faad6d455bff2bcc19d522781d45ef6bdb8c053b 100644 (file)
@@ -1,10 +1,10 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <?pde version="3.8"?>
-<target name="Simantics 1.29.0" sequenceNumber="21">
+<target name="Simantics 1.30.0" sequenceNumber="22">
 <locations>
 <location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
-<unit id="org.simantics.sdk.feature.group" version="1.29.0"/>
-<unit id="org.simantics.sdk.source.feature.group" version="1.29.0"/>
+<unit id="org.simantics.sdk.feature.group" version="1.30.0"/>
+<unit id="org.simantics.sdk.source.feature.group" version="1.30.0"/>
 <repository location="http://www.simantics.org/download/master/sdk"/>
 </location>
 <location includeAllPlatforms="true" includeConfigurePhase="false" includeMode="slicer" includeSource="true" type="InstallableUnit">
index b3d1dc628b9bcc7f5dbd38bb934a5b9a34681711..a72cb5e12af374e2baae37acce5d31dbca24d048 100644 (file)
@@ -2,7 +2,7 @@
        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>
        <artifactId>org.simantics.sdk.repository</artifactId>
-       <version>1.29.0-SNAPSHOT</version>
+       <version>1.30.0-SNAPSHOT</version>
        <packaging>eclipse-repository</packaging>
 
        <parent>
index f50056e8d230e37a8b309b908736607ae13667ee..5bd0c85d7b48c9ad8f03f925f9e401d0713c68d8 100644 (file)
@@ -138,6 +138,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(); }
@@ -221,6 +222,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(); }
index 612a3ab1e82da58ef28b4294e333e434b75d76bc..ede9d008b9d8866a84e54163bfd5b97377537fa1 100644 (file)
@@ -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(); }
     
 }