Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » Code Formatter as an Ant Task
Code Formatter as an Ant Task [message #244179] Fri, 01 June 2007 05:32 Go to next message
Eclipse UserFriend
I have managed to extract the Code Formatter so that you don't need to
have the complete Eclipse IDE installed. It now means that you can use
an Ant Task to format your code according to some configuration that is
extracted from your project settings.

Please bear in mind this is made from the discovery on
http://wiyoo.blogspot.com/2007/05/batch-formatting-java-sour ce-code-with.html,
so you need to follow the instructions there to get your configuration file.

You can download the source, compiled jar and libs from
http://www.darkedges.com/java/ant/JavaCodeFormatter.zip

It is very rough, but seems to work for me, and is entirely based on the
original code, except for 2 lines where I could not figure out how to
get the Platform object initiated to find the javalike extensions.

Nicholas Irving
nirving@darkedges.com
Re: Code Formatter as an Ant Task [message #244207 is a reply to message #244179] Mon, 04 June 2007 07:17 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: stefan.bley.dd.gmx.de

Hi Nicholas,

How do I have to call your bundled version of the Java Code Formatter from
command line?

Stefan
Re: Code Formatter as an Ant Task [message #244267 is a reply to message #244207] Tue, 05 June 2007 18:43 Go to previous message
Eclipse UserFriend
1. unzip JavacodeFormatter.zip
2. Issue the following command

Windows:
java -classpath
lib\org.eclipse.core.contenttype_3.2.0.v20060603.jar;
lib\org.eclipse.core.jobs_3.2.0.v20060603.jar;
lib\org.eclipse.core.resources_3.2.1.R32x_v20060914.jar;
lib\org.eclipse.core.runtime_3.2.0.v20060603.jar;
lib\org.eclipse.equinox.common_3.2.0.v20060603.jar;
lib\org.eclipse.jdt.core_3.2.1.v_677_R32x.jar;
lib\org.eclipse.osgi_3.2.1.R32x_v20060919.jar;
lib\org.eclipse.text_3.2.0.v20060605-1400.jar;
lib\JavaCodeFormatter.jar
com.darkedges.JavaCodeFormatter

Unix:
java -classpath
lib\org.eclipse.core.contenttype_3.2.0.v20060603.jar:
lib\org.eclipse.core.jobs_3.2.0.v20060603.jar:
lib\org.eclipse.core.resources_3.2.1.R32x_v20060914.jar:
lib\org.eclipse.core.runtime_3.2.0.v20060603.jar:
lib\org.eclipse.equinox.common_3.2.0.v20060603.jar:
lib\org.eclipse.jdt.core_3.2.1.v_677_R32x.jar:
lib\org.eclipse.osgi_3.2.1.R32x_v20060919.jar:
lib\org.eclipse.text_3.2.0.v20060605-1400.jar:
lib\JavaCodeFormatter.jar
com.darkedges.JavaCodeFormatter

Remember this has to be on one line.

Hope this helps.

NIrving

Stefan Bley wrote:
> Hi Nicholas,
>
> How do I have to call your bundled version of the Java Code Formatter
> from command line?
>
> Stefan
>
Previous Topic:Checking if external jar modified
Next Topic:Java Code Formatter: Writing Plugin for NetBeans
Goto Forum:
  


Current Time: Tue Jul 22 15:29:01 EDT 2025

Powered by FUDForum. Page generated in 0.04811 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top