Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / December 2005

Tip: Looking for answers? Try searching our database.

creating a property file builder with eclipse?

Thread view: 
Elhanan - 16 Dec 2005 14:11 GMT
hi..

i would to like to have eclipse perform a batch file each time i save
my eclipse property file, the batch will run native2ascii program
turning my hebrew into \u codes and place it in the web-inf /classes
directory.

can i do that?
Jean-Francois Briere - 16 Dec 2005 23:21 GMT
Yes you can.

You could use the ANT 'native2ascii' task to be executed automatically
with Eclipse.
The following are simple steps to follow with Eclipse 3.1 and a JDK
(1.4+) already installed.

1- Start Eclipse 3.1 with a JDK (not a JRE).
  To be sure, just before starting Eclipse, edit 'eclipse.ini' file in
{ECLIPSE_HOME} folder
  and put in the two first lines the two following lines:

-vm
{JDK_HOME}\bin\javaw.exe

  This example works for Windows.
  Of course {JDK_HOME} must be change appropriately for the JDK root
folder path.

2- In yur project, make sure that all your property files :
      a- are located in 'hebrew_properties' sub-folder
      b- have the '.properties' file extension
      c- are saved with the appropriate encoding (for instance
'ISO-8859-8' encoding).
         To be sure, open each file, then 'File' / 'Properties', then
check with the 'text file encoding' section.

3- In the root of your project, create a new file that you could name:
'convert_properties.xml'
  and with the following content:

<project name="convert_properties" default="convert">
    <target name="convert">
       <native2ascii encoding="ISO-8859-8"
                     src="hebrew_properties"
                     dest="WEB-INF/classes"
                     includes="**/*.properties"
       />
      </target>
</project>

4- Right-click on your project, then 'Properties', select 'Builders' in
tne left, then 'New' and 'OK' ('Ant Build' is pre-selected).
  Change the 'Name' field for 'convert_properties', then for
'Buildfile' click on 'Browse Workspace...' and select the
'convert_properties.xml' file.
  Then click on the 'Targets' panel, in 'Auto Build:' section click on
'Set Targets...' and then 'OK' ('convert' is pre-selected).
  Then click 'OK' and again 'OK'.

This should work fine and smoothly.
Of course you can change the folder names / files extensions / other
names at will.

Regards
Elhanan - 17 Dec 2005 18:06 GMT
thanks, i created a build.xml and wrote
<project name="properyConvert" default="convert">
    <target name="convert">
        <native2ascii encoding="ISO-8859-8"
            includes="*.properties"
            src="props"
            dest="WEB-INF/classes">
        </native2ascii>
    </target>
</project>

at first i tried placing in the src direcoty but then i saw that
eclipse overwrote it by simply copying the original file, so i had to
set in a different directory (anyway to supress it? ).
Jean-Francois Briere - 17 Dec 2005 21:33 GMT
If it works, why changing it?


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.