[Yanel-commits] rev 42121 - public/yanel/trunk/src/test

guillaume at wyona.com guillaume at wyona.com
Mon Mar 23 12:46:35 CET 2009


Author: guillaume
Date: 2009-03-23 12:46:35 +0100 (Mon, 23 Mar 2009)
New Revision: 42121

Added:
   public/yanel/trunk/src/test/.empty.classpath
Modified:
   public/yanel/trunk/src/test/
   public/yanel/trunk/src/test/build.xml
Log:
Yanel test project can now be compiled easily in Eclipse!
To do it run `build -f src/test/build.xml eclipse`
(running `build deploy` before may be need to get the full classpath for building).

Issue: 6942



Property changes on: public/yanel/trunk/src/test
___________________________________________________________________
Name: svn:ignore
   - test-results

   + test-results
build
.classpath
.project


Copied: public/yanel/trunk/src/test/.empty.classpath (from rev 42114, public/0_tools/eclipse-3.settings/empty.classpath)
===================================================================
--- public/yanel/trunk/src/test/.empty.classpath	                        (rev 0)
+++ public/yanel/trunk/src/test/.empty.classpath	2009-03-23 11:46:35 UTC (rev 42121)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="junit"/>
+	<classpathentry kind="src" path="htmlunit"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="output" path="build/classes"/>
+</classpath>


Property changes on: public/yanel/trunk/src/test/.empty.classpath
___________________________________________________________________
Name: svn:mergeinfo
   + 

Modified: public/yanel/trunk/src/test/build.xml
===================================================================
--- public/yanel/trunk/src/test/build.xml	2009-03-23 10:02:20 UTC (rev 42120)
+++ public/yanel/trunk/src/test/build.xml	2009-03-23 11:46:35 UTC (rev 42121)
@@ -3,6 +3,7 @@
  xmlns:yanel="http://www.wyona.org/yanel/1.0"
  xmlns:artifact="antlib:org.apache.maven.artifact.ant"
 >
+  <dirname property="tests.home.dir" file="${ant.file}"/>
 
   <property file="../build/local.build.properties"/>
   <property file="../build/build.properties"/>
@@ -28,6 +29,7 @@
   <import file="../build/targets/build-artifacts.build.xml"/>
   
   <target name="init" depends="dependencies">
+    <!--XXX HACK: we should distinguish between the build classpath and the runtime classpath... -->
     <path id="classpath">
       <pathelement location="${webapp.classes.dir}"/>
       <pathelement path="${maven2.cp}"/>
@@ -63,7 +65,28 @@
 
     <property name="maven2.cp" refid="maven2.classpath"/>
   </target>
+
+  <target name="eclipse:classpath" description="Update Eclipse's .classpath file" depends="init">
+    <ant dir="${yanel.home.dir}/tools/eclipse.settings" target="update-classpath"
+     inheritAll="false" inheritRefs="false">
+      <reference torefid="classpath.ref" refid="classpath"/>
+      <property name="classpath.dir" value="${tests.home.dir}"/>
+      <property name="classpath.template.file" value="${tests.home.dir}/.empty.classpath"/>
+    </ant>
+  </target>
  
+  <target name="eclipse" description="Generate all files needed to use the project under Eclipse (WARNING: .project file will be overwritten!)" depends="eclipse:classpath">
+    <!--XXX HACK: we should generify this instead of stealing files from resource-types' build... -->
+    <copy file="${yanel.home.dir}/src/build/resource-types/Eclipse-3.template.project" tofile="${tests.home.dir}/.project">
+      <filterset>
+        <filter token="RESOURCE_TYPE_NAME" value="yanel-test"/>
+        <filter token="YANEL_VERSION" value="${yanel.version}-r${yanel.revision}"/>
+        <filter token="GENERATION_COMMAND" value="build -f src/test/build.xml eclipse"/>
+      </filterset>
+    </copy>
+    <echo>Eclipse project created: in Eclipse you can now import (as an existing project into your workspace) this project with root directory set to ${tests.home.dir} and build it there!</echo>
+  </target>
+
   <target name="compile-classes" depends="init" description="Compile Java test classes of Yanel">
     <mkdir dir="${build.dir}"/>
     <mkdir dir="${junit.build.dir}"/>



More information about the Yanel-commits mailing list