001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.util.ant;
016    
017    import java.io.File;
018    
019    import org.apache.tools.ant.Project;
020    import org.apache.tools.ant.taskdefs.War;
021    
022    /**
023     * @author Brian Wing Shun Chan
024     */
025    public class WarTask {
026    
027            public static void war(
028                    File baseDir, File destination, String excludes, File webxml) {
029    
030                    Project project = AntUtil.getProject();
031    
032                    War war = new War();
033    
034                    war.setProject(project);
035                    war.setBasedir(baseDir);
036                    war.setDestFile(destination);
037                    war.setExcludes(excludes);
038                    war.setWebxml(webxml);
039    
040                    war.execute();
041            }
042    
043            public static void war(
044                    String baseDir, String destination, String excludes, String webxml) {
045    
046                    war(
047                            new File(baseDir), new File(destination), excludes,
048                            new File(webxml));
049            }
050    
051    }