Skip to content

Commit 0f69a36

Browse files
authored
Merge pull request #4570 from dotty-staging/sbt-1.1.5
Sbt 1.1.5
2 parents 4258d8e + a94a7ae commit 0f69a36

File tree

14 files changed

+73
-81
lines changed

14 files changed

+73
-81
lines changed

.drone.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,29 +23,29 @@ pipeline:
2323
# We run tests in parallel. Tests run in a copy of the working directory to avoid conflict
2424
test:
2525
group: test
26-
image: lampepfl/dotty:2018-04-10
26+
image: lampepfl/dotty:2018-05-23
2727
commands:
2828
- cp -R . /tmp/1/ && cd /tmp/1/
2929
- ./project/scripts/sbt ";compile ;test"
3030
- ./project/scripts/cmdTests
3131

3232
test_bootstrapped:
3333
group: test
34-
image: lampepfl/dotty:2018-04-10
34+
image: lampepfl/dotty:2018-05-23
3535
commands:
3636
- cp -R . /tmp/2/ && cd /tmp/2/
3737
- ./project/scripts/sbt ";dotty-bootstrapped/compile ;dotty-bootstrapped/test"
3838

3939
test_optimised:
4040
group: test
41-
image: lampepfl/dotty:2018-04-10
41+
image: lampepfl/dotty:2018-05-23
4242
commands:
4343
- cp -R . /tmp/3/ && cd /tmp/3/
4444
- ./project/scripts/sbt dotty-optimised/test
4545

4646
test_sbt:
4747
group: test
48-
image: lampepfl/dotty:2018-04-10
48+
image: lampepfl/dotty:2018-05-23
4949
commands:
5050
- cp -R . /tmp/4/ && cd /tmp/4/
5151
- ./project/scripts/sbt sbt-dotty/scripted
@@ -55,7 +55,7 @@ pipeline:
5555

5656
# DOCUMENTATION:
5757
documentation:
58-
image: lampepfl/dotty:2018-04-10
58+
image: lampepfl/dotty:2018-05-23
5959
commands:
6060
- ./project/scripts/genDocs
6161
secrets: [ bot_pass ]
@@ -67,7 +67,7 @@ pipeline:
6767
# PUBLISHING:
6868
# Publishing expect NIGHTLYBUILD or RELEASEBUILD to be set. See dottyVersion in Build.scala
6969
publish_nightly:
70-
image: lampepfl/dotty:2018-04-10
70+
image: lampepfl/dotty:2018-05-23
7171
environment:
7272
- NIGHTLYBUILD=yes
7373
commands:
@@ -78,7 +78,7 @@ pipeline:
7878
environment: nightly
7979

8080
publish_release:
81-
image: lampepfl/dotty:2018-04-10
81+
image: lampepfl/dotty:2018-05-23
8282
environment:
8383
- RELEASEBUILD=yes
8484
commands:
@@ -102,7 +102,7 @@ pipeline:
102102
event: tag
103103

104104
publish_sbt_release:
105-
image: lampepfl/dotty:2018-04-10
105+
image: lampepfl/dotty:2018-05-23
106106
environment:
107107
- RELEASEBUILD=yes
108108
commands:

