3 build_path=${SRCDIR}/build_result
7 build_id=${package_name}
9 build_result_directory=${build_type}.${build_id}
10 build_result_path="$build_path/$build_result_directory"
12 ide_root_path_name=ide
16 archive_platform_name=linux
19 windows-32|windows-64)
20 archive_platform_name=win32
24 archive_platform_name=macosx
28 echo "${TARGET_OS} is not support yet."
32 result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip
35 __set_build_parameter()
39 reference_ide_path=${ROOTDIR}/indigo-pde/eclipse
41 windows-32|windows-64)
42 reference_ide_path=${ROOTDIR}/indigo-winpde/eclipse
45 reference_ide_path=${ROOTDIR}/indigo-macpde/eclipse
48 echo "${TARGET_OS} is not support yet."
53 __set_install_parameter()
55 INSTALL_DIR=${SRCDIR}/package/${package_name}.package.${platform}/data
58 __clean_build_environment()
62 echo "Build result directory : [$build_path]"
64 echo "Make build result directory [$build_path]"
68 echo "Remove legacy build files..."
69 if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ]
71 rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}
73 if [ -e ${build_result_path}/${result_archive_file} ]
75 rm -rf ${build_result_path}/${result_archive_file}
77 if [ -d ${build_path}/tmp ]
79 rm -rf ${build_path}/tmp
82 if [ -d ${build_path}/buildRepo ]
84 rm -rf ${build_path}/buildRepo
87 rm -rf ${build_path}/*.xml
88 rm -rf ${build_path}/*.properties
89 rm -rf ${build_path}/*.clean
92 if [ -d $build_path/plugins ]
94 echo "plugins directory recreate..."
95 rm -rf $build_path/plugins
96 mkdir $build_path/plugins
98 echo "Make plugins directory..."
99 mkdir $build_path/plugins
101 if [ -d $build_path/features/ ]
103 echo "features directory recreate..."
104 rm -rf $build_path/features
105 mkdir $build_path/features
107 echo "Make features directory..."
108 mkdir $build_path/features
113 __copy_build_sources()
115 echo "Copy features from $SRCDIR to $build_path/features"
116 temp_dir="`mktemp -d /tmp/ide.XXXXX`"
117 cp -r $SRCDIR/* $temp_dir
118 cp -r $temp_dir/* $build_path/features
121 echo "Copy plugins from $SRCDIR to $build_path/plugins"
122 temp_dir="`mktemp -d /tmp/ide.XXXXX`"
123 cp -r $SRCDIR/* $temp_dir
124 cp -r $temp_dir/* $build_path/plugins
128 __copy_dependency_plugins()
130 dependency_plugin_path=${ROOTDIR}/${ide_root_path_name}
131 if [ -d ${dependency_plugin_path} ]
133 cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/
134 cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/
136 echo "ERROR : ${dependency_plugin_path} is not exist."
140 __make_ant_build_properties_file()
142 builder_path="${SRCDIR}/builder"
143 parent_path_of_based_eclipse=${reference_ide_path}/..
145 echo "Make build.properties file..."
146 if [ ! -e $builder_path/build.properties.clean ] ; then
147 echo "ERROR : \"build.properties.clean\" file does not exist..."
150 cp $builder_path/build.properties.clean $build_path
151 cp $builder_path/customTargets.xml $build_path
153 if [ -d $reference_ide_path ]
155 sed -e "s;\(^buildDirectory=\).*;\1${build_path};g" \
156 -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \
157 -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \
158 -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \
159 -e "s;\(^buildType=\).*;\1${build_type};g" \
160 -e "s;\(^buildId=\).*;\1${build_id};g" \
161 -e "s;\(^archivePrefix=\).*;\1${build_id};g" \
162 < $build_path/build.properties.clean > $build_path/build.properties
165 echo "ERROR : target eclipse is not exist."
170 __execute_pde_build()
172 echo "Execute Product Ant Builder..."
173 equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar`
174 pde_build=`echo org.eclipse.pde.build_*`
176 java -jar ${reference_ide_path}/plugins/$equinox_launcher -application org.eclipse.ant.core.antRunner -buildfile ${reference_ide_path}/plugins/$pde_build/scripts/productBuild/productBuild.xml -Dbuilder=$build_path -Dosgi.locking=none 2>&1
180 echo "Build failed..."
185 __unzip_plugin_pack()
187 echo "unzip to $build_result_path"
188 unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture}
195 echo "build plugin for ${platform}"
197 windows-32|windows-64)
198 echo "build plugin for ${platform}"
201 echo "build plugin for ${platform}"
204 echo "${platform} is not support yet."
210 __set_build_parameter
211 __clean_build_environment
213 __copy_dependency_plugins
214 __make_ant_build_properties_file
218 echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"."
221 __clean_packaging_environment()
224 if [ -d ${INSTALL_DIR} ]
226 rm -rf ${INSTALL_DIR}
228 mkdir -p ${INSTALL_DIR}
232 __copy_necessary_binaries()
234 echo "add necessary files."
235 ## ex) cp -rf ~~~~/file.file ${INSTALL_DIR}/${ide_root_path_name}/
241 __set_install_parameter
243 __clean_packaging_environment
244 __copy_necessary_binaries
246 install_ide_path=${INSTALL_DIR}/${ide_root_path_name}
248 if [ ! -d ${install_ide_path} ]
250 mkdir -p ${install_ide_path}
253 cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/
259 echo "=========================================CLEAN============================================"
260 rm -rf ${SRCDIR}/*.zip
261 rm -rf ${SRCDIR}/*.tar.gz
268 echo "=========================================BUILD============================================"
269 pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'`
270 for pkgname_and_platform in ${pkgname_and_platform_list}
272 pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '`
273 package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
274 platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
276 if [ "x${TARGET_OS}" = "x${platform}" ]
288 pkgname_and_platform_list=`awk 'BEGIN{RS="\n\n"; FS="\n"} /Package:/{for(i=1;i<NF;i++){if($i ~ /^OS:/){print $1,$i}}}' ${SRCDIR}/package/pkginfo.manifest | tr ' ' '@'`
289 for pkgname_and_platform in ${pkgname_and_platform_list}
291 echo "=========================================INSTALL============================================"
292 pkgname_and_platform=`echo $pkgname_and_platform | tr '@' ' '`
293 package_name=`echo ${pkgname_and_platform} | cut -f1 -d " " | cut -f2 -d ":"`
294 platform=`echo ${pkgname_and_platform} | cut -f2 -d " " | cut -f2 -d ":"`
296 if [ "x${TARGET_OS}" = "x${platform}" ]
305 [ "$1" = "clean" ] && clean
306 [ "$1" = "build" ] && build
307 [ "$1" = "install" ] && install