mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-24 01:15:29 +02:00
bug 288489: [API] [cdt.managedbuild.core] Add getLibraryFiles method to IOption interface
Patch from Emilio U. Giuffrida
This commit is contained in:
parent
1fc47b91e1
commit
b91139e868
3 changed files with 40 additions and 0 deletions
|
@ -344,6 +344,15 @@ public interface IOption extends IBuildObject {
|
|||
*/
|
||||
public String[] getLibraries() throws BuildException ;
|
||||
|
||||
/**
|
||||
* @return an array or <code>String</code>s containing the library files
|
||||
* that must be linked into the project.
|
||||
*
|
||||
* @throws BuildException
|
||||
* @since 7.0
|
||||
*/
|
||||
public String[] getLibraryFiles() throws BuildException ;
|
||||
|
||||
/**
|
||||
* Answers a <code>String</code> containing the unique ID of the selected
|
||||
* enumeration in an enumerated option. For an option that has not been
|
||||
|
|
|
@ -1337,6 +1337,23 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryFiles()
|
||||
*/
|
||||
public String[] getLibraryFiles() throws BuildException {
|
||||
if (getValueType() != LIBRARY_FILES) {
|
||||
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
||||
}
|
||||
ArrayList<String> v = (ArrayList<String>)getValue();
|
||||
if (v == null) {
|
||||
return EMPTY_STRING_ARRAY;
|
||||
} else {
|
||||
v.trimToSize();
|
||||
return v.toArray(new String[v.size()]);
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefaultEnumValue()
|
||||
*/
|
||||
|
|
|
@ -440,6 +440,20 @@ public class OptionReference implements IOption {
|
|||
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IOption#getLibraryFiles()
|
||||
*/
|
||||
public String[] getLibraryFiles() throws BuildException {
|
||||
if (value == null)
|
||||
return option.getLibraryFiles();
|
||||
else if (getValueType() == LIBRARY_FILES) {
|
||||
ArrayList<String> list = (ArrayList<String>)value;
|
||||
return list.toArray(new String[list.size()]);
|
||||
}
|
||||
else
|
||||
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue