[Yanel-commits] rev 41961 - in public/yanel/trunk/src/build:
resource-types targets
targets/create-new-resource-type/from-scratch-resource-template
guillaume at wyona.com
guillaume at wyona.com
Mon Mar 16 11:47:35 CET 2009
Author: guillaume
Date: 2009-03-16 11:47:35 +0100 (Mon, 16 Mar 2009)
New Revision: 41961
Added:
public/yanel/trunk/src/build/resource-types/Eclipse-3.template.project
Modified:
public/yanel/trunk/src/build/resource-types/resource-type.build.xml
public/yanel/trunk/src/build/targets/create-new-resource-type.xml
public/yanel/trunk/src/build/targets/create-new-resource-type/from-scratch-resource-template/build.xml
Log:
The .project file for Eclipse for resource-types can now also be generated
using `build -f ... eclipse` (this also triggers regeneration of the associated .classpath file).
Also WRT resource-types created from scratch: added some inline help and fixed the initial Ant project name.
Issue: 6942
Added: public/yanel/trunk/src/build/resource-types/Eclipse-3.template.project
===================================================================
--- public/yanel/trunk/src/build/resource-types/Eclipse-3.template.project (rev 0)
+++ public/yanel/trunk/src/build/resource-types/Eclipse-3.template.project 2009-03-16 10:47:35 UTC (rev 41961)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>@RESOURCE_TYPE_NAME@</name>
+ <comment>Generated by Yanel @YANEL_VERSION@ using `@GENERATION_COMMAND@`. Please do not edit manually unless you know what you are doing!</comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
Modified: public/yanel/trunk/src/build/resource-types/resource-type.build.xml
===================================================================
--- public/yanel/trunk/src/build/resource-types/resource-type.build.xml 2009-03-16 09:55:57 UTC (rev 41960)
+++ public/yanel/trunk/src/build/resource-types/resource-type.build.xml 2009-03-16 10:47:35 UTC (rev 41961)
@@ -54,6 +54,17 @@
</ant>
</target>
+ <target name="eclipse" description="Generate all files needed to use the resource type under Eclipse (WARNING: .project file will be overwritten!)" depends="eclipse:classpath">
+ <copy file="${yanel.home}/src/build/resource-types/Eclipse-3.template.project" tofile="${resource.home.dir}/.project">
+ <filterset>
+ <filter token="RESOURCE_TYPE_NAME" value="${ant.project.name}"/>
+ <filter token="YANEL_VERSION" value="${yanel.version}-r${yanel.revision}"/>
+ <filter token="GENERATION_COMMAND" value="build -f ${ant.file} eclipse"/>
+ </filterset>
+ </copy>
+ <echo>Eclipse project created: in Eclipse you can now import (as an existing project into your workspace) this resource-type with root directory set to ${resource.home.dir} and build it there!</echo>
+ </target>
+
<target name="compile" description="Compile Java classes" depends="init">
<mkdir dir="${resource.classes.dir}"/>
Modified: public/yanel/trunk/src/build/targets/create-new-resource-type/from-scratch-resource-template/build.xml
===================================================================
--- public/yanel/trunk/src/build/targets/create-new-resource-type/from-scratch-resource-template/build.xml 2009-03-16 09:55:57 UTC (rev 41960)
+++ public/yanel/trunk/src/build/targets/create-new-resource-type/from-scratch-resource-template/build.xml 2009-03-16 10:47:35 UTC (rev 41961)
@@ -1,3 +1,3 @@
-<project name="yanel-resource">
+<project name="yanel-from-scratch-resource-type">
<import file="${yanel.source.home}/src/build/resource-types/resource-type.build.xml"/>
</project>
Modified: public/yanel/trunk/src/build/targets/create-new-resource-type.xml
===================================================================
--- public/yanel/trunk/src/build/targets/create-new-resource-type.xml 2009-03-16 09:55:57 UTC (rev 41960)
+++ public/yanel/trunk/src/build/targets/create-new-resource-type.xml 2009-03-16 10:47:35 UTC (rev 41961)
@@ -67,6 +67,12 @@
<replacetoken>from-scratch</replacetoken>
</replace>
+ <!-- Patch build.xml -->
+ <replace file="${yanel.source.home}/src/contributions/resources/${new.resource.name}/build.xml" value="${new.resource.name}">
+ <replacetoken>from-scratch</replacetoken>
+ </replace>
+
+ <!-- Finalize creation based on chosen Java class template -->
<echo>${new.resource.java.class}</echo>
<if>
@@ -225,5 +231,8 @@
</replace>
</then>
</if>
+
+ <!-- Help user to find out what he can do next -->
+ <echo>New resource type "${new.resource.name}" is now created! Please note that to build it you can either keep using the integrated build system or directly use Eclipse: for details, please run `build -f ${yanel.source.home}/src/contributions/resources/${new.resource.name}/build.xml -p`.</echo>
</target>
</project>
More information about the Yanel-commits
mailing list