Command Line Flex Formatting

Purpose: Used to format all the code base from the source directory
Setup: Get all the jars
asJars
Where will you find the jars:
 
sourceForgeFF
and also from
 
sourceForgeFF1
Download the jars and create a folder called “ComandLineFormatting”, and dump in all the jars in this folder.
 
If in case, you do not have java jdk  installed on your machine, then please install and check if its working.
 
        How to Check Java is working.
  • Open Command Prompt. Type “cmd” in your search and the command window appears for you.
  • Type “cd\” then Type java -version. You should see the current java version installed on your system.
If your java is working fine you should see the below screen.
cmd1
Now Type cd C:\Users\rchouhan\CommandLineFormatting as shown to point to your local folder.
cmd2
As per the Sourceforge document the instruction is to execute “java -Djava.ext.dirs=. utilities.CommandLine c:\sourceDir c:\tools\Formatter.properties 4 true”.
 
where -Djava.ext.dirs point to all the external jars in “CommandLineFormatting” folder that you just created.
c:\sourceDir – is the flex project source folder where you have all mxml’s and actionscript (*.as) files located and 
c:\tools\Formatter.properties – its the location where you have the FlexFormatter properties file.
 
In my case it would be
 
cmd3
 
and Hit “Enter”
 
After successful execution of this command, you should see
 
cmd4
 
 
Note: If you have any white spaces between folder names and or path , try to give the full path in quotes.
 
C:\Users\rchouhan\Adobe Flash Builder 4.6\testComboBox\src
 
Your output in the Flash Builder would be a nicely formatted code:
 
code
 
 
Hope you’ve enjoyed it.!!!
Advertisements