簡體   English   中英

Eclipse編譯器設置對應的ant javac選項是什么?

[英]What are the corresponding ant javac options for Eclipse compiler settings?

我正在嘗試獲取一個ant構建文件以生成與eclipse編譯器相同的類文件

org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve

前三個對應於(我希望!)與javac任務中的debuglevel="vars,lines,source"應:

<javac includeantruntime="false" srcdir="${src.dir}" destdir="${build.dir}"  debug="true"  debuglevel="vars,lines,source" target="1.5" >
   <classpath refid="master-classpath" />
</javac>

那最后一個呢?

對於前三個,我認為您需要告訴Ant javac的全部是debug="true" 默認情況下,您將獲得變量,行和源。 明確指定它們也可以。

最后,這是Eclipse JDT編譯器特有的。 我認為其他編譯器不會優化未使用的局部變量。 當然,由於刪除了未使用的局部變量,所以我從未遇到過調試器失調的情況。

您是否正在使用Ant javac適配器在Ant構建中使用 JDT編譯 除非您這樣做,否則我認為您不能保證兩種環境之間的類文件絕對相同。 但是,對於這樣一個級別相同的要求,我會有點懷疑。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM