Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
47 changes: 34 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,40 @@
language: scala
sudo: false

scala:
- 2.12.10
- 2.13.0

env:
global:
# PGP_PASSPHRASE
- secure: "ENsi/6s/RXiPqrfrU7kXqaDz8WiZeenQMhaSFshxbueJ8EtN20FIVt4rSM8HOpLbn1pYeq6PiQ7T2mxlsaJMWCUNud9CqOxgSH9vCoYkJJy6CkTIVLLKdu5teHVIzWcl3smbk7LZYv/4FuljBqYs9EecWjuYF7dZrY/otE5kKbA="
# SONA_USER
- secure: "cQAs8Q/a2YrqzRv3+QAiHchLac35Ppu7rppwJs2favmVJFL0SIBtPu891UiPy0V/3QN1JmwPLbsR/lsgpoGM76AMCn3rgq88zp45pD+UiH0d7dgFMzXorNGt3K+YpiW4j6iHyzM/POKVO7vLnRuln6jTE0QRcjRbEOqg+xtQo+I="
# SONA_PASS
- secure: "Cj4PsumsWL37Pl7V5ZPJw+/xH9esHblG5nN9Op91XcCfG006xHsz2w1iNOqFqCF8wAhgObuA2CmAH3ZuI1jZGGSo2HMt9+f5Z6tpifFzsTHZJtdNIVOpS3/NGhvgtg3UnT5WQQtnVi6zlkKl1xCpAIDNhOJ9dXoL54auAqvxpko="
script:
- admin/build.sh
jdk:
- oraclejdk8
- openjdk11
- ADOPTOPENJDK=8
- ADOPTOPENJDK=11

before_install:
# adding $HOME/.sdkman to cache would create an empty directory, which interferes with the initial installation
- "[[ -d $HOME/.sdkman/bin ]] || rm -rf $HOME/.sdkman/"
- curl -sL https://get.sdkman.io | bash
- echo sdkman_auto_answer=true > $HOME/.sdkman/etc/config
- source "$HOME/.sdkman/bin/sdkman-init.sh"

install:
- sdk install java $(sdk list java | grep -o "$ADOPTOPENJDK\.[0-9\.]*hs-adpt" | head -1)
- unset JAVA_HOME
- java -Xmx32m -version
- git fetch --tags # get all tags for sbt-dynver

script: ./build.sh

notifications:
email:
- jason.zaugg@lightbend.com
- seth.tisue@lightbend.com

before_cache:
- rm -f $HOME/.ivy2/.sbt.ivy.lock
- find $HOME/.ivy2/cache -name "ivydata-*.properties" | xargs rm
- find $HOME/.sbt -name "*.lock" | xargs rm
cache:
directories:
- $HOME/.ivy2/cache
- $HOME/.sbt
- $HOME/.cache/coursier
- $HOME/.sdkman
71 changes: 0 additions & 71 deletions admin/README.md

This file was deleted.

53 changes: 0 additions & 53 deletions admin/build.sh

This file was deleted.

11 changes: 0 additions & 11 deletions admin/encryptEnvVars.sh

This file was deleted.

41 changes: 0 additions & 41 deletions admin/genKeyPair.sh

This file was deleted.

1 change: 0 additions & 1 deletion admin/gpg.sbt

This file was deleted.

9 changes: 0 additions & 9 deletions admin/publish-settings.sbt

This file was deleted.

18 changes: 0 additions & 18 deletions admin/pubring.asc

This file was deleted.

Binary file removed admin/secring.asc.enc
Binary file not shown.
22 changes: 3 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
import ScalaModulePlugin._

scalaModuleSettings

scalaVersionsByJvm in ThisBuild := {
val v212 = "2.12.8"
val v213 = "2.13.0"

val allFalse = List(v212 -> false, v213 -> false)
Map(
8 -> List(v212 -> true, v213 -> true),
11 -> allFalse,
12 -> allFalse
)
}
ScalaModulePlugin.scalaModuleSettings
ScalaModulePlugin.scalaModuleSettingsJVM

name := "scala-async"
repoName := "async"

version := "0.10.1-SNAPSHOT"

libraryDependencies += "org.scala-lang" % "scala-reflect" % scalaVersion.value % "provided"
libraryDependencies += "org.scala-lang" % "scala-compiler" % scalaVersion.value % "test" // for ToolBox
libraryDependencies += "junit" % "junit" % "4.12" % "test"
libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % "test"

enableOptimizer
ScalaModulePlugin.enableOptimizer
testOptions += Tests.Argument(TestFrameworks.JUnit, "-q", "-v", "-s")
scalacOptions in Test ++= Seq("-Yrangepos")

Expand Down
68 changes: 68 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

set -e

# Builds of tagged revisions are published to sonatype staging.

# Travis runs a build on new revisions and on new tags, so a tagged revision is built twice.
# Builds for a tag have TRAVIS_TAG defined, which we use for identifying tagged builds.

# sbt-dynver sets the version number from the tag
# sbt-travisci sets the Scala version from the travis job matrix

# When a new binary incompatible Scala version becomes available, a previously released version
# can be released using that new Scala version by creating a new tag containing the Scala version
# after a hash, e.g., v1.2.3#2.13.0-M3. In this situation, the first job of the travis job
# matrix builds the release. All other jobs are stopped. Make sure that the first job uses
# the desired JVM version.

# For normal tags that are cross-built, we release on JDK 8 for Scala 2.x
isReleaseJob() {
if [[ "$ADOPTOPENJDK" == "8" ]]; then
true
else
false
fi
}

# For tags that define a Scala version, we pick the jobs of one Scala version (2.13.x) to do the releases
isTagScalaReleaseJob() {
if [[ "$ADOPTOPENJDK" == "8" && "$TRAVIS_SCALA_VERSION" =~ ^2\.13\.[0-9]+$ ]]; then
true
else
false
fi
}

verPat="[0-9]+\.[0-9]+\.[0-9]+(-[A-Za-z0-9-]+)?"
tagPat="^v$verPat(#$verPat)?$"

if [[ "$TRAVIS_TAG" =~ $tagPat ]]; then
releaseTask="ci-release"
tagScalaVer=$(echo $TRAVIS_TAG | sed s/[^#]*// | sed s/^#//)
if [[ "$tagScalaVer" == "" ]]; then
if ! isReleaseJob; then
echo "Not releasing on Java $ADOPTOPENJDK with Scala $TRAVIS_SCALA_VERSION"
exit 0
fi
else
if isTagScalaReleaseJob; then
setTagScalaVersion='set every scalaVersion := "'$tagScalaVer'"'
else
echo "The releases for Scala $tagScalaVer are built by other jobs in the travis job matrix"
exit 0
fi
fi
fi

# default is +publishSigned; we cross-build with travis jobs, not sbt's crossScalaVersions
# re-define pgp files to work around https://github.com/olafurpg/sbt-ci-release/issues/64
export CI_RELEASE="; set pgpSecretRing := pgpSecretRing.value; set pgpPublicRing := pgpPublicRing.value; publishSigned"
export CI_SNAPSHOT_RELEASE="publish"

# default is sonatypeBundleRelease, which closes and releases the staging repo
# see https://github.com/xerial/sbt-sonatype#commands
# for now, until we're confident in the new release scripts, just close the staging repo.
export CI_SONATYPE_RELEASE="; sonatypePrepare; sonatypeBundleUpload; sonatypeClose"

sbt "$setTagScalaVersion" clean test publishLocal $releaseTask
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.2.8
sbt.version=1.3.0
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.0.0")
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.1.1")