Skip to content

Fix dotr/dotc scripts #1957

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 8 commits into from
Feb 10, 2017
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pipeline:

matrix:
TEST:
- test
- ;test;dotty-bin-tests/test
- ;publishLocal;dotty-bootstrapped/test
- partest-only-no-bootstrap --show-diff --verbose
- partest-only --show-diff --verbose
2 changes: 1 addition & 1 deletion bin/common
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function getLastStringOnLineWith {
}

# Configuration
SCALA_VERSION=$(getLastStringOnLineWith "scalaVersion in")
SCALA_VERSION=$(getLastStringOnLineWith "val scalacVersion")
SCALA_BINARY_VERSION=2.11
SCALA_COMPILER_VERSION=$(getLastStringOnLineWith "scala-compiler")
SBT_VERSION=$(grep "sbt.version=" "$DOTTY_ROOT/project/build.properties" | sed 's/sbt.version=//')
Expand Down
21 changes: 15 additions & 6 deletions bin/test/TestScripts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,17 @@ class TestScripts {
private def executeScript(script: String): (Int, String) = {
val sb = new StringBuilder
val ret = Process(script) ! ProcessLogger(sb append _)
(ret, sb.toString)
val output = sb.toString
println(output) // For CI, otherwise "terminal inactive for 5m0s, build cancelled"
(ret, output)
}

private def deletePackages: Unit = {
def delete(path: String) = {
val file = new JFile(path)
if (file.exists) file.delete()
}
private def delete(path: String) = {
val file = new JFile(path)
if (file.exists) file.delete()
}

private def deletePackages: Unit = {
try {
for (jar <- Source.fromFile("./.packages").getLines())
delete(jar)
Expand Down Expand Up @@ -88,4 +90,11 @@ class TestScripts {
ret == 0 && !output.contains("rebuilding"),
s"Project recompiled when it didn't need to be. Status $ret, output:$lineSep$output")
}

/** dotc script should work after deleting .packages */
@Test def reCreatesPackagesIfNecessary = doUnlessWindows {
delete("./.packages")
val (retFirstBuild, _) = executeScript("./bin/dotc ./tests/pos/HelloWorld.scala")
assert(retFirstBuild == 0, "building dotc failed")
}
}
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import sbt.Package.ManifestAttributes

object DottyBuild extends Build {

val scalacVersion = "2.11.5"
val scalacVersion = "2.11.5" // Do not rename, this is grepped in bin/common.

val dottyOrganization = "ch.epfl.lamp"
val dottyVersion = {
Expand Down