PageRenderTime 75ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/tl/src/cmn/setup/buildenv.ksh

https://bitbucket.org/rsaqc/openesb-core
Korn Shell | 448 lines | 263 code | 76 blank | 109 comment | 54 complexity | eab402aa290c8c1a22b6907fc8ad6085 MD5 | raw file
  1. #
  2. # BEGIN_HEADER - DO NOT EDIT
  3. #
  4. # The contents of this file are subject to the terms
  5. # of the Common Development and Distribution License
  6. # (the "License"). You may not use this file except
  7. # in compliance with the License.
  8. #
  9. # You can obtain a copy of the license at
  10. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  11. # See the License for the specific language governing
  12. # permissions and limitations under the License.
  13. #
  14. # When distributing Covered Code, include this CDDL
  15. # HEADER in each file and include the License file at
  16. # https://open-esb.dev.java.net/public/CDDLv1.0.html.
  17. # If applicable add the following below this CDDL HEADER,
  18. # with the fields enclosed by brackets "[]" replaced with
  19. # your own identifying information: Portions Copyright
  20. # [year] [name of copyright owner]
  21. #
  22. #
  23. # @(#)buildenv.ksh
  24. # Copyright 2004-2008 Sun Microsystems, Inc. All Rights Reserved.
  25. #
  26. # END_HEADER - DO NOT EDIT
  27. #
  28. ###################
  29. # INPUT PARAMETERS:
  30. ###################
  31. # IIS_TOOLROOT - override the default TOOLROOT setting.
  32. # IIS_CVSROOT - override the default CVSROOT setting.
  33. # IIS_BRANCH_NAME - override the default CVS_BRANCH_NAME setting
  34. # IIS_CODELINE - override the default CODELINE setting
  35. # IIS_MAVEN_REPO_LOCAL - override the default MAVEN_REPO_LOCAL setting
  36. # IIS_MAVEN_DISTROOT - override the default MAVEN_DISTROOT setting
  37. # IIS_AS8BASE - override the default AS8BASE setting
  38. # IIS_NETBEANS_HOME - override the default NETBEANS_HOME setting
  39. #
  40. # WARNING: the above variables are PRIVATE and are RESERVED for
  41. # this definition file. They are unexported after use.
  42. ####
  43. #set the path-separator for this platform:
  44. ####
  45. export PS
  46. echo $PATH | grep ';' > /dev/null
  47. if [ $? -eq 0 ]; then
  48. PS=';'
  49. else
  50. PS=':'
  51. fi
  52. #### this is precautionary only, to divorce from old forte tools:
  53. unset MAINROOT
  54. export PRODUCT=openesb
  55. #this can be preset to a local tunnel host:
  56. if [ "x$JNET_CVS_HOST" = x ]; then
  57. JNET_CVS_HOST="luna.sfbay"
  58. fi
  59. if [ "x$JNET_USER" = x ]; then
  60. export JNET_USER="guest"
  61. echo "WARNING: your java.net user name (JNET_USER) was defaulted to '$JNET_USER'."
  62. echo "To remove this warning, please export JNET_USER in the environment."
  63. fi
  64. export CVSIGNORE
  65. if [ "x$CVSIGNORE" = x ]; then
  66. CVSIGNORE='Makefile bld target'
  67. fi
  68. #########
  69. # CVSROOT:
  70. #########
  71. export CVSROOT
  72. if [ "x$IIS_CVSROOT" = x ]; then
  73. #use default setting (note - CVSROOT is set later):
  74. IIS_CVSROOT=":pserver:${JNET_USER}@cvs.dev.java.net:/cvs"
  75. fi
  76. pwd=`pwd`
  77. #cannonicalize $SRCROOT if it is set:
  78. if [ "$SRCROOT" != "" ]; then
  79. srcroot=`sh -c "cd $SRCROOT; pwd"`
  80. else
  81. srcroot=""
  82. fi
  83. if [ "$srcroot" = "$pwd" ]; then
  84. export SRCROOT="$pwd"
  85. elif [ "$PROJECT" != "" -a \( "$srcroot" = "" -o "$srcroot" = "$PROJECT" \) ]; then
  86. ## ASSUME we are using VSPMS
  87. export SRCROOT="$PROJECT"
  88. else
  89. cat << 'EOF'
  90. PLEASE SET $SRCROOT OR USE chpj BEFORE SOURCING buildenv.ksh
  91. NOTE: if you are not using VSPMS and *have* set $SRCROOT, then
  92. "cd $SRCROOT" before sourcing this setup file. Make sure that
  93. the pwd command returns the same string as your $SRCROOT setting.
  94. ### EXAMPLE 1: without VSPMS:
  95. $ mkdir -p /somedisk/cvs/mywork
  96. $ cd /somedisk/cvs/mywork
  97. $ cat >> mysetup
  98. export SRCROOT=/somedisk/cvs/mywork
  99. export JAVABASE=C:
  100. export JAVAVERS j2sdk1.4.0
  101. . $SRCROOT/tools/boot/buildenv.ksh
  102. pathinfo #optional - display key environment settings.
  103. ^D
  104. $ . mysetup
  105. [do this whenever you want work on your project]
  106. ### EXAMPLE 2: using VSPMS:
  107. $ cd /somedisk/cvs/mywork
  108. $ addpj mywork
  109. [name your project whatever you want]
  110. $ cat >> $PROJECTRC
  111. export JAVABASE=C:
  112. export JAVAVERS j2sdk1.4.0
  113. . $PROJECT/tools/boot/buildenv.ksh
  114. pathinfo #optional - display key environment settings.
  115. ^D
  116. % chpj mywork
  117. [do this whenever you want work on your project]
  118. SETUP ABORTED
  119. EOF
  120. return
  121. fi
  122. #########
  123. #CODELINE:
  124. #########
  125. export CODELINE
  126. #allow user to override codeline var, which determines cvs branch names
  127. #for main repository, and determines the placement of log and kit directories.
  128. if [ "x$IIS_CODELINE" != x ]; then
  129. CODELINE=$IIS_CODELINE
  130. else
  131. CODELINE=main
  132. fi
  133. ####
  134. #CVS BRANCH NAMES. Use IIS_BRANCH_NAME to override "main" when bootstraping a branch.
  135. ####
  136. export JBI_BRANCH_NAME CVS_BRANCH_NAME
  137. JBI_BRANCH_NAME=main
  138. if [ "x$IIS_BRANCH_NAME" != x ]; then
  139. JBI_BRANCH_NAME="$IIS_BRANCH_NAME"
  140. fi
  141. CVS_BRANCH_NAME=$JBI_BRANCH_NAME
  142. #now we can set TOOLS_CVSROOT, which is based on the branch and product name:
  143. if [ "x$TOOLS_CVSROOT" = x ]; then
  144. export TOOLS_CVSROOT=":pserver:anoncvs@iis:/tooldist/$PRODUCT/$CVS_BRANCH_NAME"
  145. fi
  146. #################
  147. # CVS_BRANCH_NAME is used in the following scripts to denote the
  148. # major codeline revision. It is meant to be generic for generic tools (devtools).
  149. # toolsBuild - checkout tools src
  150. # makedrv.pl - checkout tools src
  151. # buildenv.csh - setup file
  152. # buildenv.ksh - setup file
  153. # bldcmn.sh - assert
  154. # fortepj.rc - cosmetic (sets $REV VSPMS var)
  155. # fortepj.ksh - cosmetic (sets $REV VSPMS var)
  156. #################
  157. export DEVELOPER_BUILD=1
  158. alias gettools='(mkdir -p tools.new; cd $SRCROOT/tools.new; cvs -f -d $TOOLS_CVSROOT co ${FORTE_PORT}tools; echo new tools are in tools.new)'
  159. alias cvstools='cvs -d $TOOLS_CVSROOT'
  160. #### CVS DEFS
  161. export CVSREAD=1
  162. export CVSROOT="$IIS_CVSROOT"
  163. #these variables are needed to update the local project tool sources during toolsBuild
  164. export CVS_SRCROOT_PREFIX="open-esb"
  165. export CVS_CO_ROOT="${SRCROOT}/.."
  166. if [ "x$JBI_MODULES" = x ]; then
  167. export JBI_MODULES="open-esb/m2.ant open-esb/pom.xml open-esb/antbld open-esb/bb open-esb/build-common open-esb/esb-components open-esb/esb-packages open-esb/esb-test open-esb/esb-util open-esb/installers open-esb/jbi open-esb/platform-config open-esb/repo open-esb/ri-clients open-esb/ri-components open-esb/ri-examples open-esb/ri-packages open-esb/rl open-esb/runtime open-esb/vendor-libs"
  168. fi
  169. ####### TOOLS SETUP
  170. export TOOLROOT FORTE_PORT
  171. if [ "x$IIS_TOOLROOT" != x ]; then
  172. TOOLROOT=$IIS_TOOLROOT
  173. else
  174. TOOLROOT=$SRCROOT/tools
  175. fi
  176. if [ -x $TOOLROOT/boot/whatport.ksh -o -x $TOOLROOT/boot/whatport ]; then
  177. FORTE_PORT=`$TOOLROOT/boot/whatport`
  178. else
  179. echo ERROR: could not find tools - please bootstrap your tools.
  180. return
  181. fi
  182. PATH="$TOOLROOT/bin/$FORTE_PORT${PS}$TOOLROOT/bin/cmn${PS}$PATH"
  183. export PERL_LIBPATH
  184. if [ "x$PERL5_HOME" != x ]; then
  185. if [ -d "$PERL5_HOME" ]; then
  186. #perl installations on solaris and linux differ - solaris has {bin,lib} subdirs:
  187. if [ -d "$PERL5_HOME/lib" ]; then
  188. PERL_LIBPATH=".;$PERL5_HOME/lib;$TOOLROOT/lib/cmn;$TOOLROOT/lib/cmn/perl5"
  189. else
  190. PERL_LIBPATH=".;$PERL5_HOME;$TOOLROOT/lib/cmn;$TOOLROOT/lib/cmn/perl5"
  191. fi
  192. if [ -d "$PERL5_HOME/bin" ]; then
  193. PATH="$PERL5_HOME/bin${PS}$PATH"
  194. #otherwise, we assume perl is already in the path
  195. fi
  196. else
  197. echo "WARNING: not a directory, PERL5_HOME='$PERL5_HOME'. Please fix."
  198. fi
  199. else
  200. #use port-specific perl libs in $TOOLROOT; this is for old solaris
  201. #and mks perl installs:
  202. PERL_LIBPATH=".;$TOOLROOT/lib/cmn;$TOOLROOT/lib/$FORTE_PORT/perl5;$TOOLROOT/lib/cmn/perl5"
  203. fi
  204. #used by makemf utility:
  205. export MAKEMF_LIB=$TOOLROOT/lib/cmn
  206. #used by codegen utility:
  207. export CG_TEMPLATE_PATH=".;$TOOLROOT/lib/cmn/templates;$TOOLROOT/lib/cmn/templates/java"
  208. alias pull='$TOOLROOT/boot/updateDist'
  209. #### set up env required for release and tools builds:
  210. export PATHNAME=`basename $SRCROOT`
  211. export PATHREF=$SRCROOT
  212. export RELEASE_ROOT=$SRCROOT/release
  213. export RELEASE_DISTROOT=$SRCROOT/release
  214. export HOST_NAME="`uname -n`"
  215. export PRIMARY_PORT=solsparc
  216. export TARGET_OS_LIST="cmn,ntcmn,nt,solsparc,linux,macosx,solx86,cygwin"
  217. if [ "x$FORTE_LINKROOT" = x ]; then
  218. export FORTE_LINKROOT=$SRCROOT
  219. fi
  220. if [ "x$DISTROOT" = x ]; then
  221. export DISTROOT=$FORTE_LINKROOT/dist/tools
  222. fi
  223. if [ "x$KITROOT" = x ]; then
  224. export KITROOT=$FORTE_LINKROOT/kits
  225. fi
  226. if [ "x$KIT_DISTROOT" = x ]; then
  227. export KIT_DISTROOT=$FORTE_LINKROOT/kits/$PRODUCT
  228. fi
  229. if [ "x$KIT_REV" = x ]; then
  230. export KIT_REV=$CODELINE
  231. fi
  232. if [ "x$REGRESS_DISPLAY" = x ]; then
  233. if [ "x$DISPLAY" != x ]; then
  234. export REGRESS_DISPLAY="$DISPLAY"
  235. else
  236. export REGRESS_DISPLAY=NULL
  237. fi
  238. fi
  239. ##### JAVA BASE
  240. #adjust this to where you have java installed:
  241. if [ "x$JAVABASE" = x ]; then
  242. bldmsg -error You must set JAVABASE and JAVAVERS
  243. bldmsg EXAMPLE: 'export JAVABASE=c:; export JAVAVERS=jdk1.3_0'
  244. return 1
  245. fi
  246. export JAVA_HOME=$JAVABASE/$JAVAVERS
  247. PATH="$JAVA_HOME/bin${PS}$PATH"
  248. ##########
  249. ##### JAVA TOOLS
  250. #ant
  251. export ANT_HOME=$TOOLROOT/java/ant
  252. if [ "x$ANT_OPTS" = x ]; then
  253. export ANT_OPTS=-Xmx200m
  254. fi
  255. ######
  256. #maven setup:
  257. ######
  258. export MAVEN_REPO_LOCAL
  259. if [ "$IIS_MAVEN_REPO_LOCAL" != "" ]; then
  260. MAVEN_REPO_LOCAL="$IIS_MAVEN_REPO_LOCAL"
  261. else
  262. MAVEN_REPO_LOCAL="$SRCROOT/m2/repository"
  263. fi
  264. export MAVEN_DISTROOT
  265. if [ "$IIS_MAVEN_DISTROOT" != "" ]; then
  266. MAVEN_DISTROOT="$IIS_MAVEN_DISTROOT"
  267. else
  268. MAVEN_DISTROOT="$SRCROOT/bld/remote"
  269. fi
  270. export MAVEN_HOME M2_HOME
  271. MAVEN_HOME=$TOOLROOT/java/maven
  272. M2_HOME=$TOOLROOT/java/maven2
  273. export MAVEN_OPTS
  274. if [ x$MAVEN_OPTS = x ]; then
  275. MAVEN_OPTS="-Xmx400m"
  276. fi
  277. ##### JREGRESS
  278. if [ "x$JREGRESS_TIMEOUT" = x ]; then
  279. export JREGRESS_TIMEOUT=650
  280. fi
  281. ##### set up JBI_USER_NAME:
  282. #this can be set in the login env, as it is usually invariant
  283. if [ "x$JBI_USER_NAME" = x ]; then
  284. if [ "x$LOGNAME" != x ]; then
  285. export JBI_USER_NAME="$LOGNAME"
  286. elif [ "x$USER" != x ]; then
  287. export JBI_USER_NAME="$USER"
  288. else
  289. echo 'ERROR cannot set JBI_USER_NAME from $LOGNAME or $USER - PLEASE DEFINE IT MANUALLY'
  290. export JBI_USER_NAME="NONAME"
  291. fi
  292. fi
  293. ##### Default AS8BASE:
  294. export AS8BASE
  295. if [ "$IIS_AS8BASE" != "" ]; then
  296. AS8BASE="$IIS_AS8BASE"
  297. else
  298. AS8BASE="$SRCROOT/install/as8"
  299. fi
  300. PATH="$AS8BASE/bin${PS}$PATH"
  301. ##### Default JBISE_BASE:
  302. export JBISE_BASE=$SRCROOT/install/jbise
  303. ##### Default JBOSSBASE:
  304. export JBOSSBASE=$SRCROOT/install/jboss
  305. PATH="$JBOSSBASE/bin${PS}$PATH"
  306. #######
  307. #cygwin: set java versions of SRCROOT, TOOLROOT (used in ant scripts):
  308. #######
  309. export JV_SRCROOT JV_TOOLROOT JV_MAVEN_REPO_LOCAL JV_MAVEN_DISTROOT JV_AS8BASE
  310. if [ "$FORTE_PORT" = "cygwin" ]; then
  311. JV_SRCROOT=`cygpath -wm "$SRCROOT"`
  312. JV_TOOLROOT=`cygpath -wm "$TOOLROOT"`
  313. JV_MAVEN_REPO_LOCAL=`cygpath -wm "$MAVEN_REPO_LOCAL"`
  314. JV_MAVEN_DISTROOT=`cygpath -wm "$MAVEN_DISTROOT"`
  315. JV_AS8BASE=`cygpath -wm "$AS8BASE"`
  316. else
  317. JV_SRCROOT="$SRCROOT"
  318. JV_TOOLROOT="$TOOLROOT"
  319. JV_MAVEN_REPO_LOCAL="$MAVEN_REPO_LOCAL"
  320. JV_MAVEN_DISTROOT="$MAVEN_DISTROOT"
  321. JV_AS8BASE="$AS8BASE"
  322. fi
  323. #########
  324. #NetBeans setup:
  325. #########
  326. export NETBEANS_HOME
  327. if [ "$IIS_NETBEANS_HOME" != "" ]; then
  328. NETBEANS_HOME="$IIS_NETBEANS_HOME"
  329. fi
  330. #make a random guess, based on platform:
  331. if [ "$NETBEANS_HOME" = "" ]; then
  332. nbvers=5.5beta2
  333. if [ "$FORTE_PORT" = "macosx" ]; then
  334. NETBEANS_HOME=/Applications/NetBeans.app/Contents/Resources/NetBeans
  335. elif [ "$FORTE_PORT" = "cygwin" ]; then
  336. NETBEANS_HOME=/netbeans/$nbvers
  337. else
  338. NETBEANS_HOME=/opt/netbeans/$nbvers
  339. fi
  340. unset nbvers
  341. fi
  342. if [ ! -d "$NETBEANS_HOME" ]; then
  343. echo "WARNING: not a directory, NETBEANS_HOME='$NETBEANS_HOME'. Please provide IIS_NETBEANS_HOME parameter."
  344. fi
  345. alias runide='"$NETBEANS_HOME"/bin/netbeans -J-Dmaven.repo.local="$JV_SRCROOT"/m2/repository'
  346. #this is a hack to bootstrap the boms. RT 9/26/05
  347. export JBI_DOT_VERSION="1.1"
  348. #standard project defs:
  349. unset fortepj
  350. export fortepj="$TOOLROOT/lib/cmn/fortepj.ksh"
  351. if [ -r "$fortepj" ]; then
  352. . "$fortepj"
  353. else
  354. echo WARNING - cannot open $fortepj
  355. fi
  356. opt=`optpath` > /dev/null 2>&1
  357. if [ $? -eq 0 ]; then
  358. export PATH="$opt"
  359. else
  360. echo PATH not optimized
  361. fi
  362. #these variables are PRIVATE and RESERVED for this definition file:
  363. unset IIS_TOOLROOT
  364. unset IIS_CVSROOT
  365. unset IIS_BRANCH_NAME
  366. unset IIS_CODELINE
  367. unset IIS_MAVEN_REPO_LOCAL
  368. unset IIS_MAVEN_DISTROOT
  369. unset IIS_AS8BASE
  370. unset IIS_NETBEANS_HOME
  371. #finally, set the current release tag:
  372. export REV="CP07"