001package ball.riddler538.ant.taskdefs;
002/*-
003 * ##########################################################################
004 * Solutions for the 538 Riddler
005 * $Id: AbstractTask.html 5431 2020-02-12 19:03:17Z ball $
006 * $HeadURL: svn+ssh://svn.hcf.dev/var/spool/scm/repository.svn/hcf-dev/blog/2019-07-08-fivethirtyeight-best-scrabble-string/src/main/resources/javadoc/src-html/ball/riddler538/ant/taskdefs/AbstractTask.html $
007 * %%
008 * Copyright (C) 2015 - 2020 Allen D. Ball
009 * %%
010 * Licensed under the Apache License, Version 2.0 (the "License");
011 * you may not use this file except in compliance with the License.
012 * You may obtain a copy of the License at
013 *
014 *      http://www.apache.org/licenses/LICENSE-2.0
015 *
016 * Unless required by applicable law or agreed to in writing, software
017 * distributed under the License is distributed on an "AS IS" BASIS,
018 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
019 * See the License for the specific language governing permissions and
020 * limitations under the License.
021 * ##########################################################################
022 */
023import ball.util.ant.taskdefs.AnnotatedAntTask;
024import ball.util.ant.taskdefs.ClasspathDelegateAntTask;
025import ball.util.ant.taskdefs.ConfigurableAntTask;
026import lombok.Getter;
027import lombok.NoArgsConstructor;
028import lombok.Setter;
029import lombok.experimental.Accessors;
030import org.apache.tools.ant.BuildException;
031import org.apache.tools.ant.Task;
032import org.apache.tools.ant.util.ClasspathUtils;
033
034import static lombok.AccessLevel.PROTECTED;
035
036/**
037 * Abstract {@link.uri http://ant.apache.org/ Ant} {@link Task} for
038 * solutions.
039 *
040 * {@ant.task}
041 *
042 * @author {@link.uri mailto:ball@hcf.dev Allen D. Ball}
043 * @version $Revision: 5431 $
044 */
045@NoArgsConstructor(access = PROTECTED)
046public abstract class AbstractTask extends Task
047                                   implements AnnotatedAntTask,
048                                              ClasspathDelegateAntTask,
049                                              ConfigurableAntTask {
050    @Getter @Setter @Accessors(chain = true, fluent = true)
051    private ClasspathUtils.Delegate delegate = null;
052
053    @Override
054    public void init() throws BuildException {
055        super.init();
056        ClasspathDelegateAntTask.super.init();
057        ConfigurableAntTask.super.init();
058    }
059
060    @Override
061    public void execute() throws BuildException {
062        super.execute();
063        AnnotatedAntTask.super.execute();
064    }
065}