]> git.donarmstrong.com Git - lilypond.git/commitdiff
convert-ly policy and useful script.
authorGraham Percival <graham@percival-music.ca>
Tue, 26 Oct 2010 07:06:39 +0000 (08:06 +0100)
committerGraham Percival <graham@percival-music.ca>
Wed, 27 Oct 2010 07:46:37 +0000 (08:46 +0100)
Documentation/contributor/doc-work.itexi
Documentation/contributor/programming-work.itexi
scripts/auxiliar/update-with-convert-ly.sh [new file with mode: 0755]

index 0a657de144d15cb13cc7371cebf2aa4ed3bb3840..9ac318eb6d38fe9b244f6dd8e9860abe83c9e627 100644 (file)
@@ -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
index 672533ecb89f20f56beddb91382f013ba398d055..999bc92d2e5013bb3ecebad8e902dd64d2e4fb61 100644 (file)
@@ -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 (executable)
index 0000000..b124d5f
--- /dev/null
@@ -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