01: /*
02: * Copyright 2005 Paul Hinds
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.tp23.antinstaller.antmod.taskdefs;
17:
18: import org.apache.tools.ant.BuildException;
19: import org.apache.tools.ant.Task;
20: import org.tp23.antinstaller.InstallerContext;
21: import org.tp23.antinstaller.antmod.RuntimeLauncher;
22:
23: /**
24: * usage:
25: * <antinstaller-message message="output"/>
26: * @author teknopaul
27: *
28: */
29: public class MessageTask extends Task {
30:
31: private String message;
32:
33: /**
34: * Ant Tasks must have a noargs constructor
35: */
36: public MessageTask() {
37: }
38:
39: /**
40: * the "main" method
41: */
42: public void execute() throws BuildException {
43: InstallerContext ctx = (InstallerContext) getProject()
44: .getReference(RuntimeLauncher.CONTEXT_REFERENCE);
45: ctx.getMessageRenderer().printMessage(message);
46:
47: }
48:
49: public String getMessage() {
50: return message;
51: }
52:
53: public void setMessage(String message) {
54: this.message = message;
55: }
56:
57: }
|