diff mxtool/mx.py @ 14918:31a9c79399c8

disabled current Checkstyle configurations (until Checkstyle supports Java8)
author Doug Simon <doug.simon@oracle.com>
date Tue, 01 Apr 2014 18:51:14 +0200
parents 3e06a56ab0e6
children 3de340bdb8d3
line wrap: on
line diff
--- a/mxtool/mx.py	Tue Apr 01 15:50:55 2014 +0200
+++ b/mxtool/mx.py	Tue Apr 01 18:51:14 2014 +0200
@@ -2372,10 +2372,10 @@
         if p.native:
             continue
         sourceDirs = p.source_dirs()
-        dotCheckstyle = join(p.dir, '.checkstyle')
-
-        if not exists(dotCheckstyle):
-            abort('ERROR: .checkstyle for Project {0} is missing'.format(p.name))
+
+        csConfig = join(p.dir, '.checkstyle_checks.xml')
+        if not exists(csConfig):
+            abort('ERROR: Checkstyle configuration for project {} is missing: {}'.format(p.name, csConfig))
 
         # skip checking this Java project if its Java compliance level is "higher" than the configured JDK
         jdk = java(p.javaCompliance)
@@ -2403,7 +2403,7 @@
                     log('[all Java sources in {0} already checked - skipping]'.format(sourceDir))
                 continue
 
-            dotCheckstyleXML = xml.dom.minidom.parse(dotCheckstyle)
+            dotCheckstyleXML = xml.dom.minidom.parse(csConfig)
             localCheckConfig = dotCheckstyleXML.getElementsByTagName('local-check-config')[0]
             configLocation = localCheckConfig.getAttribute('location')
             configType = localCheckConfig.getAttribute('type')
@@ -2901,6 +2901,11 @@
             out.close('fileset-config')
             update_file(dotCheckstyle, out.xml(indent='  ', newl='\n'))
             files.append(dotCheckstyle)
+        else:
+            # clean up existing .checkstyle file
+            dotCheckstyle = join(p.dir, ".checkstyle")
+            if exists(dotCheckstyle):
+                os.unlink(dotCheckstyle)
 
         out = XMLDoc()
         out.open('projectDescription')
@@ -3548,6 +3553,7 @@
         shutil.rmtree(join(p.dir, '.externalToolBuilders'), ignore_errors=True)
         shutil.rmtree(join(p.dir, 'nbproject'), ignore_errors=True)
         rm(join(p.dir, '.classpath'))
+        rm(join(p.dir, '.checkstyle'))
         rm(join(p.dir, '.project'))
         rm(join(p.dir, '.factorypath'))
         rm(join(p.dir, 'build.xml'))