#!/usr/bin/env kmk_ash # $Id: gen-slickedit-workspace.sh 105381 2024-07-17 14:16:23Z vboxsync $ ## @file # Script for generating a SlickEdit workspace. # # The gen-vscode-workspace.sh script is derived from this one, so fixes here # may apply there too. # # # Copyright (C) 2009-2023 Oracle and/or its affiliates. # # This file is part of VirtualBox base platform packages, as # available from https://www.virtualbox.org. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, in version 3 of the # License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # SPDX-License-Identifier: GPL-3.0-only # # # Include code we share with gen-vscode-workspace.sh # MY_SCRIPT_DIR=. case "$0" in */*|*\\*) MY_SCRIPT_DIR=$(echo "$0" | kmk_sed -e 's,[/\][^/\][^/\]*$,,') ;; esac . "${MY_SCRIPT_DIR}/common-gen-workspace.inc.sh" # # Globals. # MY_PROJECT_FILES="" # # Parameters w/ defaults. # MY_OUT_DIR="SlickEdit" MY_PRJ_PRF="VBox-" MY_WS_NAME="VirtualBox.vpw" MY_DBG="" MY_WINDOWS_HOST="" MY_OPT_MINIMAL="" MY_OPT_USE_WILDCARDS="yes" MY_OPT_ONLY_USERCPP="" ## # Generate folders for the specified directories and files. # # @param $1 The output (base) file name. # @param $2+ The files and directories to traverse. my_generate_folder() { MY_FILE="$1" shift # Zap existing file collections. > "${MY_FILE}-All.lst" > "${MY_FILE}-Sources.lst" > "${MY_FILE}-Headers.lst" > "${MY_FILE}-Assembly.lst" > "${MY_FILE}-Testcases.lst" > "${MY_FILE}-Others.lst" # Traverse the directories and files. while test $# -ge 1 -a -n "${1}"; do for f in ${MY_ROOT_DIR}/$1; do if test -d "${f}"; then if test -z "${MY_OPT_USE_WILDCARDS}"; then my_sub_tree "${MY_FILE}" "${f}" else case "${f}" in ${MY_ROOT_DIR}/include*) #my_sub_tree "${MY_FILE}" "${f}" "Headers" my_wildcard "${MY_FILE}" "${f}" "Headers" ;; *) my_wildcard "${MY_FILE}" "${f}" ;; esac fi else my_file "${MY_FILE}" "${f}" fi done shift done # Generate the folders. if test -s "${MY_FILE}-All.lst"; then ${MY_SORT} "${MY_FILE}-All.lst" | ${MY_SED} -e 's/