diff options
author | Jean-Marie Henaff <jmhenaff@google.com> | 2015-06-23 13:54:03 +0200 |
---|---|---|
committer | Jean-Marie Henaff <jmhenaff@google.com> | 2015-06-25 11:20:50 +0200 |
commit | dce5a4a097596892f3d23a048f52295be80989a1 (patch) | |
tree | ec68a9f6ce8796ca217cf840c7be7b3d6ffa8995 | |
parent | d0dbb08d4c1e393d6d7c17bbb19d7d8d98c80ec7 (diff) | |
download | toolchain_jack-dce5a4a097596892f3d23a048f52295be80989a1.zip toolchain_jack-dce5a4a097596892f3d23a048f52295be80989a1.tar.gz toolchain_jack-dce5a4a097596892f3d23a048f52295be80989a1.tar.bz2 |
Add version update in property files and scripts in build.xml
- Use jack-version.properties and package it in distributed jars.
- Use -Ddist.sha and -Ddist.build-id to set SHA and build ID in
those property files before packaging.
Change-Id: I5b2dd1ed4fdf01e77653e2338ce5a5c803d22e70
(cherry picked from commit 60efcff894d18d00c1eb71ba6aa8cd161001b451)
-rw-r--r-- | build.xml | 58 | ||||
-rwxr-xr-x | jack/etc/jack | 2 | ||||
-rwxr-xr-x | jack/etc/jack-admin | 2 | ||||
-rw-r--r-- | jack/rsc/jack.properties | 24 | ||||
-rw-r--r-- | jack/src/com/android/jack/Jack.java | 2 | ||||
-rw-r--r-- | jack/src/com/android/jack/Version.java | 16 | ||||
-rw-r--r-- | version.properties (renamed from jack-launcher/rsc/jack-launcher-version.properties) | 0 |
7 files changed, 65 insertions, 39 deletions
@@ -106,7 +106,15 @@ <delete dir="${jack-top-dist.dir}"/> </target> - <target name="dist" depends="jack, + <target name="dist-check"> + <fail message="jack.dist.sha is undefined" unless="dist.sha" /> + <fail message="jack.dist.build-id is undefined" unless="dist.build-id" /> + </target> + + <target name="dist" + description="package a Jack distribution" depends=" + dist-check, + jack, jack-api, jack-api-src, jack-annotations-lib, @@ -123,8 +131,52 @@ <file name="${jack.dist.dir}/${jack-annotations.libname}" /> </filelist> </copy> + + <mkdir dir="${jack-top-dist.dir}/tmp"/> + + <property file="${jack-project.dir}/version.properties"/> + + <copy file="${jack-project.dir}/version.properties" tofile="${jack-top-dist.dir}/tmp/version.properties"/> + <propertyfile file="${jack-top-dist.dir}/tmp/version.properties"> + <entry key="version.sha" value="${dist.sha}"/> + <entry key="version.buildid" value="${dist.build-id}"/> + </propertyfile> + + <copy file="${jack-top-dist.dir}/tmp/version.properties" tofile="${jack-top-dist.dir}/tmp/jack-version.properties"/> + <jar destfile="${jack-top-dist.dir}/${jack.execname}" update="true" + basedir="${jack-top-dist.dir}/tmp" + includes="jack-version.properties"/> + + <copy file="${jack-top-dist.dir}/tmp/version.properties" tofile="${jack-top-dist.dir}/tmp/jack-api-version.properties"/> + <jar destfile="${jack-top-dist.dir}/${jack-api.name}" update="true" + basedir="${jack-top-dist.dir}/tmp" + includes="jack-api-version.properties"/> + + <copy file="${jack-top-dist.dir}/tmp/version.properties" tofile="${jack-top-dist.dir}/tmp/jack-launcher-version.properties"/> + <jar destfile="${jack-top-dist.dir}/${jack-launcher.name}" update="true" + basedir="${jack-top-dist.dir}/tmp" + includes="jack-launcher-version.properties"/> + + <copy file="${jack-top-dist.dir}/tmp/version.properties" tofile="${jack-top-dist.dir}/tmp/jack-annotations-version.properties"/> + <jar destfile="${jack-top-dist.dir}/${jack-annotations.libname}" update="true" + basedir="${jack-top-dist.dir}/tmp" + includes="jack-annotations-version.properties"/> + + <replace file="${jack-top-dist.dir}/jack" + token="%%VERSION%%" + value="${version}" + encoding="UTF-8"/> + + <replace file="${jack-top-dist.dir}/jack-admin" + token="%%VERSION%%" + value="${version}" + encoding="UTF-8"/> + + <delete dir="${jack-top-dist.dir}/tmp"/> + </target> + <!-- ******************* --> <!-- Jack-lib --> <!-- ******************* --> @@ -262,6 +314,7 @@ <copy todir="${jack.build.outdir}"> <fileset dir="${jack.dir}/rsc" includes="**"/> </copy> + <copy file="${jack-project.dir}/version.properties" tofile="${jack.build.outdir}/jack-version.properties"/> <jar destfile="${jack.dist.dir}/${jack.libname}" basedir="${jack.build.outdir}" includes="**"/> </target> @@ -468,9 +521,6 @@ </classpath> </javac> <unzip dest="${jack-launcher.build.outdir}" src="${jack-launcher.libs.dir}/${jsr305.libname}" /> - <copy todir="${jack-launcher.build.outdir}"> - <fileset dir="${jack-launcher.dir}/rsc" includes="**"/> - </copy> <jar destfile="${jack-launcher.dist.dir}/${jack-launcher.name}" manifest="${jack-launcher.dir}/etc/manifest.txt"> <fileset dir="${jack-launcher.build.outdir}"/> </jar> diff --git a/jack/etc/jack b/jack/etc/jack index 7cbe449..c3215d5 100755 --- a/jack/etc/jack +++ b/jack/etc/jack @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# v 1.1-rc5 +# Version: %%VERSION%% # set -o nounset umask 077 diff --git a/jack/etc/jack-admin b/jack/etc/jack-admin index 4377fb9..0d7e2ce 100755 --- a/jack/etc/jack-admin +++ b/jack/etc/jack-admin @@ -14,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # -# v 1.1-rc5 +# Version: %%VERSION%% # set -o nounset umask 077 diff --git a/jack/rsc/jack.properties b/jack/rsc/jack.properties deleted file mode 100644 index 87381a3..0000000 --- a/jack/rsc/jack.properties +++ /dev/null @@ -1,24 +0,0 @@ -# -# Copyright (C) 2014 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -jack.version=1.1-rc5 -jack.version.release.name=Brest -jack.version.release.code=2 -jack.version.sub-release.kind=CANDIDATE -jack.version.sub-release.code=18 - -# These properties are added by the release step -# jack.version.buildid=<BUILDID> -# jack.version.sha=<SHA> diff --git a/jack/src/com/android/jack/Jack.java b/jack/src/com/android/jack/Jack.java index 1a1c247..d96c71a 100644 --- a/jack/src/com/android/jack/Jack.java +++ b/jack/src/com/android/jack/Jack.java @@ -1258,7 +1258,7 @@ public abstract class Jack { } @Nonnull - private static final String PROPERTIES_FILE = "jack.properties"; + private static final String PROPERTIES_FILE = "jack-version.properties"; @CheckForNull private static Version version = null; diff --git a/jack/src/com/android/jack/Version.java b/jack/src/com/android/jack/Version.java index 8224011..f53a3af 100644 --- a/jack/src/com/android/jack/Version.java +++ b/jack/src/com/android/jack/Version.java @@ -55,23 +55,23 @@ public class Version { try { prop.load(is); - version = prop.getProperty("jack.version"); + version = prop.getProperty("version"); assert version != null; - releaseName = prop.getProperty("jack.version.release.name"); + releaseName = prop.getProperty("version.release.name"); assert releaseName != null; - releaseCode = Integer.parseInt(prop.getProperty("jack.version.release.code")); + releaseCode = Integer.parseInt(prop.getProperty("version.release.code")); assert releaseCode >= 1; - subReleaseCode = Integer.parseInt(prop.getProperty("jack.version.sub-release.code")); - assert subReleaseCode >= 1; + subReleaseCode = Integer.parseInt(prop.getProperty("version.sub-release.code")); + assert subReleaseCode >= 0; subReleaseKind = SubReleaseKind.valueOf(SubReleaseKind.class, - prop.getProperty("jack.version.sub-release.kind")); - buildId = prop.getProperty("jack.version.buildid"); - codeBase = prop.getProperty("jack.version.sha"); + prop.getProperty("version.sub-release.kind")); + buildId = prop.getProperty("version.buildid"); + codeBase = prop.getProperty("version.sha"); if (codeBase == null || buildId == null) { subReleaseKind = SubReleaseKind.ENGINEERING; diff --git a/jack-launcher/rsc/jack-launcher-version.properties b/version.properties index a496ad2..a496ad2 100644 --- a/jack-launcher/rsc/jack-launcher-version.properties +++ b/version.properties |