mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-06 09:16:02 +02:00
Bug 321040 - Getting Library search paths from Tool's Option
This commit is contained in:
parent
a733900f52
commit
8b954e69cb
3 changed files with 49 additions and 6 deletions
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2003, 2010 IBM Corporation and others.
|
* Copyright (c) 2003, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -9,6 +9,7 @@
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
* ARM Ltd. - basic tooltip support
|
* ARM Ltd. - basic tooltip support
|
||||||
* James Blackburn (Broadcom Corp.)
|
* James Blackburn (Broadcom Corp.)
|
||||||
|
* Petri Tuononen - [321040] Get Library Search Paths
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.core;
|
package org.eclipse.cdt.managedbuilder.core;
|
||||||
|
|
||||||
|
@ -342,6 +343,15 @@ public interface IOption extends IBuildObject {
|
||||||
*/
|
*/
|
||||||
public String[] getLibraryFiles() throws BuildException;
|
public String[] getLibraryFiles() throws BuildException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return an array or <code>String</code>s containing the library paths
|
||||||
|
* passed to the linker.
|
||||||
|
*
|
||||||
|
* @throws BuildException if the option isn't of type IOption#LIBRARY_PATHS
|
||||||
|
* @since 8.0
|
||||||
|
*/
|
||||||
|
public String[] getLibraryPaths() throws BuildException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a <code>String</code> containing the unique ID of the selected
|
* @return a <code>String</code> containing the unique ID of the selected
|
||||||
* enumeration in an enumerated option. For an option that has not been
|
* enumeration in an enumerated option. For an option that has not been
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2003, 2010 IBM Corporation and others.
|
* Copyright (c) 2003, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
* ARM Ltd. - basic tooltip support
|
* ARM Ltd. - basic tooltip support
|
||||||
|
* Petri Tuononen - [321040] Get Library Search Paths
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||||
|
|
||||||
|
@ -1387,7 +1388,6 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryFiles()
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryFiles()
|
||||||
*/
|
*/
|
||||||
|
@ -1405,6 +1405,23 @@ public class Option extends BuildObject implements IOption, IBuildPropertiesRest
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryPaths()
|
||||||
|
*/
|
||||||
|
public String[] getLibraryPaths() throws BuildException {
|
||||||
|
if (getValueType() != LIBRARY_PATHS) {
|
||||||
|
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
||||||
|
}
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
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)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefaultEnumValue()
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getDefaultEnumValue()
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2003, 2010 IBM Corporation and others.
|
* Copyright (c) 2003, 2011 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,6 +8,7 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* IBM - Initial API and implementation
|
* IBM - Initial API and implementation
|
||||||
* ARM Ltd. - basic tooltip support
|
* ARM Ltd. - basic tooltip support
|
||||||
|
* Petri Tuononen - [321040] Get Library Search Paths
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.managedbuilder.internal.core;
|
package org.eclipse.cdt.managedbuilder.internal.core;
|
||||||
|
|
||||||
|
@ -455,6 +456,21 @@ public class OptionReference implements IOption {
|
||||||
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
throw new BuildException(ManagedMakeMessages.getResourceString("Option.error.bad_value_type")); //$NON-NLS-1$
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* (non-Javadoc)
|
||||||
|
* @see org.eclipse.cdt.managedbuilder.core.IOption#getLibraryPaths()
|
||||||
|
*/
|
||||||
|
public String[] getLibraryPaths() throws BuildException {
|
||||||
|
if (value == null)
|
||||||
|
return option.getLibraryPaths();
|
||||||
|
else if (getValueType() == LIBRARY_PATHS) {
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
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)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
|
* @see org.eclipse.cdt.core.build.managed.IBuildObject#getName()
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Add table
Reference in a new issue