587
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
package com.nokia.helium.sbs.ant.types;
|
|
19 |
|
628
|
20 |
import java.util.ArrayList;
|
587
|
21 |
import java.util.List;
|
628
|
22 |
import java.util.Vector;
|
|
23 |
|
|
24 |
import org.apache.tools.ant.BuildException;
|
|
25 |
import org.apache.tools.ant.types.DataType;
|
587
|
26 |
import org.apache.tools.ant.types.Reference;
|
|
27 |
|
|
28 |
|
|
29 |
/**
|
|
30 |
* This class provides user the option to store the one to one
|
|
31 |
* mapping with raptor configuration. This is mainly there for backward
|
|
32 |
* compatibility with schema 1.4.0 and would be deprecated in the future
|
|
33 |
* when migrated to schema 3.0.0
|
|
34 |
*
|
|
35 |
* <pre>
|
|
36 |
* sbsbuild takes only sbsinput reference id. Each reference id contains
|
|
37 |
* list of raptor commands matching corresponding abld commands for a
|
|
38 |
* particular configuration in the system definition file schema 1.4.0.
|
|
39 |
*
|
|
40 |
* Example 1:
|
|
41 |
*
|
|
42 |
* <sbsbuild id="sbs.dfs_build_ncp">
|
|
43 |
* <sbsinput refid="dfs_build_ncp_input"/>
|
|
44 |
* </sbsbuild>
|
|
45 |
* </pre>
|
|
46 |
|
|
47 |
* @ant.type name="arg" category="SBS"
|
|
48 |
* @ant.type name="makeOption" category="SBS"
|
|
49 |
*/
|
|
50 |
public class SBSBuild extends DataType
|
|
51 |
{
|
|
52 |
private String name;
|
|
53 |
|
|
54 |
private Vector<SBSInput> sbsInputList = new Vector<SBSInput>();
|
|
55 |
|
|
56 |
/**
|
|
57 |
* Set the name of the variable.
|
|
58 |
* @param name
|
|
59 |
*/
|
|
60 |
public void setName(String nm) {
|
|
61 |
name = nm;
|
|
62 |
}
|
|
63 |
|
|
64 |
/**
|
|
65 |
* Gets the name of the build input.
|
|
66 |
* @param name
|
|
67 |
*/
|
|
68 |
public String getName() {
|
|
69 |
return name;
|
|
70 |
}
|
|
71 |
|
|
72 |
/**
|
|
73 |
* Creates an empty variable element and adds
|
|
74 |
* it to the variables list
|
|
75 |
* @return empty Variable pair
|
|
76 |
*/
|
|
77 |
public SBSInput createSBSInput() {
|
|
78 |
SBSInput input = new SBSInput();
|
|
79 |
sbsInputList.add(input);
|
|
80 |
return input;
|
|
81 |
}
|
|
82 |
|
|
83 |
/**
|
|
84 |
* Gets the list of sbs input list for this build configuration.
|
|
85 |
* it to the variables list
|
|
86 |
* @return empty Variable pair
|
|
87 |
*/
|
|
88 |
public List<SBSInput> getSBSInputList() {
|
|
89 |
List<SBSInput> inputList = new ArrayList<SBSInput>();
|
|
90 |
Reference refId = getRefid();
|
|
91 |
Object sbsInputObject = null;
|
|
92 |
if (refId != null) {
|
|
93 |
try {
|
|
94 |
sbsInputObject = refId.getReferencedObject();
|
|
95 |
} catch ( BuildException ex) {
|
|
96 |
throw new BuildException("Reference id (" + refId.getRefId() + ") of sbsinput list is not valid");
|
|
97 |
}
|
|
98 |
if (sbsInputObject != null && sbsInputObject instanceof SBSInput) {
|
|
99 |
inputList.add((SBSInput)sbsInputObject);
|
|
100 |
}
|
|
101 |
}
|
|
102 |
inputList.addAll(sbsInputList);
|
|
103 |
return inputList;
|
|
104 |
}
|
|
105 |
}
|