lixingwang / tapestrytools

Automatically exported from code.google.com/p/tapestrytools
0 stars 0 forks source link

Template is opened from the target folder on a mavenized project #13

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. On a mavenized project open a *.java page file
2. Hit ctrl+R
3. A wrong *.tml file is opened

What is the expected output? What do you see instead?
/target/.../*.tml is opened. 
The opened file should be:
/src/main/resources/.../*.tml

What version of the product are you using? On what operating system?
Eclipse: Version: Indigo Release Build id: 20110615-0604
Plugin: Tapestry tools: 1.3.3.v201102021253 (installed from the update site 
today)
OS: Win 7

Please provide any additional information below.
/target folder is set as derived and added to svn:ignore.
Opening the *.java file from *.tml works properly. From both ones

Original issue reported on code.google.com by jure.jes...@gmail.com on 10 Aug 2011 at 6:45

GoogleCodeExporter commented 9 years ago
I will check this situation

Original comment by gavingui...@gmail.com on 11 Aug 2011 at 10:04

GoogleCodeExporter commented 9 years ago
the problem is in the method FindCorrespondingFileAction.travelAllFolder, the 
"source" file is found before and the "target" file is found after....but when 
you find the first the method does not return.

I attached a patch(it's not "clean", take it as an example), but the 
"isSourceFolder" condition should be rewritten using eclipse apis (I'm not a 
plugin developer), because in some improbable use-cases (generating the tml at 
build time) the "generated source" folders are also in the target directory.

Original comment by giulio.m...@gmail.com on 3 Dec 2011 at 2:18

Attachments:

GoogleCodeExporter commented 9 years ago
I have already remove the old version code from trunk several days ago, and 
will not fix this problem for old version of TapestryTools. Thanks for Giulio's 
patch, he told me it works, and the detailed info:

It depends by the order of resources.
you have 2 .tml when using maven: the first found is always in the /src
directory, the second is in the /target.
My patch stops the FOR cycle after the first found in /src. I use it since
the day i've posted in the issue, and I can tell you that it works.

Original comment by gavingui...@gmail.com on 21 Mar 2012 at 10:23