java - 使用 eclipse 命令行进行增量构建

标签 java eclipse command-line

引用号: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/

相关文章:

java - 将日期格式化为字符串,从 bean 到 javascript

java - NonNull 注解的实现

eclipse - 删除@WebServlet 会导致 java.lang.ClassNotFoundException

r - 在 R 中通过命令行传递多个参数

c - 如何比较指针与ascii字符?

java - 如何使用 Selenium Java 设置 <pre> html 标签的值?

java - SWT:用组件重新填充外壳时布局被破坏

java - 奇怪的谜题 - 位置的无效内存访问

java - 在 Eclipse 的控制台中显示 java 错误

php - 如何在 AppFog 上运行 Laravel artisan 命令?