|
Lines 30-35
Link Here
|
| 30 |
|
30 |
|
| 31 |
import org.eclipse.cdt.core.model.CoreModel; |
31 |
import org.eclipse.cdt.core.model.CoreModel; |
| 32 |
import org.eclipse.cdt.core.resources.ACBuilder; |
32 |
import org.eclipse.cdt.core.resources.ACBuilder; |
|
|
33 |
import org.eclipse.cdt.core.settings.model.CIncludeFileEntry; |
| 34 |
import org.eclipse.cdt.core.settings.model.CIncludePathEntry; |
| 35 |
import org.eclipse.cdt.core.settings.model.CMacroEntry; |
| 33 |
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; |
36 |
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; |
| 34 |
import org.eclipse.cdt.core.settings.model.ICProjectDescription; |
37 |
import org.eclipse.cdt.core.settings.model.ICProjectDescription; |
| 35 |
import org.eclipse.cdt.managedbuilder.core.IConfiguration; |
38 |
import org.eclipse.cdt.managedbuilder.core.IConfiguration; |
|
Lines 70-75
Link Here
|
| 70 |
* - Import all projects in the tree : -importAll {[uri:/]/path/to/projectTreeURI} |
73 |
* - Import all projects in the tree : -importAll {[uri:/]/path/to/projectTreeURI} |
| 71 |
* - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all} |
74 |
* - Build projects / the workspace : -build {project_name_reg_ex/config_name_reg_ex | all} |
| 72 |
* - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all} |
75 |
* - Clean build projects / the workspace : -cleanBuild {project_name_reg_ex/config_name_reg_ex | all} |
|
|
76 |
* - Add Include path to build : -I {include_path} |
| 77 |
* - Add Include file to build : -include {include_file} |
| 78 |
* - Add preprocessor define to build : -D {prepoc_define} |
| 73 |
* |
79 |
* |
| 74 |
* Build output is automatically sent to stdout. |
80 |
* Build output is automatically sent to stdout. |
| 75 |
* @since 6.0 |
81 |
* @since 6.0 |
|
Lines 363-368
Link Here
|
| 363 |
return status; |
369 |
return status; |
| 364 |
} |
370 |
} |
| 365 |
|
371 |
|
|
|
372 |
// Hook in our external settings to the build |
| 373 |
HeadlessBuilderExternalSettingsProvider.hookExternalSettingsProvider(); |
| 374 |
|
| 366 |
IProject[] allProjects = root.getProjects(); |
375 |
IProject[] allProjects = root.getProjects(); |
| 367 |
// Map from Project -> Configurations to build. We also Build all projects which are clean'd |
376 |
// Map from Project -> Configurations to build. We also Build all projects which are clean'd |
| 368 |
Map<IProject, Set<ICConfigurationDescription>> configsToBuild = new HashMap<IProject, Set<ICConfigurationDescription>>(); |
377 |
Map<IProject, Set<ICConfigurationDescription>> configsToBuild = new HashMap<IProject, Set<ICConfigurationDescription>>(); |
|
Lines 411-416
Link Here
|
| 411 |
} finally { |
420 |
} finally { |
| 412 |
// Reset the build_all_configs preference value to its previous state |
421 |
// Reset the build_all_configs preference value to its previous state |
| 413 |
ACBuilder.setAllConfigBuild(buildAllConfigs); |
422 |
ACBuilder.setAllConfigBuild(buildAllConfigs); |
|
|
423 |
// Unhook the external settings provider |
| 424 |
HeadlessBuilderExternalSettingsProvider.unhookExternalSettingsProvider(); |
| 414 |
} |
425 |
} |
| 415 |
} finally { |
426 |
} finally { |
| 416 |
// Wait for any outstanding jobs to finish |
427 |
// Wait for any outstanding jobs to finish |
|
Lines 466-471
Link Here
|
| 466 |
* -importAll {[uri:/]/path/to/projectTreeURI} Import all projects in the tree |
477 |
* -importAll {[uri:/]/path/to/projectTreeURI} Import all projects in the tree |
| 467 |
* -build {project_name_reg_ex/config_name_reg_ex | all} |
478 |
* -build {project_name_reg_ex/config_name_reg_ex | all} |
| 468 |
* -cleanBuild {project_name_reg_ex/config_name_reg_ex | all} |
479 |
* -cleanBuild {project_name_reg_ex/config_name_reg_ex | all} |
|
|
480 |
* -I {include_path} additional include_path to add to tools |
| 481 |
* -include {include_file} additional include_file to pass to tools |
| 482 |
* -D {prepoc_define} addition preprocessor defines to pass to the tools |
| 469 |
* |
483 |
* |
| 470 |
* Each argument may be specified more than once |
484 |
* Each argument may be specified more than once |
| 471 |
* @param args String[] of arguments to parse |
485 |
* @param args String[] of arguments to parse |
|
Lines 484-489
Link Here
|
| 484 |
projectRegExToBuild.add(args[++i]); |
498 |
projectRegExToBuild.add(args[++i]); |
| 485 |
} else if ("-cleanBuild".equals(args[i])) { //$NON-NLS-1$ |
499 |
} else if ("-cleanBuild".equals(args[i])) { //$NON-NLS-1$ |
| 486 |
projectRegExToClean.add(args[++i]); |
500 |
projectRegExToClean.add(args[++i]); |
|
|
501 |
} else if ("-D".equals(args[i])) { //$NON-NLS-1$ |
| 502 |
String macro = args[++i]; |
| 503 |
String macroVal = ""; //$NON-NLS-1$ |
| 504 |
if (macro.indexOf('=') != -1) { |
| 505 |
macroVal = macro.substring(macro.indexOf('=') + 1); |
| 506 |
macro = macro.substring(0, macro.indexOf('=')); |
| 507 |
} |
| 508 |
HeadlessBuilderExternalSettingsProvider.additionalSettings.add(new CMacroEntry(macro, macroVal, 0)); |
| 509 |
} else if ("-I".equals(args[i])) { //$NON-NLS-1$ |
| 510 |
HeadlessBuilderExternalSettingsProvider.additionalSettings.add(new CIncludePathEntry(args[++i], 0)); |
| 511 |
} else if ("-include".equals(args[i])) { //$NON-NLS-1$ |
| 512 |
HeadlessBuilderExternalSettingsProvider.additionalSettings.add(new CIncludeFileEntry(args[++i], 0)); |
| 487 |
} else { |
513 |
} else { |
| 488 |
throw new Exception(HeadlessBuildMessages.HeadlessBuilder_unknown_argument + args[i]); |
514 |
throw new Exception(HeadlessBuildMessages.HeadlessBuilder_unknown_argument + args[i]); |
| 489 |
} |
515 |
} |
|
Lines 497-502
Link Here
|
| 497 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_importAll); |
523 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_importAll); |
| 498 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_build); |
524 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_build); |
| 499 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_clean_build); |
525 |
System.err.println(HeadlessBuildMessages.HeadlessBuilder_usage_clean_build); |
|
|
526 |
System.err.println(" -I {include_path} additional include_path to add to tools"); |
| 527 |
System.err.println(" -include {include_file} additional include_file to pass to tools"); |
| 528 |
System.err.println(" -D {prepoc_define} addition preprocessor defines to pass to the tools"); |
| 500 |
return false; |
529 |
return false; |
| 501 |
} |
530 |
} |
| 502 |
|
531 |
|