Add exception and log mechanism

1. Add :
   a. GenBuildLogger.java in Tools/Source/GenBuild/org/tianocore/build/gobal.
   b.Tools/Source/Common/build.xml
2. modify:
   a.edksetup.bat
   b.Tools/build.xml
   c.Tools/Source/GenBuild/build.xml
   d. Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@574 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
qouyang
2006-06-20 11:57:17 +00:00
parent c082c8cffe
commit b9546cc80d
6 changed files with 94 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<property name="WORKSPACE" value="${env.WORKSPACE}"/>
<path id="classpath">
<fileset dir="${WORKSPACE}/Tools/Jars" includes="SurfaceArea.jar"/>
<fileset dir="${WORKSPACE}/Tools/Jars" includes="Common.jar"/>
<fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
</path>
<property name="buildDir" value="build"/>

View File

@@ -50,10 +50,12 @@ import org.w3c.dom.Node;
import org.tianocore.build.autogen.AutoGen;
import org.tianocore.build.autogen.CommonDefinition;
import org.tianocore.build.fpd.FpdParserTask;
import org.tianocore.build.global.GenBuildLogger;
import org.tianocore.build.global.GlobalData;
import org.tianocore.build.global.OutputManager;
import org.tianocore.build.global.SurfaceAreaQuery;
import org.tianocore.build.toolchain.ToolChainFactory;
import org.tianocore.logger.EdkLog;
import org.tianocore.FilenameDocument;
import org.tianocore.MsaHeaderDocument;
import org.tianocore.MsaLibHeaderDocument;
@@ -200,6 +202,13 @@ public class GenBuildTask extends Task {
**/
public void execute() throws BuildException {
System.out.println("Module [" + baseName + "] start.");
//
// Inital GenBuild log method
//
GenBuildLogger logger = new GenBuildLogger(getProject());
EdkLog.setLogger(logger);
EdkLog.setLogLevel(1);
OutputManager.update(getProject());
GlobalData.initInfo("Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db",
getProject().getProperty("WORKSPACE_DIR"));

View File

@@ -0,0 +1,36 @@
/*++
Copyright (c) 2006, Intel Corporation
All rights reserved. This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
http://opensource.org/licenses/bsd-license.php
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
Module Name:
GenBuildLogger.java
Abstract:
--*/
package org.tianocore.build.global;
import org.apache.tools.ant.Project;
import org.tianocore.logger.LogMethod;
public class GenBuildLogger implements LogMethod {
private Project project;
public GenBuildLogger(Project project) {
this.project = project;
}
public void putMessage(Object msgSource, int msgLevel, String msg) {
if (this.project != null){
this.project.log(msg, Project.MSG_INFO);
}
}
}