From fbac655599735e779476a64651c9892c2cb35773 Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Fri, 17 May 2019 15:00:59 +0200 Subject: [PATCH 1/2] Fix genDocs classPath Also removes doc generation for anything but the stdlib. The distinction between bootstrapped and non-bootstrapped is needed to avoid cycles. --- .drone.yml | 8 ++++---- project/Build.scala | 16 +++++++--------- project/scripts/genDocs | 3 ++- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.drone.yml b/.drone.yml index c9f7ea243e2c..8bef991706f0 100644 --- a/.drone.yml +++ b/.drone.yml @@ -77,10 +77,10 @@ pipeline: commands: - ./project/scripts/genDocs secrets: [ bot_token ] - when: - event: push - # We only generate the documentation for the master branch - branch: master + # when: + # event: push + # # We only generate the documentation for the master branch + # branch: master # PUBLISHING: # Publishing expect NIGHTLYBUILD or RELEASEBUILD to be set. See dottyVersion in Build.scala diff --git a/project/Build.scala b/project/Build.scala index 4b6a6623a7f4..3808c6b4ca04 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -302,7 +302,8 @@ object Build { val dottyLib = jars("dotty-library") val dottyInterfaces = jars("dotty-interfaces") val otherDeps = (dependencyClasspath in Compile).value.map(_.data).mkString(File.pathSeparator) - dottyLib + File.pathSeparator + dottyInterfaces + File.pathSeparator + otherDeps + val attList = (dependencyClasspath in Runtime).value + dottyLib + File.pathSeparator + findLib(attList, "scala-library-") } lazy val semanticdbSettings = Seq( @@ -317,8 +318,7 @@ object Build { ) ) - // Settings shared between dotty-doc and dotty-doc-bootstrapped - lazy val dottyDocSettings = Seq( + def dottyDocSettings(implicit mode: Mode) = Seq( baseDirectory in (Compile, run) := baseDirectory.value / "..", baseDirectory in Test := baseDirectory.value / "..", @@ -336,12 +336,10 @@ object Build { val majorVersion = baseVersion.take(baseVersion.lastIndexOf('.')) IO.write(file("./docs/_site/versions/latest-nightly-base"), majorVersion) - val sources = - unmanagedSources.in(Compile, compile).value ++ - unmanagedSources.in(`dotty-compiler`, Compile).value ++ - // TODO use bootstrapped library - // Blocked by #6295, also see https://github.com/lampepfl/dotty/pull/5499 - unmanagedSources.in(`dotty-library`, Compile).value + val sources = unmanagedSources.in(mode match { + case NonBootstrapped => `dotty-library` + case Bootstrapped => `dotty-library-bootstrapped` + }, Compile).value val args = Seq( "-siteroot", "docs", "-project", "Dotty", diff --git a/project/scripts/genDocs b/project/scripts/genDocs index 1fa5bb78f5d4..cb7ad7c59461 100755 --- a/project/scripts/genDocs +++ b/project/scripts/genDocs @@ -11,7 +11,7 @@ shopt -s extglob # make sure that BOT_TOKEN is set if [ -z "$BOT_TOKEN" ]; then echo "Error: BOT_TOKEN env unset, unable to push without password" 1>&2 - exit 1 + # exit 1 fi echo "Working directory: $PWD" @@ -29,6 +29,7 @@ fi # save current head for commit message in gh-pages GIT_HEAD=$(git rev-parse HEAD) +exit 0 # set up remote and github credentials git remote add doc-remote "https://dotty-bot:$BOT_TOKEN@github.com/lampepfl/dotty-website.git" From 56aa9be69d13edb0ea83b813cc2358bfa13667f7 Mon Sep 17 00:00:00 2001 From: Olivier Blanvillain Date: Fri, 17 May 2019 15:01:07 +0200 Subject: [PATCH 2/2] Only generate the docs on master --- .drone.yml | 8 ++++---- project/scripts/genDocs | 3 +-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 8bef991706f0..c9f7ea243e2c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -77,10 +77,10 @@ pipeline: commands: - ./project/scripts/genDocs secrets: [ bot_token ] - # when: - # event: push - # # We only generate the documentation for the master branch - # branch: master + when: + event: push + # We only generate the documentation for the master branch + branch: master # PUBLISHING: # Publishing expect NIGHTLYBUILD or RELEASEBUILD to be set. See dottyVersion in Build.scala diff --git a/project/scripts/genDocs b/project/scripts/genDocs index cb7ad7c59461..1fa5bb78f5d4 100755 --- a/project/scripts/genDocs +++ b/project/scripts/genDocs @@ -11,7 +11,7 @@ shopt -s extglob # make sure that BOT_TOKEN is set if [ -z "$BOT_TOKEN" ]; then echo "Error: BOT_TOKEN env unset, unable to push without password" 1>&2 - # exit 1 + exit 1 fi echo "Working directory: $PWD" @@ -29,7 +29,6 @@ fi # save current head for commit message in gh-pages GIT_HEAD=$(git rev-parse HEAD) -exit 0 # set up remote and github credentials git remote add doc-remote "https://dotty-bot:$BOT_TOKEN@github.com/lampepfl/dotty-website.git"