Skip to content

Commit 88c5407

Browse files
committed
Merge pull request scala#4365 from adriaanm/2.10.x
Publish to sonatype staging (the default).
2 parents 8f0819a + 3285445 commit 88c5407

File tree

1 file changed

+2
-137
lines changed

1 file changed

+2
-137
lines changed

scripts/jobs/integrate/bootstrap

Lines changed: 2 additions & 137 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,14 @@
11
#!/bin/bash -e
22

3-
4-
53
# NOTE: this is a quick backport of the 2.11.x script to 2.10.x -- some comments may be out dated
64

7-
8-
9-
# TODO: different scripts for the different phases -- usually we don't need to bootstrap the modules,
10-
# since we can use the previous version of scala for STARR as well as for compiling the modules (assuming it's binary compatible)
11-
# We should move away from the complicated bootstrap and set up our release schedule so we always have a previous build that satisfies these criteria.
12-
# (Potentially trivially, by splitting up this script, and publishing locker as if it were a real release.)
13-
145
# requirements:
15-
# sbtCmd must point to sbt from sbt-extras (this is the standard on the Scala jenkins, so we only support that one)
166
# - ~/.sonatype-curl that consists of user = USER:PASS
17-
# - ~/.m2/settings.xml with credentials for sonatype
18-
# <server>
19-
# <id>private-repo</id>
20-
# <username>jenkinside</username>
21-
# <password></password>
22-
# </server>
237
# - ~/.credentials (for sonatype)
248
# realm=Sonatype Nexus Repository Manager
259
# host=oss.sonatype.org
2610
# user=lamp
2711
# password=
28-
# - ~/.credentials-private-repo for private-repo.typesafe.com, as follows:
29-
# realm=Artifactory Realm
30-
# host=private-repo.typesafe.com
31-
# user=jenkinside
32-
# password=
33-
# - ~/.sbt/0.13/plugins/gpg.sbt with:
34-
# addSbtPlugin("com.typesafe.sbt" % "sbt-pgp" % "0.8.1")
35-
36-
# Modus operandi:
37-
#
38-
# Determine Scala version as:
39-
#
40-
# $SCALA_VER_BASE$SCALA_VER_SUFFIX (if former variable is set)
41-
# By parsing the tag (if HEAD is tagged as v$base$suffix)
42-
# By parsing build.number for the base version, suffixing with -$sha-nightly
43-
# Serialize these versions to jenkins.properties, which are passed downstream to scala-release-2.11.x-dist.
44-
# This also removes the need to tag scala/scala-dist (not possible for nightlies, still encouraged for releases, but not a hard requirement).
45-
#
46-
# Determine Module Versions
47-
#
48-
# When running in "versions.properties" mode (the default), derive tags from these versions and build, publishing only those modules that are not available yet.
49-
# Otherwise, build HEAD for all modules, derive a -nightly version for them.
50-
# Bootstrap:
51-
#
52-
# Build minimal core of Scala as this version (aka locker), publish to private-repo
53-
# Build modules required to bootstrap, publish to private-repo
54-
# Build Scala using the previously built core and bootstrap modules, publish to private-repo This overwrites the minimal core on private-repo
55-
# Stage to sonatype (unless building a -nightly release):
56-
#
57-
# Stage this Scala build on sonatype
58-
# Rebuild modules with this Scala build, and stage them on sonatype as well
59-
# This script can be run in multiple modes. It is design to work without any input,
60-
# so that it could be run in Travis CI. In that mode, it'll build a release when
61-
# the current HEAD of the checkout in $WORKSPACE is tagged, and stage to sonatype. Otherwise,
62-
# it'll build a nightly.
63-
#
64-
# Since the nightlies are intended to be a drop in replacement, all modules are built with the
65-
# full Scala version as their binary version, so that you can just set scalaVersion to the
66-
# nightly's sha-derived version and be good to go.
67-
#
68-
# The other way to trigger a release is by setting the SCALA_VER_BASE env var.
69-
#
70-
# By default, we build the versions of the modules as specified by versions.properties
71-
# (as specified in the HEAD commit). Set moduleVersioning to something random
72-
# to trigger building HEAD of each module, generating a fresh -$(git describe)-nightly version for each.
73-
#
74-
# PS: set publishToSonatype to anything but "yes" to avoid publishing to sonatype
75-
# (publishing only done when $WORKSPACE checkout's HEAD is tagged / SCALA_VER_BASE is set.)
76-
77-
78-
sbtCmd=${sbtCmd-sbt} # TESTING (this is a marker for defaults to change when testing locally: should be sbtx on my mac)
79-
80-
# 0.13.5 does not respect "set every scalaVersion", see
81-
# https://github.com/scala/scala-parser-combinators/pull/27
82-
sbtCmd="$sbtCmd -sbt-version 0.13.2"
8312

