summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-04 20:41:28 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-04 20:47:46 -0800
commit00d0f979e2facd2c5d12d06dd2dc70c0b14c3c1f (patch)
treeeaa85b4b7fe6ec513f8545d5e1e43954e6e011ce
parent74c4751ffc5abcc08f6dae0a336d76549161b444 (diff)
downloadmill-00d0f979e2facd2c5d12d06dd2dc70c0b14c3c1f.tar.gz
mill-00d0f979e2facd2c5d12d06dd2dc70c0b14c3c1f.tar.bz2
mill-00d0f979e2facd2c5d12d06dd2dc70c0b14c3c1f.zip
Cleanup
-rw-r--r--.travis.yml8
-rwxr-xr-xbuild.sc18
-rwxr-xr-xci/release.sh9
-rwxr-xr-xci/test-mill-built.sh (renamed from ci/test3.sh)0
-rwxr-xr-xci/test-mill-release.sh (renamed from ci/test4.sh)0
-rwxr-xr-xci/test-sbt-built.sh (renamed from ci/test2.sh)0
-rwxr-xr-xci/test-sbt.sh (renamed from ci/test1.sh)0
-rw-r--r--core/test/src/mill/util/ScriptTestSuite.scala4
-rw-r--r--core/test/src/mill/util/TestEvaluator.scala4
9 files changed, 31 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index 02d43def..da939589 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -11,13 +11,13 @@ jdk:
matrix:
include:
- stage: build
- env: CI_SCRIPT=ci/test1.sh
+ env: CI_SCRIPT=ci/test-sbt.sh
- stage: build
- env: CI_SCRIPT=ci/test2.sh
+ env: CI_SCRIPT=ci/test-sbt-built.sh
- stage: build
- env: CI_SCRIPT=ci/test3.sh
+ env: CI_SCRIPT=ci/test-mill-built.sh
- stage: build
- env: CI_SCRIPT=ci/test4.sh
+ env: CI_SCRIPT=ci/test-mill-release.sh
- stage: release
env: CI_SCRIPT=ci/release.sh
diff --git a/build.sc b/build.sc
index a2062409..ff819daf 100755
--- a/build.sc
+++ b/build.sc
@@ -243,7 +243,23 @@ def uploadToGithub(assembly: Path, authKey: String, release: String, label: Stri
}
}
-def releaseCI(githubAuthKey: String, sonatypeCreds: String, gpgPassphrase: String) =
+def releaseCI(githubAuthKey: String,
+ sonatypeCreds: String,
+ gpgPassphrase: String,
+ gpgPrivateKey: String) =
+ if (isMasterCommit) T.command()
+ else {
+ write(home / "gpg.key", java.util.Base64.getDecoder.decode(gpgPrivateKey))
+ %('gpg, 'import, home / "gpg.key")(pwd)
+ T.command{
+ releaseManual(githubAuthKey, sonatypeCreds, gpgPassphrase)()
+ }
+ }
+
+
+def releaseManual(githubAuthKey: String,
+ sonatypeCreds: String,
+ gpgPassphrase: String) =
if (isMasterCommit) T.command()
else T.command{
moduledefs.publish(sonatypeCreds, gpgPassphrase)()
diff --git a/ci/release.sh b/ci/release.sh
index 892e8e49..18bfc399 100755
--- a/ci/release.sh
+++ b/ci/release.sh
@@ -2,7 +2,10 @@
set -eux
-echo $GPG_PRIVATE_KEY_B64 | base64 --decode > ~/gpg.key
-gpg import ~/gpg.key
-target/bin/mill releaseCI $GITHUB_ACCESS_TOKEN lihaoyi:$SONATYPE_PASSWORD $GPG_PASSWORD
+
+target/bin/mill releaseCI \
+ $GITHUB_ACCESS_TOKEN \
+ lihaoyi:$SONATYPE_PASSWORD \
+ $GPG_PASSWORD \
+ $GPG_PRIVATE_KEY_B64
diff --git a/ci/test3.sh b/ci/test-mill-built.sh
index 5b3b1a28..5b3b1a28 100755
--- a/ci/test3.sh
+++ b/ci/test-mill-built.sh
diff --git a/ci/test4.sh b/ci/test-mill-release.sh
index 52fc053d..52fc053d 100755
--- a/ci/test4.sh
+++ b/ci/test-mill-release.sh
diff --git a/ci/test2.sh b/ci/test-sbt-built.sh
index ebb3ddb5..ebb3ddb5 100755
--- a/ci/test2.sh
+++ b/ci/test-sbt-built.sh
diff --git a/ci/test1.sh b/ci/test-sbt.sh
index f77456f7..f77456f7 100755
--- a/ci/test1.sh
+++ b/ci/test-sbt.sh
diff --git a/core/test/src/mill/util/ScriptTestSuite.scala b/core/test/src/mill/util/ScriptTestSuite.scala
index 7d46feee..1aa74de1 100644
--- a/core/test/src/mill/util/ScriptTestSuite.scala
+++ b/core/test/src/mill/util/ScriptTestSuite.scala
@@ -11,8 +11,8 @@ abstract class ScriptTestSuite extends TestSuite{
def scriptSourcePath: Path
val workspacePath = pwd / 'target / 'workspace / workspaceSlug
-// val stdOutErr = new PrintStream(new ByteArrayOutputStream())
- val stdOutErr = new PrintStream(System.out)
+ val stdOutErr = new PrintStream(new ByteArrayOutputStream())
+// val stdOutErr = new PrintStream(System.out)
val stdIn = new ByteArrayInputStream(Array())
val runner = new mill.main.MainRunner(
ammonite.main.Cli.Config(wd = workspacePath), false,
diff --git a/core/test/src/mill/util/TestEvaluator.scala b/core/test/src/mill/util/TestEvaluator.scala
index 92ce5b37..c9230065 100644
--- a/core/test/src/mill/util/TestEvaluator.scala
+++ b/core/test/src/mill/util/TestEvaluator.scala
@@ -28,8 +28,8 @@ class TestEvaluator[T <: TestUtil.TestBuild](module: T)
tp: TestPath){
val outPath = TestUtil.getOutPath()
-// val logger = DummyLogger
- val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err)
+ val logger = DummyLogger
+// val logger = new PrintLogger(true, ammonite.util.Colors.Default, System.out, System.out, System.err)
val evaluator = new Evaluator(outPath, TestEvaluator.externalOutPath, module, discover, logger)
def apply[T](t: Task[T]): Either[Result.Failing[T], (T, Int)] = {