package org.headsupdev.agile.app.ci.builders;

import org.headsupdev.agile.api.*;

/**
 * A factory for BuildHandlers available to manage building of various types of project
 * <p/>
 * Created: 29/09/2012
 *
 * @author Andrew Williams
 * @since 2.2
 */
public class BuildHandlerFactory
{
    public boolean supportsBuilding( Project project )
    {
        return project instanceof MavenTwoProject || project instanceof AntProject ||
                project instanceof EclipseProject || project instanceof XCodeProject ||
                project instanceof CommandLineProject;
    }

    public BuildHandler getBuildHandler( Project project )
    {
        if ( project instanceof MavenTwoProject)
        {
            return new MavenTwoBuildHandler();
        }
        else if ( project instanceof AntProject)
        {
            return new AntBuildHandler();
        }
        else if ( project instanceof EclipseProject)
        {
            return new EclipseBuildHandler();
        }
        else if ( project instanceof XCodeProject)
        {
            return new XCodeBuildHandler();
        }
        else if ( project instanceof CommandLineProject )
        {
            return new CommandLineBuildHandler();
        }

        return null;
    }
}

@@ -1,8 +1,747 @@
+/*%0A * HeadsUp Agile%0A * Copyright 2012 Heads Up Development Ltd.%0A *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0A
 package 

add missing copyright