引用号:Build Eclipse Java Project from Command Line
@基维利
是否有任何命令可以使用 eclipse 命令行仅编译/构建修改过的文件而不是整个项目?
下面的命令每次都会编译整个项目。
eclipsec.exe -noSplash -data "D:\Source\MyProject\workspace" -application org.eclipse.jdt.apt.core.aptBuild
最佳答案
使用CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER
选项:
org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder=ignore
public static final String CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER
Core option ID: Recreate Modified class files in Output Folder. Indicate whether the JavaBuilder should check for any changes to .class files in the output folders while performing incremental build operations. If changes are detected to managed .class files, then a full build is performed, otherwise the changes are left as is. Tools further altering generated .class files, like optimizers, should ensure this option remains set in its default state of ignore.
Option id: "org.eclipse.jdt.core.builder.recreateModifiedClassFileInOutputFolder"
Possible values: { "enabled", "ignore" }
Default: "ignore"
Since: 3.2
或者 org.eclipse.core.resources.ant.IncrementalBuild
Ant 任务:
eclipse.incrementalBuild
When the project attribute is supplied, this task is a wrapper to IProject.build(). Otherwise, this task is a wrapper to the method: IWorkspace.build().
示例:
<eclipse.incrementalBuild/>
<eclipse.incrementalBuild project="MyProject" kind="incremental"/>
project the name of the project to be built
kind the kind of build to perform. Possible values include:
"incremental" to perform an incremental build "full" to discard existing builder state and rebuild everything from scratch "clean" to discard existing builder state but not rebuild
builder the name of the builder to run; If this value is not specified all builders are run
引用文献
关于java - 使用 eclipse 命令行进行增量构建,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40094841/