[jbossws-commits] JBossWS SVN: r7542 - common/trunk/src/main/java/org/jboss/ws/tools/ant.
jbossws-commits at lists.jboss.org
jbossws-commits at lists.jboss.org
Sat Jun 14 08:58:11 EDT 2008
Author: alessio.soldano at jboss.com
Date: 2008-06-14 08:58:11 -0400 (Sat, 14 Jun 2008)
New Revision: 7542
Modified:
common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseClasspathTask.java
common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseJUnitTestsTask.java
Log:
[JBWS-2232] Adding test.resources.directory and test.archive.directory parameters to Eclipse launch files + removing non-jar files from Eclipse .classpath file
Modified: common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseClasspathTask.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseClasspathTask.java 2008-06-14 12:40:57 UTC (rev 7541)
+++ common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseClasspathTask.java 2008-06-14 12:58:11 UTC (rev 7542)
@@ -109,7 +109,7 @@
sb.append("<classpathentry kind=\"con\" path=\"org.eclipse.jdt.launching.JRE_CONTAINER\"/>\n");
for (int i = 0; i < libs.length; i++)
{
- if (new File(libs[i]).exists())
+ if (new File(libs[i]).exists() && libs[i].endsWith(".jar")) //jar files only can be used as lib entry
{
sb.append("<classpathentry kind=\"lib\" path=\"");
sb.append(absoluteToRelativePath(libs[i]));
Modified: common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseJUnitTestsTask.java
===================================================================
--- common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseJUnitTestsTask.java 2008-06-14 12:40:57 UTC (rev 7541)
+++ common/trunk/src/main/java/org/jboss/ws/tools/ant/EclipseJUnitTestsTask.java 2008-06-14 12:58:11 UTC (rev 7542)
@@ -47,6 +47,8 @@
{
private String projectName;
private String projectWorkingDir; // the Eclipse project working dir, i.e. the output dir
+ private String testResourcesDir; //the dir containing the resources files
+ private String testLibsDir; //the dir containing the libs files
private String srcDir; // the tests src dir
private String integrationTarget;
private String jbossHome;
@@ -111,12 +113,14 @@
conf.putStringAttribute("org.eclipse.jdt.launching.PROJECT_ATTR", projectName);
// computing the userDir; please note we get the relative path since we use the Eclipse $workspace_loc variable
String userDir = "${workspace_loc:" + projectName + "}/" + absoluteToRelativePath(projectWorkingDir);
- conf.putStringAttribute("org.eclipse.jdt.launching.VM_ARGUMENTS", getVMArguments(userDir));
+ String resourcesDir = "${workspace_loc:" + projectName + "}/" + absoluteToRelativePath(testResourcesDir);
+ String libsDir = "${workspace_loc:" + projectName + "}/" + absoluteToRelativePath(testLibsDir);
+ conf.putStringAttribute("org.eclipse.jdt.launching.VM_ARGUMENTS", getVMArguments(userDir, resourcesDir, libsDir));
conf.putStringAttribute("org.eclipse.jdt.launching.WORKING_DIRECTORY", userDir);
return conf;
}
- private String getVMArguments(String userDir)
+ private String getVMArguments(String userDir, String resourcesDir, String libsDir)
{
StringBuffer sb = new StringBuffer();
sb.append("-Djbossws.integration.target=").append(integrationTarget);
@@ -131,6 +135,8 @@
sb.append("-Duser.dir=").append(userDir);
sb.append(" -Djboss.home=").append(jbossHome);
sb.append(" -Djdk.home=${env_var:JAVA_HOME}");
+ sb.append(" -Dtest.archive.directory=").append(libsDir);
+ sb.append(" -Dtest.resources.directory=").append(resourcesDir);
return sb.toString();
}
@@ -182,6 +188,16 @@
this.endorsedDir = endorsedDir;
}
+ public void setTestResourcesDir(String testResourcesDir)
+ {
+ this.testResourcesDir = testResourcesDir;
+ }
+
+ public void setTestLibsDir(String testLibsDir)
+ {
+ this.testLibsDir = testLibsDir;
+ }
+
private class LaunchConfiguration
{
private Map<String, String> booleanAttributes = new LinkedHashMap<String, String>();
More information about the jbossws-commits
mailing list