[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[m2t-dev] Acceleo Builder not supporting projects in subdirectories

Hello list,

We are willing to use Acceleo for a project that is in a subdirectory of
our workspace (in a Maven module to be more precise).

We are getting a null pointer exception (stack trace follows).
The problem seems to be in the AcceleoProject.getOutputFilePath(...)
method which tries to compare the source file's absolute full path
(for instance /testproject/innerproject/src/main/java/generate.mtl)
to the source folders of the project (/innerproject/src/main/java/)
without any success.

The getFullPath() call must be replaced by a getProjectRelativePath()
call. The patch follows. We would be glad if you could include that for
the next release. (Or maybe we could have it in a nightly build ?)

Thanks for Acceleo. Keep up the great work.
Sincerely, Didier Villevalois.


Index: src/org/eclipse/acceleo/ide/ui/resources/AcceleoProject.java
===================================================================
RCS
file: /cvsroot/modeling/org.eclipse.m2t/org.eclipse.acceleo/plugins/org.eclipse.acceleo.ide.ui/src/org/eclipse/acceleo/ide/ui/resources/AcceleoProject.java,v
retrieving revision 1.30
diff -u -r1.30 AcceleoProject.java
--- src/org/eclipse/acceleo/ide/ui/resources/AcceleoProject.java	10 Mar
2011 09:00:35 -0000	1.30
+++ src/org/eclipse/acceleo/ide/ui/resources/AcceleoProject.java	14 Mar
2011 20:38:35 -0000
@@ -250,7 +250,7 @@
 	 * @return the output file path
 	 */
 	public IPath getOutputFilePath(IFile fileAcceleo) {
-		IPath filePath = fileAcceleo.getFullPath();
+		IPath filePath = fileAcceleo.getProjectRelativePath();
 		IFolder folder = getOutputFolder(project);
 		if (folder != null) {
 			for (Iterator<IPath> itSourceFolders = sourceFolders.iterator();
itSourceFolders.hasNext();) {



The stack trace:
----------------

java.lang.NullPointerException
	at
org.eclipse.acceleo.internal.ide.ui.builders.runner.CreateRunnableAcceleoOperation.run(CreateRunnableAcceleoOperation.java:117)
	at
org.eclipse.acceleo.internal.ide.ui.builders.AcceleoCompileOperation.doCompileResources(AcceleoCompileOperation.java:225)
	at
org.eclipse.acceleo.internal.ide.ui.builders.AcceleoCompileOperation.run(AcceleoCompileOperation.java:127)
	at
org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.incrementalBuild(AcceleoBuilder.java:232)
	at
org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:94)
	at org.eclipse.core.internal.events.BuildManager
$2.run(BuildManager.java:629)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:172)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:203)
	at org.eclipse.core.internal.events.BuildManager
$1.run(BuildManager.java:255)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at
org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:258)
	at
org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:311)
	at
org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:343)
	at
org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:144)
	at
org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:242)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)