[izpack-changes] r1891 - in izpack-src/trunk/src: . dist-files doc-reST

noreply at berlios.de noreply at berlios.de
Thu Nov 8 04:42:31 CET 2007


Author: jponge
Date: 2007-11-08 04:42:13 +0100 (Thu, 08 Nov 2007)
New Revision: 1891

Modified:
   izpack-src/trunk/src/build.xml
   izpack-src/trunk/src/dist-files/IzPack-install.xml
   izpack-src/trunk/src/doc-reST/build.py
Log:
* The documentation build script is now a full-fledge application
* Ant calls this script properly
* The PDF documentation pack is back in the IzPack installer


Modified: izpack-src/trunk/src/build.xml
===================================================================
--- izpack-src/trunk/src/build.xml	2007-11-07 07:59:37 UTC (rev 1890)
+++ izpack-src/trunk/src/build.xml	2007-11-08 03:42:13 UTC (rev 1891)
@@ -165,7 +165,10 @@
      and time. This will effect in directory _dist. This won't effect to compiled files and
      other files which are manipulated during the process.
 
+  08.11.2007: (Julien Ponge)
+     Call the new docutils-based documentation build system.
 
+
   Mini-HowTo:
 
   To compile and package the compiler.jar jar file, type:
@@ -203,8 +206,8 @@
     <property name="cwd" value="${basedir}" />
 
     <property file="src/ant.properties" />
-    <property name="ver" value="3.10" />
-    <property name="rel" value="2" />
+    <property name="ver" value="3.11" />
+    <property name="rel" value="0-beta1" />
     <property name="build.number" value="${ver}.${rel}" />
 
     <property name="src.dir" value="${basedir}/src/lib" />
@@ -910,12 +913,21 @@
     </target>
 
     <target name="build.docu" description="Builds the customer documentation">
-        <mkdir dir="${doc.dir}/izpack/xhtml" />
-        <copy todir="${doc.dir}/izpack/xhtml" preservelastmodified="true">
-            <fileset dir="${basedir}/src/doc-ng/XHTML">
+        <exec executable="python" dir="${basedir}/src/doc-reST">
+            <arg value="build.py"/>
+        </exec>
+        <mkdir dir="${doc.dir}/izpack/html" />
+        <copy todir="${doc.dir}/izpack/html" preservelastmodified="true">
+            <fileset dir="${basedir}/src/doc-reST/html">
                 <include name="**/*" />
             </fileset>
         </copy>
+        <mkdir dir="${doc.dir}/izpack/pdf" />
+        <copy todir="${doc.dir}/izpack/pdf" preservelastmodified="true">
+            <fileset dir="${basedir}/src/doc-reST/pdf">
+                <include name="manual.pdf" />
+            </fileset>
+        </copy>
     </target>
 
     <target name="create.docu"
@@ -1091,6 +1103,12 @@
     	  <include name="**/*.sh"/>
     	  <include name="compile"/>
     	</fixcrlf>
+    	<fixcrlf srcdir="${dist.dir}" eol="dos" eof="add">
+            <include name="**/*.bat"/>
+        </fixcrlf>
+    	<fixcrlf srcdir="${dist.bin.dir}" eol="dos" eof="add">
+    	  <include name="**/*.bat"/>
+    	</fixcrlf>
     </target>
 
     <!-- Runs a testing installer. -->

Modified: izpack-src/trunk/src/dist-files/IzPack-install.xml
===================================================================
--- izpack-src/trunk/src/dist-files/IzPack-install.xml	2007-11-07 07:59:37 UTC (rev 1890)
+++ izpack-src/trunk/src/dist-files/IzPack-install.xml	2007-11-08 03:42:13 UTC (rev 1891)
@@ -23,7 +23,7 @@
     <!-- The info section -->
     <info>
         <appname>IzPack</appname>
-        <appversion>3.10.2</appversion>
+        <appversion>3.11.0-beta1</appversion>
         <authors>
             <author email="" name="Julien Ponge (maintainer and original developer)"/>
 
@@ -113,13 +113,11 @@
         <res src="Unix_shortcutSpec.xml" id="Unix_shortcutSpec.xml"/>
         <res src="core.png" id="ImgPacksPanel.img.0"/>
         <res src="doc-html.png" id="ImgPacksPanel.img.1"/>
