[Yanel-commits] rev 41922 - in public/yanel/trunk/src/build: .
targets targets/webapp
guillaume at wyona.com
guillaume at wyona.com
Thu Mar 12 20:12:08 CET 2009
Author: guillaume
Date: 2009-03-12 20:12:07 +0100 (Thu, 12 Mar 2009)
New Revision: 41922
Added:
public/yanel/trunk/src/build/targets/build-artifacts.build.xml
Modified:
public/yanel/trunk/src/build/build.xml
public/yanel/trunk/src/build/targets/cmdl.xml
public/yanel/trunk/src/build/targets/webapp/webapp.xml
Log:
Refactoring installation of Yanel JARs in the Maven repository
(this will help getting the Yanel-specific base test classes
into the Eclipse classpath by allowing us to produce a
Yanel test artifact easily).
Also fixed the "compile-impl" which broke when called standalone.
Issue: 6942
Modified: public/yanel/trunk/src/build/build.xml
===================================================================
--- public/yanel/trunk/src/build/build.xml 2009-03-12 16:29:18 UTC (rev 41921)
+++ public/yanel/trunk/src/build/build.xml 2009-03-12 19:12:07 UTC (rev 41922)
@@ -1,6 +1,9 @@
<?xml version="1.0"?>
-<project name="yanel-main" default="deploy" xmlns:artifact="antlib:org.apache.maven.artifact.ant" xmlns:svnant="antlib:org.tigris.subversion.svnant">
+<project name="yanel-main" default="deploy"
+ xmlns:yanel="http://www.wyona.org/yanel/1.0"
+ xmlns:svnant="antlib:org.tigris.subversion.svnant"
+>
<description>Yanel Build</description>
@@ -56,6 +59,7 @@
<import file="targets/cmdl.xml"/>
<import file="targets/test.xml"/>
<import file="targets/config.xml"/>
+ <import file="targets/build-artifacts.build.xml"/>
@@ -108,7 +112,7 @@
</target>
- <target name="compile-core" description="Compile Java classes of Yanel core" depends="init, set-classpath">
+ <target name="compile-core-classes" description="Compile Java classes of Yanel core" depends="init, set-classpath">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${yanel.source.home}/src/core/java/org/wyona/yanel/core"
destdir="${classes.dir}"
@@ -117,44 +121,27 @@
debug="true">
<classpath refid="classpath.compile"/>
</javac>
- <mkdir dir="${yanel.source.home}/build/lib"/>
- <jar destfile="${yanel.source.home}/build/lib/yanel-core-${yanel.version}-r${yanel.revision}.jar"
- basedir="${classes.dir}"
- includes="org/wyona/yanel/core/**"/>
+ </target>
- <copy file="${yanel.source.home}/src/build/pom-core.xml" todir="${yanel.source.home}/build/lib"/>
- <replace file="${yanel.source.home}/build/lib/pom-core.xml" value="${yanel.version}-r${yanel.revision}">
- <replacetoken>@VERSION@</replacetoken>
- </replace>
+ <target name="install-core-jar" description="Install Yanel core JAR" depends="compile-core-classes">
+ <yanel:install-jar id="core"/>
+ </target>
- <artifact:pom id="core.project" file="${yanel.source.home}/build/lib/pom-core.xml"/>
-
- <artifact:install file="${yanel.source.home}/build/lib/yanel-core-${yanel.version}-r${yanel.revision}.jar">
- <pom refid="core.project"/>
- </artifact:install>
+ <target name="compile-core" depends="compile-core-classes, install-core-jar">
</target>
- <target name="compile-impl" description="Compile Java classes of Yanel implementation" depends="init">
+ <target name="compile-impl-classes" description="Compile Java classes of Yanel implementation" depends="init, compile-core">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${yanel.source.home}/src/impl/java/org/wyona/yanel/impl" destdir="${classes.dir}" debug="true">
<classpath refid="classpath.compile"/>
</javac>
+ </target>
- <mkdir dir="${yanel.source.home}/build/lib"/>
- <jar destfile="${yanel.source.home}/build/lib/yanel-impl-${yanel.version}-r${yanel.revision}.jar"
- basedir="${classes.dir}"
- includes="org/wyona/yanel/impl/**"/>
-
- <copy file="${yanel.source.home}/src/build/pom-impl.xml" todir="${yanel.source.home}/build/lib"/>
- <replace file="${yanel.source.home}/build/lib/pom-impl.xml" value="${yanel.version}-r${yanel.revision}">
- <replacetoken>@VERSION@</replacetoken>
- </replace>
+ <target name="install-impl-jar" description="Install Yanel implementation JAR" depends="compile-impl-classes">
+ <yanel:install-jar id="impl"/>
+ </target>
- <artifact:pom id="impl.project" file="${yanel.source.home}/build/lib/pom-impl.xml"/>
-
- <artifact:install file="${yanel.source.home}/build/lib/yanel-impl-${yanel.version}-r${yanel.revision}.jar">
- <pom refid="impl.project"/>
- </artifact:install>
+ <target name="compile-impl" depends="compile-impl-classes, install-impl-jar">
</target>
<target name="source-snapshot" description="Create a source code snapshot" depends="init">
Copied: public/yanel/trunk/src/build/targets/build-artifacts.build.xml (from rev 41914, public/yanel/trunk/src/build/build.xml)
===================================================================
--- public/yanel/trunk/src/build/targets/build-artifacts.build.xml (rev 0)
+++ public/yanel/trunk/src/build/targets/build-artifacts.build.xml 2009-03-12 19:12:07 UTC (rev 41922)
@@ -0,0 +1,30 @@
+<project name="build-artifacts"
+ xmlns:artifact="antlib:org.apache.maven.artifact.ant"
+>
+
+ <!-- Install a Yanel JAR: core, impl, webapp, cmdl, etc. -->
+ <macrodef name="install-jar" uri="http://www.wyona.org/yanel/1.0">
+ <attribute name="id"/>
+ <attribute name="package-dir" default="@{id}"/>
+ <sequential>
+
+ <mkdir dir="${yanel.source.home}/build/lib"/>
+ <jar destfile="${yanel.source.home}/build/lib/yanel-@{id}-${yanel.version}-r${yanel.revision}.jar"
+ basedir="${classes.dir}"
+ includes="org/wyona/yanel/@{package-dir}/**"/>
+
+ <copy file="${yanel.source.home}/src/build/pom-@{id}.xml" todir="${yanel.source.home}/build/lib"/>
+ <replace file="${yanel.source.home}/build/lib/pom-@{id}.xml" value="${yanel.version}-r${yanel.revision}">
+ <replacetoken>@VERSION@</replacetoken>
+ </replace>
+
+ <artifact:pom id="@{id}.project" file="${yanel.source.home}/build/lib/pom-@{id}.xml"/>
+
+ <artifact:install file="${yanel.source.home}/build/lib/yanel-@{id}-${yanel.version}-r${yanel.revision}.jar">
+ <pom refid="@{id}.project"/>
+ </artifact:install>
+
+ </sequential>
+ </macrodef>
+
+</project>
Property changes on: public/yanel/trunk/src/build/targets/build-artifacts.build.xml
___________________________________________________________________
Name: svn:mergeinfo
+
Name: svn:eol-style
+ native
Modified: public/yanel/trunk/src/build/targets/cmdl.xml
===================================================================
--- public/yanel/trunk/src/build/targets/cmdl.xml 2009-03-12 16:29:18 UTC (rev 41921)
+++ public/yanel/trunk/src/build/targets/cmdl.xml 2009-03-12 19:12:07 UTC (rev 41922)
@@ -1,7 +1,8 @@
<?xml version="1.0"?>
+<project name="cmdl"
+ xmlns:yanel="http://www.wyona.org/yanel/1.0"
+>
-<project name="cmdl" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
-
<target name="run-yanel-cmdl" description="Run command line tool" depends="init-runtime">
<echo>Yanel Path: ${yanel.path}</echo>
<!--
@@ -41,29 +42,19 @@
-->
</target>
- <target name="compile-cmdl" description="Compile Java classes of Yanel command line" depends="init, compile-core, set-cmdl-classpath">
- <!--
- TODO: This target is never called
- -->
+ <target name="compile-cmdl-classes" description="Compile Java classes of Yanel command line" depends="init, compile-core, set-cmdl-classpath">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${yanel.source.home}/src/core/java/org/wyona/yanel/cmdl" destdir="${classes.dir}"
debug="true"
classpathref="classpath.cmdl"
/>
- <mkdir dir="${yanel.source.home}/build/lib"/>
- <jar destfile="${yanel.source.home}/build/lib/yanel-cmdl-${yanel.version}-r${yanel.revision}.jar"
- basedir="${classes.dir}"
- includes="org/wyona/yanel/cmdl/**"/>
- <copy file="${yanel.source.home}/src/build/pom-cmdl.xml" tofile="${yanel.source.home}/build/lib/pom-cmdl.xml"/>
- <replace file="${yanel.source.home}/build/lib/pom-cmdl.xml" value="${yanel.version}-r${yanel.revision}">
- <replacetoken>@VERSION@</replacetoken>
- </replace>
+ </target>
- <artifact:pom id="cmdl.project" file="${yanel.source.home}/build/lib/pom-cmdl.xml"/>
- <artifact:install file="${yanel.source.home}/build/lib/yanel-cmdl-${yanel.version}-r${yanel.revision}.jar">
- <pom refid="cmdl.project"/>
- </artifact:install>
+ <target name="install-cmdl-jar" description="Install Yanel command line JAR" depends="compile-cmdl-classes">
+ <yanel:install-jar id="cmdl"/>
</target>
+
+ <target name="compile-cmdl" depends="compile-cmdl-classes, install-cmdl-jar"/>
<target name="set-cmdl-classpath" description="Set classpath" depends="init, dependencies">
<echo>INFO: Set classpath ...</echo>
@@ -74,4 +65,4 @@
</path>
</target>
-</project>
\ No newline at end of file
+</project>
Modified: public/yanel/trunk/src/build/targets/webapp/webapp.xml
===================================================================
--- public/yanel/trunk/src/build/targets/webapp/webapp.xml 2009-03-12 16:29:18 UTC (rev 41921)
+++ public/yanel/trunk/src/build/targets/webapp/webapp.xml 2009-03-12 19:12:07 UTC (rev 41922)
@@ -1,6 +1,7 @@
<?xml version="1.0"?>
-
-<project name="webapp" default="deploy" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
+<project name="webapp" default="deploy"
+ xmlns:yanel="http://www.wyona.org/yanel/1.0"
+>
<target name="deploy" description="Deploy war file" depends="init, webapp">
<condition property="property-tomcat-cluster-node1-is-set">
@@ -145,28 +146,19 @@
<jar jarfile="${yanel.source.home}/build/webapps/${servlet.context.prefix}.war" basedir="${yanel.source.home}/build/webapps/${servlet.context.prefix}"/>
</target>
- <target name="compile-webapp" description="Compile Java classes of Yanel webapp" depends="init, compile-core, compile-cmdl">
+ <target name="compile-webapp-classes" description="Compile Java classes of Yanel webapp" depends="init, compile-core, compile-cmdl"><!--XXX HACK: This is the only place where we compile the command line interface, we should do that elsewhere. -->
<mkdir dir="${classes.dir}"/>
<javac srcdir="${yanel.source.home}/src/webapp/src/java/org/wyona/yanel/servlet" destdir="${classes.dir}"
debug="true"
classpathref="classpath.compile"
/>
- <mkdir dir="${yanel.source.home}/build/lib"/>
- <jar destfile="${yanel.source.home}/build/lib/yanel-webapp-${yanel.version}-r${yanel.revision}.jar"
- basedir="${classes.dir}"
- includes="org/wyona/yanel/servlet/**"/>
-
- <copy file="${yanel.source.home}/src/build/pom-webapp.xml" todir="${yanel.source.home}/build/lib"/>
- <replace file="${yanel.source.home}/build/lib/pom-webapp.xml" value="${yanel.version}-r${yanel.revision}">
- <replacetoken>@VERSION@</replacetoken>
- </replace>
+ </target>
- <artifact:pom id="webapp.project" file="${yanel.source.home}/build/lib/pom-webapp.xml"/>
-
- <artifact:install file="${yanel.source.home}/build/lib/yanel-webapp-${yanel.version}-r${yanel.revision}.jar">
- <pom refid="webapp.project"/>
- </artifact:install>
+ <target name="install-webapp-jar" description="Install Yanel webapp JAR" depends="compile-webapp-classes">
+ <yanel:install-jar id="webapp" package-dir="servlet"/>
</target>
+
+ <target name="compile-webapp" depends="compile-webapp-classes, install-webapp-jar"/>
<target name="createCK" description="Add ssl configuration to your webserver">
<!-- delete already created file -->
More information about the Yanel-commits
mailing list