project/Build.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ object ExposedValues extends AutoPlugin {
3333
object Build {
3434

3535
val baseVersion = "0.9.0"
36-
val scalacVersion = "2.12.4"
36+
val scalacVersion = "2.12.6"
3737

3838
val dottyOrganization = "ch.epfl.lamp"
3939
val dottyGithubUrl = "https://github.com/lampepfl/dotty"
@@ -866,7 +866,7 @@ object Build {
866866
settings(commonSettings).
867867
settings(
868868
version := {
869-
val base = "0.2.2"
869+
val base = "0.2.3"
870870
if (isRelease) base else base + "-SNAPSHOT"
871871
},
872872

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.1.4
1+
sbt.version=1.1.5

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/src/main/scala/hello/Hello.scala renamed to sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/app/src/main/scala/hello/Hello.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
package hello
2+
23
object Hello {
34
def main(args: Array[String]): Unit = {
45
val dotty: Int | String = "dotty"
Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
lazy val dottyVersion = sys.props("plugin.scalaVersion")
22

3-
lazy val pluginSetting = Seq(
4-
name := "dividezero",
5-
version := "0.0.1",
6-
organization := "ch.epfl.lamp",
7-
scalaVersion := dottyVersion,
3+
lazy val plugin = project
4+
.in(file("plugin"))
5+
.settings(
6+
name := "dividezero",
7+
version := "0.0.1",
8+
organization := "ch.epfl.lamp",
9+
scalaVersion := dottyVersion,
810

9-
libraryDependencies ++= Seq(
10-
"ch.epfl.lamp" %% "dotty" % scalaVersion.value % "provided"
11-
)
12-
)
11+
scalacOptions ++= Seq(
12+
"-language:implicitConversions"
13+
),
1314

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

16-
lazy val app = (project in file(".")).settings(
17-
scalaVersion := dottyVersion,
18-
libraryDependencies += compilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
19-
)
20+
lazy val app = project
21+
.in(file("app"))
22+
.settings(
23+
scalaVersion := dottyVersion
24+
)
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
lazy val dottyVersion = sys.props("plugin.scalaVersion")
2+
3+
lazy val plugin = project
4+
.in(file("plugin"))
5+
.settings(
6+
name := "dividezero",
7+
version := "0.0.1",
8+
organization := "ch.epfl.lamp",
9+
scalaVersion := dottyVersion,
10+
11+
libraryDependencies ++= Seq(
12+
"ch.epfl.lamp" %% "dotty" % scalaVersion.value % "provided"
13+
)
14+
)
15+
16+
lazy val app = project
17+
.in(file("app"))
18+
.settings(
19+
scalaVersion := dottyVersion,
20+
addCompilerPlugin("ch.epfl.lamp" %% "dividezero" % "0.0.1")
21+
)

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/pending

Lines changed: 0 additions & 5 deletions
This file was deleted.

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/plugin/DivideZero.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,15 @@ import Symbols.Symbol
1212
import Constants.Constant
1313
import transform.{LinkAll, Pickler}
1414

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

1920
val phaseName = name
2021

21-
override val runsAfter = Set(Pickler.phaseName)
22-
override val runsBefore = Set(LinkAll.phaseName)
22+
override val runsAfter = Set(Pickler.name)
23+
override val runsBefore = Set(LinkAll.name)
2324

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

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

3334
override def transformApply(tree: tpd.Apply)(implicit ctx: Context): tpd.Tree = tree match {
3435
case tpd.Apply(fun, tpd.Literal(Constants.Constant(v)) :: Nil) if isNumericDivide(fun.symbol) && v == 0 =>
35-
ctx.warning("divide by zero", tree.pos)
36+
ctx.error("divide by zero", tree.pos)
3637
tpd.Literal(Constant(0))
3738
case _ =>
3839
tree
3940
}
40-
}
41+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pluginClass=dividezero.DivideZero
1+
pluginClass=dividezero.DivideZero

sbt-dotty/sbt-test/sbt-dotty/compiler-plugin/project/build.properties

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Should compile OK without the plugin
2+
> app/compile
3+
4+
# Publish plugin locally
5+
> plugin/publishLocal
6+
7+
# Enable plugin
8+
$ copy-file changes/build.sbt build.sbt
9+
> reload
10+
11+
# Should NOT compile with the plugin
12+
> clean
13+
-> app/compile

sbt-dotty/src/dotty/tools/sbtplugin/DottyPlugin.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ object DottyPlugin extends AutoPlugin {
145145
onLoad in Global := onLoad.in(Global).value.andThen { state =>
146146
val sbtV = sbtVersion.value
147147
sbtFullVersion(sbtV) match {
148-
case Some((1, sbtMinor, sbtPatch)) if sbtMinor > 1 || (sbtMinor == 1 && sbtPatch >= 4) =>
148+
case Some((1, sbtMinor, sbtPatch)) if sbtMinor > 1 || (sbtMinor == 1 && sbtPatch >= 5) =>
149149
case _ =>
150-
sys.error(s"The sbt-dotty plugin cannot work with this version of sbt ($sbtV), sbt >= 1.1.4 is required.")
150+
sys.error(s"The sbt-dotty plugin cannot work with this version of sbt ($sbtV), sbt >= 1.1.5 is required.")
151151
}
152152
state
153153
}

tests/run/t5880.scala

Lines changed: 0 additions & 41 deletions
This file was deleted.

tests/run/view-headoption.check

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ f3: Some(5)
1717
fail
1818
success
1919
fail
20-
success
21-
fail
2220
fail
2321
success
2422
fail

0 commit comments

Comments
 (0)