Skip to content

Commit

Permalink
[SPARK-29293][BUILD] Move scalafmt to Scala 2.12 profile; bump to 0.12
Browse files Browse the repository at this point in the history
### What changes were proposed in this pull request?

Move scalafmt to Scala 2.12 profile; bump to 0.12.

### Why are the changes needed?

To facilitate a future Scala 2.13 build.

### Does this PR introduce any user-facing change?

None.

### How was this patch tested?

This isn't covered by tests, it's a convenience for contributors.

Closes apache#26655 from srowen/SPARK-29293.

Authored-by: Sean Owen <sean.owen@databricks.com>
Signed-off-by: Dongjoon Hyun <dhyun@apple.com>
  • Loading branch information
srowen authored and attilapiros committed Dec 6, 2019
1 parent c5471d3 commit c513c78
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
2 changes: 1 addition & 1 deletion dev/scalafmt
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@
# by default, format only files that differ from git master
params="${@:---diff}"

./build/mvn mvn-scalafmt_2.12:format -Dscalafmt.skip=false -Dscalafmt.parameters="$params"
./build/mvn -Pscala-2.12 mvn-scalafmt_2.12:format -Dscalafmt.skip=false -Dscalafmt.parameters="$params"
46 changes: 27 additions & 19 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2843,24 +2843,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.antipathy</groupId>
<artifactId>mvn-scalafmt_2.12</artifactId>
<version>0.9_1.5.1</version>
<configuration>
<parameters>${scalafmt.parameters}</parameters> <!-- (Optional) Additional command line arguments -->
<skip>${scalafmt.skip}</skip> <!-- (Optional) skip formatting -->
<configLocation>dev/.scalafmt.conf</configLocation> <!-- (Optional) config locataion -->
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
<!--
Couple of dependencies are coming in bundle format (bundle is just a normal jar which
contains OSGi metadata in the manifest). If one don't use OSGi, then a bundle will work as
Expand Down Expand Up @@ -3020,9 +3002,35 @@
</properties>
</profile>

<!-- Exists for backwards compatibility; profile doesn't do anything -->
<profile>
<id>scala-2.12</id>
<build>
<pluginManagement>
<plugins>
<!-- SPARK-29293 currently not able to update to 1.x for Scala 2.13 -->
<plugin>
<groupId>org.antipathy</groupId>
<artifactId>mvn-scalafmt_2.12</artifactId>
<version>0.12_1.5.1</version>
<configuration>
<parameters>${scalafmt.parameters}</parameters> <!-- (Optional) Additional command line arguments -->
<skip>${scalafmt.skip}</skip> <!-- (Optional) skip formatting -->
<skipSources>${scalafmt.skip}</skipSources>
<skipTestSources>${scalafmt.skip}</skipTestSources>
<configLocation>dev/.scalafmt.conf</configLocation> <!-- (Optional) config location -->
</configuration>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
</build>
</profile>

<profile>
Expand Down

0 comments on commit c513c78

Please sign in to comment.