Skip to content

Sbt 1.1.5 #4570

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 23, 2018
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,29 @@ pipeline:
# We run tests in parallel. Tests run in a copy of the working directory to avoid conflict
test:
group: test
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
commands:
- cp -R . /tmp/1/ && cd /tmp/1/
- ./project/scripts/sbt ";compile ;test"
- ./project/scripts/cmdTests

test_bootstrapped:
group: test
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
commands:
- cp -R . /tmp/2/ && cd /tmp/2/
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test"

test_optimised:
group: test
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
commands:
- cp -R . /tmp/3/ && cd /tmp/3/
- ./project/scripts/sbt dotty-optimised/test

test_sbt:
group: test
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
commands:
- cp -R . /tmp/4/ && cd /tmp/4/
- ./project/scripts/sbt sbt-dotty/scripted
Expand All @@ -55,7 +55,7 @@ pipeline:

# DOCUMENTATION:
documentation:
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
commands:
- ./project/scripts/genDocs
secrets: [ bot_pass ]
Expand All @@ -67,7 +67,7 @@ pipeline:
# PUBLISHING:
# Publishing expect NIGHTLYBUILD or RELEASEBUILD to be set. See dottyVersion in Build.scala
publish_nightly:
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
environment:
- NIGHTLYBUILD=yes
commands:
Expand All @@ -78,7 +78,7 @@ pipeline:
environment: nightly

publish_release:
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
environment:
- RELEASEBUILD=yes
commands:
Expand All @@ -102,7 +102,7 @@ pipeline:
event: tag

publish_sbt_release:
image: lampepfl/dotty:2018-04-10
image: lampepfl/dotty:2018-05-23
environment:
- RELEASEBUILD=yes
commands:
Expand Down
4 changes: 2 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ object ExposedValues extends AutoPlugin {
object Build {

val baseVersion = "0.9.0"
val scalacVersion = "2.12.4"
val scalacVersion = "2.12.6"

val dottyOrganization = "ch.epfl.lamp"
val dottyGithubUrl = "https://github.com/lampepfl/dotty"
Expand Down Expand Up @@ -866,7 +866,7 @@ object Build {
settings(commonSettings).
settings(
version := {
val base = "0.2.2"
val base = "0.2.3"
if (isRelease) base else base + "-SNAPSHOT"
},

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.1.4
sbt.version=1.1.5
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package hello

object Hello {
def main(args: Array[String]): Unit = {
val dotty: Int | String = "dotty"
Expand Down
33 changes: 19 additions & 14 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/build.sbt
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
lazy val dottyVersion = sys.props("plugin.scalaVersion")

lazy val pluginSetting = Seq(
name := "dividezero",
version := "0.0.1",
organization := "ch.epfl.lamp",
scalaVersion := dottyVersion,
lazy val plugin = project
.in(file("plugin"))
.settings(
name := "dividezero",
version := "0.0.1",
organization := "ch.epfl.lamp",
scalaVersion := dottyVersion,

libraryDependencies ++= Seq(
"ch.epfl.lamp" %% "dotty" % scalaVersion.value % "provided"
)
)
scalacOptions ++= Seq(
"-language:implicitConversions"
),

lazy val plugin = (project in file("plugin")).settings(pluginSetting: _*)
libraryDependencies ++= Seq(
"ch.epfl.lamp" %% "dotty-compiler" % scalaVersion.value % "provided"
)
)

lazy val app = (project in file(".")).settings(
scalaVersion := dottyVersion,
libraryDependencies += compilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
)
lazy val app = project
.in(file("app"))
.settings(
scalaVersion := dottyVersion
)
21 changes: 21 additions & 0 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/changes/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
lazy val dottyVersion = sys.props("plugin.scalaVersion")

lazy val plugin = project
.in(file("plugin"))
.settings(
name := "dividezero",
version := "0.0.1",
organization := "ch.epfl.lamp",
scalaVersion := dottyVersion,

libraryDependencies ++= Seq(
"ch.epfl.lamp" %% "dotty" % scalaVersion.value % "provided"
)
)

lazy val app = project
.in(file("app"))
.settings(
scalaVersion := dottyVersion,
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
)
5 changes: 0 additions & 5 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/pending

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import Symbols.Symbol
import Constants.Constant
import transform.{LinkAll, Pickler}

/** Compiler plugin that emits an error when compiling a division by zero */
class DivideZero extends PluginPhase with StandardPlugin {
val name: String = "divideZero"
override val description: String = "divide zero check"

val phaseName = name

override val runsAfter = Set(Pickler.phaseName)
override val runsBefore = Set(LinkAll.phaseName)
override val runsAfter = Set(Pickler.name)
override val runsBefore = Set(LinkAll.name)

override def init(options: List[String]): List[PluginPhase] = this :: Nil

Expand All @@ -32,9 +33,9 @@ class DivideZero extends PluginPhase with StandardPlugin {

override def transformApply(tree: tpd.Apply)(implicit ctx: Context): tpd.Tree = tree match {
case tpd.Apply(fun, tpd.Literal(Constants.Constant(v)) :: Nil) if isNumericDivide(fun.symbol) && v == 0 =>
ctx.warning("divide by zero", tree.pos)
ctx.error("divide by zero", tree.pos)
tpd.Literal(Constant(0))
case _ =>
tree
}
}
}
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pluginClass=dividezero.DivideZero
pluginClass=dividezero.DivideZero

This file was deleted.

13 changes: 13 additions & 0 deletions sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Should compile OK without the plugin
> app/compile

# Publish plugin locally
> plugin/publishLocal

# Enable plugin
$ copy-file changes/build.sbt build.sbt
> reload

# Should NOT compile with the plugin
> clean
-> app/compile
4 changes: 2 additions & 2 deletions sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ object DottyPlugin extends AutoPlugin {
onLoad in Global := onLoad.in(Global).value.andThen { state =>
val sbtV = sbtVersion.value
sbtFullVersion(sbtV) match {
case Some((1, sbtMinor, sbtPatch)) if sbtMinor > 1 || (sbtMinor == 1 && sbtPatch >= 4) =>
case Some((1, sbtMinor, sbtPatch)) if sbtMinor > 1 || (sbtMinor == 1 && sbtPatch >= 5) =>
case _ =>
sys.error(s"The sbt-dotty plugin cannot work with this version of sbt ($sbtV), sbt >= 1.1.4 is required.")
sys.error(s"The sbt-dotty plugin cannot work with this version of sbt ($sbtV), sbt >= 1.1.5 is required.")
}
state
}
Expand Down