]>
Commit | Line | Data |
---|---|---|
878ddf1f | 1 | /** @file\r |
2 | BuildAction class.\r | |
3 | \r | |
4 | BuildAction is the parent class for all action related to ant Task. This class will\r | |
5 | define some common utility functionality, such as logMsg, warningMsg..etc.\r | |
6 | \r | |
7 | Copyright (c) 2006, Intel Corporation\r | |
8 | All rights reserved. This program and the accompanying materials\r | |
9 | are licensed and made available under the terms and conditions of the BSD License\r | |
10 | which accompanies this distribution. The full text of the license may be found at\r | |
11 | http://opensource.org/licenses/bsd-license.php\r | |
12 | \r | |
13 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
14 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
15 | \r | |
16 | **/\r | |
d14ebb43 | 17 | package org.tianocore.pcd.action;\r |
878ddf1f | 18 | \r |
19 | import org.apache.tools.ant.Task;\r | |
3d52de13 | 20 | import org.apache.tools.ant.Project;\r |
d14ebb43 | 21 | import org.tianocore.pcd.exception.BuildActionException;\r |
878ddf1f | 22 | \r |
23 | /** BuildAction is the parent class for all action related to ant Task. This class will\r | |
24 | define some common utility functionality, such as logMsg, warningMsg..etc.\r | |
25 | **/\r | |
d14ebb43 | 26 | public abstract class BuildAction extends Task {\r |
878ddf1f | 27 | ///\r |
28 | /// Original message level before this action. This value will \r | |
29 | /// be restored when quit this action.\r | |
30 | ///\r | |
31 | private int originalMessageLevel;\r | |
32 | \r | |
33 | /**\r | |
34 | checkParameter function check all parameter valid.\r | |
35 | \r | |
36 | This function will be overrided by child class.\r | |
37 | **/\r | |
d14ebb43 | 38 | public abstract void checkParameter() throws BuildActionException;\r |
878ddf1f | 39 | \r |
40 | /**\r | |
41 | performAction is to execute the detail action.\r | |
42 | \r | |
43 | This function will be overrided by child class.\r | |
44 | **/\r | |
d14ebb43 | 45 | public abstract void performAction() throws BuildActionException;\r |
878ddf1f | 46 | \r |
878ddf1f | 47 | /**\r |
48 | execute function is the main flow for all build action class.\r | |
49 | \r | |
50 | This workflow will be:\r | |
51 | 1) Check paramet of this action.\r | |
52 | 2) Perform the child class action function.\r | |
53 | 3) Restore the message level.\r | |
54 | \r | |
55 | @throws BuildActionException\r | |
56 | **/ \r | |
57 | public void execute() throws BuildActionException {\r | |
58 | checkParameter();\r | |
59 | performAction();\r | |
878ddf1f | 60 | }\r |
61 | }\r |