buildframework/helium/sf/java/imaker/src/com/nokia/helium/imaker/ant/types/ConfigurationSet.java
/*
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of the License "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/
package com.nokia.helium.imaker.ant.types;
import java.util.ArrayList;
import java.util.List;
import java.util.Vector;
import org.apache.tools.ant.types.DataType;
import com.nokia.helium.imaker.IMaker;
import com.nokia.helium.imaker.ant.Command;
import com.nokia.helium.imaker.ant.IMakerCommandSet;
/**
* Set of iMaker configuration.
*
* <pre>
* <hlm:imakerconfigurationset>
* <imakerconfiguration regionalVariation="true">
* <makefileset>
* <include name="**/product/*ui.mk"/>
* </makefileset>
* <targetset>
* <include name="^core$" />
* <include name="langpack_\d+" />
* <include name="^custvariant_.*$" />
* <include name="^udaerase$" />
* </targetset>
* <variableset>
* <variable name="USE_FOTI" value="0"/>
* <variable name="USE_FOTA" value="1"/>
* </variableset>
* <variablegroup>
* <variable name="TYPE" value="rnd"/>
* <variable name="USE_FOTI" value="0"/>
* <variable name="USE_FOTA" value="1"/>
* </variablegroup>
* <variablegroup>
* <variable name="TYPE" value="subcon"/>
* <variable name="USE_FOTI" value="0"/>
* <variable name="USE_FOTA" value="1"/>
* </variablegroup>
* </imakerconfiguration>
* </hlm:imakerconfigurationset>
* </pre>
* @ant.type name="imakerconfigurationset" category="imaker"
*/
public class ConfigurationSet extends DataType implements IMakerCommandSet {
private Vector<Configuration> configurations = new Vector<Configuration>();
/**
* This method create an iMaker Configuration element.
*/
public Configuration createImakerConfiguration() {
Configuration config = new Configuration();
configurations.add(config);
return config;
}
/**
* Get the list of iMaker configuration.
*/
public Vector<Configuration> getImakerConfiguration() {
return configurations;
}
@Override
public List<List<Command>> getCommands(IMaker imaker) {
List<List<Command>> cmdset = new ArrayList<List<Command>>();
for (Configuration config : configurations) {
if (config.isReference()) {
config = (Configuration) config.getRefid().getReferencedObject();
}
cmdset.addAll(config.getCommands(imaker));
}
return cmdset;
}
}