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