Skip to content

Commit

Permalink
Merge pull request #715 from coursier/topic/fix-build-1.0
Browse files Browse the repository at this point in the history
Update version numbers in CI scripts after 1.0.0 release
  • Loading branch information
alexarchambault committed Dec 18, 2017
2 parents bee3a36 + 1c134dc commit b21042a
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 9 deletions.
32 changes: 31 additions & 1 deletion project/Release.scala
@@ -1,5 +1,5 @@
import java.nio.charset.StandardCharsets
import java.nio.file.Files
import java.nio.file.{Files, Paths}
import java.util.regex.Pattern

import com.typesafe.sbt.pgp.PgpKeys
Expand Down Expand Up @@ -281,6 +281,35 @@ object Release {
state
}

val updateTestFixture = ReleaseStep(
action = { state =>

val initialVer = state.get(initialVersion).getOrElse {
sys.error(s"${initialVersion.label} key not set")
}
val (_, nextVer) = state.get(ReleaseKeys.versions).getOrElse {
sys.error(s"${ReleaseKeys.versions.label} key not set")
}

if (initialVer == nextVer)
state
else {
val vcs = state.vcs
val log = toProcessLogger(state)

val originalFile = Paths.get(s"tests/shared/src/test/resources/resolutions/io.get-coursier/coursier_2.11/$initialVer")
val originalContent = new String(Files.readAllBytes(originalFile), StandardCharsets.UTF_8)
val destFile = Paths.get(s"tests/shared/src/test/resources/resolutions/io.get-coursier/coursier_2.11/$nextVer")
val destContent = originalContent.replace(initialVer, nextVer)
log.out(s"Writing $destFile")
Files.write(destFile, destContent.getBytes(StandardCharsets.UTF_8))
vcs.add(destFile.toAbsolutePath.toString).!!(log)
vcs.cmd("rm", originalFile.toAbsolutePath.toString).!!(log)
state
}
}
)

val commitUpdates = ReleaseStep(
action = { state =>

Expand Down Expand Up @@ -367,6 +396,7 @@ object Release {
stageReadme,
updatePluginsSbt,
updateMimaVersions,
updateTestFixture,
commitUpdates,
reallyTagRelease,
setNextVersion,
Expand Down
2 changes: 1 addition & 1 deletion scripts/launch-test-repo.sh
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e

VERSION="${VERSION:-1.0.0-SNAPSHOT}"
VERSION="1.0.0"

cd "$(dirname "$0")/.."

Expand Down
2 changes: 1 addition & 1 deletion scripts/start-it-auth-server.ps1
@@ -1,3 +1,3 @@
# see https://stackoverflow.com/questions/2224350/powershell-start-job-working-directory/2246542#2246542
Set-Location $args[0]
& java -jar -noverify coursier launch io.get-coursier:http-server_2.12:1.0.0-SNAPSHOT -- -d tests/jvm/src/test/resources/test-repo/http/abc.com -u user -P pass -r realm --port 8080 --list-pages -v
& java -jar -noverify coursier launch io.get-coursier:http-server_2.12:1.0.0 -- -d tests/jvm/src/test/resources/test-repo/http/abc.com -u user -P pass -r realm --port 8080 --list-pages -v
2 changes: 1 addition & 1 deletion scripts/start-it-no-listing-server.ps1
@@ -1,3 +1,3 @@
# see https://stackoverflow.com/questions/2224350/powershell-start-job-working-directory/2246542#2246542
Set-Location $args[0]
& java -jar -noverify coursier launch io.get-coursier:http-server_2.12:1.0.0-SNAPSHOT -- -d tests/jvm/src/test/resources/test-repo/http/abc.com -u user -P pass -r realm --port 8081 -v
& java -jar -noverify coursier launch io.get-coursier:http-server_2.12:1.0.0 -- -d tests/jvm/src/test/resources/test-repo/http/abc.com -u user -P pass -r realm --port 8081 -v
8 changes: 5 additions & 3 deletions scripts/travis.sh
Expand Up @@ -7,6 +7,8 @@ BRANCH="${BRANCH:-${TRAVIS_BRANCH:-$(git rev-parse --abbrev-ref HEAD)}}"
PUBLISH="${PUBLISH:-0}"
SCALA_JS="${SCALA_JS:-0}"

VERSION="$(grep -oP '(?<=")[^"]*(?!<")' < version.sbt)"

JARJAR_VERSION="${JARJAR_VERSION:-1.0.1-coursier-SNAPSHOT}"

is210() {
Expand Down Expand Up @@ -183,7 +185,7 @@ testSbtCoursierJava6() {
mkdir -p foo/project
cd foo
echo 'libraryDependencies += "foo" % "bar" % "1.0"' >> build.sbt
echo 'addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-SNAPSHOT")' >> project/plugins.sbt
echo 'addSbtPlugin("io.get-coursier" % "sbt-coursier" % "'"$VERSION"'")' >> project/plugins.sbt
echo 'sbt.version=0.13.15' >> project/build.properties
docker run -it --rm \
-v $HOME/.ivy2/local:/root/.ivy2/local \
Expand All @@ -201,7 +203,7 @@ clean_plugin_sbt() {
mv plugins.sbt plugins.sbt0
grep -v coursier plugins.sbt0 > plugins.sbt || true
echo '
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "1.0.0-SNAPSHOT")
addSbtPlugin("io.get-coursier" % "sbt-coursier" % "'"$VERSION"'")
' >> plugins.sbt
}

Expand All @@ -212,7 +214,7 @@ publish() {
testBootstrap() {
if is211; then
sbt ++${SCALA_VERSION} echo/publishLocal "project cli" pack
cli/target/pack/bin/coursier bootstrap -o cs-echo io.get-coursier:echo:1.0.0-SNAPSHOT
cli/target/pack/bin/coursier bootstrap -o cs-echo io.get-coursier:echo:1.0.0
if [ "$(./cs-echo foo)" != foo ]; then
echo "Error: unexpected output from bootstrapped echo command." 1>&2
exit 1
Expand Down
@@ -1,4 +1,4 @@
io.get-coursier:coursier_2.11:1.0.0-SNAPSHOT:compile
io.get-coursier:coursier_2.11:1.0.1-SNAPSHOT:compile
org.scala-lang:scala-library:2.11.11:default
org.scala-lang.modules:scala-xml_2.11:1.0.6:default
org.scalaz:scalaz-core_2.11:7.2.16:default
org.scalaz:scalaz-core_2.11:7.2.16:default

0 comments on commit b21042a

Please sign in to comment.