You are viewing a plain text version of this content. The canonical link for it is here.
Posted to alexandria-dev@jakarta.apache.org by ru...@apache.org on 2002/01/14 14:29:34 UTC
cvs commit: jakarta-alexandria/proposal/gump/stylesheet bash.xsl build.xsl win2k.xsl
rubys 02/01/14 05:29:34
Modified: proposal/gump build.xml
proposal/gump/java Project.java Workspace.java
proposal/gump/site/xdocs workspace.xml
proposal/gump/stylesheet bash.xsl build.xsl win2k.xsl
Log:
Provide the ability to save the jars produced into a separate directory
Revision Changes Path
1.7 +0 -1 jakarta-alexandria/proposal/gump/build.xml
Index: build.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/build.xml,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- build.xml 9 Jan 2002 11:58:53 -0000 1.6
+++ build.xml 14 Jan 2002 13:29:34 -0000 1.7
@@ -26,7 +26,6 @@
<srcfiles dir="profile" includes="*.xml"/>
<srcfiles dir="project" includes="*.xml"/>
<srcfiles dir="repository" includes="*.xml"/>
- <srcfiles dir="stylesheet" includes="*.xsl"/>
</uptodate>
<uptodate property="javadocs.uptodate" targetfile="javadocs/index.html">
1.27 +19 -1 jakarta-alexandria/proposal/gump/java/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Project.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- Project.java 13 Jan 2002 12:15:05 -0000 1.26
+++ Project.java 14 Jan 2002 13:29:34 -0000 1.27
@@ -246,11 +246,14 @@
* self contained.
*/
private void expandDepends() throws Exception {
+ String jardir = Workspace.getJarDir();
+
for (Enumeration e=dependsOn.keys(); e.hasMoreElements(); ) {
String name = (String)e.nextElement();
+ Element depend = (Element) dependsOn.get(name);
Project target = (Project)projects.get(name);
+ boolean buildable = false;
- Element depend = (Element) dependsOn.get(name);
if (!depend.getNodeName().equals("option")) {
require(target, "project", name);
}
@@ -266,8 +269,23 @@
depend.appendChild(child.cloneNode(false));
} else if (child.getNodeName().equals("ant")) {
depend.appendChild(document.createElement("ant"));
+ buildable = true;
} else if (child.getNodeName().equals("script")) {
depend.appendChild(document.createElement("script"));
+ buildable = true;
+ }
+ }
+
+ if (buildable && !jardir.equals("")) {
+ String module = target.get("module");
+ depend.setAttribute("home", jardir + "/" + module);
+ child=depend.getFirstChild();
+ for (; child != null; child=child.getNextSibling()) {
+ if (child.getNodeName().equals("jar")) {
+ String jarname = ((Element)child).getAttribute("name");
+ jarname = jarname.substring(jarname.lastIndexOf("/")+1);
+ ((Element)child).setAttribute("name", jarname);
+ }
}
}
}
1.3 +8 -0 jakarta-alexandria/proposal/gump/java/Workspace.java
Index: Workspace.java
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/java/Workspace.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Workspace.java 28 Oct 2001 02:48:48 -0000 1.2
+++ Workspace.java 14 Jan 2002 13:29:34 -0000 1.3
@@ -26,6 +26,14 @@
}
/**
+ * Static property accessor for jardir attribute.
+ * @return Package directory associated with this workspace
+ */
+ public static String getJarDir() {
+ return element.getAttribute("jardir");
+ }
+
+ /**
* Static property accessor for javadoc element.
* @return Javadoc element (if any) associated with this workspace
*/
1.9 +10 -0 jakarta-alexandria/proposal/gump/site/xdocs/workspace.xml
Index: workspace.xml
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/site/xdocs/workspace.xml,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- workspace.xml 8 Jan 2002 18:10:17 -0000 1.8
+++ workspace.xml 14 Jan 2002 13:29:34 -0000 1.9
@@ -50,6 +50,16 @@
<td>No. Defaults to ${basedir}/log</td>
</tr>
<tr>
+ <td>jardir</td>
+ <td>Directory into which the generated jars are copied. This
+ May be useful for a number of reasons. First, the results
+ themselves may be something worth publishing. Second, it allows
+ an greater range of development - e.g., build clean won't affect
+ the availability of jars. Finally, it may allow you to get further
+ without hitting command line length restrictions.</td>
+ <td>No. If this option is not specified, the jars aren't copied.</td>
+ </tr>
+ <tr>
<td>version</td>
<td>Which version of the Gump dtd this workspace was defined against.
The current version is "0.3".
1.67 +25 -5 jakarta-alexandria/proposal/gump/stylesheet/bash.xsl
Index: bash.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/bash.xsl,v
retrieving revision 1.66
retrieving revision 1.67
diff -u -r1.66 -r1.67
--- bash.xsl 27 Nov 2001 11:15:44 -0000 1.66
+++ bash.xsl 14 Jan 2002 13:29:34 -0000 1.67
@@ -465,11 +465,31 @@
<!-- =================================================================== -->
<xsl:template match="copy">
- <xsl:text>eval "cp -r </xsl:text>
- <xsl:value-of select="translate(@fromdir,'\','/')"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="translate(@todir,'\','/')"/>
- <xsl:text> $OUT 2>&1" </xsl:text>
+ <xsl:if test="@fromdir">
+ <xsl:text>eval "cp -r </xsl:text>
+ <xsl:value-of select="translate(@fromdir,'\','/')"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="translate(@todir,'\','/')"/>
+ <xsl:text> $OUT 2>&1" </xsl:text>
+ </xsl:if>
+
+ <xsl:if test="@file">
+ <xsl:text>eval "test -f </xsl:text>
+ <xsl:value-of select="translate(@file,'\','/')"/>
+ <xsl:text> -a ! -d </xsl:text>
+ <xsl:value-of select="translate(@todir,'\','/')"/>
+ <xsl:text> mkdir </xsl:text>
+ <xsl:value-of select="translate(@todir,'\','/')"/>
+ <xsl:text> $OUT 2>&1" </xsl:text>
+
+ <xsl:text>eval "test -f </xsl:text>
+ <xsl:value-of select="translate(@file,'\','/')"/>
+ <xsl:text> cp </xsl:text>
+ <xsl:value-of select="translate(@file,'\','/')"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="translate(@todir,'\','/')"/>
+ <xsl:text> $OUT 2>&1" </xsl:text>
+ </xsl:if>
</xsl:template>
<!-- =================================================================== -->
1.48 +13 -0 jakarta-alexandria/proposal/gump/stylesheet/build.xsl
Index: build.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/build.xsl,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -r1.47 -r1.48
--- build.xsl 23 Oct 2001 19:35:52 -0000 1.47
+++ build.xsl 14 Jan 2002 13:29:34 -0000 1.48
@@ -47,6 +47,9 @@
<sync fromdir="{$cvsdir}/{@name}" todir="{@srcdir}"/>
</xsl:if>
</xsl:for-each>
+ <xsl:if test="@jardir">
+ <delete dir="{@jardir}"/>
+ </xsl:if>
</logic>
</content>
</html>
@@ -203,6 +206,16 @@
</classpath>
<xsl:apply-templates select="ant|script"/>
+
+ <!-- Optionally save any jars produced -->
+ <xsl:if test="/workspace/@jardir">
+ <xsl:variable name="jardir" select="/workspace/@jardir"/>
+ <xsl:variable name="home" select="@home"/>
+ <xsl:variable name="module" select="@module"/>
+ <xsl:for-each select="jar">
+ <copy file="{$home}/{@name}" todir="{$jardir}/{$module}"/>
+ </xsl:for-each>
+ </xsl:if>
<chdir dir="{$basedir}"/>
</logic>
1.34 +25 -5 jakarta-alexandria/proposal/gump/stylesheet/win2k.xsl
Index: win2k.xsl
===================================================================
RCS file: /home/cvs/jakarta-alexandria/proposal/gump/stylesheet/win2k.xsl,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -r1.33 -r1.34
--- win2k.xsl 27 Nov 2001 11:15:44 -0000 1.33
+++ win2k.xsl 14 Jan 2002 13:29:34 -0000 1.34
@@ -413,11 +413,31 @@
<!-- =================================================================== -->
<xsl:template match="copy">
- <xsl:text>xcopy /E /I /Q /R /K </xsl:text>
- <xsl:value-of select="translate(@fromdir,'/','\')"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="translate(@todir,'/','\')"/>
- <xsl:text> %OUT% 2>&1 </xsl:text>
+ <xsl:if test="@fromdir">
+ <xsl:text>xcopy /E /I /Q /R /K </xsl:text>
+ <xsl:value-of select="translate(@fromdir,'/','\')"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="translate(@todir,'/','\')"/>
+ <xsl:text> %OUT% 2>&1 </xsl:text>
+ </xsl:if>
+
+ <xsl:if test="@file">
+ <xsl:text>if exist </xsl:text>
+ <xsl:value-of select="translate(@file,'/','\')"/>
+ <xsl:text> if not exist </xsl:text>
+ <xsl:value-of select="translate(@todir,'/','\')"/>
+ <xsl:text> mkdir </xsl:text>
+ <xsl:value-of select="translate(@todir,'/','\')"/>
+ <xsl:text> %OUT% 2>&1 </xsl:text>
+
+ <xsl:text>if exist </xsl:text>
+ <xsl:value-of select="translate(@file,'/','\')"/>
+ <xsl:text> copy /Y </xsl:text>
+ <xsl:value-of select="translate(@file,'/','\')"/>
+ <xsl:text> </xsl:text>
+ <xsl:value-of select="translate(@todir,'/','\')"/>
+ <xsl:text> %OUT% 2>&1 </xsl:text>
+ </xsl:if>
</xsl:template>
<!-- =================================================================== -->
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>