[19253] | 1 | /*
|
---|
| 2 | * Copyright 2005 Paul Hinds
|
---|
| 3 | *
|
---|
| 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
---|
| 5 | * you may not use this file except in compliance with the License.
|
---|
| 6 | * You may obtain a copy of the License at
|
---|
| 7 | *
|
---|
| 8 | * http://www.apache.org/licenses/LICENSE-2.0
|
---|
| 9 | *
|
---|
| 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 | * usage:
|
---|
| 24 | * <antinstaller-message message="output"/>
|
---|
| 25 | * @author teknopaul
|
---|
| 26 | *
|
---|
| 27 | */
|
---|
| 28 | public class MessageTask extends Task {
|
---|
| 29 |
|
---|
| 30 | private String message;
|
---|
| 31 | /**
|
---|
| 32 | * Ant Tasks must have a noargs constructor
|
---|
| 33 | */
|
---|
| 34 | public MessageTask(){
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | /**
|
---|
| 38 | * the "main" method
|
---|
| 39 | */
|
---|
| 40 | public void execute() throws BuildException {
|
---|
| 41 | InstallerContext ctx = (InstallerContext)getProject().getReference(RuntimeLauncher.CONTEXT_REFERENCE);
|
---|
| 42 | ctx.getMessageRenderer().printMessage(message);
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public String getMessage() {
|
---|
| 46 | return message;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public void setMessage(String message) {
|
---|
| 50 | this.message = message;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 |
|
---|
| 54 | }
|
---|