VirtualBox

Changeset 43632 in vbox for trunk/tools/bin


Ignore:
Timestamp:
Oct 12, 2012 12:11:01 PM (12 years ago)
Author:
vboxsync
Message:

gen-slickedit-workspace.sh: use wildcards so we don't need to regenerate the project when files are added or moved.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/gen-slickedit-workspace.sh

    r43401 r43632  
    6666MY_WINDOWS_HOST=""
    6767MY_OPT_MINIMAL=""
     68MY_OPT_USE_WILDCARDS="yes"
    6869
    6970#MY_KBUILD_PATH="${KBUILD_PATH}"
     
    113114# @param    $1      The output file name base.
    114115# @param    $2      The file name.
     116# @param    $3      Optional folder override.
    115117my_file()
    116118{
     
    128130
    129131        # by extension.
    130         *.c|*.cpp|*.m|*.mm|*.pl|*.py|*.as|*.c.h|*.cpp.h)
     132        *.c|*.cpp|*.m|*.mm|*.pl|*.py|*.as|*.c.h|*.cpp.h|*.java)
    131133            MY_FOLDER="$1-Sources.lst"
    132134            ;;
     
    144146            ;;
    145147    esac
     148    if test -n "$3";
     149    then
     150        MY_FOLDER="$1-$3.lst"
     151    fi
    146152
    147153    ## @todo only files which are in subversion.
     
    153159
    154160##
     161# Generate file entry for the specified file if it was found to be of interest.
     162#
     163# @param    $1      The output file name base.
     164# @param    $2      The wildcard spec.
     165my_wildcard()
     166{
     167    EXCLUDES="*.log;*.kup;*~;*.pyc;*.exe;*.sys;*.dll;*.o;*.obj;*.lib;*.a;*.ko;*.class;.svn/*"
     168    echo '        <F N="'"${2}"'/*" Recurse="1" Excludes="'"${EXCLUDES}"'"/>' >> "$1-All.lst"
     169}
     170
     171##
    155172# Generate file entries for the specified sub-directory tree.
    156173#
    157174# @param    $1      The output filename.
    158175# @param    $2      The sub-directory.
     176# @param    $3      Optional folder override.
    159177my_sub_tree()
    160178{
     
    173191        if test -d "${f}";
    174192        then
    175             my_sub_tree "${1}" "${f}"
     193            my_sub_tree "${1}" "${f}" "${3}"
    176194        else
    177             my_file "${1}" "${f}"
     195            my_file "${1}" "${f}" "${3}"
    178196        fi
    179197    done
     
    193211
    194212    # Zap existing file collections.
     213    > "${MY_FILE}-All.lst"
    195214    > "${MY_FILE}-Sources.lst"
    196215    > "${MY_FILE}-Headers.lst"
     
    206225            if test -d "${f}";
    207226            then
    208                 my_sub_tree "${MY_FILE}" "${f}"
     227                if test -z "${MY_OPT_USE_WILDCARDS}";
     228                then
     229                    my_sub_tree "${MY_FILE}" "${f}"
     230                else
     231                    case "${f}" in
     232                        ${MY_ROOT_DIR}/include*)
     233                            my_sub_tree "${MY_FILE}" "${f}" "Headers"
     234                            ;;
     235                        *)  my_wildcard "${MY_FILE}" "${f}"
     236                            ;;
     237                    esac
     238                fi
    209239            else
    210240                my_file "${MY_FILE}" "${f}"
     
    215245
    216246    # Generate the folders.
     247    if test -s "${MY_FILE}-All.lst";
     248    then
     249        ${MY_SORT} "${MY_FILE}-All.lst"   | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/          /' >> "${MY_FILE}"
     250    fi
    217251    if test -s "${MY_FILE}-Sources.lst";
    218252    then
     
    223257    if test -s "${MY_FILE}-Headers.lst";
    224258    then
    225         echo '        <Folder Name="Headers"  Filters="*.h;*.hpp">' >> "${MY_FILE}"
     259        if test -z "${MY_OPT_USE_WILDCARDS}";
     260        then
     261            echo '        <Folder Name="Headers"  Filters="*.h;*.hpp">' >> "${MY_FILE}"
     262        else
     263            echo '        <Folder Name="Headers"  Filters="">' >> "${MY_FILE}"
     264        fi
    226265        ${MY_SORT} "${MY_FILE}-Headers.lst"   | ${MY_SED} -e 's/<!-- sortkey: [^>]*>/          /' >> "${MY_FILE}"
    227266        echo '        </Folder>' >> "${MY_FILE}"
     
    247286
    248287    # Cleanup
    249     ${MY_RM}  "${MY_FILE}-Sources.lst" "${MY_FILE}-Headers.lst" "${MY_FILE}-Assembly.lst" "${MY_FILE}-Testcases.lst" "${MY_FILE}-Others.lst"
     288    ${MY_RM}  "${MY_FILE}-All.lst" "${MY_FILE}-Sources.lst" "${MY_FILE}-Headers.lst" "${MY_FILE}-Assembly.lst" \
     289        "${MY_FILE}-Testcases.lst" "${MY_FILE}-Others.lst"
    250290}
    251291
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette