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-log message="log message"/>
26: * @author teknopaul
27: *
28: */
29: public class LogTask extends Task {
30:
31: private String message;
32:
33: /**
34: * Ant Tasks must have a noargs constructor
35: */
36: public LogTask() {
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.log(message);
46: }
47:
48: public String getMessage() {
49: return message;
50: }
51:
52: public void setMessage(String message) {
53: this.message = message;
54: }
55:
56: }
|