Sun, 03 Sep 2023 12:24:39 +0200
fix several unquoted variable uses
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
1 | /* |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
2 | * To change this license header, choose License Headers in Project Properties. |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
3 | * To change this template file, choose Tools | Templates |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
4 | * and open the template in the editor. |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
5 | */ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
6 | package de.unixwork.uwproj; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
7 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
8 | import java.io.File; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
9 | import java.io.FileInputStream; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
10 | import java.io.FileNotFoundException; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
11 | import java.io.IOException; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
12 | import java.util.HashMap; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
13 | import java.util.LinkedList; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
14 | import java.util.List; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
15 | import java.util.Map; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
16 | import java.util.Properties; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
17 | import javax.xml.parsers.DocumentBuilder; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
18 | import javax.xml.parsers.DocumentBuilderFactory; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
19 | import javax.xml.parsers.ParserConfigurationException; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
20 | import org.w3c.dom.Document; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
21 | import org.w3c.dom.Element; |
7
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
22 | import org.w3c.dom.Node; |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
23 | import org.w3c.dom.NodeList; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
24 | import org.xml.sax.SAXException; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
25 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
26 | /** |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
27 | * |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
28 | * @author olaf |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
29 | */ |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
30 | public class Project { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
31 | private String path; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
32 | private Properties properties = new Properties(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
33 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
34 | private HashMap<String,List<Dependency>> namedDependencies = new HashMap<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
35 | private List<Dependency> dependencies = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
36 | private List<Target> targets = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
37 | private List<Option> options = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
38 | private List<Feature> features = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
39 | |
7
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
40 | private HashMap<String,ConfigVar> configVars = new HashMap<>(); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
41 | private List<ConfigVar> configVarsList = new LinkedList<>(); |
8
82cd9f1d94cb
add c++ compiler detection
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
7
diff
changeset
|
42 | |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
43 | public Project(File file) throws ParserConfigurationException, SAXException, IOException, Exception { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
44 | DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
45 | factory.setNamespaceAware(true); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
46 | DocumentBuilder builder = factory.newDocumentBuilder(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
47 | Document doc = builder.parse(file); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
48 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
49 | Element root = doc.getDocumentElement(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
50 | NodeList dependency_nodes = root.getElementsByTagName("dependency"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
51 | NodeList target_nodes = root.getElementsByTagName("target"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
52 | NodeList property_nodes = root.getElementsByTagName("property"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
53 | |
7
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
54 | NodeList config_nodes = root.getElementsByTagName("config"); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
55 | for(int i=0;i<config_nodes.getLength();i++) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
56 | Element p = (Element)config_nodes.item(i); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
57 | NodeList cfgs = p.getChildNodes(); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
58 | for(int c=0;c<cfgs.getLength();c++) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
59 | Node node = cfgs.item(c); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
60 | if (node.getNodeType() == Node.ELEMENT_NODE) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
61 | if(node.getNodeName().equals("var")) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
62 | ConfigVar var = ConfigVar.parse((Element)node); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
63 | if(var != null) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
64 | configVarsList.add(var); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
65 | configVars.put(var.getName(), var); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
66 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
67 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
68 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
69 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
70 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
71 | |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
72 | for(int i=0;i<dependency_nodes.getLength();i++) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
73 | addDependency(Dependency.parse((Element)dependency_nodes.item(i))); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
74 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
75 | for(int i=0;i<target_nodes.getLength();i++) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
76 | targets.add(Target.parse(this, (Element)target_nodes.item(i))); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
77 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
78 | for(int i=0;i<property_nodes.getLength();i++) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
79 | Element p = (Element)property_nodes.item(i); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
80 | String name = p.getAttribute("name"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
81 | String value = p.getAttribute("value"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
82 | if(name != null && value != null) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
83 | properties.setProperty(name, value); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
84 | } else { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
85 | throw new Exception("Missing property name or value"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
86 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
87 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
88 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
89 | if(targets.size() == 0) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
90 | createDefaultTarget(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
91 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
92 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
93 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
94 | private void createDefaultTarget() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
95 | Target t = new Target(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
96 | t.setAllDependencies(true); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
97 | t.setName("default"); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
98 | addTarget(t); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
99 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
100 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
101 | public String getPath() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
102 | return path; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
103 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
104 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
105 | public void setPath(String path) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
106 | this.path = path; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
107 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
108 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
109 | public List<NamedDependency> getNamedDependencies() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
110 | List<NamedDependency> ret = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
111 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
112 | for(Map.Entry<String,List<Dependency>> entry : namedDependencies.entrySet()) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
113 | NamedDependency d = new NamedDependency(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
114 | d.setName(entry.getKey()); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
115 | d.setSubdependencies(entry.getValue()); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
116 | ret.add(d); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
117 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
118 | return ret; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
119 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
120 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
121 | public List<Dependency> getDependencies() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
122 | return dependencies; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
123 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
124 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
125 | public List<Target> getTargets() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
126 | return targets; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
127 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
128 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
129 | public void addDependency(Dependency dependency) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
130 | if(dependency.getName() != null) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
131 | List<Dependency> l = namedDependencies.get(dependency.getName()); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
132 | if(l == null) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
133 | l = new LinkedList<>(); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
134 | namedDependencies.put(dependency.getName(), l); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
135 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
136 | dependency.setNum(l.size()); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
137 | l.add(dependency); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
138 | } else { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
139 | dependencies.add(dependency); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
140 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
141 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
142 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
143 | public void addTarget(Target target) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
144 | targets.add(target); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
145 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
146 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
147 | public void addOption(Option o) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
148 | options.add(o); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
149 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
150 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
151 | public List<Option> getOptions() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
152 | return options; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
153 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
154 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
155 | public void addFeature(Feature feature) { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
156 | features.add(feature); |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
157 | } |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
158 | |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
159 | public List<Feature> getFeatures() { |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
160 | return features; |
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
161 | } |
7
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
162 | |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
163 | public List<ConfigVar> getVars() { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
164 | return configVarsList; |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
165 | } |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
166 | |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
167 | public boolean hasVar(String varName) { |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
168 | return configVars.containsKey(varName); |
686991ae6e2f
add configureable make variables
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
0
diff
changeset
|
169 | } |
0
38775db5fdf5
add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff
changeset
|
170 | } |