ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r731504 - in /ant/ivy/ivyde/trunk: build.xml org.apache.ivyde.eclipse/ org.apache.ivyde.eclipse/META-INF/MANIFEST.MF org.apache.ivyde.eclipse/build.properties org.apache.ivyde.eclipse/plugin.xml template-eclipse-doc.html
Date Mon, 05 Jan 2009 09:25:55 GMT
Author: hibou
Date: Mon Jan  5 01:25:55 2009
New Revision: 731504

URL: http://svn.apache.org/viewvc?rev=731504&view=rev
Log:
IVYDE-150: Add the IvyDE documentation to the Eclipse help
 - add a xooki template used for the eclipse doc
 - add the declaration of the doc in the plugin
 - add an ant target to generate the doc formatted for the eclipse plugin
 - add an ant target to generate the eclipse toc from the xooki one

Added:
    ant/ivy/ivyde/trunk/template-eclipse-doc.html   (with props)
Modified:
    ant/ivy/ivyde/trunk/build.xml
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/   (props changed)
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/build.properties
    ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml

Modified: ant/ivy/ivyde/trunk/build.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/build.xml?rev=731504&r1=731503&r2=731504&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/build.xml (original)
+++ ant/ivy/ivyde/trunk/build.xml Mon Jan  5 01:25:55 2009
@@ -28,22 +28,27 @@
 - local.build.properties : properties handled by developers, ignored by subversion.
                            The baseLocation property should be set there.
 -->
-<project name="ivyde" basedir="." default="build">
+<project name="ivyde" basedir="." default="build" xmlns:xooki="antlib:xooki">
+
+    <taskdef uri="antlib:xooki" file="${basedir}/doc/xooki/antlib.xml" />
 
     <property file="local.build.properties" />
     <property file="build.properties" />
 
     <property name="work.dir" value="${basedir}/work"/>
     <property name="ivy.work.dir" value="${work.dir}/ivy"/>
+    <property name="doc.work.dir" value="${work.dir}/doc"/>
     <property name="eclipse.work.dir" value="${work.dir}/eclipse"/>
     <property name="dist.dir" value="${basedir}/dist"/>
+    <property name="eclipse-doc.dir" value="${basedir}/org.apache.ivyde.eclipse/doc" />
+    <property name="src.doc.dir" value="${basedir}/doc" />
 
     <target name="/release" description="Make the build artifacts tagged with the release
version">
         <property name="forceContextQualifier" value="${version.qualifier}" />
         <property name="generateFeatureVersionSuffix" value="false" />
     </target>
 
-    <target name="dist" depends="build,sources,checksum" description="Build every artifacts
for distribution" />
+    <target name="dist" depends="generate-eclipse-doc,build,sources,checksum" description="Build
every artifacts for distribution" />
 
     <target name="clean" description="Remove every build artifacts">
         <delete dir="${work.dir}" />
@@ -320,4 +325,87 @@
         </fail>
         <echo message="SHA Checksum verify passed successfully" />
     </target>
