From: Dmitriy Nikiforov Date: Fri, 13 May 2016 18:17:56 +0000 (+0300) Subject: SRADA-680: Updated DIBS build script to use maven X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=19b79940a11cb7f1d2e263234a41876b32745228;p=sdk%2Ftools%2Fdynamic-analyzer.git SRADA-680: Updated DIBS build script to use maven Changes: * updated some build paths * removed no more necessary functions: - __copy_build_sources - __copy_dependency_plugins - __make_ant_properties_files - __copy_necessary_binaries - __unzip_plugin_pack * added backup of product information files in __set_product_about_info * added restoration of product information files in __restore_product_info * modified __clean_build_environment to remove only built project * removed copying of 'config' directory from 'packaging_bfiles' Change-Id: I1a3fde0816c73b7bed14ae607b8b88f5fda03925 --- diff --git a/org.tizen.dynamicanalyzer.workbench/build.properties b/org.tizen.dynamicanalyzer.workbench/build.properties index d940ea9..798eb0c 100644 --- a/org.tizen.dynamicanalyzer.workbench/build.properties +++ b/org.tizen.dynamicanalyzer.workbench/build.properties @@ -3,9 +3,6 @@ output.. = bin/ bin.includes = plugin.xml,\ META-INF/,\ .,\ - about.ini,\ - about.mappings,\ - about.properties,\ plugin.properties,\ plugin_customization.ini,\ icons/ diff --git a/package/build.linux b/package/build.linux index 34466b9..c849b5e 100644 --- a/package/build.linux +++ b/package/build.linux @@ -1,6 +1,6 @@ #!/bin/bash -x -build_path=${SRCDIR}/build_result +build_path=${SRCDIR}/org.tizen.dynamicanalyzer.workbench.product/target/products/org.tizen.dynamicanalyzer.workbench.product build_time=`date +%Y%m%d-%H%M` __set_parameter() @@ -8,7 +8,6 @@ __set_parameter() build_id=${package_name} build_type=N build_result_directory=${build_type}.${build_id} - build_result_path="$build_path/$build_result_directory" ide_root_path_name=tools/dynamic-analyzer ide_lib_path_name=library/dynamic-analyzer @@ -48,6 +47,7 @@ __set_parameter() ;; esac + build_result_path="$build_path/$archive_platform_name/$windowing/$architecture/da" result_archive_file=${build_id}-${archive_platform_name}.${windowing}.${architecture}.zip } @@ -55,7 +55,7 @@ __set_build_parameter() { manifest_version=`grep Version: ${SRCDIR}/package/pkginfo.manifest | cut -f2 -d":" | head -n 1` product_version=${manifest_version} - branding_path="org.tizen.dynamicanalyzer.workbench" + branding_path="org.tizen.dynamicanalyzer.workbench.product" branding_file="dynamicanalyzer.product" case ${platform} in @@ -82,104 +82,26 @@ __set_install_parameter() __clean_build_environment() { - if [ -d $build_path ] - then - echo "Build result directory : [$build_path]" - else - echo "Make build result directory [$build_path]" - mkdir -p $build_path - fi - echo "Remove legacy build files..." - if [ -d ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} ] - then - rm -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture} - fi - if [ -e ${build_result_path}/${result_archive_file} ] - then - rm -rf ${build_result_path}/${result_archive_file} - fi - if [ -d ${build_path}/tmp ] - then - rm -rf ${build_path}/tmp - fi - - if [ -d ${build_path}/buildRepo ] - then - rm -rf ${build_path}/buildRepo - fi - - rm -rf ${build_path}/*.xml - rm -rf ${build_path}/*.properties - rm -rf ${build_path}/*.clean - - - if [ -d $build_path/plugins ] - then - echo "plugins directory recreate..." - rm -rf $build_path/plugins - mkdir $build_path/plugins - else - echo "Make plugins directory..." - mkdir $build_path/plugins - fi - if [ -d $build_path/features/ ] - then - echo "features directory recreate..." - rm -rf $build_path/features - mkdir $build_path/features - else - echo "Make features directory..." - mkdir $build_path/features - fi - -} - -__copy_build_sources() -{ - echo "Copy features from $SRCDIR to $build_path/features" - temp_dir="`mktemp -d /tmp/da.XXXXX`" - cp -r $SRCDIR/* $temp_dir - cp -r $temp_dir/* $build_path/features - rm -rf $temp_dir - - echo "Copy plugins from $SRCDIR to $build_path/plugins" - temp_dir="`mktemp -d /tmp/da.XXXXX`" - cp -r $SRCDIR/* $temp_dir - cp -r $temp_dir/* $build_path/plugins - rm -rf $temp_dir -} - -__copy_dependency_plugins() -{ - case ${platform} in - ubuntu-32|ubuntu-64|windows-32|windows-64) - dependency_plugin_path=${ROOTDIR}/ide - ;; - macos-64) - dependency_plugin_path=${ROOTDIR}/IDE.app/Contents/Eclipse - ;; - *) - echo "${platform} is not support yet." - ;; - esac - - if [ -d ${dependency_plugin_path} ] + if [ -d ${build_path} ] then - cp -rf ${dependency_plugin_path}/features/* ${build_path}/features/ - cp -rf ${dependency_plugin_path}/plugins/* ${build_path}/plugins/ + rm -rf ${build_path} fi } __set_product_version() { echo "Set product's version (${product_version})" - product_path="${build_path}/plugins/${branding_path}/${branding_file}" + product_path="${SRCDIR}/${branding_path}/${branding_file}" + cp ${product_path} ${product_path}.bkp + sed -e "s;\(\);\1\"${product_version}\"\2;g" \ < ${product_path} > ${product_path}.mod mv ${product_path}.mod ${product_path} - about_mapping_path="${build_path}/plugins/${branding_path}/about.mappings" + about_mapping_path="${SRCDIR}/${branding_path}/about.mappings" + cp ${about_mapping_path} ${about_mapping_path}.bkp + about_version_parameter="1" about_build_time_parameter="2" sed -e "s;\(^${about_version_parameter}=\).*;\1${product_version};g" \ @@ -189,53 +111,25 @@ __set_product_version() { } __set_product_about_info() { - about_mapping_path="${build_path}/plugins/${branding_path}/about.mappings" - about_version_parameter="0" - about_build_time_parameter="1" - sed -e "s;\(^${about_version_parameter}=\).*;\1${product_version};g" \ - -e "s;\(^${about_build_time_parameter}=\).*;\1${build_time};g" \ - < ${about_mapping_path} > ${about_mapping_path}.mod - mv ${about_mapping_path}.mod ${about_mapping_path} + about_mapping_path="${SRCDIR}/${branding_path}/about.mappings" + about_version_parameter="0" + about_build_time_parameter="1" + sed -e "s;\(^${about_version_parameter}=\).*;\1${product_version};g" \ + -e "s;\(^${about_build_time_parameter}=\).*;\1${build_time};g" \ + < ${about_mapping_path} > ${about_mapping_path}.mod + mv ${about_mapping_path}.mod ${about_mapping_path} } -__make_ant_build_properties_file() -{ - builder_path="${SRCDIR}/builder" - parent_path_of_based_eclipse=${reference_ide_path}/.. - - echo "Make build.properties file..." - if [ ! -e $builder_path/build.properties.clean ] ; then - echo "ERROR : \"build.properties.clean\" file does not exist..." - exit 1 - fi - cp $builder_path/build.properties.clean $build_path - cp $builder_path/customTargets.xml $build_path - - if [ -d $reference_ide_path ] - then - sed -e "s;\(^product=\).*;\1/${branding_path}/${branding_file};g" \ - -e "s;\(^buildDirectory=\).*;\1${build_path};g" \ - -e "s;\(^base=\).*;\1${parent_path_of_based_eclipse};g" \ - -e "s;\(^baseLocation=\).*;\1${reference_ide_path};g" \ - -e "s;\(^configs=\).*;\1${archive_platform_name},${windowing},${architecture};g" \ - -e "s;\(^buildType=\).*;\1${build_type};g" \ - -e "s;\(^buildId=\).*;\1${build_id};g" \ - -e "s;\(^archivePrefix=\).*;\1${build_id};g" \ - < $build_path/build.properties.clean > $build_path/build.properties - - else - echo "ERROR : target eclipse is not exist." - exit 1 - fi +__restore_product_info() { + mv ${product_path}.bkp ${product_path} + mv ${about_mapping_path}.bkp ${about_mapping_path} } __execute_pde_build() { echo "Execute Product Ant Builder..." - equinox_launcher=`echo org.eclipse.equinox.launcher_*.jar` - pde_build=`echo org.eclipse.pde.build_*` - - java -server -XX:+UseParNewGC -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 + cd ${SRCDIR} + mvn -DenvOs=${archive_platform_name} -DenvWs=${windowing} -DenvArch=${architecture} clean package if [ $? != 0 ]; then @@ -244,12 +138,6 @@ __execute_pde_build() fi } -__unzip_plugin_pack() -{ - echo "unzip to $build_result_path" - unzip -a $build_result_path/${result_archive_file} -d $build_result_path/${archive_platform_name}.${windowing}.${architecture} -} - build_plugins() { case ${platform} in @@ -271,13 +159,10 @@ build_plugins() __set_parameter __set_build_parameter __clean_build_environment - __copy_build_sources - __copy_dependency_plugins __set_product_version __set_product_about_info - __make_ant_build_properties_file __execute_pde_build - __unzip_plugin_pack + __restore_product_info echo "Build SUCCESS. You will find SDK IDE in \"${build_result_path}\"." } @@ -293,17 +178,11 @@ __clean_packaging_environment() fi } -__copy_necessary_binaries() -{ - echo "add necessary files." -} - packaging_plugins() { __set_parameter __set_install_parameter __clean_packaging_environment - __copy_necessary_binaries install_ide_path=${INSTALL_DIR}/${ide_root_path_name} @@ -312,7 +191,7 @@ packaging_plugins() { mkdir -p ${install_ide_path} fi - cp -rf ${build_result_path}/${archive_platform_name}.${windowing}.${architecture}/${package_name}/* ${install_ide_path}/ + cp -rf ${build_result_path}/* ${install_ide_path}/ echo ${manifest_version} > ${install_ide_path}/version } @@ -337,7 +216,6 @@ packaging_bfiles() ##install_lib_path=${INSTALL_DIR}/${ide_lib_path_name} blib_dir=org.tizen.dynamicanalyzer.workbench/dynamic-analyzer/library tool_dir=tool - cp -rf ${SRCDIR}/${bfile_dir}/config ${install_ide_path}/ mkdir -p ${install_ide_path}/${tool_dir} case ${platform} in ubuntu-32|ubuntu-64)