Reputation: 1
REF: Build Eclipse Java Project from Command Line
@kieveli
Is there any command to compile/build only modified files instead of whole project using eclipse command line?
Below command compiles the whole project every time.
eclipsec.exe -noSplash -data "D:\Source\MyProject\workspace" -application org.eclipse.jdt.apt.core.aptBuild
Upvotes: 0
Views: 980
Reputation: 24617
Use the CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER
option:
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
Or the org.eclipse.core.resources.ant.IncrementalBuild
Ant task:
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().
Examples:
<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
References
org.eclipse.jdt.core.JavaCore: CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER
Troubleshooting headless Ant builds with Rational Application Developer
Plug-in Development Environment Guide > Tasks > PDE Build > Advanced Topics: Compiler options
Upvotes: 1