KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > pde > internal > build > tasks > UnzipperGeneratorTask


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM - Initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.pde.internal.build.tasks;
12
13 import org.apache.tools.ant.BuildException;
14 import org.eclipse.ant.core.Task;
15 import org.eclipse.core.runtime.CoreException;
16 import org.eclipse.pde.internal.build.AbstractScriptGenerator;
17 import org.eclipse.pde.internal.build.BundleHelper;
18 import org.eclipse.pde.internal.build.packager.UnzipperGenerator;
19
20 /**
21  * Internal Task.
22  * This task generates an unzipper script that unzip a files.
23  * @since 3.0
24  */

25 public class UnzipperGeneratorTask extends Task {
26     private UnzipperGenerator generator = new UnzipperGenerator();
27
28     public void execute() throws BuildException {
29         try {
30             BundleHelper.getDefault().setLog(this);
31             generator.generate();
32             BundleHelper.getDefault().setLog(null);
33         } catch (CoreException e) {
34             throw new BuildException(TaskHelper.statusToString(e.getStatus(), null).toString());
35         }
36     }
37
38     /**
39      * Set the name of the file listing all the files that must be unzipped.
40      * @param filename
41      */

42     public void setZipsDirectory(String JavaDoc filename) {
43         generator.setDirectoryLocation(filename);
44     }
45
46     /**
47      * Set the folder in which the scripts will be generated.
48      * @param installLocation the location where the scripts will be generated and the files fetched.
49      */

50     public void setWorkingDirectory(String JavaDoc installLocation) {
51         generator.setWorkingDirectory(installLocation);
52     }
53
54     /**
55      * Set the configuration for which the script should be generated. The default is set to be configuration independent.
56      * @param configInfo an ampersand separated list of configuration (for example win32, win32, x86 & macoxs, carbon, ppc).
57      * @throws BuildException
58      */

59     public void setConfigInfo(String JavaDoc configInfo) throws BuildException {
60         try {
61             AbstractScriptGenerator.setConfigInfo(configInfo);
62         } catch (CoreException e) {
63             throw new BuildException(e);
64         }
65     }
66
67     /**
68      * Set the property file containing information about packaging
69      * @param propertyFile the path to a property file
70      */

71     public void setPackagePropertyFile(String JavaDoc propertyFile) {
72         generator.setPropertyFile(propertyFile);
73     }
74 }
75
Popular Tags