18 private final List<Option> options = new LinkedList<>(); |
18 private final List<Option> options = new LinkedList<>(); |
19 private final List<Feature> features = new LinkedList<>(); |
19 private final List<Feature> features = new LinkedList<>(); |
20 |
20 |
21 private final HashMap<String, ConfigVar> configVars = new HashMap<>(); |
21 private final HashMap<String, ConfigVar> configVars = new HashMap<>(); |
22 private final List<ConfigVar> configVarsList = new LinkedList<>(); |
22 private final List<ConfigVar> configVarsList = new LinkedList<>(); |
|
23 |
|
24 private final List<String> langList = new LinkedList<>(); |
23 |
25 |
24 public Project(File file) throws Exception { |
26 public Project(File file) throws Exception { |
25 var root = DocumentBuilderFactory. |
27 var root = DocumentBuilderFactory. |
26 newDefaultNSInstance(). |
28 newDefaultNSInstance(). |
27 newDocumentBuilder(). |
29 newDocumentBuilder(). |
53 targets.add(Target.parse(this, (Element) target_nodes.item(i))); |
55 targets.add(Target.parse(this, (Element) target_nodes.item(i))); |
54 } |
56 } |
55 |
57 |
56 if (targets.isEmpty()) { |
58 if (targets.isEmpty()) { |
57 createDefaultTarget(); |
59 createDefaultTarget(); |
|
60 } |
|
61 |
|
62 // create a list of all languages that are used |
|
63 for (Dependency d : dependencies) { |
|
64 for (String lang : d.getLang()) { |
|
65 if(!langList.contains(lang)) { |
|
66 langList.add(lang); |
|
67 } |
|
68 } |
|
69 } |
|
70 for (var nd : namedDependencies.entrySet()) { |
|
71 for (var d : nd.getValue()) { |
|
72 for (String lang : d.getLang()) { |
|
73 if(!langList.contains(lang)) { |
|
74 langList.add(lang); |
|
75 } |
|
76 } |
|
77 } |
58 } |
78 } |
59 } |
79 } |
60 |
80 |
61 private void createDefaultTarget() { |
81 private void createDefaultTarget() { |
62 var t = new Target(); |
82 var t = new Target(); |