1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-19 06:55:23 +02:00

Bug 540369 - HeadlessBuilder: change private to protected

Change-Id: Ib8ca36aa50ce6060d4f8fb14f5b74c3662bc8862
Signed-off-by: Evgueni Driouk <Evgueni.Driouk@arm.com>
This commit is contained in:
Evgueni Driouk 2018-10-22 15:19:45 +02:00 committed by William Riley
parent ebc9420473
commit 1fa5f7d6e5

View file

@ -114,7 +114,7 @@ public class HeadlessBuilder implements IApplication {
/** /**
* IProgressMonitor to provide printing of task * IProgressMonitor to provide printing of task
*/ */
private static class PrintingProgressMonitor extends NullProgressMonitor { public static class PrintingProgressMonitor extends NullProgressMonitor {
@Override @Override
public void beginTask(String name, int totalWork) { public void beginTask(String name, int totalWork) {
if (name != null && name.length() > 0) if (name != null && name.length() > 0)
@ -125,7 +125,7 @@ public class HeadlessBuilder implements IApplication {
/** /**
* A class representing a new tool option value * A class representing a new tool option value
*/ */
private static class ToolOption { protected static class ToolOption {
public static final int REPLACE = 0; public static final int REPLACE = 0;
public static final int APPEND = 1; public static final int APPEND = 1;
public static final int PREPEND = 2; public static final int PREPEND = 2;
@ -146,7 +146,7 @@ public class HeadlessBuilder implements IApplication {
/** /**
* A class representing a backed-up tool option to restored at the end of the build * A class representing a backed-up tool option to restored at the end of the build
*/ */
private static class SavedToolOption { protected static class SavedToolOption {
final String toolId; final String toolId;
final String optionId; final String optionId;
final Object value; final Object value;
@ -175,32 +175,32 @@ public class HeadlessBuilder implements IApplication {
public static final Integer OK = IApplication.EXIT_OK; public static final Integer OK = IApplication.EXIT_OK;
/** Set of project URIs / paths to import */ /** Set of project URIs / paths to import */
private final Set<String> projectsToImport = new HashSet<String>(); protected final Set<String> projectsToImport = new HashSet<String>();
/** Tree of projects to recursively import */ /** Tree of projects to recursively import */
private final Set<String> projectTreeToImport = new HashSet<String>(); protected final Set<String> projectTreeToImport = new HashSet<String>();
/** Set of project names to build */ /** Set of project names to build */
private final Set<String> projectRegExToBuild = new HashSet<String>(); protected final Set<String> projectRegExToBuild = new HashSet<String>();
/** Set of project names to clean */ /** Set of project names to clean */
private final Set<String> projectRegExToClean = new HashSet<String>(); protected final Set<String> projectRegExToClean = new HashSet<String>();
private boolean buildAll = false; protected boolean buildAll = false;
private boolean cleanAll = false; protected boolean cleanAll = false;
private boolean disableIndexer = false; protected boolean disableIndexer = false;
/** List of Tool Option values being set */ /** List of Tool Option values being set */
private List<ToolOption> toolOptions = new ArrayList<ToolOption>(); protected List<ToolOption> toolOptions = new ArrayList<ToolOption>();
/** Map from configuration ID -> Set of SavedToolOptions */ /** Map from configuration ID -> Set of SavedToolOptions */
private Map<String, Set<SavedToolOption>> savedToolOptions = new HashMap<String, Set<SavedToolOption>>(); protected Map<String, Set<SavedToolOption>> savedToolOptions = new HashMap<String, Set<SavedToolOption>>();
private boolean markerTypesDefault = true; protected boolean markerTypesDefault = true;
private boolean markerTypesAll = false; protected boolean markerTypesAll = false;
private Set<String> markerTypes = new HashSet<>(); protected Set<String> markerTypes = new HashSet<>();
private boolean printErrorMarkers = false; protected boolean printErrorMarkers = false;
private static final String MATCH_ALL_CONFIGS = ".*"; //$NON-NLS-1$ protected static final String MATCH_ALL_CONFIGS = ".*"; //$NON-NLS-1$
/* /*
* Find all project build configurations that match the regular expression ("project/config") * Find all project build configurations that match the regular expression ("project/config")
*/ */
private Map<IProject, Set<ICConfigurationDescription>> matchConfigurations(String regularExpression, IProject[] projectList, Map<IProject, Set<ICConfigurationDescription>> cfgMap) { protected Map<IProject, Set<ICConfigurationDescription>> matchConfigurations(String regularExpression, IProject[] projectList, Map<IProject, Set<ICConfigurationDescription>> cfgMap) {
try { try {
int separatorIndex = regularExpression.indexOf('/'); int separatorIndex = regularExpression.indexOf('/');
@ -263,7 +263,7 @@ public class HeadlessBuilder implements IApplication {
/* /*
* Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL) * Build the given configurations using the specified build type (FULL, CLEAN, INCREMENTAL)
*/ */
private void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs, final IProgressMonitor monitor, final int buildType) throws CoreException { protected void buildConfigurations(Map<IProject, Set<ICConfigurationDescription>> projConfigs, final IProgressMonitor monitor, final int buildType) throws CoreException {
for (Map.Entry<IProject, Set<ICConfigurationDescription>> entry : projConfigs.entrySet()) { for (Map.Entry<IProject, Set<ICConfigurationDescription>> entry : projConfigs.entrySet()) {
Set<ICConfigurationDescription> cfgDescs = entry.getValue(); Set<ICConfigurationDescription> cfgDescs = entry.getValue();
@ -282,7 +282,7 @@ public class HeadlessBuilder implements IApplication {
* @param recurse should we recurse down the URI importing all projects? * @param recurse should we recurse down the URI importing all projects?
* @return int OK / ERROR * @return int OK / ERROR
*/ */
private int importProject(String projURIStr, boolean recurse) throws CoreException { protected int importProject(String projURIStr, boolean recurse) throws CoreException {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProgressMonitor monitor = new PrintingProgressMonitor(); IProgressMonitor monitor = new PrintingProgressMonitor();
InputStream in = null; InputStream in = null;
@ -376,7 +376,7 @@ public class HeadlessBuilder implements IApplication {
return OK; return OK;
} }
private boolean isProjectSuccesfullyBuild(IProject project) { protected boolean isProjectSuccesfullyBuild(IProject project) {
try { try {
for (String markerType : markerTypes) { for (String markerType : markerTypes) {
int findMaxProblemSeverity = project.findMaxProblemSeverity(markerType, true, IResource.DEPTH_INFINITE); int findMaxProblemSeverity = project.findMaxProblemSeverity(markerType, true, IResource.DEPTH_INFINITE);
@ -391,7 +391,7 @@ public class HeadlessBuilder implements IApplication {
return true; return true;
} }
private void accumulateErrorMarkers(IProject project, List<String> allBuildErrors) { protected void accumulateErrorMarkers(IProject project, List<String> allBuildErrors) {
try { try {
for (String markerType : markerTypes) { for (String markerType : markerTypes) {
IMarker[] findMarkers = project.findMarkers(markerType, true, IResource.DEPTH_INFINITE); IMarker[] findMarkers = project.findMarkers(markerType, true, IResource.DEPTH_INFINITE);
@ -603,7 +603,7 @@ public class HeadlessBuilder implements IApplication {
* *
* @return true if a valid instance location has been set and false otherwise * @return true if a valid instance location has been set and false otherwise
*/ */
private boolean checkInstanceLocation() { protected boolean checkInstanceLocation() {
// -data @none was specified but an ide requires workspace // -data @none was specified but an ide requires workspace
Location instanceLoc = Platform.getInstanceLocation(); Location instanceLoc = Platform.getInstanceLocation();
if (instanceLoc == null || !instanceLoc.isSet()) { if (instanceLoc == null || !instanceLoc.isSet()) {
@ -755,7 +755,7 @@ public class HeadlessBuilder implements IApplication {
return true; return true;
} }
private void addEnvironmentVariable(String string, int op) throws Exception { protected void addEnvironmentVariable(String string, int op) throws Exception {
String[] parts = string.split("=", 2); //$NON-NLS-1$ String[] parts = string.split("=", 2); //$NON-NLS-1$
String name = parts[0]; String name = parts[0];
String value = ""; //$NON-NLS-1$ String value = ""; //$NON-NLS-1$
@ -764,7 +764,7 @@ public class HeadlessBuilder implements IApplication {
EnvironmentVariableManager.fUserSupplier.createOverrideVariable(name, value, op, null); EnvironmentVariableManager.fUserSupplier.createOverrideVariable(name, value, op, null);
} }
private void addToolOption(String toolId, String option, int operation) { protected void addToolOption(String toolId, String option, int operation) {
String optionId = option; String optionId = option;
String value = ""; //$NON-NLS-1$ String value = ""; //$NON-NLS-1$
if (option.indexOf('=') != -1) { if (option.indexOf('=') != -1) {
@ -774,7 +774,7 @@ public class HeadlessBuilder implements IApplication {
toolOptions.add(new ToolOption(toolId, optionId, value, operation)); toolOptions.add(new ToolOption(toolId, optionId, value, operation));
} }
private void addMarkerType(String markerType) { protected void addMarkerType(String markerType) {
markerTypesDefault = false; markerTypesDefault = false;
if ("all".equals(markerType)) { //$NON-NLS-1$ if ("all".equals(markerType)) { //$NON-NLS-1$
markerTypesAll = true; markerTypesAll = true;
@ -791,7 +791,7 @@ public class HeadlessBuilder implements IApplication {
* by calls to {@link #resetToolOptions(IConfiguration)}. * by calls to {@link #resetToolOptions(IConfiguration)}.
*/ */
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private void setToolOptions(IConfiguration configuration) throws BuildException { protected void setToolOptions(IConfiguration configuration) throws BuildException {
if (!savedToolOptions.containsKey(configuration.getId())) if (!savedToolOptions.containsKey(configuration.getId()))
savedToolOptions.put(configuration.getId(), new HashSet<SavedToolOption>()); savedToolOptions.put(configuration.getId(), new HashSet<SavedToolOption>());
Set<SavedToolOption> savedToolOptionsSet = savedToolOptions.get(configuration.getId()); Set<SavedToolOption> savedToolOptionsSet = savedToolOptions.get(configuration.getId());
@ -870,7 +870,7 @@ public class HeadlessBuilder implements IApplication {
/** /**
* Reset the tool options that were set using {@link #setToolOptions(IConfiguration)} * Reset the tool options that were set using {@link #setToolOptions(IConfiguration)}
*/ */
private void resetToolOptions(IConfiguration configuration) throws BuildException { protected void resetToolOptions(IConfiguration configuration) throws BuildException {
for (SavedToolOption toolOption : savedToolOptions.get(configuration.getId())) { for (SavedToolOption toolOption : savedToolOptions.get(configuration.getId())) {
IOption option = configuration.getTool(toolOption.toolId).getOptionById(toolOption.optionId); IOption option = configuration.getTool(toolOption.toolId).getOptionById(toolOption.optionId);
option.setValue(toolOption.value); option.setValue(toolOption.value);