]> git.proxmox.com Git - mirror_edk2.git/blame - Tools/Source/GenBuild/org/tianocore/build/toolchain/ToolChainTask.java
Change to new XML Schema.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / toolchain / ToolChainTask.java
CommitLineData
878ddf1f 1/** @file\r
2 ToolChainTask class.\r
3 \r
4 ToolChainTask class's main fucntion is read all tool chain related config files. \r
5\r
6Copyright (c) 2006, Intel Corporation \r
7All rights reserved. This program and the accompanying materials \r
8are licensed and made available under the terms and conditions of the BSD License \r
9which accompanies this distribution. The full text of the license may be found at \r
10http://opensource.org/licenses/bsd-license.php \r
11\r
12THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
13WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
14\r
15**/\r
16package org.tianocore.build.toolchain;\r
17\r
18import org.apache.tools.ant.BuildException;\r
19import org.apache.tools.ant.Task;\r
20\r
21/**\r
22 This class is an ANT task. The main function is to read all tool chain related\r
23 config files. \r
24 \r
25 @since GenBuild 1.0\r
26**/\r
27public class ToolChainTask extends Task{\r
28\r
29 private String confPath = ".";\r
30 \r
31 /**\r
32 Public construct method. It is necessary for ANT task.\r
33 **/\r
34 public ToolChainTask(){\r
35 }\r
36 \r
37 /**\r
38 ANT task's entry point, will be called after init(). Using\r
39 <code>ToolChainFactory</code> to parse all config files, and\r
40 set TARGET property. \r
41 \r
42 @throws BuildException\r
43 Config files are invalid.\r
44 **/\r
45 public void execute() throws BuildException {\r
46 String toolChain = getProject().getProperty("env.TOOL_CHAIN");\r
47 ToolChainFactory toolchain = new ToolChainFactory(confPath, toolChain);\r
48 toolchain.setupToolChain();\r
49 getProject().setProperty("TARGET", toolchain.getCurrentTarget());\r
50 }\r
51\r
52 /**\r
53 Set the path of config files.\r
54 \r
55 @param confPath the path of config files\r
56 **/\r
57 public void setConfPath(String confPath) {\r
58 this.confPath = confPath;\r
59 }\r
60}\r