From 700c66e23b22f4285d991acf8b10d5e8b5f764e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Mon, 24 Oct 2016 14:30:29 +0200 Subject: [PATCH 1/4] Update readme --- .drone.yml | 8 +------- .travis.yml | 5 +---- bin/setupCI.sh | 6 ++++++ readme/Intro.scalatex | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) create mode 100755 bin/setupCI.sh diff --git a/.drone.yml b/.drone.yml index b63de1676..d85d53fda 100644 --- a/.drone.yml +++ b/.drone.yml @@ -2,11 +2,5 @@ build: image: olafurpg/scalafix:0.0.1 commands: - - apt-get install nailgun - - alias ng=ng-nailgun - - export PATH=$PATH:/root/local/bin - - pip install --user codecov + - ./bin/setupCI.sh - ./bin/testAll.sh - # I can't be bothered to hide this token. - - $HOME/.local/bin/codecov -t 5f2117aa-0a01-4cf1-8bf7-631a62ccb47a - diff --git a/.travis.yml b/.travis.yml index dbf091b5b..dfd18db08 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: scala -# Use container-based infrastructure sudo: false -# These directories are cached to S3 at the end of the build cache: directories: - $HOME/.ivy2/cache @@ -11,13 +9,12 @@ git: scala: - 2.11.8 before_install: - - pip install --user codecov + - ./bin/setupCI.sh script: - ./bin/testAll.sh after_success: - codecov jdk: - - oraclejdk8 - oraclejdk7 notifications: email: diff --git a/bin/setupCI.sh b/bin/setupCI.sh new file mode 100755 index 000000000..215b1b281 --- /dev/null +++ b/bin/setupCI.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +set -e +apt-get install nailgun +alias ng=ng-nailgun +export PATH=$PATH:/root/local/bin +pip install --user codecov diff --git a/readme/Intro.scalatex b/readme/Intro.scalatex index 0af917dff..f793ac92a 100644 --- a/readme/Intro.scalatex +++ b/readme/Intro.scalatex @@ -3,7 +3,6 @@ @p @raw - codecov.io Build Status Join the chat at https://gitter.im/scalacenter/scalafix From eacf22fa0a7b2f916fea2c140bdb50e0a5745556 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Mon, 24 Oct 2016 14:41:04 +0200 Subject: [PATCH 2/4] Support scalafix foo.scala syntax in CLI --- cli/src/main/scala/scalafix/cli/Cli.scala | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cli/src/main/scala/scalafix/cli/Cli.scala b/cli/src/main/scala/scalafix/cli/Cli.scala index 899994971..3b06d449a 100644 --- a/cli/src/main/scala/scalafix/cli/Cli.scala +++ b/cli/src/main/scala/scalafix/cli/Cli.scala @@ -48,8 +48,7 @@ case class ScalafixOptions( ) debug: Boolean = false, @Recurse common: CommonOptions = CommonOptions() ) extends App { - - Cli.runOn(this) + Cli.runOn(this.copy(files = files ++ remainingArgs)) } object Cli extends AppOf[ScalafixOptions] { From dd1b0ed1e781f8f92a2b5609ad2c57ec5a24164b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Mon, 24 Oct 2016 14:48:03 +0200 Subject: [PATCH 3/4] Update badge and remove nailgun integration test --- bin/testAll.sh | 3 --- readme/Intro.scalatex | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/bin/testAll.sh b/bin/testAll.sh index d949764c3..b27397d6c 100755 --- a/bin/testAll.sh +++ b/bin/testAll.sh @@ -5,6 +5,3 @@ sbt clean coverage test sbt "; publishLocal ; scripted ; cli/pack" sbt coverageAggregate -# Integration tests -./bin/nailgun_integration_test.sh - diff --git a/readme/Intro.scalatex b/readme/Intro.scalatex index f793ac92a..eae3d14fb 100644 --- a/readme/Intro.scalatex +++ b/readme/Intro.scalatex @@ -3,7 +3,7 @@ @p @raw - Build Status + Join the chat at https://gitter.im/scalacenter/scalafix @p From e70f42b248462874a125832fe97a4b2fa48e222c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93lafur=20P=C3=A1ll=20Geirsson?= Date: Mon, 24 Oct 2016 14:54:56 +0200 Subject: [PATCH 4/4] Setup caching on drone --- .drone.yml | 7 +++++- bin/nailgun_integration_test.sh | 41 --------------------------------- bin/setupCI.sh | 1 - bin/testAll.sh | 7 +++--- 4 files changed, 9 insertions(+), 47 deletions(-) delete mode 100755 bin/nailgun_integration_test.sh diff --git a/.drone.yml b/.drone.yml index d85d53fda..58de4722f 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,6 +1,11 @@ -# Trigger build 8 build: image: olafurpg/scalafix:0.0.1 + environment: + - COURSIER_CACHE=/drone/cache/coursier commands: + - export PATH=$PATH:/root/local/bin - ./bin/setupCI.sh - ./bin/testAll.sh +cache: + mount: + - /drone/cache diff --git a/bin/nailgun_integration_test.sh b/bin/nailgun_integration_test.sh deleted file mode 100755 index 5dcedc20f..000000000 --- a/bin/nailgun_integration_test.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash -set -e - -echo "Running nailgun integration test..." - -cwd=$(pwd) -cd cli/target/pack -make install -cd $cwd - -echoOriginalContents() { - cat << EOF -object app { - def main() { - println(1) - } -} -EOF -} - -echoExpectedContents() { - cat << EOF -object app { - def main(): Unit = { - println(1) - } -} -EOF -} -original=target/original.scala -expected=target/expected.scala - -mkdir -p target -echoOriginalContents > ${original} -echoExpectedContents > ${expected} -./bin/scalafix_ng -i ${original} - -# Assert there is no diff -diff ${original} ${expected} - -echo "Done!" diff --git a/bin/setupCI.sh b/bin/setupCI.sh index 215b1b281..ba2c262ea 100755 --- a/bin/setupCI.sh +++ b/bin/setupCI.sh @@ -2,5 +2,4 @@ set -e apt-get install nailgun alias ng=ng-nailgun -export PATH=$PATH:/root/local/bin pip install --user codecov diff --git a/bin/testAll.sh b/bin/testAll.sh index b27397d6c..a47a24977 100755 --- a/bin/testAll.sh +++ b/bin/testAll.sh @@ -1,7 +1,6 @@ #!/bin/bash set -e -sbt clean coverage test -sbt "; publishLocal ; scripted ; cli/pack" -sbt coverageAggregate - +sbt -Dsbt.home.ivy=/drone/cache/ivy2 clean coverage test +sbt -Dsbt.home.ivy=/drone/cache/ivy2 "; publishLocal ; scripted ; cli/pack" +sbt -Dsbt.home.ivy=/drone/cache/ivy2 coverageAggregate