1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20 package com.github.maven_nar.cpptasks;
21
22 import org.apache.tools.ant.types.DataType;
23 import org.apache.tools.ant.types.Reference;
24
25
26
27
28
29
30 public final class TargetDef extends DataType {
31
32
33
34 private String ifCond;
35
36
37
38
39 private String unlessCond;
40
41
42
43
44
45 private CPUEnum cpu;
46
47
48
49
50
51 private ArchEnum arch;
52
53
54
55
56
57 private OSFamilyEnum osFamily;
58
59
60
61
62
63 public TargetDef() {
64 }
65
66
67
68
69 public void execute() {
70 throw new org.apache.tools.ant.BuildException("Not an actual task, but looks like one for documentation purposes");
71 }
72
73
74
75
76
77
78
79 public ArchEnum getArch() {
80 if (isReference()) {
81 final TargetDef refPlatform = (TargetDef) getCheckedRef(TargetDef.class, "TargetDef");
82 return refPlatform.getArch();
83 }
84 return this.arch;
85 }
86
87
88
89
90
91
92
93 public CPUEnum getCpu() {
94 if (isReference()) {
95 final TargetDef refPlatform = (TargetDef) getCheckedRef(TargetDef.class, "TargetDef");
96 return refPlatform.getCpu();
97 }
98 return this.cpu;
99 }
100
101
102
103
104
105
106
107 public OSFamilyEnum getOsfamily() {
108 if (isReference()) {
109 final TargetDef refPlatform = (TargetDef) getCheckedRef(TargetDef.class, "TargetDef");
110 return refPlatform.getOsfamily();
111 }
112 return this.osFamily;
113 }
114
115
116
117
118
119
120
121 public boolean isActive() {
122 return CUtil.isActive(getProject(), this.ifCond, this.unlessCond);
123 }
124
125
126
127
128
129
130
131 public void setArch(final ArchEnum value) {
132 if (isReference()) {
133 throw tooManyAttributes();
134 }
135 if (this.cpu != null) {
136 throw tooManyAttributes();
137 }
138 this.arch = value;
139 }
140
141
142
143
144
145
146
147 public void setCpu(final CPUEnum value) {
148 if (isReference()) {
149 throw tooManyAttributes();
150 }
151 this.cpu = value;
152 }
153
154
155
156
157
158
159
160 @Override
161 public void setDescription(final String desc) {
162 super.setDescription(desc);
163 }
164
165
166
167
168
169
170
171 public void setId(final String id) {
172
173
174
175
176 }
177
178
179
180
181
182
183
184
185
186
187
188
189
190 public void setIf(final String propName) {
191 this.ifCond = propName;
192 }
193
194
195
196
197
198
199
200 public void setOsfamily(final OSFamilyEnum value) {
201 if (isReference()) {
202 throw tooManyAttributes();
203 }
204 if (this.cpu != null) {
205 throw tooManyAttributes();
206 }
207 this.osFamily = value;
208 }
209
210
211
212
213
214
215
216
217
218 @Override
219 public void setRefid(final Reference r) {
220 super.setRefid(r);
221 }
222
223
224
225
226
227
228
229
230
231
232
233
234
235 public void setUnless(final String propName) {
236 this.unlessCond = propName;
237 }
238
239 }