mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 09:25:31 +02:00
autotools: Another round of core bundle cleanups.
* Use try-with-resources. * More efficient cycles. * Use collections interfaces instead of concrete classes. * Turn non-javadoc with actual comments into javadoc. * Adapt to proper Java naming conventions. * Modifiers order. * Unused modifiers. Change-Id: I5e4ca3e5f2900b72b53338a455dbaaa65273d812 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
This commit is contained in:
parent
0a04f1aba9
commit
904d0df63d
17 changed files with 200 additions and 216 deletions
|
@ -38,12 +38,12 @@ public class AutotoolsNewProjectNature implements IProjectNature {
|
|||
|
||||
public static final String AUTOTOOLS_NATURE_ID = "org.eclipse.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$
|
||||
public static final String OLD_AUTOTOOLS_NATURE_ID = "org.eclipse.linuxtools.cdt.autotools.core.autotoolsNatureV2"; //$NON-NLS-1$
|
||||
public final static String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$
|
||||
public static final String BUILDER_ID = ManagedBuilderCorePlugin.getUniqueIdentifier() + ".genmakebuilder"; //$NON-NLS-1$
|
||||
/**
|
||||
* @since 1.3
|
||||
*/
|
||||
public final static String REMOTE_BUILDER_ID = "org.eclipse.ptp.rdt.sync.cdt.core.SyncBuilder"; // $NON-NLS-1$
|
||||
public final static String OLD_AUTOTOOLS_BUILDER_ID = "org.eclipse.linuxtools.cdt.autotools.genmakebuilder"; //$NON-NLS-1$
|
||||
public static final String REMOTE_BUILDER_ID = "org.eclipse.ptp.rdt.sync.cdt.core.SyncBuilder"; // $NON-NLS-1$
|
||||
public static final String OLD_AUTOTOOLS_BUILDER_ID = "org.eclipse.linuxtools.cdt.autotools.genmakebuilder"; //$NON-NLS-1$
|
||||
|
||||
private IProject project;
|
||||
|
||||
|
|
|
@ -5,51 +5,51 @@ package org.eclipse.cdt.autotools.core;
|
|||
*/
|
||||
public class AutotoolsOptionConstants {
|
||||
// IAutotoolOption Names
|
||||
public final static String TOOL_CONFIGURE = "configure"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_GENERAL = "general"; // $NON-NLS-1$
|
||||
public final static String OPT_CONFIGDIR = "configdir"; // $NON-NLS-1$
|
||||
public final static String OPT_CACHE_FILE = "cache-file"; // $NON-NLS-1$
|
||||
public final static String OPT_HELP = "help"; // $NON-NLS-1$
|
||||
public final static String OPT_NO_CREATE = "no-create"; // $NON-NLS-1$
|
||||
public final static String OPT_QUIET = "quiet"; // $NON-NLS-1$
|
||||
public final static String OPT_VERSION = "version"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_PLATFORM = "platform"; // $NON-NLS-1$
|
||||
public final static String OPT_HOST = "host"; // $NON-NLS-1$
|
||||
public final static String OPT_BUILD = "build"; // $NON-NLS-1$
|
||||
public final static String OPT_TARGET = "target"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_DIRECTORIES = "directories"; // $NON-NLS-1$
|
||||
public final static String OPT_PREFIX = "prefix"; // $NON-NLS-1$
|
||||
public final static String OPT_EXEC_PREFIX = "exec-prefix"; // $NON-NLS-1$
|
||||
public final static String OPT_LIBDIR = "libdir"; // $NON-NLS-1$
|
||||
public final static String OPT_BINDIR = "bindir"; // $NON-NLS-1$
|
||||
public final static String OPT_SBINDIR = "sbindir"; // $NON-NLS-1$
|
||||
public final static String OPT_INCLUDEDIR = "includedir"; // $NON-NLS-1$
|
||||
public final static String OPT_DATADIR = "datadir"; // $NON-NLS-1$
|
||||
public final static String OPT_SYSCONFDIR = "sysconfdir"; // $NON-NLS-1$
|
||||
public final static String OPT_INFODIR = "infodir"; // $NON-NLS-1$
|
||||
public final static String OPT_MANDIR = "mandir"; // $NON-NLS-1$
|
||||
public final static String OPT_SRCDIR = "srcdir"; // $NON-NLS-1$
|
||||
public final static String OPT_LOCALSTATEDIR = "localstatedir"; // $NON-NLS-1$
|
||||
public final static String OPT_SHAREDSTATEDIR = "sharedstatedir"; // $NON-NLS-1$
|
||||
public final static String OPT_LIBEXECDIR = "libexecdir"; // $NON-NLS-1$
|
||||
public final static String OPT_OLDINCLUDEDIR = "oldincludedir"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_FILENAMES = "filenames"; // $NON-NLS-1$
|
||||
public final static String OPT_PROGRAM_PREFIX = "program-prefix"; // $NON-NLS-1$
|
||||
public final static String OPT_PROGRAM_SUFFIX = "program-suffix"; // $NON-NLS-1$
|
||||
public final static String OPT_PROGRAM_TRANSFORM_NAME = "program-transform-name"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_FEATURES = "features"; // $NON-NLS-1$
|
||||
public final static String OPT_ENABLE_MAINTAINER_MODE = "enable-maintainer-mode"; // $NON-NLS-1$
|
||||
public final static String FLAG_CFLAGS = "CFLAGS"; // $NON-NLS-1$
|
||||
public static final String TOOL_CONFIGURE = "configure"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_GENERAL = "general"; // $NON-NLS-1$
|
||||
public static final String OPT_CONFIGDIR = "configdir"; // $NON-NLS-1$
|
||||
public static final String OPT_CACHE_FILE = "cache-file"; // $NON-NLS-1$
|
||||
public static final String OPT_HELP = "help"; // $NON-NLS-1$
|
||||
public static final String OPT_NO_CREATE = "no-create"; // $NON-NLS-1$
|
||||
public static final String OPT_QUIET = "quiet"; // $NON-NLS-1$
|
||||
public static final String OPT_VERSION = "version"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_PLATFORM = "platform"; // $NON-NLS-1$
|
||||
public static final String OPT_HOST = "host"; // $NON-NLS-1$
|
||||
public static final String OPT_BUILD = "build"; // $NON-NLS-1$
|
||||
public static final String OPT_TARGET = "target"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_DIRECTORIES = "directories"; // $NON-NLS-1$
|
||||
public static final String OPT_PREFIX = "prefix"; // $NON-NLS-1$
|
||||
public static final String OPT_EXEC_PREFIX = "exec-prefix"; // $NON-NLS-1$
|
||||
public static final String OPT_LIBDIR = "libdir"; // $NON-NLS-1$
|
||||
public static final String OPT_BINDIR = "bindir"; // $NON-NLS-1$
|
||||
public static final String OPT_SBINDIR = "sbindir"; // $NON-NLS-1$
|
||||
public static final String OPT_INCLUDEDIR = "includedir"; // $NON-NLS-1$
|
||||
public static final String OPT_DATADIR = "datadir"; // $NON-NLS-1$
|
||||
public static final String OPT_SYSCONFDIR = "sysconfdir"; // $NON-NLS-1$
|
||||
public static final String OPT_INFODIR = "infodir"; // $NON-NLS-1$
|
||||
public static final String OPT_MANDIR = "mandir"; // $NON-NLS-1$
|
||||
public static final String OPT_SRCDIR = "srcdir"; // $NON-NLS-1$
|
||||
public static final String OPT_LOCALSTATEDIR = "localstatedir"; // $NON-NLS-1$
|
||||
public static final String OPT_SHAREDSTATEDIR = "sharedstatedir"; // $NON-NLS-1$
|
||||
public static final String OPT_LIBEXECDIR = "libexecdir"; // $NON-NLS-1$
|
||||
public static final String OPT_OLDINCLUDEDIR = "oldincludedir"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_FILENAMES = "filenames"; // $NON-NLS-1$
|
||||
public static final String OPT_PROGRAM_PREFIX = "program-prefix"; // $NON-NLS-1$
|
||||
public static final String OPT_PROGRAM_SUFFIX = "program-suffix"; // $NON-NLS-1$
|
||||
public static final String OPT_PROGRAM_TRANSFORM_NAME = "program-transform-name"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_FEATURES = "features"; // $NON-NLS-1$
|
||||
public static final String OPT_ENABLE_MAINTAINER_MODE = "enable-maintainer-mode"; // $NON-NLS-1$
|
||||
public static final String FLAG_CFLAGS = "CFLAGS"; // $NON-NLS-1$
|
||||
/**
|
||||
* @since 1.4
|
||||
*/
|
||||
public final static String FLAG_CFLAGS_FLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$
|
||||
public final static String OPT_CFLAGS_DEBUG = "cflags-debug"; // $NON-NLS-1$
|
||||
public final static String OPT_CFLAGS_GPROF = "cflags-gprof"; // $NON-NLS-1$
|
||||
public final static String OPT_CFLAGS_GCOV = "cflags-gcov"; // $NON-NLS-1$
|
||||
public final static String OPT_USER = "user"; // $NON-NLS-1$
|
||||
public final static String TOOL_AUTOGEN = "autogen"; // $NON-NLS-1$
|
||||
public final static String CATEGORY_OPTIONS = "options"; // $NON-NLS-1$
|
||||
public final static String OPT_AUTOGENOPTS = "autogenOpts"; // $NON-NLS-1$
|
||||
public static final String FLAG_CFLAGS_FLAGS = "CFLAGS|CXXFLAGS"; // $NON-NLS-1$
|
||||
public static final String OPT_CFLAGS_DEBUG = "cflags-debug"; // $NON-NLS-1$
|
||||
public static final String OPT_CFLAGS_GPROF = "cflags-gprof"; // $NON-NLS-1$
|
||||
public static final String OPT_CFLAGS_GCOV = "cflags-gcov"; // $NON-NLS-1$
|
||||
public static final String OPT_USER = "user"; // $NON-NLS-1$
|
||||
public static final String TOOL_AUTOGEN = "autogen"; // $NON-NLS-1$
|
||||
public static final String CATEGORY_OPTIONS = "options"; // $NON-NLS-1$
|
||||
public static final String OPT_AUTOGENOPTS = "autogenOpts"; // $NON-NLS-1$
|
||||
|
||||
}
|
||||
|
|
|
@ -80,14 +80,6 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
|
|||
return getDefault().getBundle().getSymbolicName();
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called upon plug-in activation
|
||||
*/
|
||||
@Override
|
||||
public void start(BundleContext context) throws Exception {
|
||||
super.start(context);
|
||||
}
|
||||
|
||||
/**
|
||||
* This method is called when the plug-in is stopped
|
||||
*/
|
||||
|
@ -182,8 +174,6 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
} catch (CoreException e) {
|
||||
// Don't care...fall through to not found.
|
||||
} catch (Exception f) {
|
||||
// Don't care...fall through to not found.
|
||||
}
|
||||
|
@ -230,12 +220,7 @@ public class AutotoolsPlugin extends AbstractUIPlugin {
|
|||
if (display == null)
|
||||
display = Display.getDefault();
|
||||
final IStatus fstatus = status;
|
||||
display.asyncExec(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
ErrorDialog.openError(null, title, null, fstatus);
|
||||
}
|
||||
});
|
||||
display.asyncExec(() -> ErrorDialog.openError(null, title, null, fstatus));
|
||||
}
|
||||
|
||||
public static void logException(Throwable e) {
|
||||
|
|
|
@ -7,16 +7,20 @@ import org.eclipse.core.runtime.CoreException;
|
|||
* @since 1.2
|
||||
*/
|
||||
public interface IAutotoolsOption {
|
||||
public final static int CATEGORY = 0;
|
||||
public final static int BIN = 1;
|
||||
public final static int STRING = 2;
|
||||
public final static int INTERNAL = 3;
|
||||
public final static int MULTIARG = 4;
|
||||
public final static int TOOL = 5;
|
||||
public final static int FLAG = 6;
|
||||
public final static int FLAGVALUE = 7;
|
||||
public int getType();
|
||||
public boolean canUpdate();
|
||||
public void setValue(String value) throws CoreException;
|
||||
public String getValue();
|
||||
int CATEGORY = 0;
|
||||
int BIN = 1;
|
||||
int STRING = 2;
|
||||
int INTERNAL = 3;
|
||||
int MULTIARG = 4;
|
||||
int TOOL = 5;
|
||||
int FLAG = 6;
|
||||
int FLAGVALUE = 7;
|
||||
|
||||
int getType();
|
||||
|
||||
boolean canUpdate();
|
||||
|
||||
void setValue(String value) throws CoreException;
|
||||
|
||||
String getValue();
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.Arrays;
|
|||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
@ -86,16 +87,16 @@ import org.eclipse.remote.core.exception.RemoteConnectionException;
|
|||
@SuppressWarnings("deprecation")
|
||||
public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
||||
|
||||
public final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
|
||||
public final String MAKEFILE = "Makefile"; //$NON-NLS-1$
|
||||
public final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
|
||||
public final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$
|
||||
public final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
|
||||
public static final String CONFIG_STATUS = "config.status"; //$NON-NLS-1$
|
||||
public static final String MAKEFILE = "Makefile"; //$NON-NLS-1$
|
||||
public static final String MAKEFILE_CVS = "Makefile.cvs"; //$NON-NLS-1$
|
||||
public static final String SETTINGS_FILE_NAME = ".cdtconfigure"; //$NON-NLS-1$
|
||||
public static final String SHELL_COMMAND = "sh"; //$NON-NLS-1$
|
||||
|
||||
public final String AUTOGEN_TOOL_ID = "autogen"; //$NON-NLS-1$
|
||||
public final String CONFIGURE_TOOL_ID = "configure"; //$NON-NLS-1$
|
||||
public static final String AUTOGEN_TOOL_ID = "autogen"; //$NON-NLS-1$
|
||||
public static final String CONFIGURE_TOOL_ID = "configure"; //$NON-NLS-1$
|
||||
|
||||
public final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$
|
||||
public static final String GENERATED_TARGET = AutotoolsPlugin.PLUGIN_ID + ".generated.MakeTarget"; //$NON-NLS-1$
|
||||
|
||||
private static final String MAKE_TARGET_KEY = MakeCorePlugin.getUniqueIdentifier() + ".buildtargets"; //$NON-NLS-1$
|
||||
private static final String BUILD_TARGET_ELEMENT = "buildTargets"; //$NON-NLS-1$
|
||||
|
@ -127,7 +128,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
|
||||
|
||||
public void generateDependencies() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,6 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
* @since 2.0
|
||||
*/
|
||||
public boolean isGeneratedResource() {
|
||||
// TODO Auto-generated method stub
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -186,13 +185,13 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
* @since 2.0
|
||||
*/
|
||||
public void regenerateDependencies() {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Check whether the build has been cancelled. Cancellation
|
||||
* requests propagated to the caller by throwing <code>OperationCanceledException</code>.
|
||||
/**
|
||||
* Check whether the build has been cancelled. Cancellation requests
|
||||
* propagated to the caller by throwing
|
||||
* <code>OperationCanceledException</code>.
|
||||
*
|
||||
* @see org.eclipse.core.runtime.OperationCanceledException#OperationCanceledException()
|
||||
*/
|
||||
|
@ -202,13 +201,13 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc) Return or create the makefile needed for the build. If we
|
||||
* are creating the resource, set the derived bit to true so the CM system
|
||||
* ignores the contents. If the resource exists, respect the existing
|
||||
* derived setting.
|
||||
/**
|
||||
* Return or create the makefile needed for the build. If we are creating
|
||||
* the resource, set the derived bit to true so the CM system ignores the
|
||||
* contents. If the resource exists, respect the existing derived setting.
|
||||
*
|
||||
* @param makefilePath @return IFile
|
||||
* @param makefilePath
|
||||
* @return IFile
|
||||
*/
|
||||
protected IFile createFile(IPath makefilePath) throws CoreException {
|
||||
// Create or get the handle for the makefile
|
||||
|
@ -238,10 +237,11 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
return newFile;
|
||||
}
|
||||
|
||||
/*
|
||||
* Create a directory
|
||||
/**
|
||||
* Create a directory.
|
||||
*
|
||||
* @param boolean @return whether the directory was created
|
||||
* @param boolean
|
||||
* @return whether the directory was created
|
||||
*/
|
||||
private boolean createDirectory(String dirName) throws CoreException {
|
||||
// Create or get the handle for the build directory
|
||||
|
@ -268,9 +268,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
/**
|
||||
* @see org.eclipse.cdt.managedbuilder.makegen.IManagedBuilderMakefileGenerator#getMakefileName()
|
||||
*/
|
||||
public String getMakefileName() {
|
||||
|
@ -331,7 +329,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
private Status regenerateMakefiles(IConfiguration icfg, boolean reconfigure) throws CoreException {
|
||||
MultiStatus status;
|
||||
int rc = IStatus.OK;
|
||||
String errMsg = new String();
|
||||
String errMsg = "";
|
||||
boolean needFullConfigure = false;
|
||||
|
||||
// See if the user has cancelled the build
|
||||
|
@ -489,12 +487,12 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
}
|
||||
}
|
||||
|
||||
ArrayList<String> configureEnvs = new ArrayList<>();
|
||||
ArrayList<String> configureCmdParms = new ArrayList<>();
|
||||
List<String> configureEnvs = new ArrayList<>();
|
||||
List<String> configureCmdParms = new ArrayList<>();
|
||||
IPath configurePath = getConfigurePath(configureEnvs, configureCmdParms);
|
||||
String[] configArgs = getConfigArgs(configureCmdParms);
|
||||
ArrayList<String> autogenEnvs = new ArrayList<>();
|
||||
ArrayList<String> autogenCmdParms = new ArrayList<>();
|
||||
List<String> autogenEnvs = new ArrayList<>();
|
||||
List<String> autogenCmdParms = new ArrayList<>();
|
||||
IPath autogenPath = getAutogenPath(autogenEnvs, autogenCmdParms);
|
||||
|
||||
// Check if we have a config.status (meaning configure has already run).
|
||||
|
@ -638,7 +636,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
rc = IStatus.ERROR;
|
||||
errMsg = AutotoolsPlugin.getResourceString("MakeGenerator.didnt.generate"); //$NON-NLS-1$
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
// forgetLastBuiltState();
|
||||
rc = IStatus.ERROR;
|
||||
|
@ -665,7 +663,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
* @param envVars - ArrayList to add environment variables to
|
||||
* @return stripped command
|
||||
*/
|
||||
public static String stripEnvVars(String command, ArrayList<String> envVars) {
|
||||
public static String stripEnvVars(String command, List<String> envVars) {
|
||||
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s+)\\w+.*");
|
||||
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s+)\\w+.*");
|
||||
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+\\s+)\\w+.*");
|
||||
|
@ -727,7 +725,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
* @param envVars - ArrayList to add environment variables to
|
||||
* @return stripped option
|
||||
*/
|
||||
public static String stripEnvVarsFromOption(String str, ArrayList<String> envVars) {
|
||||
public static String stripEnvVarsFromOption(String str, List<String> envVars) {
|
||||
Pattern p1 = Pattern.compile("(\\w+[=]\\\".*?\\\"\\s*).*");
|
||||
Pattern p2 = Pattern.compile("(\\w+[=]'.*?'\\s*).*");
|
||||
Pattern p3 = Pattern.compile("(\\w+[=][^\\s]+).*");
|
||||
|
@ -780,7 +778,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
return sourcePath;
|
||||
}
|
||||
|
||||
protected IPath getConfigurePath(ArrayList<String> envVars, ArrayList<String> cmdParms) {
|
||||
protected IPath getConfigurePath(List<String> envVars, List<String> cmdParms) {
|
||||
IPath configPath;
|
||||
IConfigureOption configOption = toolsCfg.getOption(CONFIGURE_TOOL_ID);
|
||||
String command = "configure"; // $NON-NLS-1$
|
||||
|
@ -812,7 +810,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
return makefileCVSPath.toFile().exists();
|
||||
}
|
||||
|
||||
protected IPath getAutogenPath(ArrayList<String> envVars, ArrayList<String> cmdParms) {
|
||||
protected IPath getAutogenPath(List<String> envVars, List<String> cmdParms) {
|
||||
IPath autogenPath;
|
||||
IConfigureOption autogenOption = toolsCfg.getOption(AUTOGEN_TOOL_ID);
|
||||
String command = "autogen.sh"; // $NON-NLS-1$
|
||||
|
@ -830,16 +828,16 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
return autogenPath;
|
||||
}
|
||||
|
||||
private String[] getAutogenArgs(ArrayList<String> cmdParms) {
|
||||
private String[] getAutogenArgs(List<String> cmdParms) {
|
||||
// Get the arguments to be passed to config from build model
|
||||
ArrayList<String> autogenArgs = toolsCfg.getToolArgs(AUTOGEN_TOOL_ID);
|
||||
List<String> autogenArgs = toolsCfg.getToolArgs(AUTOGEN_TOOL_ID);
|
||||
cmdParms.addAll(autogenArgs);
|
||||
return cmdParms.toArray(new String[cmdParms.size()]);
|
||||
}
|
||||
|
||||
private String[] getConfigArgs(ArrayList<String> cmdParms) {
|
||||
private String[] getConfigArgs(List<String> cmdParms) {
|
||||
// Get the arguments to be passed to config from build model
|
||||
ArrayList<String> configArgs = toolsCfg.getToolArgs(CONFIGURE_TOOL_ID);
|
||||
List<String> configArgs = toolsCfg.getToolArgs(CONFIGURE_TOOL_ID);
|
||||
cmdParms.addAll(configArgs);
|
||||
return cmdParms.toArray(new String[cmdParms.size()]);
|
||||
}
|
||||
|
@ -1117,7 +1115,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
|
||||
// Run an autotools script (e.g. configure, autogen.sh, config.status).
|
||||
private int runScript(IPath commandPath, IPath runPath, String[] args, String jobDescription, String errMsg,
|
||||
IConsole console, ArrayList<String> additionalEnvs, boolean consoleStart)
|
||||
IConsole console, List<String> additionalEnvs, boolean consoleStart)
|
||||
throws CoreException, NullPointerException, IOException {
|
||||
|
||||
int rc = IStatus.OK;
|
||||
|
@ -1514,7 +1512,7 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
|
||||
IMakeTarget[] makeTargetArray = new IMakeTarget[makeTargets.size()];
|
||||
Collection<IMakeTarget> values = makeTargets.values();
|
||||
ArrayList<IMakeTarget> valueList = new ArrayList<>(values);
|
||||
List<IMakeTarget> valueList = new ArrayList<>(values);
|
||||
valueList.toArray(makeTargetArray);
|
||||
MakeTargetComparator compareMakeTargets = new MakeTargetComparator();
|
||||
Arrays.sort(makeTargetArray, compareMakeTargets);
|
||||
|
@ -1530,13 +1528,8 @@ public class AutotoolsNewMakeGenerator extends MarkerGenerator {
|
|||
Method m = c.getMethod("setTargets", IContainer.class, IMakeTarget[].class);
|
||||
m.invoke(makeTargetManager, project, makeTargetArray);
|
||||
targetsAdded = true;
|
||||
} catch (NoSuchMethodException e) {
|
||||
// ignore and use fail-safe saveTargets method
|
||||
} catch (IllegalArgumentException e) {
|
||||
// ignore and use fail-safe saveTargets method
|
||||
} catch (IllegalAccessException e) {
|
||||
// ignore and use fail-safe saveTargets method
|
||||
} catch (InvocationTargetException e) {
|
||||
} catch (NoSuchMethodException | IllegalArgumentException | IllegalAccessException
|
||||
| InvocationTargetException e) {
|
||||
// ignore and use fail-safe saveTargets method
|
||||
}
|
||||
if (!targetsAdded)
|
||||
|
|
|
@ -213,7 +213,7 @@ public class ErrorParser extends MarkerGenerator implements IErrorParser {
|
|||
return Integer.parseInt(m.group(1));
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
} catch (IOException e) {
|
||||
return -1;
|
||||
} finally {
|
||||
if (reader != null) {
|
||||
|
|
|
@ -19,13 +19,12 @@ import java.io.OutputStream;
|
|||
import java.net.URI;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsPlugin;
|
||||
import org.eclipse.cdt.core.IErrorParser;
|
||||
import org.eclipse.cdt.core.IErrorParser2;
|
||||
import org.eclipse.cdt.core.IMarkerGenerator;
|
||||
import org.eclipse.cdt.core.ProblemMarkerInfo;
|
||||
import org.eclipse.cdt.internal.core.IErrorMarkeredOutputStream;
|
||||
import org.eclipse.cdt.utils.EFSExtensionManager;
|
||||
|
@ -54,7 +53,7 @@ public class ErrorParserManager extends OutputStream {
|
|||
* Delimiter for error parsers presented in one string.
|
||||
* @since 5.2
|
||||
*/
|
||||
public final static char ERROR_PARSER_DELIMITER = ';';
|
||||
public static final char ERROR_PARSER_DELIMITER = ';';
|
||||
|
||||
private int nOpens;
|
||||
private int lineCounter=0;
|
||||
|
@ -63,7 +62,7 @@ public class ErrorParserManager extends OutputStream {
|
|||
private final MarkerGenerator fMarkerGenerator;
|
||||
|
||||
private Map<String, ErrorParser> fErrorParsers;
|
||||
private ArrayList<ProblemMarkerInfo> fErrors;
|
||||
private List<ProblemMarkerInfo> fErrors;
|
||||
|
||||
private Vector<URI> fDirectoryStack;
|
||||
private final URI fBaseDirectoryURI;
|
||||
|
@ -247,8 +246,10 @@ public class ErrorParserManager extends OutputStream {
|
|||
* supports error markers, use it, otherwise use conventional stream
|
||||
*/
|
||||
private void outputLine(String line, ProblemMarkerInfo marker) {
|
||||
String l = line + "\n"; //$NON-NLS-1$
|
||||
if ( outputStream == null ) return;
|
||||
String l = line + '\n';
|
||||
if (outputStream == null) {
|
||||
return;
|
||||
}
|
||||
try {
|
||||
if (marker != null) {
|
||||
if (outputStream instanceof IErrorMarkeredOutputStream) {
|
||||
|
@ -322,7 +323,7 @@ public class ErrorParserManager extends OutputStream {
|
|||
* @return the previous line, save in the working buffer.
|
||||
*/
|
||||
public String getPreviousLine() {
|
||||
return new String((previousLine) == null ? "" : previousLine); //$NON-NLS-1$
|
||||
return previousLine == null ? "" : previousLine; //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -33,7 +33,6 @@ public abstract class MarkerGenerator {
|
|||
* Constructor for MarkerGenerator
|
||||
*/
|
||||
public MarkerGenerator() {
|
||||
super();
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -157,14 +156,16 @@ public abstract class MarkerGenerator {
|
|||
return IMarker.SEVERITY_ERROR;
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
/**
|
||||
* Removes the IMarkers for the project specified in the argument if the
|
||||
* project exists, and is open.
|
||||
* project exists, and is open.
|
||||
*
|
||||
* @param project
|
||||
*/
|
||||
public void removeAllMarkers(IProject project) {
|
||||
if (project == null || !project.isAccessible()) return;
|
||||
if (project == null || !project.isAccessible()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Clear out the problem markers
|
||||
IWorkspace workspace = project.getWorkspace();
|
||||
|
|
|
@ -27,7 +27,7 @@ import org.eclipse.ui.IMarkerResolution;
|
|||
|
||||
public class PkgconfigErrorResolution implements IMarkerResolution {
|
||||
|
||||
private class ConsoleOutputStream extends OutputStream {
|
||||
private static class ConsoleOutputStream extends OutputStream {
|
||||
|
||||
protected StringBuffer fBuffer;
|
||||
|
||||
|
@ -54,7 +54,7 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
|||
}
|
||||
}
|
||||
|
||||
private final static String PKG_UPDATE_MSG = "UpdatePackage.msg"; //$NON-NLS-1$
|
||||
private static final String PKG_UPDATE_MSG = "UpdatePackage.msg"; //$NON-NLS-1$
|
||||
private String pkgName;
|
||||
|
||||
public PkgconfigErrorResolution(String pkgconfigRequirement) {
|
||||
|
@ -68,7 +68,6 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
|||
|
||||
@Override
|
||||
public String getLabel() {
|
||||
// TODO Auto-generated method stub
|
||||
return AutotoolsPlugin.getFormattedString(PKG_UPDATE_MSG, new String[] {pkgName});
|
||||
}
|
||||
|
||||
|
@ -118,9 +117,8 @@ public class PkgconfigErrorResolution implements IMarkerResolution {
|
|||
}
|
||||
|
||||
} catch (CoreException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
} //$NON-NLS-1$
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
package org.eclipse.cdt.internal.autotools.core.configure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class AbstractConfigurationOption implements IConfigureOption {
|
||||
|
||||
|
@ -52,8 +53,8 @@ public abstract class AbstractConfigurationOption implements IConfigureOption {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getParameters() {
|
||||
ArrayList<String> parameters = new ArrayList<>();
|
||||
public List<String> getParameters() {
|
||||
List<String> parameters = new ArrayList<>();
|
||||
if (isParmSet())
|
||||
parameters.add(getParameter());
|
||||
return parameters;
|
||||
|
|
|
@ -14,6 +14,7 @@ import java.util.ArrayList;
|
|||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.AutotoolsOptionConstants;
|
||||
|
@ -306,7 +307,7 @@ public class AutotoolsConfiguration implements IAConfiguration {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getToolArgs(String name) {
|
||||
public List<String> getToolArgs(String name) {
|
||||
if (isParmsDirty) {
|
||||
configParms = new ArrayList<>();
|
||||
Option[] options = getChildOptions(name);
|
||||
|
@ -316,11 +317,11 @@ public class AutotoolsConfiguration implements IAConfiguration {
|
|||
Option[] childOptions = getChildOptions(option.getName());
|
||||
for (int j = 0; j < childOptions.length; ++j) {
|
||||
IConfigureOption childOption = getOption(childOptions[j].getName());
|
||||
ArrayList<String> parameters = childOption.getParameters();
|
||||
List<String> parameters = childOption.getParameters();
|
||||
configParms.addAll(parameters);
|
||||
}
|
||||
} else {
|
||||
ArrayList<String> parameters = option.getParameters();
|
||||
List<String> parameters = option.getParameters();
|
||||
configParms.addAll(parameters);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,10 +15,10 @@ import java.io.File;
|
|||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
|
@ -62,8 +62,8 @@ import org.xml.sax.SAXException;
|
|||
|
||||
public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
||||
|
||||
public final static String CFG_FILE_NAME = ".autotools"; //$NON-NLS-1$
|
||||
private final static String CFG_CANT_SAVE = "Configure.Error.NoProjectToSave"; //$NON-NLS-1$
|
||||
public static final String CFG_FILE_NAME = ".autotools"; //$NON-NLS-1$
|
||||
private static final String CFG_CANT_SAVE = "Configure.Error.NoProjectToSave"; //$NON-NLS-1$
|
||||
|
||||
/**
|
||||
* @since 1.2
|
||||
|
@ -383,49 +383,53 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
if (!f.exists())
|
||||
f.createNewFile();
|
||||
if (f.exists()) {
|
||||
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)));
|
||||
Map<String, IAConfiguration> cfgs = configs.get(projectName);
|
||||
p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
|
||||
p.println("<configurations>"); // $NON-NLS-1$
|
||||
Option[] optionList = AutotoolsConfiguration.getOptionList();
|
||||
// Before saving, force any cloning to occur via the option value handler.
|
||||
setSyncing(true);
|
||||
for (int i = 0; i < cfgds.length; ++i) {
|
||||
@SuppressWarnings("unused")
|
||||
CConfigurationData data = cfgds[i].getConfigurationData();
|
||||
}
|
||||
setSyncing(false);
|
||||
for (int i = 0; i < cfgds.length; ++i) {
|
||||
ICConfigurationDescription cfgd = cfgds[i];
|
||||
String id = cfgd.getId();
|
||||
IAConfiguration cfg = cfgs.get(id);
|
||||
if (cfg == null) {
|
||||
cfg = createDefaultConfiguration(project, id);
|
||||
try (PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
|
||||
Map<String, IAConfiguration> cfgs = configs.get(projectName);
|
||||
p.println("<?xml version=\"1.0\" encoding=\"UTF-8\"?>"); //$NON-NLS-1$
|
||||
p.println("<configurations>"); // $NON-NLS-1$
|
||||
Option[] optionList = AutotoolsConfiguration.getOptionList();
|
||||
// Before saving, force any cloning to occur via the option
|
||||
// value handler.
|
||||
setSyncing(true);
|
||||
for (int i = 0; i < cfgds.length; ++i) {
|
||||
@SuppressWarnings("unused")
|
||||
CConfigurationData data = cfgds[i].getConfigurationData();
|
||||
}
|
||||
p.println("<configuration id=\"" + cfg.getId() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
for (int j = 0; j < optionList.length; ++j) {
|
||||
Option option = optionList[j];
|
||||
IConfigureOption opt = cfg.getOption(option.getName());
|
||||
if (opt.isFlag()) {
|
||||
p.println("<flag id=\"" + option.getName() + "\" value=\"" + xmlEscape(option.getDefaultValue()) + "\">"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
|
||||
FlagConfigureOption fco = (FlagConfigureOption)opt;
|
||||
ArrayList<String> children = fco.getChildren();
|
||||
for (int k = 0; k < children.size(); ++k) {
|
||||
String childName = children.get(k);
|
||||
IConfigureOption childopt = cfg.getOption(childName);
|
||||
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" + xmlEscape(childopt.getValue()) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$
|
||||
}
|
||||
p.println("</flag>"); //$NON-NLS-1$
|
||||
setSyncing(false);
|
||||
for (int i = 0; i < cfgds.length; ++i) {
|
||||
ICConfigurationDescription cfgd = cfgds[i];
|
||||
String id = cfgd.getId();
|
||||
IAConfiguration cfg = cfgs.get(id);
|
||||
if (cfg == null) {
|
||||
cfg = createDefaultConfiguration(project, id);
|
||||
}
|
||||
else if (!opt.isCategory() && !opt.isFlagValue())
|
||||
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) + "\"/>"); //$NON-NLS-1$ //$NON-NLS-2$ // $NON-NLS-3$
|
||||
p.println("<configuration id=\"" + cfg.getId() + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
for (int j = 0; j < optionList.length; ++j) {
|
||||
Option option = optionList[j];
|
||||
IConfigureOption opt = cfg.getOption(option.getName());
|
||||
if (opt.isFlag()) {
|
||||
p.println("<flag id=\"" + option.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ xmlEscape(option.getDefaultValue()) + "\">"); //$NON-NLS-1$
|
||||
FlagConfigureOption fco = (FlagConfigureOption) opt;
|
||||
List<String> children = fco.getChildren();
|
||||
for (int k = 0; k < children.size(); ++k) {
|
||||
String childName = children.get(k);
|
||||
IConfigureOption childopt = cfg.getOption(childName);
|
||||
p.println("<flagvalue id=\"" + childopt.getName() + "\" value=\"" //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ xmlEscape(childopt.getValue()) + "\"/>"); // $NON-NLS-3$
|
||||
}
|
||||
p.println("</flag>"); //$NON-NLS-1$
|
||||
} else if (!opt.isCategory() && !opt.isFlagValue())
|
||||
p.println("<option id=\"" + option.getName() + "\" value=\"" + xmlEscape(opt.getValue()) //$NON-NLS-1$ //$NON-NLS-2$
|
||||
+ "\"/>"); // $NON-NLS-3$
|
||||
}
|
||||
p.println("</configuration>"); //$NON-NLS-1$
|
||||
// Sync name field as this configuration is now
|
||||
// officially saved
|
||||
syncNameField(cfgd);
|
||||
}
|
||||
p.println("</configuration>"); //$NON-NLS-1$
|
||||
// Sync name field as this configuration is now officially saved
|
||||
syncNameField(cfgd);
|
||||
p.println("</configurations>");
|
||||
}
|
||||
p.println("</configurations>");
|
||||
p.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
AutotoolsPlugin.log(e);
|
||||
|
@ -451,8 +455,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
if (!f.exists())
|
||||
f.createNewFile();
|
||||
if (f.exists()) {
|
||||
PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)));
|
||||
try {
|
||||
try (PrintWriter p = new PrintWriter(new BufferedWriter(new FileWriter(f)))) {
|
||||
Map<String, IAConfiguration> cfgs = getSavedConfigs(project);
|
||||
if (cfgs == null)
|
||||
return;
|
||||
|
@ -483,11 +486,11 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
|
||||
// Put all the remaining configurations already saved back into the file.
|
||||
// These represent deleted configurations, but confirmation has not occurred.
|
||||
for (Iterator<String> i = cfgs.keySet().iterator(); i.hasNext(); ) {
|
||||
String id = i.next();
|
||||
for (Entry<String, IAConfiguration> i : cfgs.entrySet()) {
|
||||
String id = i.getKey();
|
||||
// A remaining id won't appear in our savedIds list.
|
||||
if (!savedIds.contains(id)) {
|
||||
IAConfiguration cfg = cfgs.get(id);
|
||||
IAConfiguration cfg = i.getValue();
|
||||
p.println("<configuration id=\"" + id + "\">"); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
for (int j = 0; j < optionList.length; ++j) {
|
||||
Option option = optionList[j];
|
||||
|
@ -499,8 +502,6 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
}
|
||||
}
|
||||
p.println("</configurations>");
|
||||
} finally {
|
||||
p.close();
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
|
@ -547,7 +548,7 @@ public class AutotoolsConfigurationManager implements IResourceChangeListener {
|
|||
}
|
||||
}
|
||||
|
||||
private class AutotoolsOption implements IAutotoolsOption {
|
||||
private static class AutotoolsOption implements IAutotoolsOption {
|
||||
|
||||
private IConfigureOption option;
|
||||
private final static String UNMODIFIABLE_CONFIG_OPTION = "CfgOptions.Unmodifiable.Option"; //$NON-NLS-1$
|
||||
|
|
|
@ -28,13 +28,13 @@ import org.eclipse.core.runtime.CoreException;
|
|||
public class AutotoolsOptionValueHandler extends ManagedOptionValueHandler
|
||||
implements IOptionApplicability {
|
||||
|
||||
public final static String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$
|
||||
public final static String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"; //$NON-NLS-1$
|
||||
public final static String BUILD_DIR_OPTION_ID = "org.eclipse.linuxtools.cdt.autotools.core.option.configure.builddir"; //$NON-NLS-1$
|
||||
public final static String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$
|
||||
public final static String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$
|
||||
public final static String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$
|
||||
public final static String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
|
||||
public static final String DEFAULT_BUILD_DIR = "build"; //$NON-NLS-1$
|
||||
public static final String CONFIGURE_TOOL_ID = "org.eclipse.linuxtools.cdt.autotools.core.gnu.toolchain.tool.configure"; //$NON-NLS-1$
|
||||
public static final String BUILD_DIR_OPTION_ID = "org.eclipse.linuxtools.cdt.autotools.core.option.configure.builddir"; //$NON-NLS-1$
|
||||
public static final String BUILD_DIR_APPLY = "BuildDir.apply"; //$NON-NLS-1$
|
||||
public static final String BUILD_DIR_DEFAULT_QUESTION = "BuildDir.default"; //$NON-NLS-1$
|
||||
public static final String BUILD_DIR_YES = "BuildDir.yes"; //$NON-NLS-1$
|
||||
public static final String BUILD_DIR_NO = "BuildDir.no"; //$NON-NLS-1$
|
||||
|
||||
//FIXME: Use holder to set option value, not the "option" parameter
|
||||
@Override
|
||||
|
|
|
@ -12,12 +12,12 @@
|
|||
package org.eclipse.cdt.internal.autotools.core.configure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FlagConfigureOption extends AbstractConfigurationOption {
|
||||
|
||||
private String value;
|
||||
private ArrayList<String> children =
|
||||
new ArrayList<>();
|
||||
private ArrayList<String> children = new ArrayList<>();
|
||||
|
||||
public FlagConfigureOption(String name, AutotoolsConfiguration cfg) {
|
||||
super(name, cfg);
|
||||
|
@ -30,11 +30,10 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
|
|||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private FlagConfigureOption(String name, AutotoolsConfiguration cfg,
|
||||
String value, ArrayList<String> children) {
|
||||
private FlagConfigureOption(String name, AutotoolsConfiguration cfg, String value, ArrayList<String> children) {
|
||||
super(name, cfg);
|
||||
this.value = value;
|
||||
this.children = (ArrayList<String>)children.clone();
|
||||
this.children = (ArrayList<String>) children.clone();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -93,8 +92,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
|
|||
|
||||
@Override
|
||||
public IConfigureOption copy(AutotoolsConfiguration config) {
|
||||
FlagConfigureOption f = new FlagConfigureOption(name, config, value, children);
|
||||
return f;
|
||||
return new FlagConfigureOption(name, config, value, children);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -116,7 +114,7 @@ public class FlagConfigureOption extends AbstractConfigurationOption {
|
|||
children.add(name);
|
||||
}
|
||||
|
||||
public ArrayList<String> getChildren() {
|
||||
public List<String> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.autotools.core.configure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface IAConfiguration {
|
||||
|
@ -26,7 +26,7 @@ public interface IAConfiguration {
|
|||
|
||||
String getToolParameters(String name);
|
||||
|
||||
ArrayList<String> getToolArgs(String name);
|
||||
List<String> getToolArgs(String name);
|
||||
|
||||
void setOption(String name, String value);
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.autotools.core.configure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.cdt.autotools.core.IAutotoolsOption;
|
||||
|
||||
|
@ -29,7 +29,7 @@ public interface IConfigureOption {
|
|||
|
||||
String getParameter();
|
||||
|
||||
ArrayList<String> getParameters();
|
||||
List<String> getParameters();
|
||||
|
||||
boolean isParmSet();
|
||||
|
||||
|
|
|
@ -11,12 +11,13 @@
|
|||
package org.eclipse.cdt.internal.autotools.core.configure;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class MultiArgConfigureOption extends AbstractConfigurationOption {
|
||||
|
||||
private String value;
|
||||
private ArrayList<String> userArgs;
|
||||
private List<String> userArgs;
|
||||
private boolean isDirty;
|
||||
|
||||
public MultiArgConfigureOption(String name, AutotoolsConfiguration cfg) {
|
||||
|
@ -65,7 +66,7 @@ public class MultiArgConfigureOption extends AbstractConfigurationOption {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> getParameters() {
|
||||
public List<String> getParameters() {
|
||||
// May be multiple user-specified options in which case we
|
||||
// need to split them up into individual options
|
||||
if (!isDirty && userArgs != null)
|
||||
|
|
Loading…
Add table
Reference in a new issue