8413
# publishToSonatype
8514
# set to anything but "yes" to avoid publishing to sonatype
@@ -90,36 +19,7 @@ baseDir=${WORKSPACE-`pwd`}
9019
scriptsDir="$baseDir/scripts"
9120
. $scriptsDir/common
9221

93-
# we must change ivy home to get a fresh ivy cache, otherwise we get half-bootstrapped scala
94-
# rm it in case it existed (and there's no ivy2-shadow, which indicates we're running in a TESTING environment)...
95-
# we don't nuke the whole ws since that clobbers the git clones needlessly
96-
[[ -d $baseDir/ivy2-shadow ]] || rm -rf $baseDir/ivy2
97-
mkdir -p $baseDir/ivy2
98-
99-
rm -rf $baseDir/resolutionScratch_
100-
mkdir -p $baseDir/resolutionScratch_
101-
102-
# repo used to publish "locker" scala to (to start the bootstrap)
103-
privateCred="private-repo"
104-
privateRepo="http://private-repo.typesafe.com/typesafe/scala-release-temp/"
105-
106-
##### git
107-
gfxd() {
108-
git clean -fxd # TESTING
109-
}
110-
111-
update() {
112-
[[ -d $baseDir ]] || mkdir -p $baseDir
113-
cd $baseDir
114-
115-
if [ ! -d $baseDir/$2 ]; then git clone "https://github.com/$1/$2.git"; fi
11622

117-
cd $2
118-
119-
git fetch --tags "https://github.com/$1/$2.git"
120-
(git fetch "https://github.com/$1/$2.git" $3 && git checkout -q FETCH_HEAD) #|| git checkout -q $3 # || fallback is for local testing on tag
121-
git reset --hard
122-
}
12323

12424
##### sonatype interface
12525

@@ -146,28 +46,6 @@ function st_stagingRepoClose() {
14646
}
14747

14848

149-
# ARGH trying to get this to work on multiple versions of sbt-extras...
150-
# the old version (on jenkins, and I don't want to upgrade for risk of breaking other builds) honors -sbt-dir
151-
# the new version of sbt-extras ignores sbt-dir, so we pass it in as -Dsbt.global.base
152-
# need to set sbt-dir to one that has the gpg.sbt plugin config
153-
sbtArgs="-no-colors -ivy $baseDir/ivy2 -Dsbt.override.build.repos=true -Dsbt.repository.config=$scriptsDir/repositories-scala-release -Dsbt.global.base=$HOME/.sbt/0.13 -sbt-dir $HOME/.sbt/0.13"
154-
155-
sbtBuild() {
156-
echo "### sbtBuild: "$sbtCmd $sbtArgs "${scalaVersionTasks[@]}" "${publishTasks[@]}" "$@"
157-
$sbtCmd $sbtArgs "${scalaVersionTasks[@]}" "${publishTasks[@]}" "$@" >> $baseDir/logs/builds 2>&1
158-
}
159-
160-
sbtResolve() {
161-
cd $baseDir/resolutionScratch_
162-
touch build.sbt
163-
cross=${4-binary} # Disabled / binary / full
164-
echo "### sbtResolve: $sbtCmd $sbtArgs " "${scalaVersionTasks[@]}" "\"$1\" % \"$2\" % \"$3\" cross CrossVersion.$cross"
165-
$sbtCmd $sbtArgs "${scalaVersionTasks[@]}" \
166-
"set libraryDependencies := Seq(\"$1\" % \"$2\" % \"$3\" cross CrossVersion.$cross)" \
167-
'show update' >> $baseDir/logs/resolution 2>&1
168-
}
169-
170-
17149
## BUILD STEPS:
17250

17351
determineScalaVersion() {
@@ -217,27 +95,14 @@ determineScalaVersion() {
21795
echo "Building Scala $SCALA_VER."
21896
}
21997

220-
deriveVersion() {
221-
update $1 $2 $3 &> /dev/null
222-
echo "$(git describe --match=v* | cut -dv -f2)-nightly"
223-
}
224-
225-
deriveVersionAnyTag() {
226-
update $1 $2 $3 &> /dev/null
227-
echo "$(git describe | cut -dv -f2)-nightly"
228-
}
229-
23098
distro() {
23199
cd $WORKSPACE
232100

233101
echo "### Building the distribution"
234102

235-
ant -Dextra.repo.url=$privateRepo\
236-
-Dmaven.version.suffix=$SCALA_VER_SUFFIX\
103+
ant -Dmaven.version.number=$SCALA_VER\
104+
-Dbuild.release=1\
237105
-Dscaladoc.git.commit=$SCALADOC_SOURCE_LINKS_VER\
238-
-Dremote.snapshot.repository=NOPE\
239-
-Dremote.release.repository=$privateRepo\
240-
-Drepository.credentials.id=$privateCred\
241106
distpack-opt
242107

243108
(cd $WORKSPACE/dists/ && tar cvzhf ../scala-dist-$SCALA_VER.tar.gz .)

0 commit comments

Comments
 (0)