[openrtm-commit:00952] r393 - in trunk/rtmtools: . sitetool
openrtm @ openrtm.org
openrtm @ openrtm.org
2013年 1月 29日 (火) 14:42:50 JST
Author: n-ando
Date: 2013-01-29 14:42:49 +0900 (Tue, 29 Jan 2013)
New Revision: 393
Added:
trunk/rtmtools/build_all
trunk/rtmtools/build_features
trunk/rtmtools/build_plugins
Removed:
trunk/rtmtools/buildall.sh
trunk/rtmtools/sitetool/run.sh
Modified:
trunk/rtmtools/sitetool/build.xml
Log:
Build plugins/features systems have been updated. Now build_plugins/build_features/build_all script-set should be used.
Copied: trunk/rtmtools/build_all (from rev 390, trunk/rtmtools/buildall.sh)
===================================================================
--- trunk/rtmtools/build_all (rev 0)
+++ trunk/rtmtools/build_all 2013-01-29 05:42:49 UTC (rev 393)
@@ -0,0 +1,248 @@
+#!/bin/sh
+#
+# @file buildall.sh
+# @brief rtmtools build script
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#
+# update:
+# cerate:Sep/11/2008
+#
+# * How to build rtmtools
+#
+# ** Required environment
+#
+# The following development environment and tools are required to
+# build rtmtools.
+#
+# - jdk
+# - ant
+# - Eclipse SDK (3.4 or later is required.)
+#
+# ** Before build tools
+#
+# Please edit "version" text to set version number of the tools. This
+# is a kind of bash script.
+#
+# Example:
+# -------
+# VERSION=1.1.0
+# PROJECT_VERSION=${VERSION}.rc7v$(date +%Y%m%d)
+#
+# ** Environment variables
+#
+# To build rtmtools, some environmental variables can be set. In most
+# case, these variables are automatically set.
+#
+# - ECLIPSE_HOME: A directory path to an Eclipse SDK. Under this
+# directory, .eclipseproduct, eclipse.ini, plugins and
+# eclipse executable should exist. If this
+# env.variable is not set, this script tries to search
+# eclipse directory under some directories that is set
+# in a env.variable ECLIPSE_DIRS written in the head
+# of this script.
+#
+# - JAVA_HOME: A directory JDK installed. If this variable is not set,
+# this script tries to estimate JDK directory to
+# resolve symbolic link of javac executable.
+#
+# - VERSION: A simple version number for the tools like 1.1.1. This is
+# used for actual bundles' version number with
+# PROJECT_VERSION number.
+#
+# - PROJECT_VERSION: Project version number is full version string
+# with simple version and suffix like
+# rc120121212. This version string is used actual jar
+# file name.
+#
+# - JARDIR: A directory to store jar files. Default directory is "jar".
+# This directory is temporary jar files store place.
+#
+# - DISTDIR: A directory to be archived for distribution package.
+# This directory name becomes archive package name.
+# Default name is openrtm-x.y.z. x, y, z are version
+# number which is defined in version text file.
+#
+
+
+#---------------------------------------------------------------------------
+# Global variables
+#---------------------------------------------------------------------------
+
+# Default build taget
+TARGET="buildAll"
+
+# Default
+JARDIR_DEFAULT="jar"
+
+# target projects
+PROJECTS="jp.go.aist.rtm.toolscommon.profiles
+ jp.go.aist.rtm.toolscommon.profiles.nl1
+ jp.go.aist.rtm.toolscommon
+ jp.go.aist.rtm.toolscommon.nl1
+ jp.go.aist.rtm.rtcbuilder
+ jp.go.aist.rtm.rtcbuilder.nl1
+ jp.go.aist.rtm.rtcbuilder.java
+ jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.repositoryView
+ jp.go.aist.rtm.repositoryView.nl1
+ jp.go.aist.rtm.nameserviceview
+ jp.go.aist.rtm.nameserviceview.nl1
+ jp.go.aist.rtm.systemeditor
+ jp.go.aist.rtm.systemeditor.nl1"
+
+# Eclipse search directories
+ECLIPSE_DIRS="$HOME/eclipse ../ ../../ ../../ $HOME /usr/lib/ /usr/share"
+
+#============================================================
+# functions
+#============================================================
+
+#------------------------------------------------------------
+# getopt
+#
+# This function gets command line options
+# ------------------------------------------------------------
+getopt()
+{
+ if test $# = 1 ; then
+ arg=$1
+ if test "x$arg" = "xclean" ; then
+ TARGET=$1
+ return 0
+ fi
+ if test "x$arg" = "xrevert" ; then
+ echo "Reverting updated MANIFEST.MF..."
+ mf=`svn status | grep '^M' | grep MANIFEST.MF | awk '{print $2;}'`
+ for m in $mf; do
+ rm $m
+ svn update $m
+ done
+ exit 0
+ fi
+ fi
+}
+
+#------------------------------------------------------------
+# get_version
+#
+# This function gets version number and project version string
+# from version text file.
+# ------------------------------------------------------------
+get_version()
+{
+ if test "x$VERSION" = "x" || test "x$PROJECT_VERSION" = "x" ; then
+ echo "Environment variable VERSION/PROJECT_VERSION is not set."
+ echo "Getting from ./version text."
+ . ./version
+ fi
+ export VERSION
+ export PROJECT_VERSION
+
+ if test "x$DISTDIR" = "x" ; then
+ DISTDIR=openrtp-$VERSION
+ fi
+ if test "x$JARDIR" = "x" ; then
+ JARDIR=$JARDIR_DEFAULT
+ fi
+}
+
+#------------------------------------------------------------
+# find_eclipsehome
+#
+# This function checks ECLIPSE_HOME env variable and if it is
+# not set, it searches an eclipse directory under ECLIPSE_DIRS,
+# and set ECLIPSE_HOME env variable.
+# ------------------------------------------------------------
+find_eclipsehome()
+{
+ if test ! "x$ECLIPSE_HOME" = "x" ; then
+ if test -d $ECLIPSE_HOME ; then
+ return 0
+ fi
+ echo "ECLIPSE_HOME $ECLIPSE_HOME does not exist."
+ fi
+ echo "Environment variable ECLIPSE_HOME is not set. Seaching..."
+ for d in $ECLIPSE_DIRS ; do
+ tmp=`find -L $d -name .eclipseproduct`
+ if test "x$tmp" = "x" ; then
+ continue
+ fi
+ for e in $tmp ; do
+ edir=`dirname $e`
+ if test -f $edir/eclipse.ini && test -d $edir/plugins ; then
+ export ECLIPSE_HOME="$edir"
+ return 0
+ fi
+ done
+ done
+ echo "eclipse not found. Please install eclipse and set ECLIPSE_HOME."
+ exit 1
+}
+
+#------------------------------------------------------------
+# find_javahome
+#
+# This function estimate JAVA_HOME from javac, which usually
+# is a symbolic link to $JAVA_HOME/bin/javac.
+#------------------------------------------------------------
+find_javahome()
+{
+ if test ! "x$JAVA_HOME" = "x" ; then
+ if test -d $JAVA_HOME && test -f $JAVA_HOME/bin/javac ; then
+ return 0
+ fi
+ echo "JDK cannot be found under JAVA_HOME: $JAVA_HOME"
+ fi
+ echo "Valid Environment variable JAVA_HOME is not set. Searching..."
+ tmp=`readlink -e $(which javac)`
+ jdk_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$jdk_path" = "x" ; then
+ echo "JDK not found. Please install JDK and set JAVA_HOME."
+ exit 1
+ fi
+ export JAVA_HOME=$jdk_path
+ return 0
+}
+
+#==============================
+# main
+#==============================
+export LC_ALL=C
+cd `dirname $0`
+
+getopt $*
+get_version
+
+find_eclipsehome
+find_javahome
+
+if test "x$TARGET" = "xclean" ; then
+ ./build_plugins clean
+ if test $? -ne 0 ; then
+ echo "[ERROR] cleaning plugins failed. Aborting..."
+ exit 1
+ fi
+ ./build_features clean
+ if test $? -ne 0 ; then
+ echo "[ERROR] cleaning features failed. Aborting..."
+ exit 1
+ fi
+ echo "[OK] cleaning plugins/features successfully done."
+ exit 0
+else
+ ./build_plugins
+ if test $? -ne 0 ; then
+ echo "[ERROR] build plugins failed. Aborting..."
+ exit 1
+ fi
+ ./build_features
+ if test $? -ne 0 ; then
+ echo "[ERROR] build features failed. Aborting..."
+ exit 1
+ fi
+ echo "[OK] building plugins/features successfully done."
+fi
+
+exit 0
+
+# end of script
Added: trunk/rtmtools/build_features
===================================================================
--- trunk/rtmtools/build_features (rev 0)
+++ trunk/rtmtools/build_features 2013-01-29 05:42:49 UTC (rev 393)
@@ -0,0 +1,337 @@
+#!/bin/sh
+#
+# @file build_features
+# @brief rtmtools feature build script
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#
+# * How to build rtmtools
+#
+# ** Required environment
+#
+# The following development environment and tools are required to
+# build rtmtools.
+#
+# - jdk
+# - ant
+# - Eclipse SDK (3.4 or later is required.)
+#
+# ** Before build tools
+#
+# Please edit "version" text to set version number of the tools. This
+# is a kind of bash script.
+#
+# Example:
+# -------
+# VERSION=1.1.0
+# PROJECT_VERSION=${VERSION}.rc7v$(date +%Y%m%d)
+#
+# ** Environment variables
+#
+# To build rtmtools, some environmental variables can be set. In most
+# case, these variables are automatically set.
+#
+# - ECLIPSE_HOME: A directory path to an Eclipse SDK. Under this
+# directory, .eclipseproduct, eclipse.ini, plugins and
+# eclipse executable should exist. If this
+# env.variable is not set, this script tries to search
+# eclipse directory under some directories that is set
+# in a env.variable ECLIPSE_DIRS written in the head
+# of this script.
+#
+# - JAVA_HOME: A directory JDK installed. If this variable is not set,
+# this script tries to estimate JDK directory to
+# resolve symbolic link of javac executable.
+#
+# - VERSION: A simple version number for the tools like 1.1.1. This is
+# used for actual bundles' version number with
+# PROJECT_VERSION number.
+#
+# - PROJECT_VERSION: Project version number is full version string
+# with simple version and suffix like
+# rc120121212. This version string is used actual jar
+# file name.
+#
+# - JARDIR: A directory to store jar files. Default directory is "jar".
+# This directory is temporary jar files store place.
+#
+# - DISTDIR: A directory to be archived for distribution package.
+# This directory name becomes archive package name.
+# Default name is openrtm-x.y.z. x, y, z are version
+# number which is defined in version text file.
+#
+# - PLUGINS_DIR: A directory rtmtools plugins stored. Plugin versions
+# should be same as versions which obtained from
+# version text file. Usually this variable can be set
+# automatically as $JARDIR.
+#
+# - ANT_DiR: Eclipse ant plugin directory. This variable would be set
+# automatically as
+# ECLIPSE_HOME/org.apache.ant.<something>.
+#
+
+# Eclipse search directories
+ECLIPSE_DIRS="$HOME/eclipse $HOME ../ ../../ ../..//usr/lib/ /usr/share"
+
+# Ant eclipse plugin location
+ANT_HOME_DEFAULT="${ECLIPSE_HOME}/plugins/org.apache.ant_1.7.0.v200803061910/"
+
+# Default
+JARDIR_DEFAULT="jar"
+
+# target projects
+PROJECTS="jp.go.aist.rtm.toolscommon.profiles
+ jp.go.aist.rtm.toolscommon.profiles.nl1
+ jp.go.aist.rtm.toolscommon
+ jp.go.aist.rtm.toolscommon.nl1
+ jp.go.aist.rtm.rtcbuilder
+ jp.go.aist.rtm.rtcbuilder.nl1
+ jp.go.aist.rtm.rtcbuilder.java
+ jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.repositoryView
+ jp.go.aist.rtm.repositoryView.nl1
+ jp.go.aist.rtm.nameserviceview
+ jp.go.aist.rtm.nameserviceview.nl1
+ jp.go.aist.rtm.systemeditor
+ jp.go.aist.rtm.systemeditor.nl1"
+
+#============================================================
+# functions
+#============================================================
+#------------------------------------------------------------
+# getopt
+#
+# This function gets command line options
+# ------------------------------------------------------------
+getopt()
+{
+ if test $# = 1 ; then
+ arg=$1
+ if test "x$arg" = "xclean" ; then
+ TARGET=$1
+ return 0
+ fi
+ fi
+}
+
+#------------------------------------------------------------
+# get_version
+#
+# This function gets version number and project version string
+# from version text file.
+# ------------------------------------------------------------
+get_version()
+{
+ if test "x$VERSION" = "x" || test "x$PROJECT_VERSION" = "x" ; then
+ echo "Environment variable VERSION/PROJECT_VERSION is not set."
+ echo "Getting from ./version text."
+ . ./version
+ fi
+ export VERSION
+ export PROJECT_VERSION
+
+ if test "x$DISTDIR" = "x" ; then
+ DISTDIR=openrtp-$VERSION
+ fi
+ if test "x$JARDIR" = "x" ; then
+ JARDIR=$JARDIR_DEFAULT
+ fi
+}
+
+#------------------------------------------------------------
+# find_eclipsehome
+#
+# This function checks ECLIPSE_HOME env variable and if it is
+# not set, it searches an eclipse directory under ECLIPSE_DIRS,
+# and set ECLIPSE_HOME env variable.
+# ------------------------------------------------------------
+find_eclipsehome()
+{
+ if test ! "x$ECLIPSE_HOME" = "x" ; then
+ if test -d $ECLIPSE_HOME ; then
+ return 0
+ fi
+ echo "ECLIPSE_HOME $ECLIPSE_HOME does not exist."
+ fi
+ echo "Environment variable ECLIPSE_HOME is not set. Seaching..."
+ for d in $ECLIPSE_DIRS ; do
+ tmp=`find -L $d -name .eclipseproduct`
+ if test "x$tmp" = "x" ; then
+ continue
+ fi
+ for e in $tmp ; do
+ edir=`dirname $e`
+ if test -f $edir/eclipse.ini && test -d $edir/plugins ; then
+ export ECLIPSE_HOME="$edir"
+ return 0
+ fi
+ done
+ done
+ echo "eclipse not found. Please install eclipse and set ECLIPSE_HOME."
+ exit 1
+}
+
+#------------------------------------------------------------
+# find_javahome
+#
+# This function estimate JAVA_HOME from javac, which usually
+# is a symbolic link to $JAVA_HOME/bin/javac.
+#------------------------------------------------------------
+find_javahome()
+{
+ if test ! "x$JAVA_HOME" = "x" ; then
+ if test -d $JAVA_HOME && test -f $JAVA_HOME/bin/javac ; then
+ return 0
+ fi
+ echo "JDK cannot be found under JAVA_HOME: $JAVA_HOME"
+ fi
+ echo "Valid Environment variable JAVA_HOME is not set. Searching..."
+ tmp=`readlink -e $(which javac)`
+ jdk_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$jdk_path" = "x" ; then
+ echo "JDK not found. Please install JDK and set JAVA_HOME."
+ exit 1
+ fi
+ export JAVA_HOME=$jdk_path
+ return 0
+}
+
+#------------------------------------------------------------
+# find_antplugin
+#
+# This function find Eclipse's and plugin under ECLIPSE_HOME.
+#------------------------------------------------------------
+find_antplugin()
+{
+ if test ! "x$ANT_HOME" = "x" ; then
+ echo "ANT_HOME: $ANT_HOME is set."
+ if test -d $ANT_HOME ; then
+ echo "ANT_HOME: $ANT_HOME exists. Contents are the following."
+ ls $ANT_HOME
+ return 0
+ fi
+ echo "ANT_HOME directory $ANT_HOME not found. Searching other Ant..."
+ else
+ echo "Environment variable ANT_HOME does not exist. Searching..."
+ fi
+
+ other_ant=`find $ECLIPSE_HOME/plugins -maxdepth 1 -type d -name 'org.apache.ant*'`
+ echo "Found: $other_ant"
+ if test "x$other_ant" = "x" ; then
+ echo "Ant plugin was not found."
+ echo "Please install eclipse with ant plugin such as org.apache.ant.*"
+ echo "Aborting."
+ return 1
+ fi
+ for a in $other_ant ; do
+ ANT_HOME=$other_ant
+ echo "ANT_HOME: $ANT_HOME is set."
+ return 0
+ done
+}
+
+#------------------------------------------------------------
+# check_plugins
+#------------------------------------------------------------
+check_plugins()
+{
+ if test ! "x$PLUGINS_DIR" = "x" ; then
+ JARDIR=$PLUGINS_DIR
+ fi
+ echo "Checking plugin jar files..."
+ for p in $PROJECTS ; do
+ tmp="${p}_${PROJECT_VERSION}.jar"
+ if test ! -f `pwd`/$JARDIR/$tmp ; then
+ echo "[ERROR] $tmp not found"
+ echo "Please build plugins at first."
+ exit 1
+ fi
+ echo "[OK] $tmp found"
+ done
+ PLUGINS_DIR=`pwd`/$JARDIR
+ echo "PLUGINS_DIR: $JARDIR is set."
+ return 0
+}
+
+#------------------------------------------------------------
+# build_features
+#
+# Building features:
+# - copying plugins
+# - signing plugins
+# - building features
+# - copying features
+#------------------------------------------------------------
+build_features()
+{
+ echo "Getting plugins (get.plugins)"
+ ant -lib lib get.plugins
+ if test $? -ne 0 ; then
+ echo "Error in get.plugins target. Aborting..."
+ exit 1
+ fi
+
+ echo "Signing features (feature.sign.gen)"
+ ant -lib lib feature.sign.gen
+ if test $? -ne 0 ; then
+ echo "Error in feature.sign.gen target. Aborting..."
+ exit 1
+ fi
+
+ echo "Building features (build.features)"
+ ant -lib lib build.features
+ if test $? -ne 0 ; then
+ echo "Error in build.features target. Aborting..."
+ exit 1
+ fi
+
+ echo "Deploying features to site (deploy.site)"
+ ant -lib lib deploy.site
+ if test $? -ne 0 ; then
+ echo "Error in deploy.site target. Aborting..."
+ exit 1
+ fi
+}
+
+clean_features()
+{
+ echo "Cleaning features."
+ ant -lib lib clean
+ if test $? -ne 0 ; then
+ echo "Cleaning features failed. Aborting..."
+ exit 1
+ fi
+ return 0
+}
+#==============================
+# main
+#==============================
+export LC_ALL=C
+cd `dirname $0`
+
+getopt $*
+get_version
+
+# [clean] case
+if test "x$TARGET" = "xclean" ; then
+ echo "Starting to clean features."
+ cd sitetool
+ clean_features
+else
+# [build] case
+ echo "Starting to build features."
+ find_eclipsehome
+ find_antplugin
+ check_plugins
+
+ export ANT_HOME
+ export PLUGINS_DIR
+ export PATH=${PATH}:${ANT_HOME}/bin
+ echo "ANT_HOME=${ANT_HOME}"
+ echo "PLUGINS_DIR=${PLUGINS_DIR}"
+ echo "PATH=${PATH}"
+
+ cd sitetool
+ build_features
+fi
+exit 0
+# EOF
Property changes on: trunk/rtmtools/build_features
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/rtmtools/build_plugins
===================================================================
--- trunk/rtmtools/build_plugins (rev 0)
+++ trunk/rtmtools/build_plugins 2013-01-29 05:42:49 UTC (rev 393)
@@ -0,0 +1,336 @@
+#!/bin/sh
+#
+# @file build_plugins
+# @brief rtmtools plugins build script
+# @author Noriaki Ando <n-ando at aist.go.jp>
+#
+# * How to build rtmtools
+#
+# ** Required environment
+#
+# The following development environment and tools are required to
+# build rtmtools.
+#
+# - jdk
+# - ant
+# - Eclipse SDK (3.4 or later is required.)
+#
+# ** Before build tools
+#
+# Please edit "version" text to set version number of the tools. This
+# is a kind of bash script.
+#
+# Example:
+# -------
+# VERSION=1.1.0
+# PROJECT_VERSION=${VERSION}.rc7v$(date +%Y%m%d)
+#
+# ** Environment variables
+#
+# To build rtmtools, some environmental variables can be set. In most
+# case, these variables are automatically set.
+#
+# - ECLIPSE_HOME: A directory path to an Eclipse SDK. Under this
+# directory, .eclipseproduct, eclipse.ini, plugins and
+# eclipse executable should exist. If this
+# env.variable is not set, this script tries to search
+# eclipse directory under some directories that is set
+# in a env.variable ECLIPSE_DIRS written in the head
+# of this script.
+#
+# - JAVA_HOME: A directory JDK installed. If this variable is not set,
+# this script tries to estimate JDK directory to
+# resolve symbolic link of javac executable.
+#
+# - VERSION: A simple version number for the tools like 1.1.1. This is
+# used for actual bundles' version number with
+# PROJECT_VERSION number.
+#
+# - PROJECT_VERSION: Project version number is full version string
+# with simple version and suffix like
+# rc120121212. This version string is used actual jar
+# file name.
+#
+# - JARDIR: A directory to store jar files. Default directory is "jar".
+# This directory is temporary jar files store place.
+#
+# - DISTDIR: A directory to be archived for distribution package.
+# This directory name becomes archive package name.
+# Default name is openrtm-x.y.z. x, y, z are version
+# number which is defined in version text file.
+#
+
+
+#---------------------------------------------------------------------------
+# Global variables
+#---------------------------------------------------------------------------
+
+# Default build taget
+TARGET="buildAll"
+
+# Default
+JARDIR_DEFAULT="jar"
+
+# target projects
+PROJECTS="jp.go.aist.rtm.toolscommon.profiles
+ jp.go.aist.rtm.toolscommon.profiles.nl1
+ jp.go.aist.rtm.toolscommon
+ jp.go.aist.rtm.toolscommon.nl1
+ jp.go.aist.rtm.rtcbuilder
+ jp.go.aist.rtm.rtcbuilder.nl1
+ jp.go.aist.rtm.rtcbuilder.java
+ jp.go.aist.rtm.rtcbuilder.python
+ jp.go.aist.rtm.repositoryView
+ jp.go.aist.rtm.repositoryView.nl1
+ jp.go.aist.rtm.nameserviceview
+ jp.go.aist.rtm.nameserviceview.nl1
+ jp.go.aist.rtm.systemeditor
+ jp.go.aist.rtm.systemeditor.nl1"
+
+# Eclipse search directories
+ECLIPSE_DIRS="$HOME/eclipse ../ ../../ ../../ $HOME /usr/lib/ /usr/share"
+
+#============================================================
+# functions
+#============================================================
+
+#------------------------------------------------------------
+# getopt
+#
+# This function gets command line options
+# ------------------------------------------------------------
+getopt()
+{
+ if test $# = 1 ; then
+ arg=$1
+ if test "x$arg" = "xclean" ; then
+ TARGET=$1
+ return 0
+ fi
+ if test "x$arg" = "xrevert" ; then
+ echo "Reverting updated MANIFEST.MF..."
+ mf=`svn status | grep '^M' | grep MANIFEST.MF | awk '{print $2;}'`
+ for m in $mf; do
+ rm $m
+ svn update $m
+ done
+ exit 0
+ fi
+ fi
+}
+
+#------------------------------------------------------------
+# get_version
+#
+# This function gets version number and project version string
+# from version text file.
+# ------------------------------------------------------------
+get_version()
+{
+ if test "x$VERSION" = "x" || test "x$PROJECT_VERSION" = "x" ; then
+ echo "Environment variable VERSION/PROJECT_VERSION is not set."
+ echo "Getting from ./version text."
+ . ./version
+ fi
+ export VERSION
+ export PROJECT_VERSION
+
+ if test "x$DISTDIR" = "x" ; then
+ DISTDIR=openrtp-$VERSION
+ fi
+ if test "x$JARDIR" = "x" ; then
+ JARDIR=$JARDIR_DEFAULT
+ fi
+}
+
+#------------------------------------------------------------
+# find_eclipsehome
+#
+# This function checks ECLIPSE_HOME env variable and if it is
+# not set, it searches an eclipse directory under ECLIPSE_DIRS,
+# and set ECLIPSE_HOME env variable.
+# ------------------------------------------------------------
+find_eclipsehome()
+{
+ if test ! "x$ECLIPSE_HOME" = "x" ; then
+ if test -d $ECLIPSE_HOME ; then
+ return 0
+ fi
+ echo "ECLIPSE_HOME $ECLIPSE_HOME does not exist."
+ fi
+ echo "Environment variable ECLIPSE_HOME is not set. Seaching..."
+ for d in $ECLIPSE_DIRS ; do
+ tmp=`find -L $d -name .eclipseproduct`
+ if test "x$tmp" = "x" ; then
+ continue
+ fi
+ for e in $tmp ; do
+ edir=`dirname $e`
+ if test -f $edir/eclipse.ini && test -d $edir/plugins ; then
+ export ECLIPSE_HOME="$edir"
+ return 0
+ fi
+ done
+ done
+ echo "eclipse not found. Please install eclipse and set ECLIPSE_HOME."
+ exit 1
+}
+
+#------------------------------------------------------------
+# find_javahome
+#
+# This function estimate JAVA_HOME from javac, which usually
+# is a symbolic link to $JAVA_HOME/bin/javac.
+#------------------------------------------------------------
+find_javahome()
+{
+ if test ! "x$JAVA_HOME" = "x" ; then
+ if test -d $JAVA_HOME && test -f $JAVA_HOME/bin/javac ; then
+ return 0
+ fi
+ echo "JDK cannot be found under JAVA_HOME: $JAVA_HOME"
+ fi
+ echo "Valid Environment variable JAVA_HOME is not set. Searching..."
+ tmp=`readlink -e $(which javac)`
+ jdk_path=`dirname $tmp | sed 's/\/bin$//'`
+ if test "x$jdk_path" = "x" ; then
+ echo "JDK not found. Please install JDK and set JAVA_HOME."
+ exit 1
+ fi
+ export JAVA_HOME=$jdk_path
+ return 0
+}
+
+#------------------------------------------------------------
+# check_plugins
+#------------------------------------------------------------
+check_plugins()
+{
+ if test "x$JARDIR" = "x" ; then
+ echo "Env variable JARDIR is not set. Aborting."
+ exit 1
+ fi
+ echo "Checking plugin jar files..."
+ for p in $PROJECTS ; do
+ tmp="${p}_${PROJECT_VERSION}.jar"
+ if test ! -f $JARDIR/$tmp ; then
+ echo "[ERROR] $tmp not found"
+ return 1
+ fi
+ echo "[OK] $tmp found"
+ done
+}
+
+#------------------------------------------------------------
+# cleanup_jardir
+#
+# Cleanup jar directory
+#------------------------------------------------------------
+cleanup_jardir()
+{
+ if test -f $DISTDIR.zip ; then
+ rm -f $DISTDIR.zip
+ fi
+ if test -d $DISTDIR; then
+ rm -rf $DISTDIR
+ fi
+ if test -d $JARDIR; then
+ rm -rf $JARDIR
+ fi
+ mkdir $DISTDIR
+ mkdir $JARDIR
+}
+
+#------------------------------------------------------------
+# do_ant <TARGET>
+#
+# Invoke Ant build by buildAll target for each projects.
+#------------------------------------------------------------
+do_ant()
+{
+ target=$TARGET
+ for project in $PROJECTS; do
+ if test -d $project; then
+ echo "- Starting ant build of project: $project"
+ cd $project
+ ant $target $LIBS
+ if test $? -ne 0; then
+ echo "[ERROR] build failed: " $project
+ echo "Aborting..."
+ exit 1
+ fi
+ echo "Copying created jar file into $DISTDIR..."
+ cp jar/*aist*.jar ../$DISTDIR
+ cp jar/*aist*.jar ../$JARDIR
+ cd ..
+ else
+ echo "Project: $project does not exist"
+ echo "Skipping..."
+ fi
+ done
+}
+
+#------------------------------------------------------------
+# create_zip
+#
+# Create ZIP archive of built plugin files.
+#------------------------------------------------------------
+create_zip()
+{
+ echo "Creating ZIP archive of plugins jar files."
+ zipfile=$DISTDIR.zip
+ if test -f $zipfile ; then
+ rm $zipfile
+ fi
+ zip $zipfile -r ./$DISTDIR
+ if test $? -ne 0 ; then
+ echo "Faild to create ZIP file: $zipfile created"
+ exit 1
+ else
+ echo "ZIP file: $zipfile created"
+ fi
+}
+
+#==============================
+# main
+#==============================
+export LC_ALL=C
+cd `dirname $0`
+
+getopt $*
+get_version
+
+find_eclipsehome
+find_javahome
+
+echo "------------------------------------------------------------"
+echo "Environment variables:"
+echo "ECLIPSE_HOME: $ECLIPSE_HOME"
+echo "JAVA_HOME: $JAVA_HOME"
+echo "VERSION: $VERSION"
+echo "PROJECT_VERSION: $PROJECT_VERSION"
+echo "------------------------------------------------------------"
+
+LIBS="-lib ../lib -lib $ECLIPSE_HOME/plugins"
+
+cleanup_jardir
+do_ant $TARGET
+
+# Check and finalize Ant results
+if test "x$TARGET" = "xclean" ; then
+ # cleanup jar directories
+ rm -rf $DISTDIR
+ rm -rf $JARDIR
+ exit 0
+elif test "x$TARGET" = "xbuildAll" ; then
+ check_plugins
+ if test $? -ne 0 ;then
+ echo "Build failed? Some jar files are not found. Aborting..."
+ exit 1
+ fi
+ create_zip
+fi
+
+exit 0
+
+# end of script
Property changes on: trunk/rtmtools/build_plugins
___________________________________________________________________
Added: svn:executable
+ *
Deleted: trunk/rtmtools/buildall.sh
===================================================================
--- trunk/rtmtools/buildall.sh 2013-01-25 16:04:06 UTC (rev 392)
+++ trunk/rtmtools/buildall.sh 2013-01-29 05:42:49 UTC (rev 393)
@@ -1,265 +0,0 @@
-#!/bin/sh
-#
-# @file buildall.sh
-# @brief rtmtools build script
-# @author Noriaki Ando <n-ando at aist.go.jp>
-#
-# update:
-# cerate:Sep/11/2008
-#
-# * How to build rtmtools
-#
-# ** Required environment
-#
-# The following development environment and tools are required to
-# build rtmtools.
-#
-# - jdk
-# - ant
-# - Eclipse SDK (3.4 or later is required.)
-#
-# ** Before build tools
-#
-# Please edit "version" text to set version number of the tools. This
-# is a kind of bash script.
-#
-# Example:
-# -------
-# VERSION=1.1.0
-# PROJECT_VERSION=${VERSION}.rc7v$(date +%Y%m%d)
-#
-# ** Environment variables
-#
-# To build rtmtools, some environmental variables can be set. In most
-# case, these variables are automatically set.
-#
-# - ECLIPSE_HOME: A directory path to an Eclipse SDK. Under this
-# directory, .eclipseproduct, eclipse.ini, plugins and
-# eclipse executable should exist. If this
-# env.variable is not set, this script tries to search
-# eclipse directory under some directories that is set
-# in a env.variable ECLIPSE_DIRS written in the head
-# of this script.
-#
-# - JAVA_HOME: A directory JDK installed. If this variable is not set,
-# this script tries to estimate JDK directory to
-# resolve symbolic link of javac executable.
-#
-# - VERSION: A simple version number for the tools like 1.1.1. This is
-# used for actual bundles' version number with
-# PROJECT_VERSION number.
-#
-# - PROJECT_VERSION: Project version number is full version string
-# with simple version and suffix like
-# rc120121212. This version string is used actual jar
-# file name.
-#
-# - JARDIR: A directory to store jar files. Default directory is "jar".
-# This directory is temporary jar files store place.
-#
-# - DISTDIR: A directory to be archived for distribution package.
-# This directory name becomes archive package name.
-# Default name is openrtm-x.y.z. x, y, z are version
-# number which is defined in version text file.
-#
-
-
-#---------------------------------------------------------------------------
-# Global variables
-#---------------------------------------------------------------------------
-
-# Default build taget
-TARGET="buildAll"
-
-# Default
-JARDIR_DEFAULT="jar"
-
-# target projects
-PROJECTS="jp.go.aist.rtm.toolscommon.profiles
- jp.go.aist.rtm.toolscommon.profiles.nl1
- jp.go.aist.rtm.toolscommon
- jp.go.aist.rtm.toolscommon.nl1
- jp.go.aist.rtm.rtcbuilder
- jp.go.aist.rtm.rtcbuilder.nl1
- jp.go.aist.rtm.rtcbuilder.java
- jp.go.aist.rtm.rtcbuilder.python
- jp.go.aist.rtm.repositoryView
- jp.go.aist.rtm.repositoryView.nl1
- jp.go.aist.rtm.nameserviceview
- jp.go.aist.rtm.nameserviceview.nl1
- jp.go.aist.rtm.systemeditor
- jp.go.aist.rtm.systemeditor.nl1"
-
-# Eclipse search directories
-ECLIPSE_DIRS="../ ../../ ../../ $HOME /usr/lib/ /usr/share"
-
-#============================================================
-# functions
-#============================================================
-
-#------------------------------------------------------------
-# find_eclipsehome
-#
-# This function checks ECLIPSE_HOME env variable and if it is
-# not set, it searches an eclipse directory under ECLIPSE_DIRS,
-# and set ECLIPSE_HOME env variable.
-# ------------------------------------------------------------
-find_eclipsehome()
-{
- if test ! "x$ECLIPSE_HOME" = "x" ; then
- return 0
- fi
- echo "Environment variable ECLIPSE_HOME is not set. Seaching..."
- for d in $ECLIPSE_DIRS ; do
- tmp=`find $d -name .eclipseproduct`
- if test "x$tmp" = "x" ; then
- continue
- fi
- for e in $tmp ; do
- edir=`dirname $e`
- if test -f $edir/eclipse.ini && test -d $edir/plugins ; then
- export ECLIPSE_HOME="$edir"
- return 0
- fi
- done
- done
- echo "eclipse not found. Please install eclipse and set ECLIPSE_HOME."
- exit 1
-}
-
-#------------------------------------------------------------
-# find_javahome
-#
-# This function estimate JAVA_HOME from javac, which usually
-# is a symbolic link to $JAVA_HOME/bin/javac.
-#------------------------------------------------------------
-find_javahome()
-{
- if test ! "x$JAVA_HOME" = "x" ; then
- return 0
- fi
- echo "Environment variable JAVA_HOME is not set. Searching..."
- tmp=`readlink -e $(which javac)`
- jdk_path=`dirname $tmp | sed 's/\/bin$//'`
- if test "x$jdk_path" = "x" ; then
- echo "JDK not found. Please install JDK and set JAVA_HOME."
- exit 1
- fi
- export JAVA_HOME=$jdk_path
- return 0
-}
-
-get_version()
-{
- if test "x$VERSION" = "x" || test "x$PROJECT_VERSION" = "x" ; then
- echo "Environment variable VERSION/PROJECT_VERSION is not set."
- echo "Getting from ./version text."
- . ./version
- fi
-
- if test "x$DISTDIR" = "x" ; then
- DISTDIR=openrtp-$VERSION
- fi
- if test "x$JARDIR" = "x" ; then
- JARDIR=$JARDIR_DEFAULT
- fi
-}
-
-#------------------------------------------------------------
-# cleanup_jardir
-#
-# Cleanup jar directory
-#------------------------------------------------------------
-cleanup_jardir()
-{
- if test -f $DISTDIR.zip ; then
- rm -f $DISTDIR.zip
- fi
- if test -d $DISTDIR; then
- rm -rf $DISTDIR
- fi
- if test -d $JARDIR; then
- rm -rf $JARDIR
- fi
- mkdir $DISTDIR
- mkdir $JARDIR
-}
-
-do_ant_build()
-{
- for project in $PROJECTS; do
- if test -d $project; then
- echo "- Starting ant build of project: $project"
- cd $project
- ant $TARGET $LIBS
- if test $? -ne 0; then
- echo "[ERROR] build failed: " $project
- echo "Aborting..."
- exit 1
- fi
- echo "Copying created jar file into $DISTDIR..."
- cp jar/*aist*.jar ../$DISTDIR
- cp jar/*aist*.jar ../$JARDIR
- cd ..
- else
- echo "Project: $project does not exist"
- echo "Skipping..."
- fi
- done
-}
-
-create_zip()
-{
- if test -f $DISTDIR.zip ; then
- rm $DISTDIR.zip
- fi
- zip $DISTDIR.zip -r ./$DISTDIR
-}
-
-getopt()
-{
- if test $# = 1 ; then
- arg=$1
- if test "x$arg" = "xclean" ; then
- TARGET=$1
- return 0
- fi
- if test "x$arg" = "xrevert" ; then
- echo "Reverting updated MANIFEST.MF..."
- mf=`svn status | grep '^M' | grep MANIFEST.MF | awk '{print $2;}'`
- for m in $mf; do
- rm $m
- svn update $m
- done
- exit 0
- fi
- fi
-}
-
-#==============================
-# main
-#==============================
-getopt $*
-find_eclipsehome
-find_javahome
-get_version
-
-echo "ECLIPSE_HOME: $ECLIPSE_HOME"
-echo "JAVA_HOME: $JAVA_HOME"
-echo "VERSION: $VERSION"
-echo "PROJECT_VERSION: $PROJECT_VERSION"
-
-LIBS="-lib ../lib -lib $ECLIPSE_HOME/plugins"
-
-cleanup_jardir
-do_ant_build
-if test "x$TARGET" = "xclean" ; then
- rm -rf $DISTDIR
- rm -rf $JARDIR
- exit 0
-fi
-create_zip
-
-exit 0
-
-# end of script
Modified: trunk/rtmtools/sitetool/build.xml
===================================================================
--- trunk/rtmtools/sitetool/build.xml 2013-01-25 16:04:06 UTC (rev 392)
+++ trunk/rtmtools/sitetool/build.xml 2013-01-29 05:42:49 UTC (rev 393)
@@ -10,13 +10,21 @@
<property name="eclipse.dir" value="eclipse" />
<property name="launcher.id" value="org.eclipse.equinox.launcher" />
+ <property name="temp.build.dir" value="build" />
<property name="temp.plugins.dir" value="build/plugins" />
<property name="temp.features.dir" value="build/features" />
<property name="temp.site.dir" value="build/site" />
+ <property name="temp.backup.dir" value="backup" />
+
<!-- 更新サイトに関する設定 -->
<property name="site_proj.dir" value="${basedir}/openrtp_site" />
+ <property name="site_proj.plugins.dir"
+ value="${site_proj.dir}/plugins" />
+ <property name="site_proj.features.dir"
+ value="${site_proj.dir}/features" />
+
<property name="update_site.name" value="OpenRTP Updates" />
<!-- フィーチャ(RTCBuilder)に関する設定 -->
@@ -150,9 +158,18 @@
</target>
<target name="clean" description="中間生成ファイルの削除">
- <delete dir="${temp.plugins.dir}" />
- <delete dir="${temp.features.dir}" />
- <delete dir="${temp.site.dir}" />
+ <delete dir="${temp.plugins.dir}" quiet="true" />
+ <delete dir="${temp.features.dir}" quiet="true" />
+ <delete dir="${temp.site.dir}" quiet="true" />
+ <delete dir="${temp.build.dir}" quiet="true" />
+ <delete dir="${temp.backup.dir}" quiet="true" />
+ <delete dir="${site_proj.plugins.dir}" quiet="true" />
+ <delete dir="${site_proj.features.dir}" quiet="true" />
+ <delete includeEmptyDirs="true" quiet="true">
+ <fileset dir="." includes="**/*.log" />
+ <fileset dir="${site_proj.dir}" includes="**/*.jar" />
+ <fileset dir="conf" includes="**/*.keystore" />
+ </delete>
</target>
Deleted: trunk/rtmtools/sitetool/run.sh
===================================================================
--- trunk/rtmtools/sitetool/run.sh 2013-01-25 16:04:06 UTC (rev 392)
+++ trunk/rtmtools/sitetool/run.sh 2013-01-29 05:42:49 UTC (rev 393)
@@ -1,201 +0,0 @@
-#!/bin/sh
-#
-# @file buildall.sh
-# @brief rtmtools build script
-# @author Noriaki Ando <n-ando at aist.go.jp>
-#
-# update:
-# cerate:Sep/11/2008
-#
-# * How to build rtmtools
-#
-# ** Required environment
-#
-# The following development environment and tools are required to
-# build rtmtools.
-#
-# - jdk
-# - ant
-# - Eclipse SDK (3.4 or later is required.)
-#
-# ** Before build tools
-#
-# Please edit "version" text to set version number of the tools. This
-# is a kind of bash script.
-#
-# Example:
-# -------
-# VERSION=1.1.0
-# PROJECT_VERSION=${VERSION}.rc7v$(date +%Y%m%d)
-#
-# ** Environment variables
-#
-# To build rtmtools, some environmental variables can be set. In most
-# case, these variables are automatically set.
-#
-# - ECLIPSE_HOME: A directory path to an Eclipse SDK. Under this
-# directory, .eclipseproduct, eclipse.ini, plugins and
-# eclipse executable should exist. If this
-# env.variable is not set, this script tries to search
-# eclipse directory under some directories that is set
-# in a env.variable ECLIPSE_DIRS written in the head
-# of this script.
-#
-# - JAVA_HOME: A directory JDK installed. If this variable is not set,
-# this script tries to estimate JDK directory to
-# resolve symbolic link of javac executable.
-#
-# - VERSION: A simple version number for the tools like 1.1.1. This is
-# used for actual bundles' version number with
-# PROJECT_VERSION number.
-#
-# - PROJECT_VERSION: Project version number is full version string
-# with simple version and suffix like
-# rc120121212. This version string is used actual jar
-# file name.
-#
-# - JARDIR: A directory to store jar files. Default directory is "jar".
-# This directory is temporary jar files store place.
-#
-# - DISTDIR: A directory to be archived for distribution package.
-# This directory name becomes archive package name.
-# Default name is openrtm-x.y.z. x, y, z are version
-# number which is defined in version text file.
-#
-
-# Eclipse search directories
-ECLIPSE_DIRS="$HOME/eclipse $HOME ../ ../../ ../..//usr/lib/ /usr/share"
-
-# Ant eclipse plugin location
-ANT_HOME_DEFAULT="${ECLIPSE_HOME}/plugins/org.apache.ant_1.7.0.v200803061910/"
-
-#============================================================
-# functions
-#============================================================
-
-#------------------------------------------------------------
-# find_eclipsehome
-#
-# This function checks ECLIPSE_HOME env variable and if it is
-# not set, it searches an eclipse directory under ECLIPSE_DIRS,
-# and set ECLIPSE_HOME env variable.
-# ------------------------------------------------------------
-find_eclipsehome()
-{
- if test ! "x$ECLIPSE_HOME" = "x" ; then
- if test -d $ECLIPSE_HOME ; then
- return 0
- fi
- echo "ECLIPSE_HOME $ECLIPSE_HOME does not exist."
- fi
- echo "Environment variable ECLIPSE_HOME is not set. Seaching..."
- for d in $ECLIPSE_DIRS ; do
- tmp=`find -L $d -name .eclipseproduct`
- if test "x$tmp" = "x" ; then
- continue
- fi
- for e in $tmp ; do
- edir=`dirname $e`
- if test -f $edir/eclipse.ini && test -d $edir/plugins ; then
- export ECLIPSE_HOME="$edir"
- return 0
- fi
- done
- done
- echo "eclipse not found. Please install eclipse and set ECLIPSE_HOME."
- exit 1
-}
-
-
-
-
-find_antplugin()
-{
- if test ! "x$ANT_HOME" = "x" ; then
- return 0
- fi
- echo "Environment variable ANT_HOME does not exist. Searching..."
- if test ! -d $ANT_HOME ; then
- echo "ANT_HOME $ANT_HOME does not exist. Finding another ant plugin."
- other_ant=`find $ECLIPSE_HOME/plugins -maxdepth 1 -type d -name 'org.apache.ant*'`
- echo $other_ant
- if test "x$other_ant" = "x" ; then
- echo "Ant plugin was not found. Aborting."
- return 1
- fi
- ANT_HOME=$other_ant
- fi
-}
-
-check_plugins()
-{
- if test "x$PLUGINS_DIR" = "x" ; then
- echo "Environment variable PLUGINS_DIR is not set."
- tmp=`find ../jar -name 'jp.go.aist.rtm.toolscommon*' -exec dirname {} \;`
- if test "x$tmp" = "x" ; then
- echo "Plugins not found. Trying to build plugins."
- exit 0
- cd ../
- sh buildall.sh
- cd -
- if test $? -ne 0 ; then
- echo "Build failed. Aborting."
- exit 1
- fi
- tmp=`find ../jar -name 'jp.go.aist.rtm.toolscommon*' -exec dirname {} \;`
- if test "x$tmp" = "x" ; then
- echo "Plugins not found. Aborting."
- return 1
- fi
- fi
- for t in $tmp ; do
- plugindir=$t
- break
- done
- PLUGINS_DIR=$plugindir
- fi
-}
-
-#==============================
-# main
-#==============================
-cd `dirname $0`
-pwd
-
-find_eclipsehome
-find_antplugin
-check_plugins
-
-export ANT_HOME
-export PLUGINS_DIR
-export PATH=${PATH}:${ANT_HOME}/bin
-
-echo "ANT_HOME=${ANT_HOME}"
-echo "PLUGINS_DIR=${PLUGINS_DIR}"
-echo "PATH=${PATH}"
-
-echo "Getting plugins (get.plugins)"
-ant -lib lib get.plugins
-if test $? -ne 0 ; then
- echo "Error in get.plugins target. Aborting..."
-fi
-
-echo "Signing features (feature.sign.gen)"
-ant -lib lib feature.sign.gen
-if test $? -ne 0 ; then
- echo "Error in feature.sign.gen target. Aborting..."
-fi
-
-echo "Building features (build.features)"
-ant -lib lib build.features
-if test $? -ne 0 ; then
- echo "Error in build.features target. Aborting..."
-fi
-
-echo "Deploying features to site (deploy.site)"
-ant -lib lib deploy.site
-if test $? -ne 0 ; then
- echo "Error in deploy.site target. Aborting..."
-fi
-
-# EOF
More information about the openrtm-commit
mailing list