com.android.sdklib.internal.project
Class ProjectPropertiesWorkingCopy
java.lang.Object
com.android.sdklib.internal.project.ProjectProperties
com.android.sdklib.internal.project.ProjectPropertiesWorkingCopy
- All Implemented Interfaces:
- IPropertySource
public class ProjectPropertiesWorkingCopy
- extends ProjectProperties
A modifiable and savable copy of a ProjectProperties.
This copy gives access to modification method such as setProperty(String, String)
and removeProperty(String).
To get access to an instance, use ProjectProperties.makeWorkingCopy() or
ProjectProperties.create(IAbstractFolder, PropertyType).
| Fields inherited from class com.android.sdklib.internal.project.ProjectProperties |
mProjectFolder, mProperties, mType, PATTERN_PROP, PROPERTY_BUILD_OUT_DIR, PROPERTY_BUILD_SOURCE_DIR, PROPERTY_BUILD_TOOLS, PROPERTY_KEY_ALIAS, PROPERTY_KEY_STORE, PROPERTY_LIB_REF, PROPERTY_LIBRARY, PROPERTY_PACKAGE, PROPERTY_PROGUARD_CONFIG, PROPERTY_PROJECTS, PROPERTY_RS_TARGET, PROPERTY_RULES_PATH, PROPERTY_SDK, PROPERTY_SPLIT_BY_ABI, PROPERTY_SPLIT_BY_DENSITY, PROPERTY_SPLIT_BY_LOCALE, PROPERTY_TARGET, PROPERTY_TESTED_PROJECT, PROPERTY_VERSIONCODE |
| Methods inherited from class com.android.sdklib.internal.project.ProjectProperties |
create, create, createEmpty, createEmpty, debugPrint, delete, delete, escape, getFile, getProperty, getType, keySet, load, load, makeWorkingCopy, makeWorkingCopy, parsePropertyFile, reload |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
setProperty
public void setProperty(java.lang.String name,
java.lang.String value)
- Sets a new properties. If a property with the same name already exists, it is replaced.
- Parameters:
name - the name of the property.value - the value of the property.
removeProperty
public java.lang.String removeProperty(java.lang.String name)
- Removes a property and returns its previous value (or null if the property did not exist).
- Parameters:
name - the name of the property to remove.
merge
public ProjectPropertiesWorkingCopy merge(ProjectProperties.PropertyType type)
- Merges all properties from the given file into the current properties.
This emulates the Ant behavior: existing properties are not overridden.
Only new undefined properties become defined.
Typical usage:
- Create a ProjectProperties with
PropertyType#ANT
- Merge in values using
PropertyType#PROJECT
- The result is that this contains all the properties from default plus those
overridden by the build.properties file.
- Parameters:
type - One the possible ProjectProperties.PropertyTypes.
- Returns:
- this object, for chaining.
save
public void save()
throws java.io.IOException,
com.android.io.StreamException
- Saves the property file, using UTF-8 encoding.
- Throws:
java.io.IOException
com.android.io.StreamException
makeReadOnlyCopy
@NonNull
public ProjectProperties makeReadOnlyCopy()