252 if (source == null) {
253 helper.error("err.invalid.source", operand);
254 return true;
255 }
256 return super.process(helper, option, operand);
257 }
258 },
259
260 TARGET("-target", "opt.arg.release", "opt.target", STANDARD, BASIC) {
261 @Override
262 public boolean process(OptionHelper helper, String option, String operand) {
263 Target target = Target.lookup(operand);
264 if (target == null) {
265 helper.error("err.invalid.target", operand);
266 return true;
267 }
268 return super.process(helper, option, operand);
269 }
270 },
271
272 PLATFORM("-platform", "opt.arg.platform", "opt.platform", STANDARD, BASIC) {
273 @Override
274 void help(Log log, OptionKind kind) {
275 if (this.kind != kind)
276 return;
277
278 Iterable<PlatformProviderFactory> factories =
279 ServiceLoader.load(PlatformProviderFactory.class, Arguments.class.getClassLoader());
280 Set<String> platforms = new TreeSet<>();
281
282 for (PlatformProviderFactory factory : factories) {
283 for (PlatformProvider platform : factory.createPlatformProviders()) {
284 platforms.add(platform.getName());
285 }
286 }
287
288 StringBuilder targets = new StringBuilder();
289 String delim = "";
290 for (String platform : platforms) {
291 targets.append(delim);
292 targets.append(platform);
|
252 if (source == null) {
253 helper.error("err.invalid.source", operand);
254 return true;
255 }
256 return super.process(helper, option, operand);
257 }
258 },
259
260 TARGET("-target", "opt.arg.release", "opt.target", STANDARD, BASIC) {
261 @Override
262 public boolean process(OptionHelper helper, String option, String operand) {
263 Target target = Target.lookup(operand);
264 if (target == null) {
265 helper.error("err.invalid.target", operand);
266 return true;
267 }
268 return super.process(helper, option, operand);
269 }
270 },
271
272 RELEASE("-release", "opt.arg.release", "opt.release", STANDARD, BASIC) {
273 @Override
274 void help(Log log, OptionKind kind) {
275 if (this.kind != kind)
276 return;
277
278 Iterable<PlatformProviderFactory> factories =
279 ServiceLoader.load(PlatformProviderFactory.class, Arguments.class.getClassLoader());
280 Set<String> platforms = new TreeSet<>();
281
282 for (PlatformProviderFactory factory : factories) {
283 for (PlatformProvider platform : factory.createPlatformProviders()) {
284 platforms.add(platform.getName());
285 }
286 }
287
288 StringBuilder targets = new StringBuilder();
289 String delim = "";
290 for (String platform : platforms) {
291 targets.append(delim);
292 targets.append(platform);
|