- This topic has 31 replies, 10 voices, and was last updated 18 years, 9 months ago by Riyad Kalla.
-
AuthorPosts
-
Riyad KallaMemberThis message has not been recovered.
KapellerMemberThe only thing that has changed is the icon of xml files. I still have only the “Run …” when i right-click my ant file.
Riyad KallaMemberWe are going to take another look at this situation, to see if we can make the XML editor and Ant editor play nicer.
KapellerMemberglad to hear that.
thank you!
Riyad KallaMemberKapeller,
Myself along with 1 other developer just did 5 new installs of MyEclipse on clean Eclipse with new worskapces to simulate a “new user” experience, and on each one, build.xml was associtaed default with the Ant editor as well as having the Run As menu intact… can you give us some more details about your system and setup that might help us figure out why you aren’t seeing this?
tmanningMemberI have the same problem this user reported. Unless my Ant build file is named “build.xml”, Eclipse does not give me the option to open the file with the Ant editor. I can add the name of my file explicitly to the list of files supported by Ant, and it will then give me the option, but that’s not a very nice workaround. MyEclipse (latest version 4.0.2GA) seems to clobber the Ant XML editor – you don’t even have the option to use the Ant editor on any file other than build.xml.
It would be nice to find a solution. Anyone come across one?
Riyad KallaMembertmanning,
Please navigate to your Window > Prefs > General> File Association settings, find *.xml, mark the Ant Editor as the default, hit OK and try now, do you see the Ant editor?
tmanningMemberYes – that does it. I see now that solution was presented earlier (got lost in the thread) – thanks.
Rick SchallackMemberNothing in this thread, though, addresses the inherent problem with the “Run As…” feature in Eclipse. Ant build scripts can have different names (not just ‘build.xml’). And when I run Eclipse without MyEclipse, I can create a build file named ‘mySpecialBuild.xml’ and right-click on that file and run it as an Ant build file from the “Run As…” option (I get the extra choices when I choose “Run As…”). When I install MyEclipse, I no longer have those options in the “Run As…” when I right click on ‘mySpecialBuild.xml’. Now I only receive those options with build.xml. No other xml file seems to qualify as an Ant build file to run it with Ant. Is this expected behavior?
Riyad KallaMemberrschallack & others,
This will likely be the out of box behavior but can be adjust by way of the Window > Preferences > General > Content Types > Text > XML > Ant Buildfile settings. Here you can add the custom name of our build script and it will be treated appropriately.What is happening here is in a base Eclipse install, there is no support for XML files so the Ant mapping to *.xml is the only thing there, but after installing MyEclipse, there are atleast 6 new editors ALL mapped to the *.xml extension AND content type so the old Ant *.xml mapping gets burried in the shuffle. Default build.xml files work fine, but if you want to use custom names and NOT have the file treated like a straight .xml file, you need to add a custom content type mapping at the area I show above.
Rick SchallackMemberOK, thank you for clarifying that. It is unfortunate that the behavior gets clobbered and I hope that will be worked out in future releases, but I’m glad there is that work around. I’ll be sure to use it with my projects.
BodziakMemberHello
I found the reason why Run As ant task disappear. All fiels that have *.xml extension and are nor recoginzed by MyEclipse
has assigned file type named “File (MyEclipse XML Content Type)” see properties of file by right click. So it is not trated ad ANT built fileBut there is the solution
change extenstion form *.xml to *.ent then the file type is mapped as “File (Ant Buildfile)”Addtionaly
Go to preferences\general\editors\file assocations\
find *.ent
and change default editor to from MyEclipse XML to ANT editor
And then ANT automagically run as starts to workPS. Dear MyExclipse support – how I should believe in the statement that disapearing of RUN AS Ant build was caused Eclipse behaviour change ???
Riyad KallaMemberPS. Dear MyExclipse support – how I should believe in the statement that disapearing of RUN AS Ant build was caused Eclipse behaviour change ???
Please point out to me where we said that.
BodziakMemberQuote:
PS. Dear MyExclipse support – how I should believe in the statement that disapearing of RUN AS Ant build was caused Eclipse behaviour change ???
Please point out to me where we said that.
support-scott
Posted: Jul 15, 2005 – 06:31 AMThis isn’t a change caused by MyEclipse; it’s simply a change in Eclipse 3.1 in the way it handles file content types. So that Run As… > Ant shows up on your files, navigate to Window > Preferences > General > Content Types > Text > XML > Ant Buildfile and add you file names to the list that this content type supports using the Add… button
support-rkalla
Posted: Sep 12, 2005 – 04:13 PM
After further investigation it seems this is behave by-design from the Eclipse team. Something that was introduced with Eclipse 3.1 was the idea of Content Types, basically a mechanism by which the platform is able to tell more specifically what *kind* of file it is editing.
Riyad KallaMemberBodziak,
I feel both of those quotes are taken out of context. I explained twice why this occurs when MyEclipse is installed and why it doesn’t occur when it is not installed.Too sum up: Before MyEclipse is installed, “Ant” is the only thing associated with “XML” files. That is why executing Run Ant on build.xml and someNameBuild.xml all work. After you install MyEclipse, we introduce approximately 6 more XML mappings, in addition to the default XML mapping of *.xml -> MyEclipse XML Editor. So when you go to execute Ant on a someNameBuild.xml file, the Ant run command is gone because the new “owner” so to speak is the MyEclipse XML Editor.
This is what Scott and I were trying to get to. Because of how many mappings are going to the XML files you run into a problem of “knowing” which kind of file it is. There is no one at fault here, just a case of complex file-type to editor mappings.
One of the developers had an idea of how we could make this easier out of the box and we may look into fixing that later on. For now modifying your File Association and/or Content Types will allow Eclipse to know that your someNameBuidl.xml file is an Ant script and give you the run menu again when you right-click on it.
-
AuthorPosts