Commits

tbrugz  committed a42222a

refatoração do build: movendo arquivos

  • Participants
  • Parent commits f0aa2f3

Comments (0)

Files changed (8)

File README.markdown

 * JDK
 * [fop](http://xmlgraphics.apache.org/fop/)
 * [xalan-j 2.7.1](http://xml.apache.org/xalan-j/)
-* ant
-* xml-commons-resolver (versăo utilizada: [1.2](http://www.apache.org/dist/xml/commons/xml-commons-resolver-1.2.zip))
+* [ant](http://ant.apache.org/)
+* xml-commons-resolver - [versăo utilizada: 1.2](http://www.apache.org/dist/xml/commons/xml-commons-resolver-1.2.zip)
 * [epubckeck](http://code.google.com/p/epubcheck/)
 * eclipse (opcional)
 
 
 _para gerar o TCC de teste:_
 
-* renomear `local.template.properties` para `local.properties` e (opcional) alterá-lo 
+* copiar `xsl/docbook-tcc-input.template.xsl` para `xsl/docbook-tcc-input.xsl` e (opcional) alterá-lo
+* (opcional) copiar `local.template.properties` para `local.properties` e alterá-lo 
 * ant: build-all: gera PDF, RTF e EPUB
 
 _outras tarefas ant:_
 * `run-csv2docbooktable`: converte tabelas CSV para formato docbook
 * `fop+acroread`: gera PDF e o visualiza com o acrobat reader (windows)
 * `dtd-validate`: valida arquivo docbook (p.ex.: `test_docbook/docbook-tcc-input.xml`)
+* `run-check-env`: mostra informaçőes sobre configuraçăo do ambiente
 
 _troubleshooting - sem uso de catálogo:_
 
 - [http://www.docbook.org/](http://www.docbook.org/) - `DocBook 5: The Definitive Guide`
 - [http://docbook.sourceforge.net/](http://docbook.sourceforge.net/) - página do projeto docbook
 - [http://www.sagehill.net/docbookxsl/](http://www.sagehill.net/docbookxsl/) - DocBook XSL: The Complete Guide, por Bob Stayton
-- [http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/index.html](http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/index.html) - DocBook Demystification HOWTO, por Eric Raymond
+- [http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/](http://tldp.org/HOWTO/DocBook-Demystification-HOWTO/) - DocBook Demystification HOWTO, por Eric Raymond
 - [http://opensource.bureau-cornavin.com/crash-course/](http://opensource.bureau-cornavin.com/crash-course/) - DocBook Crash Course
 	<!-- fop properties -->
 	<property name="file.xmlinput" value="${srcfiles.dir}/docbook-tcc-input.xml"/>
 	<property name="csv-tables-dir" value="${srcfiles.dir}/tables-csv"/>
-	<property name="file.xsl" value="${srcfiles.dir}/docbook-tcc-input.xsl"/>
+	<property name="file.xsl" value="${xsl.dir}/docbook-tcc-input.xsl"/>
 	<!-- property name="file-epub.xsl" value="${srcfiles.dir}/docbook-tcc-input-epub.xsl"/ --> <!-- not used... -->
 	<property name="file.pdfoutput" value="${dist}/tcc-output.pdf"/>
 	<property name="file.rtfoutput" value="${dist}/tcc-output.rtf"/>
 	<property name="file.epub.output" value="${dist}/tcc-output.epub"/>
 
 	<!-- xsl template properties -->
-	<property name="file-template.xmlinput" value="${xsl.dir}/tcc-eco-template.xml"/>
-	<property name="file-template.output" value="${build}/tcc-eco-template-out.xsl"/>
+	<property name="file-template.xmlinput" value="${xsl.dir}/tcc-eco-xsltemplate.xml"/>
+	<property name="file-template.output" value="${build}/tcc-eco-xsltemplate-out.xsl"/>
 	<property name="file-template.xsl" value="${docbook-xsl-dir}/template/titlepage.xsl"/>
 
 	<path id="foppath">
 	-->
 	<target name="run-proc-fop-test" depends="prepare">
 		<java classname="tbrugz.fop.FOP_Proc" classpathref="foppath" fork="true" dir="${srcfiles.dir}">
-		    <arg value="${file.xmlinput}"/>
-		    <arg value="${file.xsl}"/>
-		    <arg value="${file.pdfoutput}"/>
+			<arg value="${file.xmlinput}"/>
+			<arg value="${file.xsl}"/>
+			<arg value="${file.pdfoutput}"/>
 		</java>
 	</target>
 	
 		-->
 		<delete dir="${file.epub.builddir}"/>
 		<mkdir dir="${file.epub.builddir}"/>
-		<copy file="${xsl.dir}/mimetype.epub" tofile="${file.epub.builddir}/mimetype" />
 		<java classname="org.apache.xalan.xslt.Process" classpathref="foppath" fork="true">
 		    <arg value="-in"/>
 		    <arg value="${file.xmlinput}"/>
 		<!--copy todir="${file.epub.builddir}/OEBPS/covers/">
 			<fileset dir="${srcfiles.dir}/covers/" includes="*.png, *.jpg"/>
 		</copy-->
+		<copy file="${xsl.dir}/mimetype.epub" tofile="${file.epub.builddir}/mimetype" />
 		<copy todir="${file.epub.builddir}/OEBPS/">
 			<fileset dir="${srcfiles.dir}/" includes="**/*.png, **/*.jpg"/>
 		</copy>
 
 		<delete file="${file.epub.output}" />
 
-		<echo message="temp zip n. 1..."/>
 		<zip destfile="${file.epub.output}.mime.zip" basedir="${file.epub.builddir}" includes="mimetype" defaultexcludes="true" compress="false"/>
-
-		<echo message="temp zip n. 2..."/>
 		<zip destfile="${file.epub.output}.rest.zip" basedir="${file.epub.builddir}" update="true" duplicate="preserve" excludes="tcc-output-epub.xml,mimetype"/>
 		
 		<zip destfile="${file.epub.output}"
 
 	<target name="run-env-check">
 		<java classname="org.apache.xalan.xslt.EnvironmentCheck" classpathref="foppath" />
-		<echo message="XML: ${file.xmlinput}" />
-		<echo message="XSL: ${file.xsl}" />
+
+		<available file="${file.xmlinput}" property="file.xmlinput.exists" />
+		<available file="${file.xsl}" property="file.xsl.exists" />
+		<property name="file.xmlinput.exists" value="false"/>
+		<property name="file.xsl.exists" value="false"/>
+		
+		<echo message="XML: ${file.xmlinput} [exists? ${file.xmlinput.exists}]" />
+		<echo message="XSL: ${file.xsl} [exists? ${file.xsl.exists}]" />
 		<echo message="out-PDF: ${file.pdfoutput}" />
 		<echo message="out-RTF: ${file.rtfoutput}" />
 		<echo message="out-EPUB: ${file.epub.output}" />
+		<!--fail message="Files are missing.">
+			<condition>
+				<not>
+					<resourcecount count="2">
+						<fileset dir="." includes="${file.xmlinput.exists}, ${file.xsl.exists}"/>
+					</resourcecount>
+				</not>
+			</condition>
+		</fail-->
 	</target>
 	
 	<target name="compile" depends="prepare">

File test_docbook/covers/tcc-cover-thumbnail.png

Old
Old image
New
New image

File test_docbook/docbook-tcc-input.xsl

-<?xml version="1.0" encoding="ISO-8859-1"?>
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
-	xmlns:fo="http://www.w3.org/1999/XSL/Format" 
-	version="1.0">
-
-<!-- xsl:import href="../../tcc-eco-docbook/docbook-xsl-1.76.1-RC1/fo/docbook.xsl"/ -->
-<xsl:import href="../xsl/tcc-eco.xsl"/>
-
-<xsl:param name="dbk.ufrgs.eco.versao">digital</xsl:param> <!-- ou: impressao --> 
-<xsl:param name="dbk.ufrgs.eco.marcaralteracoes">x</xsl:param> <!-- "x" ou vazio -->
-<xsl:param name="dbk.ufrgs.eco.mostrarnotas">x</xsl:param> <!-- "x" ou vazio -->
-
-</xsl:stylesheet>

File xsl/docbook-tcc-input.template.xsl

+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
+	xmlns:fo="http://www.w3.org/1999/XSL/Format" 
+	version="1.0">
+
+<!-- xsl:import href="../../tcc-eco-docbook/docbook-xsl-1.76.1-RC1/fo/docbook.xsl"/ -->
+<xsl:import href="tcc-eco.xsl"/>
+
+<xsl:param name="dbk.ufrgs.eco.versao">digital</xsl:param> <!-- ou: impressao --> 
+<xsl:param name="dbk.ufrgs.eco.marcaralteracoes">x</xsl:param> <!-- "x" ou vazio -->
+<xsl:param name="dbk.ufrgs.eco.mostrarnotas">x</xsl:param> <!-- "x" ou vazio -->
+
+</xsl:stylesheet>

File xsl/tcc-eco-template.xml

-<!DOCTYPE t:templates [
-<!ENTITY hsize0 "10pt">
-<!ENTITY hsize1 "12pt">
-<!ENTITY hsize2 "14.4pt">
-<!ENTITY hsize3 "17.28pt">
-<!ENTITY hsize4 "20.736pt">
-<!ENTITY hsize5 "24.8832pt">
-<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
-<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
-<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
-<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
-<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
-<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
-]>
-<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
-	     xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
-             xmlns:fo="http://www.w3.org/1999/XSL/Format"
-             xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-
-<!-- ********************************************************************
-     $Id: titlepage.templates.xml 8341 2009-03-16 03:00:56Z bobstayton $
-     ********************************************************************
-
-     This file is part of the DocBook XSL Stylesheet distribution.
-     See ../README or http://docbook.sf.net/ for copyright
-     copyright and other information.
-
-     ******************************************************************** -->
-
-<!-- ==================================================================== -->
-
-  <t:titlepage t:element="book" t:wrapper="fo:block">
-    <t:titlepage-content t:side="recto">
-      <orgname
-        text-align="center"
-		font-size="&hsize1;"
-		font-family="{$title.fontset}" 
-      />
-      
-      <author font-size="&hsize1;"
-	      space-before="4.5cm"
-	      keep-with-next.within-column="always"/>
-
-      <title
-         t:named-template="book.verso.title"
-	     text-align="center"
-	     font-size="&hsize2;"
-	     space-before="2.5cm"
-	     font-weight="bold"
-	     font-family="{$title.fontset}"/>
-	     
-	  <!-- 
-	     t:named-template="division.title"
-	     param:node="ancestor-or-self::book[1]"
-
-         t:named-template="book.verso.title"
-	   -->
-	     
-      <!-- subtitle
-		text-align="center"
-		font-size="&hsize4;"
-		space-before="&hsize4space;"
-		font-family="{$title.fontset}"/>
-      <corpauthor font-size="&hsize3;"
-		  keep-with-next.within-column="always"
-		  space-before="2in"/>
-      <authorgroup space-before="2in"/ -->
-      
-	      
-      <address font-size="&hsize1;"
-          param:node="city[1]"
-	      space-before="9.3cm"
-	      text-align="center"
-	      keep-with-next.within-column="always"/>
-	      
-      <date font-size="&hsize1;"
-	      space-before="0.1cm"
-	      keep-with-next.within-column="always"/>
-      <!-- If you add editor, include this t:predicate attribute
-           because only the first editor generates the list of editors.
-      <editor t:predicate="[position() = 1]"/>
-      -->
-    </t:titlepage-content>
-
-  <t:titlepage-content t:side="verso">
-      <!-- authorgroup t:named-template="verso.authorgroup"/ -->
-      <author font-size="&hsize1;"
-	      space-before="0cm"
-	      text-align="center"
-	      font-weight="bold"
-	      keep-with-next.within-column="always"/>
-      <!-- If you add editor, include this t:predicate attribute
-           because only the first editor generates the list of editors.
-      <editor t:predicate="[position() = 1]"/>
-      -->
-      
-      <!--
-      t:named-template="book.verso.title"
-      t:named-template="division.title"
-      --> 
-      <title
-         t:named-template="division.title"
-	     param:node="ancestor-or-self::book[1]"
-	     font-size="&hsize2;"
-	     font-weight="bold"
-	     font-family="{$title.fontset}"
-	     text-align="center"
-	     space-before="5cm"
-	     />
-
-      <legalnotice
-         space-before="6cm"
-      />
-      <!-- corpauthor/ -->
-      <othercredit/>
-      
-      <address font-size="&hsize1;"
-          select="child::city"
-	      space-before="4.8cm"
-	      text-align="center"
-	      font-weight="bold"
-	      keep-with-next.within-column="always"/>
-	      
-      <date font-size="&hsize1;"
-	      space-before="0.1cm"
-	      text-align="center"
-	      font-weight="bold"
-	      keep-with-next.within-column="always"/>
-      
-      <!-- releaseinfo space-before="0.5em"/>
-      <pubdate space-before="1em"/>
-      <copyright/>
-      <abstract/-->
-  </t:titlepage-content>
-
-  <t:titlepage-separator>
-      <fo:block break-after="page"/>
-  </t:titlepage-separator>
-
-  <t:titlepage-before t:side="recto">
-  </t:titlepage-before>
-
-  <t:titlepage-before t:side="verso">
-      <fo:block break-after="page"/>
-  </t:titlepage-before>
-</t:titlepage>
-
-<!-- ==================================================================== -->
-
-</t:templates>

File xsl/tcc-eco-xsltemplate.xml

+<!DOCTYPE t:templates [
+<!ENTITY hsize0 "10pt">
+<!ENTITY hsize1 "12pt">
+<!ENTITY hsize2 "14.4pt">
+<!ENTITY hsize3 "17.28pt">
+<!ENTITY hsize4 "20.736pt">
+<!ENTITY hsize5 "24.8832pt">
+<!ENTITY hsize0space "7.5pt"> <!-- 0.75 * hsize0 -->
+<!ENTITY hsize1space "9pt"> <!-- 0.75 * hsize1 -->
+<!ENTITY hsize2space "10.8pt"> <!-- 0.75 * hsize2 -->
+<!ENTITY hsize3space "12.96pt"> <!-- 0.75 * hsize3 -->
+<!ENTITY hsize4space "15.552pt"> <!-- 0.75 * hsize4 -->
+<!ENTITY hsize5space "18.6624pt"> <!-- 0.75 * hsize5 -->
+]>
+<t:templates xmlns:t="http://nwalsh.com/docbook/xsl/template/1.0"
+	     xmlns:param="http://nwalsh.com/docbook/xsl/template/1.0/param"
+             xmlns:fo="http://www.w3.org/1999/XSL/Format"
+             xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+
+<!-- ********************************************************************
+     $Id: titlepage.templates.xml 8341 2009-03-16 03:00:56Z bobstayton $
+     ********************************************************************
+
+     This file is part of the DocBook XSL Stylesheet distribution.
+     See ../README or http://docbook.sf.net/ for copyright
+     copyright and other information.
+
+     ******************************************************************** -->
+
+<!-- ==================================================================== -->
+
+  <t:titlepage t:element="book" t:wrapper="fo:block">
+    <t:titlepage-content t:side="recto">
+      <orgname
+        text-align="center"
+		font-size="&hsize1;"
+		font-family="{$title.fontset}" 
+      />
+      
+      <author font-size="&hsize1;"
+	      space-before="4.5cm"
+	      keep-with-next.within-column="always"/>
+
+      <title
+         t:named-template="book.verso.title"
+	     text-align="center"
+	     font-size="&hsize2;"
+	     space-before="2.5cm"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"/>
+	     
+	  <!-- 
+	     t:named-template="division.title"
+	     param:node="ancestor-or-self::book[1]"
+
+         t:named-template="book.verso.title"
+	   -->
+	     
+      <!-- subtitle
+		text-align="center"
+		font-size="&hsize4;"
+		space-before="&hsize4space;"
+		font-family="{$title.fontset}"/>
+      <corpauthor font-size="&hsize3;"
+		  keep-with-next.within-column="always"
+		  space-before="2in"/>
+      <authorgroup space-before="2in"/ -->
+      
+	      
+      <address font-size="&hsize1;"
+          param:node="city[1]"
+	      space-before="9.3cm"
+	      text-align="center"
+	      keep-with-next.within-column="always"/>
+	      
+      <date font-size="&hsize1;"
+	      space-before="0.1cm"
+	      keep-with-next.within-column="always"/>
+      <!-- If you add editor, include this t:predicate attribute
+           because only the first editor generates the list of editors.
+      <editor t:predicate="[position() = 1]"/>
+      -->
+    </t:titlepage-content>
+
+  <t:titlepage-content t:side="verso">
+      <!-- authorgroup t:named-template="verso.authorgroup"/ -->
+      <author font-size="&hsize1;"
+	      space-before="0cm"
+	      text-align="center"
+	      font-weight="bold"
+	      keep-with-next.within-column="always"/>
+      <!-- If you add editor, include this t:predicate attribute
+           because only the first editor generates the list of editors.
+      <editor t:predicate="[position() = 1]"/>
+      -->
+      
+      <!--
+      t:named-template="book.verso.title"
+      t:named-template="division.title"
+      --> 
+      <title
+         t:named-template="division.title"
+	     param:node="ancestor-or-self::book[1]"
+	     font-size="&hsize2;"
+	     font-weight="bold"
+	     font-family="{$title.fontset}"
+	     text-align="center"
+	     space-before="5cm"
+	     />
+
+      <legalnotice
+         space-before="6cm"
+      />
+      <!-- corpauthor/ -->
+      <othercredit/>
+      
+      <address font-size="&hsize1;"
+          select="child::city"
+	      space-before="4.8cm"
+	      text-align="center"
+	      font-weight="bold"
+	      keep-with-next.within-column="always"/>
+	      
+      <date font-size="&hsize1;"
+	      space-before="0.1cm"
+	      text-align="center"
+	      font-weight="bold"
+	      keep-with-next.within-column="always"/>
+      
+      <!-- releaseinfo space-before="0.5em"/>
+      <pubdate space-before="1em"/>
+      <copyright/>
+      <abstract/-->
+  </t:titlepage-content>
+
+  <t:titlepage-separator>
+      <fo:block break-after="page"/>
+  </t:titlepage-separator>
+
+  <t:titlepage-before t:side="recto">
+  </t:titlepage-before>
+
+  <t:titlepage-before t:side="verso">
+      <fo:block break-after="page"/>
+  </t:titlepage-before>
+</t:titlepage>
+
+<!-- ==================================================================== -->
+
+</t:templates>

File xsl/tcc-eco.xsl

 
 <xsl:import href="../../tcc-eco-docbook/docbook-xsl-1.76.1-RC1/fo/docbook.xsl"/>
 <xsl:include href="tcc-eco-xtra.xsl"/>
-<xsl:include href="../build/tcc-eco-template-out.xsl"/> 
+<xsl:include href="../build/tcc-eco-xsltemplate-out.xsl"/> 
 
 <!--
 dbk.ufrgs.eco.versao: "digital" ou "impressao" - versăo digital bota links externos em azul