From b1b54751cd4d96c102110bdbb512c729d1f618a5 Mon Sep 17 00:00:00 2001 From: Stefan Zeiger Date: Wed, 16 Dec 2015 10:28:03 -0800 Subject: Use sbt for PR validation builds. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit # Improve version handling in the sbt build: The new settings `baseVersion` and `baseVersionSuffix` make it easier to set version numbers for different kinds of builds in a consistent way without e.g. having to first get a git SHA outside of sbt. The new task `generateBuildCharacterPropertiesFile` writes the file `buildcharacter.properties` to the root dir. The format is compatible with the same file produced by the ANT build but it only contains a subset of the properties, in particular the Maven version, which is needed in publishing scripts and passed around between different Jenkins jobs as `jenkins.properties`. SHAs in version numbers are consistently shortened to 7 digits (as used by git and github). Previously we used 7 digits in Maven snapshot version numbers but 10 digits in canonical and OSGi version numbers. # Add Jenkins script support to the sbt build: The new command `setupPublishCore` takes the PR validation snapshot repository as an argument and changes the required settings for the `publish-core` build (use SHA-SNAPSHOT versioning, compile with optimization enabled, do not publish scaladoc sets) For example, the following command can be used to generate `buildcharacter.properties` with the version numbers needed for PR validation builds: sbt setupPublishCore dummy generateBuildCharacterPropertiesFile The sbt build will now automatically detect and use a “~/.credentials” file with the credentials for publishing to a remote repository. # Call sbt from `publish-core`: The correct`$SBT_CMD` is set directly in `bootstrap` and used by `publish-core` to first generate `buildcharacter.properties` and then build and publish. Parsing the git revision, computing a version number and getting binary dependencies are no longer required in the script. This is all done in the sbt build. --- scripts/common | 3 +++ 1 file changed, 3 insertions(+) (limited to 'scripts/common') diff --git a/scripts/common b/scripts/common index b075469379..35199992bc 100644 --- a/scripts/common +++ b/scripts/common @@ -18,6 +18,9 @@ IVY_CACHE="$WORKSPACE/.ivy2" mkdir -p $IVY_CACHE rm -rf $IVY_CACHE/cache/org.scala-lang +SBT_CMD=${sbtCmd-sbt} +SBT_CMD="$SBT_CMD -sbt-version 0.13.9" + # temp dir where all 'non-build' operation are performed TMP_ROOT_DIR=$(mktemp -d -t pr-scala.XXXX) TMP_DIR="${TMP_ROOT_DIR}/tmp" -- cgit v1.2.3