-        <res src="javadocs.png" id="ImgPacksPanel.img.2"/>
-        <res src="doc-nanoxml.png" id="ImgPacksPanel.img.3"/>
-        <!--
-            <res src="doc-pdf.png" id="ImgPacksPanel.img.2" />
-        -->
-        <res src="sample.png" id="ImgPacksPanel.img.4"/>
-        <res src="src.png" id="ImgPacksPanel.img.5"/>
+        <res src="doc-pdf.png" id="ImgPacksPanel.img.2"/>
+        <res src="javadocs.png" id="ImgPacksPanel.img.3"/>
+        <res src="doc-nanoxml.png" id="ImgPacksPanel.img.4"/>
+        <res src="sample.png" id="ImgPacksPanel.img.5"/>
+        <res src="src.png" id="ImgPacksPanel.img.6"/>
         <res src="border1.png" id="Installer.image.0"/>
         <res src="border2.png" id="Installer.image.1"/>
         <res src="border3.png" id="Installer.image.2"/>
@@ -142,10 +140,6 @@
         <panel classname="SummaryPanel" id="summarypanel"/>
         <panel classname="InstallPanel" id="installpanel"/>
         <panel classname="ShortcutPanel" id="shortcutpanel"/>
-        <!-- We use temporary the FinishPanel in the 3.9 Release
-             to get Access to the [Generate an automatic installation script]-Button
-             to get feedback so quick as possible from all of users,
-             who wants to get back this feature ;-) -->
         <panel classname="FinishPanel" id="finishpanel"/>
     </panels>
 
@@ -175,13 +169,19 @@
         </pack>
 
         <!-- The documentation -->
-        <pack name="XHTML Documentation" required="no" packImgId="ImgPacksPanel.img.1">
-            <description>The IzPack documentation (XHTML version).</description>
+        <pack name="HTML Documentation" required="no" packImgId="ImgPacksPanel.img.1">
+            <description>The IzPack documentation (HTML version).</description>
             <fileset dir="" targetdir="$INSTALL_PATH">
-                <include name="doc/izpack/xhtml/**/*"/>
+                <include name="doc/izpack/html/**/*"/>
             </fileset>
         </pack>
-        <pack name="Java Documentation" required="no" packImgId="ImgPacksPanel.img.2">
+        <pack name="PDF Documentation" required="no" packImgId="ImgPacksPanel.img.2">
+            <description>The IzPack documentation (PDF version).</description>
+            <fileset dir="" targetdir="$INSTALL_PATH">
+            <include name="doc/izpack/pdf/**/*" />
+            </fileset>
+        </pack>
+        <pack name="Javadocs Documentation" required="no" packImgId="ImgPacksPanel.img.3">
             <description>
                 The IzPack Java documentation (Javadocs for IzPack developers).
             </description>
@@ -189,17 +189,7 @@
                 <include name="doc/izpack/javadoc/**/*"/>
             </fileset>
         </pack>
-        <!--
-            Disabled while doc-ng not provides a pdf ...
-
-            <pack name="PDF Documentation" required="no">
-            <description>The IzPack documentation (PDF version).</description>
-            <fileset dir="" targetdir="$INSTALL_PATH">
-            <include name="doc/izpack/pdf/**/*" />
-            </fileset>
-            </pack>
-        -->
-        <pack name="NanoXML Documentation" required="no" packImgId="ImgPacksPanel.img.3">
+        <pack name="NanoXML Documentation" required="no" packImgId="ImgPacksPanel.img.4">
             <description>NanoXML documentation (for IzPack developers).</description>
             <fileset dir="" targetdir="$INSTALL_PATH">
                 <include name="doc/nanoxml/**/*"/>
@@ -208,7 +198,7 @@
 
 
         <!-- A trivial sample to get started -->
-        <pack name="Sample" required="no" packImgId="ImgPacksPanel.img.4">
+        <pack name="Sample" required="no" packImgId="ImgPacksPanel.img.5">
             <description>A sample installation.</description>
             <fileset dir="" targetdir="$INSTALL_PATH">
                 <include name="sample/**/*"/>
@@ -216,7 +206,7 @@
         </pack>
 
         <!-- The source code of this version -->
-        <pack name="Sources" required="no" packImgId="ImgPacksPanel.img.5">
+        <pack name="Sources" required="no" packImgId="ImgPacksPanel.img.6">
             <description>The full IzPack source code.</description>
             <fileset dir="" targetdir="$INSTALL_PATH">
                 <include name="src/**/*"/>

