From 99c4e4b0a90d06b4f2228b59b8b0116d4ee64b28 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 15:54:06 +0200 Subject: [PATCH 1/3] Fix genDocs following the full bootstrap --- doc-tool/src/dotty/tools/dottydoc/model/factories.scala | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala b/doc-tool/src/dotty/tools/dottydoc/model/factories.scala index db1cabf99d90..c74fb3f1212b 100644 --- a/doc-tool/src/dotty/tools/dottydoc/model/factories.scala +++ b/doc-tool/src/dotty/tools/dottydoc/model/factories.scala @@ -126,6 +126,10 @@ object factories { case tp: LazyRef => expandTpe(tp.ref) + + case MatchType(bound, scrutinee, cases) => + // See #6295 + ConstantReference("FIXME: MatchType support") } expandTpe(t) From 6a42c8d8ee1e5908cc361b4fd49f8d390ce2c763 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 16:03:58 +0200 Subject: [PATCH 2/3] Rewrite dotty.tools.dottydoc.staticsite.Yaml in Java To work properly, `TypeReference` relies on using runtime reflection to get the generic arguments it was instantiated with, this does not work currently with Dotty, because we're not emitting a generic signature for the parent, see #6349. --- .../dotty/tools/dottydoc/staticsite/Yaml.java | 22 ++++++++++++++++++ .../tools/dottydoc/staticsite/Yaml.scala | 23 ------------------- 2 files changed, 22 insertions(+), 23 deletions(-) create mode 100644 doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java delete mode 100644 doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.scala diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java b/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java new file mode 100644 index 000000000000..60201752bef7 --- /dev/null +++ b/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.java @@ -0,0 +1,22 @@ +package dotty.tools.dottydoc.staticsite; + +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.core.type.TypeReference; + +import java.util.HashMap; +import java.io.ByteArrayInputStream; + +public class Yaml { + + public static HashMap apply(String input) + throws java.io.UnsupportedEncodingException, java.io.IOException { + ByteArrayInputStream is = new ByteArrayInputStream(input.getBytes("UTF-8")); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + + TypeReference> typeRef = + new TypeReference>() {}; + + return mapper.readValue(is, typeRef); + } +} diff --git a/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.scala b/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.scala deleted file mode 100644 index 07bc2756200c..000000000000 --- a/doc-tool/src/dotty/tools/dottydoc/staticsite/Yaml.scala +++ /dev/null @@ -1,23 +0,0 @@ -package dotty.tools -package dottydoc -package staticsite - -import com.fasterxml.jackson.dataformat.yaml.YAMLFactory -import com.fasterxml.jackson.databind.ObjectMapper -import com.fasterxml.jackson.core.`type`.TypeReference - -object Yaml { - import scala.collection.JavaConverters._ - import java.util.HashMap - import java.io.ByteArrayInputStream - - def apply(input: String): HashMap[String, AnyRef] = { - val is = new ByteArrayInputStream(input.getBytes("UTF-8")) - val mapper = new ObjectMapper(new YAMLFactory()) - - val typeRef: TypeReference[HashMap[String, AnyRef]] = - new TypeReference[HashMap[String, AnyRef]] {} - - mapper.readValue(is, typeRef) - } -} From 32a492ef6b57a29a1fa14b6ed65590d4d60ff011 Mon Sep 17 00:00:00 2001 From: Guillaume Martres Date: Mon, 22 Apr 2019 16:48:08 +0200 Subject: [PATCH 3/3] Update CI cache for the full bootstrap --- .drone.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 1ccdfb4980cd..d9e3771c0731 100644 --- a/.drone.yml +++ b/.drone.yml @@ -20,7 +20,7 @@ pipeline: # We run tests in parallel. Tests run in a copy of the working directory to avoid conflict test: group: test - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - cp -R . /tmp/1/ && cd /tmp/1/ - ./project/scripts/sbt ";compile ;test" @@ -28,7 +28,7 @@ pipeline: test_bootstrapped: group: test - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - cp -R . /tmp/2/ && cd /tmp/2/ - ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test; dotty-semanticdb/compile; dotty-semanticdb/test:compile;sjsSandbox/run" @@ -36,7 +36,7 @@ pipeline: community_build: group: test - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - cp -R . /tmp/3/ && cd /tmp/3/ - git submodule update --init --recursive --jobs 7 @@ -44,7 +44,7 @@ pipeline: test_sbt: group: test - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - cp -R . /tmp/4/ && cd /tmp/4/ - ./project/scripts/sbt sbt-dotty/scripted @@ -54,14 +54,14 @@ pipeline: test_scala212: group: test - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - cp -R . /tmp/5/ && cd /tmp/5/ - ./project/scripts/sbt ";++2.12.8 ;compile ;test" # DOCUMENTATION: documentation: - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 commands: - ./project/scripts/genDocs secrets: [ bot_token ] @@ -73,7 +73,7 @@ pipeline: # PUBLISHING: # Publishing expect NIGHTLYBUILD or RELEASEBUILD to be set. See dottyVersion in Build.scala publish_nightly: - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 environment: - NIGHTLYBUILD=yes commands: @@ -84,7 +84,7 @@ pipeline: environment: nightly publish_release: - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 environment: - RELEASEBUILD=yes commands: @@ -108,7 +108,7 @@ pipeline: event: tag publish_sbt_release: - image: lampepfl/dotty:2019-02-06 + image: lampepfl/dotty:2019-04-22 environment: - RELEASEBUILD=yes commands: