Skip to content

Commit 28a73c7

Browse files
committed
Issue #251: auto generate patch file during maven build
1 parent 2471105 commit 28a73c7

File tree

5 files changed

+30
-9
lines changed

5 files changed

+30
-9
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,5 @@ net.sf.eclipsecs.core/lib/metadata-gen-1.0-SNAPSHOT.jar
66
*.iml
77
*.prefs
88
.checkstyle
9-
net.sf.eclipsecs.core/lib/patch-filter-1.0-SNAPSHOT.jar
109
target/
11-
patch-filters/
10+
show.patch

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@ matrix:
2727
- jdk: openjdk8
2828
env:
2929
- DESC="install (openjdk8)"
30-
- CMD="./build-metafile-gen.sh && mkdir -p target && git diff HEAD~1 HEAD > target/show.patch && mvn install && git diff"
30+
- CMD="./build-metafile-gen.sh && mvn install && git diff"
3131

3232
# JDK 11 (Long Term Support version)
3333
- jdk: openjdk11
3434
env:
3535
- DESC="install (openjdk11)"
36-
- CMD="./build-metafile-gen.sh && mkdir -p target && git diff HEAD~1 HEAD > target/show.patch && mvn install && git diff"
36+
- CMD="./build-metafile-gen.sh && mvn install && git diff"
3737

3838
# JDK 13 (most recent Java version)
3939
- jdk: openjdk13
4040
env:
4141
- DESC="install (openjdk13)"
42-
- CMD="./build-metafile-gen.sh && mkdir -p target && git diff HEAD~1 HEAD > target/show.patch && mvn install && git diff"
42+
- CMD="./build-metafile-gen.sh && mvn install && git diff"
4343

4444
script:
4545
- |

config/checkstyle_checks.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,14 +190,14 @@
190190
</module>
191191

192192
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressionPatchFilter">
193-
<property name="file" value="target/show.patch"/>
193+
<property name="file" value="show.patch"/>
194194
<property name="strategy" value="patchedline" />
195195
<property name="neverSuppressedChecks" value="FileLength, NewlineAtEndOfFile, RegexpOnFilename" />
196196
</module>
197197

198198
<module name="TreeWalker">
199199
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressionJavaPatchFilter">
200-
<property name="file" value="target/show.patch"/>
200+
<property name="file" value="show.patch"/>
201201
<property name="strategy" value="patchedline" />
202202
</module>
203203

config/checkstyle_sevntu_checks.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
</module>
1414

1515
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressionPatchFilter">
16-
<property name="file" value="target/show.patch"/>
16+
<property name="file" value="show.patch"/>
1717
<property name="strategy" value="patchedline" />
1818
</module>
1919

2020
<module name="TreeWalker">
2121
<module name="com.puppycrawl.tools.checkstyle.filters.SuppressionJavaPatchFilter">
22-
<property name="file" value="target/show.patch"/>
22+
<property name="file" value="show.patch"/>
2323
<property name="strategy" value="patchedline" />
2424
</module>
2525

pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,28 @@
120120
</environments>
121121
</configuration>
122122
</plugin>
123+
<plugin>
124+
<groupId>org.codehaus.mojo</groupId>
125+
<artifactId>exec-maven-plugin</artifactId>
126+
<version>3.0.0</version>
127+
<executions>
128+
<execution>
129+
<phase>verify</phase>
130+
<goals>
131+
<goal>exec</goal>
132+
</goals>
133+
</execution>
134+
</executions>
135+
<configuration>
136+
<executable>git</executable>
137+
<arguments>
138+
<argument>diff</argument>
139+
<argument>HEAD~1</argument>
140+
<argument>HEAD</argument>
141+
</arguments>
142+
<outputFile>${maven.multiModuleProjectDirectory}/show.patch</outputFile>
143+
</configuration>
144+
</plugin>
123145
<plugin>
124146
<groupId>org.apache.maven.plugins</groupId>
125147
<artifactId>maven-checkstyle-plugin</artifactId>

0 commit comments

Comments
 (0)