You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2011/12/31 02:53:30 UTC

svn commit: r1226021 - in /pivot/infra/bin: create-release.sh setup-environment-sample.sh

Author: smartini
Date: Sat Dec 31 01:53:29 2011
New Revision: 1226021

URL: http://svn.apache.org/viewvc?rev=1226021&view=rev
Log:
Update Release build file, and add sample setup for environment variables

Added:
    pivot/infra/bin/setup-environment-sample.sh   (with props)
Modified:
    pivot/infra/bin/create-release.sh

Modified: pivot/infra/bin/create-release.sh
URL: http://svn.apache.org/viewvc/pivot/infra/bin/create-release.sh?rev=1226021&r1=1226020&r2=1226021&view=diff
==============================================================================
--- pivot/infra/bin/create-release.sh (original)
+++ pivot/infra/bin/create-release.sh Sat Dec 31 01:53:29 2011
@@ -65,21 +65,65 @@ create_project_bundle() {
 }
 
 create_release() {
-    ## TODO Check existence of JAVA_HOME
+    ## Check existence of JAVA_HOME
+    if [ -z "$JAVA_HOME" ]; then
+        echo "error, must specify a value for JAVA_HOME"
+        echo "Build failed"
+        echo
+        exit 1
+    else
+        echo "using this as JAVA_HOME: $JAVA_HOME"
+    fi
 
-    ## TODO Check existence of RAT_LIB
+    ## Check existence of RAT_LIB
+    if [ -z "$RAT_LIB" ]; then
+        echo "error, must specify a value for RAT_LIB"
+        echo "Build failed"
+        echo
+        exit 1
+    else
+        echo "using this as RAT_LIB: $RAT_LIB"
+    fi
 
-    ## TODO Check that we're in the right folder
+    ## Check that we're in the right folder, the trunk folder
+    if [ -e './build.xml' ]; then
+        echo "the ant build file exists in the current folder"
+    else
+        echo "error, the ant build file does not exist in the current folder"
+        echo "Build failed"
+        echo
+        exit 1
+    fi
 
-    ## TODO Check for conflicting release.tar.gz
-    rm -f release.tar.gz
+    ## Check for conflicting release.tar.gz
+    # rm -f release.tar.gz
+    if [ -e './release.tar.gz' ]; then
+        echo "error, a previous release artifact exists"
+        echo "Build failed"
+        echo
+        exit 1
+    fi
 
     ## Location where we'll store the artifacts
-    tmp="/tmp/$(basename $0).$$.tmp"
+    tmp="$TEMP_DIR/$(basename $0).$$.tmp"
 
-    ## TODO Check for existing tmp dir
+    ## Check for existing tmp dir
+    if [ ! -d "$TEMP_DIR" ]; then
+        echo "error, a temp folder does not exists"
+        echo "Build failed"
+        echo
+        exit 1
+    fi
 
-    ## TODO test that GPG keys are set up
+    ## test that GPG keys are set up
+    if [ -z "gpg --list-keys $GPG_KEY_EMAIL" ]; then
+        echo "error, must set a GPG Key for the mail address set"
+        echo "Build failed"
+        echo
+        exit 1
+    else
+        echo "using the GPG Key associated to this mail address: $GPG_KEY_EMAIL"
+    fi
 
     ## Get the GPG passphrase
     printf "Enter GPG passphrase: "

Added: pivot/infra/bin/setup-environment-sample.sh
URL: http://svn.apache.org/viewvc/pivot/infra/bin/setup-environment-sample.sh?rev=1226021&view=auto
==============================================================================
--- pivot/infra/bin/setup-environment-sample.sh (added)
+++ pivot/infra/bin/setup-environment-sample.sh Sat Dec 31 01:53:29 2011
@@ -0,0 +1,71 @@
+#!/bin/bash
+###
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to you 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.
+###
+
+# Sample Shell script to show the right setup 
+# of environment variables needed to run the create-release.sh script,
+# dependent to folders of the PC where this script is run.
+
+export TEMP_DIR=/tmp
+export OPT=/opt
+
+export ANT_HOME=$OPT/apache-ant-1.8.1
+export JAVA_HOME=$OPT/jdk1.6.0_30
+export MAVEN_HOME=$OPT/apache-maven-2.2.1
+# export MAVEN_HOME=$OPT/apache-maven-3.0.3
+
+export JAVALIB_DIR=$OPT/javalib
+
+export JUNIT_LIB=$JAVALIB_DIR/junit-4.8.2.jar
+export MAVEN_ANT_TASKS_LIB=$JAVALIB_DIR/maven-ant-tasks-2.1.3.jar
+export RAT_LIB=$JAVALIB_DIR/apache-rat-0.8.jar
+
+export GPG_KEY_EMAIL=smartini@apache.org
+
+
+# Setup CLASSPATH
+export CLASSPATH=.
+export CLASSPATH=$CLASSPATH:$JUNIT_LIB
+export CLASSPATH=$CLASSPATH:$MAVEN_ANT_TASKS_LIB
+export CLASSPATH=$CLASSPATH:$RAT_LIB
+
+# export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib/tools.jar
+# export CLASSPATH=$CLASSPATH:$JAVA_HOME/jre/lib/javaws.jar
+# export CLASSPATH=$CLASSPATH:$JAVA_HOME/jre/lib/plugin.jar
+
+
+# Setup PATH
+export PATH=$JAVA_HOME/bin:$ANT_HOME/bin:$MAVEN_HOME/bin:$PATH
+
+
+# Show current settings
+printf "Show current settings, CLASSPATH:\n%s \n" $CLASSPATH
+printf "Show current settings, PATH:\n%s \n" $PATH
+
+printf "Show current settings, GPG_KEY_EMAIL:\n%s \n" $GPG_KEY_EMAIL
+
+
+# Verify that Java (from a JDK) is in PATH
+java -version
+
+# Verify that Ant is in PATH
+ant -version
+
+# Verify that Maven is in PATH
+mvn -version
+
+

Propchange: pivot/infra/bin/setup-environment-sample.sh
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: pivot/infra/bin/setup-environment-sample.sh
------------------------------------------------------------------------------
    svn:executable = *