diff options
-rwxr-xr-x | build_tools/build_documentation.sh | 95 | ||||
-rw-r--r-- | fish.xcodeproj/project.pbxproj | 229 |
2 files changed, 324 insertions, 0 deletions
diff --git a/build_tools/build_documentation.sh b/build_tools/build_documentation.sh new file mode 100755 index 00000000..232f3469 --- /dev/null +++ b/build_tools/build_documentation.sh @@ -0,0 +1,95 @@ +#!/bin/sh + +# This script is run as part of the build process +# It looks for doc_src, and then builds documentation out of it +# into either help_doc or $BUILT_PRODUCTS_DIR (if set) + +# If running from Xcode, the fish directory is in SRCROOT; +# otherwise assume it's the current directory +FISHDIR=`pwd` +if test -n "$SRCROOT"; then + FISHDIR="$SRCROOT" +fi + +# Make sure doc_src is found +if test ! -d "${FISHDIR}/doc_src"; then + echo >&2 "doc_src not found in '${FISHDIR}'" + exit 1 +fi + +# Make sure doxygen is found +DOXYGENPATH=`command -v doxygen` +if test -z "$DOXYGENPATH" ; then + for i in /usr/local/bin/doxygen /opt/bin/doxygen; do + if test -f "$i"; then + DOXYGENPATH="$i" + break + fi + done +fi + +if test -z "$DOXYGENPATH"; then + echo >&2 "doxygen is not installed, so documentation will not be built." + exit 0 +fi + +# Determine where our output should go +OUTPUTDIR="${FISHDIR}/help_doc" +if test -n "$BUILT_PRODUCTS_DIR"; then + OUTPUTDIR="$BUILT_PRODUCTS_DIR" +fi +mkdir -p "${OUTPUTDIR}" + + +# Make a temporary directory +TMPLOC=`mktemp -d -t fish_doc_build` || { echo >&2 "Could not build documentation because mktemp failed"; exit 1; } + +# Copy stuff to the temp directory +for i in "$FISHDIR"/doc_src/*.txt; do + DOXYFILE=$TMPLOC/`basename $i .txt`.doxygen + echo "/** \page" `basename $i .txt` >$DOXYFILE; + cat $i >>$DOXYFILE; + echo "*/" >>$DOXYFILE; +done + +# Make some extra stuff to pass to doxygen +# Input is kept as . because we cd to the input directory beforehand +# This prevents doxygen from generating "documentation" for intermediate directories +read -d '' DOXYPARAMS <<EOF +PROJECT_NUMBER=2.0.0 +INPUT=. +OUTPUT_DIRECTORY=$OUTPUTDIR +QUIET=YES +EOF + +# echo "$DOXYPARAMS" + +# Clear out the output directory first +find "${OUTPUTDIR}" -name "*.1" -delete + +# Run doxygen +cd "$TMPLOC" +(cat "${FISHDIR}/Doxyfile.help" ; echo "$DOXYPARAMS";) | "$DOXYGENPATH" - + +# Remember errors +RESULT=$? + +if test $RESULT == 0; then + # Postprocess the files + for i in "$FISHDIR"/doc_src/*.txt; do + CMD_NAME=`basename "$i" .txt`; + sed -i '' -e "s/\(.\)\\.SH/\1/" -e "s/$CMD_NAME *\\\\- *\"\(.*\)\"/\1/" "${OUTPUTDIR}/man/man1/${CMD_NAME}.1" + done +fi + +# Destroy TMPLOC +echo "Cleaning up '$TMPLOC'" +#rm -Rf "$TMPLOC" + +if test $RESULT == 0; then + # Tell the user what we did + echo "Output man pages into '${OUTPUTDIR}'" +else + echo "Doxygen failed. See the output log for details." +fi +exit $RESULT diff --git a/fish.xcodeproj/project.pbxproj b/fish.xcodeproj/project.pbxproj index 483bd071..e8d4e366 100644 --- a/fish.xcodeproj/project.pbxproj +++ b/fish.xcodeproj/project.pbxproj @@ -20,10 +20,22 @@ D07D265B15E33B86009E43F6 /* PBXTargetDependency */, D07D265D15E33B86009E43F6 /* PBXTargetDependency */, D07D265F15E33B86009E43F6 /* PBXTargetDependency */, + D0A56500168D257900AF6161 /* PBXTargetDependency */, ); name = install_tree; productName = base; }; + D0A564E6168CFDD800AF6161 /* man_pages */ = { + isa = PBXAggregateTarget; + buildConfigurationList = D0A564E9168CFDD800AF6161 /* Build configuration list for PBXAggregateTarget "man_pages" */; + buildPhases = ( + D0A564EB168CFDDE00AF6161 /* ShellScript */, + ); + dependencies = ( + ); + name = man_pages; + productName = man_pages; + }; D0F019EC15A976F30034B3B1 /* base */ = { isa = PBXAggregateTarget; buildConfigurationList = D0F019ED15A976F30034B3B1 /* Build configuration list for PBXAggregateTarget "base" */; @@ -39,6 +51,7 @@ D0F01A1915AA36310034B3B1 /* PBXTargetDependency */, D0F01A1715AA36300034B3B1 /* PBXTargetDependency */, D0F01A1B15AA36330034B3B1 /* PBXTargetDependency */, + D0A564EF168D09C000AF6161 /* PBXTargetDependency */, ); name = base; productName = base; @@ -57,6 +70,8 @@ D07D266D15E33B86009E43F6 /* functions in Copy Files */ = {isa = PBXBuildFile; fileRef = D025C02815D1FEA100B9DB63 /* functions */; }; D07D266E15E33B86009E43F6 /* tools in Copy Files */ = {isa = PBXBuildFile; fileRef = D025C02915D1FEA100B9DB63 /* tools */; }; D07D267215E34171009E43F6 /* config.fish in Copy Files */ = {isa = PBXBuildFile; fileRef = D0CBD580159EE48F0024809C /* config.fish */; }; + D0A564FE168D23D800AF6161 /* man in CopyFiles */ = {isa = PBXBuildFile; fileRef = D0A564F1168D0BAB00AF6161 /* man */; }; + D0A56501168D258300AF6161 /* man in Copy Files */ = {isa = PBXBuildFile; fileRef = D0A564F1168D0BAB00AF6161 /* man */; }; D0CBD587159EF0E10024809C /* launch_fish.scpt in Resources */ = {isa = PBXBuildFile; fileRef = D0CBD586159EF0E10024809C /* launch_fish.scpt */; }; D0D02A67159837AD008E62BD /* complete.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A0853713B3ACEE0099B651 /* complete.cpp */; }; D0D02A69159837B2008E62BD /* env.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D0A0853A13B3ACEE0099B651 /* env.cpp */; }; @@ -185,6 +200,20 @@ remoteGlobalIDString = D0F019DB15A969970034B3B1; remoteInfo = set_color; }; + D0A564EE168D09C000AF6161 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D0A084F213B3AC130099B651 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A564E6168CFDD800AF6161; + remoteInfo = man_pages; + }; + D0A564FF168D257900AF6161 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = D0A084F213B3AC130099B651 /* Project object */; + proxyType = 1; + remoteGlobalIDString = D0A564E6168CFDD800AF6161; + remoteInfo = man_pages; + }; D0F01A1215AA36280034B3B1 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = D0A084F213B3AC130099B651 /* Project object */; @@ -232,6 +261,7 @@ D033781115DC6D4C00A634BA /* completions in CopyFiles */, D033781215DC6D5200A634BA /* functions in CopyFiles */, D033781315DC6D5400A634BA /* tools in CopyFiles */, + D0A564FE168D23D800AF6161 /* man in CopyFiles */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -255,6 +285,7 @@ D07D266C15E33B86009E43F6 /* completions in Copy Files */, D07D266D15E33B86009E43F6 /* functions in Copy Files */, D07D266E15E33B86009E43F6 /* tools in Copy Files */, + D0A56501168D258300AF6161 /* man in Copy Files */, ); name = "Copy Files"; runOnlyForDeploymentPostprocessing = 1; @@ -402,6 +433,9 @@ D0A0856513B3ACEE0099B651 /* xdgmimeint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeint.cpp; sourceTree = "<group>"; }; D0A0856613B3ACEE0099B651 /* xdgmimemagic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimemagic.cpp; sourceTree = "<group>"; }; D0A0856713B3ACEE0099B651 /* xdgmimeparent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = xdgmimeparent.cpp; sourceTree = "<group>"; }; + D0A564D2168CF34A00AF6161 /* doc_src */ = {isa = PBXFileReference; lastKnownFileType = folder; path = doc_src; sourceTree = "<group>"; }; + D0A564F1168D0BAB00AF6161 /* man */ = {isa = PBXFileReference; lastKnownFileType = text; path = man; sourceTree = BUILT_PRODUCTS_DIR; }; + D0A564F2168D1F2000AF6161 /* build_documentation.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; name = build_documentation.sh; path = build_tools/build_documentation.sh; sourceTree = "<group>"; }; D0B6B0FE14E88BA400AD6C10 /* color.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = color.cpp; sourceTree = "<group>"; }; D0B6B0FF14E88BA400AD6C10 /* color.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = color.h; sourceTree = "<group>"; }; D0C4FD9415A7D7EE00212EF1 /* config.fish */ = {isa = PBXFileReference; lastKnownFileType = text; name = config.fish; path = etc/config.fish; sourceTree = "<group>"; }; @@ -635,9 +669,12 @@ D0C4FD9415A7D7EE00212EF1 /* config.fish */, D07B247515BCC4BE00D4ADB4 /* install.sh */, D0D02AA915985C0C008E62BD /* Info.plist */, + D0A564F2168D1F2000AF6161 /* build_documentation.sh */, + D0A564F1168D0BAB00AF6161 /* man */, D025C02715D1FEA100B9DB63 /* completions */, D025C02815D1FEA100B9DB63 /* functions */, D025C02915D1FEA100B9DB63 /* tools */, + D0A564D2168CF34A00AF6161 /* doc_src */, ); name = Resources; sourceTree = "<group>"; @@ -819,6 +856,7 @@ D0D02ACF1598642A008E62BD /* fish_indent */, D0D02AE315986537008E62BD /* fish_pager */, D0F019DB15A969970034B3B1 /* set_color */, + D0A564E6168CFDD800AF6161 /* man_pages */, D0A084F713B3AC130099B651 /* Makefile */, ); }; @@ -838,6 +876,164 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + D0A564EB168CFDDE00AF6161 /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + "$(SRCROOT)/doc_src/alias.txt", + "$(SRCROOT)/doc_src/and.txt", + "$(SRCROOT)/doc_src/begin.txt", + "$(SRCROOT)/doc_src/bg.txt", + "$(SRCROOT)/doc_src/bind.txt", + "$(SRCROOT)/doc_src/block.txt", + "$(SRCROOT)/doc_src/break.txt", + "$(SRCROOT)/doc_src/breakpoint.txt", + "$(SRCROOT)/doc_src/builtin.txt", + "$(SRCROOT)/doc_src/case.txt", + "$(SRCROOT)/doc_src/cd.txt", + "$(SRCROOT)/doc_src/command.txt", + "$(SRCROOT)/doc_src/commandline.txt", + "$(SRCROOT)/doc_src/complete.txt", + "$(SRCROOT)/doc_src/contains.txt", + "$(SRCROOT)/doc_src/continue.txt", + "$(SRCROOT)/doc_src/count.txt", + "$(SRCROOT)/doc_src/dirh.txt", + "$(SRCROOT)/doc_src/dirs.txt", + "$(SRCROOT)/doc_src/echo.txt", + "$(SRCROOT)/doc_src/else.txt", + "$(SRCROOT)/doc_src/emit.txt", + "$(SRCROOT)/doc_src/end.txt", + "$(SRCROOT)/doc_src/eval.txt", + "$(SRCROOT)/doc_src/exec.txt", + "$(SRCROOT)/doc_src/exit.txt", + "$(SRCROOT)/doc_src/fg.txt", + "$(SRCROOT)/doc_src/fish.txt", + "$(SRCROOT)/doc_src/fish_config.txt", + "$(SRCROOT)/doc_src/fish_indent.txt", + "$(SRCROOT)/doc_src/fish_pager.txt", + "$(SRCROOT)/doc_src/fish_prompt.txt", + "$(SRCROOT)/doc_src/fish_right_prompt.txt", + "$(SRCROOT)/doc_src/fish_update_completions.txt", + "$(SRCROOT)/doc_src/fishd.txt", + "$(SRCROOT)/doc_src/for.txt", + "$(SRCROOT)/doc_src/funced.txt", + "$(SRCROOT)/doc_src/funcsave.txt", + "$(SRCROOT)/doc_src/function.txt", + "$(SRCROOT)/doc_src/functions.txt", + "$(SRCROOT)/doc_src/help.txt", + "$(SRCROOT)/doc_src/history.txt", + "$(SRCROOT)/doc_src/if.txt", + "$(SRCROOT)/doc_src/isatty.txt", + "$(SRCROOT)/doc_src/jobs.txt", + "$(SRCROOT)/doc_src/math.txt", + "$(SRCROOT)/doc_src/mimedb.txt", + "$(SRCROOT)/doc_src/nextd.txt", + "$(SRCROOT)/doc_src/not.txt", + "$(SRCROOT)/doc_src/open.txt", + "$(SRCROOT)/doc_src/or.txt", + "$(SRCROOT)/doc_src/popd.txt", + "$(SRCROOT)/doc_src/prevd.txt", + "$(SRCROOT)/doc_src/psub.txt", + "$(SRCROOT)/doc_src/pushd.txt", + "$(SRCROOT)/doc_src/pwd.txt", + "$(SRCROOT)/doc_src/random.txt", + "$(SRCROOT)/doc_src/read.txt", + "$(SRCROOT)/doc_src/return.txt", + "$(SRCROOT)/doc_src/set.txt", + "$(SRCROOT)/doc_src/set_color.txt", + "$(SRCROOT)/doc_src/source.txt", + "$(SRCROOT)/doc_src/status.txt", + "$(SRCROOT)/doc_src/switch.txt", + "$(SRCROOT)/doc_src/test.txt", + "$(SRCROOT)/doc_src/trap.txt", + "$(SRCROOT)/doc_src/type.txt", + "$(SRCROOT)/doc_src/ulimit.txt", + "$(SRCROOT)/doc_src/umask.txt", + "$(SRCROOT)/doc_src/vared.txt", + "$(SRCROOT)/doc_src/while.txt", + ); + outputPaths = ( + "$(BUILT_PRODUCTS_DIR)/man/man1/alias.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/and.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/begin.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/bg.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/bind.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/block.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/break.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/breakpoint.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/builtin.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/case.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/cd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/command.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/commandline.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/complete.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/contains.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/continue.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/count.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/dirh.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/dirs.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/echo.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/else.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/emit.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/end.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/eval.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/exec.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/exit.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fg.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_config.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_indent.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_pager.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_prompt.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_right_prompt.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fish_update_completions.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/fishd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/for.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/funced.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/funcsave.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/function.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/functions.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/help.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/history.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/if.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/isatty.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/jobs.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/math.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/mimedb.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/nextd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/not.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/open.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/or.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/popd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/prevd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/psub.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/pushd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/pwd.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/random.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/read.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/return.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/set.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/set_color.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/source.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/status.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/switch.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/test.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/trap.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/type.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/ulimit.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/umask.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/vared.1", + "$(BUILT_PRODUCTS_DIR)/man/man1/while.1", + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = /bin/sh; + shellScript = ". \"${SRCROOT}/build_tools/build_documentation.sh\"\n"; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ D0D02AB815985EF9008E62BD /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -978,6 +1174,16 @@ target = D0F019DB15A969970034B3B1 /* set_color */; targetProxy = D07D266015E33B86009E43F6 /* PBXContainerItemProxy */; }; + D0A564EF168D09C000AF6161 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A564E6168CFDD800AF6161 /* man_pages */; + targetProxy = D0A564EE168D09C000AF6161 /* PBXContainerItemProxy */; + }; + D0A56500168D257900AF6161 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = D0A564E6168CFDD800AF6161 /* man_pages */; + targetProxy = D0A564FF168D257900AF6161 /* PBXContainerItemProxy */; + }; D0F01A1315AA36280034B3B1 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = D0D2693B159835CA005D9B9C /* fish_shell */; @@ -1107,6 +1313,20 @@ }; name = Release; }; + D0A564E7168CFDD800AF6161 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + D0A564E8168CFDD800AF6161 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; D0D02AA515985A75008E62BD /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -1325,6 +1545,15 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + D0A564E9168CFDD800AF6161 /* Build configuration list for PBXAggregateTarget "man_pages" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + D0A564E7168CFDD800AF6161 /* Debug */, + D0A564E8168CFDD800AF6161 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; D0D02AA415985A75008E62BD /* Build configuration list for PBXNativeTarget "fish.app" */ = { isa = XCConfigurationList; buildConfigurations = ( |