diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2016-07-22 18:19:45 +0200 |
---|---|---|
committer | Stefan Zeiger <szeiger@novocode.com> | 2016-08-23 16:05:06 +0200 |
commit | e2b6c7b608b82fca5343f6d09236c2b48b5d824d (patch) | |
tree | 3f3b8b6b0261bf5170143147047a2fa791bf1312 /project | |
parent | 74702078b14ccba1710dd714c1723bef879c46a0 (diff) | |
download | scala-e2b6c7b608b82fca5343f6d09236c2b48b5d824d.tar.gz scala-e2b6c7b608b82fca5343f6d09236c2b48b5d824d.tar.bz2 scala-e2b6c7b608b82fca5343f6d09236c2b48b5d824d.zip |
Switch remaining uses of ant over to sbt
- Modify `tools/scaladoc-diff` to use sbt instead of ant.
- Move `stability-test.sh` from `tools` to `scripts`. With the new
build process without separate `locker` and `strap` stages, it doesn’t
make sense to call this script without first setting up the proper
test environment in a CI build.
- Replace the use of `build.number` in `bootstrap` with a new
`SHA-NIGHTLY` mode for `baseVersionSuffix`.
- Make `partest` call sbt instead of ant for initializing the classpath
and use the new classpath location (`quick` instead of `pack`).
Diffstat (limited to 'project')
-rw-r--r-- | project/VersionUtil.scala | 45 |
1 files changed, 26 insertions, 19 deletions
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 = { |