Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Update gradlew, fix a few new pmd issues, fix broken test, update cop…
Browse files Browse the repository at this point in the history
…yright header (#133)
  • Loading branch information
fieldju authored and mayitbeegh committed Apr 11, 2019
1 parent c6e740a commit 36dda5b
Show file tree
Hide file tree
Showing 206 changed files with 733 additions and 796 deletions.
6 changes: 1 addition & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,8 @@ apply from: file('gradle/integration.gradle')

mainClassName = 'com.nike.cerberus.cli.CerberusRunner'

task wrapper(type: Wrapper) {
gradleVersion = '3.4'
}

/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion codequality/findbugs-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
<Method name="run" />
<Bug pattern="DM_EXIT" />
</Match>
</FindBugsFilter>
</FindBugsFilter>
14 changes: 7 additions & 7 deletions codequality/findbugs_default.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@

<h1><a href="http://findbugs.sourceforge.net">FindBugs</a> Report</h1>

<h2>Project Information</h2>
<h2>Project Information</h2>
<xsl:apply-templates select="/BugCollection/Project"/>

<h2>Metrics</h2>
Expand All @@ -151,7 +151,7 @@
<xsl:sort select="." order="ascending"/>
<xsl:variable name="catkey" select="."/>
<xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>

<li><a href="#Warnings_{$catkey}"><xsl:value-of select="$catdesc"/> Warnings</a></li>
</xsl:for-each>

Expand All @@ -174,7 +174,7 @@
<xsl:otherwise>tablerow1</xsl:otherwise>
</xsl:choose>
</xsl:variable>

<tr class="{$styleclass}">
<td><a href="#Warnings_{$catkey}"><xsl:value-of select="$catdesc"/> Warnings</a></td>
<td align="right"><xsl:value-of select="count(/BugCollection/BugInstance[(@category=$catkey) and not(@last)])"/></td>
Expand All @@ -200,7 +200,7 @@
<xsl:sort select="." order="ascending"/>
<xsl:variable name="catkey" select="."/>
<xsl:variable name="catdesc" select="/BugCollection/BugCategory[@category=$catkey]/Description"/>

<xsl:call-template name="generateWarningTable">
<xsl:with-param name="warningSet" select="/BugCollection/BugInstance[(@category=$catkey) and not(@last)]"/>
<xsl:with-param name="sectionTitle"><xsl:value-of select="$catdesc"/> Warnings</xsl:with-param>
Expand All @@ -220,14 +220,14 @@
</xsl:template>

<xsl:template match="Project">
<p>Project:
<p>Project:
<xsl:choose>
<xsl:when test='string-length(/BugCollection/Project/@projectName)>0'><xsl:value-of select="/BugCollection/Project/@projectName" /></xsl:when>
<xsl:otherwise><xsl:value-of select="/BugCollection/Project/@filename" /></xsl:otherwise>
</xsl:choose>
</p>
<p>FindBugs version: <xsl:value-of select="/BugCollection/@version"/></p>

<p>Code analyzed:</p>
<ul>
<xsl:for-each select="./Jar">
Expand Down Expand Up @@ -293,7 +293,7 @@
<xsl:variable name="format" select="'#######0.00'"/>

<p><xsl:value-of select="@total_size"/> lines of code analyzed,
in <xsl:value-of select="@total_classes"/> classes,
in <xsl:value-of select="@total_classes"/> classes,
in <xsl:value-of select="@num_packages"/> packages.</p>
<table width="500" cellpadding="5" cellspacing="2">
<tr class="tableheader">
Expand Down
35 changes: 35 additions & 0 deletions codequality/pmd.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0"?>
<!--
~ Copyright (c) 2019 Nike, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<ruleset name="cerberus-lifecycle-cli-ruleset"
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
<description>cerberus-lifecycle-cli-ruleset</description>

<rule ref="category/java/errorprone.xml">
<exclude name="BeanMembersShouldSerialize"/>
<exclude name="DataflowAnomalyAnalysis"/>
<exclude name="AvoidCatchingThrowable"/>
<exclude name="DoNotCallSystemExit"/>
<exclude name="AvoidLiteralsInIfCondition"/>
<exclude name="LoggerIsNotStaticFinal"/>
<exclude name="MissingSerialVersionUID"/>
<exclude name="UseProperClassLoader"/>
</rule>

</ruleset>
4 changes: 2 additions & 2 deletions codequality/suppressions.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0"?>

<!--
~ Copyright (c) 2016 Nike, Inc.
~ Copyright (c) 2019 Nike, Inc.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -24,4 +24,4 @@
<suppress checks="MagicNumber" files=".*"/>
<suppress checks="Javadoc" files=".*"/>
<suppress checks="LineLength" files=".*"/>
</suppressions>
</suppressions>
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2016 Nike, Inc.
# Copyright (c) 2019 Nike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down
12 changes: 6 additions & 6 deletions gradle/buildscript.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -20,8 +20,8 @@ repositories {

//noinspection GroovyAssignabilityCheck
dependencies {
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:2.2.5'
classpath 'net.saliman:gradle-cobertura-plugin:2.2.7'
classpath "com.github.jengelman.gradle.plugins:shadow:1.2.4"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
}
classpath 'org.jfrog.buildinfo:build-info-extractor-gradle:4.9.5'
classpath 'net.saliman:gradle-cobertura-plugin:2.6.1'
classpath "com.github.jengelman.gradle.plugins:shadow:5.0.0"
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.8.2'
}
28 changes: 17 additions & 11 deletions gradle/check.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,7 +16,7 @@

apply plugin: 'findbugs'
apply plugin: 'pmd'
apply plugin: 'cobertura'
apply plugin: "jacoco"
apply plugin: 'com.github.kt3k.coveralls'

findbugs {
Expand All @@ -27,6 +27,8 @@ findbugs {

pmd {
sourceSets = [project.sourceSets.main]
ruleSets = []
ruleSetFiles = files('codequality/pmd.xml')
}

tasks.withType(FindBugs) {
Expand All @@ -35,15 +37,19 @@ tasks.withType(FindBugs) {
}
}

cobertura {
// https://github.com/stevesaliman/gradle-cobertura-plugin/blob/master/usage.md
coverageReportDir = new File("$buildDir/reports/cobertura")
coverageFormats = ['html', 'xml']
coverageIgnoreTrivial = true
coverageExcludes = [
]
jacoco {
toolVersion = "0.8.3"
reportsDir = file("$buildDir/reports/jacoco")
}
test.finalizedBy(project.tasks.coberturaReport)

jacocoTestReport {
reports {
xml.enabled true
csv.enabled false
}
}

test.finalizedBy(project.tasks.jacocoTestReport)

task findbugsHtml {
group = "Verification"
Expand All @@ -56,4 +62,4 @@ task findbugsHtml {
}
findbugsMain.finalizedBy findbugsHtml

tasks.coveralls.dependsOn check
tasks.coveralls.dependsOn check
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down
6 changes: 3 additions & 3 deletions gradle/integration.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,12 +31,12 @@ configurations {
}

task integrationTest(type: Test) {
testClassesDir = sourceSets.integrationTest.output.classesDir
testClassesDirs = sourceSets.integrationTest.output.classesDirs
classpath = sourceSets.integrationTest.runtimeClasspath
}

integrationTest {
testLogging {
showStandardStreams = true
}
}
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
20 changes: 18 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
#Tue Jul 11 14:20:10 PDT 2017
#
# Copyright (c) 2019 Nike, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

#Thu Apr 11 10:48:41 PDT 2019
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-3.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.3.1-bin.zip
22 changes: 15 additions & 7 deletions gradlew
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/usr/bin/env sh

##############################################################################
##
Expand Down Expand Up @@ -154,11 +154,19 @@ if $cygwin ; then
esac
fi

# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
# Escape application args
save ( ) {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
APP_ARGS=$(save "$@")

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"

# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
cd "$(dirname "$0")"
fi

exec "$JAVACMD" "$@"
6 changes: 0 additions & 6 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ goto fail
@rem Get command-line arguments, handling Windows variants

if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args

:win9xME_args
@rem Slurp the command line arguments.
Expand All @@ -60,11 +59,6 @@ set _SKIP=2
if "x%~1" == "x" goto execute

set CMD_LINE_ARGS=%*
goto execute

:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$

:execute
@rem Setup the command line
Expand Down
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016 Nike, Inc.
* Copyright (c) 2019 Nike, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -14,4 +14,4 @@
* limitations under the License.
*/

rootProject.name = artifactId
rootProject.name = artifactId
Loading

0 comments on commit 36dda5b

Please sign in to comment.