Changeset 1705
- Timestamp:
- 2010-09-08 12:51:06 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/restlet-dependency/make_restlet4kauri.sh
r1698 r1705 1 1 #!/bin/bash 2 # 3 # environment variables you can set before running this 4 # DIR - should point to the directory holding the restlet-svn checkout to build 5 # if omitted the script will create a new checkout directory for each version it is building 6 # TAG - should indicate the revision name to use 7 # if omitted the script will assign a tag based on the current restlet-repo-revision number: svn{revision} 8 # note these are intended to optimise the use in the hudson context at ci.outerthought.org 9 # when ran locally you should typically let the script assign DIR and TAG 10 # 2 11 3 12 ME=$(basename ${0}); … … 5 14 NAME="restlet"; 6 15 SVN_TRUNK_URI="http://restlet.tigris.org/svn/restlet/trunk"; 7 BUILD_PARAMS= "-Dverify=false"; #unsafe build - clear to run tests!16 BUILD_PARAMS=${BUILD_PARAMS:-}; # to skip tests use BUILD_PARAMS="-Dverify=false" 8 17 JDK_VERSION_TEST="java version \"1.5"; 9 18 10 echo "-- ${ME} -- Check JDK version "; 11 JAVA_CMD="$(which java)"; 12 if [[ -x ${JAVA_HOME}/bin/java ]] ; then 13 JAVA_CMD="${JAVA_HOME}/bin/java"; 19 20 if [[ ! -d ${DIR} ]] ; then 21 echo "-- ${ME} -- Check JDK version "; 22 JAVA_CMD="$(which java)"; 23 if [[ -x ${JAVA_HOME}/bin/java ]] ; then 24 JAVA_CMD="${JAVA_HOME}/bin/java"; 25 fi 26 CHECK=$(${JAVA_CMD} -version 2>&1| grep "${JDK_VERSION_TEST}"); 27 28 if [[ "${CHECK}" = "" ]] ; then 29 echo "Java JDK version does not match <<${JDK_VERSION_TEST}>>"; 30 exit 1; 31 fi 32 33 echo "-- ${ME} -- Retrieving current trunk revision number "; 34 REVISION=$(svn info ${SVN_TRUNK_URI} |grep Revision|sed -e "s/Revision: //"); 35 TAG="svn${REVISION}"; 36 37 SVN_REV_URI="${SVN_TRUNK_URI}@${REVISION}"; 38 DIR="${NAME}-${TAG}"; 39 echo "-- ${ME} -- Export current trunk revision to ./${DIR}"; 40 svn export ${SVN_REV_URI} ${DIR}; 41 else 42 TAG=${TAG:-TEMP_OVERWRITE}; 14 43 fi 15 CHECK=$(${JAVA_CMD} -version 2>&1| grep "${JDK_VERSION_TEST}");16 17 if [[ "${CHECK}" = "" ]] ; then18 echo "Java JDK version does not match <<${JDK_VERSION_TEST}>>";19 exit 1;20 fi21 22 23 echo "-- ${ME} -- Retrieving current trunk revision number ";24 REVISION=$(svn info ${SVN_TRUNK_URI} |grep Revision|sed -e "s/Revision: //");25 26 27 SVN_REV_URI="${SVN_TRUNK_URI}@${REVISION}";28 DIR="${NAME}-r${REVISION}";29 echo "-- ${ME} -- Export current trunk revision to ./${DIR}";30 svn export ${SVN_REV_URI} ${DIR};31 44 32 45 … … 34 47 echo "-- ${ME} -- Generate custom build props to ./${PROPS}"; 35 48 cat <<-EOF > ${PROPS} 36 # Custom Kauri-friendly build properties - generated for r${REVISION}49 # Custom Kauri-friendly build properties - generated for ${TAG} 37 50 # ------------------------------------------------------------------- 38 51 # Used only for the maven distribution 39 suffix-maven: - svn${REVISION}40 version-maven: svn${REVISION}52 suffix-maven: -${TAG} 53 version-maven: ${TAG} 41 54 # Indicates if the Maven distribution should be regenerated. 42 55 maven: true … … 52 65 cd ${DIR}/build; 53 66 ant rebuild ${BUILD_PARAMS}; 54 SUCCESS=$?; 67 SUCCESS=$?; #helas ant reports suucessful builds with warnings as != 0 55 68 cd -; 56 69 57 70 58 71 echo "-- ${ME} -- Grab Maven2 Artifacts."; 59 M2_TGZ="restlet-${ REVISION}-m2.tgz";72 M2_TGZ="restlet-${TAG}-m2.tgz"; 60 73 M2_DIST="${DIR}/build/dist/maven2"; 61 74 DISTNAME="$(ls -1 ${M2_DIST} | head -1)"; … … 74 87 75 88 76 echo "-- ${ME} -- Done building restlet-${REVISION}"; 77 78 # TODO maybe something to clean/remove old builds (not the current one: as that is useful sometimes to have around) - maybe do it at the start then (easier) 89 echo "-- ${ME} -- Done building restlet-${TAG}";
Note: See TracChangeset
for help on using the changeset viewer.