2011-04-12 23 views

回答

2

Google CodePro Analytix應該有一個Ant任務,它應該是命令行實用程序執行所需操作的地方。

5

有一個set of codepro ant tasks可用於審計和報告生成。

至於其他工具,還有一個set of ant tasks for PMD以及一個PMD plugin for maven。兩者都可以從命令行運行。

爲FindBugs的相似:在螞蟻任務的說明可以發現here,和Maven插件here

編輯:在我看來,谷歌購買了此beatiful工具只是爲了讓它死去默默無聞的。似乎沒有ongoig開發,也沒有發佈到開源。螞蟻任務沒有發佈(我沒有找到可用的例子)。沒有maven插件。我們無法將其整合到我們的版本中,並重新使用PMD,Findbugs和Sonar。這是一個恥辱。

+0

網頁自2012年3月27日起更新,所以對我來說這並不明顯。 – dfrankow 2012-11-07 17:21:13

1

CodePro Analytix具有螞蟻任務,它們是功能性的。請看這裏的文檔。

https://developers.google.com/java-dev-tools/codepro/doc/features/ant/headless - 即使第一行顯示任務已過時,它也能正常工作。

這兩個ant任務codepro.audit和codepro.metrics都可以在Eclipse Juno中正常工作。我能夠通過編輯headless.xml和run_headless.bat文件從https://developers.google.com/java-dev-tools/codepro/doc/features/ant/example/headless_existing_workspace_33.zip

在現有工作區項目上運行審計和度量任務我編輯了默認的headless.xml以使用特定的規則/度量標準集並導出導致xml格式。

<?xml version="1.0" encoding="UTF-8"?> 
<project name="Ant Test" basedir="." default="main"> 
    <target name="main">   
     <!-- the project source directory to be analyzed --> 
     <property name="projSrc" location="<full path to your project source folder>"/> 

     <!-- test codepro.audit --> 
     <codepro.audit auditRuleSetName="CodePro Default" 
      resultFile="headless_audit_out.txt"> 
      <fileSet dir="${projSrc}"/> 
      <report file="audit_result.xml" format="xml"> 
      </report> 
     </codepro.audit> 

     <!-- test codepro.metrics --> 
     <codepro.metrics metricSetName="CodePro Default" 
      resultFile="headless_metrics_out.txt"> 
      <fileSet dir="${projSrc}"/> 
      <report file="metrics_result.xml" format="xml"> 
      </report> 
     </codepro.metrics> 

     <echo message="It works!"/> 
    </target> 
</project> 
+0

運行bat文件時...我得到'[antlib:org.apache.tools.ant]無法從資源org/apache/tools/ant/antlib.xml加載定義。它找不到。「我正在使用伽利略 – 2014-10-29 10:09:36