Skip to content

Commit 08127a0

Browse files
authored
Check style only on Travis CI (#287)
* Check style only on Travis CI * Update pom.xml * Update pom.xml * update indent
1 parent 5860855 commit 08127a0

3 files changed

Lines changed: 18 additions & 13 deletions

File tree

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ os:
66

77
script:
88
- ./mvnw clean verify
9+
- ./mvnw checkstyle:check
910

1011
cache:
1112
directories:

check_style.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
<property name="fileExtensions" value="java, properties, xml"/>
2222
<module name="RegexpHeader">
23-
<property name="headerFile" value="${basedir}/microsoft.header"/>
23+
<property name="headerFile" value="microsoft.header"/>
2424
</module>
2525
<!-- Checks for whitespace
2626
See http://checkstyle.sf.net/config_whitespace.html -->
@@ -289,4 +289,4 @@
289289
<module name="SimplifyBooleanExpression"/>
290290
<module name="SimplifyBooleanReturn"/>
291291
</module>
292-
</module>
292+
</module>

pom.xml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
<base.name>Java Debug Server for Visual Studio Code</base.name>
1313
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1414
<tycho-version>1.2.0</tycho-version>
15+
<checkstyleDir>${basedir}</checkstyleDir>
1516
</properties>
1617

1718
<licenses>
@@ -113,15 +114,6 @@
113114
<groupId>org.apache.maven.plugins</groupId>
114115
<artifactId>maven-checkstyle-plugin</artifactId>
115116
<version>2.17</version>
116-
<executions>
117-
<execution>
118-
<id>validate</id>
119-
<phase>validate</phase>
120-
<goals>
121-
<goal>check</goal>
122-
</goals>
123-
</execution>
124-
</executions>
125117
<dependencies>
126118
<dependency>
127119
<groupId>com.puppycrawl.tools</groupId>
@@ -135,8 +127,7 @@
135127
</dependency>
136128
</dependencies>
137129
<configuration>
138-
<configLocation>${project.parent.basedir}/check_style.xml</configLocation>
139-
<propertyExpansion>basedir=${project.parent.basedir}</propertyExpansion>
130+
<configLocation>${checkstyleDir}/check_style.xml</configLocation>
140131
<failOnViolation>true</failOnViolation>
141132
</configuration>
142133
</plugin>
@@ -148,6 +139,19 @@
148139
</plugins>
149140
</pluginManagement>
150141
</build>
142+
<profiles>
143+
<profile>
144+
<id>activate-in-module</id>
145+
<activation>
146+
<file>
147+
<exists>${basedir}/../check_style.xml</exists>
148+
</file>
149+
</activation>
150+
<properties>
151+
<checkstyleDir>${basedir}/..</checkstyleDir>
152+
</properties>
153+
</profile>
154+
</profiles>
151155
<repositories>
152156
<repository>
153157
<id>photon</id>

0 commit comments

Comments
 (0)