Skip to content

Commit 9b3ec8a

Browse files
committed
Some cleanups in the build.
1 parent 415ba06 commit 9b3ec8a

File tree

5 files changed

+73
-82
lines changed

5 files changed

+73
-82
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ stages:
2222
- name: publish
2323
if: type != pull_request
2424

25+
# see comment in `bootstrap_fun` for details on the procedure
2526
# env available in each stage
2627
# - by travis config (see below): secret env vars
2728
# - by `common` script: WORKSPACE, IVY2_DIR, SBT_CMD, integrationRepoUrl

admin/init.sh

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#!/bin/bash
2-
1+
#!/bin/bash -e
32

43
sensitive() {
54
perl -p -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' < files/credentials-private-repo > ~/.credentials-private-repo
@@ -12,14 +11,9 @@ sensitive() {
1211
# don't let anything escape from the sensitive part (e.g. leak environment var by echoing to log on failure)
1312
sensitive >/dev/null 2>&1
1413

15-
# pgp signing doesn't work without public key??
16-
gpg --keyserver pgp.mit.edu --recv-keys 0xa9052b1b6d92e560
17-
1814
# just to verify
1915
gpg --list-keys
2016
gpg --list-secret-keys
2117

2218
mkdir -p ~/.sbt/0.13/plugins
2319
cp files/gpg.sbt ~/.sbt/0.13/plugins/
24-
25-
export sbtCmd=$(which sbt)

scripts/bootstrap_fun

+68
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,71 @@
1+
# Bootstrap procedure
2+
# - determine scala version
3+
# - determine module versions
4+
# - build minimal core (aka locker) of Scala, use the determined version number, publish to scala-integration
5+
# - build those modules where a binary compatible version doesn't exist, publish to scala-integration
6+
# - build Scala using the previously built core and modules, publish to scala-integration
7+
# - run tests
8+
# - for releases
9+
# - stage Scala on sonatype
10+
# - rebuild modules where no binary compatible version existed, stage them on sonatype
11+
# - the Scala version is serialized to jenkins.properties, which is passed downstream to scala-release jobs
12+
13+
14+
# Specifying the Scala version:
15+
# - To build a release (enables publishing to sonatype):
16+
# - Specify SCALA_VER_BASE and optionally SCALA_VER_SUFFIX. The version is SCALA_VER=$SCALA_VER_BASE$SCALA_VER_SUFFIX.
17+
# - After building a release, the jenkins job provides an updated versions.properties file as artifact.
18+
# Put this file in the Scala repo and create a pull request, also update `baseVersion in Global` in build.sbt.
19+
#
20+
# - Otherwise, an integration build is performed:
21+
# - version number is read from the build.sbt, extended with -[bin|pre]-$sha
22+
23+
24+
# Specifying module versions. We use release versions for modules.
25+
# - Module versions are read from the versions.properties file.
26+
# - Set <MODULE>_VER to override the default, e.g. XML_VER="1.0.4".
27+
# - The git revision is set to <MODULE>_REF="v$<MODULE>_VER". Make sure the tag exists (you can't override <MODULE>_REF).
28+
29+
30+
# Modules are automatically built if necessary.
31+
# - A module is built if it doesn't exist in the maven repository. Note that the lookup uses two versions:
32+
# - The version of the module (see below how it's determined)
33+
# - The binary version of of the SCALA_VER release that is being built
34+
# - sbt computes the binary version when looking up / building modules (*). Examples:
35+
# - 2.12.0-M1, 2.12.0-RC3: the full version is used
36+
# - 2.12.0, 2.12.1-M1, 2.12.1-RC3, 2.12.1: the binary version 2.12 is used
37+
#
38+
# - Example: assume that `scala-xml_2.11 % 1.0.3` and `scala-xml_2.12.0-M1 % 1.0.3` both exists
39+
# - XML_VER=1.0.3 and SCALA_VER=2.11.7 => no rebuild (binary version remains 2.11)
40+
# - XML_VER=1.0.3 and SCALA_VER=2.12.0-M2 => rebuild (new binary version 2.12.0-M2)
41+
# - XML_VER=1.0.4 and SCALA_VER=2.11.7 => rebuild (new version for the module, not yet on maven)
42+
# NOTE: this is not the recommended way of publishing a module. Instead, prefer to release `scala-xml_2.11 % 1.0.4`
43+
# using the existing scala 2.11.6 compiler before releasing 2.11.7. Sometimes it's necessary though. One
44+
# example was 2.11.1, which contained a fix in the backend (SerialVersionUID was ignored). All modules needed
45+
# to be re-built using the 2.11.1 release, we could not use 2.11.0. We could also not release the modules
46+
# after 2.11.1 was out, because that way the scala-library-all pom of 2.11.1 would depend on the old modules.
47+
#
48+
# (*) https://github.com/sbt/sbt/blob/v0.13.13/util/cross/src/main/input_sources/CrossVersionUtil.scala#L41
49+
50+
51+
# Binary incompatible changes in Modules: example with Scala 2.11 / 2.12 and scala-parser-combinators
52+
# - The 1.0.x branch on scala-parser-combinators remains binary compatible with 1.0.0
53+
# - Scala 2.11 will always use 1.0.x releases: we ship scala-parser-combinators with the distribution,
54+
# so we cannot introduce incompatible changes in a minor release.
55+
# - The master branch of scala-parser-combinators contains binary incompatible changes, versioned 1.1.x
56+
# - Scala 2.12 will use 1.1.x releases
57+
# - No changes to the build script required: just put the 1.1.x version number into versions.properties
58+
#
59+
# Note: It's still OK for a module to release a binary incompatible version to maven, for example
60+
# scala-parser-combinators_2.11 % 1.1.0. Users can depend on this in their sbt build. But for the
61+
# distribution (tar/zip archives, scala-library-all) we have to stay on the binary compatible version.
62+
63+
64+
# Credentials
65+
# - `PRIVATE_REPO_PASS` password for `scala-ci` user on scala-ci.typesafe.com/artifactory
66+
# - `SONA_USER` / `SONA_PASS` for sonatype
67+
68+
169
publishPrivateTask=${publishPrivateTask-"publish"}
270
publishSonatypeTaskCore=${publishSonatypeTaskCore-"publishSigned"}
371
publishSonatypeTaskModules=${publishSonatypeTaskModules-"publishSigned"}

scripts/common

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This is for forcibly stopping the job from a subshell (see test
2-
# below).
1+
# This is for forcibly stopping the job from a subshell (see test below).
32
trap "exit 1" TERM
43
export TOP_PID=$$
54
set -e
@@ -24,7 +23,7 @@ mkdir -p "$LOGGINGDIR"
2423
rm -rf "$WORKSPACE/resolutionScratch_"
2524
mkdir -p "$WORKSPACE/resolutionScratch_"
2625

27-
SBT_CMD=${sbtCmd-sbt}
26+
SBT_CMD=${SBT_CMD-sbt}
2827
SBT_CMD="$SBT_CMD -sbt-version 0.13.17"
2928

3029
# repo to publish builds

scripts/jobs/integrate/bootstrap

+1-72
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,6 @@
11
#!/bin/bash -e
22

3-
# Script Overview
4-
# - determine scala version
5-
# - determine module versions
6-
# - build minimal core (aka locker) of Scala, use the determined version number, publish to scala-integration
7-
# - build those modules where a binary compatible version doesn't exist, publish to scala-integration
8-
# - build Scala using the previously built core and bootstrap modules, publish to scala-integration
9-
# - for releases
10-
# - stage Scala on sonatype
11-
# - rebuild modules that needed a rebuild with this Scala build, and stage them on sonatype
12-
# - the Scala version is serialized to jenkins.properties, which is passed downstream to scala-release jobs
13-
14-
15-
# Specifying the Scala version:
16-
# - To build a release (this enables publishing to sonatype):
17-
# - Specify SCALA_VER_BASE. You may also specify SCALA_VER_SUFFIX, the Scala version is SCALA_VER=$SCALA_VER_BASE$SCALA_VER_SUFFIX.
18-
# - Note: After building a release, the jenkins job provides an updated versions.properties file as artifact.
19-
# Put this file in the Scala repo and create a pull request, also update `baseVersion in Global` in build.sbt.
20-
#
21-
# - Otherwise, an integration build is performed:
22-
# - version number is read from the build.sbt, extended with -[bin|pre]-$sha
23-
24-
25-
# Specifying module versions. We use release versions for modules.
26-
# - Module versions are read from the versions.properties file.
27-
# - Set <MODULE>_VER to override the default, e.g. XML_VER="1.0.4".
28-
# - The git revision is set to <MODULE>_REF="v$<MODULE>_VER". Make sure the tag exists (you can't override <MODULE>_REF).
29-
30-
31-
# Modules are automatically built if necessary.
32-
# - A module is built if it doesn't exist in the maven repository. Note that the lookup uses two versions:
33-
# - The version of the module (see below how it's determined)
34-
# - The binary version of of the SCALA_VER release that is being built
35-
# - sbt computes the binary version when looking up / building modules (*). Examples:
36-
# - 2.12.0-M1, 2.12.0-RC3: the full version is used
37-
# - 2.12.0, 2.12.1-M1, 2.12.1-RC3, 2.12.1: the binary version 2.12 is used
38-
#
39-
# - Example: assume that `scala-xml_2.11 % 1.0.3` and `scala-xml_2.12.0-M1 % 1.0.3` both exists
40-
# - XML_VER=1.0.3 and SCALA_VER=2.11.7 => no rebuild (binary version remains 2.11)
41-
# - XML_VER=1.0.3 and SCALA_VER=2.12.0-M2 => rebuild (new binary version 2.12.0-M2)
42-
# - XML_VER=1.0.4 and SCALA_VER=2.11.7 => rebuild (new version for the module, not yet on maven)
43-
# NOTE: this is not the recommended way of publishing a module. Instead, prefer to release `scala-xml_2.11 % 1.0.4`
44-
# using the existing scala 2.11.6 compiler before releasing 2.11.7. Sometimes it's necessary though. One
45-
# example was 2.11.1, which contained a fix in the backend (SerialVersionUID was ignored). All modules needed
46-
# to be re-built using the 2.11.1 release, we could not use 2.11.0. We could also not release the modules
47-
# after 2.11.1 was out, because that way the scala-library-all pom of 2.11.1 would depend on the old modules.
48-
#
49-
# (*) https://github.com/sbt/sbt/blob/v0.13.13/util/cross/src/main/input_sources/CrossVersionUtil.scala#L41
50-
51-
52-
# Binary incompatible changes in Modules: example with Scala 2.11 / 2.12 and scala-parser-combinators
53-
# - The 1.0.x branch on scala-parser-combinators remains binary compatible with 1.0.0
54-
# - Scala 2.11 will always use 1.0.x releases: we ship scala-parser-combinators with the distribution,
55-
# so we cannot introduce incompatible changes in a minor release.
56-
# - The master branch of scala-parser-combinators contains binary incompatible changes, versioned 1.1.x
57-
# - Scala 2.12 will use 1.1.x releases
58-
# - No changes to the build script required: just put the 1.1.x version number into versions.properties
59-
#
60-
# Note: It's still OK for a module to release a binary incompatible version to maven, for example
61-
# scala-parser-combinators_2.11 % 1.1.0. Users can depend on this in their sbt build. But for the
62-
# distribution (tar/zip archives, scala-library-all) we have to stay on the binary compatible version.
63-
64-
65-
# Requirements
66-
# - SBT_CMD must point to sbt from sbt-extras
67-
# - ~/.sonatype-curl, ~/.m2/settings.xml, ~/.credentials, ~/.credentials-sonatype, ~/.credentials-private-repo
68-
# as defined by https://github.com/scala/scala-jenkins-infra/tree/master/templates/default
69-
# - ~/.sbt/0.13/plugins/gpg.sbt with:
70-
# addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1")
71-
72-
# Note: private-repo used to be private-repo.typesafe.com. now we're running artifactory on scala-ci.typesafe.com/artifactory
73-
74-
#### MAIN
3+
# See comment in bootstrap_fun
754

765
source scripts/common
776

0 commit comments

Comments
 (0)