summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-20 11:57:17 +0000
committerqouyang <qouyang@6f19259b-4bc3-4df7-8a09-765794883524>2006-06-20 11:57:17 +0000
commitb9546cc80d2ebe1a4754d98c35c5b7b15f94556d (patch)
treec82942ded396cc709fd9ded600f67b21731e9b28
parentc082c8cffe418d9e4b3e89f322fe0ff0365cedfa (diff)
downloadedk2-b9546cc80d2ebe1a4754d98c35c5b7b15f94556d.tar.gz
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
-rw-r--r--Tools/Source/Common/build.xml45
-rw-r--r--Tools/Source/GenBuild/build.xml1
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java9
-rw-r--r--Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java36
-rw-r--r--Tools/build.xml1
-rw-r--r--edksetup.bat2
6 files changed, 94 insertions, 0 deletions
diff --git a/Tools/Source/Common/build.xml b/Tools/Source/Common/build.xml
new file mode 100644
index 000000000..ad517cd86
--- /dev/null
+++ b/Tools/Source/Common/build.xml
@@ -0,0 +1,45 @@
+<?xml version="1.0"?>
+<!--
+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.
+-->
+<project name="Common" default="all" basedir=".">
+
+ <taskdef resource="net/sf/antcontrib/antlib.xml"/>
+ <property environment="env"/>
+ <property name="WORKSPACE" value="${env.WORKSPACE}"/>
+ <property name="buildDir" value="build"/>
+ <property name="installLocation" value="${WORKSPACE}/Tools/Jars"/>
+ <target name="all" depends="install"/>
+ <target name="source">
+ <mkdir dir="${buildDir}"/>
+ <javac srcdir="." destdir="${buildDir}">
+ <compilerarg value="-Xlint"/>
+ </javac>
+ </target>
+ <target name="clean">
+ <delete dir="${buildDir}"/>
+ </target>
+ <target name="cleanall">
+ <delete dir="${buildDir}"/>
+ <if>
+ <available file="${installLocation}/Common.jar"/>
+ <then>
+ <echo message="You must manually remove the file: ${installLocation}/Common.jar"/>
+ <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>
+ </then>
+ </if>
+ </target>
+ <target name="install" depends="source">
+ <jar destfile="${installLocation}/Common.jar"
+ basedir="${buildDir}"
+ includes="**"
+ />
+ </target>
+</project>
diff --git a/Tools/Source/GenBuild/build.xml b/Tools/Source/GenBuild/build.xml
index 473646bdb..811f96b25 100644
--- a/Tools/Source/GenBuild/build.xml
+++ b/Tools/Source/GenBuild/build.xml
@@ -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"/>
diff --git a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
index 5ee07fb34..3127b8706 100644
--- a/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
+++ b/Tools/Source/GenBuild/org/tianocore/build/GenBuildTask.java
@@ -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"));
diff --git a/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java b/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
new file mode 100644
index 000000000..4c179b8fd
--- /dev/null
+++ b/Tools/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
@@ -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);
+ }
+
+ }
+} \ No newline at end of file
diff --git a/Tools/build.xml b/Tools/build.xml
index 2188431a9..f73e69302 100644
--- a/Tools/build.xml
+++ b/Tools/build.xml
@@ -18,6 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
<!-- Note: this is an ordered list. The projects have dependencies between them. -->
<filelist dir="."
files="
+ Source/Common/build.xml
Source/GenBuild/build.xml
Source/FrameworkTasks/build.xml
Source/Cpptasks/build.xml
diff --git a/edksetup.bat b/edksetup.bat
index 60c55c4e4..10d532526 100644
--- a/edksetup.bat
+++ b/edksetup.bat
@@ -118,12 +118,14 @@ call ant -f %WORKSPACE%\Tools\build.xml SurfaceArea
@REM
set CLASSPATH=%CLASSPATH%;%WORKSPACE%\%Tools\Jars\SurfaceArea.jar
+
call ant -f %WORKSPACE%\Tools\build.xml JavaCode
@REM
@REM We have all of the Java Programs and add-in classes created, so we can start
@REM using the cpp-tasks to create our tools
@REM
+set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\Common.jar
set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\GenBuild.jar
set CLASSPATH=%CLASSPATH%;%WORKSPACE%\Tools\Jars\cpptasks.jar;%WORKSPACE%\Tools\Jars\frameworktasks.jar