Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yracnet/formatter-build
Format Source Code JAVA, CSS, JS, XML, HTML with Eclipse Platform
https://github.com/yracnet/formatter-build
code format formatter indentation java js source-code xml
Last synced: 21 days ago
JSON representation
Format Source Code JAVA, CSS, JS, XML, HTML with Eclipse Platform
- Host: GitHub
- URL: https://github.com/yracnet/formatter-build
- Owner: yracnet
- License: apache-2.0
- Created: 2020-01-30T21:21:02.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-11-15T23:34:11.000Z (about 2 years ago)
- Last Synced: 2024-11-24T21:03:30.383Z (about 2 months ago)
- Topics: code, format, formatter, indentation, java, js, source-code, xml
- Language: Java
- Size: 105 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# formatter
Format Source Code for JAVA, CSS, JS, XML, HTML with Eclipse JDT## Formatter Help is an API as utility based in https://code.revelc.net/formatter-maven-plugin
## What is the difference?
1. formatter-maven-plugin is an wrap of eclipse jdt core for maven-plugin and required that used in a pom.xml
2. formatter-build not depend of maven-plugin, this could use as a simple LIB and wrap the eclipse format jdtYou can use this api in your application in runtime without include the maven-plugin dependency
### Declare dependency:
com.github.yracnet.formatter
formatter-help
0.2.0
### In your code:
public static void main(String[] args) throws FormatterException, IOException {
File basedir = new File("/work/project-x");
File dir1 = new File(basedir, "/src/main");
File dir2 = new File(basedir, "/src/test");
FormatterBuild build = FormatterBuild.create();//basedir is a root directory when exist a source code as JAVA, JS, HTML, CSS
build.setBasedir(basedir);// this is necesary for declare all directory that format
// remember that dir1, dir2 are subdirectory of basedir
build.setDirectories(dir1, dir2);//This execute the format code
build.execute();
}The FormatterBuild Class has many method for configure the execution, please see the project https://code.revelc.net/formatter-maven-plugin