Skip to content

Commit

Permalink
Added formatter and import plugins.
Browse files Browse the repository at this point in the history
Signed-off-by: Roberto Cortez <[email protected]>
  • Loading branch information
radcortez committed Sep 24, 2020
1 parent 9ddc8e8 commit 6c5aa18
Show file tree
Hide file tree
Showing 7 changed files with 135 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ jobs:
java-version: ${{matrix.java}}

- name: build with maven
run: mvn -ntp verify
run: mvn -ntp install
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ test-output
# Ignore a release.conf for perform_release/* script usage
release.conf
**/.DS_Store
*.cache/
11 changes: 11 additions & 0 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,17 @@

<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-build-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down
34 changes: 34 additions & 0 deletions build-tools/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2009-2020 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
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.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<!-- This is just for now and will not work if the API has a separate release cycle than the rest. -->
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-parent</artifactId>
<version>2.0-SNAPSHOT</version>
</parent>

<artifactId>microprofile-config-build-tools</artifactId>
<name>MicroProfile Config Build Tools</name>
<description>MicroProfile Config :: Build Tools</description>

</project>
30 changes: 30 additions & 0 deletions build-tools/src/main/resources/formatter.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!--
Copyright (c) 2009-2020 Contributors to the Eclipse Foundation
See the NOTICE file(s) distributed with this work for additional
information regarding copyright ownership.
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.
-->
<profiles version="1">
<profile kind="CodeFormatterProfile" name="MicroProfile" version="1">
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="120"/>
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="false"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="16"/>
<setting id="org.eclipse.jdt.core.formatter.alignment_for_field_declaration" value="16"/>
</profile>
</profiles>
51 changes: 47 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
</distributionManagement>

<modules>
<module>build-tools</module>
<module>api</module>
<module>tck</module>
<module>spec</module>
Expand Down Expand Up @@ -160,6 +161,37 @@
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>2.12.1</version>
<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
<version>1.4.1</version>
<configuration>
<groups>java.,javax.,org.,com.</groups>
<staticGroups>*</staticGroups>
<removeUnused>true</removeUnused>
</configuration>
<executions>
<execution>
<id>sort-imports</id>
<goals>
<goal>sort</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
Expand Down Expand Up @@ -216,6 +248,19 @@
<extensions>true</extensions>
</plugin>

<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<configuration>
<configFile>formatter.xml</configFile>
</configuration>
</plugin>

<plugin>
<groupId>net.revelc.code</groupId>
<artifactId>impsort-maven-plugin</artifactId>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
Expand Down Expand Up @@ -283,9 +328,7 @@
<module name="LeftCurly">
<property name="option" value="EOL" />
</module>
<module name="RightCurly">
<property name="option" value="ALONE" />
</module>
<module name="RightCurly"/>
<module name="EmptyStatement" />
<module name="EqualsHashCode" />
<module name="DefaultComesLast" />
Expand Down Expand Up @@ -330,10 +373,10 @@
<exclude>.factorypath</exclude>
<exclude>.editorconfig</exclude>
<exclude>.github/**</exclude>
<exclude>.cache/**</exclude>
</excludes>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
11 changes: 11 additions & 0 deletions tck/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,17 @@

<build>
<plugins>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.eclipse.microprofile.config</groupId>
<artifactId>microprofile-config-build-tools</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
Expand Down

0 comments on commit 6c5aa18

Please sign in to comment.