5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-02 19:50:39 +08:00

SQOOP-78. Consolidate web-based documentation and tarball documentation.

Eliminates "webdocs" target from build, merged with "docs" target.
Web-based format for document delivery is used for local documentation as well.
Links to release notes, API documentation added to documentation homepage.
Release notes are generated for non-SNAPSHOT builds as part of "package" step.

From: Aaron Kimball <aaron@cloudera.com>

git-svn-id: https://svn.apache.org/repos/asf/incubator/sqoop/trunk@1149971 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Andrew Bayer 2011-07-22 20:04:15 +00:00
parent f88bfe27a2
commit f4f0197174
3 changed files with 49 additions and 43 deletions

View File

@ -97,8 +97,6 @@
<property name="tar.file" location="${build.dir}/${artifact.name}.tar.gz" /> <property name="tar.file" location="${build.dir}/${artifact.name}.tar.gz" />
<property name="build.docs.timestamp" <property name="build.docs.timestamp"
location="${build.dir}/docs.timestamp" /> location="${build.dir}/docs.timestamp" />
<property name="build.webdocs.timestamp"
location="${build.dir}/webdocs.timestamp" />
<!-- compilation --> <!-- compilation -->
<property name="javac.deprecation" value="off"/> <property name="javac.deprecation" value="off"/>
@ -450,7 +448,7 @@
</target> </target>
<target name="package" <target name="package"
depends="jar-all,compile-all,docs,javadoc,ivy-retrieve-redist,scripts" depends="jar-all,compile-all,docs,ivy-retrieve-redist,scripts"
description="Create a redistributable package"> description="Create a redistributable package">
<mkdir dir="${dist.dir}"/> <mkdir dir="${dist.dir}"/>
@ -511,6 +509,8 @@
<copy todir="${dist.dir}/docs" includeEmptyDirs="false" flatten="false"> <copy todir="${dist.dir}/docs" includeEmptyDirs="false" flatten="false">
<fileset dir="${build.dir}/docs"> <fileset dir="${build.dir}/docs">
<include name="**/*.html" /> <include name="**/*.html" />
<include name="**/*.css" />
<include name="images/**" />
</fileset> </fileset>
</copy> </copy>
<copy todir="${dist.dir}/docs/man" includeEmptyDirs="false" flatten="false"> <copy todir="${dist.dir}/docs/man" includeEmptyDirs="false" flatten="false">
@ -716,15 +716,6 @@
</uptodate> </uptodate>
</target> </target>
<target name="webdocs-uptodate" depends="init">
<uptodate property="webdocs.uptodate">
<srcfiles dir="${basedir}/src/docs/">
<include name="**/*.txt" />
</srcfiles>
<mapper type="merge" to="${build.webdocs.timestamp}" />
</uptodate>
</target>
<target name="checkversion"> <target name="checkversion">
<if> <if>
<contains string="${version}" substring="SNAPSHOT" /> <contains string="${version}" substring="SNAPSHOT" />
@ -737,6 +728,14 @@
<target name="relnotes-uptodate" depends="init"> <target name="relnotes-uptodate" depends="init">
<!-- releasenotes are considered up-to-date if they exist. --> <!-- releasenotes are considered up-to-date if they exist. -->
<available property="relnotes.exists" file="${relnotes.filename}" /> <available property="relnotes.exists" file="${relnotes.filename}" />
<!-- if we're building a snapshot release, don't make release notes. -->
<if>
<contains string="${version}" substring="SNAPSHOT" />
<then>
<property name="relnotes.exists" value="true" />
</then>
</if>
</target> </target>
<target name="relnotes" depends="relnotes-uptodate" unless="relnotes.exists" <target name="relnotes" depends="relnotes-uptodate" unless="relnotes.exists"
@ -751,11 +750,11 @@
</exec> </exec>
</target> </target>
<target name="release" depends="checkversion,tar,webdocs,relnotes,releaseaudit" <target name="release" depends="checkversion,tar,releaseaudit"
description="Roll a release artifact"> description="Roll a release artifact">
<echo message="Release complete" /> <echo message="Release complete" />
<echo message="Binary tar: ${tar.file}" /> <echo message="Binary tar: ${tar.file}" />
<echo message="Web docs: ${build.dir}/webdocs" /> <echo message="Documentation: ${build.dir}/docs" />
<echo message="Release notes: ${relnotes.filename}" /> <echo message="Release notes: ${relnotes.filename}" />
<echo message="Release audit report: ${build.dir}/rat.log" /> <echo message="Release audit report: ${build.dir}/rat.log" />
</target> </target>
@ -901,20 +900,10 @@
</artifact:deploy> </artifact:deploy>
</target> </target>
<target name="webdocs" depends="webdocs-uptodate" unless="webdocs.uptodate" <target name="docs" depends="real-docs,relnotes,javadoc"
description="Build website documentation"> description="Build documentation"/>
<exec executable="make" failonerror="true">
<arg value="-C" />
<arg value="${basedir}/src/docs" />
<arg value="BUILDROOT=${build.dir}" />
<arg value="VERSION=${version}" />
<arg value="website" />
</exec>
<touch file="${build.webdocs.timestamp}" />
</target>
<target name="docs" depends="docs-uptodate" unless="docs.uptodate" <target name="real-docs" depends="docs-uptodate,init" unless="docs.uptodate">
description="Build documentation">
<exec executable="make" failonerror="true"> <exec executable="make" failonerror="true">
<arg value="-C" /> <arg value="-C" />
<arg value="${basedir}/src/docs" /> <arg value="${basedir}/src/docs" />
@ -941,7 +930,7 @@
<arg value="+%Y" /> <arg value="+%Y" />
</exec> </exec>
<javadoc <javadoc
packagenames="com.cloudera.sqoop.*" packagenames="com.cloudera.sqoop.lib.*"
destdir="${build.javadoc}" destdir="${build.javadoc}"
author="true" author="true"
version="true" version="true"
@ -949,7 +938,9 @@
windowtitle="${Name} ${version} API" windowtitle="${Name} ${version} API"
doctitle="${Name} ${version} API" doctitle="${Name} ${version} API"
bottom="Copyright &amp;copy; ${year} Cloudera, Inc."> bottom="Copyright &amp;copy; ${year} Cloudera, Inc.">
<packageset dir="${src.dir}" /> <packageset dir="${src.dir}">
<include name="com/cloudera/sqoop/lib/**" />
</packageset>
<classpath> <classpath>
<path refid="compile.classpath" /> <path refid="compile.classpath" />
</classpath> </classpath>

