Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_langtools
提交
cf1a9a23
D
dragonwell8_langtools
项目概览
openanolis
/
dragonwell8_langtools
通知
0
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_langtools
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cf1a9a23
编写于
11月 14, 2011
作者:
K
ksrini
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7110974: (javac) add coding conventions and style checkers for langtools
Reviewed-by: jjg
上级
bf0d054e
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
127 addition
and
0 deletion
+127
-0
make/build.properties
make/build.properties
+4
-0
make/build.xml
make/build.xml
+52
-0
make/conf/checkstyle-emacs.xsl
make/conf/checkstyle-emacs.xsl
+24
-0
make/conf/checkstyle-langtools.xml
make/conf/checkstyle-langtools.xml
+47
-0
未找到文件。
make/build.properties
浏览文件 @
cf1a9a23
...
...
@@ -196,3 +196,7 @@ import.jdk.stub.files = \
# An empty value means all tests
# Override as desired to run a specific set of tests
jtreg.tests
=
# Check style configuration
# overridable name and version
checkstyle.name.version
=
checkstyle-5.4
make/build.xml
浏览文件 @
cf1a9a23
...
...
@@ -131,8 +131,10 @@
<property
name=
"dist.bin.dir"
location=
"${dist.dir}/bin"
/>
<property
name=
"dist.coverage.dir"
location=
"${dist.dir}/coverage"
/>
<property
name=
"dist.findbugs.dir"
location=
"${dist.dir}/findbugs"
/>
<property
name=
"dist.checkstyle.dir"
location=
"${dist.dir}/checkstyle"
/>
<property
name=
"dist.lib.dir"
location=
"${dist.dir}/lib"
/>
<property
name=
"make.dir"
location=
"make"
/>
<property
name=
"make.conf.dir"
location=
"${make.dir}/conf"
/>
<property
name=
"make.tools.dir"
location=
"${make.dir}/tools"
/>
<property
name=
"src.dir"
location=
"src"
/>
<property
name=
"src.bin.dir"
location=
"${src.dir}/share/bin"
/>
...
...
@@ -263,6 +265,41 @@
<jtreg-tool
name=
"all"
tests=
"${jtreg.tests}"
/>
</target>
<target
name=
"checkstyle"
depends=
"-def-checkstyle"
description=
"Generates reports for code convention violations."
>
<mkdir
dir=
"${dist.checkstyle.dir}"
/>
<checkstyle
config=
"${make.conf.dir}/checkstyle-langtools.xml"
failureProperty=
"checkstyle.failure"
failOnViolation=
"false"
>
<formatter
type=
"xml"
tofile=
"${dist.checkstyle.dir}/checkstyle_report.xml"
/>
<fileset
dir=
"src"
includes=
"**/*.java, **/*.properties"
/>
</checkstyle>
<!-- transform the output to a simple html -->
<xslt
in=
"${dist.checkstyle.dir}/checkstyle_report.xml"
out=
"${dist.checkstyle.dir}/checkstyle_report.html"
style=
"${checkstyle.home}/contrib/checkstyle-simple.xsl"
/>
<!-- transform the output to a very simple emacs friendly text file -->
<xslt
in=
"${dist.checkstyle.dir}/checkstyle_report.xml"
out=
"${dist.checkstyle.dir}/checkstyle_report.tmp"
style=
"${make.conf.dir}/checkstyle-emacs.xsl"
/>
<!-- beautify remove extra lines -->
<move
file=
"${dist.checkstyle.dir}/checkstyle_report.tmp"
toFile=
"${dist.checkstyle.dir}/checkstyle_report.emacs.txt"
>
<filterchain>
<ignoreblank/>
<replaceregex
byline=
"true"
pattern=
"^File:"
replace=
"${line.separator}File:"
/>
</filterchain>
</move>
</target>
<!-- target can be invoked from an ide, the output of which can be used
to access and fix the errors directly.
-->
<target
name=
"checkstyle-ide"
depends=
"checkstyle"
>
<concat>
<fileset
file=
"${dist.checkstyle.dir}/checkstyle_report.emacs.txt"
/>
</concat>
</target>
<target
name=
"findbugs"
depends=
"-def-findbugs,build-all-tools"
>
<property
name=
"findbugs.reportLevel"
value=
"medium"
/>
<mkdir
dir=
"${dist.findbugs.dir}"
/>
...
...
@@ -406,6 +443,7 @@
<echo
level=
"info"
>
target.java.home = ${target.java.home}
</echo>
<echo
level=
"info"
>
jtreg.home = ${jtreg.home}
</echo>
<echo
level=
"info"
>
findbugs.home = ${findbugs.home}
</echo>
<echo
level=
"info"
>
checkstyle.home = ${checkstyle.home}
</echo>
</target>
<target
name=
"post-sanity"
depends=
"-def-jtreg,sanity,build"
...
...
@@ -690,6 +728,10 @@
<check
name=
"findbugs"
property=
"findbugs.home"
marker=
"lib/findbugs.jar"
/>
</target>
<target
name=
"-check-checkstyle.home"
depends=
"-def-check"
>
<check
name=
"checkstyle"
property=
"checkstyle.home"
marker=
"${checkstyle.name.version}.jar"
/>
</target>
<target
name=
"-check-jtreg.home"
depends=
"-def-check"
>
<check
name=
"jtreg"
property=
"jtreg.home"
marker=
"lib/jtreg.jar"
/>
</target>
...
...
@@ -989,6 +1031,16 @@
<taskdef
classpathref=
"cobertura.classpath"
resource=
"tasks.properties"
/>
</target>
<target
name=
"-def-checkstyle"
unless=
"checkstyle.defined"
depends=
"-check-checkstyle.home"
>
<taskdef
resource=
"checkstyletask.properties"
>
<classpath>
<pathelement
location=
"${checkstyle.home}/${checkstyle.name.version}-all.jar"
/>
</classpath>
</taskdef>
<property
name=
"checkstyle.defined"
value=
"true"
/>
</target>
<target
name=
"-def-findbugs"
unless=
"findbugs.defined"
depends=
"-check-findbugs.home,-check-target.java.home"
>
<taskdef
name=
"findbugs"
classname=
"edu.umd.cs.findbugs.anttask.FindBugsTask"
>
...
...
make/conf/checkstyle-emacs.xsl
0 → 100644
浏览文件 @
cf1a9a23
<?xml version="1.0"?>
<xsl:stylesheet
version=
"1.0"
xmlns:xsl=
"http://www.w3.org/1999/XSL/Transform"
>
<xsl:output
method=
"text"
omit-xml-declaration=
"yes"
/>
<xsl:template
match=
"/"
>
Coding Style Check Results
--------------------------
Total files checked:
<xsl:number
level=
"any"
value=
"count(descendant::file)"
/>
Files with errors:
<xsl:number
level=
"any"
value=
"count(descendant::file[error])"
/>
Total errors:
<xsl:number
level=
"any"
value=
"count(descendant::error)"
/>
Errors per file:
<xsl:number
level=
"any"
value=
"count(descendant::error) div count(descendant::file)"
/>
<xsl:apply-templates/>
</xsl:template>
<xsl:template
match=
"file[error]"
>
<xsl:apply-templates
select=
"error"
/>
</xsl:template>
<xsl:template
match=
"error"
>
<xsl:value-of
select=
"../@name"
/>
:
<xsl:value-of
select=
"@line"
/><xsl:text>
:
</xsl:text><xsl:value-of
select=
"@message"
/><xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
make/conf/checkstyle-langtools.xml
0 → 100644
浏览文件 @
cf1a9a23
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Puppy Crawl//DTD Check Configuration 1.3//EN"
"http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<!--
Checks for initial langtools code conventions, we are starting with
imports and import orders and this will grow to encompass other
violations over time.
-->
<module
name=
"Checker"
>
<!-- Checks for whitespace. -->
<module
name=
"FileTabCharacter"
>
<property
name=
"fileExtensions"
value=
".java"
/>
</module>
<!-- Miscellaneous other checks. -->
<module
name=
"RegexpSingleline"
>
<property
name=
"format"
value=
"\s+$"
/>
<property
name=
"minimum"
value=
"0"
/>
<property
name=
"maximum"
value=
"0"
/>
<property
name=
"message"
value=
"Line has trailing spaces."
/>
<property
name=
"fileExtensions"
value=
".java .html"
/>
</module>
<module
name=
"TreeWalker"
>
<!-- Checks for imports -->
<!--
<module name="AvoidStarImport"/>
<module name="IllegalImport"/>
-->
<module
name=
"GenericWhitespace"
/>
<module
name=
"RedundantImport"
/>
<module
name=
"UnusedImports"
/>
<module
name=
"ImportOrder"
>
<property
name=
"groups"
value=
"java, javax, org, com"
/>
<property
name=
"ordered"
value=
"true"
/>
<property
name=
"separated"
value=
"true"
/>
</module>
<module
name=
"EmptyForInitializerPad"
>
<property
name=
"option"
value=
"space"
/>
</module>
<module
name=
"WhitespaceAfter"
/>
</module>
</module>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录