Click here to load reader
Upload
walkmod
View
143
Download
0
Embed Size (px)
Citation preview
walkmodquick start
lunes 16 de septiembre de 2013
What are coding conventions?
“coding conventions are a set of guidelines for a specific programming language that recommend programming style, practices and methods for
each aspect of a piece program written in this language.” wikipedia
lunes 16 de septiembre de 2013
examples
• Naming conventions
• Code formatting
• Code licenses
• Code documentation
• Code refactoring
• Apply programming practices
• Architectural best practices
• More..
lunes 16 de septiembre de 2013
walkmod is a tool to...• automatize the practice of code conventions in development teams (i.e
license usage).
• automatize the resolution of problems detected by code quality tools (i.e PMD, sonar, findbugs).
• automatize the development and repetitive tasks i.e: creating basic CRUD services for the entire model.
• automatize global code changes: i.e refactorings.
lunes 16 de septiembre de 2013
requirements
• walkmod is a Java tool, so you need the java virtual machine (jdk) 1.6 or higher in order to proceed.
Please, make sure that JAVA_HOME is set to the location of your JDK and that $JAVA_HOME/bin is in your $PATH environment variable.
lunes 16 de septiembre de 2013
installation
• download walkmod-{version}.zip from walkmod.com.
• unzip the folder. The created folder is called$walkmod_home.
• update your environment variable $PATH with your$walkmod_home/bin directory.
• run walkmod --version to verify that it is correctly installed.
lunes 16 de septiembre de 2013
walkmod.xml
• Create a walkmod.xml file in the root directory of your java project.
• Edit the file and put the following content.
<!DOCTYPE walkmod PUBLIC "-//WALKMOD//DTD" "http://www.walkmod.com/dtd/walkmod-1.0.dtd"> <walkmod> <chain name="example-chain"> <reader path="${source directory}" /> <transformation type="walkmod:commons:import-cleaner" /> <writer path="${target directory}"/> </chain> </walkmod>
lunes 16 de septiembre de 2013
configure a project• Replace ${source directory} from where read your java packages. i.e
src/main/java.
• Replace${target directory} from where write the new code. i.e src/main/java. if ${source directory} = ${target directory}, your code will be automatically replaced.
• imports-cleaner will remove unused imports of your project.
• writer will rewrite your code with a default eclipse formatting. Yo can configure it.
lunes 16 de septiembre de 2013
runOpen your prompt and go to your project directory.
> cd {project directory}
Then, type:
> walkmod apply
And voila! your code has applied all declared conventions (transformations) into your source code according a configuration file called walkmod.xml
lunes 16 de septiembre de 2013
... INFO [main] - >>com.mycompany.Foo INFO [main] - >>com.mycompany.Bar INFO [main] - >>com.mycompany.Services ------------------------------------------------------------ INFO [main] - TRANSFORMATION CHAIN SUCCESS ------------------------------------------------------------ INFO [main] - Total time : 3,262 seconds INFO [main] - Finished at : Sun, 7 Apr 2013 18:13:39 INFO [main] - Final memory : 4 M/ 21 M INFO [main] - Total modified files : 14
outputwalkmod should print those files which contain unused imports. For example:
lunes 16 de septiembre de 2013
thank youhttp://www.walkmod.com
lunes 16 de septiembre de 2013