View File

@ -15,16 +15,17 @@
BUILDROOT=../../build BUILDROOT=../../build
BUILD_DIR=$(BUILDROOT)/docs BUILD_DIR=$(BUILDROOT)/docs
WEBSITE_DIR=$(BUILDROOT)/webdocs
VERSION=Unknown VERSION=Unknown
all: man userguide devguide all: man userguide devguide supportfiles index
userguide: $(BUILD_DIR)/SqoopUserGuide.html userguide: $(BUILD_DIR)/SqoopUserGuide.html
devguide: $(BUILD_DIR)/SqoopDevGuide.html devguide: $(BUILD_DIR)/SqoopDevGuide.html
index: $(BUILD_DIR)/index.html
MANSOURCES=$(shell echo man/sqoop*.txt) MANSOURCES=$(shell echo man/sqoop*.txt)
MANPAGES=$(MANSOURCES:.txt=.1.gz) MANPAGES=$(MANSOURCES:.txt=.1.gz)
@ -47,9 +48,6 @@ website:
xmlto -o $(WEBSITE_DIR) -m web/html.xsl html-nochunks web/index.xml xmlto -o $(WEBSITE_DIR) -m web/html.xsl html-nochunks web/index.xml
cp web/docbook.css $(WEBSITE_DIR) cp web/docbook.css $(WEBSITE_DIR)
rsync -a web/images $(WEBSITE_DIR)/ rsync -a web/images $(WEBSITE_DIR)/
rm user/SqoopUserGuide.xml
rm dev/SqoopDevGuide.xml
rm web/index.xml
man: $(MANPAGES) man: $(MANPAGES)
@ -62,18 +60,33 @@ man: $(MANPAGES)
mv $@ $(BUILD_DIR) mv $@ $(BUILD_DIR)
$(BUILD_DIR)/SqoopUserGuide.html: user/*.txt $(BUILD_DIR)/SqoopUserGuide.html: user/*.txt
asciidoc -a toc -a toclevels=1 -a "toc-title=Table of Contents" \
-a revnumber=$(VERSION) -a "revdate=$(REVDATE)" \
user/SqoopUserGuide.txt
mkdir -p $(BUILD_DIR) mkdir -p $(BUILD_DIR)
mv user/SqoopUserGuide.html $(BUILD_DIR) asciidoc --unsafe -a revnumber=$(VERSION) \
-b docbook \
user/SqoopUserGuide.txt
xmlto -o $(BUILD_DIR) -m web/html.xsl html-nochunks user/SqoopUserGuide.xml
rm user/SqoopUserGuide.xml
$(BUILD_DIR)/SqoopDevGuide.html: dev/*.txt $(BUILD_DIR)/SqoopDevGuide.html: dev/*.txt
asciidoc -a toc -a toclevels=1 -a "toc-title=Table of Contents" \
-a revnumber=$(VERSION) -a "revdate=$(REVDATE)" \
dev/SqoopDevGuide.txt
mkdir -p $(BUILD_DIR) mkdir -p $(BUILD_DIR)
mv dev/SqoopDevGuide.html $(BUILD_DIR) asciidoc --unsafe -a revnumber=$(VERSION) \
-b docbook \
dev/SqoopDevGuide.txt
xmlto -o $(BUILD_DIR) -m web/html.xsl html-nochunks dev/SqoopDevGuide.xml
rm dev/SqoopDevGuide.xml
$(BUILD_DIR)/index.html: web/index.txt
mkdir -p $(BUILD_DIR)
asciidoc --unsafe -a revnumber=$(VERSION) \
-b docbook \
web/index.txt
xmlto -o $(BUILD_DIR) -m web/html.xsl html-nochunks web/index.xml
rm web/index.xml
supportfiles:
mkdir -p $(BUILD_DIR)
cp web/docbook.css $(BUILD_DIR)
rsync -a web/images $(BUILD_DIR)/
clean: clean:
-rm $(BUILD_DIR)/sqoop-*.1.gz -rm $(BUILD_DIR)/sqoop-*.1.gz
@ -81,5 +94,5 @@ clean:
-rm user/SqoopUserGuide.html -rm user/SqoopUserGuide.html
-rm dev/SqoopDevGuide.html -rm dev/SqoopDevGuide.html
.PHONY: all man userguide devguide clean .PHONY: all man userguide devguide clean supportfiles index

View File

@ -25,4 +25,6 @@ The following pages are the documentation for Sqoop v{revnumber}:
- link:SqoopUserGuide.html[Sqoop User Guide] - link:SqoopUserGuide.html[Sqoop User Guide]
- link:SqoopDevGuide.html[Sqoop Developer's Guide] - link:SqoopDevGuide.html[Sqoop Developer's Guide]
- link:sqoop-{revnumber}.releasenotes.html[Release Notes]
- link:api/index.html[API Documentation]