An open API service indexing awesome lists of open source software.

https://github.com/igapyon/blancoapexformatterplugin


https://github.com/igapyon/blancoapexformatterplugin

Last synced: 12 months ago
JSON representation

Awesome Lists containing this project

README

          

# blancoApexFormatter

blancoApexFormatter is a Apax language source code formatter.
blancoApexFormatter is written in Java. blancoApexFormatter is provided as an OSS product.

## spec

blancoApexFormatter format Apax code like below:

### before (input)

```java
@isTest
public without sharing class MySimpleTest {
static testMethod void testMain001(){
System.assert(false,
'First hello word written in Apex, as a error of test code.');
}
}
```

### after (formatted output)

```java
@isTest
public without sharing class MySimpleTest {
static testMethod void testMain001() {
System.assert(false,
'First hello word written in Apex, as a error of test code.');
}
}
```

## usage

There is several way to use blancoApexFormatter.
My currently recommendation is to use blancoApexFormatterPlugin. blancoApexFormatter provides Maven Plugin, Ant Task and command line interface. See below:

### Maven Plugin

```xml

jp.igapyon.blanco.apex.formatter.plugin
blancoApexFormatterPlugin
1.0.3

${project.basedir}/src/main/apex
${project.build.directory}/apex-formatted
false
false
true
true
true
true
true




format




```

Running Maven Plugin of blancoApexFormatter is like below:

```sh
mvn jp.igapyon.blanco.apex.formatter.plugin:blancoApexFormatterPlugin:1.0.3:format
```

### Ant task

Prepare Ant taskdef on your build.xml like below:

```xml










```

Run Ant task of blancoApexFormatter like below:

```xml



```

'input' and 'output' attributes are required.

### Command line

```
java -cp blancoApexFormatterCli.jar:lib/blancoApexFormatter.jar:lib/blancoApexSyntaxParser.jar:lib/blancoApexParser.jar:lib/apache/commons-cli-1.3.1.jar:lib/apache/commons-io-2.5.jar blanco.apex.formatter.cli.BlancoApexFormatterCli -i /home/tosiki/workspace/apex-lang/src.apex -o /home/tosiki/workspace/apex-lang/src.apex.output
```

Command line interface of blancoApexFormatter provides several option like below:

```
usage: BlancoApexFormatterCli
-h,--help show usage.
-i,--input input directory.
-o,--output output directory.
-v,--verbose run verbose mode.
-xbracket format bracket.
-xcomma format comma.
-xindent format indent.
-xsemicolon format semicolon.
-xsmashwhitespace format with whitespace smash (hard format).
-xspecialchar format special char.
```

## download

You can download latest version of blancoApexFormatter from URL below:

### source distribution

* https://github.com/igapyon/blancoApexFormatter/releases
* https://github.com/igapyon/blancoApexSyntaxParser/releases
* https://github.com/igapyon/blancoApexParser/releases

## LICENSE

```
/*
* Copyright 2016 Toshiki Iga
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
```