Skip to content

Commit

Permalink
[FLINK-1114] Move scala-style checks to scala projects, change paths …
Browse files Browse the repository at this point in the history
…to style conifg, to allow isolated building of individual projects.
  • Loading branch information
StephanEwen committed Sep 23, 2014
1 parent b904b00 commit cf80d86
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void reduce(Iterable<Tuple2<Long, Long>> values, Collector<Tuple2<Long, L
.coGroup(nextPaths)
.where(0).equalTo(0)
.with(new CoGroupFunction<Tuple2<Long, Long>, Tuple2<Long, Long>, Tuple2<Long, Long>>() {
Set prevSet = new HashSet<Tuple2<Long,Long>>();
Set<Tuple2<Long,Long>> prevSet = new HashSet<Tuple2<Long,Long>>();
@Override
public void coGroup(Iterable<Tuple2<Long, Long>> prevPaths, Iterable<Tuple2<Long, Long>> nextPaths, Collector<Tuple2<Long, Long>> out) throws Exception {
for (Tuple2<Long,Long> prev : prevPaths) {
Expand Down
36 changes: 30 additions & 6 deletions flink-examples/flink-scala-examples/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,30 @@ under the License.
</executions>
</plugin>

<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
<configLocation>${project.basedir}/../../tools/maven/scalastyle-config.xml</configLocation>
<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down Expand Up @@ -237,7 +261,6 @@ under the License.
</includes>
</configuration>
</execution>
-->
<execution>
<id>WordCount</id>
Expand All @@ -257,10 +280,11 @@ under the License.
<includes>
<include>**/wordcount/WordCount*.class</include>
<include>**/wordcount/util/WordCountData.class</include>
</includes>
</configuration>
</execution>
<!--
<execution>
<id>ConnectedComponents</id>
<phase>package</phase>
Expand All @@ -275,13 +299,11 @@ under the License.
</manifestEntries>
</archive>
<includes>
<include>**/graph/ConnectedComponents*.class</include>
DOES NOT WORK <include>**/graph/ConnectedComponents*.class</include>
</includes>
</configuration>
</execution>
-->

<execution>
<id>TransitiveClosureNaive</id>
<phase>package</phase>
Expand All @@ -300,10 +322,12 @@ under the License.
<includes>
<include>**/wordcount/TransitiveClosureNaive*.class</include>
DOES NOT WORK <include>**/java/graph/util/ConnectedComponentsData.class</include>
</includes>
</configuration>
</execution>

-->

</executions>
</plugin>

Expand Down
24 changes: 24 additions & 0 deletions flink-scala/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,30 @@ under the License.
</executions>
</plugin>

<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.5.0</version>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
<configLocation>${project.basedir}/../tools/maven/scalastyle-config.xml</configLocation>
<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
</plugin>

</plugins>
</build>

Expand Down
49 changes: 13 additions & 36 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -84,20 +84,20 @@ under the License.
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.1</version>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.0.13</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -558,29 +558,6 @@ under the License.
<logViolationsToConsole>true</logViolationsToConsole>
</configuration>
</plugin>
<plugin>
<groupId>org.scalastyle</groupId>
<artifactId>scalastyle-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<verbose>false</verbose>
<failOnViolation>true</failOnViolation>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<failOnWarning>false</failOnWarning>
<sourceDirectory>${basedir}/src/main/scala</sourceDirectory>
<testSourceDirectory>${basedir}/src/test/scala</testSourceDirectory>
<configLocation>tools/maven/scalastyle-config.xml</configLocation>
<outputFile>${project.basedir}/scalastyle-output.xml</outputFile>
<outputEncoding>UTF-8</outputEncoding>
</configuration>
<executions>
<execution>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<!-- just define the Java version to be used for compiling and plugins -->
<groupId>org.apache.maven.plugins</groupId>
Expand Down

0 comments on commit cf80d86

Please sign in to comment.