Modified: izpack-src/trunk/src/doc-reST/build.py
===================================================================
--- izpack-src/trunk/src/doc-reST/build.py	2007-11-07 07:59:37 UTC (rev 1890)
+++ izpack-src/trunk/src/doc-reST/build.py	2007-11-08 03:42:13 UTC (rev 1891)
@@ -1,35 +1,90 @@
 #!/usr/bin/env python
+# ........................................................................... #
+#
+# This script generates the documentation using Python docutils.
+#
+# It requires the following softwares to be installed and made available from
+# the invocation path context:
+#
+# 	- Python (of course!)
+# 	- the docutils module (see http://docutils.sourceforge.net/)
+#   - a LaTeX distribution to invoke 'pdflatex' (MikTeX, TeXLive, teTeX, ...)
+#
+# It should be noted that the pdflatex invocation can be skipped if necessary
+# by using a special command-line flag.
+#
+# ........................................................................... #
+#
+# IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
+#  
+# https://izpack.github.io/
+# http://developer.berlios.de/projects/izpack/
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#     http://www.apache.org/licenses/LICENSE-2.0
+#      
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ........................................................................... #
 
 import os
 import shutil
 
-REST_FILES = [
-	'index',
-	'introduction',
-	'getting-started',
-	'installation-files',
-	'advanced-features',
-	'desktop-shortcuts',
-	'creating-panels',
-	'user-input',
-	'custom-actions',
-	'apache-license',
-	'cc-license',
-	'cookbooks'
-]
+from optparse import OptionParser
+from docutils.core import publish_cmdline as publish
 
-DIRS = ['html', 'pdf']
+def create_dirs():
+	print('Creating output directories...')
+	for d in ['html', 'pdf']:
+		if not os.path.exists(d):	os.makedirs(d)
 
-for d in DIRS:
-	if not os.path.exists(d):
-		os.makedirs(d)
+def scan_files():
+	print('Scanning files...')
+	rest_files = [ f[0:(len(f) - 4)] for f in os.listdir('.') if f.endswith('.txt') and f != 'pdf-version.txt' ]
+	pictures   = [ f for f in os.listdir('.') if f.endswith('.png') or f.endswith('.jpg') ]
+	return rest_files, pictures
 
-for rest_file in REST_FILES:
-	os.system('rst2html.py %s.txt html/%s.html' % (rest_file, rest_file))
+def copy_files(pictures):
+	print('Copying pictures...')
+	for pic in pictures:
+		print('    ' + pic)
+		shutil.copyfile(pic, 'html/' + pic)
+		shutil.copyfile(pic, 'pdf/' + pic)
 
-os.system('rst2newlatex.py pdf-version.txt pdf/manual.tex')
+def generate_html(rest_files):
+	print('Generating html...')
+	for rest_file in rest_files:
+		print('    ' + rest_file)
+		publish(writer_name='html', argv=['%s.txt' % rest_file, 'html/%s.html' % rest_file])
+ 
+def generate_latex():
+	print('Generating LaTeX for PDF output...')
+	publish(writer_name='newlatex2e', argv=['pdf-version.txt', 'pdf/manual.tex'])
 
-for f in os.listdir('.'):
-	if f.endswith('.png') or f.endswith('.jpg'):
-		shutil.copyfile(f, 'html/' + f)
-		shutil.copyfile(f, 'pdf/' + f)
\ No newline at end of file
+def compile_latex():
+	print('Generating PDF from LaTeX...')
+	os.chdir('pdf')
+	for i in xrange(1,4):
+		print('    pdflatex pass #%i' % i)
+		os.system('pdflatex --interaction=batchmode manual.tex')
+		os.chdir('..')
+
+if __name__ == '__main__':
+	parser = OptionParser()
+	parser.add_option("-n", "--no-pdflatex", dest="pdflatex", action="store_false",
+                  	default=True, help="don't call pdflatex")
+	options, args = parser.parse_args()
+
+	rest_files, pictures = scan_files()
+	create_dirs()
+	copy_files(pictures)
+	generate_html(rest_files)
+	generate_latex()
+	if options.pdflatex: compile_latex()
+	
+	print('Done')



More information about the izpack-changes mailing list