From: Graham Percival Date: Tue, 26 Oct 2010 07:06:39 +0000 (+0100) Subject: convert-ly policy and useful script. X-Git-Tag: release/2.13.38-1~13 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=2c532f7c51905250b5bc3cbc178edcf56ce7a0e2;p=lilypond.git convert-ly policy and useful script. --- diff --git a/Documentation/contributor/doc-work.itexi b/Documentation/contributor/doc-work.itexi index 0a657de144..9ac318eb6d 100644 --- a/Documentation/contributor/doc-work.itexi +++ b/Documentation/contributor/doc-work.itexi @@ -1418,15 +1418,9 @@ scripts/auxiliar/strip-whitespace.py Documentation/FILENAME @subheading Updating doc with @command{convert-ly} -cd into @file{Documentation/} and run - -@example -find . -name '*.itely' | xargs convert-ly -e -@end example - -@noindent -This also updates translated documentation. - +Don't. This should be done by programmers when they add new +features. If you notice that it hasn't been done, complain to +@code{lilypond-devel}. @node Docstrings in scheme diff --git a/Documentation/contributor/programming-work.itexi b/Documentation/contributor/programming-work.itexi index 672533ecb8..999bc92d2e 100644 --- a/Documentation/contributor/programming-work.itexi +++ b/Documentation/contributor/programming-work.itexi @@ -1124,8 +1124,8 @@ for feature addition and modification. * Write the code:: * Write regression tests:: * Write convert-ly rule:: -* Automatically update auxiliary information:: -* Manually update auxiliary information:: +* Automatically update documentation:: +* Manually update documentation:: * Edit changes.tely:: * Verify successful build:: * Verify regression tests:: @@ -1191,41 +1191,30 @@ It will change all files in git, so use with caution and examine the resulting diff. -@node Automatically update auxiliary information -@subsection Automatically update auxiliary information +@node Automatically update documentation +@subsection Automatically update documentation -convert-ly should be used to update the documentation, the snippets, -and the regression tests. This not only makes the necessary syntax -changes, it also tests the convert-ly rules. +@command{convert-ly} should be used to update the documentation, +the snippets, and the regression tests. This not only makes the +necessary syntax changes, it also tests the @command{convert-ly} +rules. -The automatic updating is a three step process. First, be sure you -are in the top-level source directory. Then, for the -documentation, do: +The automatic updating is performed by moving to the top-level +source directory, then running: @example -find Documentation/ -name '*.itely' | xargs convert-ly -e --from @qq{@var{X.Y.Z}} +scripts/auxiliar/update-with-convert-ly.sh @end example -@noindent -where @var{X.Y.Z} is the version number of the last released development -version. - -Next, for the snippets, do: +If you did an out-of-tree build, pass in the relative path: @example -find Documentation/snippets/ -name '*.ly' | xargs convert-ly -e --from @qq{@var{X.Y.Z}} -@end example - -Finally, for the regression tests, do: - -@example -find input/regression/ -name '*.ly' | xargs convert-ly -e --from @qq{@var{X.Y.Z}} - +BUILD_DIR=../build-lilypond/ scripts/auxiliar/update-with-convert-ly.sh @end example -@node Manually update auxiliary information -@subsection Manually update auxiliary information +@node Manually update documentation +@subsection Manually update documentation Where the convert-ly rule is not able to automatically update the inline lilypond code in the documentation (i.e. if a NOT_SMART rule is used), the diff --git a/scripts/auxiliar/update-with-convert-ly.sh b/scripts/auxiliar/update-with-convert-ly.sh new file mode 100755 index 0000000000..b124d5ff32 --- /dev/null +++ b/scripts/auxiliar/update-with-convert-ly.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +### are we in the top source dir? +if [ ! -e scripts/convert-ly.py ]; then + echo "Must run from top source directory" + exit 1 +fi + +### get the directories +TOP_SRC_DIR=`pwd` +if [ -z $BUILD_DIR ]; then + BUILD_DIR=. +fi + +### make sure convert-ly is up-to-date +touch python/convertrules.py +touch scripts/convert-ly.py +cd $BUILD_DIR +make +cd $TOP_SRC_DIR + +### update manuals +find Documentation/ -path 'Documentation/snippets' -prune \ + , -name '*.itely' | xargs $BUILD_DIR/out/bin/convert-ly -e -d + +### update .ly files +find . -name '*.ly' | xargs $BUILD_DIR/out/bin/convert-ly -e -d