+
+    <!--
+        ======================================================================================
+        Targets related to the generation of the documentation included in the eclipse plugin
+        ======================================================================================
+     -->
+
+    <target name="generate-eclipse-doc" depends="clean-eclipse-doc,generate-eclipse-doc-html,generate-eclipse-doc-files,generate-eclipse-toc">
+    </target>
+
+    <target name="clean-eclipse-doc">
+        <delete dir="${doc.work.dir}" />
+        <delete dir="${eclipse-doc.dir}" />
+    </target>
+
+    <target name="generate-eclipse-doc-html">
+        <copy todir="${doc.work.dir}">
+            <fileset dir="${src.doc.dir}" />
+        </copy>
+        <copy file="${basedir}/template-eclipse-doc.html" tofile="${doc.work.dir}/template.html"
overwrite="true"/>
+        <property name="checkUpToDate" value="true" />
+        <xooki:generate destDir="${eclipse-doc.dir}" checkUpToDate="${checkUpToDate}">
+            <fileset dir="${doc.work.dir}">
+                <include name="**/*.html"/>
+                <exclude name="template.html"/>
+                <exclude name="**/xooki/**"/>
+            </fileset>
+        </xooki:generate>
+    </target>
+
+    <target name="generate-eclipse-doc-files">
+        <property name="checkUpToDate" value="true" />
+        <condition property="overwrite">
+             <isfalse value="${checkUpToDate}"/>
+        </condition>
+        <copy todir="${eclipse-doc.dir}" overwrite="${overwrite}">
+            <fileset dir="${src.doc.dir}">
+                <include name="style/**" />
+                <include name="js/**" />
+                <include name="images/**" />
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="generate-eclipse-toc">
+        <scriptdef name="generate-eclipse-toc" language="javascript">
+            <attribute name="jsontocfile" />
+            <attribute name="destFile"/>
+            <![CDATA[
+                importPackage(java.io);
+                importPackage(javax.xml.xpath);
+                importPackage(org.xml.sax);
+                importPackage(javax.xml.parsers);
+
+                var tocfile = self.getProject().resolveFile(attributes.get("jsontocfile"))
+                r = new BufferedReader(new FileReader(tocfile));
+                var val = "";
+                while((s = r.readLine()) != null) {
+                    val += s;
+                }
+                r.close();
+                var toc = eval("("+val+")")
+
+                var writeTopic = function(o, children, indent) {
+                    for(var c in children) {
+                        o.write(indent + '<topic label="' + children[c].title + '" href="doc/'
+ children[c].id + '.html">\n');
+                        if (children[c].children && children[c].children.length &&
children[c].children.length != 0) {
+                            writeTopic(o, children[c].children, indent+'    ');
+                        }
+                        o.write(indent+'</topic>\n');
+                    }
+                };
+
+                out = new FileWriter(self.getProject().resolveFile(attributes.get("destfile")));
+                out.write('<toc label="IvyDE user documentation">\n')
+                writeTopic(out, toc.children[0].children, '    ');
+                out.write('</toc>\n');
+                out.close();
+            ]]>
+        </scriptdef>
+        <generate-eclipse-toc jsontocfile="${src.doc.dir}/toc.json" destFile="${eclipse-doc.dir}/toc.xml"
/>
+    </target>
+
 </project>

Propchange: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Mon Jan  5 01:25:55 2009
@@ -1 +1,3 @@
 bin
+doc
+

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF?rev=731504&r1=731503&r2=731504&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/META-INF/MANIFEST.MF Mon Jan  5 01:25:55
2009
@@ -31,5 +31,6 @@
  org.eclipse.jdt.core,
  org.eclipse.jdt.ui,
  org.eclipse.ui.console,
- org.apache.ivy
+ org.apache.ivy,
+ org.eclipse.help
 Eclipse-LazyStart: true

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/build.properties
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/build.properties?rev=731504&r1=731503&r2=731504&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/build.properties (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/build.properties Mon Jan  5 01:25:55 2009
@@ -21,7 +21,8 @@
 bin.includes = plugin.xml,\
                ivyde-eclipse.jar,\
                icons/,\
-               META-INF/
+               META-INF/,\
+               doc/
                
 module.type = tools
 

Modified: ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml?rev=731504&r1=731503&r2=731504&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml (original)
+++ ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/plugin.xml Mon Jan  5 01:25:55 2009
@@ -209,6 +209,13 @@
             state="true">
       </decorator>
    </extension>
+   <extension
+         point="org.eclipse.help.toc">
+      <toc
+            file="doc/toc.xml"
+            primary="true">
+      </toc>
+   </extension>
    
 
 

Added: ant/ivy/ivyde/trunk/template-eclipse-doc.html
URL: http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/template-eclipse-doc.html?rev=731504&view=auto
==============================================================================
--- ant/ivy/ivyde/trunk/template-eclipse-doc.html (added)
+++ ant/ivy/ivyde/trunk/template-eclipse-doc.html Mon Jan  5 01:25:55 2009
@@ -0,0 +1,37 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<!--
+   Licensed to the Apache Software Foundation (ASF) under one
+   or more contributor license agreements.  See the NOTICE file
+   distributed with this work for additional information
+   regarding copyright ownership.  The ASF licenses this file
+   to you 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.    
+-->
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+<head>
+<title>${title} | IvyDE</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+  <link rel="stylesheet" type="text/css" href="style/style.css" />
+  <style type="text/css">
+body  {
+  background-color: #ffffff;
+}
+</style>
+</head>
+<body>
+		<div id="main">
+		<h1 class="title">${title}</h1>
+            ${body}
+ 		</div>
+</body>
+</html>

Propchange: ant/ivy/ivyde/trunk/template-eclipse-doc.html
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ant/ivy/ivyde/trunk/template-eclipse-doc.html
------------------------------------------------------------------------------
    svn:keywords = Date Revision Author HeadURL Id

Propchange: ant/ivy/ivyde/trunk/template-eclipse-doc.html
------------------------------------------------------------------------------
    svn:mime-type = text/html



Mime
View raw message