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