summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.sbt10
-rw-r--r--project/VersionUtil.scala45
-rw-r--r--scripts/jobs/integrate/bootstrap9
-rw-r--r--[-rwxr-xr-x]scripts/stability-test.sh (renamed from tools/stability-test.sh)0
-rwxr-xr-xtest/partest12
-rwxr-xr-xtools/scaladoc-diff4
6 files changed, 43 insertions, 37 deletions
diff --git a/build.sbt b/build.sbt
index d9a9f43db2..3ceff35b45 100644
--- a/build.sbt
+++ b/build.sbt
@@ -102,12 +102,10 @@ lazy val publishSettings : Seq[Setting[_]] = Seq(
publishMavenStyle := true
)
-// Set the version number: The ANT build uses the file "build.number" to get the base version. Overriding versions or
-// suffixes for certain builds is done by directly setting variables from the shell scripts. For example, in
-// publish-core this requires computing the commit SHA first and then passing it to ANT. In the sbt build we use
-// the two settings `baseVersion` and `baseVersionSuffix` to compute all versions (canonical, Maven, OSGi). See
-// VersionUtil.versionPropertiesImpl for details. The standard sbt `version` setting should not be set directly. It
-// is the same as the Maven version and derived automatically from `baseVersion` and `baseVersionSuffix`.
+// Set the version number: We use the two settings `baseVersion` and `baseVersionSuffix` to compute all versions
+// (canonical, Maven, OSGi). See VersionUtil.versionPropertiesImpl for details. The standard sbt `version` setting
+// should not be set directly. It is the same as the Maven version and derived automatically from `baseVersion` and
+// `baseVersionSuffix`.
globalVersionSettings
baseVersion in Global := "2.12.0"
baseVersionSuffix in Global := "SNAPSHOT"
diff --git a/project/VersionUtil.scala b/project/VersionUtil.scala
index 6fe2b004f7..1c2fff27b7 100644
--- a/project/VersionUtil.scala
+++ b/project/VersionUtil.scala
@@ -27,12 +27,13 @@ object VersionUtil {
generateBuildCharacterPropertiesFile := generateBuildCharacterPropertiesFileImpl.value
)
- case class Versions(canonicalVersion: String, mavenVersion: String, osgiVersion: String, commitSha: String, commitDate: String, isRelease: Boolean) {
+ case class Versions(canonicalVersion: String, mavenBase: String, mavenSuffix: String, osgiVersion: String, commitSha: String, commitDate: String, isRelease: Boolean) {
val githubTree =
if(isRelease) "v" + mavenVersion
else if(commitSha != "unknown") commitSha
else "master"
+ def mavenVersion: String = mavenBase + mavenSuffix
override def toString = s"Canonical: $canonicalVersion, Maven: $mavenVersion, OSGi: $osgiVersion, github: $githubTree"
def toMap: Map[String, String] = Map(
@@ -45,17 +46,18 @@ object VersionUtil {
/** Compute the canonical, Maven and OSGi version number from `baseVersion` and `baseVersionSuffix`.
* Examples of the generated versions:
*
- * ("2.11.8", "SNAPSHOT" ) -> ("2.11.8-20151215-133023-7559aed3c5", "2.11.8-SNAPSHOT", "2.11.8.v20151215-133023-7559aed3c5")
- * ("2.11.8", "SHA-SNAPSHOT") -> ("2.11.8-20151215-133023-7559aed3c5", "2.11.8-7559aed3c5-SNAPSHOT", "2.11.8.v20151215-133023-7559aed3c5")
- * ("2.11.8", "" ) -> ("2.11.8", "2.11.8", "2.11.8.v20151215-133023-VFINAL-7559aed3c5")
- * ("2.11.8", "M3" ) -> ("2.11.8-M3", "2.11.8-M3", "2.11.8.v20151215-133023-M3-7559aed3c5")
- * ("2.11.8", "RC4" ) -> ("2.11.8-RC4", "2.11.8-RC4", "2.11.8.v20151215-133023-RC4-7559aed3c5")
- * ("2.11.8-RC4", "SPLIT" ) -> ("2.11.8-RC4", "2.11.8-RC4", "2.11.8.v20151215-133023-RC4-7559aed3c5")
+ * ("2.11.8", "SNAPSHOT" ) -> ("2.11.8-20151215-133023-7559aed", "2.11.8-SNAPSHOT", "2.11.8.v20151215-133023-7559aed")
+ * ("2.11.8", "SHA-SNAPSHOT") -> ("2.11.8-20151215-133023-7559aed", "2.11.8-7559aed-SNAPSHOT", "2.11.8.v20151215-133023-7559aed")
+ * ("2.11.8", "SHA-NIGHTLY" ) -> ("2.11.8-7559aed-nightly", "2.11.8-7559aed-nightly", "2.11.8.v20151215-133023-NIGHTLY-7559aed")
+ * ("2.11.8", "" ) -> ("2.11.8", "2.11.8", "2.11.8.v20151215-133023-VFINAL-7559aed")
+ * ("2.11.8", "M3" ) -> ("2.11.8-M3", "2.11.8-M3", "2.11.8.v20151215-133023-M3-7559aed")
+ * ("2.11.8", "RC4" ) -> ("2.11.8-RC4", "2.11.8-RC4", "2.11.8.v20151215-133023-RC4-7559aed")
+ * ("2.11.8-RC4", "SPLIT" ) -> ("2.11.8-RC4", "2.11.8-RC4", "2.11.8.v20151215-133023-RC4-7559aed")
*
* A `baseVersionSuffix` of "SNAPSHOT" is the default, which is used for local snapshot builds. The PR validation
- * job uses "SHA-SNAPSHOT". An empty suffix is used for releases. All other suffix values are treated as RC /
- * milestone builds. The special suffix value "SPLIT" is used to split the real suffix off from `baseVersion`
- * instead and then apply the usual logic. */
+ * job uses "SHA-SNAPSHOT". A proper version number for a nightly build can be computed with "SHA-nightly". An empty
+ * suffix is used for releases. All other suffix values are treated as RC / milestone builds. The special suffix
+ * value "SPLIT" is used to split the real suffix off from `baseVersion` instead and then apply the usual logic. */
private lazy val versionPropertiesImpl: Def.Initialize[Versions] = Def.setting {
val (base, suffix) = {
@@ -76,16 +78,17 @@ object VersionUtil {
}
val date = executeTool("get-scala-commit-date")
- val sha = executeTool("get-scala-commit-sha").substring(0, 7) // The script produces 10 digits at the moment
-
- val (canonicalV, mavenV, osgiV, release) = suffix match {
- case "SNAPSHOT" => (s"$base-$date-$sha", s"$base-SNAPSHOT", s"$base.v$date-$sha", false)
- case "SHA-SNAPSHOT" => (s"$base-$date-$sha", s"$base-$sha-SNAPSHOT", s"$base.v$date-$sha", false)
- case "" => (s"$base", s"$base", s"$base.v$date-VFINAL-$sha", true)
- case suffix => (s"$base-$suffix", s"$base-$suffix", s"$base.v$date-$suffix-$sha", true)
+ val sha = executeTool("get-scala-commit-sha").substring(0, 7)
+
+ val (canonicalV, mavenSuffix, osgiV, release) = suffix match {
+ case "SNAPSHOT" => (s"$base-$date-$sha", s"-SNAPSHOT", s"$base.v$date-$sha", false)
+ case "SHA-SNAPSHOT" => (s"$base-$date-$sha", s"-$sha-SNAPSHOT", s"$base.v$date-$sha", false)
+ case "SHA-NIGHTLY" => (s"$base-$sha-nightly", s"-$sha-nightly", s"$base.v$date-NIGHTLY-$sha", true)
+ case "" => (s"$base", "", s"$base.v$date-VFINAL-$sha", true)
+ case suffix => (s"$base-$suffix", s"-$suffix", s"$base.v$date-$suffix-$sha", true)
}
- Versions(canonicalV, mavenV, osgiV, sha, date, release)
+ Versions(canonicalV, base, mavenSuffix, osgiV, sha, date, release)
}
private lazy val generateVersionPropertiesFileImpl: Def.Initialize[Task[File]] = Def.task {
@@ -94,7 +97,11 @@ object VersionUtil {
}
private lazy val generateBuildCharacterPropertiesFileImpl: Def.Initialize[Task[File]] = Def.task {
- writeProps(versionProperties.value.toMap ++ versionProps, (baseDirectory in ThisBuild).value / "buildcharacter.properties")
+ val v = versionProperties.value
+ writeProps(v.toMap ++ versionProps ++ Map(
+ "maven.version.base" -> v.mavenBase,
+ "maven.version.suffix" -> v.mavenSuffix
+ ), (baseDirectory in ThisBuild).value / "buildcharacter.properties")
}
private def writeProps(m: Map[String, String], propFile: File): File = {
diff --git a/scripts/jobs/integrate/bootstrap b/scripts/jobs/integrate/bootstrap
index 86ba67bd8b..bd509061b7 100644
--- a/scripts/jobs/integrate/bootstrap
+++ b/scripts/jobs/integrate/bootstrap
@@ -327,9 +327,10 @@ determineScalaVersion() {
if [ -z "$scalaTag" ]
then
echo "No tag found, building nightly snapshot."
- parseScalaProperties "build.number"
- SCALA_VER_BASE="$version_major.$version_minor.$version_patch"
- SCALA_VER_SUFFIX="-$(git rev-parse --short HEAD)-nightly"
+ $SBT_CMD $sbtArgs 'set baseVersionSuffix in Global := "SHA-NIGHTLY"' generateBuildCharacterPropertiesFile
+ parseScalaProperties "buildcharacter.properties"
+ SCALA_VER_BASE="$maven_version_base"
+ SCALA_VER_SUFFIX="$maven_version_suffix"
SCALADOC_SOURCE_LINKS_VER=$(git rev-parse HEAD)
# TODO: publish nightly snapshot using this script - currently it's a separate jenkins job still running at EPFL.
@@ -540,7 +541,7 @@ bootstrap() {
dist/mkQuick
mv build/quick build/strap
mv quick1 build/quick
- tools/stability-test.sh
+ $scriptsDir/stability-test.sh
# TODO: create PR with following commit (note that release will have been tagged already)
# git commit versions.properties -m"Bump versions.properties for $SCALA_VER."
diff --git a/tools/stability-test.sh b/scripts/stability-test.sh
index f017ac0842..f017ac0842 100755..100644
--- a/tools/stability-test.sh
+++ b/scripts/stability-test.sh
diff --git a/test/partest b/test/partest
index 07a5de12af..d74176aa8a 100755
--- a/test/partest
+++ b/test/partest
@@ -28,7 +28,7 @@ findScalaHome () {
# that runs this script. I don't know why. it may have to do with
# which bash flags are set (-e? -x?) and with bash flags propagating
# from one script to another? not sure. anyway, normally in a CI
-# context we run partest through ant, not through this script, so I'm
+# context we run partest through sbt, not through this script, so I'm
# not investigating further for now.)
term_colors=$(tput colors 2>/dev/null)
if [[ $? == 0 ]] && [[ $term_colors -gt 2 ]]; then
@@ -54,14 +54,14 @@ if $cygwin; then
SCALA_HOME=`cygpath --unix "$SCALA_HOME"`
fi
-# Let ant construct the classpath used to run partest (downloading partest from maven if necessary)
+# Let sbt construct the classpath used to run partest (downloading partest from maven if necessary)
# PARTEST_CLASSPATH=""
if [ -z "$PARTEST_CLASSPATH" ] ; then
- if [ ! -f "$SCALA_HOME/build/pack/partest.properties" ] ; then
- (cd "$SCALA_HOME" && ant -q test.suite.init) # builds pack, downloads partest and writes classpath to build/pack/partest.properties
+ if [ ! -f "$SCALA_HOME/build/quick/partest.properties" ] ; then
+ (cd "$SCALA_HOME" && sbt dist/mkQuick) # builds quick, downloads partest and writes classpath to build/quick/partest.properties
fi
- PARTEST_CLASSPATH=$( cat "$SCALA_HOME/build/pack/partest.properties" | grep partest.classpath | sed -e 's/\\:/:/g' | cut -f2- -d= )
+ PARTEST_CLASSPATH=$( cat "$SCALA_HOME/build/quick/partest.properties" | grep partest.classpath | sed -e 's/\\:/:/g' | cut -f2- -d= )
# sanity check, disabled to save time
# $( javap -classpath $PARTEST_CLASSPATH scala.tools.partest.nest.NestRunner &> /dev/null ) || unset PARTEST_CLASSPATH
@@ -126,7 +126,7 @@ fi
# supplied argument will be used.
JAVA_OPTS="-Xmx1024M -Xms64M $JAVA_OPTS"
-# the ant task doesn't supply any options by default,
+# the sbt task doesn't supply any options by default,
# so don't do that here either -- note that you may want to pass -optimise
# to mimic what happens during nightlies.
# [ -n "$SCALAC_OPTS" ] || SCALAC_OPTS="-deprecation"
diff --git a/tools/scaladoc-diff b/tools/scaladoc-diff
index df0d1f3335..1003b3dc02 100755
--- a/tools/scaladoc-diff
+++ b/tools/scaladoc-diff
@@ -49,7 +49,7 @@ if [ ! -f "build/scaladoc-output-$oldsha.txt" ]
then
echo "making scaladoc for parent commit ($oldsha)"
git checkout -q $oldsha
- ant docs.lib -Dscaladoc.raw.output='yes' > build/scaladoc-output-$oldsha.txt
+ sbt 'set scalacOptions in Compile in doc in library += "-raw-output"' library/doc > build/scaladoc-output-$oldsha.txt
rm -rf build/scaladoc-${oldsha}
mv build/scaladoc build/scaladoc-${oldsha}
git checkout -q $sha
@@ -57,7 +57,7 @@ fi
# create scaladoc for current commit
echo "making scaladoc for current commit ($sha)"
-ant docs.lib -Dscaladoc.raw.output='yes' > build/scaladoc-output-$sha.txt
+sbt 'set scalacOptions in Compile in doc in library += "-raw-output"' library/doc > build/scaladoc-output-$sha.txt
rm -rf build/scaladoc-${sha}
mv build/scaladoc build/scaladoc-${sha}