diff options
author | Singal, Kapil (ks220y) <ks220y@att.com> | 2019-11-22 18:06:08 -0500 |
---|---|---|
committer | KAPIL SINGAL <ks220y@att.com> | 2019-11-26 21:32:38 +0000 |
commit | 341db21b2ac0a14a1ed2b8bf7930914dda054bfe (patch) | |
tree | 113bba965b06cfe3a8af3a0a527d1a41c9faf0f9 /pom.xml | |
parent | d274e5fc552cf9ae25500f504f0434981cf3accf (diff) |
Formatting Code base with ktlint
No Business logic change, just the code format.
Competible with IntelliJ: https://github.com/pinterest/ktlint#option-3
To format run: mvn process-sources -P format
Issue-ID: CCSDK-1947
Signed-off-by: Singal, Kapil (ks220y) <ks220y@att.com>
Change-Id: Ic9e9209fb7023d77f434693ad5a01229f8d09331
Diffstat (limited to 'pom.xml')
-rw-r--r-- | pom.xml | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -98,6 +98,56 @@ limitations under the License. </execution> </executions> </plugin> + + <!-- Plugin to Format/Validate Kotlin Files --> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>1.7</version> + <executions> + <execution> + <id>validate-kotlin</id> + <phase>validate</phase> + <configuration> + <target name="ktlint"> + <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" + classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath"> + <arg value="src/**/*.kt"/> + </java> + </target> + <skip>${format.skipValidate}</skip> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + <execution> + <!-- Built-in formatter So that you wouldn't have to fix all style violations by hand.--> + <id>format-kotlin</id> + <phase>process-sources</phase> + <configuration> + <target name="ktlint"> + <java taskname="ktlint" dir="${project.basedir}" fork="true" failonerror="true" + classname="com.pinterest.ktlint.Main" classpathref="maven.plugin.classpath"> + <arg value="-F"/> + <arg value="src/**/*.kt"/> + </java> + </target> + <skip>${format.skipExecute}</skip> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>com.pinterest</groupId> + <artifactId>ktlint</artifactId> + <version>0.35.0</version> + </dependency> + </dependencies> + </plugin> </plugins> </build> @@ -142,5 +192,6 @@ limitations under the License. <format.skipExecute>false</format.skipExecute> </properties> </profile> + </profiles> </project> |