All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timo Mueller <mail@timomueller.eu>
To: yocto@yoctoproject.org
Cc: Timo Mueller <timo.mueller@bmw-carit.de>
Subject: [RFC v5 09/12] scripts/generate-doc.sh: Add script to handle eclipse help generation
Date: Fri,  8 Feb 2013 14:24:39 +0100	[thread overview]
Message-ID: <3d62d994c01a6fbdc3baf0ee2de7e89c1ddbaaf7.1360320932.git.timo.mueller@bmw-carit.de> (raw)
In-Reply-To: <16b4f90332e22cf61937a70a8469f78a58d1790b.1360320932.git.timo.mueller@bmw-carit.de>
In-Reply-To: <cover.1360320932.git.timo.mueller@bmw-carit.de>

From: Timo Mueller <timo.mueller@bmw-carit.de>

This script will checkout the yocto-docs project containing the
official yocto documentation. After successful checkout the eclipse
help is generated and the about.html file of the doc.user plugin is
created.

Signed-off-by: Timo Mueller <timo.mueller@bmw-carit.de>
---
 scripts/generate-doc.sh | 85 +++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 85 insertions(+)
 create mode 100755 scripts/generate-doc.sh

diff --git a/scripts/generate-doc.sh b/scripts/generate-doc.sh
new file mode 100755
index 0000000..7152d6f
--- /dev/null
+++ b/scripts/generate-doc.sh
@@ -0,0 +1,85 @@
+#!/bin/sh
+
+help()
+{
+	echo "Generate and add eclipse help from yocto's documentation"
+	echo "Usage: $0 BRANCH_NAME PLUGIN_FOLDER"
+	echo "       $0 -t TAG_NAME PLUGIN_FOLDER"
+	echo ""
+	echo "Options:"
+	echo "-h - display this help and exit"
+	echo "-t TAG_NAME - tag to build the documentation upon"
+	echo "BRANCH_NAME - branch to build the documentation upon"
+	echo "PLUGIN_FOLDER - root folder of the eclipse-poky project"
+	exit 1
+}
+
+fail ()
+{
+  local retval=$1
+  shift $1
+  echo "[Fail $retval]: $*"
+  echo "BUILD_TOP=${BUILD_TOP}"
+  cd ${TOP}
+  exit ${retval}
+}
+
+CHECKOUT_TAG=0
+while getopts ":ht" opt; do
+	case $opt in
+		h)
+			help
+			;;
+		t)
+			CHECKOUT_TAG=1
+			;;
+	esac
+done
+shift $(($OPTIND - 1))
+
+if [ $# -ne 2 ]; then
+	help
+fi
+
+if [ $CHECKOUT_TAG -eq 0 ]; then
+	REFERENCE=origin/$1
+else
+	REFERENCE=$1
+fi
+PLUGIN_FOLDER=`readlink -f $2`
+
+TOP=`pwd`
+
+DOC_DIR=${PLUGIN_FOLDER}/docs
+rm -rf ${DOC_DIR}
+DOC_PLUGIN_DIR=${PLUGIN_FOLDER}/plugins/org.yocto.doc.user
+DOC_HTML_DIR=${DOC_PLUGIN_DIR}/html/
+
+# git clone
+#DOC_GIT=git://git.yoctoproject.org/yocto-docs.git
+DOC_GIT=file:///home/timo/_dev/oss/yocto/yocto-docs
+git clone ${DOC_GIT} ${DOC_DIR} || fail $? "git clone ${DOC_GIT}"
+cd ${DOC_DIR}
+git checkout ${REFERENCE} || fail $? "git checkout ${REFERENCE}"
+COMMIT_ID=`git rev-parse HEAD`
+
+# build and copy
+DOCS="yocto-project-qs adt-manual kernel-dev \
+      bsp-guide ref-manual dev-manual profile-manual"
+
+cd documentation
+ECLIPSE_TARGET_AVAILABLE=`make -q eclipse &> /dev/null; echo $?`
+if [ ${ECLIPSE_TARGET_AVAILABLE} -ne 1 ]; then
+	echo "WARNING:"
+	echo "This version does not support generating eclipse help"
+	echo "Documentation will not be available in eclipse"
+	exit 1
+fi
+
+for DOC in ${DOCS}; do
+	make DOC=${DOC} eclipse
+done
+
+sed -e "s/@.*@/${COMMIT_ID}/" < ${DOC_PLUGIN_DIR}/about.html.in > ${DOC_PLUGIN_DIR}/about.html
+
+cd ${TOP}
-- 
1.7.11.7



  reply	other threads:[~2013-02-08 13:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-08 13:24 [RFC v5 00/12][eclipse-poky] Integrate yocto documentation into eclipse Timo Mueller
2013-02-08 13:24 ` [RFC v5 01/12] features/sdk.site: Fixed typo in category name Timo Mueller
2013-02-08 13:24   ` [RFC v5 02/12] Fixed typo in version variable name Timo Mueller
2013-02-08 13:24     ` [RFC v5 03/12] plugins/sdk.ide.doc.user: Add empty eclipse help Timo Mueller
2013-02-08 13:24       ` [RFC v5 04/12] plugins/sdk.ide.doc.user: Add about.html to prepare addition of yocto documentation Timo Mueller
2013-02-08 13:24         ` [RFC v5 05/12] features/org.yocto.doc: Add new feature containing yocto project documentation Timo Mueller
2013-02-08 13:24           ` [RFC v5 06/12] features/doc.headless.build: Added headless build for yocto.doc feature Timo Mueller
2013-02-08 13:24             ` [RFC v5 07/12] features/sdk.site: Added yocto.doc feature to update site Timo Mueller
2013-02-08 13:24               ` [RFC v5 08/12] scripts/build.sh: Added yocto.doc feature to build Timo Mueller
2013-02-08 13:24                 ` Timo Mueller [this message]
2013-02-08 13:24                   ` [RFC v5 10/12] plugins/sdk.ide.doc.user: Add yocto documentation to the table of contents Timo Mueller
2013-02-08 13:24                     ` [RFC v5 11/12] scripts/generate-doc.sh: Copy generated eclipse help into the user.doc plugin Timo Mueller
2013-02-08 13:24                       ` [RFC v5 12/12] scripts/build.sh: Add documentation generation to the default build Timo Mueller
2013-02-08 21:03 ` [RFC v5 00/12][eclipse-poky] Integrate yocto documentation into eclipse Zhang, Jessica

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3d62d994c01a6fbdc3baf0ee2de7e89c1ddbaaf7.1360320932.git.timo.mueller@bmw-carit.de \
    --to=mail@timomueller.eu \
    --cc=timo.mueller@bmw-carit.de \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.