Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use checkstyle version 6.15 #27

Merged
merged 2 commits into from
Feb 3, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion mx.mx/suite.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
}
},

"CHECKSTYLE" : {
"CHECKSTYLE_6.0" : {
"urls" : [
"https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/checkstyle-6.0-all.jar",
"jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/6.0/checkstyle-6.0-bin.zip/download!/checkstyle-6.0/checkstyle-6.0-all.jar",
Expand All @@ -71,6 +71,20 @@
}
},

"CHECKSTYLE_6.15" : {
"urls" : [
"https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/checkstyle-6.15-all.jar",
"jar:http://sourceforge.net/projects/checkstyle/files/checkstyle/6.15/checkstyle-6.15-all.jar",
],
"sha1" : "db9ade7f4ef4ecb48e3f522873946f9b48f949ee",
"licence" : "LGPLv21",
"maven" : {
"groupId" : "com.puppycrawl.tools",
"artifactId" : "checkstyle",
"version" : "6.15",
}
},

"HAMCREST" : {
"urls" : [
"https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3.jar",
Expand Down
12 changes: 7 additions & 5 deletions mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -1274,10 +1274,11 @@ def __init__(self, args, parallelism, project):
BuildTask.__init__(self, project, args, parallelism)

class JavaProject(Project, ClasspathDependency):
def __init__(self, suite, name, subDir, srcDirs, deps, javaCompliance, workingSets, d, theLicense=None):
def __init__(self, suite, name, subDir, srcDirs, deps, javaCompliance, workingSets, d, checkstyleLibraryName, theLicense=None):
Project.__init__(self, suite, name, subDir, srcDirs, deps, workingSets, d, theLicense)
ClasspathDependency.__init__(self)
self.checkstyleProj = name
self.checkstyleLibraryName = checkstyleLibraryName
if javaCompliance is None:
abort('javaCompliance property required for Java project ' + name)
self.javaCompliance = JavaCompliance(javaCompliance)
Expand Down Expand Up @@ -5425,7 +5426,8 @@ def _load_projects(self):
javaCompliance = attrs.pop('javaCompliance', None)
if javaCompliance is None:
abort('javaCompliance property required for non-native project ' + name)
p = JavaProject(self, name, subDir, srcDirs, deps, javaCompliance, workingSets, d, theLicense=theLicense)
checkstyleLibraryName = self.getMxCompatibility().checkstyleLibraryName()
p = JavaProject(self, name, subDir, srcDirs, deps, javaCompliance, workingSets, d, checkstyleLibraryName, theLicense=theLicense)
p.checkstyleProj = attrs.pop('checkstyle', name)
p.checkPackagePrefix = attrs.pop('checkPackagePrefix', 'true') == 'true'
ap = Suite._pop_list(attrs, 'annotationProcessors', context)
Expand Down Expand Up @@ -8546,6 +8548,7 @@ def checkstyle(args):
continue
if args.primary and not p.suite.primary:
continue
checkstyleLibrary = library(p.checkstyleLibraryName).get_path(True)
sourceDirs = p.source_dirs()

config = join(project(p.checkstyleProj).dir, '.checkstyle_checks.xml')
Expand Down Expand Up @@ -8594,11 +8597,10 @@ def match(name):

auditfileName = join(p.dir, 'checkstyleOutput.txt')
log('Running Checkstyle on {0} using {1}...'.format(sourceDir, config))

try:
for chunk in _chunk_files_for_command_line(javafilelist):
try:
run_java(['-Xmx1g', '-jar', library('CHECKSTYLE').get_path(True), '-f', 'xml', '-c', config, '-o', auditfileName] + chunk, nonZeroIsFatal=False)
run_java(['-Xmx1g', '-jar', checkstyleLibrary, '-f', 'xml', '-c', config, '-o', auditfileName] + chunk, nonZeroIsFatal=False)
finally:
if exists(auditfileName):
errors = []
Expand Down Expand Up @@ -12283,7 +12285,7 @@ def alarm_handler(signum, frame):
# no need to show the stack trace when the user presses CTRL-C
abort(1)

version = VersionSpec("5.6.15")
version = VersionSpec("5.6.16")

currentUmask = None

Expand Down
11 changes: 11 additions & 0 deletions mx_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ def getSuiteOutputRoot(self, suite):
def mavenDeployJavadoc(self):
return False

def checkstyleLibraryName(self):
return 'CHECKSTYLE_6.0'

def __str__(self):
return str("MxCompatibility({})".format(self.version()))

Expand Down Expand Up @@ -128,6 +131,14 @@ def version():
def mavenDeployJavadoc(self):
return True

class MxCompatibility5616(MxCompatibility566):#pylint: disable=too-many-ancestors
@staticmethod
def version():
return mx.VersionSpec("5.6.16")

def checkstyleLibraryName(self):
return 'CHECKSTYLE_6.15'

def minVersion():
_ensureCompatLoaded()
return _versionsMap.keys()[0]
Expand Down