Skip to content

Commit

Permalink
Issue checkstyle#5208: use maven version plugin to report new version…
Browse files Browse the repository at this point in the history
…s for update
  • Loading branch information
romani authored and timurt committed Dec 19, 2017
1 parent f55f6be commit 45c7a86
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .ci/travis/travis.sh
Expand Up @@ -13,6 +13,23 @@ nondex)
if [[ $RESULT != 0 ]]; then false; fi
;;

versions)
if [[ $TRAVIS_EVENT_TYPE != "cron" ]]; then exit 0; fi
mvn clean versions:dependency-updates-report versions:plugin-updates-report
if [ $(grep "<nextVersion>" target/*-updates-report.xml | cat | wc -l) -gt 0 ]; then
echo "Version reports (dependency-updates-report.xml):"
cat target/dependency-updates-report.xml
echo "Version reports (plugin-updates-report.xml):"
cat target/plugin-updates-report.xml
echo "New versions:"
grep -B 7 "<nextVersion>" target/dependency-updates-report.xml
grep -B 4 "<nextVersion>" target/plugin-updates-report.xml
exit 1
else
echo "No new versions found"
fi
;;

assembly-run-all-jar)
mvn clean package -Passembly
CS_POM_VERSION=$(mvn -q -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive org.codehaus.mojo:exec-maven-plugin:1.3.1:exec)
Expand Down
6 changes: 6 additions & 0 deletions .travis.yml
Expand Up @@ -175,6 +175,12 @@ matrix:
- DESC="no error test on simple-binary-encoding"
- CMD="./.ci/travis/travis.sh no-error-test-sbe"

# versions to update
- jdk: oraclejdk8
env:
- DESC="print versions to update"
- CMD="./.ci/travis/travis.sh versions"

script:
- SKIP_FILES=".github|appveyor.yml|circle.yml|distelli-manifest.yml|fast-forward-merge.sh|LICENSE|LICENSE.apache20|README.md|release.sh|RIGHTS.antlr|shippable.yml|wercker.yml|intellij-idea-inspections.xml"
- SKIP_CI=$(if [[ $(git diff --name-only HEAD HEAD~1 | grep -vE "$SKIP_FILES" | cat | wc -c | sed 's/^ *//' ) > 0 ]]; then echo false; else echo true; fi;)
Expand Down
21 changes: 21 additions & 0 deletions config/version-number-rules.xml
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ruleset xmlns="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
comparisonMethod="maven" xsi:schemaLocation="http://mojo.codehaus.org/versions-maven-plugin/rule/2.0.0 https://mojo.codehaus.org/versions-maven-plugin/xsd/rule-2.0.0.xsd">

<ignoreVersions>
<ignoreVersion type="regex">.*[-_\.](alpha|Alpha|ALPHA|beta|Beta|BETA|rc|RC|M|EA)[-_\.]?[0-9]?.*</ignoreVersion>
</ignoreVersions>
<rules>
<rule groupId="com.google.guava">
<ignoreVersions>
<ignoreVersion type="regex">.*-android</ignoreVersion>
</ignoreVersions>
</rule>
<rule groupId="antlr">
<ignoreVersions>
<!-- this is really old version before versioning become semantic -->
<ignoreVersion type="regex">20030911</ignoreVersion>
</ignoreVersions>
</rule>
</rules>
</ruleset>
5 changes: 5 additions & 0 deletions pom.xml
Expand Up @@ -680,6 +680,11 @@
<version>${maven.versions.plugin.version}</version>
<configuration>
<generateBackupPoms>false</generateBackupPoms>
<rulesUri>file://${basedir}/config/version-number-rules.xml</rulesUri>
<formats>
<format>xml</format>
<format>html</format>
</formats>
</configuration>
</plugin>
<plugin>
Expand Down

0 comments on commit 45c7a86

Please sign in to comment.