summaryrefslogtreecommitdiff
path: root/Tools/Java
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Java')
-rw-r--r--Tools/Java/Source/CheckTools/CheckTools.msa39
-rw-r--r--Tools/Java/Source/CheckTools/build.xml42
-rw-r--r--Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/CheckTools.java292
-rw-r--r--Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolChecks.java851
-rw-r--r--Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolInfo.java185
-rw-r--r--Tools/Java/Source/Common/Common.msa48
-rw-r--r--Tools/Java/Source/Common/build.xml64
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/cache/FileTimeStamp.java83
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/definitions/EdkDefinitions.java111
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java105
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/exception/EdkException.java49
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java44
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java112
-rw-r--r--Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java27
-rw-r--r--Tools/Java/Source/ContextTool/ContextTool.msa31
-rw-r--r--Tools/Java/Source/ContextTool/build.xml55
-rw-r--r--Tools/Java/Source/ContextTool/org/tianocore/context/ContextMain.java48
-rw-r--r--Tools/Java/Source/ContextTool/org/tianocore/context/HelpInfo.java144
-rw-r--r--Tools/Java/Source/ContextTool/org/tianocore/context/ParseParameter.java276
-rw-r--r--Tools/Java/Source/ContextTool/org/tianocore/context/TargetFile.java403
-rw-r--r--Tools/Java/Source/Cpptasks/CppTasks.msa219
-rw-r--r--Tools/Java/Source/Cpptasks/build.xml58
-rw-r--r--Tools/Java/Source/Cpptasks/cpptasks.mf7
-rw-r--r--Tools/Java/Source/Cpptasks/cpptasks.tasks1
-rw-r--r--Tools/Java/Source/Cpptasks/cpptasks.types9
-rw-r--r--Tools/Java/Source/Cpptasks/javadoc.xml30
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AboutCCTask.java49
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ArchEnum.java72
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerDef.java118
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerEnum.java54
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerDef.java237
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerEnum.java53
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTask.java1749
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTaskProgressMonitor.java56
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CPUEnum.java71
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CUtil.java461
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerDef.java556
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerEnum.java221
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerParam.java33
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyInfo.java86
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyTable.java609
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerDef.java243
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerMap.java218
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerProtocolEnum.java50
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/FileVisitor.java27
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerDef.java549
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerEnum.java106
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerParam.java33
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OSFamilyEnum.java59
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ObjectFileCollector.java42
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OptimizationEnum.java82
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OutputTypeEnum.java48
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileDef.java215
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileExceptDef.java80
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorDef.java714
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorEnumValue.java47
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorParam.java100
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/RuntimeType.java26
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java51
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SubsystemEnum.java34
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetDef.java228
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistory.java58
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistoryTable.java426
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetInfo.java127
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetMatcher.java117
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/VersionInfo.java550
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSCCompiler.java215
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLibrarian.java160
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java166
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCCompiler.java135
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCfgParser.java70
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLibrarian.java200
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLinker.java264
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java219
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandResourceCompiler.java130
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/CfgFilenameState.java46
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/ConsumeToSpaceOrNewLine.java30
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/QuoteBranchState.java35
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranCompiler.java138
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLibrarian.java82
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java77
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAslcompiler.java75
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAssembler.java72
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java205
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java85
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java129
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Aslcompiler.java23
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AslcompilerConfiguration.java29
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Assembler.java23
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AssemblerConfiguration.java29
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CaptureStreamHandler.java122
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompiler.java226
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java93
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssembler.java326
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssemblerConfiguration.java123
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java42
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java435
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java216
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java42
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java404
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java119
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Compiler.java24
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CompilerConfiguration.java64
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkType.java134
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Linker.java57
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java31
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCCompiler.java43
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCompiler.java104
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCompiler.java49
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Processor.java73
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProcessorConfiguration.java52
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProgressMonitor.java31
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAslcompiler.java70
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAssembler.java84
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCCompiler.java50
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java136
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLibrarian.java86
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLinker.java127
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLibrarian.java36
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLinker.java44
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioMIDLCompiler.java113
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java90
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java117
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java106
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java323
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccAssembler.java76
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java243
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java152
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLibrarian.java41
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLinker.java210
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccProcessor.java299
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GppLinker.java203
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/LdLinker.java57
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccCCompiler.java273
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLibrarian.java69
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLinker.java234
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccProcessor.java288
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GppLinker.java228
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/LdLinker.java83
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccCCompiler.java245
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLibrarian.java43
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java215
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java305
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GppLinker.java210
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/LdLinker.java60
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java104
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCLinker.java100
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java111
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java75
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java58
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java55
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java58
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java55
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java51
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Aslcompiler.java66
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java53
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java38
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java46
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java53
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390CCompiler.java157
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Linker.java201
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Processor.java71
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccCompiler.java124
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccLinker.java202
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccProcessor.java71
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParser.java67
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParserState.java41
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/BranchState.java46
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CParser.java78
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CaseInsensitiveLetterState.java87
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FilenameState.java41
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FortranParser.java106
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/LetterState.java80
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/Parser.java28
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/PostE.java41
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrCaseInsensitiveLetterState.java83
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrLetterState.java75
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89CCompiler.java109
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Linker.java125
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Processor.java116
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java119
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCLinker.java100
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxCCompiler.java192
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLibrarian.java162
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java181
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java30
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java30
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java122
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java28
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java84
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java92
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java38
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java199
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java59
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java38
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java290
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java48
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java28
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java45
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java37
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java153
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java297
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineArgument.java34
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineCompiler.java45
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java333
-rw-r--r--Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java87
-rw-r--r--Tools/Java/Source/DbTools/DbTools.msa31
-rw-r--r--Tools/Java/Source/DbTools/build.xml42
-rw-r--r--Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbCmds.java501
-rw-r--r--Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbTool.java24
-rw-r--r--Tools/Java/Source/DbTools/src/org/tianocore/DbTools/UpdateDb.java594
-rw-r--r--Tools/Java/Source/FrameworkTasks/FrameworkTasks.msa81
-rw-r--r--Tools/Java/Source/FrameworkTasks/build.xml53
-rw-r--r--Tools/Java/Source/FrameworkTasks/frameworktasks.tasks25
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Compress.java78
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressHeader.java77
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java213
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java192
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Database.java30
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java194
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiDefine.java56
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java376
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsHeader.java185
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsTypes.java115
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FileArg.java65
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java848
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java198
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java194
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java142
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java341
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java167
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java1010
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java274
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java398
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java253
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java368
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/IncludePath.java26
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Input.java24
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/InputFile.java24
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java381
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java221
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/NestElement.java366
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java290
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java196
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java224
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SectFile.java116
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Section.java26
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java162
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SkipExt.java24
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java195
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java471
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java197
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java266
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ToolArg.java151
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java213
-rw-r--r--Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java195
-rw-r--r--Tools/Java/Source/FrameworkWizard/FrameworkWizard.msa224
-rw-r--r--Tools/Java/Source/FrameworkWizard/MANIFEST.MF2
-rw-r--r--Tools/Java/Source/FrameworkWizard/build.xml46
-rw-r--r--Tools/Java/Source/FrameworkWizard/rsc/resources/images/No.JPGbin1205 -> 0 bytes
-rw-r--r--Tools/Java/Source/FrameworkWizard/rsc/resources/images/Yes.JPGbin1106 -> 0 bytes
-rw-r--r--Tools/Java/Source/FrameworkWizard/rsc/resources/images/logo.gifbin3920 -> 0 bytes
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java161
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java1291
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java3789
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/NewFileChooser.java228
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java809
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SplashScreen.java106
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java508
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java139
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java304
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java746
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java1123
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java193
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java300
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IDefaultTableModel.java37
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java91
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java113
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java71
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java231
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java75
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java231
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java74
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java217
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java74
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java55
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java155
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java301
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java95
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java334
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java378
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java715
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java40
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java1050
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java651
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java657
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultId.java124
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdFindResultId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java318
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java263
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java227
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java280
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java163
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java264
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java216
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java231
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java64
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java203
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java76
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java84
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java67
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java104
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/AggregationOperation.java86
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/DistributeRule.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Far.java261
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarFileItem.java54
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarHeader.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarIdentification.java58
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarInterface.java21
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarMd5.java40
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPackage.java93
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPlatformItem.java60
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java36
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Manifest.java960
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/ManifestInterface.java40
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQuery.java127
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQueryInterface.java38
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java334
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java641
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java294
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java349
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java374
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java351
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java362
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java483
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java315
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java417
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java93
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java95
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java114
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java152
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java174
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java112
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java103
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java147
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java105
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java170
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java175
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java98
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java74
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java123
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java123
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java89
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java96
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java100
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java97
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java472
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java493
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java537
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java655
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java465
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java471
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java485
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java485
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java479
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java514
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java515
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java491
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java469
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java472
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java1696
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java445
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java495
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java452
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java546
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java948
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java465
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java461
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java511
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java589
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java611
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java441
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java493
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java523
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java547
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java458
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java498
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/PackageIdentification.java64
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GenGuidDialog.java445
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GuidEditor.java98
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java1885
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java941
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java816
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java931
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java517
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java579
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java1242
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java148
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java146
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java61
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/DynamicTree.java42
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java2242
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java774
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java3818
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java3239
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java1084
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFvOptions.java368
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java786
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java2240
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java1043
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java265
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenListDialog.java244
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenLongTextDialog.java229
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java119
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/LongTextEditor.java93
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/TableSorter.java277
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/LibraryClassDescriptor.java132
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java413
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java157
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java1152
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java329
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/Workspace.java153
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java958
-rw-r--r--Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/ui/SwitchWorkspace.java217
-rw-r--r--Tools/Java/Source/GenBuild/GenBuild.msa89
-rw-r--r--Tools/Java/Source/GenBuild/GenBuild.tasks8
-rw-r--r--Tools/Java/Source/GenBuild/build.xml56
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java526
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/FileProcess.java286
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java415
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java858
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildThread.java242
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java523
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java2303
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java261
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java285
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/exception/AutoGenException.java40
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/exception/GenBuildException.java40
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/exception/PcdAutogenException.java35
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/exception/PlatformPcdPreprocessBuildException.java36
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/exception/XmlParseException.java35
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java421
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java950
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java708
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFile.java130
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFileList.java64
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java283
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java948
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/OnDependency.java145
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/OutputManager.java201
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/Spd.java273
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java2356
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/global/VariableTask.java71
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java130
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/Identification.java128
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java251
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java118
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java113
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java384
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java1740
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java359
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java114
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java127
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java54
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java347
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java278
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java328
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java140
-rw-r--r--Tools/Java/Source/GenBuild/org/tianocore/build/tools/PackageItem.java88
-rw-r--r--Tools/Java/Source/Merge/Merge.msa32
-rw-r--r--Tools/Java/Source/Merge/build.xml44
-rw-r--r--Tools/Java/Source/Merge/readme.txt48
-rw-r--r--Tools/Java/Source/Merge/src/org/tianocore/Merge/CombineMsa.java2007
-rw-r--r--Tools/Java/Source/Merge/src/org/tianocore/Merge/Merge.java24
-rw-r--r--Tools/Java/Source/Merge/src/org/tianocore/Merge/MergeCmd.java211
-rw-r--r--Tools/Java/Source/MigrationTools/MANIFEST.MF2
-rw-r--r--Tools/Java/Source/MigrationTools/MigrationTools.msa51
-rw-r--r--Tools/Java/Source/MigrationTools/build.xml54
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Common.java255
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Critic.java239
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java505
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/FirstPanel.java305
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Func.java73
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java77
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/Macro.java54
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MigrationTool.java195
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java177
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleReader.java430
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java425
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java166
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java294
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/PathIterator.java56
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java504
-rw-r--r--Tools/Java/Source/MigrationTools/org/tianocore/migration/UI.java32
-rw-r--r--Tools/Java/Source/PcdTools/PcdTools.msa48
-rw-r--r--Tools/Java/Source/PcdTools/build.xml54
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/action/BuildAction.java61
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java992
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/CommonDefinition.java353
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java162
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/MemoryDatabaseManager.java313
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/ModulePcdInfoFromFpd.java48
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/SkuInstance.java50
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/Token.java960
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageIdentification.java105
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java512
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/BuildActionException.java33
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/EntityException.java31
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/PlatformPcdPreprocessException.java36
-rw-r--r--Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/UIException.java31
-rw-r--r--Tools/Java/Source/SurfaceArea/SurfaceArea.msa38
-rw-r--r--Tools/Java/Source/SurfaceArea/build.xml220
536 files changed, 0 insertions, 141524 deletions
diff --git a/Tools/Java/Source/CheckTools/CheckTools.msa b/Tools/Java/Source/CheckTools/CheckTools.msa
deleted file mode 100644
index bcda84307e..0000000000
--- a/Tools/Java/Source/CheckTools/CheckTools.msa
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <MsaHeader>
- <ModuleName>Check Tool Definitions</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>015250d4-e7e2-452f-a6aa-c8be46acbfc7</GuidValue>
- <Version>0.1</Version>
- <Abstract>The tool checks the active tool definition file to verify tools exists</Abstract>
- <Description>
-This tool will verify the tool chain configuration file to verify that the directories and programs exist.
-It will also check to see if an ACPI compiler has been defined for tool chain tag names - if not, then it prints a warning.
-It also checks the assembler to see if it exists, and where.
-The quiet option will not print anything.
-The return values are:
- 0 - PASS
- 1 - FAIL
-
-USAGE:
-checkTools [-h] [-d] [-i] [-v] [-s | -scan] [-t | -test] [-q | -quiet] [[-f | -filename] filename.txt]</Description>
- <Copyright>Copyright (c) 2006, Intel Corporation All rights reserved.</Copyright>
- <License URL="http://opensource.org/licenses/bsd-license.php">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.</License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>EBC IA32 X64 IPF ARM PPC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>Merge</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>src/org/tianocore/CheckTools/ToolChecks.java</Filename>
- <Filename>src/org/tianocore/CheckTools/ToolInfo.java</Filename>
- <Filename>src/org/tianocore/CheckTools/CheckTools.java</Filename>
- <Filename>build.xml</Filename>
- <Filename>readme.txt</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/CheckTools/build.xml b/Tools/Java/Source/CheckTools/build.xml
deleted file mode 100644
index b1a592b116..0000000000
--- a/Tools/Java/Source/CheckTools/build.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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="CheckTools" default="CheckTools" 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/bin"/>
- <target name="CheckTools" depends="install"/>
-
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="src" destdir="${buildDir}"/>
- </target>
-
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/CheckTools" includes="${buildDir}"/>
- </delete>
- </target>
-
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: CheckTools.jar"/>
- <delete file="${installLocation}/CheckTools.jar"/>
- </target>
-
- <target name="install" depends="source">
- <jar destfile="${installLocation}/CheckTools.jar">
- <fileset dir="${buildDir}"/>
- </jar>
- </target>
-
-</project>
diff --git a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/CheckTools.java b/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/CheckTools.java
deleted file mode 100644
index 7c0a26be8d..0000000000
--- a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/CheckTools.java
+++ /dev/null
@@ -1,292 +0,0 @@
-/** @file
- Verify the tool configuration file for location of the correct tools.
-
- 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.
-
- **/
-
-/**
- * This tool checks to see if specified tool chain paths exist.
- * It will check all specified paths, as indicated by the last field of the
- * tool property line equal to _PATH
- *
- * no option = check 1) the file specified in target.txt or 2) tools_def.txt
- * if neither is found, we check the tools_def.template file.
- * -i = INTERACTIVE checks the "active" tools_def.txt file and lets the
- * user modify invalid entries.
- *
- * -s = SCAN will check all standard locations for tool chains
- * C:\Program Files\Microsoft Visual Studio *
- * C:\WINDDK
- * C:\Bin
- * C:\ASL
- * C:\MASM*
- * /opt/tiano
- *
- * -f = FILE check the tools in this file instead of tools_def.txt, or
- * a file that was specified in target.txt
- *
- * -t = TEST can be used with -f or -s, not with -i.
- *
- * -d = DUMP can be used with -f, not with -i
- *
- * -q = QUIET - turns off all System.out.print statements, the return code
- * is the only thing that will determine PASS or FAIL
- *
- */
-package org.tianocore.CheckTools;
-
-import java.io.*;
-
-public class CheckTools {
- private static int DEBUG = 0;
-
- private static final String copyright = "Copyright (c) 2006, Intel Corporation All rights reserved.";
-
- private static final String version = "Version 0.1";
-
- private int VERBOSE = 0;
-
- private boolean QUIET = false;
-
- // private String argv[];
-
- private final int DEFAULT = 1;
-
- private final int TEST = 2;
-
- private final int SCAN = 4;
-
- private final int DUMP = 8;
-
- private final int INTERACTIVE = 16;
-
- private boolean USERFILE = false;
-
- private String inFile = "";
-
- private final int PASS = 0;
-
- private final int FAIL = 1;
-
- private String SEP = System.getProperty("file.separator");
-
- public static void main(String[] argv) {
- CheckTools cts = new CheckTools();
- int exitCode = cts.checkTool(argv);
- if (DEBUG > 10)
- System.out.println("Exit Code: " + exitCode);
- if (exitCode == -1) {
- new CheckTools().usage();
- System.exit(1);
- }
- System.exit(exitCode);
- }
-
- private int checkTool(String[] arguments) {
- if ((DEBUG > 1) && (arguments.length > 0))
- System.out.println("Arguments: ");
- int cmdCode = DEFAULT;
- if (arguments.length > 0) {
- cmdCode = DEFAULT;
- for (int i = 0; i < arguments.length; i++)
- if (arguments[i].toLowerCase().startsWith("-q"))
- QUIET = true;
- for (int i = 0; i < arguments.length; i++) {
- String arg = arguments[i];
- if (DEBUG > 1)
- System.out.println(" [" + i + "] " + arg);
- if (!(arg.toLowerCase().startsWith("-t") || arg.toLowerCase().startsWith("-s")
- || arg.toLowerCase().startsWith("-d") || arg.toLowerCase().startsWith("-i")
- || arg.toLowerCase().startsWith("-v") || arg.toLowerCase().startsWith("-q")
- || arg.toLowerCase().startsWith("-h") || arg.toLowerCase().startsWith("-f"))) {
- // Only allow valid option flags
- if (QUIET == false) {
- System.out.println("Invalid argument: " + arg);
- usage();
- }
- System.exit(FAIL);
- }
-
- if (arg.toLowerCase().startsWith("-d")) {
- if (cmdCode == DEFAULT) {
- cmdCode = DUMP;
- } else {
- if (QUIET == false)
- System.out.println("Invalid Options");
- usage();
- System.exit(FAIL);
- }
- }
- if (arg.toLowerCase().startsWith("-f")) {
- i++;
- inFile = arguments[i];
- USERFILE = true;
- }
- if (arg.toLowerCase().startsWith("-h")) {
- usage();
- System.exit(PASS);
- }
- if (arg.toLowerCase().startsWith("-i")) {
- // Interactive can be specified with any
- // other option - it turns on the query
- // on fail mode.
- cmdCode = cmdCode | INTERACTIVE;
- }
- if (arg.toLowerCase().startsWith("-q")) {
- QUIET = true;
- }
- if (arg.toLowerCase().startsWith("-s")) {
- if (cmdCode == DEFAULT) {
- cmdCode = SCAN;
- } else {
- if (!QUIET) {
- System.out.println("Invalid Options");
- usage();
- }
- System.exit(FAIL);
- }
- }
- if (arg.toLowerCase().startsWith("-t")) {
- if (cmdCode == DEFAULT) {
- cmdCode = TEST;
- } else {
- if (!QUIET) {
- System.out.println("Invalid Options");
- usage();
- }
- System.exit(FAIL);
- }
- }
- if (arg.startsWith("-v")) {
- // Verbose level can be increased to print
- // more INFO messages.
- VERBOSE += 1;
- }
- if (arg.startsWith("-V")) {
- if (!QUIET) {
- System.out.println(copyright);
- System.out.println("CheckTools, " + version);
- }
- System.exit(PASS);
- }
- }
- }
- if (QUIET)
- VERBOSE = 0;
-
- String WORKSPACE = System.getenv("WORKSPACE");
- if ((DEBUG > 0) || (VERBOSE > 0))
- System.out.println("Verifying Tool Chains for WORKSPACE: " + WORKSPACE);
- int returnCode = 0;
-
- if (WORKSPACE == null) {
- if (QUIET == false)
- System.out.println("Please set the environment variable, WORKSPACE and run again.");
- System.exit(FAIL);
- }
- String targetTxt = WORKSPACE + SEP + "Tools" + SEP + "Conf" + SEP + "target.txt";
-
-
- if (inFile.length() < 1) {
- //
- // Check the target.txt file for a Tool Configuration File.
- // If not set, we use tools_def.txt, unless we are running with the
- // INTERACTIVE flag - where we check the template file before copying over to the
- // tools_def.txt file.
- //
- inFile = "tools_def.txt";
- File target = new File(targetTxt);
- String readLine = null;
- String fileLine[] = new String[2];
- if (target.exists()) {
- try {
- FileReader fileReader = new FileReader(targetTxt);
- BufferedReader bufReader = new BufferedReader(fileReader);
- while ((readLine = bufReader.readLine()) != null) {
- if (readLine.startsWith("TOOL_CHAIN_CONF")) {
- fileLine = readLine.trim().split("=");
- if (fileLine[1].trim().length() > 0) {
- if (fileLine[1].trim().contains("Tools/Conf/"))
- inFile = fileLine[1].replace("Tools/Conf/", "").trim();
- else
- inFile = fileLine[1].trim();
- }
- }
- }
- bufReader.close();
- } catch (IOException e) {
- if (QUIET == false)
- System.out.println(" [target.txt] Read Error: " + e);
- System.exit(FAIL);
- }
- }
- }
-
- // OK, now check the infile of we had one.
- String toolsDef = WORKSPACE + SEP + "Tools" + SEP + "Conf" + SEP + inFile;
- File toolsFile = new File(toolsDef);
- if (!toolsFile.exists()) {
- // use the template file
- if (USERFILE) {
- if (QUIET == false) {
- System.out.println("Could not locate the specified file: " + inFile);
- System.out.println(" It must be located in the WORKSPACE" + SEP + "Tools" + SEP + "Conf directory");
- }
- System.exit(FAIL);
- }
- toolsDef = WORKSPACE + SEP + "Tools" + SEP + "Conf" + SEP + "tools_def.template";
- File toolsTemplate = new File(toolsDef);
- if (!toolsTemplate.exists()) {
- if (QUIET == false)
- System.out.println("Your WORKSPACE is not properly configured!");
- System.exit(FAIL);
- } else {
- if (QUIET == false)
- System.out.println("**** WARNING: No Tool Configuration File was found, using the template file, "
- + toolsDef);
- }
- }
-
- //
- // at this point the file, toolsDef points to a tool configuration file of some sort.
- //
- // check tool configuration file
- if (DEBUG > 2)
- System.out.println("Calling checkTools(" + toolsDef + ", " + cmdCode + ", " + VERBOSE + ")");
- ToolChecks tc = new ToolChecks();
- returnCode = tc.checkTools(toolsDef, cmdCode, VERBOSE, QUIET);
-
- if (VERBOSE > 10)
- System.out.println(" checkTools returned: " + returnCode);
- return returnCode;
- }
-
- private void usage() {
- if (QUIET)
- return;
- System.out
- .println("Usage: checkTools [-h] [-d] [-i] [-v] [-s | -scan] [-t | -test] [-q | -quiet] [[-f | -filename] filename.txt]");
- System.out.println(" Where");
- System.out.println(" -h Help - display this screen.");
- System.out.println(" -d Dump - display the tool defintion file in user readable format");
- System.out.println(" -i Interactive query - not yet implemented!");
- System.out.println(" -v Verbose - add up to 3 -v options to increase info messages.");
- System.out.println(" -s Scan - search the usual places on your system for tools.");
- System.out.println(" The Scan feature not yet implemented!.");
- System.out.println(" -t Test - checks that PATH entries in the tool configuration file exist.");
- System.out
- .println(" -q Quiet - no messages get printed, the return value determines pass or fail.");
- System.out.println(" -f filename Use filename instead of the file specified in target.txt or");
- System.out.println(" tools_def.txt or tools_def.template.");
- System.out.println(" By Rule, all tool configuration files must reside in the");
- System.out.println(" WORKSPACE" + SEP + "Tools" + SEP + "Conf directory.");
- }
-}
diff --git a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolChecks.java b/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolChecks.java
deleted file mode 100644
index 59cc336fd9..0000000000
--- a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolChecks.java
+++ /dev/null
@@ -1,851 +0,0 @@
-/** @file
- Verify the tool configuration file for location of the correct tools.
-
- 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.
-
- **/
-
-/**
- * This tool checks to see if specified tool chain paths exist.
- * It will check all specified paths, as indicated by the last field of the
- * tool property line equal to _PATH
- *
- * no option = check 1) the file specified in target.txt or 2) tools_def.txt
- * if neither is found, we check the tools_def.template file.
- * -i = INIT checks the tools_def.template file
- *
- * -s = SCAN will check all standard locations for tool chains
- * C:\Program Files\Microsoft Visual Studio *
- * C:\WINDDK
- * C:\Bin
- * C:\ASL
- * C:\MASM*
- * /opt/tiano
- *
- * -f = FILE check the tools in this file instead of tools_def.txt, or
- * a file that was specified in target.txt
- */
-package org.tianocore.CheckTools;
-
-import java.io.*;
-import java.util.*;
-
-public class ToolChecks {
- private static int DEBUG = 0;
-
- private final int DEFAULT = 1;
-
- private final int TEST = 2;
-
- private final int SCAN = 4;
-
- private final int DUMP = 8;
-
- private final int INTERACTIVE = 16;
-
- private final int PASS = 0;
-
- private final int FAIL = 1;
-
- private ArrayList<String> errLog = new ArrayList<String>();
-
- private ArrayList<String> goodLog = new ArrayList<String>();
-
- private ArrayList<String> warnLog = new ArrayList<String>();
-
- public int checkTools(String toolConfFile, int cmdCode, int VERBOSE, boolean QUIET) {
-
- int returnCode = FAIL;
- boolean interActive = false;
-
- if ((DEBUG > 0) || (VERBOSE > 0)) {
- if ((cmdCode & DUMP) == DUMP)
- System.out.print("Using Tool Configuration File: " + toolConfFile + " ");
- else
- System.out.println("Using Tool Configuration File: " + toolConfFile);
- }
-
- if (DEBUG > 2)
- System.out.println("The cmdCode: " + cmdCode);
-
- if ((cmdCode & INTERACTIVE) == INTERACTIVE) {
- interActive = true;
- if (QUIET == false)
- System.out.println("***** WARNING ***** The Interactive function has not been implemented yet!");
- }
-
- if ((cmdCode & DUMP) == DUMP) {
- returnCode = dumpFile(toolConfFile, VERBOSE, QUIET);
- if (DEBUG > 10)
- System.out.println("dumpFile returned: " + returnCode);
- }
-
- if ((cmdCode & SCAN) == SCAN) {
- returnCode = scanFile(toolConfFile, interActive, VERBOSE, QUIET);
- }
-
- if (((cmdCode & TEST) == TEST) || ((cmdCode & DEFAULT) == DEFAULT))
- returnCode = testFile(toolConfFile, interActive, VERBOSE, QUIET);
-
- if ((errLog.isEmpty() == false) && (QUIET == false)) {
- // We had ERRORS, not just Warnings.
- // System.out.println("Tool Configuration File: " + toolConfFile);
- System.out.println(" goodLog has: " + goodLog.size() + " entries");
- if ((goodLog.isEmpty() == false) && (VERBOSE > 1))
- for (int i = 0; i < goodLog.size(); i++)
- System.out.println("Tool Chain Tag Name: " + goodLog.get(i) + " is valid!");
- for (int i = 0; i < errLog.size(); i++)
- System.out.println(errLog.get(i));
- if (warnLog.isEmpty() == false)
- for (int i = 0; i < warnLog.size(); i++)
- System.out.println(" " + warnLog.get(i));
- if (VERBOSE > 0) {
- System.out.println();
- System.out.println("You can remove these WARNING messages by editing the file:");
- System.out.println(" " + toolConfFile);
- System.out.println("and commenting out out or deleting the entries for the tool");
- System.out.println("chain tag names that do not apply to your system.");
- }
- } else {
- if (QUIET == false) {
- if ((cmdCode & DUMP) == DUMP)
- System.out.println("");
- if (VERBOSE > 0) {
- System.out.print("Valid Tag Names:");
- for (int i = 0; i < goodLog.size(); i++)
- System.out.print(" " + goodLog.get(i));
- System.out.println("");
- }
- if (warnLog.isEmpty() == false)
- for (int i = 0; i < warnLog.size(); i++)
- System.out.println(" " + warnLog.get(i));
- if (returnCode == 0)
- if (warnLog.isEmpty())
- System.out.println(" Tool Configuration File: " + toolConfFile + " is valid!");
- else
- System.out.println(" Tool Configuration File: " + toolConfFile
- + " is valid! However, there are WARNINGS!");
- else
- System.out.println(" Tool Configuration File: " + toolConfFile
- + " contains INVALID tool tag names!");
- }
- }
-
- return returnCode;
- }
-
- private int scanFile(String testFile, boolean interActive, int VERBOSE, boolean QUIET) {
- if ((DEBUG > 0) || (VERBOSE > 0))
- System.out.println("Scanning the Normal Installation Locations ...");
- System.out.println("The Scan function has not been implemented yet!");
- return FAIL;
- }
-
- private int dumpFile(String testFile, int VERBOSE, boolean QUIET) {
- int retCode = PASS;
- try {
- //
- // initialize local variables
- //
- ArrayList<ToolInfo> info = new ArrayList<ToolInfo>();
- String readLine = "";
- String fileLine[] = new String[2];
- String property[] = new String[5];
- ToolInfo toolInf = null;
- String lastTagName = "arf";
- String lastFamily = "arf";
- String lastArch = "IA32";
- String lastCmdCode = "arf";
- // String lastFlags = "arf";
- boolean found = false;
- String tFamily = "arf";
- String tCmdName = "arf";
- String acpiPath = "";
- String cmdPath = "";
- String asmPath = "";
- int ctr = 0;
- //
- // Setup the reader
- //
- FileReader toolConfFile = new FileReader(testFile);
- BufferedReader bufReader = new BufferedReader(toolConfFile);
-
- while ((readLine = bufReader.readLine()) != null) {
- if (!readLine.startsWith("#")) {
- if (readLine.contains("IDENTIFIER")) {
- readLine = readLine.trim();
- fileLine = readLine.split("=");
- if (QUIET == false)
- System.out.println("IDENTIFIER: " + fileLine[1].trim());
- toolInf = new ToolInfo();
- toolInf.setValid();
- } else if (readLine.contains("_")) {
- /**
- * This section should complete array values
- * String TagName
- * String Family
- * boolean Valid
- * String Arch
- * ArrayList<String> Targets
- * ArrayList<String> CmdCode
- * ArrayList<String> Path
- * ArrayList<String> Arguments
- */
- if (DEBUG > 10)
- System.out.println("Processing: " + readLine.trim());
- readLine = readLine.trim();
- readLine = readLine.replaceFirst("=", "_SPLIT_HERE_");
- fileLine = readLine.split("_SPLIT_HERE_");
- fileLine[0] = fileLine[0].trim();
- fileLine[1] = fileLine[1].trim();
- property = fileLine[0].split("_");
-
- // Covert to simple string names
- String tTarget = property[0].trim();
- if (tTarget.contentEquals("*"))
- tTarget = "All Targets";
- String tTag = property[1].trim();
- String tArch = property[2].trim();
- String tCmdCode = property[3].trim();
- String tArg = property[4].trim();
- if (tArg.contentEquals("FAMILY"))
- tFamily = fileLine[1].trim();
- if (tArg.contentEquals("NAME")) {
- tCmdName = fileLine[1].trim();
- tCmdCode = tCmdCode + " (" + tCmdName + ")";
- }
-
- String tVal = fileLine[1].trim();
-
- // Process the TagName
- if ((!tTag.contentEquals(lastTagName))
- || ((!tArch.contentEquals(lastArch)) && (!tArch.contentEquals("*")))
- || (!tFamily.contentEquals(lastFamily))) {
- if (DEBUG > 10) {
- System.out.println(" LAST Tag: " + lastTagName + " Arch: " + lastArch + " Family: "
- + lastFamily);
- System.out.println(" NEXT Tag: " + tTag + " Arch: " + tArch + " Family: " + tFamily);
- }
- if ((!lastTagName.equals("arf")) && (!tTag.equals("*"))) {
- toolInf.setTagName(lastTagName);
- toolInf.setFamily(lastFamily);
- toolInf.setArch(lastArch);
- if (toolInf.getCmdCode().size() < 1)
- toolInf.addCmdCode(lastCmdCode);
- info.add(toolInf);
- toolInf = new ToolInfo();
- toolInf.setValid();
- if (DEBUG > 3)
- System.out.println(" ADDED " + ctr + " Tag: " + lastTagName + " Arch: " + lastArch
- + " Family: " + lastFamily + " CmdCode: " + lastCmdCode);
- ctr++;
-
- }
-
- if ((!tTag.contentEquals("*")) && (!tTag.contentEquals(lastTagName)))
- lastTagName = tTag;
-
- if ((!tArch.contentEquals(lastArch)) && (!tArch.contentEquals("*")))
- lastArch = tArch;
- if ((!tArch.contentEquals(lastArch)) && (tArch.contentEquals("*")))
- lastArch = "IA32";
-
- if (!tFamily.contentEquals(lastFamily))
- lastFamily = tFamily;
- if (DEBUG > 10)
- System.out.println(" Setting Tag: " + lastTagName + " Arch: " + lastArch
- + " Family: " + lastFamily);
- }
-
- // Set the Arch
- if ((!lastArch.contentEquals(tArch)) && (!tArch.contentEquals("*"))) {
- toolInf.setArch(tArch);
- lastArch = tArch;
- if (DEBUG > 10)
- System.out.println(" Setting Arch: " + tArch);
- }
-
- // Process Target field - making sure we add only unique values.
- if (!tTarget.contains("*")) {
- found = false;
- for (int k = 0; k < toolInf.getTargetName().size(); k++)
- if (toolInf.getTargetName(k).contentEquals(tTarget))
- found = true;
- if (!found) {
- toolInf.addTargetName(tTarget);
- if (DEBUG > 10)
- System.out.println(" Adding Target: " + tTarget);
- }
- }
-
- // Process Command Code Field - making sure we add only unique values.
- if (!tCmdCode.contentEquals("*")) {
- found = false;
- for (int k = 0; k < toolInf.getCmdCode().size(); k++)
- if (toolInf.getCmdCode(k).startsWith(tCmdCode))
- found = true;
- if (!found) {
- if (!tCmdCode.contains(" (")) {
- boolean nf = true;
- for (int m = toolInf.size(); m >= 0; --m) {
- if (nf) {
- ArrayList<String> lastCmdEntry = info.get(m).getCmdCode();
- for (int l = 0; l < lastCmdEntry.size(); l++) {
- if (lastCmdEntry.get(l).startsWith(tCmdCode)) {
- tCmdCode = lastCmdEntry.get(l).trim();
- if (DEBUG > 20)
- System.out.println("found tCmdCode here: " + tCmdCode);
- nf = false;
- }
- }
- }
- }
- if (nf == false) {
- toolInf.addCmdCode(tCmdCode);
- if (DEBUG > 10)
- System.out.println(" Adding previous CmdCode: " + tCmdCode);
- }
- } else {
- toolInf.addCmdCode(tCmdCode);
- lastCmdCode = tCmdCode;
- if (DEBUG > 10)
- System.out.println(" Adding first CmdCode: " + tCmdCode);
- }
- }
- }
-
- // Process Path Field - making sure we add only unique values.
- if (tArg.contentEquals("PATH")) {
- String prefix = "PATH_";
- if (tCmdCode.contentEquals("ASM"))
- prefix = "ASMPATH_";
- if (tCmdCode.contentEquals("ASMLINK"))
- prefix = "ALPATH_";
- if (tCmdCode.contentEquals("ASL"))
- prefix = "ASLPATH_";
- File path = new File(tVal);
- found = false;
- if (path.exists()) {
- for (int k = 0; k < toolInf.getPath().size(); k++)
- if (toolInf.getPath(k).startsWith(prefix))
- found = true;
- if (found == false) {
- toolInf.addPath(prefix + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding valid path: " + tVal);
- }
- if (prefix.contentEquals("ASLPATH_"))
- acpiPath = tVal;
- if (prefix.contentEquals("PATH_"))
- cmdPath = tVal;
- if (prefix.contentEquals("ASMPATH_"))
- asmPath = tVal;
- } else {
- toolInf.setInvalid();
- for (int k = 0; k < toolInf.getBadPath().size(); k++)
- if (toolInf.getBadPath(k).startsWith(prefix))
- found = true;
- if (!found) {
- toolInf.addBadPath(prefix + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding NOT valid Path: " + tVal);
- retCode = FAIL;
- }
- }
- }
-
- if (tArg.contentEquals("DPATH")) {
- found = false;
- File path = new File(tVal);
- if (path.exists()) {
- for (int k = 0; k < toolInf.getPath().size(); k++)
- if (toolInf.getPath(k).startsWith("DPATH_"))
- found = true;
- if (!found) {
- toolInf.addPath("DPATH_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding valid DPath: " + tVal);
- }
- } else {
- toolInf.setInvalid();
- for (int k = 0; k < toolInf.getBadPath().size(); k++)
- if (toolInf.getBadPath(k).contentEquals("DPATH_" + tVal))
- found = true;
- if (!found) {
- toolInf.addBadPath("DPATH_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding NOT valid DPath: " + tVal);
- retCode = FAIL;
- }
- }
- }
-
- if (tArg.contentEquals("SPATH")) {
- found = false;
- File path = new File(tVal);
- if (path.exists()) {
- for (int k = 0; k < toolInf.getPath().size(); k++)
- if (toolInf.getPath(k).contentEquals("SPATH_" + tVal))
- found = true;
- if (!found) {
- toolInf.addPath("SPATH_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding valid SPath: " + tVal);
- }
- } else {
- toolInf.setInvalid();
- for (int k = 0; k < toolInf.getBadPath().size(); k++)
- if (toolInf.getBadPath(k).contentEquals("SPATH_" + tVal))
- found = true;
- if (!found) {
- toolInf.addBadPath("SPATH_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding NOT valid SPath: " + tVal);
- retCode = FAIL;
- }
- }
- }
-
- if (tArg.equals("INCLUDEPATH")) {
- found = false;
- File path = new File(tVal);
- if (path.exists()) {
- for (int k = 0; k < toolInf.getPath().size(); k++)
- if (toolInf.getPath(k).contentEquals("INCLUDEPATH_" + tVal))
- found = true;
- if (!found) {
- toolInf.addPath("INCLUDEPATH_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding valid IPath: " + tVal);
- }
- } else {
- toolInf.setInvalid();
- for (int k = 0; k < toolInf.getBadPath().size(); k++)
- if (toolInf.getBadPath(k).contentEquals("INCLUDE_" + tVal))
- found = true;
- if (!found) {
- toolInf.addBadPath("INCLUDE_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding NOT valid IPath: " + tVal);
- retCode = FAIL;
- }
- }
- }
-
- if (tArg.equals("LIBPATH")) {
- found = false;
- File path = new File(tVal);
- if (path.exists()) {
- for (int k = 0; k < toolInf.getPath().size(); k++)
- if (toolInf.getPath(k).contentEquals("LIB_" + tVal))
- found = true;
- if (!found) {
- toolInf.addPath("LIB_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding valid LPath: " + tVal);
- }
- } else {
- toolInf.setInvalid();
- for (int k = 0; k < toolInf.getBadPath().size(); k++)
- if (toolInf.getBadPath(k).contentEquals("LIB_" + tVal))
- found = true;
- if (!found) {
- toolInf.addBadPath("LIB_" + tVal);
- if (DEBUG > 10)
- System.out.println(" Adding NOT valid LPath: " + tVal);
- retCode = FAIL;
- }
- }
- }
-
- if (tArg.equals("FLAGS")) {
- String flags = fileLine[1].trim();
- String fLine = tTarget + "_" + tCmdCode + "_FLAGS_" + flags;
- toolInf.addArguments(fLine);
- if (DEBUG > 10)
- System.out.println(" Adding flag line: " + fLine);
- }
- }
- }
- }
- toolInf.setArch(lastArch);
- toolInf.setFamily(lastFamily);
- toolInf.setTagName(lastTagName);
- info.add(toolInf);
- if (DEBUG > 2)
- System.out.println(" ADDED " + ctr + " LAST Tag: " + lastTagName + " Arch: " + lastArch + " Family: "
- + lastFamily + " Last CmdCode: " + lastCmdCode);
- //
- // Finished collecting data, print it out in Human Readable Format
- if (info.size() > 0) {
- if (QUIET == false)
- System.out.println(" **** TOOL CHAINS ****");
- if ((DEBUG > 0) || (VERBOSE > 1))
- System.out.println("There are " + info.size()
- + " different combinations of Tag Names and Architectures.");
- lastTagName = "arf";
-
- boolean asmExists = false;
- boolean asmPathDefined = false;
-
- boolean cmdPathDefined = false;
- boolean dPathDefined = false;
-
- boolean acpiPathDefined = false;
- boolean acpiDeclared = false;
- ArrayList<String> warnMsgs = null;
-
- for (int i = 0; i < info.size(); i++) {
- if (!lastTagName.contentEquals(info.get(i).getTagName())) {
- if ((acpiDeclared == false) && (!lastTagName.contentEquals("arf"))) {
- if (QUIET == false) {
- System.out
- .println(" ----WARNING: No ACPI assembler has been defined for "
- + lastTagName
- + ", you will not be able to successfully create a complete firmware image.");
- System.out.println("");
- }
- }
- if ((asmExists == false) && (!lastTagName.contentEquals("arf"))) {
- if (QUIET == false) {
- System.out.println(" ----WARNING: No Assembler has been defined for " + lastTagName
- + ", you will not be able to successfully compile all platforms.");
- System.out.println("");
- }
- }
- asmPath = "";
- asmPathDefined = false;
- cmdPath = "";
- cmdPathDefined = false;
- dPathDefined = false;
- acpiPath = "";
- acpiPathDefined = false;
- acpiDeclared = false;
- warnMsgs = new ArrayList<String>();
- lastTagName = info.get(i).getTagName();
- }
-
- if ((DEBUG > 0) || (VERBOSE > 1))
- System.out.print("Tool Chain " + i + " Tag Name: " + info.get(i).getTagName() + ", Family: "
- + info.get(i).getFamily());
- else if (QUIET == false)
- System.out.print("Tool Chain Tag Name: " + info.get(i).getTagName() + ", Family: "
- + info.get(i).getFamily());
-
- if (info.get(i).isValid()) {
- ToolInfo vTool = info.get(i);
- if (QUIET == false)
- System.out.println(" is Valid for Architecture: " + info.get(i).getArch());
- // OK, let's print out the command w/flags
-
- for (int m = 0; m < vTool.getPath().size(); m++) {
- String pathName[] = vTool.getPath(m).split("_");
- String prefix = " Tool Path: ";
- if (pathName[0].startsWith("DPATH")) {
- prefix = " Dynamic Linker Path: ";
- dPathDefined = true;
- }
- if (pathName[0].startsWith("PATH")) {
- cmdPathDefined = true;
- cmdPath = pathName[1].trim();
- }
- if (pathName[0].startsWith("APATH")) {
- asmPathDefined = true;
- asmPath = pathName[1].trim();
- }
- if (pathName[0].startsWith("ASLPATH")) {
- acpiPathDefined = true;
- acpiPath = pathName[1].trim();
- }
- if (VERBOSE > 0)
- System.out.println(prefix + pathName[1].trim());
- }
- if (acpiPathDefined == false) {
- if (VERBOSE > 0)
- warnMsgs.add(" ---- WARNING: " + vTool.getTagName() + "ACPI Path is not defined!");
- }
- if ((VERBOSE == 0) && (QUIET == false))
- System.out.print("Defined Targets: ");
- for (int k = 0; k < vTool.getTargetName().size(); k++) {
- String tTarget = vTool.getTargetName(k);
- if (tTarget.contentEquals("*"))
- break;
-
- if (VERBOSE > 0)
- System.out.println("+++ " + tTarget + " +++");
- else if (QUIET == false)
- System.out.print(" " + tTarget);
-
- for (int j = 0; j < vTool.getCmdCode().size(); j++) {
- String tCommand = vTool.getCmdCode(j);
- if (tCommand.contains("ASL ")) {
- acpiDeclared = true;
- if (acpiPathDefined) {
- // TODO: Check the acpi tool path
- }
- }
- if (vTool.getArguments().size() > 1) {
-
- if (!cmdPathDefined) {
- warnMsgs.add(" ---- ERROR: Command Path is not defined!");
- }
- if ((vTool.getFamily().contentEquals("MSFT")) && (!dPathDefined)) {
- warnMsgs
- .add(" ---- ERROR: Microsoft Tool Chains require a Path (DPATH) to the mspdbXX.dll file");
- }
-
- // Process Flag lines!
- for (int n = 0; n < vTool.getArguments().size(); n++) {
- String tFlags = vTool.getArguments(n);
- String aFlags[] = new String[2];
- aFlags = tFlags.split("FLAGS_");
- String tsCmd[] = tCommand.split(" ");
- tsCmd[0] = tsCmd[0].trim();
- if (DEBUG > 10)
- System.out.println(" tCmd: " + tsCmd[0] + ", aFlags[0]: " + aFlags[0]
- + ", tTarget: " + tTarget);
- if (aFlags[0].contains(tsCmd[0])) {
- if ((tFlags.contains("All")) || (aFlags[0].contains(tTarget))) {
- String flagLine = aFlags[1].trim();
- if (info.get(i).getFamily().contentEquals("MSFT")) {
- if (tCommand.startsWith("PP")) {
- if (QUIET == false)
- if ((!flagLine.contains("/P "))
- && (!flagLine.contains("/E "))) {
- System.out
- .println(" **** ERROR **** Pre-Processor Flags are NOT VALID!");
- }
- }
- }
- String cmdExe = "";
-
- if (tCommand.contains("ASM ")) {
- cmdExe = tCommand.replace("ASM (", "");
- cmdExe = cmdExe.replace(")", "");
- if (asmPathDefined)
- cmdExe = asmPath.trim() + File.separator + cmdExe.trim();
- else
- cmdExe = cmdPath.trim() + File.separator + cmdExe.trim();
- File testCmd = new File(cmdExe);
- // System.out.println("Check: " + cmdExe);
- if (!testCmd.exists()) {
- String errMsg = " **** ERROR **** Assembler Command Defined, but does not exist! "
- + cmdExe;
- if (VERBOSE > 0) {
- System.out.println(errMsg);
- }
- boolean nf = true;
- for (int r = 0; r < warnMsgs.size(); r++)
- if (warnMsgs.get(r).contentEquals(errMsg))
- nf = false;
- if (nf)
- warnMsgs.add(errMsg);
- } else
- asmExists = true;
-
- }
-
- if ((tCommand.contains("ASM ")) && (asmPathDefined == false)
- && (VERBOSE > 0))
- System.out
- .println(" --- WARNING: Assembler - "
- + tCommand
- + " defined, but a Separate Path to the Assembler was not defined, using: "
- + cmdExe);
- if ((asmPathDefined) && (tCommand.contains("ASM "))
- && (asmPathDefined == false) && (VERBOSE == 0)) {
- String msgIs = " --- WARNING: "
- + info.get(i).getTagName()
- + " Assembler "
- + info.get(i).getArch()
- + " - "
- + tCommand
- + " defined, but a Separate Path to the Assembler was not defined, using: "
- + cmdExe;
- boolean nf = true;
- for (int r = 0; r < warnMsgs.size(); r++)
- if (warnMsgs.get(r).contentEquals(msgIs))
- nf = false;
- if (nf)
- warnMsgs.add(msgIs);
- }
- if (VERBOSE > 0)
- System.out.println(" " + tCommand + " " + flagLine);
- }
- }
- }
- } else {
- if (VERBOSE > 0)
- System.out.println(" " + tCommand + " has no arguments defined.");
- }
- }
- }
-
- } else {
- if (QUIET == false)
- System.out.println(" is NOT VALID for Architecture: " + info.get(i).getArch());
- retCode = FAIL;
- for (int k = 0; k < info.get(i).getBadPath().size(); k++) {
- String failureString = "";
- String tempString = info.get(i).getBadPath(k);
- if (tempString.startsWith("PATH_"))
- failureString = "Common Command Path: " + tempString.replace("PATH_", "")
- + " is NOT Valid!";
- if (tempString.startsWith("SPATH"))
- failureString = "Static Linker Path: " + tempString.replace("SPATH_", "")
- + " is NOT valid!";
- if (tempString.startsWith("DPATH"))
- failureString = "Dynamic Linker Path: " + tempString.replace("DPATH_", "")
- + " is NOT valid!";
- if (tempString.startsWith("LIB_"))
- failureString = "System Lib Path: " + tempString.replace("LIB_", "")
- + " is NOT valid!";
- if (tempString.startsWith("INCLUDEPATH_"))
- failureString = "System include Path: " + tempString.replace("INCLUDEPATH_", "")
- + " is NOT valid!";
- if (tempString.startsWith("APATH"))
- failureString = "Assembler Path: " + tempString.replace("APATH_", "")
- + " is NOT valid!";
- if (tempString.startsWith("ALPATH"))
- failureString = "Assembler Link Path: " + tempString.replace("ALPATH_", "")
- + " is NOT valid!";
- if (tempString.startsWith("ASLPATH"))
- failureString = "ACPI Path: " + tempString.replace("ASLPATH_", "")
- + " is NOT valid!";
- if (QUIET == false)
- System.out.println(" --- " + failureString);
- }
-
- }
-
- if ((VERBOSE == 0) && (QUIET == false)) {
- System.out.println("");
- for (int p = 0; p < warnMsgs.size(); p++)
- System.out.println(warnMsgs.get(p));
- }
- if (QUIET == false)
- System.out.println("");
- }
-
- }
-
- } catch (IOException e) {
- if (QUIET == false)
- System.out.println("I/O Failure: " + e);
- retCode = FAIL;
- }
-
- return retCode;
- }
-
- private int testFile(String testFile, boolean interActive, int VERBOSE, boolean QUIET) {
-
- int retCode = PASS;
- String readLine = "";
- String fileLine[] = new String[2];
- boolean definedAsl = false;
-
- try {
- FileReader toolConfFile = new FileReader(testFile);
- BufferedReader reader = new BufferedReader(toolConfFile);
- String path = "";
- String props[] = new String[5];
- String lastErrTag = "barf";
- String lastTag = "barf";
- while ((readLine = reader.readLine()) != null) {
- if ((!readLine.startsWith("#")) && (readLine.contains("_PATH"))) {
- if (DEBUG > 2) {
- System.out.println(" PATH LINE: " + readLine);
- }
- readLine = readLine.trim();
- fileLine = readLine.split("=");
- path = fileLine[1].trim();
- props = fileLine[0].split("_");
- String tagName = props[1].trim();
- // System.out.println(" Testing TagName: " + tagName);
- String cmdTag = props[3].trim();
- if (!lastTag.contentEquals(tagName)) {
- // we have a new tagName
- // first past lastTag = barf, lastErrTag = barf, tagName = something other than BARF
- if (DEBUG > 0)
- System.out.println(" lastTag: " + lastTag + " this Tag: " + tagName + " lastErrTag: "
- + lastErrTag);
-
- if ((definedAsl == false) && (lastTag.contentEquals("barf") == false))
- warnLog.add(" -- WARNING: Tool Chain Tag Name: " + lastTag
- + " does not have an ACPI assembler defined!");
- definedAsl = false;
-
- if ((lastErrTag.contentEquals("barf")) || (!tagName.contentEquals(lastErrTag))) {
- if ((DEBUG > 2) || (VERBOSE > 3))
- System.out.println("Adding tag: " + tagName + " to the goodLog");
- goodLog.add(tagName);
- }
-
- lastTag = tagName;
-
- } // end of adding the new tag name to the goodLog and
- // checking if we had an ACPI compiler defined for the TagName
- File testPath = new File(path);
- if (cmdTag.contentEquals("ASL"))
- definedAsl = true;
- if (!testPath.exists()) {
- if (VERBOSE > 0)
- System.out.println(" Invalid path: " + path + ", path does not exist!");
- if (!tagName.contentEquals(lastErrTag)) {
- errLog.add(" -- WARNING: Tool Chain Tag Name: " + tagName + " is NOT valid!");
- errLog.add(" Tool Code: [" + cmdTag + "] Path: " + path + " does not exist!");
- }
- retCode = 1;
- lastErrTag = tagName;
-
- } else {
-
- if ((DEBUG > 0) || (VERBOSE > 0)) {
- if ((!tagName.contentEquals(lastTag)) && (!tagName.contentEquals(lastErrTag))
- && (!lastTag.contentEquals("barf"))) {
- String goodMsg = "Tool Chain: " + tagName + " is valid";
- System.out.println(goodMsg);
- }
- }
- } // end of path existence check
- } // end of parsing the PATH line
- } // end of reading file
- // Check the LAST Tag to see of ACPI has been defined.
- if (definedAsl == false)
- warnLog.add(" -- WARNING: Tool Chain Tag Name: " + lastTag
- + " does not have an ACPI assembler defined!");
- // CLEAN UP
- toolConfFile.close();
- } catch (IOException e) {
- if (QUIET == false)
- System.out.println(" [" + testFile + "] " + e);
- System.exit(FAIL);
- } // end of TRY-CATCH for reading file
-
- if ((errLog.isEmpty() == false) && (QUIET == false))
- for (int i = 0; i < goodLog.size(); i++) {
- for (int j = 0; j < errLog.size(); j++) {
- System.out.println(" Error Log [" + j + "] is " + errLog.get(j));
- if (errLog.get(j).contains(goodLog.get(i).trim())) {
- if (VERBOSE > 1)
- System.out.println(" Removing: " + goodLog.get(i).trim());
- goodLog.remove(i);
- break;
- }
- }
- }
- if (DEBUG > 0)
- System.out.println("Returning with goodLog having: " + goodLog.size());
- return retCode;
-
- }
-
-}
diff --git a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolInfo.java b/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolInfo.java
deleted file mode 100644
index 3821c53dbd..0000000000
--- a/Tools/Java/Source/CheckTools/src/org/tianocore/CheckTools/ToolInfo.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/** @file
- Tool Definition Class for translating the tools_def.txt entries
-
- 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.
-
- **/
-
-/**
- * This section should complete array values
- * this.TagName
- * this.Family
- * this.Valid
- * this.Arch
- * this.Targets[]
- * this.CmdCode[]
- * this.Path[]
- * this.Arguments[]
- *
- */
-
-package org.tianocore.CheckTools;
-
-import java.util.*;
-
-public class ToolInfo extends ArrayList {
-
- ///
- /// Define Class Serial Version UID
- ///
- private static final long serialVersionUID = 2513613555731096258L;
-
- private String sTagName;
-
- private String sFamily;
-
- private boolean bValid;
-
- private String sArch;
-
- private ArrayList<String> aTargetName = null;
-
- private ArrayList<String> aCmdCode = null;
-
- private ArrayList<String> aCmdName = null;
-
- private ArrayList<String> aPath = null;
-
- private ArrayList<String> aBadPath = null;
-
- private ArrayList<String> aArguments = null;
-
- public ToolInfo() {
- super();
- init();
- }
-
- private void init() {
- sTagName = "";
- sFamily = "";
- bValid = false;
- sArch = "";
- aTargetName = new ArrayList<String>();
- aCmdCode = new ArrayList<String>();
- aCmdName = new ArrayList<String>();
- aPath = new ArrayList<String>();
- aArguments = new ArrayList<String>();
- aBadPath = new ArrayList<String>();
- }
-
- public String getTagName() {
- return this.sTagName.trim();
- }
-
- public String getFamily() {
- return this.sFamily.trim();
- }
-
- public boolean isValid() {
- return this.bValid;
- }
-
- public String getArch() {
- return this.sArch.trim();
- }
-
- public ArrayList<String> getTargetName() {
- return this.aTargetName;
- }
-
- public String getTargetName(int id) {
- return this.aTargetName.get(id).trim();
- }
-
- public ArrayList<String> getCmdCode() {
- return this.aCmdCode;
- }
-
- public String getCmdCode(int id) {
- return this.aCmdCode.get(id).trim();
- }
-
- public ArrayList<String> getCmdName() {
- return this.aCmdName;
- }
-
- public String getCmdName(int id) {
- return this.aCmdName.get(id).trim();
- }
-
- public ArrayList<String> getPath() {
- return this.aPath;
- }
-
- public String getPath(int id) {
- return this.aPath.get(id).trim();
- }
-
- public ArrayList<String> getArguments() {
- return this.aArguments;
- }
-
- public String getArguments(int id) {
- return this.aArguments.get(id).trim();
- }
-
- public ArrayList<String> getBadPath() {
- return this.aBadPath;
- }
-
- public String getBadPath(int id) {
- return this.aBadPath.get(id).trim();
- }
-
- public void setTagName(String val) {
- this.sTagName = val.trim();
- }
-
- public void setFamily(String val) {
- this.sFamily = val.trim();
- }
-
- public void setValid() {
- this.bValid = true;
- }
-
- public void setInvalid() {
- this.bValid = false;
- }
-
- public void setArch(String val) {
- this.sArch = val.trim();
- }
-
- public void addTargetName(String val) {
- this.aTargetName.add(val.trim());
- }
-
- public void addCmdCode(String val) {
- this.aCmdCode.add(val.trim());
- }
-
- public void addCmdName(String val) {
- this.aCmdName.add(val.trim());
- }
-
- public void addPath(String val) {
- this.aPath.add(val.trim());
- }
-
- public void addArguments(String val) {
- this.aArguments.add(val.trim());
- }
-
- public void addBadPath(String val) {
- this.aBadPath.add(val.trim());
- }
-
-}
diff --git a/Tools/Java/Source/Common/Common.msa b/Tools/Java/Source/Common/Common.msa
deleted file mode 100644
index 6c07455b1f..0000000000
--- a/Tools/Java/Source/Common/Common.msa
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>Common Java Classes</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>9D0ACB3E-4CE1-4228-98FF-85E64B0A4EC8</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano Tool Resources Module</Abstract>
- <Description>
- This Module provides the EFI/Tiano Tools that are used to create EFI/Tiano
- Modules and Platform Binary Files (PBF)
- These tools require compilation only once if the Developer Workstation and
- the Developer's choice of HOST tool chain are stable. If the developer
- updates either the OS or the HOST tool chain, these tools should be rebuilt.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>org/tianocore/common/cache/FileTimeStamp.java</Filename>
-
- <Filename>org/tianocore/common/definitions/EdkDefinitions.java</Filename>
- <Filename>org/tianocore/common/definitions/ToolDefinitions.java</Filename>
-
- <Filename>org/tianocore/common/exception/EdkException.java</Filename>
-
- <Filename>org/tianocore/common/logger/DefaultLogger.java</Filename>
- <Filename>org/tianocore/common/logger/EdkLog.java</Filename>
- <Filename>org/tianocore/common/logger/LogMethod.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/Common/build.xml b/Tools/Java/Source/Common/build.xml
deleted file mode 100644
index f75db2fb71..0000000000
--- a/Tools/Java/Source/Common/build.xml
+++ /dev/null
@@ -1,64 +0,0 @@
-<?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="Common_Jar" 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"/>
-
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars">
- <include name="SurfaceArea.jar"/>
- </fileset>
- <fileset dir="${env.XMLBEANS_HOME}/lib">
- <include name="*.jar"/>
- </fileset>
- <pathelement path="${env.CLASSPATH}"/>
- </path>
-
- <target name="Common_Jar" depends="install"/>
-
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
-
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/Common" includes="${buildDir}"/>
- </delete>
- </target>
-
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: Common.jar"/>
- <delete file="${installLocation}/Common.jar"/>
- <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/Java/Source/Common/org/tianocore/common/cache/FileTimeStamp.java b/Tools/Java/Source/Common/org/tianocore/common/cache/FileTimeStamp.java
deleted file mode 100644
index 968d31f15c..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/cache/FileTimeStamp.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/** @file
-This file is to define the FileTimeStamp class for speeding up the dependency check.
-
-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.
-
-**/
-package org.tianocore.common.cache;
-
-import java.io.File;
-import java.util.Map;
-import java.util.TreeMap;
-import java.util.HashMap;
-
-/**
- FileTimeStamp class is used to cache the time stamp of accessing file, which
- will speed up the dependency check for build
- **/
-public class FileTimeStamp {
- //
- // cache the modified timestamp of files accessed, to speed up the depencey check
- //
- private static Map<String, Long> timeStampCache = new HashMap<String, Long>();
-
- /**
- Get the time stamp of given file. It will try the cache first and then
- get from file system if no time stamp of the file is cached.
-
- @param file File name
-
- @return long The time stamp of the file
- **/
- synchronized public static long get(String file) {
- long timeStamp = 0;
-
- Long value = timeStampCache.get(file);
- if (value != null) {
- timeStamp = value.longValue();
- } else {
- timeStamp = new File(file).lastModified();
- timeStampCache.put(file, new Long(timeStamp));
- }
-
- return timeStamp;
- }
-
- /**
- Force update the time stamp for the given file
-
- @param file File name
- @param timeStamp The time stamp of the file
- **/
- synchronized public static void update(String file, long timeStamp) {
- timeStampCache.put(file, new Long(timeStamp));
- }
-
- /**
- Force update the time stamp for the given file
-
- @param file File name
- **/
- synchronized public static void update(String file) {
- long timeStamp = new File(file).lastModified();
- timeStampCache.put(file, new Long(timeStamp));
- }
-
- /**
- Check if the time stamp of given file has been cached for not
-
- @param file The file name
-
- @return boolean
- **/
- synchronized public static boolean containsKey(String file) {
- return timeStampCache.containsKey(file);
- }
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/definitions/EdkDefinitions.java b/Tools/Java/Source/Common/org/tianocore/common/definitions/EdkDefinitions.java
deleted file mode 100644
index e5f510a199..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/definitions/EdkDefinitions.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/** @file
- EdkDefinitions Class.
-
- EdkDefinitions class incldes the common EDK definitions which are used
- by the Tools.
-
-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.
-
-**/
-
-package org.tianocore.common.definitions;
-
-/**
- This class includes the common EDK definitions.
- **/
-public class EdkDefinitions {
- ///
- /// MODULE_TYPE definitions
- ///
- public final static String MODULE_TYPE_BASE = "BASE";
- public final static String MODULE_TYPE_SEC = "SEC";
- public final static String MODULE_TYPE_PEI_CORE = "PEI_CORE";
- public final static String MODULE_TYPE_PEIM = "PEIM";
- public final static String MODULE_TYPE_DXE_CORE = "DXE_CORE";
- public final static String MODULE_TYPE_DXE_DRIVER = "DXE_DRIVER";
- public final static String MODULE_TYPE_DXE_RUNTIME_DRIVER = "DXE_RUNTIME_DRIVER";
- public final static String MODULE_TYPE_DXE_SMM_DRIVER = "DXE_SMM_DRIVER";
- public final static String MODULE_TYPE_DXE_SAL_DRIVER = "DXE_SAL_DRIVER";
- public final static String MODULE_TYPE_UEFI_DRIVER = "UEFI_DRIVER";
- public final static String MODULE_TYPE_UEFI_APPLICATION = "UEFI_APPLICATION";
- public final static String MODULE_TYPE_USER_DEFINED = "USER_DEFINED";
- public final static String MODULE_TYPE_TOOL = "TOOL";
-
- ///
- /// Extension definitions for each of module types
- ///
- public final static String ModuleTypeExtensions[][] = {
- { MODULE_TYPE_BASE, ".FFS" },
- { MODULE_TYPE_SEC, ".SEC" },
- { MODULE_TYPE_PEI_CORE, ".PEI" },
- { MODULE_TYPE_PEIM, ".PEI" },
- { MODULE_TYPE_DXE_CORE, ".DXE" },
- { MODULE_TYPE_DXE_DRIVER, ".DXE" },
- { MODULE_TYPE_DXE_RUNTIME_DRIVER, ".DXE" },
- { MODULE_TYPE_DXE_SMM_DRIVER, ".DXE" },
- { MODULE_TYPE_DXE_SAL_DRIVER, ".DXE" },
- { MODULE_TYPE_UEFI_DRIVER, ".DXE" },
- { MODULE_TYPE_UEFI_APPLICATION, ".APP" },
- { MODULE_TYPE_USER_DEFINED, ".FFS" },
- { MODULE_TYPE_TOOL, ".FFS" }
- };
-
- ///
- /// FFS_TYPE definitions
- ///
- public final static int EFI_FV_FILETYPE_ALL = 0x00;
- public final static int EFI_FV_FILETYPE_RAW = 0x01;
- public final static int EFI_FV_FILETYPE_FREEFORM = 0x02;
- public final static int EFI_FV_FILETYPE_SECURITY_CORE = 0x03;
- public final static int EFI_FV_FILETYPE_PEI_CORE = 0x04;
- public final static int EFI_FV_FILETYPE_DXE_CORE = 0x05;
- public final static int EFI_FV_FILETYPE_PEIM = 0x06;
- public final static int EFI_FV_FILETYPE_DRIVER = 0x07;
- public final static int EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER = 0x08;
- public final static int EFI_FV_FILETYPE_APPLICATION = 0x09;
- public final static int EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE = 0x0B;
- public final static int EFI_FV_FILETYPE_FFS_PAD = 0xF0;
-
- ///
- /// SECTION_TYPE definitions
- ///
- public final static String EFI_SECTION_COMPRESSION = "EFI_SECTION_COMPRESSION";
- public final static String EFI_SECTION_GUID_DEFINED = "EFI_SECTION_GUID_DEFINED";
- public final static String EFI_SECTION_PE32 = "EFI_SECTION_PE32";
- public final static String EFI_SECTION_PIC = "EFI_SECTION_PIC";
- public final static String EFI_SECTION_TE = "EFI_SECTION_TE";
- public final static String EFI_SECTION_DXE_DEPEX = "EFI_SECTION_DXE_DEPEX";
- public final static String EFI_SECTION_VERSION = "EFI_SECTION_VERSION";
- public final static String EFI_SECTION_USER_INTERFACE = "EFI_SECTION_USER_INTERFACE";
- public final static String EFI_SECTION_COMPATIBILITY16 = "EFI_SECTION_COMPATIBILITY16";
- public final static String EFI_SECTION_FIRMWARE_VOLUME_IMAGE = "EFI_SECTION_FIRMWARE_VOLUME_IMAGE";
- public final static String EFI_SECTION_FREEFORM_SUBTYPE_GUID = "EFI_SECTION_FREEFORM_SUBTYPE_GUID";
- public final static String EFI_SECTION_RAW = "EFI_SECTION_RAW";
- public final static String EFI_SECTION_PEI_DEPEX = "EFI_SECTION_PEI_DEPEX";
-
- ///
- /// Extension definitions for each of section types
- ///
- public final static String SectionTypeExtensions[][] = {
- { EFI_SECTION_COMPRESSION, ".sec" },
- { EFI_SECTION_GUID_DEFINED, ".sec" },
- { EFI_SECTION_PE32, ".pe32" },
- { EFI_SECTION_PIC, ".pic" },
- { EFI_SECTION_TE, ".tes" },
- { EFI_SECTION_DXE_DEPEX, ".dpx" },
- { EFI_SECTION_VERSION, ".ver" },
- { EFI_SECTION_USER_INTERFACE, ".ui" },
- { EFI_SECTION_COMPATIBILITY16, ".sec" },
- { EFI_SECTION_FIRMWARE_VOLUME_IMAGE, ".sec" },
- { EFI_SECTION_FREEFORM_SUBTYPE_GUID, ".sec" },
- { EFI_SECTION_RAW, ".sec" },
- { EFI_SECTION_PEI_DEPEX, ".dpx" }
- };
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java b/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java
deleted file mode 100644
index dc6d9f772f..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/definitions/ToolDefinitions.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
- ToolDefinitions Class.
-
- ToolDefinitions class incldes the common Tool definitions.
-
-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.
-
-**/
-
-package org.tianocore.common.definitions;
-
-import java.io.File;
-
-/**
- This class includes the common Tool definitions.
- **/
-public class ToolDefinitions {
- ///
- /// Line separator (carriage return-line feed, CRLF)
- ///
- public final static String LINE_SEPARATOR = "\r\n";
-
- ///
- /// Framework Database (FrameworkDatabase.db) file path
- ///
- public final static String FRAMEWORK_DATABASE_FILE_PATH =
- "Tools" + File.separatorChar + "Conf" + File.separatorChar + "FrameworkDatabase.db";
-
- ///
- /// Target (target.txt) file path
- ///
- public final static String TARGET_FILE_PATH =
- "Tools" + File.separatorChar + "Conf" + File.separatorChar + "target.txt";
-
- ///
- /// Default Tools Definition (tools_def.txt) file path
- ///
- public final static String DEFAULT_TOOLS_DEF_FILE_PATH =
- "Tools" + File.separatorChar + "Conf" + File.separatorChar + "tools_def.txt";
-
- ///
- /// Extension names for SPD, FPD, and MSA
- ///
- public final static String SPD_EXTENSION = ".spd";
- public final static String FPD_EXTENSION = ".fpd";
- public final static String MSA_EXTENSION = ".msa";
-
- ///
- /// Tool Chain Elements in the Tools Definition file
- ///
- public final static String TOOLS_DEF_ELEMENT_TARGET = "TARGET";
- public final static String TOOLS_DEF_ELEMENT_TOOLCHAIN = "TOOLCHAIN";
- public final static String TOOLS_DEF_ELEMENT_ARCH = "ARCH";
- public final static String TOOLS_DEF_ELEMENT_TOOLCODE = "TOOLCODE";
- public final static String TOOLS_DEF_ELEMENT_ATTRIBUTE = "ATTRIBUTE";
-
- ///
- /// Index of Tool Chain elements in the Tools Definition file
- ///
- public final static int TOOLS_DEF_ELEMENT_INDEX_TARGET = 0;
- public final static int TOOLS_DEF_ELEMENT_INDEX_TOOLCHAIN = 1;
- public final static int TOOLS_DEF_ELEMENT_INDEX_ARCH = 2;
- public final static int TOOLS_DEF_ELEMENT_INDEX_TOOLCODE = 3;
- public final static int TOOLS_DEF_ELEMENT_INDEX_ATTRIBUTE = 4;
- public final static int TOOLS_DEF_ELEMENT_INDEX_MAXIMUM = 5;
-
- ///
- /// Tool Chain Attributes in the Tools Definition file
- ///
- public final static String TOOLS_DEF_ATTRIBUTE_NAME = "NAME";
- public final static String TOOLS_DEF_ATTRIBUTE_PATH = "PATH";
- public final static String TOOLS_DEF_ATTRIBUTE_DPATH = "DPATH";
- public final static String TOOLS_DEF_ATTRIBUTE_SPATH = "SPATH";
- public final static String TOOLS_DEF_ATTRIBUTE_EXT = "EXT";
- public final static String TOOLS_DEF_ATTRIBUTE_FAMILY = "FAMILY";
- public final static String TOOLS_DEF_ATTRIBUTE_FLAGS = "FLAGS";
- public final static String TOOLS_DEF_ATTRIBUTE_LIBPATH = "LIBPATH";
- public final static String TOOLS_DEF_ATTRIBUTE_INCLUDEPATH= "INCLUDEPATH";
-
- ///
- /// Tool Chain Families in the Tools Definition file
- ///
- public final static String TOOLS_DEF_FAMILY_MSFT = "MSFT";
- public final static String TOOLS_DEF_FAMILY_INTEL = "INTEL";
- public final static String TOOLS_DEF_FAMILY_GCC = "GCC";
-
- ///
- /// Key name in the Target file
- ///
- public final static String TARGET_KEY_ACTIVE_PLATFORM = "ACTIVE_PLATFORM";
- public final static String TARGET_KEY_TARGET = "TARGET";
- public final static String TARGET_KEY_TOOLCHAIN = "TOOL_CHAIN_TAG";
- public final static String TARGET_KEY_ARCH = "TARGET_ARCH";
- public final static String TARGET_KEY_TOOLS_DEF = "TOOL_CHAIN_CONF";
- public final static String TARGET_KEY_MULTIPLE_THREAD = "MULTIPLE_THREAD";
- public final static String TARGET_KEY_MAX_CONCURRENT_THREAD_NUMBER
- = "MAX_CONCURRENT_THREAD_NUMBER";
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/exception/EdkException.java b/Tools/Java/Source/Common/org/tianocore/common/exception/EdkException.java
deleted file mode 100644
index 6d4fc52dae..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/exception/EdkException.java
+++ /dev/null
@@ -1,49 +0,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.
-
-Module Name:
- EdkException.java
-
-Abstract:
-
---*/
-
-package org.tianocore.common.exception;
-
-public class EdkException extends Exception {
- static final long serialVersionUID = -8494188017252114029L;
-
- public static boolean isPrintStack = false;
-
- public EdkException(String message) {
- super("[EdkException]:" + message);
- }
-
- public EdkException(String message, boolean traceStack) {
- super(message);
-
- }
-
- public EdkException(){
- super();
- }
-
- public EdkException(Exception e, String message){
- super("[EdkException]:" + message);
- if (isPrintStack){
- this.setStackTrace(e.getStackTrace());
- }
- e.printStackTrace();
- }
- public static void setIsprintStack (boolean flag){
- isPrintStack = flag;
- }
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java b/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java
deleted file mode 100644
index b1d9d6de85..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/logger/DefaultLogger.java
+++ /dev/null
@@ -1,44 +0,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.
-
-Module Name:
- DefaultLogger.java
-
-Abstract:
-
---*/
-
-package org.tianocore.common.logger;
-
-import java.io.File;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-class DefaultLogger implements LogMethod {
- private Logger logger = Logger.global;
- private static Level[] levelMap = {
- Level.SEVERE, Level.WARNING, Level.INFO, Level.FINE, Level.ALL
- };
-
- public DefaultLogger() {
- }
-
- public void putMessage(Object msgSource, int msgLevel, String msg) {
- if (msgLevel < 0 || msgLevel > levelMap.length) {
- msgLevel = 2;
- }
- logger.log(levelMap[msgLevel], msg);
- }
-
- public void flushToFile(File file){
-
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java b/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java
deleted file mode 100644
index 6b3ed95471..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/logger/EdkLog.java
+++ /dev/null
@@ -1,112 +0,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.
-
- Module Name:
- EdkLogger.java
-
- Abstract:
-
- --*/
-package org.tianocore.common.logger;
-
-import java.io.File;
-
-public class EdkLog {
- public static final String always = "ALWAYS";
-
- public static final String error = "ERROR";
-
- public static final String warning = "WARNING";
-
- public static final String info = "INFO";
-
- public static final String verbose = "VERBOSE";
-
- public static final String debug = "DEBUG";
-
- public static final int EDK_ALWAYS = -1;
-
- public static final int EDK_ERROR = 0;
-
- public static final int EDK_WARNING = 1;
-
- public static final int EDK_INFO = 2;
-
- public static final int EDK_VERBOSE = 3;
-
- public static final int EDK_DEBUG = 4;
-
- private static int logLevel = EDK_INFO;
-
- private static LogMethod logger = new DefaultLogger();
-
- public static void log(int level, String message) {
- if (level <= logLevel) {
- logger.putMessage(null, level, message);
- }
- }
-
- public static void log(String message) {
- if (EDK_INFO <= logLevel) {
- logger.putMessage(null, EDK_INFO, message);
- }
- }
-
- public static void log(Object o, int level, String message) {
- if (level <= logLevel) {
- logger.putMessage(o, level, message);
- }
- }
-
- public static void log(Object o, String message) {
- if (EDK_INFO <= logLevel) {
- logger.putMessage(o, EDK_INFO, message);
- }
- }
-
- public static void flushLogToFile(File file) {
- logger.flushToFile(file);
- }
-
- public static void setLogger(LogMethod l) {
- logger = l;
- }
-
- public static void setLogLevel(int level) {
- logLevel = level;
- }
-
- public static void setLogLevel(String level) {
- if (level == null) {
- return;
- }
- String levelStr = level.trim();
- if (levelStr.equalsIgnoreCase(error)) {
- logLevel = EDK_ERROR;
- }
- if (levelStr.equalsIgnoreCase(debug)) {
- logLevel = EDK_DEBUG;
- }
- if (levelStr.equalsIgnoreCase(info)) {
- logLevel = EDK_INFO;
- }
- if (levelStr.equalsIgnoreCase(verbose)) {
- logLevel = EDK_VERBOSE;
- }
- if (levelStr.equalsIgnoreCase(warning)) {
- logLevel = EDK_WARNING;
- }
- }
-
- public static int getLogLevel() {
- return logLevel;
- }
-}
diff --git a/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java b/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java
deleted file mode 100644
index f9a6802430..0000000000
--- a/Tools/Java/Source/Common/org/tianocore/common/logger/LogMethod.java
+++ /dev/null
@@ -1,27 +0,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.
-
- Module Name:
- LogMethod.java
-
- Abstract:
-
- --*/
-
-package org.tianocore.common.logger;
-
-import java.io.File;
-
-public interface LogMethod {
- public void putMessage(Object msgSource, int msgLevel, String msg);
-
- public void flushToFile(File file);
-}
diff --git a/Tools/Java/Source/ContextTool/ContextTool.msa b/Tools/Java/Source/ContextTool/ContextTool.msa
deleted file mode 100644
index 6135d21431..0000000000
--- a/Tools/Java/Source/ContextTool/ContextTool.msa
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <MsaHeader>
- <ModuleName>Context Tool</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>893c2f79-1d84-495a-a9c5-f7c1e8a58b31</GuidValue>
- <Version>0.1</Version>
- <Abstract>The tool manipulates the Tools/Conf/target.txt file.</Abstract>
- <Description>This tool is used to manipulate the target.txt file attributes from the command line.
-USAGE:
-ContextTool [-option1] [args] [-option2] [args] ...</Description>
- <Copyright>Copyright (c) 2006, Intel Corporation All rights reserved.</Copyright>
- <License URL="http://opensource.org/licenses/bsd-license.php">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.</License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>ContextTool</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>org/tianocore/context/ContextMain.java</Filename>
- <Filename>org/tianocore/context/HelpInfo.java</Filename>
- <Filename>org/tianocore/context/ParseParameter.java</Filename>
- <Filename>org/tianocore/context/TargetFile.java</Filename>
- <Filename>build.xml</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/ContextTool/build.xml b/Tools/Java/Source/ContextTool/build.xml
deleted file mode 100644
index 3779dbe257..0000000000
--- a/Tools/Java/Source/ContextTool/build.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<?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="ContextTool" default="ContextTool" basedir=".">
-
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <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"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/Jars"/>
- <target name="ContextTool" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/ContextTool" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: ContextTool.jar"/>
- <delete file="${installLocation}/ContextTool.jar"/>
- <if>
- <available file="${installLocation}/ContextTool.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/ContextTool.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}/ContextTool.jar"
- basedir="${buildDir}"
- includes="**"
- />
- </target>
-</project>
-
diff --git a/Tools/Java/Source/ContextTool/org/tianocore/context/ContextMain.java b/Tools/Java/Source/ContextTool/org/tianocore/context/ContextMain.java
deleted file mode 100644
index 94ea56a5c7..0000000000
--- a/Tools/Java/Source/ContextTool/org/tianocore/context/ContextMain.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- File is ContextMain class .
-
-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.
-**/
-package org.tianocore.context;
-
-public class ContextMain {
-
- public static void main(String[] args) {
-
- if (TargetFile.validateFilename("target.txt") == false) {
- String workspacePath = System.getenv("WORKSPACE");
- System.out.printf("%n%s%n", "target.txt can't be found. Please check it in " + workspacePath + "\\Tool\\Conf");
- System.exit(0);
- }
-
- if(ParseParameter.checkParameter(args) == false){
- System.exit(0);
- }
-
- if (TargetFile.readFile() == false){
- System.exit(0);
- }
-
- if (ParseParameter.standardizeParameter(args) > 0){
- System.exit(0);
- }
-
- if (TargetFile.createTempFile("target.txt") == false){
- System.exit(0);
- }
-
- if (TargetFile.readwriteFile() == false){
- System.exit(0);
- }
-
- String workspacePath = System.getenv("WORKSPACE");
- System.out.printf("%n%s%n", workspacePath + "\\Tool\\Conf\\target.txt is updated successfully!");
- }
-}
diff --git a/Tools/Java/Source/ContextTool/org/tianocore/context/HelpInfo.java b/Tools/Java/Source/ContextTool/org/tianocore/context/HelpInfo.java
deleted file mode 100644
index af2b653016..0000000000
--- a/Tools/Java/Source/ContextTool/org/tianocore/context/HelpInfo.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/** @file
- File is HelpInfo class which is used to output the usage info.
-
-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.
-**/
-
-package org.tianocore.context;
-
-import java.util.LinkedList;
-
-public class HelpInfo {
-
-
- /**
- * output the tools usage guide
- * @param no input parameter
- * @return no return value
- **/
- public static void outputUsageInfo() {
- System.out.printf("\n%s", DescripationString);
- System.out.printf("\n%s", UsageInfoString);
- System.out.printf("\n%s", DetailOfOptionString);
-
- for (int i = 0; i < settingnum; i++) {
- outputSubUsageInfo(UsageString[i], UsageStringInfo[i]);
- }
-
- System.out.printf("\n%s", ExampleString);
- System.out.printf("\n%s", str1);
- System.out.printf("\n%s", str2);
- System.out.printf("\n%s", str3);
- System.out.printf("\n%s", str4);
- }
-
- /**
- * output the usage info which bases on cmd option
- * @param String str1 : the cmd option
- * String str2 : the detail of cmd option
- * @return no return value
- **/
- private static void outputSubUsageInfo(String str1, String str2) {
-
- splitString(str2);
- System.out.printf("\n%4s %-30s %s", "", str1, List.get(0));
- for (int i=1; i<List.size(); i++){
- System.out.printf("\n%4s %-30s %s", "", "", List.get(i));
- }
- List.clear();
- }
-
- /**
- * according to the output width, split the detail info
- * @param String str :the detail info
- * @return no return value
- **/
- private static void splitString(String str) {
- int strlength = str.length();
- if (strlength > MaxSrtingLength) {
- String[] tokens = str.split("[ ]", 0);
- String tempstr = null;
- int templength = 0;
- int start = 0;
- int end = 0;
- for (int i = 0; i < tokens.length; i++) {
- if ((templength = end + tokens[i].length() + 1) < (MaxSrtingLength + start)) {
- end = templength;
- } else {
- tempstr = str.substring(start, end);
- List.add(tempstr);
- start = end;
- i = i - 1;
- }
- }
- tempstr = str.substring(start, end - 1);
- List.add(tempstr);
- } else {
- List.add(str);
- }
- }
-
-
- private static LinkedList<String> List = new LinkedList<String>();
-
- private static final int MaxSrtingLength = 40;
-
- private static final int settingnum = 7;
-
- private static final String DescripationString = "The purpose of this tool is modifying the settings in target.txt";
-
- private static final String UsageInfoString = "Usage: ContextTool [-option1] [args] [-option2] [args] ...";
-
- private static final String DetailOfOptionString = "Where options include:";
-
- private static final String ExampleString = "Example: ContextTool -a IA32 IA64 EBC -c Tools/Conf/tools_def.txt -t DEBUG -n GCC -p EdkNt32Pkg/Nt32.fpd -m 2\n";
-
- private static final String str1 = "show current sub setting: ContextTool -x";
-
- private static final String str2 = "show possible sub setting: ContextTool -x ?";
-
- private static final String str3 = "clean current sub setting: ContextTool -x 0";
-
- private static final String str4 = "x is the sub setting option, such as p, a, n, m, t, c.\n";
-
- private static final String HString = "-h";
-
- private static final String HStringInfo = "print usage info";
-
- private static final String AString = "-a <list of Arch>";
-
- private static final String AStringInfo = "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM. Multiple values can be specified on a single line, using space to separate the values.";
-
- private static final String CString = "-c <tool_definition_file.txt>";
-
- private static final String CStringInfo = "Assign a txt file with the relative path to WORKSPACE, which specify the tools to use for the build and must be located in the path: WORKSPACE/Tools/Conf/. If no file is specified, the default filename is \"tools_def.txt\"";
-
- private static final String NString = "-n <list of TagNames>";
-
- private static final String NStringInfo = "Specify the TagName, such as GCC, MSFT, which are defined in the \"tool_definition_file.txt\"";
-
- private static final String PString = "-p <*.fpd>";
-
- private static final String PStringInfo = "Specify the WORKSPACE relative Path and Filename of platform FPD file that will be used for the build.";
-
- private static final String TString = "-t <list of Build Targets>";
-
- private static final String TStringInfo = "What kind of the version is the binary target, such as DEBUG, RELEASE. Multiple values can be specified on a single line, using space to separate the values.";
-
- private static final String MString = "-m <num of Threads>";
-
- private static final String MStringInfo = "The number of concurrent threads. Default is 2. Recommend to set this value to one more than the number of your compurter cores or CPUs. 0 will disable MULTIPLE_THREAD and clean MAX_CONCURRENT_THREAD_NUMBER.";
-
- private static final String[] UsageString = { HString, AString, CString,
- NString, PString, TString, MString };
-
- private static final String[] UsageStringInfo = { HStringInfo, AStringInfo,
- CStringInfo, NStringInfo, PStringInfo, TStringInfo, MStringInfo };
-}
diff --git a/Tools/Java/Source/ContextTool/org/tianocore/context/ParseParameter.java b/Tools/Java/Source/ContextTool/org/tianocore/context/ParseParameter.java
deleted file mode 100644
index 4d9c6de3a0..0000000000
--- a/Tools/Java/Source/ContextTool/org/tianocore/context/ParseParameter.java
+++ /dev/null
@@ -1,276 +0,0 @@
-/** @file
- File is ParseParameter class which is used to parse the validity of user's input args
- and standardize them.
-
-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.
-**/
-package org.tianocore.context;
-
-public class ParseParameter {
-
-
- /**
- * check the validity of user's input args
- * @param args -- user's input
- * @return true or false
- **/
- public static boolean checkParameter(String[] args) {
-
- if(args.length == 0){
- TargetFile.readFile();
- outputCurSetting();
- return false;
- } else {
- if( (args[0].compareToIgnoreCase("-h") == 0) || (args[0].compareToIgnoreCase("/h") == 0) ||
- (args[0].compareToIgnoreCase("--help") == 0) || (args[0].compareToIgnoreCase("/help") == 0) ){
- HelpInfo.outputUsageInfo();
- return false;
- }
- if( args[0].charAt(0) != '-' ){
- System.out.printf("%s\n", "Error Parameters! Please type \"ContextTool -h\" for helpinfo.");
- return false;
- }
- for(int i=0; i<args.length; i++){
- if( (args[i].startsWith("-") &&
- ((args[i].compareTo("-a") != 0) && (args[i].compareTo("-c") != 0) &&
- (args[i].compareTo("-n") != 0) && (args[i].compareTo("-p") != 0) &&
- (args[i].compareTo("-t") != 0) && (args[i].compareTo("-m") != 0)))){
- System.out.printf("%s\n", "Error Parameters! Please type \"ContextTool -h\" for helpinfo.");
- return false;
- }
- }
- }
-
- return true;
- }
-
- /**
- * standardize user's input args
- * @param args -- user's input
- * @return no return value
- **/
- public static int standardizeParameter(String[] args) {
-
-
- StringBuffer InputData = new StringBuffer();
- for (int i = 0; i < args.length; i++) {
- InputData.append(args[i]);
- InputData.append(" ");
- }
-
- int i = 0;
- while (i < InputData.length()) {
- int j = InputData.indexOf("-", i + 1);
- if (j == -1)
- j = InputData.length();
-
- String argstr = InputData.substring(i, j);
- i = j;
- if (argstr.charAt(1) == 'p') {
- //
- // argstr is "-p ", display current setting
- //
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curpstr != null) {
- System.out.printf("%s\n", curpstr);
- } else {
- System.out.printf("No ACTIVE_PLATFORM defined \n");
- }
- return 1;
- }
- //
- //argstr is "-p ? ", display possible setting
- //
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- String workspacePath = System.getenv("WORKSPACE");
- System.out.printf( "%s\n", "Assign a platform FPD file with relative path to " + workspacePath);
- return 2;
- }
- //
- //argstr is "-p 0 ", clean current setting
- //
- if(argstr.length() < 6 && argstr.charAt(3) == '0'){
- curpstr = pstr;
- npflag = true;
- continue;
- }
- String[] S = argstr.split(" ");
- if(S.length > 2){
- System.out.printf( "%s\n", "There should be none or only one ACTIVE_PLATFORM. Please check the number of value which follow \"-p\".");
- return 3;
- }
- curpstr = pstr.concat(argstr.substring(2));
- npflag = true;
- } else if (argstr.charAt(1) == 't') {
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curtstr != null) {
- System.out.printf("%s\n", curtstr);
- } else {
- System.out.printf("No TARGET defined\n");
- }
- return 1;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- System.out.printf( "%s\n", "What kind of the version is the binary target, such as DEBUG, RELEASE." );
- return 2;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '0'){
- curtstr = tstr;
- ntflag = true;
- continue;
- }
- curtstr = tstr.concat(argstr.substring(2));
- ntflag = true;
- } else if (argstr.charAt(1) == 'a') {
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curastr != null) {
- System.out.printf("%s\n", curastr);
- } else {
- System.out.printf("No TARGET_ARCH defined\n");
- }
- return 1;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- System.out.printf( "%s\n", "What kind of architechure is the binary target, such as IA32, IA64, X64, EBC, or ARM." );
- return 2;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '0'){
- curastr = astr;
- naflag = true;
- continue;
- }
- curastr = astr.concat(argstr.substring(2));
- naflag = true;
- } else if (argstr.charAt(1) == 'c') {
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curcstr != null) {
- System.out.printf("%s\n", curcstr);
- } else {
- System.out.printf("No TOOL_CHAIN_CONF defined\n");
- }
- return 1;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- String workspacePath = System.getenv("WORKSPACE");
- System.out.printf( "%s\n", "Assign a txt file with relative path to " + workspacePath + ", which specify the tools to use for the build and must be located in the path:" + workspacePath + "\\Tools\\Conf" );
- return 2;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '0'){
- curcstr = cstr;
- ncflag = true;
- continue;
- }
- String[] S = argstr.split(" ");
- if(S.length > 2){
- System.out.printf( "%s\n", "There should be one and only one TOOL_CHAIN_CONF. Please check the number of value which follow \"-c\".");
- return 3;
- }
- curcstr = cstr.concat(argstr.substring(2));
- ncflag = true;
- } else if (argstr.charAt(1) == 'n') {
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curnstr != null) {
- System.out.printf("%s\n", curnstr);
- } else {
- System.out.printf("No TOOL_CHAIN_TAG defined\n");
- }
- return 1;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- System.out.printf( "%s\n", "Specify the TagName, such as GCC, MSFT." );
- return 2;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '0'){
- curnstr = nstr;
- nnflag = true;
- continue;
- }
- curnstr = nstr.concat(argstr.substring(2));
- nnflag = true;
- } else if (argstr.charAt(1) == 'm') {
- if(argstr.length() < 4 && argstr.charAt(2) == ' '){
- if (curmstr != null) {
- System.out.printf("%s\n", curmstr);
- } else {
- System.out.printf("No MAX_CONCURRENT_THREAD_NUMBER defined\n");
- }
- return 1;
- }
- if(argstr.length() < 6 && argstr.charAt(3) == '?'){
- System.out.printf( "%s\n", "The number of concurrent threads. Default is 2. Recommend to set this value to one more than the number of your compurter cores or CPUs." );
- return 2;
- }
- String[] S = argstr.split(" ");
- if(S.length > 2){
- System.out.printf( "%s\n", "There should be one and only one integer, which doesn't include space.");
- return 3;
- }
- mstr += argstr.substring(2);
- curmstr = mstr;
- nmflag = true;
- if (argstr.charAt(3) == '0'){
- mestr += " Disable";
- } else {
- mestr += " Enable";
- }
- curmestr = mestr;
- nmeflag = true;
- }
-
- }
- return 0;
- }
-
-
- public static boolean outputCurSetting(){
-
- System.out.printf( "%s\n", "The current setting is:" );
- String[] A = { pstr, tstr, astr, cstr, nstr, mstr, mestr };
- String[] B = { curpstr, curtstr, curastr, curcstr, curnstr, curmstr, curmestr };
-
- for(int i=0; i<A.length; i++){
- if(B[i] != null){
- System.out.printf( "%s\n", B[i] );
- }
- else{
- System.out.printf( "%s\n", A[i] );
- }
-
- }
-
- return true;
- }
-
-
- public static String pstr = new String("ACTIVE_PLATFORM = ");
- public static String tstr = new String("TARGET = ");
- public static String astr = new String("TARGET_ARCH = ");
- public static String cstr = new String("TOOL_CHAIN_CONF = ");
- public static String nstr = new String("TOOL_CHAIN_TAG = ");
- public static String mstr = new String("MAX_CONCURRENT_THREAD_NUMBER = ");
- public static String mestr = new String("MULTIPLE_THREAD = ");
-
- public static String curpstr = null;
- public static String curtstr = null;
- public static String curastr = null;
- public static String curcstr = null;
- public static String curnstr = null;
- public static String curmstr = null;
- public static String curmestr = null;
-
- public static boolean npflag = false;
- public static boolean ntflag = false;
- public static boolean naflag = false;
- public static boolean ncflag = false;
- public static boolean nnflag = false;
- public static boolean nmflag = false;
- public static boolean nmeflag = false;
-
-}
diff --git a/Tools/Java/Source/ContextTool/org/tianocore/context/TargetFile.java b/Tools/Java/Source/ContextTool/org/tianocore/context/TargetFile.java
deleted file mode 100644
index 122adf03ce..0000000000
--- a/Tools/Java/Source/ContextTool/org/tianocore/context/TargetFile.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/** @file
- File is TargetFile class which is used to generate the new target.txt.
-
-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.
-**/
-package org.tianocore.context;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-
-public class TargetFile {
-
-
-
- /**
- * validate the filename
- * @param String filename : the name of target file
- *
- * @return true or false
- **/
- public static boolean validateFilename(String filename) {
-
- String workspacePath = System.getenv("WORKSPACE");
-
- Fd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename);
-
- if (Fd.exists() == true && Fd.canRead() == true)
- return true;
- else
- return false;
- }
-
-
- /**
- * create a empty temp file, which is located at the same directory with target file
- * @param String filename : the name of target temp file
- * @return true or false
- **/
- public static boolean createTempFile(String filename) {
-
- String workspacePath = System.getenv("WORKSPACE");
-
- TempFd = new File(workspacePath + File.separator + "Tools" + File.separator + "Conf" + File.separator + filename + "tmp");
-
- if (TempFd.exists() == true) {
- if (TempFd.delete() == false) {
- System.out.printf("%n%s%n", "target.txttmp has been existed, and failed in deletion!");
- return false;
- }
- }
- try {
- TempFd.createNewFile();
- } catch (IOException e) {
- System.out.printf("%n%s%n", "Failed in creation of the temp file:target.txttmp!");
- return false;
- }
-
- return true;
- }
-
- /**
- * read from target.txt and write to target.txttmp, del target.txt, rename
- * @param no paremeter
- * @return true or false
- **/
- public static boolean readwriteFile() {
-
- if (Fd.canRead() != true)
- return false;
-
- BufferedReader br = null;
- BufferedWriter bw = null;
- String textLine = null;
-
- try {
- br = new BufferedReader(new FileReader(Fd));
- } catch (FileNotFoundException e) {
- System.out
- .println("\n# Creating BufferedReader fail!");
- return false;
- }
- try {
- bw = new BufferedWriter(new FileWriter(TempFd));
- } catch (IOException e) {
- System.out.println("\n# Creating the BufferedWriter fail!");
- return false;
- }
-
- //
- //TARGET_ARCH must be in front of TARGET!!! according to the target.txt
- //
- try {
- while ((textLine = br.readLine()) != null) {
- //
- // the line is composed of Space
- //
- if (textLine.trim().compareToIgnoreCase("") == 0) {
- bw.write(textLine);
- bw.newLine();
- }
- //
- // the line starts with "#", and no "="
- //
- else if ((textLine.trim().charAt(0) == '#') && (textLine.indexOf("=") == -1)){
- bw.write(textLine);
- bw.newLine();
- } else {
- //
- //modify at the first time, and there should be "*ACTIVE_PLATFORM*=*" in the line
- //
- if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
- if(pflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.npflag == true) {
- bw.write(ParseParameter.curpstr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- pflag = false;
- continue;
- }
- if(ParseParameter.npflag == true) {
- bw.write(ParseParameter.curpstr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- pflag = false;
- }
- } else if (textLine.indexOf("TARGET_ARCH") != -1) {
- if(aflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.naflag == true) {
- bw.write(ParseParameter.curastr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- aflag = false;
- continue;
- }
- if(ParseParameter.naflag == true) {
- bw.write(ParseParameter.curastr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- aflag = false;
- }
- } else if (textLine.indexOf("TARGET") != -1) {
- if(tflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.ntflag == true) {
- bw.write(ParseParameter.curtstr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- tflag = false;
- continue;
- }
- if(ParseParameter.ntflag == true) {
- bw.write(ParseParameter.curtstr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- tflag = false;
- }
- } else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
- if(cflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.ncflag == true) {
- bw.write(ParseParameter.curcstr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- cflag = false;
- continue;
- }
- if(ParseParameter.ncflag == true) {
- bw.write(ParseParameter.curcstr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- cflag = false;
- }
- } else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
- if(nflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.nnflag == true) {
- bw.write(ParseParameter.curnstr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- nflag = false;
- continue;
- }
- if(ParseParameter.nnflag == true) {
- bw.write(ParseParameter.curnstr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- nflag = false;
- }
- } else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
- if(mflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.nmflag == true) {
- bw.write(ParseParameter.curmstr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- mflag = false;
- continue;
- }
- if(ParseParameter.nmflag == true) {
- bw.write(ParseParameter.curmstr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- mflag = false;
- }
- }else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
- if(meflag == true){
- if(textLine.trim().charAt(0) == '#'){
- if(ParseParameter.nmeflag == true) {
- bw.write(ParseParameter.curmestr);
- }else{
- bw.write(textLine);
- }
- bw.newLine();
- meflag = false;
- continue;
- }
- if(ParseParameter.nmeflag == true) {
- bw.write(ParseParameter.curmestr);
- } else {
- bw.write(textLine);
- }
- bw.newLine();
- meflag = false;
- }
- }
- }
- }
- //
- //user maybe delete the line *ACTIVE_PLATFORM*=*
- //
- if( (pflag == true) && (ParseParameter.npflag == true) ){
- bw.write(ParseParameter.curpstr);
- bw.newLine();
- } else if ( (tflag == true) && (ParseParameter.ntflag == true) ){
- bw.write(ParseParameter.curtstr);
- bw.newLine();
- } else if ( (aflag == true) && (ParseParameter.naflag == true) ){
- bw.write(ParseParameter.curastr);
- bw.newLine();
- } else if ( (cflag == true) && (ParseParameter.ncflag == true) ){
- bw.write(ParseParameter.curcstr);
- bw.newLine();
- } else if ( (nflag == true) && (ParseParameter.nnflag == true) ){
- bw.write(ParseParameter.curnstr);
- bw.newLine();
- } else if ( (meflag == true) && (ParseParameter.nmeflag == true) ){
- bw.write(ParseParameter.curmestr);
- bw.newLine();
- } else if ( (mflag == true) && (ParseParameter.nmflag == true) ){
- bw.write(ParseParameter.curmstr);
- bw.newLine();
- }
- } catch (IOException e) {
- System.out.println("\n# Reading or Writing file fail!");
- return false;
- }
-
- try {
- br.close();
- bw.close();
- } catch (IOException e) {
- System.out
- .println("\n# Closing BufferedReader&BufferedWriter fail!");
- return false;
- }
-
- if (Fd.delete() == false) {
- System.out.println("\n# Deleting file fail!");
- return false;
- }
- if (TempFd.renameTo(Fd) == false) {
- System.out.println("\n# Renaming file failed!");
- return false;
- }
-
- return true;
- }
-
- /**
- * read the file and output the lines which include setting
- * @param File fd : the File of the target file
- * @return String: the current setting
- **/
- public static boolean readFile() {
-
- BufferedReader br = null;
- String textLine = null;
-
- try {
- br = new BufferedReader(new FileReader(Fd));
- } catch (FileNotFoundException e) {
- System.out
- .println("\n# Creating BufferedReader fail!");
- return false;
- }
- try {
- while ((textLine = br.readLine()) != null) {
- //
- // the line is composed of Space
- //
- if (textLine.trim().compareToIgnoreCase("") == 0) {
- continue;
- }
- //
- // the line starts with "#"
- //
- else if ((textLine.trim().charAt(0) == '#')){
- continue;
- } else {
- if (textLine.indexOf("ACTIVE_PLATFORM") != -1) {
- ParseParameter.curpstr = textLine;
- } else if (textLine.indexOf("TARGET_ARCH") != -1) {
- ParseParameter.curastr = textLine;
- } else if (textLine.indexOf("TARGET") != -1) {
- ParseParameter.curtstr = textLine;
- } else if (textLine.indexOf("TOOL_CHAIN_CONF") != -1) {
- ParseParameter.curcstr = textLine;
- } else if (textLine.indexOf("TOOL_CHAIN_TAG") != -1) {
- ParseParameter.curnstr = textLine;
- } else if (textLine.indexOf("MAX_CONCURRENT_THREAD_NUMBER") != -1) {
- ParseParameter.curmstr = textLine;
- } else if (textLine.indexOf("MULTIPLE_THREAD") != -1) {
- ParseParameter.curmestr = textLine;
- }
- }
- }
- } catch (IOException e) {
- System.out.println("\n# Reading file fail!");
- return false;
- }
-
- try {
- br.close();
- } catch (IOException e) {
- System.out
- .println("\n# Closing BufferedReader fail!");
- return false;
- }
- return true;
- }
-
-
- ///
- /// point to target.txttmp, a temp file, which is created and deleted during the tool's runtime.
- ///
- private static File TempFd;
-
- ///
- /// point to target.txt.
- ///
- private static File Fd;
-
- ///
- /// when the flag is true, the corresponding str should be add at the end of file.
- ///
- private static boolean pflag = true;
- private static boolean tflag = true;
- private static boolean aflag = true;
- private static boolean cflag = true;
- private static boolean nflag = true;
- private static boolean mflag = true;
- private static boolean meflag = true;
-
-
-}
diff --git a/Tools/Java/Source/Cpptasks/CppTasks.msa b/Tools/Java/Source/Cpptasks/CppTasks.msa
deleted file mode 100644
index 550f9e2182..0000000000
--- a/Tools/Java/Source/Cpptasks/CppTasks.msa
+++ /dev/null
@@ -1,219 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>CppTasks</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>A1DF0266-4962-478e-83C0-F84BE46F11FE</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano Tool CppTasks</Abstract>
- <Description>
- This is a customized cpptasks which includes EFI extensions for
- static and dynamic linking, assembly and acp compiles
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>cpptasks.mf</Filename>
- <Filename>cpptasks.tasks</Filename>
- <Filename>cpptasks.types</Filename>
- <Filename>javadoc.xml</Filename>
- <Filename>net/sf/antcontrib/cpptasks/AboutCCTask.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ArchEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/arm/ADSCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/arm/ADSLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/arm/ADSLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/AslcompilerDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/AslcompilerEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/AssemblerDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/AssemblerEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandCfgParser.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/BorlandResourceCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/CfgFilenameState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/ConsumeToSpaceOrNewLine.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/borland/QuoteBranchState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CCTask.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CCTaskProgressMonitor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AbstractAslcompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AbstractAssembler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/Aslcompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AslcompilerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/Assembler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/AssemblerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CaptureStreamHandler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineAssembler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineAssemblerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/Compiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/CompilerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/LinkType.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/PrecompilingCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/Processor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/ProcessorConfiguration.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/compiler/ProgressMonitor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CompilerDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CompilerEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CompilerParam.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CPUEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/CUtil.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/DependencyInfo.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/DependencyTable.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioAslcompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioAssembler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioMIDLCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/DistributerDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/DistributerMap.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/DistributerProtocolEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/FileVisitor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/GccCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/GccLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/GccLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/GccProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/GppLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/LdLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GppLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/LdLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccAssembler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GccProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/GppLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/gcc/LdLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/hp/aCCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/hp/aCCLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelWin32Aslcompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/LinkerDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/LinkerEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/LinkerParam.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ObjectFileCollector.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/OptimizationEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os390/OS390CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os390/OS390Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os390/OS390Processor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os400/IccCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os400/IccLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/os400/IccProcessor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/OSFamilyEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/OutputTypeEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/AbstractParser.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/AbstractParserState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/BranchState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/CaseInsensitiveLetterState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/CParser.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/FilenameState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/FortranParser.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/LetterState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/Parser.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/PostE.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/WhitespaceOrCaseInsensitiveLetterState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/parser/WhitespaceOrLetterState.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/PrecompileDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/PrecompileExceptDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ProcessorDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ProcessorEnumValue.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ProcessorParam.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/RuntimeType.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/SourceHistory.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/SubsystemEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/sun/C89CCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/sun/C89Linker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/sun/C89Processor.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/sun/ForteCCLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/TargetDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/TargetHistory.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/TargetHistoryTable.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/TargetInfo.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/TargetMatcher.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ti/ClxxCCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ti/ClxxLibrarian.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/ti/ClxxLinker.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/AssemblerArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/CommandLineArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/CompilerArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/ConditionalPath.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/DefineArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/DefineSet.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/FlexLong.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/IncludePath.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/LibrarySet.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/LinkerArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/SystemIncludePath.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/types/UndefineArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/userdefine/UserDefineArgument.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/userdefine/UserDefineCompiler.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java</Filename>
- <Filename>net/sf/antcontrib/cpptasks/VersionInfo.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/Cpptasks/build.xml b/Tools/Java/Source/Cpptasks/build.xml
deleted file mode 100644
index ce040e6ac7..0000000000
--- a/Tools/Java/Source/Cpptasks/build.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<?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="CppTasks" default="CppTasks" 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="CppTasks" depends="install"/>
- <target name="init">
- <uptodate property="jar.newer" targetfile="${installLocation}/cpptasks.jar">
- <srcfiles dir="net" includes="**"/>
- </uptodate>
- </target>
- <target name="source" depends="init" unless="jar.newer">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="net" destdir="${buildDir}" source="1.4">
- <classpath>
- <fileset dir="${WORKSPACE}/Tools/Jars">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/Cpptasks" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: cpptasks.jar"/>
- <delete file="${installLocation}/cpptasks.jar"/>
- <if>
- <available file="${installLocation}/cpptasks.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/cpptasks.jar"/>
- <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>
- </then>
- </if>
- </target>
- <target name="install" depends="source" unless="jar.newer">
- <copy file="cpptasks.tasks" toDir="${buildDir}"/>
- <copy file="cpptasks.types" toDir="${buildDir}"/>
- <jar destfile="${installLocation}/cpptasks.jar"
- basedir="${buildDir}"
- includes="**"
- />
- </target>
-</project>
diff --git a/Tools/Java/Source/Cpptasks/cpptasks.mf b/Tools/Java/Source/Cpptasks/cpptasks.mf
deleted file mode 100644
index a2bf638932..0000000000
--- a/Tools/Java/Source/Cpptasks/cpptasks.mf
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 2.0
-Main-Class: net.sf.antcontrib.cpptasks.AboutCCTask
-
-Name: CCTask
-Implementation-Vendor: Ant-Contrib project
-Implementation-Version: 1.0
-Implementation-Title: Compile and link tasks for Apache Ant
diff --git a/Tools/Java/Source/Cpptasks/cpptasks.tasks b/Tools/Java/Source/Cpptasks/cpptasks.tasks
deleted file mode 100644
index f34458374f..0000000000
--- a/Tools/Java/Source/Cpptasks/cpptasks.tasks
+++ /dev/null
@@ -1 +0,0 @@
-cc=net.sf.antcontrib.cpptasks.CCTask
diff --git a/Tools/Java/Source/Cpptasks/cpptasks.types b/Tools/Java/Source/Cpptasks/cpptasks.types
deleted file mode 100644
index 65af6e66c6..0000000000
--- a/Tools/Java/Source/Cpptasks/cpptasks.types
+++ /dev/null
@@ -1,9 +0,0 @@
-defineset=net.sf.antcontrib.cpptasks.types.DefineSet
-compiler=net.sf.antcontrib.cpptasks.CompilerDef
-linker=net.sf.antcontrib.cpptasks.LinkerDef
-assembler=net.sf.antcontrib.cpptasks.AssemblerDef
-aslcompiler=net.sf.antcontrib.cpptasks.AslcompilerDef
-targetplatform=net.sf.antcontrib.cpptasks.TargetDef
-versioninfo=net.sf.antcontrib.cpptasks.VersionInfo
-distributer=net.sf.antcontrib.cpptasks.DistributerDef
-command=net.sf.antcontrib.cpptasks.userdefine.UserDefineDef \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/javadoc.xml b/Tools/Java/Source/Cpptasks/javadoc.xml
deleted file mode 100644
index f0ca9648e9..0000000000
--- a/Tools/Java/Source/Cpptasks/javadoc.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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 default="javadoc">
-<target name="javadoc">
-
- <javadoc packagenames="net.sf.antcontrib.*"
- useexternalfile="yes"
- sourcepath="."
- destdir="doc"
- author="true"
- version="true"
- source="1.3"
- locale="en_US"
- windowtitle="cpptasks API"
- doctitle="cpptasks">
- <group title="CCTasks" packages="net.sf.antcontrib.cpptasks" />
-
- <bottom>Copyright @2001-2005 Ant-Contrib project. All Rights Reserved.</bottom>
-</javadoc>
-</target>
-</project>
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AboutCCTask.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AboutCCTask.java
deleted file mode 100644
index 67757bbf87..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AboutCCTask.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-/**
- * The equivalent of a Help About
- * run "java -jar cpptasks.jar" to read
- *
- * @author Curt Arnold
- */
-public class AboutCCTask {
- /**
- * display identification message and exit
- *
- * @param args ignored
- */
- public static void main(String args[]) {
- System.out.println("CCTask: Compile and link task for Apache Ant 1.5 or later\n");
- System.out.println("Copyright (c) 2002-2004, The Ant-Contrib project.\n");
- System.out.println("http://sf.net/projects/ant-contrib\n");
- System.out.println("Licensed under the Apache Software License 2.0");
- System.out.println("available at http://www.apache.org/licenses/LICENSE-2.0\n");
- System.out.println("This software is not a product of the");
- System.out.println("of the Apache Software Foundation and no");
- System.out.println("endorsement or promotion is implied.\n");
- System.out.println("THIS SOFTWARE IS PROVIDED 'AS-IS', See");
- System.out.println("http://www.apache.org/LICENSE for additional");
- System.out.println("disclaimers.\n");
- System.out.println("To use:");
- System.out.println("\tPlace cpptasks.jar into lib directory of Ant 1.5 or later.");
- System.out.println("\tAdd <taskdef resource=\"cpptasks.tasks\"/> and");
- System.out.println("\t\t<typedef resource=\"cpptasks.types\"/> to build.xml");
- System.out.println("Add <cc/>, <compiler/>, <linker/>, <assembler/> and <aslcompiler> elements.");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ArchEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ArchEnum.java
deleted file mode 100644
index e219ad6871..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ArchEnum.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of cpu architecture types.
- *
- * @author Curt Arnold
- *
- */
-public final class ArchEnum
- extends EnumeratedAttribute {
- /**
- * Constructor.
- *
- * Set by default to "pentium3"
- *
- * @see java.lang.Object#Object()
- */
- public ArchEnum() {
- setValue("pentium3");
- }
-
- /**
- * Gets list of acceptable values.
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- /**
- * Class initializer.
- */
- return new String[] {
- "i386",
- "i486",
- "i586",
- "i686",
- "pentium",
- "pentium-mmx",
- "pentiumpro",
- "pentium2",
- "pentium3",
- "pentium4",
- "k6",
- "k6-2",
- "k6-3",
- "athlon",
- "athlon-tbird",
- "athlon-4",
- "athlon-xp",
- "athlon-mp",
- "winchip-c6",
- "winchip2",
- "c3"};
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerDef.java
deleted file mode 100644
index f69d3fde63..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerDef.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import net.sf.antcontrib.cpptasks.compiler.Aslcompiler;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.intel.IntelWin32Aslcompiler;
-import net.sf.antcontrib.cpptasks.types.AslcompilerArgument;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- * A asl compiler definition. asl compiler elements may be placed either as
- * children of a cc element or the project element. A asl compiler element with
- * an id attribute may be referenced from asl compiler elements with refid or
- * extends attributes.
- *
- */
-public final class AslcompilerDef extends ProcessorDef {
-
- private Boolean defaultflag = new Boolean(true);
-
- public AslcompilerDef () {
- }
-
- /**
- * Adds a asl compiler command-line arg.
- */
- public void addConfiguredAslcompilerArg(AslcompilerArgument arg) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorArg(arg);
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- public final Boolean getDefaultflag(AslcompilerDef[] defaultProviders,
- int index) {
- if (isReference()) {
- return ((AslcompilerDef) getCheckedRef(AslcompilerDef.class,
- "AslcompilerDef")).getDefaultflag(defaultProviders,
- index);
- }
- return defaultflag;
- }
-
- public Processor getProcessor() {
- Processor processor = super.getProcessor();
- if (processor == null) {
- processor = IntelWin32Aslcompiler.getInstance();
- }
- return processor;
- }
-
- /**
- * Sets r type.
- *
- * <table width="100%" border="1"> <thead>Supported ASL Compilers</thead>
- * <tr>
- * <td>iasl (default)</td>
- * <td>Intel ACPI Source Language</td>
- * </tr>
- * <tr>
- * <td>asl</td>
- * <td>Microsoft ACPI Source Language</td>
- * </tr>
- * </table>
- *
- */
- public void setName(AslcompilerEnum name) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- Aslcompiler aslcompiler = name.getAslcompiler();
- setProcessor(aslcompiler);
- }
-
- protected void setProcessor(Processor proc) throws BuildException {
- try {
- super.setProcessor((Aslcompiler) proc);
- } catch (ClassCastException ex) {
- throw new BuildException(ex);
- }
- }
-
- /**
- * Enables or disables default flags.
- *
- * @param defaultflag
- * if true, default flags will add to command line.
- *
- */
- public void setDefaultflag(boolean defaultflag) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.defaultflag = booleanValueOf(defaultflag);
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerEnum.java
deleted file mode 100644
index fa9806916f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AslcompilerEnum.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import net.sf.antcontrib.cpptasks.compiler.Aslcompiler;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioAslcompiler;
-import net.sf.antcontrib.cpptasks.intel.IntelWin32Aslcompiler;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of supported ASL Compilers
- *
- * <table width="100%" border="1"> <thead>Supported ASL Compilers </thead>
- * <tr>
- * <td>iasl (default)</td>
- * <td>Intel ACPI Source Language</td>
- * </tr>
- * <tr>
- * <td>asl</td>
- * <td>Microsoft ACPI Source Language</td>
- * </tr>
- * </table>
- *
- */
-public class AslcompilerEnum extends EnumeratedAttribute {
- private final static ProcessorEnumValue[] aslcompiler = new ProcessorEnumValue[] {
- new ProcessorEnumValue("iasl", IntelWin32Aslcompiler
- .getInstance()),
- new ProcessorEnumValue("asl", DevStudioAslcompiler
- .getInstance()), };
-
- public Aslcompiler getAslcompiler() {
- return (Aslcompiler) aslcompiler[getIndex()].getProcessor();
- }
-
- public String[] getValues() {
- return ProcessorEnumValue.getValues(aslcompiler);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerDef.java
deleted file mode 100644
index aeae215780..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerDef.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.Assembler;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.gcc.GccAssembler;
-import net.sf.antcontrib.cpptasks.types.AssemblerArgument;
-import net.sf.antcontrib.cpptasks.types.ConditionalPath;
-import net.sf.antcontrib.cpptasks.types.IncludePath;
-import net.sf.antcontrib.cpptasks.types.SystemIncludePath;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-
-/**
- * A assembler definition. Assembler elements may be placed either as children
- * of a cc element or the project element. A assembler element with an id
- * attribute may be referenced from assembler elements with refid or extends
- * attributes.
- *
- */
-public final class AssemblerDef extends ProcessorDef {
-
- private final Vector includePaths = new Vector();
-
- private final Vector sysIncludePaths = new Vector();
-
- private Boolean defaultflag = new Boolean(true);
-
- public AssemblerDef () {
- }
-
- /**
- * Adds a assembler command-line arg.
- */
- public void addConfiguredAssemblerArg(AssemblerArgument arg) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorArg(arg);
- }
-
- /**
- * Creates an include path.
- */
- public IncludePath createIncludePath() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- IncludePath path = new IncludePath(p);
- includePaths.addElement(path);
- return path;
- }
-
- /**
- * Creates an include path.
- */
- public SystemIncludePath createSysIncludePath() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- SystemIncludePath path = new SystemIncludePath(p);
- sysIncludePaths.addElement(path);
- return path;
- }
-
- /**
- * Add a <includepath>or <sysincludepath> if specify the file attribute
- *
- * @throws BuildException
- * if the specify file not exist
- */
- protected void loadFile(Vector activePath, File file) throws BuildException {
- FileReader fileReader;
- BufferedReader in;
- String str;
- if (!file.exists()) {
- throw new BuildException("The file " + file + " is not existed");
- }
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
- while ((str = in.readLine()) != null) {
- if (str.trim() == "") {
- continue;
- }
- str = getProject().replaceProperties(str);
- activePath.addElement(str.trim());
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- /**
- * Returns the assembler-specific include path.
- */
- public String[] getActiveIncludePaths() {
- if (isReference()) {
- return ((AssemblerDef) getCheckedRef(AssemblerDef.class,
- "AssemblerDef")).getActiveIncludePaths();
- }
- return getActivePaths(includePaths);
- }
-
- /**
- * Returns the assembler-specific sysinclude path.
- */
- public String[] getActiveSysIncludePaths() {
- if (isReference()) {
- return ((AssemblerDef) getCheckedRef(AssemblerDef.class,
- "AssemblerDef")).getActiveSysIncludePaths();
- }
- return getActivePaths(sysIncludePaths);
- }
-
- private String[] getActivePaths(Vector paths) {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project not set");
- }
- Vector activePaths = new Vector(paths.size());
- for (int i = 0; i < paths.size(); i++) {
- ConditionalPath path = (ConditionalPath) paths.elementAt(i);
- if (path.isActive(p)) {
- if (path.getFile() == null) {
- String[] pathEntries = path.list();
- for (int j = 0; j < pathEntries.length; j++) {
- activePaths.addElement(pathEntries[j]);
- }
- } else {
- loadFile(activePaths, path.getFile());
- }
- }
- }
- String[] pathNames = new String[activePaths.size()];
- activePaths.copyInto(pathNames);
- return pathNames;
- }
-
- public final Boolean getDefaultflag(AssemblerDef[] defaultProviders,
- int index) {
- if (isReference()) {
- return ((AssemblerDef) getCheckedRef(AssemblerDef.class,
- "AssemblerDef")).getDefaultflag(defaultProviders,
- index);
- }
- return defaultflag;
- }
-
- public Processor getProcessor() {
- Processor processor = super.getProcessor();
- if (processor == null) {
- processor = GccAssembler.getInstance();
- }
- return processor;
- }
-
- /**
- * Sets r type.
- *
- * <table width="100%" border="1"> <thead>Supported assemblers</thead>
- * <tr>
- * <td>gcc (default)</td>
- * <td>GAS assembler</td>
- * </tr>
- * <tr>
- * <td>masm</td>
- * <td>MASM assembler</td>
- * </tr>
- * </table>
- *
- */
- public void setName(AssemblerEnum name) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- Assembler assembler = name.getAssembler();
- setProcessor(assembler);
- }
-
- protected void setProcessor(Processor proc) throws BuildException {
- try {
- super.setProcessor((Assembler) proc);
- } catch (ClassCastException ex) {
- throw new BuildException(ex);
- }
- }
-
- /**
- * Enables or disables default flags.
- *
- * @param defaultflag
- * if true, default flags will add to command line.
- *
- */
- public void setDefaultflag(boolean defaultflag) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.defaultflag = booleanValueOf(defaultflag);
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerEnum.java
deleted file mode 100644
index 9abf9f496d..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/AssemblerEnum.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import net.sf.antcontrib.cpptasks.compiler.Assembler;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioAssembler;
-import net.sf.antcontrib.cpptasks.gcc.GccAssembler;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of supported assemblers
- *
- * <table width="100%" border="1"> <thead>Supported assemblers </thead>
- * <tr>
- * <td>gas (default)</td>
- * <td>GAS assembler</td>
- * </tr>
- * <tr>
- * <td>masm</td>
- * <td>MASM assembler</td>
- * </tr>
- * </table>
- *
- */
-public class AssemblerEnum extends EnumeratedAttribute {
- private final static ProcessorEnumValue[] assemblers = new ProcessorEnumValue[] {
- new ProcessorEnumValue("gas", GccAssembler.getInstance()),
- new ProcessorEnumValue("masm", DevStudioAssembler
- .getInstance()), };
-
- public Assembler getAssembler() {
- return (Assembler) assemblers[getIndex()].getProcessor();
- }
-
- public String[] getValues() {
- return ProcessorEnumValue.getValues(assemblers);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTask.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTask.java
deleted file mode 100644
index d044df1288..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTask.java
+++ /dev/null
@@ -1,1749 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.AslcompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.AssemblerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.CompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.LinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-import net.sf.antcontrib.cpptasks.types.AslcompilerArgument;
-import net.sf.antcontrib.cpptasks.types.AssemblerArgument;
-import net.sf.antcontrib.cpptasks.types.CompilerArgument;
-import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
-import net.sf.antcontrib.cpptasks.types.DefineSet;
-import net.sf.antcontrib.cpptasks.types.IncludePath;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LinkerArgument;
-import net.sf.antcontrib.cpptasks.types.SystemIncludePath;
-import net.sf.antcontrib.cpptasks.types.SystemLibrarySet;
-import net.sf.antcontrib.cpptasks.userdefine.UserDefineCompiler;
-import net.sf.antcontrib.cpptasks.userdefine.UserDefineDef;
-import net.sf.antcontrib.cpptasks.VersionInfo;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.types.Environment;
-
-/**
- * Compile, link, assembler and asl compile task.
- *
- * <p>
- * This task can compile various source languages and produce executables,
- * shared libraries (aka DLL's) and static libraries. Compiler adaptors are
- * currently available for several C/C++ compilers, FORTRAN, MIDL and Windows
- * Resource files. Assembler adaptors are currently available for MASM and GAS.
- * And aslcompiler support to ASL and IASL command.
- * </p>
- *
- *
- * <p>
- * Copyright (c) 2001-2005, The Ant-Contrib project.
- * </p>
- *
- * <p>
- * Licensed under the Apache Software License 2.0,
- * http://www.apache.org/licenses/LICENSE-2.0.
- * </p>
- *
- * <p>
- * For use with Apache Ant 1.5 or later. This software is not a product of the
- * of the Apache Software Foundation and no endorsement is implied.
- * </p>
- *
- * <p>
- * THIS SOFTWARE IS PROVIDED 'AS-IS', See
- * http://www.apache.org/licenses/LICENSE-2.0 for additional disclaimers.
- * </p>
- *
- * To use:
- * <ol>
- * <li>Place cpptasks.jar into the lib directory of Ant 1.5 or later.</li>
- * <li>Add &lt;taskdef resource="cpptasks.tasks"/&gt; and &lt;typedef
- * resource="cpptasks.types"/&gt; to build.xml.</li>
- * <li>Add &lt;cc/&gt;, &lt;compiler/&gt; &lt;linker/&gt; &lt;assembler/&gt;
- * and &lt;aslcompiler/&gt elements to project.</li>
- * <li>Set path and environment variables to be able to run compiler from
- * command line.</li>
- * <li>Build project.</li>
- * </ol>
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public class CCTask extends Task {
- private class SystemLibraryCollector implements FileVisitor {
- private Hashtable libraries;
-
- private Linker linker;
-
- public SystemLibraryCollector (Linker linker, Hashtable libraries) {
- this.linker = linker;
- this.libraries = libraries;
- }
-
- public void visit(File basedir, String filename) {
- if (linker.bid(filename) > 0) {
- File libfile = new File(basedir, filename);
- String key = linker.getLibraryKey(libfile);
- libraries.put(key, libfile);
- }
- }
- }
-
- private static final ProcessorConfiguration[] EMPTY_CONFIG_ARRAY = new ProcessorConfiguration[0];
-
- /**
- * Builds a Hashtable to targets needing to be rebuilt keyed by compiler
- * configuration
- */
- public static Hashtable getTargetsToBuildByConfiguration(Hashtable targets) {
- Hashtable targetsByConfig = new Hashtable();
- Enumeration targetEnum = targets.elements();
- while (targetEnum.hasMoreElements()) {
- TargetInfo target = (TargetInfo) targetEnum.nextElement();
- if (target.getRebuild()) {
- Vector targetsForSameConfig = (Vector) targetsByConfig
- .get(target.getConfiguration());
- if (targetsForSameConfig != null) {
- targetsForSameConfig.addElement(target);
- } else {
- targetsForSameConfig = new Vector();
- targetsForSameConfig.addElement(target);
- targetsByConfig.put(target.getConfiguration(),
- targetsForSameConfig);
- }
- }
- }
- return targetsByConfig;
- }
-
- /** The userdefine definitions. */
- private Vector _userdefines = new Vector();
-
- /** The compiler definitions. */
- private Vector _compilers = new Vector();
-
- /** The output file type. */
- // private LinkType _linkType = LinkType.EXECUTABLE;
- /** The library sets. */
- private Vector _libsets = new Vector();
-
- /** The aslcompiler definitions. */
- private Vector _aslcompiler = new Vector();
-
- /** The assembler definitions. */
- private Vector _assemblers = new Vector();
-
- /** The linker definitions. */
- private Vector _linkers = new Vector();
-
- /** The object directory. */
- private File _objDir;
-
- /** The output file. */
- private File _outfile;
-
- private boolean userdefine = false;
- private String arch;
- private String os;
- private String vendor;
-
- /** the flag for assembler */
- private boolean assembler = true;
-
- /** the flag for aslcompiler */
- private boolean aslcompiler = true;
-
- /** The linker definitions. */
- private final Vector targetPlatforms = new Vector();
-
- /** The distributer definitions. */
- private Vector distributers = new Vector();
-
- /**
- * If true, stop build on compile failure.
- */
- protected boolean failOnError = true;
-
- /**
- * Content that appears in <cc>and also in <compiler>are maintained by a
- * captive CompilerDef instance
- */
- private final CompilerDef compilerDef = new CompilerDef();
-
- /**
- * Content that appears in <cc>and also in <aslcompiler>are maintained by a
- * captive AslcompilerDef instance
- */
- private final AslcompilerDef aslcompilerDef = new AslcompilerDef();
-
- /** The OS390 dataset to build to object to */
- private String dataset;
-
- /**
- *
- * Depth of dependency checking
- *
- * Values < 0 indicate full dependency checking Values >= 0 indicate partial
- * dependency checking and for superficial compilation checks. Will throw
- * BuildException before attempting link
- */
- private int dependencyDepth = -1;
-
- /**
- * Content that appears in <cc>and also in <assembler>are maintained by a
- * captive AssemblerDef instance
- */
- private final AssemblerDef assemblerDef = new AssemblerDef();
-
- /**
- * Content that appears in <cc>and also in <linker>are maintained by a
- * captive CompilerDef instance
- */
- private final LinkerDef linkerDef = new LinkerDef();
-
- /**
- * contains the subsystem, output type and
- *
- */
- private final LinkType linkType = new LinkType();
-
- /**
- * The property name which will be set with the physical filename of the
- * file that is generated by the linker
- */
- private String outputFileProperty;
-
- /**
- * if relentless = true, compilations should attempt to compile as many
- * files as possible before throwing a BuildException
- */
- private boolean relentless;
-
- public CCTask () {
- }
-
-
- public void addConfiguredCommand(UserDefineDef userdefineDef) {
- if (userdefineDef == null) {
- throw new NullPointerException("UserDefineDef");
- }
- userdefineDef.setProject(getProject());
- _userdefines.addElement(userdefineDef);
- }
- /**
- * Adds a asl compiler definition or reference.
- *
- * @param Aslcompiler
- * aslcompiler
- * @throws NullPointerException
- * if aslcompiler is null
- */
- public void addConfiguredAslcompiler(AslcompilerDef aslcompier) {
- if (aslcompier == null) {
- throw new NullPointerException("aslcompier");
- }
- aslcompier.setProject(getProject());
- _aslcompiler.addElement(aslcompier);
- }
-
- /**
- * Adds a asl command-line arg. Argument will be inherited by all nested
- * aslcompiler elements that do not have inherit="false".
- *
- */
- public void addConfiguredAslcompilerArg(AslcompilerArgument arg) {
- aslcompilerDef.addConfiguredAslcompilerArg(arg);
- }
-
- /**
- * Adds a assembler definition or reference.
- *
- * @param assembler
- * assemblera
- * @throws NullPointerException
- * if assembler is null
- */
- public void addConfiguredAssembler(AssemblerDef assembler) {
- if (assembler == null) {
- throw new NullPointerException("assembler");
- }
- assembler.setProject(getProject());
- _assemblers.addElement(assembler);
- }
-
- /**
- * Adds a assembler command-line arg. Argument will be inherited by all
- * nested assembler elements that do not have inherit="false".
- *
- */
- public void addConfiguredAssemblerArg(AssemblerArgument arg) {
- assemblerDef.addConfiguredAssemblerArg(arg);
- }
-
- /**
- * Adds a compiler definition or reference.
- *
- * @param compiler
- * compiler
- * @throws NullPointerException
- * if compiler is null
- */
- public void addConfiguredCompiler(CompilerDef compiler) {
- if (compiler == null) {
- throw new NullPointerException("compiler");
- }
- compiler.setProject(getProject());
- _compilers.addElement(compiler);
- }
-
- /**
- * Adds a compiler command-line arg. Argument will be inherited by all
- * nested compiler elements that do not have inherit="false".
- *
- */
- public void addConfiguredCompilerArg(CompilerArgument arg) {
- compilerDef.addConfiguredCompilerArg(arg);
- }
-
- /**
- * Adds a defineset. Will be inherited by all compiler elements that do not
- * have inherit="false".
- *
- * @param defs
- * Define set
- */
- public void addConfiguredDefineset(DefineSet defs) {
- compilerDef.addConfiguredDefineset(defs);
- }
-
- /**
- * Adds a linker definition. The first linker that is not disqualified by
- * its "if" and "unless" attributes will perform the link. If no child
- * linker element is active, the linker implied by the cc elements name or
- * classname attribute will be used.
- *
- * @param linker
- * linker
- * @throws NullPointerException
- * if linker is null
- */
- public void addConfiguredLinker(LinkerDef linker) {
- if (linker == null) {
- throw new NullPointerException("linker");
- }
- linker.setProject(getProject());
- _linkers.addElement(linker);
- }
-
- /**
- * Adds a linker command-line arg. Argument will be inherited by all nested
- * linker elements that do not have inherit="false".
- */
- public void addConfiguredLinkerArg(LinkerArgument arg) {
- linkerDef.addConfiguredLinkerArg(arg);
- }
-
- /**
- * Add an environment variable to the launched process.
- */
- public void addEnv(Environment.Variable var) {
- compilerDef.addEnv(var);
- linkerDef.addEnv(var);
- assemblerDef.addEnv(var);
- aslcompilerDef.addEnv(var);
- }
-
- /**
- * Adds a source file set.
- *
- * Files in these filesets will be auctioned to the available compiler
- * configurations, with the default compiler implied by the cc element
- * bidding last. If no compiler is interested in the file, it will be passed
- * to the linker.
- *
- * To have a file be processed by a particular compiler configuration, add a
- * fileset to the corresponding compiler element.
- */
- public void addFileset(ConditionalFileSet srcSet) {
- compilerDef.addFileset(srcSet);
- }
-
- /**
- * Adds a library set.
- *
- * Library sets will be inherited by all linker elements that do not have
- * inherit="false".
- *
- * @param libset
- * library set
- * @throws NullPointerException
- * if libset is null.
- */
- public void addLibset(LibrarySet libset) {
- if (libset == null) {
- throw new NullPointerException("libset");
- }
- linkerDef.addLibset(libset);
- }
-
- /**
- * Adds a system library set. Timestamps and locations of system library
- * sets are not used in dependency analysis.
- *
- * Essential libraries (such as C Runtime libraries) should not be specified
- * since the task will attempt to identify the correct libraries based on
- * the multithread, debug and runtime attributes.
- *
- * System library sets will be inherited by all linker elements that do not
- * have inherit="false".
- *
- * @param libset
- * library set
- * @throws NullPointerException
- * if libset is null.
- */
- public void addSyslibset(SystemLibrarySet libset) {
- if (libset == null) {
- throw new NullPointerException("libset");
- }
- linkerDef.addSyslibset(libset);
- }
-
- /**
- * Checks all targets that are not forced to be rebuilt or are missing
- * object files to be checked for modified include files
- *
- * @returns total number of targets to be rebuilt
- *
- */
- protected int checkForChangedIncludeFiles(Hashtable targets) {
- int potentialTargets = 0;
- int definiteTargets = 0;
- Enumeration targetEnum = targets.elements();
- while (targetEnum.hasMoreElements()) {
- TargetInfo target = (TargetInfo) targetEnum.nextElement();
- if (!target.getRebuild()) {
- potentialTargets++;
- } else {
- definiteTargets++;
- }
- }
- //
- // If there were remaining targets that
- // might be out of date
- //
- if (potentialTargets > 0) {
- log("Starting dependency analysis for "
- + Integer.toString(potentialTargets) + " files.");
- DependencyTable dependencyTable = new DependencyTable(_objDir);
- try {
- dependencyTable.load();
- } catch (Exception ex) {
- log("Problem reading dependencies.xml: " + ex.toString());
- }
- targetEnum = targets.elements();
- while (targetEnum.hasMoreElements()) {
- TargetInfo target = (TargetInfo) targetEnum.nextElement();
- if (!target.getRebuild()) {
- if (dependencyTable.needsRebuild(this, target,
- dependencyDepth)) {
- target.mustRebuild();
- }
- }
- }
- dependencyTable.commit(this);
- }
- //
- // count files being rebuilt now
- //
- int currentTargets = 0;
- targetEnum = targets.elements();
- while (targetEnum.hasMoreElements()) {
- TargetInfo target = (TargetInfo) targetEnum.nextElement();
- if (target.getRebuild()) {
- currentTargets++;
- }
- }
- if (potentialTargets > 0) {
- log(Integer.toString(potentialTargets - currentTargets
- + definiteTargets)
- + " files are up to date.");
- log(Integer.toString(currentTargets - definiteTargets)
- + " files to be recompiled from dependency analysis.");
- }
- log(Integer.toString(currentTargets) + " total files to be compiled.");
- return currentTargets;
- }
-
- protected LinkerConfiguration collectExplicitObjectFiles(
- Vector objectFiles, Vector sysObjectFiles) {
- //
- // find the first eligible linker
- //
- //
- ProcessorConfiguration linkerConfig = null;
- LinkerDef selectedLinkerDef = null;
- Linker selectedLinker = null;
- Hashtable sysLibraries = new Hashtable();
- TargetDef targetPlatform = getTargetPlatform();
- FileVisitor objCollector = null;
- FileVisitor sysLibraryCollector = null;
- for (int i = 0; i < _linkers.size(); i++) {
- LinkerDef currentLinkerDef = (LinkerDef) _linkers.elementAt(i);
- if (currentLinkerDef.isActive()) {
- selectedLinkerDef = currentLinkerDef;
- selectedLinker = currentLinkerDef.getProcessor().getLinker(
- linkType);
- //
- // skip the linker if it doesn't know how to
- // produce the specified link type
- if (selectedLinker != null) {
- linkerConfig = currentLinkerDef.createConfiguration(this,
- linkType, linkerDef, targetPlatform);
- if (linkerConfig != null) {
- //
- // create collectors for object files
- // and system libraries
- objCollector = new ObjectFileCollector(selectedLinker,
- objectFiles);
- sysLibraryCollector = new SystemLibraryCollector(
- selectedLinker, sysLibraries);
- //
- // if the <linker> has embedded <fileset>'s
- // (such as linker specific libraries)
- // add them as object files.
- //
- if (currentLinkerDef.hasFileSets()) {
- currentLinkerDef.visitFiles(objCollector);
- }
- //
- // user libraries are just a specialized form
- // of an object fileset
- selectedLinkerDef.visitUserLibraries(selectedLinker,
- objCollector);
- }
- break;
- }
- }
- }
- if (linkerConfig == null) {
- linkerConfig = linkerDef.createConfiguration(this, linkType, null,
- targetPlatform);
- selectedLinker = (Linker) linkerDef.getProcessor().getLinker(
- linkType);
- objCollector = new ObjectFileCollector(selectedLinker, objectFiles);
- sysLibraryCollector = new SystemLibraryCollector(selectedLinker,
- sysLibraries);
- }
- //
- // unless there was a <linker> element that
- // explicitly did not inherit files from
- // containing <cc> element
- if (selectedLinkerDef == null || selectedLinkerDef.getInherit()) {
- linkerDef.visitUserLibraries(selectedLinker, objCollector);
- linkerDef.visitSystemLibraries(selectedLinker, sysLibraryCollector);
- }
- //
- // if there was a <syslibset> in a nested <linker>
- // evaluate it last so it takes priority over
- // identically named libs from <cc> element
- //
- if (selectedLinkerDef != null) {
- //
- // add any system libraries to the hashtable
- // done in reverse order so the earliest
- // on the classpath takes priority
- selectedLinkerDef.visitSystemLibraries(selectedLinker,
- sysLibraryCollector);
- }
- //
- // copy over any system libraries to the
- // object files vector
- //
- Enumeration sysLibEnum = sysLibraries.elements();
- while (sysLibEnum.hasMoreElements()) {
- sysObjectFiles.addElement(sysLibEnum.nextElement());
- }
- return (LinkerConfiguration) linkerConfig;
- }
-
- /**
- * Adds an include path.
- *
- * Include paths will be inherited by nested compiler elements that do not
- * have inherit="false".
- */
- public IncludePath createIncludePath() {
- return compilerDef.createIncludePath();
- }
-
- /**
- * Specifies precompilation prototype file and exclusions. Inherited by all
- * compilers that do not have inherit="false".
- *
- */
- public PrecompileDef createPrecompile() throws BuildException {
- return compilerDef.createPrecompile();
- }
-
- /**
- * Adds a system include path. Locations and timestamps of files located
- * using the system include paths are not used in dependency analysis.
- *
- *
- * Standard include locations should not be specified. The compiler adapters
- * should recognized the settings from the appropriate environment variables
- * or configuration files.
- *
- * System include paths will be inherited by nested compiler elements that
- * do not have inherit="false".
- */
- public SystemIncludePath createSysIncludePath() {
- return compilerDef.createSysIncludePath();
- }
-
- /**
- * Executes the task. Compiles the given files.
- *
- * @throws BuildException
- * if someting goes wrong with the build
- */
- public void execute() throws BuildException {
- //
- // if link type allowed objdir to be defaulted
- // provide it from outfile
- if (_objDir == null) {
- if (_outfile != null) {
- _objDir = new File(_outfile.getParent());
- } else {
- _objDir = new File(".");
- }
- }
-
- //
- // if the object directory does not exist
- //
- if (!_objDir.exists()) {
- throw new BuildException("Object directory does not exist");
- }
-
- //
- // if userdefine is true, then run all user defined command
- //
- if (userdefine) {
- Iterator iter = _userdefines.iterator();
- while( iter.hasNext()) {
- UserDefineDef userdefineDef = (UserDefineDef)iter.next();
- UserDefineCompiler userdefineCompiler = new UserDefineCompiler(this, userdefineDef);
- userdefineCompiler.command(this, userdefineDef);
- }
- return ;
- }
-
- TargetHistoryTable objHistory = new TargetHistoryTable(this, _objDir);
- //
- // determine the eventual linker configuration
- // (may be null) and collect any explicit
- // object files or libraries
- Vector objectFiles = new Vector();
- Vector sysObjectFiles = new Vector();
- LinkerConfiguration linkerConfig = collectExplicitObjectFiles(
- objectFiles, sysObjectFiles);
- //
- // Assembler hashtable of all files
- // that we know how to compile (keyed by output file name)
- //
- Hashtable targets = getTargets(linkerConfig, objectFiles);
- Hashtable acpiTarget = new Hashtable();
- if (aslcompiler) {
- acpiTarget = getAcpiTargets(linkerConfig, new Vector());
- }
- Hashtable assemblerTarget = new Hashtable();
- if (assembler) {
- assemblerTarget = getAssemblerTargets(linkerConfig, objectFiles);
- }
- TargetInfo linkTarget = null;
- //
- // if output file is not specified,
- // then skip link step
- //
- if (_outfile != null) {
- linkTarget = getLinkTarget(linkerConfig, objectFiles,
- sysObjectFiles, targets, assemblerTarget);
- }
- //
- // If specify the aslcompiler, then call asl compiler
- //
- if (aslcompiler) {
- BuildException acpiException = null;
- Hashtable targetsByConfig = getTargetsToBuildByConfiguration(acpiTarget);
- Enumeration acpiTargetEnum = targetsByConfig.elements();
- Vector[] targetVectors = new Vector[targetsByConfig.size()];
- int index = 0;
- while (acpiTargetEnum.hasMoreElements()) {
- Vector targetsForConfig = (Vector) acpiTargetEnum.nextElement();
- targetVectors[index++] = targetsForConfig;
- }
- for (int i = 0; i < targetVectors.length; i++) {
- //
- // get the targets for this configuration
- //
- Vector targetsForConfig = targetVectors[i];
- //
- // get the configuration from the first entry
- //
- AslcompilerConfiguration config = (AslcompilerConfiguration) ((TargetInfo) targetsForConfig
- .elementAt(0)).getConfiguration();
- //
- // prepare the list of source files
- //
- String[] sourceFiles = new String[targetsForConfig.size()];
- Enumeration targetsEnum = targetsForConfig.elements();
- index = 0;
- while (targetsEnum.hasMoreElements()) {
- TargetInfo targetInfo = ((TargetInfo) targetsEnum
- .nextElement());
- sourceFiles[index++] = targetInfo.getSources()[0]
- .toString();
- }
- try {
- config.aslcompiler(this, _objDir, sourceFiles);
- log(sourceFiles.length
- + " total ACPI source files to be compiled.");
- } catch (BuildException ex) {
- if (acpiException == null) {
- acpiException = ex;
- }
- if (!relentless)
- break;
- }
- }
- }
- //
- // If specify the assembler, then call assembler
- //
- if (assembler) {
- BuildException assemblerException = null;
- Hashtable targetsByConfig = getTargetsToBuildByConfiguration(assemblerTarget);
- Enumeration assembleTargetEnum = targetsByConfig.elements();
- Vector[] targetVectors = new Vector[targetsByConfig.size()];
- int index = 0;
- while (assembleTargetEnum.hasMoreElements()) {
- Vector targetsForConfig = (Vector) assembleTargetEnum
- .nextElement();
- targetVectors[index++] = targetsForConfig;
- }
- for (int i = 0; i < targetVectors.length; i++) {
- //
- // get the targets for this configuration
- //
- Vector targetsForConfig = targetVectors[i];
- //
- // get the configuration from the first entry
- //
- AssemblerConfiguration config = (AssemblerConfiguration) ((TargetInfo) targetsForConfig
- .elementAt(0)).getConfiguration();
- //
- // prepare the list of source files
- //
- String[] sourceFiles = new String[targetsForConfig.size()];
- Enumeration targetsEnum = targetsForConfig.elements();
- index = 0;
- while (targetsEnum.hasMoreElements()) {
- TargetInfo targetInfo = ((TargetInfo) targetsEnum
- .nextElement());
- sourceFiles[index++] = targetInfo.getSources()[0]
- .toString();
- }
- try {
- config.assembler(this, _objDir, sourceFiles);
- log(sourceFiles.length + " total files to be assembled.");
- } catch (BuildException ex) {
- if (assemblerException == null) {
- assemblerException = ex;
- }
- if (!relentless)
- break;
- }
- }
- //
- // if we threw a assembler exception and
- // didn't throw it at the time because
- // we were relentless then
- // save the history and
- // throw the exception
- //
- if (assemblerException != null) {
- if (failOnError) {
- throw assemblerException;
- } else {
- log(assemblerException.getMessage(), Project.MSG_ERR);
- return;
- }
- }
- }
-
- //
- // mark targets that don't have a history record or
- // whose source last modification time is not
- // the same as the history to be rebuilt
- //
- objHistory.markForRebuild(targets);
- CCTaskProgressMonitor monitor = new CCTaskProgressMonitor(objHistory);
- //
- // check for changed include files
- //
- int rebuildCount = checkForChangedIncludeFiles(targets);
- if (rebuildCount > 0) {
- BuildException compileException = null;
- //
- // compile all targets with getRebuild() == true
- //
- Hashtable targetsByConfig = getTargetsToBuildByConfiguration(targets);
- //
- // build array containing Vectors with precompiled generation
- // steps going first
- //
- Vector[] targetVectors = new Vector[targetsByConfig.size()];
- int index = 0;
- Enumeration targetVectorEnum = targetsByConfig.elements();
- while (targetVectorEnum.hasMoreElements()) {
- Vector targetsForConfig = (Vector) targetVectorEnum
- .nextElement();
- //
- // get the configuration from the first entry
- //
- CompilerConfiguration config = (CompilerConfiguration) ((TargetInfo) targetsForConfig
- .elementAt(0)).getConfiguration();
- if (config.isPrecompileGeneration()) {
- targetVectors[index++] = targetsForConfig;
- }
- }
- targetVectorEnum = targetsByConfig.elements();
- while (targetVectorEnum.hasMoreElements()) {
- Vector targetsForConfig = (Vector) targetVectorEnum
- .nextElement();
- for (int i = 0; i < targetVectors.length; i++) {
- if (targetVectors[i] == targetsForConfig) {
- break;
- }
- if (targetVectors[i] == null) {
- targetVectors[i] = targetsForConfig;
- break;
- }
- }
- }
- for (int i = 0; i < targetVectors.length; i++) {
- //
- // get the targets for this configuration
- //
- Vector targetsForConfig = targetVectors[i];
- //
- // get the configuration from the first entry
- //
- CompilerConfiguration config = (CompilerConfiguration) ((TargetInfo) targetsForConfig
- .elementAt(0)).getConfiguration();
- //
- // prepare the list of source files
- //
- String[] sourceFiles = new String[targetsForConfig.size()];
- Enumeration targetsEnum = targetsForConfig.elements();
- index = 0;
- while (targetsEnum.hasMoreElements()) {
- TargetInfo targetInfo = ((TargetInfo) targetsEnum
- .nextElement());
- sourceFiles[index++] = targetInfo.getSources()[0]
- .toString();
- }
- try {
- config.compile(this, _objDir, sourceFiles, relentless,
- monitor);
- } catch (BuildException ex) {
- if (compileException == null) {
- compileException = ex;
- }
- if (!relentless)
- break;
- }
- }
- //
- // save the details of the object file compilation
- // settings to disk for dependency analysis
- //
- try {
- objHistory.commit();
- } catch (IOException ex) {
- this.log("Error writing history.xml: " + ex.toString());
- }
- //
- // if we threw a compile exception and
- // didn't throw it at the time because
- // we were relentless then
- // save the history and
- // throw the exception
- //
- if (compileException != null) {
- if (failOnError) {
- throw compileException;
- } else {
- log(compileException.getMessage(), Project.MSG_ERR);
- return;
- }
- }
- }
- //
- // if the dependency tree was not fully
- // evaluated, then throw an exception
- // since we really didn't do what we
- // should have done
- //
- //
- if (dependencyDepth >= 0) {
- throw new BuildException(
- "All files at depth "
- + Integer.toString(dependencyDepth)
- + " from changes successfully compiled.\n"
- + "Remove or change dependencyDepth to -1 to perform full compilation.");
- }
- //
- // if no link target then
- // commit the history for the object files
- // and leave the task
- if (linkTarget != null) {
- //
- // get the history for the link target (may be the same
- // as the object history)
- TargetHistoryTable linkHistory = getLinkHistory(objHistory);
- //
- // see if it needs to be rebuilt
- //
- linkHistory.markForRebuild(linkTarget);
- //
- // if it needs to be rebuilt, rebuild it
- //
- File output = linkTarget.getOutput();
- if (linkTarget.getRebuild()) {
- log("Starting link");
- LinkerConfiguration linkConfig = (LinkerConfiguration) linkTarget
- .getConfiguration();
- if (failOnError) {
- linkConfig.link(this, linkTarget);
- } else {
- try {
- linkConfig.link(this, linkTarget);
- } catch (BuildException ex) {
- log(ex.getMessage(), Project.MSG_ERR);
- return;
- }
- }
- if (outputFileProperty != null)
- getProject().setProperty(outputFileProperty,
- output.getAbsolutePath());
- linkHistory.update(linkTarget);
- try {
- linkHistory.commit();
- } catch (IOException ex) {
- log("Error writing link history.xml: " + ex.toString());
- }
- } else {
- if (outputFileProperty != null)
- getProject().setProperty(outputFileProperty,
- output.getAbsolutePath());
- }
- }
- }
-
- /**
- * Gets the dataset.
- *
- * @return Returns a String
- */
- public String getDataset() {
- return dataset;
- }
-
- protected TargetHistoryTable getLinkHistory(TargetHistoryTable objHistory) {
- File outputFileDir = new File(_outfile.getParent());
- //
- // if the output file is being produced in the link
- // directory, then we can use the same history file
- //
- if (_objDir.equals(outputFileDir)) {
- return objHistory;
- }
- return new TargetHistoryTable(this, outputFileDir);
- }
-
- protected TargetInfo getLinkTarget(LinkerConfiguration linkerConfig,
- Vector objectFiles, Vector sysObjectFiles,
- Hashtable compileTargets, Hashtable assemblerTargets) {
- //
- // walk the compile phase targets and
- // add those sources that have already been
- // assigned to the linker or
- // our output files the linker knows how to consume
- // files the linker knows how to consume
- //
- Enumeration compileTargetsEnum = compileTargets.elements();
- while (compileTargetsEnum.hasMoreElements()) {
- TargetInfo compileTarget = (TargetInfo) compileTargetsEnum
- .nextElement();
- //
- // output of compile tasks
- //
- int bid = linkerConfig.bid(compileTarget.getOutput().toString());
- if (bid > 0) {
- objectFiles.addElement(compileTarget.getOutput());
- }
- }
- //
- // walk the assembler phase targets and
- // add those sources that have already been
- // assigned to the linker or
- // our output files the linker knows how to consume
- // files the linker knows how to consume
- //
- Enumeration assembleTargetsEnum = assemblerTargets.elements();
- while (assembleTargetsEnum.hasMoreElements()) {
- TargetInfo assemblerTarget = (TargetInfo) assembleTargetsEnum
- .nextElement();
- //
- // output of assemble tasks
- //
- int bid = linkerConfig.bid(assemblerTarget.getOutput().toString());
- if (bid > 0) {
- objectFiles.addElement(assemblerTarget.getOutput());
- }
- }
- File[] objectFileArray = new File[objectFiles.size()];
- objectFiles.copyInto(objectFileArray);
- File[] sysObjectFileArray = new File[sysObjectFiles.size()];
- sysObjectFiles.copyInto(sysObjectFileArray);
- String baseName = _outfile.getName();
- String fullName = linkerConfig.getOutputFileName(baseName);
- File outputFile = new File(_outfile.getParent(), fullName);
- return new TargetInfo(linkerConfig, objectFileArray,
- sysObjectFileArray, outputFile, linkerConfig
- .getRebuild());
- }
-
- public File getObjdir() {
- return _objDir;
- }
-
- public File getOutfile() {
- return _outfile;
- }
-
- public TargetDef getTargetPlatform() {
- return null;
- }
-
- /**
- * This method collects a Hashtable, keyed by output file name, of
- * TargetInfo's for every source file that is specified in the filesets of
- * the <aslcompiler> elements. The TargetInfo's contain the appropriate ACPI
- * configurations for their possible acpi
- *
- */
- private Hashtable getAcpiTargets(LinkerConfiguration linkerConfig,
- Vector objectFiles) {
- Hashtable targets = new Hashtable(1000);
- TargetDef targetPlatform = getTargetPlatform();
- Vector biddingProcessors = new Vector(_aslcompiler.size());
- for (int i = 0; i < _aslcompiler.size(); i++) {
- AslcompilerDef currentAslDef = (AslcompilerDef) _aslcompiler
- .elementAt(i);
- if (currentAslDef.isActive()) {
- ProcessorConfiguration config = currentAslDef
- .createConfiguration(this, linkType,
- aslcompilerDef, targetPlatform);
- //
- // if the aslcompiler has a fileset
- // then allow it to add its files to
- // the set of potential targets
- //
- ProcessorConfiguration[] localConfigs = new ProcessorConfiguration[] { config };
- if (currentAslDef.hasFileSets()) {
- TargetMatcher matcher = new TargetMatcher(this, _objDir,
- localConfigs, linkerConfig, objectFiles,
- targets);
- currentAslDef.visitFiles(matcher);
- }
- biddingProcessors.addElement(config);
- }
- }
- //
- // add fallback compiler at the end
- //
- ProcessorConfiguration config = aslcompilerDef.createConfiguration(
- this, linkType, null, targetPlatform);
- biddingProcessors.addElement(config);
- ProcessorConfiguration[] bidders = new ProcessorConfiguration[biddingProcessors
- .size()];
- biddingProcessors.copyInto(bidders);
- TargetMatcher matcher = new TargetMatcher(this, _objDir, bidders,
- linkerConfig, objectFiles, targets);
- aslcompilerDef.visitFiles(matcher);
- return targets;
- }
-
- /**
- * This method collects a Hashtable, keyed by output file name, of
- * TargetInfo's for every source file that is specified in the filesets of
- * the <assembler> elements. The TargetInfo's contain the appropriate
- * assembler configurations for their possible assembly
- *
- */
- private Hashtable getAssemblerTargets(LinkerConfiguration linkerConfig,
- Vector objectFiles) {
- Hashtable targets = new Hashtable(1000);
- TargetDef targetPlatform = getTargetPlatform();
- Vector biddingProcessors = new Vector(_assemblers.size());
- for (int i = 0; i < _assemblers.size(); i++) {
- AssemblerDef currentAssemblerDef = (AssemblerDef) _assemblers
- .elementAt(i);
- if (currentAssemblerDef.isActive()) {
- ProcessorConfiguration config = currentAssemblerDef
- .createConfiguration(this, linkType,
- assemblerDef, targetPlatform);
- //
- // if the assembler has a fileset
- // then allow it to add its files to
- // the set of potential targets
- //
- ProcessorConfiguration[] localConfigs = new ProcessorConfiguration[] { config };
- if (currentAssemblerDef.hasFileSets()) {
- TargetMatcher matcher = new TargetMatcher(this, _objDir,
- localConfigs, linkerConfig, objectFiles,
- targets);
- currentAssemblerDef.visitFiles(matcher);
- }
- biddingProcessors.addElement(config);
- }
- }
- //
- // add fallback assembler at the end
- //
- ProcessorConfiguration config = assemblerDef.createConfiguration(this,
- linkType, null, targetPlatform);
- biddingProcessors.addElement(config);
- ProcessorConfiguration[] bidders = new ProcessorConfiguration[biddingProcessors
- .size()];
- biddingProcessors.copyInto(bidders);
- TargetMatcher matcher = new TargetMatcher(this, _objDir, bidders,
- linkerConfig, objectFiles, targets);
- assemblerDef.visitFiles(matcher);
- return targets;
- }
-
- /**
- * This method collects a Hashtable, keyed by output file name, of
- * TargetInfo's for every source file that is specified in the filesets of
- * the <cc>and nested <compiler>elements. The TargetInfo's contain the
- * appropriate compiler configurations for their possible compilation
- *
- */
- private Hashtable getTargets(LinkerConfiguration linkerConfig,
- Vector objectFiles) {
- Hashtable targets = new Hashtable(1000);
- TargetDef targetPlatform = getTargetPlatform();
- //
- // find active (specialized) compilers
- //
- Vector biddingProcessors = new Vector(_compilers.size());
- for (int i = 0; i < _compilers.size(); i++) {
- CompilerDef currentCompilerDef = (CompilerDef) _compilers
- .elementAt(i);
- if (currentCompilerDef.isActive()) {
- ProcessorConfiguration config = currentCompilerDef
- .createConfiguration(this, linkType,
- compilerDef, targetPlatform);
- //
- // see if this processor had a precompile child element
- //
- PrecompileDef precompileDef = currentCompilerDef
- .getActivePrecompile(compilerDef);
- ProcessorConfiguration[] localConfigs = new ProcessorConfiguration[] { config };
- //
- // if it does then
- //
- if (precompileDef != null) {
- File prototype = precompileDef.getPrototype();
- //
- // will throw exceptions if prototype doesn't exist, etc
- //
- if (!prototype.exists()) {
- throw new BuildException("prototype ("
- + prototype.toString()
- + ") does not exist.");
- }
- if (prototype.isDirectory()) {
- throw new BuildException("prototype ("
- + prototype.toString()
- + ") is a directory.");
- }
- String[] exceptFiles = precompileDef.getExceptFiles();
- //
- // create a precompile building and precompile using
- // variants of the configuration
- // or return null if compiler doesn't support
- // precompilation
- CompilerConfiguration[] configs = ((CompilerConfiguration) config)
- .createPrecompileConfigurations(prototype,
- exceptFiles);
- if (configs != null && configs.length == 2) {
- //
- // visit the precompiled file to add it into the
- // targets list (just like any other file if
- // compiler doesn't support precompilation)
- TargetMatcher matcher = new TargetMatcher(
- this,
- _objDir,
- new ProcessorConfiguration[] { configs[0] },
- linkerConfig, objectFiles, targets);
- matcher.visit(new File(prototype.getParent()),
- prototype.getName());
- //
- // only the configuration that uses the
- // precompiled header gets added to the bidding list
- biddingProcessors.addElement(configs[1]);
- localConfigs = new ProcessorConfiguration[2];
- localConfigs[0] = configs[1];
- localConfigs[1] = config;
- }
- }
- //
- // if the compiler has a fileset
- // then allow it to add its files
- // to the set of potential targets
- if (currentCompilerDef.hasFileSets()) {
- TargetMatcher matcher = new TargetMatcher(this, _objDir,
- localConfigs, linkerConfig, objectFiles,
- targets);
- currentCompilerDef.visitFiles(matcher);
- }
- biddingProcessors.addElement(config);
- }
- }
- //
- // add fallback compiler at the end
- //
- ProcessorConfiguration config = compilerDef.createConfiguration(this,
- linkType, null, targetPlatform);
- biddingProcessors.addElement(config);
- ProcessorConfiguration[] bidders = new ProcessorConfiguration[biddingProcessors
- .size()];
- biddingProcessors.copyInto(bidders);
- //
- // bid out the <fileset>'s in the cctask
- //
- TargetMatcher matcher = new TargetMatcher(this, _objDir, bidders,
- linkerConfig, objectFiles, targets);
- compilerDef.visitFiles(matcher);
- return targets;
- }
-
- /**
- * Sets the default compiler adapter. Use the "name" attribute when the
- * compiler is a supported compiler.
- *
- * @param classname
- * fully qualified classname which implements CompilerAdapter
- */
- public void setClassname(String classname) {
- compilerDef.setClassname(classname);
- linkerDef.setClassname(classname);
- assemblerDef.setClassname(classname);
- aslcompilerDef.setClassname(classname);
- }
-
- /**
- * Sets the dataset for OS/390 builds.
- *
- * @param dataset
- * The dataset to set
- */
- public void setDataset(String dataset) {
- this.dataset = dataset;
- }
-
- /**
- * Enables or disables generation of debug info.
- */
- public void setDebug(boolean debug) {
- compilerDef.setDebug(debug);
- linkerDef.setDebug(debug);
- assemblerDef.setDebug(debug);
- aslcompilerDef.setDebug(debug);
- }
-
- /**
- * Deprecated.
- *
- * Controls the depth of the dependency evaluation. Used to do a quick check
- * of changes before a full build.
- *
- * Any negative value which will perform full dependency checking. Positive
- * values will truncate dependency checking. A value of 0 will cause only
- * those files that changed to be recompiled, a value of 1 which cause files
- * that changed or that explicitly include a file that changed to be
- * recompiled.
- *
- * Any non-negative value will cause a BuildException to be thrown before
- * attempting a link or completing the task.
- *
- */
- public void setDependencyDepth(int depth) {
- dependencyDepth = depth;
- }
-
- /**
- * Enables generation of exception handling code
- */
- public void setExceptions(boolean exceptions) {
- compilerDef.setExceptions(exceptions);
- }
-
- /**
- * Enables run-time type information.
- */
- public void setRtti(boolean rtti) {
- compilerDef.setRtti(rtti);
- }
-
- // public LinkType getLinkType() {
- // return linkType;
- // }
- /**
- * Enables or disables incremental linking.
- *
- * @param incremental
- * new state
- */
- public void setIncremental(boolean incremental) {
- linkerDef.setIncremental(incremental);
- }
-
- /**
- * Set use of libtool.
- *
- * If set to true, the "libtool " will be prepended to the command line for
- * compatible processors
- *
- * @param libtool
- * If true, use libtool.
- */
- public void setLibtool(boolean libtool) {
- compilerDef.setLibtool(libtool);
- linkerDef.setLibtool(libtool);
- assemblerDef.setLibtool(libtool);
- aslcompilerDef.setLibtool(libtool);
- }
-
- /**
- * Sets the output file type. Supported values "executable", "shared", and
- * "static". Deprecated, specify outtype instead.
- *
- * @deprecated
- */
- public void setLink(OutputTypeEnum outputType) {
- linkType.setOutputType(outputType);
- }
-
- /**
- * Enables or disables generation of multithreaded code
- *
- * @param multi
- * If true, generated code may be multithreaded.
- */
- public void setMultithreaded(boolean multi) {
- compilerDef.setMultithreaded(multi);
- }
-
- //
- // keep near duplicate comment at CompilerDef.setName in sync
- //
- /**
- * Sets type of the default compiler and linker.
- *
- * <table width="100%" border="1"> <thead>Supported compilers </thead>
- * <tr>
- * <td>gcc (default)</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>c++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g77</td>
- * <td>GNU FORTRAN compiler</td>
- * </tr>
- * <tr>
- * <td>msvc</td>
- * <td>Microsoft Visual C++</td>
- * </tr>
- * <tr>
- * <td>bcc</td>
- * <td>Borland C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>msrc</td>
- * <td>Microsoft Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>brc</td>
- * <td>Borland Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>df</td>
- * <td>Compaq Visual Fortran Compiler</td>
- * </tr>
- * <tr>
- * <td>midl</td>
- * <td>Microsoft MIDL Compiler</td>
- * </tr>
- * <tr>
- * <td>icl</td>
- * <td>Intel C++ compiler for Windows (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecl</td>
- * <td>Intel C++ compiler for Windows (IA-64)</td>
- * </tr>
- * <tr>
- * <td>icc</td>
- * <td>Intel C++ compiler for Linux (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecc</td>
- * <td>Intel C++ compiler for Linux (IA-64)</td>
- * </tr>
- * <tr>
- * <td>CC</td>
- * <td>Sun ONE C++ compiler</td>
- * </tr>
- * <tr>
- * <td>aCC</td>
- * <td>HP aC++ C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>os390</td>
- * <td>OS390 C Compiler</td>
- * </tr>
- * <tr>
- * <td>os400</td>
- * <td>Icc Compiler</td>
- * </tr>
- * <tr>
- * <td>sunc89</td>
- * <td>Sun C89 C Compiler</td>
- * </tr>
- * <tr>
- * <td>xlC</td>
- * <td>VisualAge C Compiler</td>
- * </tr>
- * </table>
- *
- */
- public void setName(CompilerEnum name) {
- compilerDef.setName(name);
- Processor compiler = compilerDef.getProcessor();
- Linker linker = compiler.getLinker(linkType);
- linkerDef.setProcessor(linker);
- }
-
- /**
- * Do not propagate old environment when new environment variables are
- * specified.
- */
- public void setNewenvironment(boolean newenv) {
- compilerDef.setNewenvironment(newenv);
- linkerDef.setNewenvironment(newenv);
- assemblerDef.setNewenvironment(newenv);
- aslcompilerDef.setNewenvironment(newenv);
- }
-
- /**
- * Sets the destination directory for object files.
- *
- * Generally this should be a property expression that evaluates to distinct
- * debug and release object file directories.
- *
- * @param dir
- * object directory
- */
- public void setObjdir(File dir) {
- if (dir == null) {
- throw new NullPointerException("dir");
- }
- _objDir = dir;
- }
-
- /**
- * Sets the output file name. If not specified, the task will only compile
- * files and not attempt to link. If an extension is not specified, the task
- * may use a system appropriate extension and prefix, for example,
- * outfile="example" may result in "libexample.so" being created.
- *
- * @param outfile
- * output file name
- */
- public void setOutfile(File outfile) {
- //
- // if file name was empty, skip link step
- //
- if (outfile == null || outfile.toString().length() > 0) {
- _outfile = outfile;
- }
- }
-
- /**
- * Specifies the name of a property to set with the physical filename that
- * is produced by the linker
- */
- public void setOutputFileProperty(String outputFileProperty) {
- this.outputFileProperty = outputFileProperty;
- }
-
- /**
- * Sets the output file type. Supported values "executable", "shared", and
- * "static".
- */
- public void setOuttype(OutputTypeEnum outputType) {
- linkType.setOutputType(outputType);
- }
-
- /**
- * Sets the project.
- */
- public void setProject(Project project) {
- super.setProject(project);
- compilerDef.setProject(project);
- linkerDef.setProject(project);
- assemblerDef.setProject(project);
- aslcompilerDef.setProject(project);
- }
-
- /**
- * If set to true, all files will be rebuilt.
- *
- * @paran rebuildAll If true, all files will be rebuilt. If false, up to
- * date files will not be rebuilt.
- */
- public void setRebuild(boolean rebuildAll) {
- compilerDef.setRebuild(rebuildAll);
- linkerDef.setRebuild(rebuildAll);
- assemblerDef.setRebuild(rebuildAll);
- aslcompilerDef.setRebuild(rebuildAll);
- }
-
- /**
- * If set to true, compilation errors will not stop the task until all files
- * have been attempted.
- *
- * @param relentless
- * If true, don't stop on the first compilation error
- *
- */
- public void setRelentless(boolean relentless) {
- this.relentless = relentless;
- }
-
- /**
- * Sets the type of runtime library, possible values "dynamic", "static".
- */
- public void setRuntime(RuntimeType rtlType) {
- linkType.setStaticRuntime((rtlType.getIndex() == 1));
- }
-
- /**
- * Sets the nature of the subsystem under which that the program will
- * execute.
- *
- * <table width="100%" border="1"> <thead>Supported subsystems </thead>
- * <tr>
- * <td>gui</td>
- * <td>Graphical User Interface</td>
- * </tr>
- * <tr>
- * <td>console</td>
- * <td>Command Line Console</td>
- * </tr>
- * <tr>
- * <td>other</td>
- * <td>Other</td>
- * </tr>
- * </table>
- *
- * @param subsystem
- * subsystem
- * @throws NullPointerException
- * if subsystem is null
- */
- public void setSubsystem(SubsystemEnum subsystem) {
- if (subsystem == null) {
- throw new NullPointerException("subsystem");
- }
- linkType.setSubsystem(subsystem);
- }
-
- /**
- * Enumerated attribute with the values "none", "severe", "default",
- * "production", "diagnostic", and "failtask".
- */
- public void setWarnings(CompilerDef.WarningLevel level) {
- compilerDef.setWarnings(level);
- }
-
- /**
- * Indicates whether the build will continue even if there are compilation
- * errors; defaults to true.
- *
- * @param fail
- * if true halt the build on failure
- */
- public void setFailonerror(boolean fail) {
- failOnError = fail;
- }
-
- /**
- * Gets the failonerror flag.
- *
- * @return the failonerror flag
- */
- public boolean getFailonerror() {
- return failOnError;
- }
-
- /**
- * Adds descriptive version information to be included in the generated
- * file. The first active version info block will be used. (Non-functional
- * prototype)
- */
- public void addConfiguredVersioninfo(VersionInfo info) {
- linkerDef.addConfiguredVersioninfo(info);
- }
-
- /**
- * Adds a target definition or reference (Non-functional prototype).
- *
- * @param target
- * target
- * @throws NullPointerException
- * if compiler is null
- */
- public void addConfiguredTarget(TargetDef target) {
- if (target == null) {
- throw new NullPointerException("target");
- }
- target.setProject(getProject());
- targetPlatforms.addElement(target);
- }
-
- /**
- * Adds a distributer definition or reference (Non-functional prototype).
- *
- * @param distributer
- * distributer
- * @throws NullPointerException
- * if compiler is null
- */
- public void addConfiguredDistributer(DistributerDef distributer) {
- if (distributer == null) {
- throw new NullPointerException("distributer");
- }
- distributer.setProject(getProject());
- distributers.addElement(distributer);
- }
-
- /**
- * Sets optimization.
- * @param optimization
- */
- public void setOptimize(OptimizationEnum optimization) {
- compilerDef.setOptimize(optimization);
- }
-
- public boolean isAssembler() {
- return assembler;
- }
-
- public void setAssembler(boolean assembler) {
- this.assembler = assembler;
- }
-
- public boolean isAslcompiler() {
- return aslcompiler;
- }
-
- public void setAslcompiler(boolean aslcompiler) {
- this.aslcompiler = aslcompiler;
- }
-
- public boolean isUserdefine() {
- return userdefine;
- }
-
- public void setUserdefine(boolean userdefine) {
- this.userdefine = userdefine;
- }
-
- public String getArch() {
- return arch;
- }
-
- public void setArch(String arch) {
- this.arch = arch;
- }
-
- public String getOs() {
- return os;
- }
-
- public void setOs(String os) {
- this.os = os;
- }
-
- public String getVendor() {
- return vendor;
- }
-
- public void setVendor(String vendor) {
- this.vendor = vendor;
- }
-
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTaskProgressMonitor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTaskProgressMonitor.java
deleted file mode 100644
index 78192a5ba7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CCTaskProgressMonitor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.IOException;
-
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.ProgressMonitor;
-public class CCTaskProgressMonitor implements ProgressMonitor {
- private ProcessorConfiguration config;
- private TargetHistoryTable history;
- private long lastCommit = -1;
- public CCTaskProgressMonitor(TargetHistoryTable history) {
- this.history = history;
- }
- public void finish(ProcessorConfiguration config, boolean normal) {
- long current = System.currentTimeMillis();
- if ((current - lastCommit) > 120000) {
- try {
- history.commit();
- lastCommit = System.currentTimeMillis();
- } catch (IOException ex) {
- }
- }
- }
- public void progress(String[] sources) {
- history.update(config, sources);
- long current = System.currentTimeMillis();
- if ((current - lastCommit) > 120000) {
- try {
- history.commit();
- lastCommit = current;
- } catch (IOException ex) {
- }
- }
- }
- public void start(ProcessorConfiguration config) {
- if (lastCommit < 0) {
- lastCommit = System.currentTimeMillis();
- }
- this.config = config;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CPUEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CPUEnum.java
deleted file mode 100644
index ba73902361..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CPUEnum.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of cpu types.
- *
- * @author Curt Arnold
- *
- */
-public final class CPUEnum
- extends EnumeratedAttribute {
-
- /**
- * Constructor.
- *
- * Set by default to "pentium3"
- *
- * @see java.lang.Object#Object()
- */
- public CPUEnum() {
- setValue("pentium3");
- }
-
- /**
- * Gets list of acceptable values.
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[] {
- "i386",
- "i486",
- "i586",
- "i686",
- "pentium",
- "pentium-mmx",
- "pentiumpro",
- "pentium2",
- "pentium3",
- "pentium4",
- "k6",
- "k6-2",
- "k6-3",
- "athlon",
- "athlon-tbird",
- "athlon-4",
- "athlon-xp",
- "athlon-mp",
- "winchip-c6",
- "winchip2",
- "c3" };
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CUtil.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CUtil.java
deleted file mode 100644
index 074e8b42f8..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CUtil.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-import org.apache.tools.ant.types.Environment;
-/**
- * Some utilities used by the CC and Link tasks.
- *
- * @author Adam Murdoch
- */
-public class CUtil {
- /**
- * A class that splits a white-space, comma-separated list into a String
- * array. Used for task attributes.
- */
- public static final class StringArrayBuilder {
- private String[] _value;
- public StringArrayBuilder(String value) {
- // Split the defines up
- StringTokenizer tokens = new StringTokenizer(value, ", ");
- Vector vallist = new Vector();
- while (tokens.hasMoreTokens()) {
- String val = tokens.nextToken().trim();
- if (val.length() == 0) {
- continue;
- }
- vallist.addElement(val);
- }
- _value = new String[vallist.size()];
- vallist.copyInto(_value);
- }
- public String[] getValue() {
- return _value;
- }
- }
- /**
- * Adds the elements of the array to the given vector
- */
- public static void addAll(Vector dest, Object[] src) {
- if (src == null) {
- return;
- }
- for (int i = 0; i < src.length; i++) {
- dest.addElement(src[i]);
- }
- }
- /**
- * Checks a array of names for non existent or non directory entries and
- * nulls them out.
- *
- * @return Count of non-null elements
- */
- public static int checkDirectoryArray(String[] names) {
- int count = 0;
- for (int i = 0; i < names.length; i++) {
- if (names[i] != null) {
- File dir = new File(names[i]);
- if (dir.exists() && dir.isDirectory()) {
- count++;
- } else {
- names[i] = null;
- }
- }
- }
- return count;
- }
- /**
- * Extracts the basename of a file, removing the extension, if present
- */
- public static String getBasename(File file) {
- String path = file.getPath();
- // Remove the extension
- String basename = file.getName();
- int pos = basename.lastIndexOf('.');
- if (pos != -1) {
- basename = basename.substring(0, pos);
- }
- return basename;
- }
- /**
- * Gets the parent directory for the executable file name using the current
- * directory and system executable path
- *
- * @param exeName
- * Name of executable such as "cl.exe"
- * @return parent directory or null if not located
- */
- public static File getExecutableLocation(String exeName) {
- //
- // must add current working directory to the
- // from of the path from the "path" environment variable
- File currentDir = new File(System.getProperty("user.dir"));
- if (new File(currentDir, exeName).exists()) {
- return currentDir;
- }
- File[] envPath = CUtil.getPathFromEnvironment("PATH",
- File.pathSeparator);
- for (int i = 0; i < envPath.length; i++) {
- if (new File(envPath[i], exeName).exists()) {
- return envPath[i];
- }
- }
- return null;
- }
- /**
- * Extracts the parent of a file
- */
- public static String getParentPath(String path) {
- int pos = path.lastIndexOf(File.separator);
- if (pos <= 0) {
- return null;
- }
- return path.substring(0, pos);
- }
- /**
- * Returns an array of File for each existing directory in the specified
- * environment variable
- *
- * @param envVariable
- * environment variable name such as "LIB" or "INCLUDE"
- * @param delim
- * delimitor used to separate parts of the path, typically ";"
- * or ":"
- * @return array of File's for each part that is an existing directory
- */
- public static File[] getPathFromEnvironment(String envVariable, String delim) {
- // OS/4000 does not support the env command.
- if (System.getProperty("os.name").equals("OS/400"))
- return new File[]{};
- Vector osEnv = Execute.getProcEnvironment();
- String match = envVariable.concat("=");
- for (Enumeration e = osEnv.elements(); e.hasMoreElements();) {
- String entry = ((String) e.nextElement()).trim();
- if (entry.length() > match.length()) {
- String entryFrag = entry.substring(0, match.length());
- if (entryFrag.equalsIgnoreCase(match)) {
- String path = entry.substring(match.length());
- return parsePath(path, delim);
- }
- }
- }
- File[] noPath = new File[0];
- return noPath;
- }
- /**
- * Returns a relative path for the targetFile relative to the base
- * directory.
- *
- * @param canonicalBase
- * base directory as returned by File.getCanonicalPath()
- * @param targetFile
- * target file
- * @return relative path of target file. Returns targetFile if there were
- * no commonalities between the base and the target
- *
- * @author Curt Arnold
- */
- public static String getRelativePath(String base, File targetFile) {
- try {
- //
- // remove trailing file separator
- //
- String canonicalBase = base;
- if (base.charAt(base.length() - 1) == File.separatorChar) {
- canonicalBase = base.substring(0, base.length() - 1);
- }
- //
- // get canonical name of target and remove trailing separator
- //
- String canonicalTarget;
- if (System.getProperty("os.name").equals("OS/400"))
- canonicalTarget = targetFile.getPath();
- else
- canonicalTarget = targetFile.getCanonicalPath();
- if (canonicalTarget.charAt(canonicalTarget.length() - 1) == File.separatorChar) {
- canonicalTarget = canonicalTarget.substring(0, canonicalTarget
- .length() - 1);
- }
- if (canonicalTarget.equals(canonicalBase)) {
- return ".";
- }
- //
- // see if the prefixes are the same
- //
- if (canonicalBase.substring(0, 2).equals("\\\\")) {
- //
- // UNC file name, if target file doesn't also start with same
- // server name, don't go there
- int endPrefix = canonicalBase.indexOf('\\', 2);
- String prefix1 = canonicalBase.substring(0, endPrefix);
- String prefix2 = canonicalTarget.substring(0, endPrefix);
- if (!prefix1.equals(prefix2)) {
- return canonicalTarget;
- }
- } else {
- if (canonicalBase.substring(1, 3).equals(":\\")) {
- int endPrefix = 2;
- String prefix1 = canonicalBase.substring(0, endPrefix);
- String prefix2 = canonicalTarget.substring(0, endPrefix);
- if (!prefix1.equals(prefix2)) {
- return canonicalTarget;
- }
- } else {
- if (canonicalBase.charAt(0) == '/') {
- if (canonicalTarget.charAt(0) != '/') {
- return canonicalTarget;
- }
- }
- }
- }
- char separator = File.separatorChar;
- int lastSeparator = -1;
- int minLength = canonicalBase.length();
- if (canonicalTarget.length() < minLength) {
- minLength = canonicalTarget.length();
- }
- int firstDifference = minLength + 1;
- //
- // walk to the shorter of the two paths
- // finding the last separator they have in common
- for (int i = 0; i < minLength; i++) {
- if (canonicalTarget.charAt(i) == canonicalBase.charAt(i)) {
- if (canonicalTarget.charAt(i) == separator) {
- lastSeparator = i;
- }
- } else {
- firstDifference = lastSeparator + 1;
- break;
- }
- }
- StringBuffer relativePath = new StringBuffer(50);
- //
- // walk from the first difference to the end of the base
- // adding "../" for each separator encountered
- //
- if (canonicalBase.length() > firstDifference) {
- relativePath.append("..");
- for (int i = firstDifference; i < canonicalBase.length(); i++) {
- if (canonicalBase.charAt(i) == separator) {
- relativePath.append(separator);
- relativePath.append("..");
- }
- }
- }
- if (canonicalTarget.length() > firstDifference) {
- //
- // append the rest of the target
- //
- //
- if (relativePath.length() > 0) {
- relativePath.append(separator);
- }
- relativePath.append(canonicalTarget.substring(firstDifference));
- }
- return relativePath.toString();
- } catch (IOException ex) {
- }
- return targetFile.toString();
- }
- public static boolean isActive(Project p, String ifCond, String unlessCond)
- throws BuildException {
- if (ifCond != null) {
- String ifValue = p.getProperty(ifCond);
- if (ifValue == null) {
- return false;
- } else {
- if (ifValue.equals("false") || ifValue.equals("no")) {
- throw new BuildException("if condition \"" + ifCond
- + "\" has suspicious value \"" + ifValue);
- }
- }
- }
- if (unlessCond != null) {
- String unlessValue = p.getProperty(unlessCond);
- if (unlessValue != null) {
- if (unlessValue.equals("false") || unlessValue.equals("no")) {
- throw new BuildException("unless condition \"" + unlessCond
- + "\" has suspicious value \"" + unlessValue);
- }
- return false;
- }
- }
- return true;
- }
- /**
- * Parse a string containing directories into an File[]
- *
- * @param path
- * path string, for example ".;c:\something\include"
- * @param delim
- * delimiter, typically ; or :
- */
- public static File[] parsePath(String path, String delim) {
- Vector libpaths = new Vector();
- int delimPos = 0;
- for (int startPos = 0; startPos < path.length(); startPos = delimPos
- + delim.length()) {
- delimPos = path.indexOf(delim, startPos);
- if (delimPos < 0) {
- delimPos = path.length();
- }
- //
- // don't add an entry for zero-length paths
- //
- if (delimPos > startPos) {
- String dirName = path.substring(startPos, delimPos);
- File dir = new File(dirName);
- if (dir.exists() && dir.isDirectory()) {
- libpaths.addElement(dir);
- }
- }
- }
- File[] paths = new File[libpaths.size()];
- libpaths.copyInto(paths);
- return paths;
- }
- /**
- * This method is exposed so test classes can overload and test the
- * arguments without actually spawning the compiler
- */
- public static int runCommand(CCTask task, File workingDir,
- String[] cmdline, boolean newEnvironment, Environment env)
- throws BuildException {
- try {
- task.log(Commandline.toString(cmdline), Project.MSG_VERBOSE);
- Execute exe = new Execute(new LogStreamHandler(task,
- Project.MSG_INFO, Project.MSG_ERR));
- if (System.getProperty("os.name").equals("OS/390"))
- exe.setVMLauncher(false);
- exe.setAntRun(task.getProject());
- exe.setCommandline(cmdline);
- exe.setWorkingDirectory(workingDir);
- if (env != null) {
- String[] environment = env.getVariables();
- if (environment != null) {
- for (int i = 0; i < environment.length; i++) {
- task.log("Setting environment variable: "
- + environment[i], Project.MSG_VERBOSE);
- }
- }
- exe.setEnvironment(environment);
- }
- exe.setNewenvironment(newEnvironment);
- return exe.execute();
- } catch (java.io.IOException exc) {
- throw new BuildException("Could not launch " + cmdline[0] + ": "
- + exc, task.getLocation());
- }
- }
- /**
- * Compares the contents of 2 arrays for equaliy.
- */
- public static boolean sameList(Object[] a, Object[] b) {
- if (a == null || b == null || a.length != b.length) {
- return false;
- }
- for (int i = 0; i < a.length; i++) {
- if (!a[i].equals(b[i])) {
- return false;
- }
- }
- return true;
- }
- /**
- * Compares the contents of an array and a Vector for equality.
- */
- public static boolean sameList(Vector v, Object[] a) {
- if (v == null || a == null || v.size() != a.length) {
- return false;
- }
- for (int i = 0; i < a.length; i++) {
- Object o = a[i];
- if (!o.equals(v.elementAt(i))) {
- return false;
- }
- }
- return true;
- }
- /**
- * Compares the contents of an array and a Vector for set equality. Assumes
- * input array and vector are sets (i.e. no duplicate entries)
- */
- public static boolean sameSet(Object[] a, Vector b) {
- if (a == null || b == null || a.length != b.size()) {
- return false;
- }
- if (a.length == 0) {
- return true;
- }
- // Convert the array into a set
- Hashtable t = new Hashtable();
- for (int i = 0; i < a.length; i++) {
- t.put(a[i], a[i]);
- }
- for (int i = 0; i < b.size(); i++) {
- Object o = b.elementAt(i);
- if (t.remove(o) == null) {
- return false;
- }
- }
- return (t.size() == 0);
- }
- /**
- * Converts a vector to a string array.
- */
- public static String[] toArray(Vector src) {
- String[] retval = new String[src.size()];
- src.copyInto(retval);
- return retval;
- }
- /**
- * Replaces any embedded quotes in the string so that the value can be
- * placed in an attribute in an XML file
- *
- * @param attrValue
- * value to be expressed
- * @return equivalent attribute literal
- *
- */
- public static String xmlAttribEncode(String attrValue) {
- int quotePos = attrValue.indexOf('\"');
- if (quotePos < 0) {
- return attrValue;
- }
- int startPos = 0;
- StringBuffer buf = new StringBuffer(attrValue.length() + 20);
- while (quotePos >= 0) {
- buf.append(attrValue.substring(startPos, quotePos));
- buf.append("&quot;");
- startPos = quotePos + 1;
- quotePos = attrValue.indexOf('\"', startPos);
- }
- buf.append(attrValue.substring(startPos));
- return buf.toString();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerDef.java
deleted file mode 100644
index 0a92a51512..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerDef.java
+++ /dev/null
@@ -1,556 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler;
-import net.sf.antcontrib.cpptasks.compiler.Compiler;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.gcc.GccCCompiler;
-import net.sf.antcontrib.cpptasks.types.CompilerArgument;
-import net.sf.antcontrib.cpptasks.types.ConditionalPath;
-import net.sf.antcontrib.cpptasks.types.DefineSet;
-import net.sf.antcontrib.cpptasks.types.IncludePath;
-import net.sf.antcontrib.cpptasks.types.SystemIncludePath;
-import net.sf.antcontrib.cpptasks.types.UndefineArgument;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-import org.apache.tools.ant.*;
-/**
- * A compiler definition. compiler elements may be placed either as children of
- * a cc element or the project element. A compiler element with an id attribute
- * may be referenced from compiler elements with refid or extends attributes.
- *
- * @author Adam Murdoch
- */
-public final class CompilerDef extends ProcessorDef {
- /**
- * Enumerated attribute with the values "none", "severe", "default",
- * "production", "diagnostic", and "failtask".
- */
- public static class WarningLevel extends EnumeratedAttribute {
- public String[] getValues() {
- return new String[]{"none", "severe", "default", "production",
- "diagnostic", "aserror"};
- }
- }
- /** The source file sets. */
- private final Vector defineSets = new Vector();
- private Boolean exceptions;
- private Boolean rtti;
- private final Vector includePaths = new Vector();
- private Boolean multithreaded;
- private final Vector precompileDefs = new Vector();
- private final Vector sysIncludePaths = new Vector();
- private OptimizationEnum optimization;
- private int warnings = -1;
- private Boolean defaultflag = new Boolean(true);
- public CompilerDef() {
- }
- /**
- * Adds a compiler command-line arg.
- */
- public void addConfiguredCompilerArg(CompilerArgument arg) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorArg(arg);
- }
- /**
- * Adds a compiler command-line arg.
- */
- public void addConfiguredCompilerParam(CompilerParam param) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorParam(param);
- }
- /**
- * Adds a defineset.
- */
- public void addConfiguredDefineset(DefineSet defs) {
- if (defs == null) {
- throw new NullPointerException("defs");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- defineSets.addElement(defs);
- }
- /**
- * Creates an include path.
- */
- public IncludePath createIncludePath() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- IncludePath path = new IncludePath(p);
- includePaths.addElement(path);
- return path;
- }
- /**
- * Add a <includepath>or <sysincludepath> if specify the file
- * attribute
- *
- * @throws BuildException
- * if the specify file not exist
- */
- protected void loadFile(Vector activePath,File file) throws BuildException {
- FileReader fileReader;
- BufferedReader in;
- String str;
- if (! file.exists()){
- throw new BuildException("The file " + file + " is not existed");
- }
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
- while ( (str = in.readLine()) != null ){
- if(str.trim() == ""){
- continue ;
- }
- str = getProject().replaceProperties(str);
- activePath.addElement(str.trim());
- }
- }
- catch(Exception e){
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- * Specifies precompilation prototype file and exclusions.
- *
- */
- public PrecompileDef createPrecompile() throws BuildException {
- Project p = getProject();
- if (isReference()) {
- throw noChildrenAllowed();
- }
- PrecompileDef precomp = new PrecompileDef();
- precomp.setProject(p);
- precompileDefs.addElement(precomp);
- return precomp;
- }
- /**
- * Creates a system include path. Locations and timestamps of files located
- * using the system include paths are not used in dependency analysis.
- *
- *
- * Standard include locations should not be specified. The compiler
- * adapters should recognized the settings from the appropriate environment
- * variables or configuration files.
- */
- public SystemIncludePath createSysIncludePath() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- SystemIncludePath path = new SystemIncludePath(p);
- sysIncludePaths.addElement(path);
- return path;
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- public UndefineArgument[] getActiveDefines() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException(
- "project must be set before this call");
- }
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getActiveDefines();
- }
- Vector actives = new Vector();
- for (int i = 0; i < defineSets.size(); i++) {
- DefineSet currentSet = (DefineSet) defineSets.elementAt(i);
- UndefineArgument[] defines = currentSet.getDefines();
- for (int j = 0; j < defines.length; j++) {
- if (defines[j].isActive(p)) {
- actives.addElement(defines[j]);
- }
- }
- }
- UndefineArgument[] retval = new UndefineArgument[actives.size()];
- actives.copyInto(retval);
- return retval;
- }
- /**
- * Returns the compiler-specific include path.
- */
- public String[] getActiveIncludePaths() {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getActiveIncludePaths();
- }
- return getActivePaths(includePaths);
- }
- private String[] getActivePaths(Vector paths) {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project not set");
- }
- Vector activePaths = new Vector(paths.size());
- for (int i = 0; i < paths.size(); i++) {
- ConditionalPath path = (ConditionalPath) paths.elementAt(i);
- if (path.isActive(p)) {
- if (path.getFile() == null) {
- String[] pathEntries = path.list();
- for (int j = 0; j < pathEntries.length; j++) {
- activePaths.addElement(pathEntries[j]);
- }
- }
- else {
- loadFile(activePaths, path.getFile());
- }
- }
- }
- String[] pathNames = new String[activePaths.size()];
- activePaths.copyInto(pathNames);
- return pathNames;
- }
- public PrecompileDef getActivePrecompile(CompilerDef ccElement) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getActivePrecompile(ccElement);
- }
- PrecompileDef current = null;
- Enumeration enumPrecompilerDef = precompileDefs.elements();
- while (enumPrecompilerDef.hasMoreElements()) {
- current = (PrecompileDef) enumPrecompilerDef.nextElement();
- if (current.isActive()) {
- return current;
- }
- }
- CompilerDef extendedDef = (CompilerDef) getExtends();
- if (extendedDef != null) {
- current = extendedDef.getActivePrecompile(null);
- if (current != null) {
- return current;
- }
- }
- if (ccElement != null && getInherit()) {
- return ccElement.getActivePrecompile(null);
- }
- return null;
- }
- public String[] getActiveSysIncludePaths() {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getActiveSysIncludePaths();
- }
- return getActivePaths(sysIncludePaths);
- }
- public final boolean getExceptions(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getExceptions(defaultProviders, index);
- }
- if (exceptions != null) {
- return exceptions.booleanValue();
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getExceptions(defaultProviders,
- index + 1);
- }
- }
- return false;
- }
- public final Boolean getRtti(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getRtti(defaultProviders, index);
- }
- if (rtti != null) {
- return rtti;
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getRtti(defaultProviders,
- index + 1);
- }
- }
- return null;
- }
- public final Boolean getDefaultflag(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getDefaultflag(defaultProviders, index);
- }
- return defaultflag;
- }
- public final OptimizationEnum getOptimization(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getOptimization(defaultProviders, index);
- }
- if (optimization != null) {
- return optimization;
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getOptimization(defaultProviders,
- index + 1);
- }
- }
- return null;
- }
-
- public boolean getMultithreaded(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getMultithreaded(defaultProviders, index);
- }
- if (multithreaded != null) {
- return multithreaded.booleanValue();
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getMultithreaded(
- defaultProviders, index + 1);
- }
- }
- return true;
- }
- public Processor getProcessor() {
- Processor processor = super.getProcessor();
- if (processor == null) {
- processor = GccCCompiler.getInstance();
- }
- if (getLibtool() && processor instanceof CommandLineCompiler) {
- CommandLineCompiler compiler = (CommandLineCompiler) processor;
- processor = compiler.getLibtoolCompiler();
- }
- return processor;
- }
- public int getWarnings(CompilerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((CompilerDef) getCheckedRef(CompilerDef.class,
- "CompilerDef")).getWarnings(defaultProviders, index);
- }
- if (warnings == -1) {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getWarnings(defaultProviders,
- index + 1);
- }
- }
- return warnings;
- }
- /**
- * Sets the default compiler adapter. Use the "name" attribute when the
- * compiler is a supported compiler.
- *
- * @param classname
- * fully qualified classname which implements CompilerAdapter
- */
- public void setClassname(String classname) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- super.setClassname(classname);
- Processor proc = getProcessor();
- if (!(proc instanceof Compiler)) {
- throw new BuildException(classname + " does not implement Compiler");
- }
- }
- /**
- * Enables or disables exception support.
- *
- * @param exceptions
- * if true, exceptions are supported.
- *
- */
- public void setExceptions(boolean exceptions) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.exceptions = booleanValueOf(exceptions);
- }
-
- /**
- * Enables or disables run-time type information.
- *
- * @param rtti
- * if true, run-time type information is supported.
- *
- */
- public void setRtti(boolean rtti) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.rtti = booleanValueOf(rtti);
- }
-
- /**
- * Enables or disables generation of multithreaded code. Unless specified,
- * multithreaded code generation is enabled.
- *
- * @param multi
- * If true, generated code may be multithreaded.
- */
- public void setMultithreaded(boolean multithreaded) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.multithreaded = booleanValueOf(multithreaded);
- }
- /**
- * Sets compiler type.
- *
- *
- * <table width="100%" border="1"> <thead>Supported compilers </thead>
- * <tr>
- * <td>gcc (default)</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>c++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g77</td>
- * <td>GNU Fortran compiler</td>
- * </tr>
- * <tr>
- * <td>msvc</td>
- * <td>Microsoft Visual C++</td>
- * </tr>
- * <tr>
- * <td>bcc</td>
- * <td>Borland C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>msrc</td>
- * <td>Microsoft Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>brc</td>
- * <td>Borland Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>df</td>
- * <td>Compaq Visual Fortran Compiler</td>
- * </tr>
- * <tr>
- * <td>midl</td>
- * <td>Microsoft MIDL Compiler</td>
- * </tr>
- * <tr>
- * <td>icl</td>
- * <td>Intel C++ compiler for Windows (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecl</td>
- * <td>Intel C++ compiler for Windows (IA-64)</td>
- * </tr>
- * <tr>
- * <td>icc</td>
- * <td>Intel C++ compiler for Linux (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecc</td>
- * <td>Intel C++ compiler for Linux (IA-64)</td>
- * </tr>
- * <tr>
- * <td>CC</td>
- * <td>Sun ONE C++ compiler</td>
- * </tr>
- * <tr>
- * <td>aCC</td>
- * <td>HP aC++ C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>os390</td>
- * <td>OS390 C Compiler</td>
- * </tr>
- * <tr>
- * <td>os400</td>
- * <td>Icc Compiler</td>
- * </tr>
- * <tr>
- * <td>sunc89</td>
- * <td>Sun C89 C Compiler</td>
- * </tr>
- * <tr>
- * <td>xlC</td>
- * <td>VisualAge C Compiler</td>
- * </tr>
- * </table>
- *
- */
- public void setName(CompilerEnum name) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- Compiler compiler = name.getCompiler();
- setProcessor(compiler);
- }
- protected void setProcessor(Processor proc) throws BuildException {
- try {
- super.setProcessor((Compiler) proc);
- } catch (ClassCastException ex) {
- throw new BuildException(ex);
- }
- }
- /**
- * Enumerated attribute with the values "none", "severe", "default",
- * "production", "diagnostic", and "failtask".
- */
- public void setWarnings(CompilerDef.WarningLevel level) {
- warnings = level.getIndex();
- }
- /**
- * Sets optimization level.
- *
- * @param value optimization level
- */
- public void setOptimize(OptimizationEnum value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.optimization = value;
- }
- /**
- * Enables or disables default flags.
- *
- * @param defaultflag
- * if true, default flags will add to command line.
- *
- */
- public void setDefaultflag(boolean defaultflag) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.defaultflag = booleanValueOf(defaultflag);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerEnum.java
deleted file mode 100644
index a017243522..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerEnum.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import net.sf.antcontrib.cpptasks.arm.ADSCCompiler;
-import net.sf.antcontrib.cpptasks.borland.BorlandCCompiler;
-import net.sf.antcontrib.cpptasks.borland.BorlandResourceCompiler;
-import net.sf.antcontrib.cpptasks.compaq.CompaqVisualFortranCompiler;
-import net.sf.antcontrib.cpptasks.compiler.Compiler;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCCompiler;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioMIDLCompiler;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioResourceCompiler;
-import net.sf.antcontrib.cpptasks.gcc.GccCCompiler;
-import net.sf.antcontrib.cpptasks.hp.aCCCompiler;
-import net.sf.antcontrib.cpptasks.ibm.VisualAgeCCompiler;
-import net.sf.antcontrib.cpptasks.intel.IntelLinux32CCompiler;
-import net.sf.antcontrib.cpptasks.intel.IntelLinux64CCompiler;
-import net.sf.antcontrib.cpptasks.intel.IntelWin32CCompiler;
-import net.sf.antcontrib.cpptasks.intel.IntelWin64CCompiler;
-import net.sf.antcontrib.cpptasks.os390.OS390CCompiler;
-import net.sf.antcontrib.cpptasks.os400.IccCompiler;
-import net.sf.antcontrib.cpptasks.sun.C89CCompiler;
-import net.sf.antcontrib.cpptasks.sun.ForteCCCompiler;
-import net.sf.antcontrib.cpptasks.ti.ClxxCCompiler;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of supported compilers
- *
- * <table width="100%" border="1"> <thead>Supported compilers </thead>
- * <tr>
- * <td>gcc (default)</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>c++</td>
- * <td>GCC C++ compiler</td>
- * </tr>
- * <tr>
- * <td>g77</td>
- * <td>GNU FORTRAN compiler</td>
- * </tr>
- * <tr>
- * <td>msvc</td>
- * <td>Microsoft Visual C++</td>
- * </tr>
- * <tr>
- * <td>bcc</td>
- * <td>Borland C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>msrc</td>
- * <td>Microsoft Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>brc</td>
- * <td>Borland Resource Compiler</td>
- * </tr>
- * <tr>
- * <td>df</td>
- * <td>Compaq Visual Fortran Compiler</td>
- * </tr>
- * <tr>
- * <td>midl</td>
- * <td>Microsoft MIDL Compiler</td>
- * </tr>
- * <tr>
- * <td>icl</td>
- * <td>Intel C++ compiler for Windows (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecl</td>
- * <td>Intel C++ compiler for Windows (IA-64)</td>
- * </tr>
- * <tr>
- * <td>icc</td>
- * <td>Intel C++ compiler for Linux (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecc</td>
- * <td>Intel C++ compiler for Linux (IA-64)</td>
- * </tr>
- * <tr>
- * <td>CC</td>
- * <td>Sun ONE C++ compiler</td>
- * </tr>
- * <tr>
- * <td>aCC</td>
- * <td>HP aC++ C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>os390</td>
- * <td>OS390 C Compiler</td>
- * </tr>
- * <tr>
- * <td>os400</td>
- * <td>Icc Compiler</td>
- * </tr>
- * <tr>
- * <td>sunc89</td>
- * <td>Sun C89 C Compiler</td>
- * </tr>
- * <tr>
- * <td>xlC</td>
- * <td>VisualAge C Compiler</td>
- * </tr>
- * <tr>
- * <td>cl6x</td>
- * <td>TI TMS320C6000 Optimizing Compiler</td>
- * </tr>
- * <tr>
- * <td>cl55</td>
- * <td>TI TMS320C55x Optimizing C/C++ Compiler</td>
- * </tr>
- * <tr>
- * <td>armcpp</td>
- * <td>ARM 32-bit C++ compiler</td>
- * </tr>
- * <tr>
- * <td>armcc</td>
- * <td>ARM 32-bit C compiler</td>
- * </tr>
- * <tr>
- * <td>tcpp</td>
- * <td>ARM 16-bit C++ compiler</td>
- * </tr>
- * <tr>
- * <td>tcc</td>
- * <td>ARM 16-bit C compiler</td>
- * </tr>
- * </table>
- *
- * @author Curt Arnold
- *
- */
-public class CompilerEnum extends EnumeratedAttribute {
- private final static ProcessorEnumValue[] compilers = new ProcessorEnumValue[]{
- new ProcessorEnumValue("gcc", GccCCompiler.getInstance()),
- new ProcessorEnumValue("g++", GccCCompiler.getGppInstance()),
- new ProcessorEnumValue("c++", GccCCompiler.getCppInstance()),
- new ProcessorEnumValue("g77", GccCCompiler.getG77Instance()),
- new ProcessorEnumValue("msvc", DevStudioCCompiler.getInstance()),
- new ProcessorEnumValue("bcc", BorlandCCompiler.getInstance()),
- new ProcessorEnumValue("msrc", DevStudioResourceCompiler
- .getInstance()),
- new ProcessorEnumValue("brc", BorlandResourceCompiler.getInstance()),
- new ProcessorEnumValue("df", CompaqVisualFortranCompiler
- .getInstance()),
- new ProcessorEnumValue("midl", DevStudioMIDLCompiler.getInstance()),
- new ProcessorEnumValue("icl", IntelWin32CCompiler.getInstance()),
- new ProcessorEnumValue("ecl", IntelWin64CCompiler.getInstance()),
- new ProcessorEnumValue("icc", IntelLinux32CCompiler.getInstance()),
- new ProcessorEnumValue("ecc", IntelLinux64CCompiler.getInstance()),
- new ProcessorEnumValue("CC", ForteCCCompiler.getInstance()),
- new ProcessorEnumValue("aCC", aCCCompiler.getInstance()),
- new ProcessorEnumValue("os390", OS390CCompiler.getInstance()),
- new ProcessorEnumValue("os400", IccCompiler.getInstance()),
- new ProcessorEnumValue("sunc89", C89CCompiler.getInstance()),
- new ProcessorEnumValue("xlC", VisualAgeCCompiler.getInstance()),
- new ProcessorEnumValue("cl6x", ClxxCCompiler.getCl6xInstance()),
- new ProcessorEnumValue("cl55", ClxxCCompiler.getCl55Instance()),
- new ProcessorEnumValue("armcc", ADSCCompiler.getArmCC()),
- new ProcessorEnumValue("armcpp", ADSCCompiler.getArmCpp()),
- new ProcessorEnumValue("tcc", ADSCCompiler.getThumbCC()),
- new ProcessorEnumValue("tcpp", ADSCCompiler.getThumbCpp()),
- // userdefined
- //new ProcessorEnumValue("userdefine", UserdefineCompiler.getInstance()),
- // GCC Cross Compilers
- new ProcessorEnumValue(
- "sparc-sun-solaris2-gcc",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler
- .getInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-g++",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler
- .getGppInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-c++",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler
- .getCppInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-g77",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccCCompiler
- .getG77Instance()),
- // GCC Cross Compilers
- new ProcessorEnumValue("gcc-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler
- .getInstance()),
- new ProcessorEnumValue("g++-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler
- .getGppInstance()),
- new ProcessorEnumValue("c++-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler
- .getCppInstance()),
- new ProcessorEnumValue("g77-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccCCompiler
- .getG77Instance()),};
- public Compiler getCompiler() {
- return (Compiler) compilers[getIndex()].getProcessor();
- }
- public String[] getValues() {
- return ProcessorEnumValue.getValues(compilers);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerParam.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerParam.java
deleted file mode 100644
index 82eb6ee425..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/CompilerParam.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-/*******************************************************************************
- * Place class description here.
- *
- * @author inger
- * @author <additional author>
- *
- * @since
- ******************************************************************************/
-public class CompilerParam extends ProcessorParam {
- public CompilerParam() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyInfo.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyInfo.java
deleted file mode 100644
index 429d2b0107..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyInfo.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.util.Vector;
-/**
- * @author Curt Arnold
- */
-public final class DependencyInfo {
- /**
- * Last modified time of this file or anything that it depends on.
- *
- * Not persisted since almost any change could invalidate it. Initialized
- * to long.MIN_VALUE on construction.
- */
- private long compositeLastModified;
- private/* final */String includePathIdentifier;
- private/* final */String[] includes;
- private/* final */String source;
- private/* final */long sourceLastModified;
- private/* final */String[] sysIncludes;
- public DependencyInfo(String includePathIdentifier, String source,
- long sourceLastModified, Vector includes, Vector sysIncludes) {
- if (source == null) {
- throw new NullPointerException("source");
- }
- if (includePathIdentifier == null) {
- throw new NullPointerException("includePathIdentifier");
- }
- this.source = source;
- this.sourceLastModified = sourceLastModified;
- this.includePathIdentifier = includePathIdentifier;
- this.includes = new String[includes.size()];
- if (includes.size() == 0) {
- compositeLastModified = sourceLastModified;
- } else {
- includes.copyInto(this.includes);
- compositeLastModified = Long.MIN_VALUE;
- }
- this.sysIncludes = new String[sysIncludes.size()];
- sysIncludes.copyInto(this.sysIncludes);
- }
- /**
- * Returns the latest modification date of the source or anything that it
- * depends on.
- *
- * @returns the composite lastModified time, returns Long.MIN_VALUE if not
- * set
- */
- public long getCompositeLastModified() {
- return compositeLastModified;
- }
- public String getIncludePathIdentifier() {
- return includePathIdentifier;
- }
- public String[] getIncludes() {
- String[] includesClone = (String[]) includes.clone();
- return includesClone;
- }
- public String getSource() {
- return source;
- }
- public long getSourceLastModified() {
- return sourceLastModified;
- }
- public String[] getSysIncludes() {
- String[] sysIncludesClone = (String[]) sysIncludes.clone();
- return sysIncludesClone;
- }
- public void setCompositeLastModified(long lastMod) {
- compositeLastModified = lastMod;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyTable.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyTable.java
deleted file mode 100644
index 3cbee7a625..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DependencyTable.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-import net.sf.antcontrib.cpptasks.compiler.CompilerConfiguration;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-/**
- * @author Curt Arnold
- */
-public final class DependencyTable {
- /**
- * This class handles populates the TargetHistory hashtable in response to
- * SAX parse events
- */
- private class DependencyTableHandler extends DefaultHandler {
- private File baseDir;
- private final DependencyTable dependencyTable;
- private String includePath;
- private Vector includes;
- private String source;
- private long sourceLastModified;
- private Vector sysIncludes;
- /**
- * Constructor
- *
- * @param history
- * hashtable of TargetHistory keyed by output name
- * @param outputFiles
- * existing files in output directory
- */
- private DependencyTableHandler(DependencyTable dependencyTable,
- File baseDir) {
- this.dependencyTable = dependencyTable;
- this.baseDir = baseDir;
- includes = new Vector();
- sysIncludes = new Vector();
- source = null;
- }
- public void endElement(String namespaceURI, String localName,
- String qName) throws SAXException {
- //
- // if </source> then
- // create Dependency object and add to hashtable
- // if corresponding source file exists and
- // has the same timestamp
- //
- if (qName.equals("source")) {
- if (source != null && includePath != null) {
- File existingFile = new File(baseDir, source);
- //
- // if the file exists and the time stamp is right
- // preserve the dependency info
- if (existingFile.exists()) {
- //
- // would have expected exact matches
- // but was seeing some unexpected difference by
- // a few tens of milliseconds, as long
- // as the times are within a second
- long existingLastModified = existingFile.lastModified();
- long diff = existingLastModified - sourceLastModified;
- if (diff >= -500 && diff <= 500) {
- DependencyInfo dependInfo = new DependencyInfo(
- includePath, source, sourceLastModified,
- includes, sysIncludes);
- dependencyTable.putDependencyInfo(source,
- dependInfo);
- }
- }
- source = null;
- includes.setSize(0);
- }
- } else {
- //
- // this causes any <source> elements outside the
- // scope of an <includePath> to be discarded
- //
- if (qName.equals("includePath")) {
- includePath = null;
- }
- }
- }
- /**
- * startElement handler
- */
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts) throws SAXException {
- //
- // if includes, then add relative file name to vector
- //
- if (qName.equals("include")) {
- includes.addElement(atts.getValue("file"));
- } else {
- if (qName.equals("sysinclude")) {
- sysIncludes.addElement(atts.getValue("file"));
- } else {
- //
- // if source then
- // capture source file name,
- // modification time and reset includes vector
- //
- if (qName.equals("source")) {
- source = atts.getValue("file");
- sourceLastModified = Long.parseLong(atts
- .getValue("lastModified"), 16);
- includes.setSize(0);
- sysIncludes.setSize(0);
- } else {
- if (qName.equals("includePath")) {
- includePath = atts.getValue("signature");
- }
- }
- }
- }
- }
- }
- public abstract class DependencyVisitor {
- /**
- * Previews all the children of this source file.
- *
- * May be called multiple times as DependencyInfo's for children are
- * filled in.
- *
- * @return true to continue towards recursion into included files
- */
- public abstract boolean preview(DependencyInfo parent,
- DependencyInfo[] children);
- /**
- * Called if the dependency depth exhausted the stack.
- */
- public abstract void stackExhausted();
- /**
- * Visits the dependency info.
- *
- * @returns true to continue towards recursion into included files
- */
- public abstract boolean visit(DependencyInfo dependInfo);
- }
- public class TimestampChecker extends DependencyVisitor {
- private boolean noNeedToRebuild;
- private long outputLastModified;
- private boolean rebuildOnStackExhaustion;
- public TimestampChecker(final long outputLastModified,
- boolean rebuildOnStackExhaustion) {
- this.outputLastModified = outputLastModified;
- noNeedToRebuild = true;
- this.rebuildOnStackExhaustion = rebuildOnStackExhaustion;
- }
- public boolean getMustRebuild() {
- return !noNeedToRebuild;
- }
- public boolean preview(DependencyInfo parent, DependencyInfo[] children) {
- int withCompositeTimes = 0;
- long parentCompositeLastModified = parent.getSourceLastModified();
- for (int i = 0; i < children.length; i++) {
- if (children[i] != null) {
- //
- // expedient way to determine if a child forces us to
- // rebuild
- //
- visit(children[i]);
- long childCompositeLastModified = children[i]
- .getCompositeLastModified();
- if (childCompositeLastModified != Long.MIN_VALUE) {
- withCompositeTimes++;
- if (childCompositeLastModified > parentCompositeLastModified) {
- parentCompositeLastModified = childCompositeLastModified;
- }
- }
- }
- }
- if (withCompositeTimes == children.length) {
- parent.setCompositeLastModified(parentCompositeLastModified);
- }
- //
- // may have been changed by an earlier call to visit()
- //
- return noNeedToRebuild;
- }
- public void stackExhausted() {
- if (rebuildOnStackExhaustion) {
- noNeedToRebuild = false;
- }
- }
- public boolean visit(DependencyInfo dependInfo) {
- if (noNeedToRebuild) {
- if (dependInfo.getSourceLastModified() > outputLastModified
- || dependInfo.getCompositeLastModified() > outputLastModified) {
- noNeedToRebuild = false;
- }
- }
- //
- // only need to process the children if
- // it has not yet been determined whether
- // we need to rebuild and the composite modified time
- // has not been determined for this file
- return noNeedToRebuild
- && dependInfo.getCompositeLastModified() == Long.MIN_VALUE;
- }
- }
- private/* final */File baseDir;
- private String baseDirPath;
- /**
- * a hashtable of DependencyInfo[] keyed by output file name
- */
- private final Hashtable dependencies = new Hashtable();
- /** The file the cache was loaded from. */
- private/* final */File dependenciesFile;
- /** Flag indicating whether the cache should be written back to file. */
- private boolean dirty;
- /**
- * Creates a target history table from dependencies.xml in the prject
- * directory, if it exists. Otherwise, initializes the dependencies empty.
- *
- * @param task
- * task used for logging history load errors
- * @param baseDir
- * output directory for task
- */
- public DependencyTable(File baseDir) {
- if (baseDir == null) {
- throw new NullPointerException("baseDir");
- }
- this.baseDir = baseDir;
- try {
- baseDirPath = baseDir.getCanonicalPath();
- } catch (IOException ex) {
- baseDirPath = baseDir.toString();
- }
- dirty = false;
- //
- // load any existing dependencies from file
- dependenciesFile = new File(baseDir, "dependencies.xml");
- }
- public void commit(CCTask task) {
- //
- // if not dirty, no need to update file
- //
- if (dirty) {
- //
- // walk through dependencies to get vector of include paths
- // identifiers
- //
- Vector includePaths = getIncludePaths();
- //
- //
- // write dependency file
- //
- try {
- FileOutputStream outStream = new FileOutputStream(
- dependenciesFile);
- OutputStreamWriter streamWriter;
- //
- // Early VM's may not have UTF-8 support
- // fallback to default code page which
- // "should" be okay unless there are
- // non ASCII file names
- String encodingName = "UTF-8";
- try {
- streamWriter = new OutputStreamWriter(outStream, "UTF-8");
- } catch (UnsupportedEncodingException ex) {
- streamWriter = new OutputStreamWriter(outStream);
- encodingName = streamWriter.getEncoding();
- }
- BufferedWriter writer = new BufferedWriter(streamWriter);
- writer.write("<?xml version='1.0' encoding='");
- writer.write(encodingName);
- writer.write("'?>\n");
- writer.write("<dependencies>\n");
- StringBuffer buf = new StringBuffer();
- Enumeration includePathEnum = includePaths.elements();
- while (includePathEnum.hasMoreElements()) {
- writeIncludePathDependencies((String) includePathEnum
- .nextElement(), writer, buf);
- }
- writer.write("</dependencies>\n");
- writer.close();
- dirty = false;
- } catch (IOException ex) {
- task.log("Error writing " + dependenciesFile.toString() + ":"
- + ex.toString());
- }
- }
- }
- /**
- * Returns an enumerator of DependencyInfo's
- */
- public Enumeration elements() {
- return dependencies.elements();
- }
- /**
- * This method returns a DependencyInfo for the specific source file and
- * include path identifier
- *
- */
- public DependencyInfo getDependencyInfo(String sourceRelativeName,
- String includePathIdentifier) {
- DependencyInfo dependInfo = null;
- DependencyInfo[] dependInfos = (DependencyInfo[]) dependencies
- .get(sourceRelativeName);
- if (dependInfos != null) {
- for (int i = 0; i < dependInfos.length; i++) {
- dependInfo = dependInfos[i];
- if (dependInfo.getIncludePathIdentifier().equals(
- includePathIdentifier)) {
- return dependInfo;
- }
- }
- }
- return null;
- }
- private Vector getIncludePaths() {
- Vector includePaths = new Vector();
- DependencyInfo[] dependInfos;
- Enumeration dependenciesEnum = dependencies.elements();
- while (dependenciesEnum.hasMoreElements()) {
- dependInfos = (DependencyInfo[]) dependenciesEnum.nextElement();
- for (int i = 0; i < dependInfos.length; i++) {
- DependencyInfo dependInfo = dependInfos[i];
- boolean matchesExisting = false;
- final String dependIncludePath = dependInfo
- .getIncludePathIdentifier();
- Enumeration includePathEnum = includePaths.elements();
- while (includePathEnum.hasMoreElements()) {
- if (dependIncludePath.equals(includePathEnum.nextElement())) {
- matchesExisting = true;
- break;
- }
- }
- if (!matchesExisting) {
- includePaths.addElement(dependIncludePath);
- }
- }
- }
- return includePaths;
- }
- public void load() throws IOException, ParserConfigurationException,
- SAXException {
- dependencies.clear();
- if (dependenciesFile.exists()) {
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setValidating(false);
- SAXParser parser = factory.newSAXParser();
- parser.parse(dependenciesFile, new DependencyTableHandler(this,
- baseDir));
- dirty = false;
- }
- }
- /**
- * Determines if the specified target needs to be rebuilt.
- *
- * This task may result in substantial IO as files are parsed to determine
- * their dependencies
- */
- public boolean needsRebuild(CCTask task, TargetInfo target,
- int dependencyDepth) {
- // look at any files where the compositeLastModified
- // is not known, but the includes are known
- //
- boolean mustRebuild = false;
- CompilerConfiguration compiler = (CompilerConfiguration) target
- .getConfiguration();
- String includePathIdentifier = compiler.getIncludePathIdentifier();
- File[] sources = target.getSources();
- DependencyInfo[] dependInfos = new DependencyInfo[sources.length];
- long outputLastModified = target.getOutput().lastModified();
- //
- // try to solve problem using existing dependency info
- // (not parsing any new files)
- //
- DependencyInfo[] stack = new DependencyInfo[50];
- boolean rebuildOnStackExhaustion = true;
- if (dependencyDepth >= 0) {
- if (dependencyDepth < 50) {
- stack = new DependencyInfo[dependencyDepth];
- }
- rebuildOnStackExhaustion = false;
- }
- TimestampChecker checker = new TimestampChecker(outputLastModified,
- rebuildOnStackExhaustion);
- for (int i = 0; i < sources.length && !mustRebuild; i++) {
- File source = sources[i];
- String relative = CUtil.getRelativePath(baseDirPath, source);
- DependencyInfo dependInfo = getDependencyInfo(relative,
- includePathIdentifier);
- if (dependInfo == null) {
- task.log("Parsing " + relative, Project.MSG_VERBOSE);
- dependInfo = parseIncludes(task, compiler, source);
- }
- walkDependencies(task, dependInfo, compiler, stack, checker);
- mustRebuild = checker.getMustRebuild();
- }
- return mustRebuild;
- }
- public DependencyInfo parseIncludes(CCTask task,
- CompilerConfiguration compiler, File source) {
- DependencyInfo dependInfo = compiler.parseIncludes(task, baseDir,
- source);
- String relativeSource = CUtil.getRelativePath(baseDirPath, source);
- putDependencyInfo(relativeSource, dependInfo);
- return dependInfo;
- }
- private void putDependencyInfo(String key, DependencyInfo dependInfo) {
- //
- // optimistic, add new value
- //
- DependencyInfo[] old = (DependencyInfo[]) dependencies.put(key,
- new DependencyInfo[]{dependInfo});
- dirty = true;
- //
- // something was already there
- //
- if (old != null) {
- //
- // see if the include path matches a previous entry
- // if so replace it
- String includePathIdentifier = dependInfo
- .getIncludePathIdentifier();
- for (int i = 0; i < old.length; i++) {
- DependencyInfo oldDepend = old[i];
- if (oldDepend.getIncludePathIdentifier().equals(
- includePathIdentifier)) {
- old[i] = dependInfo;
- dependencies.put(key, old);
- return;
- }
- }
- //
- // no match prepend the new entry to the array
- // of dependencies for the file
- DependencyInfo[] combined = new DependencyInfo[old.length + 1];
- combined[0] = dependInfo;
- for (int i = 0; i < old.length; i++) {
- combined[i + 1] = old[i];
- }
- dependencies.put(key, combined);
- }
- return;
- }
- public void walkDependencies(CCTask task, DependencyInfo dependInfo,
- CompilerConfiguration compiler, DependencyInfo[] stack,
- DependencyVisitor visitor) throws BuildException {
- //
- // visit this node
- // if visit returns true then
- // visit the referenced include and sysInclude dependencies
- //
- if (visitor.visit(dependInfo)) {
- //
- // find first null entry on stack
- //
- int stackPosition = -1;
- for (int i = 0; i < stack.length; i++) {
- if (stack[i] == null) {
- stackPosition = i;
- stack[i] = dependInfo;
- break;
- } else {
- //
- // if we have appeared early in the calling history
- // then we didn't exceed the criteria
- if (stack[i] == dependInfo) {
- return;
- }
- }
- }
- if (stackPosition == -1) {
- visitor.stackExhausted();
- return;
- }
- //
- // locate dependency infos
- //
- String[] includes = dependInfo.getIncludes();
- String includePathIdentifier = compiler.getIncludePathIdentifier();
- DependencyInfo[] includeInfos = new DependencyInfo[includes.length];
- for (int i = 0; i < includes.length; i++) {
- DependencyInfo includeInfo = getDependencyInfo(includes[i],
- includePathIdentifier);
- includeInfos[i] = includeInfo;
- }
- //
- // preview with only the already available dependency infos
- //
- if (visitor.preview(dependInfo, includeInfos)) {
- //
- // now need to fill in the missing DependencyInfos
- //
- int missingCount = 0;
- for (int i = 0; i < includes.length; i++) {
- if (includeInfos[i] == null) {
- missingCount++;
- task.log("Parsing " + includes[i], Project.MSG_VERBOSE);
- // If the include is part of a UNC don't go building a
- // relative file name.
- File src = includes[i].startsWith("\\\\") ? new File(
- includes[i]) : new File(baseDir, includes[i]);
- DependencyInfo includeInfo = parseIncludes(task,
- compiler, src);
- includeInfos[i] = includeInfo;
- }
- }
- //
- // if it passes a review the second time
- // then recurse into all the children
- if (missingCount == 0
- || visitor.preview(dependInfo, includeInfos)) {
- //
- // recurse into
- //
- for (int i = 0; i < includeInfos.length; i++) {
- DependencyInfo includeInfo = includeInfos[i];
- walkDependencies(task, includeInfo, compiler, stack,
- visitor);
- }
- }
- }
- stack[stackPosition] = null;
- }
- }
- private void writeDependencyInfo(BufferedWriter writer, StringBuffer buf,
- DependencyInfo dependInfo) throws IOException {
- String[] includes = dependInfo.getIncludes();
- String[] sysIncludes = dependInfo.getSysIncludes();
- //
- // if the includes have not been evaluted then
- // it is not worth our time saving it
- // and trying to distiguish between files with
- // no dependencies and those with undetermined dependencies
- buf.setLength(0);
- buf.append(" <source file=\"");
- buf.append(CUtil.xmlAttribEncode(dependInfo.getSource()));
- buf.append("\" lastModified=\"");
- buf.append(Long.toHexString(dependInfo.getSourceLastModified()));
- buf.append("\">\n");
- writer.write(buf.toString());
- for (int i = 0; i < includes.length; i++) {
- buf.setLength(0);
- buf.append(" <include file=\"");
- buf.append(CUtil.xmlAttribEncode(includes[i]));
- buf.append("\"/>\n");
- writer.write(buf.toString());
- }
- for (int i = 0; i < sysIncludes.length; i++) {
- buf.setLength(0);
- buf.append(" <sysinclude file=\"");
- buf.append(CUtil.xmlAttribEncode(sysIncludes[i]));
- buf.append("\"/>\n");
- writer.write(buf.toString());
- }
- writer.write(" </source>\n");
- return;
- }
- private void writeIncludePathDependencies(String includePathIdentifier,
- BufferedWriter writer, StringBuffer buf) throws IOException {
- //
- // include path element
- //
- buf.setLength(0);
- buf.append(" <includePath signature=\"");
- buf.append(CUtil.xmlAttribEncode(includePathIdentifier));
- buf.append("\">\n");
- writer.write(buf.toString());
- Enumeration dependenciesEnum = dependencies.elements();
- while (dependenciesEnum.hasMoreElements()) {
- DependencyInfo[] dependInfos = (DependencyInfo[]) dependenciesEnum
- .nextElement();
- for (int i = 0; i < dependInfos.length; i++) {
- DependencyInfo dependInfo = dependInfos[i];
- //
- // if this is for the same include path
- // then output the info
- if (dependInfo.getIncludePathIdentifier().equals(
- includePathIdentifier)) {
- writeDependencyInfo(writer, buf, dependInfo);
- }
- }
- }
- writer.write(" </includePath>\n");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerDef.java
deleted file mode 100644
index ee4f656ccc..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerDef.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-import java.util.Vector;
-
-/**
- * Distributed build information (Non-functional prototype).
- *
- */
-public final class DistributerDef
- extends DataType {
- /**
- * if property.
- */
- private String ifCond;
-
- /**
- * unless property.
- */
- private String unlessCond;
-
- /**
- * hosts.
- *
- */
- private String hosts;
-
- /**
- * Protocol.
- *
- */
- private DistributerProtocolEnum protocol;
-
- /**
- * Not sure what this is.
- */
- private int tcpCork;
-
- /**
- * user name.
- */
- private String user;
-
- /**
- * local to remote file name maps.
- */
- private final Vector maps = new Vector();
-
- /**
- * Constructor.
- *
- */
- public DistributerDef() {
- }
-
- /**
- * Required by documentation generator.
- */
- public void execute() {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- /**
- * Returns true if the if and unless conditions (if any) are
- * satisfied.
- * @return true if definition is active.
- */
- public boolean isActive() {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
-
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(final String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
-
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(final String propName) {
- ifCond = propName;
- }
-
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes should be specified.
- * @param r reference name
- */
- public void setRefid(final Reference r) {
- super.setRefid(r);
- }
-
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(final String propName) {
- unlessCond = propName;
- }
-
- /**
- * Gets hosts.
- * @return hosts, may be null.
- *
- */
- public String getHosts() {
- if (isReference()) {
- DistributerDef refDistributer = (DistributerDef)
- getCheckedRef(DistributerDef.class,
- "DistributerDef");
- return refDistributer.getHosts();
- }
- return hosts;
- }
-
- /**
- * Gets tcp cork.
- * @return TCP_CORK value.
- *
- */
- public int getTcpcork() {
- if (isReference()) {
- DistributerDef refDistributer = (DistributerDef)
- getCheckedRef(DistributerDef.class,
- "DistributerDef");
- return refDistributer.getTcpcork();
- }
- return tcpCork;
- }
-
- /**
- * Gets protocol.
- * @return protocol, may be null.
- *
- */
- public DistributerProtocolEnum getProtocol() {
- if (isReference()) {
- DistributerDef refDistributer = (DistributerDef)
- getCheckedRef(DistributerDef.class,
- "DistributerDef");
- return refDistributer.getProtocol();
- }
- return protocol;
- }
-
- /**
- * Sets hosts.
- * @param value new value
- */
- public void setHosts(final String value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- hosts = value;
- }
-
- /**
- * Sets TCP_CORK value.
- * @param value new value
- */
- public void setTcpcork(final int value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- tcpCork = value;
- }
-
- /**
- * Sets protocol.
- * @param value new value
- */
- public void setProtocol(final DistributerProtocolEnum value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- protocol = value;
- }
-
- /**
- * Local to remote filename maps.
- * @return new map
- */
- public DistributerMap createMap() {
- DistributerMap map = new DistributerMap();
- map.setProject(getProject());
- maps.addElement(map);
- return map;
- }
-
- /**
- * Sets remote user name.
- * @param value user name
- */
- public void setUser(final String value) {
- user = value;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerMap.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerMap.java
deleted file mode 100644
index aeacf551fa..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerMap.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.DataType;
-
-/**
- * Local to remote filename mapping (Experimental).
- *
- */
-public final class DistributerMap
- extends DataType {
- /**
- * if property.
- */
- private String ifCond;
-
- /**
- * unless property.
- */
- private String unlessCond;
-
- /**
- * local directory name.
- *
- */
- private File localName;
-
- /**
- * Canonical local file name.
- */
- private String canonicalPath;
-
- /**
- * remote name.
- *
- */
- private String remoteName;
-
- /**
- * Separator (/ or \) character on remote system.
- */
- private char remoteSeparator = File.separatorChar;
-
- /**
- * hosts that for which this map is valid.
- *
- */
- private String hosts;
-
- /**
- * Constructor.
- *
- */
- public DistributerMap() {
- }
-
- /**
- * Required by documentation generator.
- */
- public void execute() {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- /**
- * Returns true if the if and unless conditions (if any) are
- * satisfied.
- *
- * @return true if this object is active.
- */
- public boolean isActive() {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
-
- /**
- * Sets the property name for the 'if' condition.
- *
- * This object will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(final String propName) {
- ifCond = propName;
- }
-
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(final String propName) {
- unlessCond = propName;
- }
-
- /**
- * Gets local directory.
- * @return local directory, may be null.
- *
- */
- public File getLocal() {
- return localName;
- }
-
- /**
- * Gets remote name for directory.
- * @return remote name, may be null.
- *
- */
- public String getRemote() {
- return remoteName;
- }
-
- /**
- * Converts the local file name to the remote name for the same file.
- *
- * @param host host
- * @param localFile local file
- * @return remote name for local file, null if unknown.
- */
- public String toRemote(final String host, final File localFile) {
- if (remoteName != null
- && (hosts == null || hosts.indexOf(host) >= 0)) {
- try {
- String canonical = localFile.getCanonicalPath();
- if (canonical.startsWith(canonicalPath)) {
- if (isActive()) {
- return remoteName
- + canonical.substring(canonicalPath.length()).replace(File.
- separatorChar, remoteSeparator);
- }
- }
- } catch (IOException ex) {
- return null;
- }
- }
- return null;
- }
-
- /**
- * Sets local directory for base of mapping.
- *
- * @param value value
- */
- public void setLocal(final File value) {
- if (value == null) {
- throw new NullPointerException("value");
- }
- if (value.exists() && !value.isDirectory()) {
- throw new BuildException("local should be a directory");
- }
- localName = value;
- try {
- canonicalPath = localName.getCanonicalPath();
- } catch (IOException ex) {
- throw new BuildException(ex);
- }
- }
-
- /**
- * Sets remote name for directory.
- * @param value remote name for directory
- */
- public void setRemote(final String value) {
- remoteName = value;
- }
-
- /**
- * Sets the separator character (/ or \) for the remote system.
- * @param value separator character
- */
- public void setRemoteSeparator(final String value) {
- if (value != null && value.length() != 1) {
- throw new BuildException("remote separator must be a single character");
- }
- remoteSeparator = value.charAt(0);
- }
-
- /**
- * Sets hosts for which this mapping is valid.
- *
- * @param value hosts
- */
- public void setHosts(final String value) {
- hosts = value;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerProtocolEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerProtocolEnum.java
deleted file mode 100644
index 5606d47a08..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/DistributerProtocolEnum.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Distributer prococol names (experimental).
- *
- * @author Curt Arnold
- *
- */
-public final class DistributerProtocolEnum
- extends EnumeratedAttribute {
- /**
- * Constructor.
- *
- * Set by default to "distcc"
- *
- * @see java.lang.Object#Object()
- */
- public DistributerProtocolEnum() {
- setValue("distcc");
- }
-
- /**
- * Gets list of acceptable values.
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[] {
- "distcc",
- "ssh"};
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/FileVisitor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/FileVisitor.java
deleted file mode 100644
index 24aef25fb6..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/FileVisitor.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-/**
- * An abstract class implemented to walk over the fileset members of a
- * ProcessorDef
- */
-public interface FileVisitor {
- abstract void visit(File parentDir, String filename) throws BuildException;
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerDef.java
deleted file mode 100644
index d997b2f992..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerDef.java
+++ /dev/null
@@ -1,549 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-import net.sf.antcontrib.cpptasks.gcc.GccLinker;
-import net.sf.antcontrib.cpptasks.types.FlexLong;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LinkerArgument;
-import net.sf.antcontrib.cpptasks.types.SystemLibrarySet;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.FlexInteger;
-/**
- * A linker definition. linker elements may be placed either as children of a
- * cc element or the project element. A linker element with an id attribute may
- * be referenced by linker elements with refid or extends attributes.
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public class LinkerDef extends ProcessorDef {
- private long base;
- private String entry;
- private Boolean fixed;
- private Boolean incremental;
- private final Vector librarySets = new Vector();
- private Boolean map;
- private int stack;
- private final Vector sysLibrarySets = new Vector();
- private final Vector versionInfos = new Vector();
- private Boolean defaultflag = new Boolean(true);
- /**
- * Default constructor
- *
- * @see java.lang.Object#Object()
- */
- public LinkerDef() {
- base = -1;
- stack = -1;
- }
- private void addActiveLibrarySet(Project project, Vector libsets,
- Vector srcSets) {
- Enumeration srcenum = srcSets.elements();
- while (srcenum.hasMoreElements()) {
- LibrarySet set = (LibrarySet) srcenum.nextElement();
- if (set.isActive(project)) {
- libsets.addElement(set);
- }
- }
- }
- private void addActiveSystemLibrarySets(Project project, Vector libsets) {
- addActiveLibrarySet(project, libsets, sysLibrarySets);
- }
- private void addActiveUserLibrarySets(Project project, Vector libsets) {
- addActiveLibrarySet(project, libsets, librarySets);
- }
- /**
- * Adds a linker command-line arg.
- */
- public void addConfiguredLinkerArg(LinkerArgument arg) {
- addConfiguredProcessorArg(arg);
- }
- /**
- * Adds a compiler command-line arg.
- */
- public void addConfiguredLinkerParam(LinkerParam param) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorParam(param);
- }
- /**
- * Adds a system library set.
- */
- public void addLibset(LibrarySet libset) {
- if (isReference()) {
- throw super.noChildrenAllowed();
- }
- if (libset == null) {
- throw new NullPointerException("libset");
- }
- librarySets.addElement(libset);
- }
- /**
- * Adds a system library set.
- */
- public void addSyslibset(SystemLibrarySet libset) {
- if (isReference()) {
- throw super.noChildrenAllowed();
- }
- if (libset == null) {
- throw new NullPointerException("libset");
- }
- sysLibrarySets.addElement(libset);
- }
-
- /**
- * Adds desriptive version information to be included in the
- * generated file. The first active version info block will
- * be used.
- */
- public void addConfiguredVersioninfo(VersionInfo newVersionInfo) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- newVersionInfo.setProject(this.getProject());
- versionInfos.addElement(newVersionInfo);
- }
-
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef baseDef, TargetDef targetPlatform) {
- //
- // must combine some local context (the linkType)
- // with the referenced element
- //
- // get a pointer to the definition (either local or referenced)
- ProcessorDef thisDef = this;
- if (isReference()) {
- thisDef = ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef"));
- }
- //
- // find the appropriate processor (combines local linkType
- // with possibly remote linker name)
- Processor proc = getProcessor();
- proc = proc.getLinker(linkType);
- ProcessorDef[] defaultProviders = getDefaultProviders(baseDef);
- return proc.createConfiguration(task, linkType, defaultProviders,
- thisDef, targetPlatform);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * Returns an array of active library sets for this linker definition.
- */
- public LibrarySet[] getActiveLibrarySets(LinkerDef[] defaultProviders,
- int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getActiveUserLibrarySets(defaultProviders, index);
- }
- Project p = getProject();
- Vector libsets = new Vector();
- for (int i = index; i < defaultProviders.length; i++) {
- defaultProviders[i].addActiveUserLibrarySets(p, libsets);
- defaultProviders[i].addActiveSystemLibrarySets(p, libsets);
- }
- addActiveUserLibrarySets(p, libsets);
- addActiveSystemLibrarySets(p, libsets);
- LibrarySet[] sets = new LibrarySet[libsets.size()];
- libsets.copyInto(sets);
- return sets;
- }
- /**
- * Returns an array of active library sets for this linker definition.
- */
- public LibrarySet[] getActiveSystemLibrarySets(
- LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getActiveUserLibrarySets(defaultProviders, index);
- }
- Project p = getProject();
- Vector libsets = new Vector();
- for (int i = index; i < defaultProviders.length; i++) {
- defaultProviders[i].addActiveSystemLibrarySets(p, libsets);
- }
- addActiveSystemLibrarySets(p, libsets);
- LibrarySet[] sets = new LibrarySet[libsets.size()];
- libsets.copyInto(sets);
- return sets;
- }
- /**
- * Returns an array of active library sets for this linker definition.
- */
- public LibrarySet[] getActiveUserLibrarySets(LinkerDef[] defaultProviders,
- int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getActiveUserLibrarySets(defaultProviders, index);
- }
- Project p = getProject();
- Vector libsets = new Vector();
- for (int i = index; i < defaultProviders.length; i++) {
- defaultProviders[i].addActiveUserLibrarySets(p, libsets);
- }
- addActiveUserLibrarySets(p, libsets);
- LibrarySet[] sets = new LibrarySet[libsets.size()];
- libsets.copyInto(sets);
- return sets;
- }
- public long getBase(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getBase(defaultProviders, index);
- }
- if (base <= 0) {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getBase(defaultProviders,
- index + 1);
- }
- }
- return base;
- }
- public Boolean getFixed(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getFixed(defaultProviders, index);
- }
- if (fixed == null) {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getFixed(defaultProviders,
- index + 1);
- }
- }
- return fixed;
- }
- public boolean getIncremental(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getIncremental(defaultProviders, index);
- }
- if (incremental != null) {
- return incremental.booleanValue();
- }
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getIncremental(defaultProviders, index + 1);
- }
- return false;
- }
- public boolean getMap(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getMap(defaultProviders, index);
- }
- if (map != null) {
- return map.booleanValue();
- }
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getMap(defaultProviders, index + 1);
- }
- return false;
- }
- public final Boolean getDefaultflag(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class,
- "LinkerDef")).getDefaultflag(defaultProviders, index);
- }
- return defaultflag;
- }
- public String getEntry(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getEntry(defaultProviders, index);
- }
- if (entry != null) {
- return entry;
- }
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getEntry(defaultProviders, index + 1);
- }
- return null;
- }
-
- public Processor getProcessor() {
- Linker linker = (Linker) super.getProcessor();
- if (linker == null) {
- linker = GccLinker.getInstance();
- }
- if (getLibtool() && linker instanceof CommandLineLinker) {
- CommandLineLinker cmdLineLinker = (CommandLineLinker) linker;
- linker = cmdLineLinker.getLibtoolLinker();
- }
- return linker;
- }
- public int getStack(LinkerDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((LinkerDef) getCheckedRef(LinkerDef.class, "LinkerDef"))
- .getStack(defaultProviders, index);
- }
- if (stack < 0) {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getStack(defaultProviders,
- index + 1);
- }
- }
- return stack;
- }
- /**
- * Sets the base address. May be specified in either decimal or hex.
- *
- * @param base
- * base address
- *
- */
- public void setBase(FlexLong base) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.base = base.longValue();
- }
- /**
- * Sets the starting address.
- *
- * @param name
- * function name
- */
- public void setEntry(String entry) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.entry = entry;
- }
- /**
- * If true, marks the file to be loaded only at its preferred address.
- */
- public void setFixed(boolean fixed) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.fixed = booleanValueOf(fixed);
- }
- /**
- * If true, allows incremental linking.
- *
- */
- public void setIncremental(boolean incremental) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.incremental = booleanValueOf(incremental);
- }
- /**
- * If set to true, a map file will be produced.
- */
- public void setMap(boolean map) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.map = booleanValueOf(map);
- }
- /**
- * Sets linker type.
- *
- *
- * <table width="100%" border="1"> <thead>Supported linkers </thead>
- * <tr>
- * <td>gcc</td>
- * <td>Gcc Linker</td>
- * </tr>
- * <tr>
- * <td>g++</td>
- * <td>G++ Linker</td>
- * </tr>
- * <tr>
- * <td>ld</td>
- * <td>Ld Linker</td>
- * </tr>
- * <tr>
- * <td>ar</td>
- * <td>Gcc Librarian</td>
- * </tr>
- * <tr>
- * <td>msvc</td>
- * <td>Microsoft Linker</td>
- * </tr>
- * <tr>
- * <td>bcc</td>
- * <td>Borland Linker</td>
- * </tr>
- * <tr>
- * <td>df</td>
- * <td>Compaq Visual Fortran Linker</td>
- * </tr>
- * <tr>
- * <td>icl</td>
- * <td>Intel Linker for Windows (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecl</td>
- * <td>Intel Linker for Windows (IA-64)</td>
- * </tr>
- * <tr>
- * <td>icc</td>
- * <td>Intel Linker for Linux (IA-32)</td>
- * </tr>
- * <tr>
- * <td>ecc</td>
- * <td>Intel Linker for Linux (IA-64)</td>
- * </tr>
- * <tr>
- * <td>CC</td>
- * <td>Sun ONE Linker</td>
- * </tr>
- * <tr>
- * <td>aCC</td>
- * <td>HP aC++ Linker</td>
- * </tr>
- * <tr>
- * <td>os390</td>
- * <td>OS390 Linker</td>
- * </tr>
- * <tr>
- * <td>os390batch</td>
- * <td>OS390 Linker</td>
- * </tr>
- * <tr>
- * <td>os400</td>
- * <td>IccLinker</td>
- * </tr>
- * <tr>
- * <td>sunc89</td>
- * <td>C89 Linker</td>
- * </tr>
- * <tr>
- * <td>xlC</td>
- * <td>VisualAge Linker</td>
- * </tr>
- * </table>
- *
- */
- public void setName(LinkerEnum name) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- Linker linker = name.getLinker();
- super.setProcessor(linker);
- }
- protected void setProcessor(Processor proc) throws BuildException {
- Linker linker = null;
- if (proc instanceof Linker) {
- linker = (Linker) proc;
- } else {
- LinkType linkType = new LinkType();
- linker = proc.getLinker(linkType);
- }
- super.setProcessor(linker);
- }
- /**
- * Sets stack size in bytes.
- */
- public void setStack(FlexInteger stack) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.stack = stack.intValue();
- }
- public void visitSystemLibraries(Linker linker, FileVisitor libraryVisitor) {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- LinkerDef master = ((LinkerDef) getCheckedRef(LinkerDef.class,
- "Linker"));
- master.visitSystemLibraries(linker, libraryVisitor);
- } else {
- //
- // if this linker extends another,
- // visit its libraries first
- //
- LinkerDef extendsDef = (LinkerDef) getExtends();
- if (extendsDef != null) {
- extendsDef.visitSystemLibraries(linker, libraryVisitor);
- }
- if (sysLibrarySets.size() > 0) {
- File[] libpath = linker.getLibraryPath();
- for (int i = 0; i < sysLibrarySets.size(); i++) {
- LibrarySet set = (LibrarySet) sysLibrarySets.elementAt(i);
- if (set.isActive(p)) {
- set.visitLibraries(p, linker, libpath,
- libraryVisitor);
- }
- }
- }
- }
- }
- public void visitUserLibraries(Linker linker, FileVisitor libraryVisitor) {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- LinkerDef master = ((LinkerDef) getCheckedRef(LinkerDef.class,
- "Linker"));
- master.visitUserLibraries(linker, libraryVisitor);
- } else {
- //
- // if this linker extends another,
- // visit its libraries first
- //
- LinkerDef extendsDef = (LinkerDef) getExtends();
- if (extendsDef != null) {
- extendsDef.visitUserLibraries(linker, libraryVisitor);
- }
- //
- // visit the user libraries
- //
- if (librarySets.size() > 0) {
- File[] libpath = linker.getLibraryPath();
- for (int i = 0; i < librarySets.size(); i++) {
- LibrarySet set = (LibrarySet) librarySets.elementAt(i);
- if (set.isActive(p)) {
- set.visitLibraries(p, linker, libpath,
- libraryVisitor);
- }
- }
- }
- }
- }
- /**
- * Enables or disables default flags.
- *
- * @param defaultflag
- * if true, default flags will add to command line.
- *
- */
- public void setDefaultflag(boolean defaultflag) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.defaultflag = booleanValueOf(defaultflag);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerEnum.java
deleted file mode 100644
index cfe8984c23..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerEnum.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import net.sf.antcontrib.cpptasks.arm.ADSLinker;
-import net.sf.antcontrib.cpptasks.borland.BorlandLinker;
-import net.sf.antcontrib.cpptasks.compaq.CompaqVisualFortranLinker;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioLinker;
-import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;
-import net.sf.antcontrib.cpptasks.gcc.GccLinker;
-import net.sf.antcontrib.cpptasks.gcc.GppLinker;
-import net.sf.antcontrib.cpptasks.gcc.LdLinker;
-import net.sf.antcontrib.cpptasks.hp.aCCLinker;
-import net.sf.antcontrib.cpptasks.ibm.VisualAgeLinker;
-import net.sf.antcontrib.cpptasks.intel.IntelLinux32Linker;
-import net.sf.antcontrib.cpptasks.intel.IntelLinux64Linker;
-import net.sf.antcontrib.cpptasks.intel.IntelWin32Linker;
-import net.sf.antcontrib.cpptasks.os390.OS390Linker;
-import net.sf.antcontrib.cpptasks.os400.IccLinker;
-import net.sf.antcontrib.cpptasks.sun.C89Linker;
-import net.sf.antcontrib.cpptasks.sun.ForteCCLinker;
-import net.sf.antcontrib.cpptasks.ti.ClxxLinker;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of supported linkers
- *
- * @author Curt Arnold
- *
- */
-public class LinkerEnum extends EnumeratedAttribute {
- private final static ProcessorEnumValue[] linkers = new ProcessorEnumValue[]{
- new ProcessorEnumValue("gcc", GccLinker.getInstance()),
- new ProcessorEnumValue("g++", GppLinker.getInstance()),
- new ProcessorEnumValue("ld", LdLinker.getInstance()),
- new ProcessorEnumValue("ar", GccLibrarian.getInstance()),
- new ProcessorEnumValue("msvc", DevStudioLinker.getInstance()),
- new ProcessorEnumValue("bcc", BorlandLinker.getInstance()),
- new ProcessorEnumValue("df", CompaqVisualFortranLinker
- .getInstance()),
- new ProcessorEnumValue("icl", IntelWin32Linker.getInstance()),
- new ProcessorEnumValue("ecl", IntelWin32Linker.getInstance()),
- new ProcessorEnumValue("icc", IntelLinux32Linker.getInstance()),
- new ProcessorEnumValue("ecc", IntelLinux64Linker.getInstance()),
- new ProcessorEnumValue("CC", ForteCCLinker.getInstance()),
- new ProcessorEnumValue("aCC", aCCLinker.getInstance()),
- new ProcessorEnumValue("os390", OS390Linker.getInstance()),
- new ProcessorEnumValue("os390batch", OS390Linker
- .getDataSetInstance()),
- new ProcessorEnumValue("os400", IccLinker.getInstance()),
- new ProcessorEnumValue("sunc89", C89Linker.getInstance()),
- new ProcessorEnumValue("xlC", VisualAgeLinker.getInstance()),
- new ProcessorEnumValue("cl6x", ClxxLinker.getCl6xInstance()),
- new ProcessorEnumValue("cl55", ClxxLinker.getCl55Instance()),
- new ProcessorEnumValue("armcc", ADSLinker.getInstance()),
- new ProcessorEnumValue("armcpp", ADSLinker.getInstance()),
- new ProcessorEnumValue("tcc", ADSLinker.getInstance()),
- new ProcessorEnumValue("tcpp", ADSLinker.getInstance()),
- // gcc cross compilers
- new ProcessorEnumValue(
- "sparc-sun-solaris2-gcc",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccLinker
- .getInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-g++",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GppLinker
- .getInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-ld",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.LdLinker
- .getInstance()),
- new ProcessorEnumValue(
- "sparc-sun-solaris2-ar",
- net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2.GccLibrarian
- .getInstance()),
- new ProcessorEnumValue("gcc-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccLinker
- .getInstance()),
- new ProcessorEnumValue("g++-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GppLinker
- .getInstance()),
- new ProcessorEnumValue("ld-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.LdLinker.getInstance()),
- new ProcessorEnumValue("ar-cross",
- net.sf.antcontrib.cpptasks.gcc.cross.GccLibrarian
- .getInstance()),};
- public Linker getLinker() {
- return (Linker) linkers[getIndex()].getProcessor();
- }
- public String[] getValues() {
- return ProcessorEnumValue.getValues(linkers);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerParam.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerParam.java
deleted file mode 100644
index 383bae55c9..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/LinkerParam.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-/*******************************************************************************
- * Place class description here.
- *
- * @author inger
- * @author <additional author>
- *
- * @since
- ******************************************************************************/
-public class LinkerParam extends ProcessorParam {
- public LinkerParam() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OSFamilyEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OSFamilyEnum.java
deleted file mode 100644
index 536d9922d3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OSFamilyEnum.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of cpu types.
- *
- * @author Curt Arnold
- *
- */
-public final class OSFamilyEnum
- extends EnumeratedAttribute {
- /**
- * Constructor.
- *
- * Set by default to "pentium3"
- *
- * @see java.lang.Object#Object()
- */
- public OSFamilyEnum() {
- setValue("windows");
- }
-
- /**
- * Gets list of acceptable values.
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[] {
- "windows",
- "dos",
- "mac",
- "unix",
- "netware",
- "os/2",
- "tandem",
- "win9x",
- "z/os",
- "os/400",
- "openvms"};
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ObjectFileCollector.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ObjectFileCollector.java
deleted file mode 100644
index 3e97fa40af..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ObjectFileCollector.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Collects object files for the link step.
- *
- *
- */
-public final class ObjectFileCollector implements FileVisitor {
- private final Vector files;
- private final Linker linker;
- public ObjectFileCollector(Linker linker, Vector files) {
- this.linker = linker;
- this.files = files;
- }
- public void visit(File parentDir, String filename) throws BuildException {
- int bid = linker.bid(filename);
- if (bid >= 1) {
- files.addElement(new File(parentDir, filename));
- }
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OptimizationEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OptimizationEnum.java
deleted file mode 100644
index 4a0d17953e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OptimizationEnum.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-
-/**
- * Enumeration of optimization levels (experimental).
- *
- * @author Curt Arnold
- *
- */
-public final class OptimizationEnum
- extends EnumeratedAttribute {
- /**
- * Constructor.
- *
- * Set by default to "speed"
- *
- * @see java.lang.Object#Object()
- */
- public OptimizationEnum() {
- setValue("speed");
- }
-
- /**
- * Gets list of acceptable values.
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[] {
- "none",
- "size",
- "minimal",
- "speed",
- "full",
- "aggressive",
- "extreme",
- "unsafe"
- };
- }
-
- /**
- * Is size optimized.
- * @return boolean true if size is optimized.
- */
- public boolean isSize() {
- return "speed".equals(getValue());
- }
-
- /**
- * Is speed optimized.
- * @return boolean true if speed is optimized.
- */
- public boolean isSpeed() {
- return !isSize() && !isNoOptimization();
- }
-
- /**
- * Is no optimization performed.
- * @return boolean true if no optimization is performed.
- */
- public boolean isNoOptimization() {
- return "none".equals(getValue());
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OutputTypeEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OutputTypeEnum.java
deleted file mode 100644
index fb37843fbc..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/OutputTypeEnum.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of supported subsystems
- *
- * @author Curt Arnold
- *
- */
-public class OutputTypeEnum extends EnumeratedAttribute {
- /**
- * Constructor
- *
- * Set by default to "executable"
- *
- * @see java.lang.Object#Object()
- */
- public OutputTypeEnum() {
- setValue("executable");
- }
- /**
- * Gets list of acceptable values
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[]{"executable", // executable program
- "plugin", // plugin module
- "shared", // dynamically linkable module
- "static" // convenience library
- };
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileDef.java
deleted file mode 100644
index 828e2c2f48..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileDef.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.types.DataType;
-/**
- * An element that specifies a prototype file and rules for source files that
- * should not use precompiled headers
- *
- * @author Curt Arnold
- */
-public final class PrecompileDef extends DataType {
- private final Vector exceptSets = new Vector();
- private String ifCond;
- /**
- * Directory of prototype file
- */
- private File prototype = new File("stdafx.cpp");
- private String unlessCond;
- /**
- * Constructor
- *
- */
- public PrecompileDef() {
- }
- /**
- * Method used by PrecompileExceptDef to add exception set to
- * PrecompileDef.
- */
- public void appendExceptFileSet(ConditionalFileSet exceptSet) {
- exceptSet.setProject(getProject());
- exceptSets.addElement(exceptSet);
- }
- /**
- * Adds filesets that specify files that should not be processed with
- * precompiled headers enabled.
- *
- * @param exceptSet
- * FileSet specify files that should not be processed with
- * precompiled headers enabled.
- */
- public PrecompileExceptDef createExcept() {
- return new PrecompileExceptDef(this);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- public String[] getExceptFiles() {
- PrecompileDef ref = getRef();
- if (ref != null) {
- return ref.getExceptFiles();
- }
- if (exceptSets.size() == 0) {
- return new String[0];
- }
- Project p = getProject();
- String[] exceptFiles = null;
- Enumeration setEnum = exceptSets.elements();
- while (setEnum.hasMoreElements()) {
- ConditionalFileSet exceptSet = (ConditionalFileSet) setEnum
- .nextElement();
- if (exceptSet.isActive()) {
- DirectoryScanner scanner = exceptSet
- .getDirectoryScanner(p);
- String[] scannerFiles = scanner.getIncludedFiles();
- if (exceptFiles == null) {
- exceptFiles = scannerFiles;
- } else {
- if (scannerFiles.length > 0) {
- String[] newFiles = new String[exceptFiles.length
- + scannerFiles.length];
- for (int i = 0; i < exceptFiles.length; i++) {
- newFiles[i] = exceptFiles[i];
- }
- int index = exceptFiles.length;
- for (int i = 0; i < scannerFiles.length; i++) {
- newFiles[index++] = scannerFiles[i];
- }
- exceptFiles = newFiles;
- }
- }
- }
- }
- if (exceptFiles == null) {
- exceptFiles = new String[0];
- }
- return exceptFiles;
- }
- /**
- * Gets prototype source file
- *
- */
- public File getPrototype() {
- PrecompileDef ref = getRef();
- if (ref != null) {
- return ref.getPrototype();
- }
- return prototype;
- }
- private PrecompileDef getRef() {
- if (isReference()) {
- return ((PrecompileDef) getCheckedRef(PrecompileDef.class,
- "PrecompileDef"));
- }
- return null;
- }
- public boolean isActive() {
- boolean isActive = CUtil.isActive(getProject(), ifCond, unlessCond);
- if (!isActive) {
- PrecompileDef ref = getRef();
- if (ref != null) {
- return ref.isActive();
- }
- }
- return isActive;
- }
- /**
- * Sets a description of the current data type.
- */
- public void setDescription(String desc) {
- super.setDescription(desc);
- }
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
- /**
- * Set the 'if' condition.
- *
- * The processor will be ignored unless the property is defined.
- *
- * The value of property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * isActive() is evaluated.
- *
- * @param propName
- * name of property
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Sets file to precompile.
- *
- * Should be a source file that includes only one unguarded header file.
- * Default value is "stdafx.cpp".
- *
- * @param prototype
- * file path for prototype source file
- */
- public void setPrototype(File prototype) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- if (prototype == null) {
- throw new NullPointerException("prototype");
- }
- this.prototype = prototype;
- }
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location.
- *
- * @param ref
- * Reference to other element
- *
- */
- public void setRefid(org.apache.tools.ant.types.Reference ref) {
- super.setRefid(ref);
- }
- /**
- * Set the 'unless' condition. If named property exists at execution time,
- * the processor will be ignored.
- *
- * Value of property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when isActive is called.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileExceptDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileExceptDef.java
deleted file mode 100644
index d6cdd6025f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/PrecompileExceptDef.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Specifies files that should not be compiled using precompiled headers.
- *
- * @author Curt Arnold
- */
-public final class PrecompileExceptDef {
- private ConditionalFileSet localSet = null;
- /**
- * Collection of <fileset>contained by definition
- */
- private PrecompileDef owner;
- /**
- * Constructor
- *
- */
- public PrecompileExceptDef(PrecompileDef owner) {
- this.owner = owner;
- }
- /**
- * Adds filesets that specify files that should not be processed using
- * precompiled headers.
- *
- * @param exceptSet
- * FileSet specify files that should not be processed with
- * precompiled headers enabled.
- */
- public void addFileset(ConditionalFileSet exceptSet) {
- owner.appendExceptFileSet(exceptSet);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * Sets the base-directory
- */
- public void setDir(File dir) throws BuildException {
- if (localSet == null) {
- localSet = new ConditionalFileSet();
- owner.appendExceptFileSet(localSet);
- }
- localSet.setDir(dir);
- }
- /**
- * Comma or space separated list of file patterns that should not be
- * compiled using precompiled headers.
- *
- * @param includes
- * the string containing the include patterns
- */
- public void setIncludes(String includes) {
- if (localSet == null) {
- localSet = new ConditionalFileSet();
- owner.appendExceptFileSet(localSet);
- }
- localSet.setIncludes(includes);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorDef.java
deleted file mode 100644
index 38faf427e7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorDef.java
+++ /dev/null
@@ -1,714 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Environment;
-import org.apache.tools.ant.types.Reference;
-/**
- * An abstract compiler/linker definition.
- *
- * @author Curt Arnold
- */
-public abstract class ProcessorDef extends DataType {
- /**
- * Returns the equivalent Boolean object for the specified value
- *
- * Equivalent to Boolean.valueOf in JDK 1.4
- *
- * @param val
- * boolean value
- * @return Boolean.TRUE or Boolean.FALSE
- */
- protected static Boolean booleanValueOf(boolean val) {
- if (val) {
- return Boolean.TRUE;
- }
- return Boolean.FALSE;
- }
- /**
- * if true, targets will be built for debugging
- */
- private Boolean debug;
- private Environment env = null;
- /**
- * Reference for "extends" processor definition
- */
- private Reference extendsRef = null;
- /**
- * Name of property that must be present or definition will be ignored. May
- * be null.
- */
- private String ifProp;
- /**
- * if true, processor definition inherits values from containing <cc>
- * element
- */
- private boolean inherit;
- private Boolean libtool = null;
- protected boolean newEnvironment = false;
- /**
- * Processor.
- */
- private Processor processor;
- /**
- * Collection of <compilerarg>or <linkerarg>contained by definition
- */
- private final Vector processorArgs = new Vector();
- /**
- * Collection of <compilerparam>or <linkerparam>contained by definition
- */
- private final Vector processorParams = new Vector();
- /**
- * if true, all targets will be unconditionally rebuilt
- */
- private Boolean rebuild;
- /**
- * Collection of <fileset>contained by definition
- */
- private final Vector srcSets = new Vector();
- /**
- * Name of property that if present will cause definition to be ignored.
- * May be null.
- */
- private String unlessProp;
- /**
- * Constructor
- *
- */
- protected ProcessorDef() throws NullPointerException {
- inherit = true;
- }
- /**
- * Adds a <compilerarg>or <linkerarg>
- *
- * @param arg
- * command line argument, must not be null
- * @throws NullPointerException
- * if arg is null
- * @throws BuildException
- * if this definition is a reference
- */
- protected void addConfiguredProcessorArg(CommandLineArgument arg)
- throws NullPointerException, BuildException {
- if (arg == null) {
- throw new NullPointerException("arg");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- if(arg.getFile() == null ) {
- processorArgs.addElement(arg);
- }
- else {
- loadFile(arg.getFile());
- }
- }
- /**
- * Add a <compilerarg>or <linkerarg> if specify the file attribute
- *
- * @param arg
- * command line argument, must not be null
- * @throws BuildException
- * if the specify file not exist
- */
- protected void loadFile(File file)
- throws BuildException {
- FileReader fileReader;
- BufferedReader in;
- String str;
- if (! file.exists()){
- throw new BuildException("The file " + file + " is not existed");
- }
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
- while ( (str = in.readLine()) != null ){
- if(str.trim() == ""){
- continue ;
- }
- str = getProject().replaceProperties(str);
- CommandLineArgument newarg = new CommandLineArgument();
- newarg.setValue(str.trim());
- processorArgs.addElement(newarg);
- }
- }
- catch(Exception e){
- throw new BuildException(e.getMessage());
- }
- }
- /**
- * Adds a <compilerarg>or <linkerarg>
- *
- * @param arg
- * command line argument, must not be null
- * @throws NullPointerException
- * if arg is null
- * @throws BuildException
- * if this definition is a reference
- */
- protected void addConfiguredProcessorParam(ProcessorParam param)
- throws NullPointerException, BuildException {
- if (param == null) {
- throw new NullPointerException("param");
- }
- if (isReference()) {
- throw noChildrenAllowed();
- }
- processorParams.addElement(param);
- }
- /**
- * Add an environment variable to the launched process.
- */
- public void addEnv(Environment.Variable var) {
- if (env == null) {
- env = new Environment();
- }
- env.addVariable(var);
- }
- /**
- * Adds a source file set.
- *
- * Files in these set will be processed by this configuration and will not
- * participate in the auction.
- *
- * @param srcSet
- * Fileset identifying files that should be processed by this
- * processor
- * @throws BuildException
- * if processor definition is a reference
- */
- public void addFileset(ConditionalFileSet srcSet) throws BuildException {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- srcSet.setProject(getProject());
- srcSets.addElement(srcSet);
- }
- /**
- * Creates a configuration
- *
- * @param baseDef
- * reference to def from containing <cc>element, may be null
- * @return configuration
- *
- */
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef baseDef, TargetDef targetPlatform) {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).createConfiguration(task, linkType,
- baseDef, targetPlatform);
- }
- ProcessorDef[] defaultProviders = getDefaultProviders(baseDef);
- Processor proc = getProcessor();
- return proc.createConfiguration(task, linkType, defaultProviders, this, targetPlatform);
- }
- /**
- * Prepares list of processor arguments ( <compilerarg>, <linkerarg>) that
- * are active for the current project settings.
- *
- * @return active compiler arguments
- */
- public CommandLineArgument[] getActiveProcessorArgs() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getActiveProcessorArgs();
- }
- Vector activeArgs = new Vector(processorArgs.size());
- for (int i = 0; i < processorArgs.size(); i++) {
- CommandLineArgument arg = (CommandLineArgument) processorArgs
- .elementAt(i);
- if (arg.isActive(p)) {
- activeArgs.addElement(arg);
- }
- }
- CommandLineArgument[] array = new CommandLineArgument[activeArgs.size()];
- activeArgs.copyInto(array);
- return array;
- }
- /**
- * Prepares list of processor arguments ( <compilerarg>, <linkerarg>) that
- * are active for the current project settings.
- *
- * @return active compiler arguments
- */
- public ProcessorParam[] getActiveProcessorParams() {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException("project must be set");
- }
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getActiveProcessorParams();
- }
- Vector activeParams = new Vector(processorParams.size());
- for (int i = 0; i < processorParams.size(); i++) {
- ProcessorParam param = (ProcessorParam) processorParams
- .elementAt(i);
- if (param.isActive(p)) {
- activeParams.addElement(param);
- }
- }
- ProcessorParam[] array = new ProcessorParam[activeParams.size()];
- activeParams.copyInto(array);
- return array;
- }
- /**
- * Gets boolean indicating debug build
- *
- * @param defaultProviders
- * array of ProcessorDef's in descending priority
- * @param index
- * index to first element in array that should be considered
- * @return if true, built targets for debugging
- */
- public boolean getDebug(ProcessorDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getDebug(defaultProviders, index);
- }
- if (debug != null) {
- return debug.booleanValue();
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getDebug(defaultProviders,
- index + 1);
- }
- }
- return false;
- }
- /**
- * Creates an chain of objects which provide default values in descending
- * order of significance.
- *
- * @param baseDef
- * corresponding ProcessorDef from CCTask, will be last element
- * in array unless inherit = false
- * @return default provider array
- *
- */
- protected final ProcessorDef[] getDefaultProviders(ProcessorDef baseDef) {
- ProcessorDef extendsDef = getExtends();
- Vector chain = new Vector();
- while (extendsDef != null && !chain.contains(extendsDef)) {
- chain.addElement(extendsDef);
- extendsDef = extendsDef.getExtends();
- }
- if (baseDef != null && getInherit()) {
- chain.addElement(baseDef);
- }
- ProcessorDef[] defaultProviders = new ProcessorDef[chain.size()];
- chain.copyInto(defaultProviders);
- return defaultProviders;
- }
- /**
- * Gets the ProcessorDef specified by the extends attribute
- *
- * @return Base ProcessorDef, null if extends is not specified
- * @throws BuildException
- * if reference is not same type object
- */
- public ProcessorDef getExtends() throws BuildException {
- if (extendsRef != null) {
- Object obj = extendsRef.getReferencedObject(getProject());
- if (!getClass().isInstance(obj)) {
- throw new BuildException("Referenced object "
- + extendsRef.getRefId() + " not correct type, is "
- + obj.getClass().getName() + " should be "
- + getClass().getName());
- }
- return (ProcessorDef) obj;
- }
- return null;
- }
- /**
- * Gets the inherit attribute. If the inherit value is true, this processor
- * definition will inherit default values from the containing <cc>element.
- *
- * @return if true then properties from the containing <cc>element are
- * used.
- */
- public final boolean getInherit() {
- return inherit;
- }
- public boolean getLibtool() {
- if (libtool != null) {
- return libtool.booleanValue();
- }
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getLibtool();
- }
- ProcessorDef extendsDef = getExtends();
- if (extendsDef != null) {
- return extendsDef.getLibtool();
- }
- return false;
- }
- /**
- * Obtains the appropriate processor (compiler, linker)
- *
- * @return processor
- */
- protected Processor getProcessor() {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getProcessor();
- }
- //
- // if a processor has not been explicitly set
- // then may be set by an extended definition
- if (processor == null) {
- ProcessorDef extendsDef = getExtends();
- if (extendsDef != null) {
- return extendsDef.getProcessor();
- }
- }
- return processor;
- }
- /**
- * Gets a boolean value indicating whether all targets must be rebuilt
- * regardless of dependency analysis.
- *
- * @param defaultProviders
- * array of ProcessorDef's in descending priority
- * @param index
- * index to first element in array that should be considered
- * @return true if all targets should be rebuilt.
- */
- public boolean getRebuild(ProcessorDef[] defaultProviders, int index) {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getRebuild(defaultProviders, index);
- }
- if (rebuild != null) {
- return rebuild.booleanValue();
- } else {
- if (defaultProviders != null && index < defaultProviders.length) {
- return defaultProviders[index].getRebuild(defaultProviders,
- index + 1);
- }
- }
- return false;
- }
- /**
- * Returns true if the processor definition contains embedded file set
- * definitions
- *
- * @return true if processor definition contains embedded filesets
- */
- public boolean hasFileSets() {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).hasFileSets();
- }
- return srcSets.size() > 0;
- }
- /**
- * Determine if this def should be used.
- *
- * Definition will be active if the "if" variable (if specified) is set and
- * the "unless" variable (if specified) is not set and that all reference
- * or extended definitions are active
- *
- * @return true if processor is active
- * @throws IllegalStateException
- * if not properly initialized
- * @throws BuildException
- * if "if" or "unless" variable contains suspicious values
- * "false" or "no" which indicates possible confusion
- */
- public boolean isActive() throws BuildException, IllegalStateException {
- Project project = getProject();
- if (!CUtil.isActive(project, ifProp, unlessProp)) {
- return false;
- }
- if (isReference()) {
- if (!((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).isActive()) {
- return false;
- }
- }
- //
- // walk through any extended definitions
- //
- ProcessorDef[] defaultProviders = getDefaultProviders(null);
- for (int i = 0; i < defaultProviders.length; i++) {
- if (!defaultProviders[i].isActive()) {
- return false;
- }
- }
- return true;
- }
- /**
- * Sets the class name for the adapter. Use the "name" attribute when the
- * tool is supported.
- *
- * @param className
- * full class name
- *
- */
- public void setClassname(String className) throws BuildException {
- Object proc = null;
- try {
- Class implClass = ProcessorDef.class.getClassLoader().loadClass(
- className);
- try {
- Method getInstance = implClass.getMethod("getInstance",
- new Class[0]);
- proc = getInstance.invoke(null, new Object[0]);
- } catch (Exception ex) {
- proc = implClass.newInstance();
- }
- } catch (Exception ex) {
- throw new BuildException(ex);
- }
- setProcessor((Processor) proc);
- }
- /**
- * If set true, all targets will be built for debugging.
- *
- * @param debug
- * true if targets should be built for debugging
- * @throws BuildException
- * if processor definition is a reference
- */
- public void setDebug(boolean debug) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.debug = booleanValueOf(debug);
- }
- /**
- * Sets a description of the current data type.
- */
- public void setDescription(String desc) {
- super.setDescription(desc);
- }
- /**
- * Specifies that this element extends the element with id attribute with a
- * matching value. The configuration will be constructed from the settings
- * of this element, element referenced by extends, and the containing cc
- * element.
- *
- * @param extendsRef
- * Reference to the extended processor definition.
- * @throws BuildException
- * if this processor definition is a reference
- */
- public void setExtends(Reference extendsRef) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.extendsRef = extendsRef;
- }
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The configuration will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * name of property
- */
- public void setIf(String propName) {
- ifProp = propName;
- }
- /**
- * If inherit has the default value of true, defines, includes and other
- * settings from the containing <cc>element will be inherited.
- *
- * @param inherit
- * new value
- * @throws BuildException
- * if processor definition is a reference
- */
- public void setInherit(boolean inherit) throws BuildException {
- if (isReference()) {
- throw super.tooManyAttributes();
- }
- this.inherit = inherit;
- }
- /**
- * Set use of libtool.
- *
- * If set to true, the "libtool " will be prepended to the command line
- *
- * @param libtool
- * If true, use libtool.
- */
- public void setLibtool(boolean libtool) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.libtool = booleanValueOf(libtool);
- }
- /**
- * Do not propagate old environment when new environment variables are
- * specified.
- */
- public void setNewenvironment(boolean newenv) {
- newEnvironment = newenv;
- }
- /**
- * Sets the processor
- *
- * @param processor
- * processor, may not be null.
- * @throws BuildException
- * if ProcessorDef is a reference
- * @throws NullPointerException
- * if processor is null
- */
- protected void setProcessor(Processor processor) throws BuildException,
- NullPointerException {
- if (processor == null) {
- throw new NullPointerException("processor");
- }
- if (isReference()) {
- throw super.tooManyAttributes();
- }
- if (env == null && !newEnvironment) {
- this.processor = processor;
- } else {
- this.processor = processor.changeEnvironment(newEnvironment, env);
- }
- }
- /**
- * If set true, all targets will be unconditionally rebuilt.
- *
- * @param rebuild
- * if true, rebuild all targets.
- * @throws BuildException
- * if processor definition is a reference
- */
- public void setRebuild(boolean rebuild) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.rebuild = booleanValueOf(rebuild);
- }
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes or child content should be specified,
- * other than "if", "unless" and "description".
- *
- * @param ref
- * Reference to other element
- *
- */
- public void setRefid(org.apache.tools.ant.types.Reference ref) {
- super.setRefid(ref);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the configuration will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessProp = propName;
- }
- /**
- * This method calls the FileVistor's visit function for every file in the
- * processors definition
- *
- * @param visitor
- * object whose visit method is called for every file
- */
- public void visitFiles(FileVisitor visitor) {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException(
- "project must be set before this call");
- }
- if (isReference()) {
- ((ProcessorDef) getCheckedRef(ProcessorDef.class, "ProcessorDef"))
- .visitFiles(visitor);
- }
- //
- // if this processor extends another,
- // visit its files first
- //
- ProcessorDef extendsDef = getExtends();
- if (extendsDef != null) {
- extendsDef.visitFiles(visitor);
- }
- for (int i = 0; i < srcSets.size(); i++) {
- ConditionalFileSet srcSet = (ConditionalFileSet) srcSets
- .elementAt(i);
- if (srcSet.isActive()) {
- // Find matching source files
- DirectoryScanner scanner = srcSet.getDirectoryScanner(p);
- // Check each source file - see if it needs compilation
- String[] fileNames = scanner.getIncludedFiles();
- File parentDir = scanner.getBasedir();
- for (int j = 0; j < fileNames.length; j++) {
- String currentFile = fileNames[j];
- visitor.visit(parentDir, currentFile);
- }
- }
- }
- }
- public Vector getSrcSets() {
- if (isReference()) {
- return ((ProcessorDef) getCheckedRef(ProcessorDef.class,
- "ProcessorDef")).getSrcSets();
- }
- return srcSets;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorEnumValue.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorEnumValue.java
deleted file mode 100644
index d028052232..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorEnumValue.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-/**
- * One entry in the arrays used by the CompilerEnum and LinkerEnum classes.
- *
- * @author Curt Arnold
- * @see CompilerEnum
- * @see LinkerEnum
- *
- */
-public class ProcessorEnumValue {
- public static String[] getValues(ProcessorEnumValue[] processors) {
- String[] values = new String[processors.length];
- for (int i = 0; i < processors.length; i++) {
- values[i] = processors[i].getName();
- }
- return values;
- }
- private String name;
- private Processor processor;
- public ProcessorEnumValue(String name, Processor processor) {
- this.name = name;
- this.processor = processor;
- }
- public String getName() {
- return name;
- }
- public Processor getProcessor() {
- return processor;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorParam.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorParam.java
deleted file mode 100644
index b2d47962ed..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ProcessorParam.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-/*******************************************************************************
- * Place class description here.
- *
- * @author inger
- * @author <additional author>
- *
- * @since
- ******************************************************************************/
-public class ProcessorParam {
- private String ifCond;
- private String name;
- private String unlessCond;
- private String value;
- public ProcessorParam() {
- }
- public String getName() {
- return name;
- }
- public String getValue() {
- return value;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p) {
- if (value == null) {
- return false;
- }
- if (ifCond != null && p.getProperty(ifCond) == null) {
- return false;
- } else if (unlessCond != null && p.getProperty(unlessCond) != null) {
- return false;
- }
- return true;
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The argument will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies relative location of argument on command line. "start" will
- * place argument at start of command line, "mid" will place argument after
- * all "start" arguments but before filenames, "end" will place argument
- * after filenames.
- *
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the argument will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Specifies the string that should appear on the command line. The
- * argument will be quoted if it contains embedded blanks. Use multiple
- * arguments to avoid quoting.
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/RuntimeType.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/RuntimeType.java
deleted file mode 100644
index 02da661917..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/RuntimeType.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumerated attribute with the values "dynamic" and "static",
- */
-public class RuntimeType extends EnumeratedAttribute {
- public String[] getValues() {
- return new String[]{"dynamic", "static"};
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java
deleted file mode 100644
index 0c608b4d87..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SourceHistory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.io.IOException;
-/**
- * The history of a source file used to build a target
- *
- * @author Curt Arnold
- */
-public final class SourceHistory {
- private/* final */long lastModified;
- private/* final */String relativePath;
- /**
- * Constructor
- */
- public SourceHistory(String relativePath, long lastModified) {
- if (relativePath == null) {
- throw new NullPointerException("relativePath");
- }
- this.relativePath = relativePath;
- this.lastModified = lastModified;
- }
- public String getAbsolutePath(File baseDir) {
- try {
- return new File(baseDir, relativePath).getCanonicalPath();
- } catch (IOException ex) {
- }
- return relativePath;
- }
- public long getLastModified() {
- return lastModified;
- }
- public String getRelativePath() {
- return relativePath;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SubsystemEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SubsystemEnum.java
deleted file mode 100644
index 3dc342a38a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/SubsystemEnum.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of supported subsystems
- *
- * @author Curt Arnold
- *
- */
-public final class SubsystemEnum extends EnumeratedAttribute {
- private final static String[] values = new String[]{"gui", "console",
- "other"};
- public SubsystemEnum() {
- setValue("gui");
- }
- public String[] getValues() {
- return (String[]) values.clone();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetDef.java
deleted file mode 100644
index 8e46cb7c6c..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetDef.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- * Information on the execution platforms for the generated code.
- * (Non-functional prototype)
- *
- */
-public final class TargetDef
- extends DataType {
- /**
- * if property.
- */
- private String ifCond;
-
- /**
- * unless property.
- */
- private String unlessCond;
-
- /**
- * cpu.
- *
- */
- private CPUEnum cpu;
-
- /**
- * architecture.
- *
- */
- private ArchEnum arch;
-
- /**
- * OS Family.
- *
- */
- private OSFamilyEnum osFamily;
-
- /**
- * Constructor.
- *
- */
- public TargetDef() {
- }
-
- /**
- * Bogus method required for documentation generation.
- */
- public void execute() {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- * @return true if active
- */
- public boolean isActive() {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
-
- /**
- * Sets a description of the current data type.
- * @param desc description
- */
- public void setDescription(final String desc) {
- super.setDescription(desc);
- }
-
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(final String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
-
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(final String propName) {
- ifCond = propName;
- }
-
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes should be specified.
- * @param r id of referenced target
- */
- public void setRefid(final Reference r) {
- super.setRefid(r);
- }
-
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(final String propName) {
- unlessCond = propName;
- }
-
- /**
- * Gets cpu.
- * @return cpu, may be null.
- *
- */
- public CPUEnum getCpu() {
- if (isReference()) {
- TargetDef refPlatform = (TargetDef)
- getCheckedRef(TargetDef.class,
- "TargetDef");
- return refPlatform.getCpu();
- }
- return cpu;
- }
-
- /**
- * Gets arch.
- * @return arch, may be null.
- *
- */
- public ArchEnum getArch() {
- if (isReference()) {
- TargetDef refPlatform = (TargetDef)
- getCheckedRef(TargetDef.class,
- "TargetDef");
- return refPlatform.getArch();
- }
- return arch;
- }
-
- /**
- * Gets operating system family.
- * @return os family, may be null.
- *
- */
- public OSFamilyEnum getOsfamily() {
- if (isReference()) {
- TargetDef refPlatform = (TargetDef)
- getCheckedRef(TargetDef.class,
- "TargetDef");
- return refPlatform.getOsfamily();
- }
- return osFamily;
- }
-
- /**
- * Sets preferred cpu, but does not use cpu specific instructions.
- * @param value new value
- */
- public void setCpu(final CPUEnum value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- cpu = value;
- }
-
- /**
- * Sets cpu architecture, compiler may use cpu specific instructions.
- * @param value new value
- */
- public void setArch(final ArchEnum value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- if (cpu != null) {
- throw tooManyAttributes();
- }
- arch = value;
- }
-
- /**
- * Sets operating system family.
- * @param value new value
- */
- public void setOsfamily(final OSFamilyEnum value) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- if (cpu != null) {
- throw tooManyAttributes();
- }
- osFamily = value;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistory.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistory.java
deleted file mode 100644
index 0094c8ecec..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistory.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-/**
- * A description of a file built or to be built
- */
-public final class TargetHistory {
- private/* final */String config;
- private/* final */String output;
- private/* final */long outputLastModified;
- private/* final */SourceHistory[] sources;
- /**
- * Constructor from build step
- */
- public TargetHistory(String config, String output, long outputLastModified,
- SourceHistory[] sources) {
- if (config == null) {
- throw new NullPointerException("config");
- }
- if (sources == null) {
- throw new NullPointerException("source");
- }
- if (output == null) {
- throw new NullPointerException("output");
- }
- this.config = config;
- this.output = output;
- this.outputLastModified = outputLastModified;
- this.sources = (SourceHistory[]) sources.clone();
- }
- public String getOutput() {
- return output;
- }
- public long getOutputLastModified() {
- return outputLastModified;
- }
- public String getProcessorConfiguration() {
- return config;
- }
- public SourceHistory[] getSources() {
- SourceHistory[] clone = (SourceHistory[]) sources.clone();
- return clone;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistoryTable.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistoryTable.java
deleted file mode 100644
index 9fb0a7b642..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetHistoryTable.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.UnsupportedEncodingException;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import javax.xml.parsers.SAXParser;
-import javax.xml.parsers.SAXParserFactory;
-
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-
-import org.apache.tools.ant.BuildException;
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXException;
-import org.xml.sax.helpers.DefaultHandler;
-/**
- * A history of the compiler and linker settings used to build the files in the
- * same directory as the history.
- *
- * @author Curt Arnold
- */
-public final class TargetHistoryTable {
- /**
- * This class handles populates the TargetHistory hashtable in response to
- * SAX parse events
- */
- private class TargetHistoryTableHandler extends DefaultHandler {
- private final File baseDir;
- private String config;
- private final Hashtable history;
- private String output;
- private long outputLastModified;
- private final Vector sources = new Vector();
- /**
- * Constructor
- *
- * @param history
- * hashtable of TargetHistory keyed by output name
- * @param outputFiles
- * existing files in output directory
- */
- private TargetHistoryTableHandler(Hashtable history, File baseDir) {
- this.history = history;
- config = null;
- output = null;
- this.baseDir = baseDir;
- }
- public void endElement(String namespaceURI, String localName,
- String qName) throws SAXException {
- //
- // if </target> then
- // create TargetHistory object and add to hashtable
- // if corresponding output file exists and
- // has the same timestamp
- //
- if (qName.equals("target")) {
- if (config != null && output != null) {
- File existingFile = new File(baseDir, output);
- //
- // if the corresponding files doesn't exist or has a
- // different
- // modification time, then discard this record
- if (existingFile.exists()) {
- long existingLastModified = existingFile.lastModified();
- //
- // would have expected exact time stamps
- // but have observed slight differences
- // in return value for multiple evaluations of
- // lastModified(). Check if times are within
- // a second
- long diff = outputLastModified - existingLastModified;
- if (diff >= -500 && diff <= 500) {
- SourceHistory[] sourcesArray = new SourceHistory[sources
- .size()];
- sources.copyInto(sourcesArray);
- TargetHistory targetHistory = new TargetHistory(
- config, output, outputLastModified,
- sourcesArray);
- history.put(output, targetHistory);
- }
- }
- }
- output = null;
- sources.setSize(0);
- } else {
- //
- // reset config so targets not within a processor element
- // don't pick up a previous processors signature
- //
- if (qName.equals("processor")) {
- config = null;
- }
- }
- }
- /**
- * startElement handler
- */
- public void startElement(String namespaceURI, String localName,
- String qName, Attributes atts) throws SAXException {
- //
- // if sourceElement
- //
- if (qName.equals("source")) {
- String sourceFile = atts.getValue("file");
- long sourceLastModified = Long.parseLong(atts
- .getValue("lastModified"), 16);
- sources.addElement(new SourceHistory(sourceFile,
- sourceLastModified));
- } else {
- //
- // if <target> element,
- // grab file name and lastModified values
- // TargetHistory object will be created in endElement
- //
- if (qName.equals("target")) {
- sources.setSize(0);
- output = atts.getValue("file");
- outputLastModified = Long.parseLong(atts
- .getValue("lastModified"), 16);
- } else {
- //
- // if <processor> element,
- // grab signature attribute
- //
- if (qName.equals("processor")) {
- config = atts.getValue("signature");
- }
- }
- }
- }
- }
- /** Flag indicating whether the cache should be written back to file. */
- private boolean dirty;
- /**
- * a hashtable of TargetHistory's keyed by output file name
- */
- private final Hashtable history = new Hashtable();
- /** The file the cache was loaded from. */
- private/* final */File historyFile;
- private/* final */File outputDir;
- private String outputDirPath;
- /**
- * Creates a target history table from history.xml in the output directory,
- * if it exists. Otherwise, initializes the history table empty.
- *
- * @param task
- * task used for logging history load errors
- * @param outputDir
- * output directory for task
- */
- public TargetHistoryTable(CCTask task, File outputDir)
- throws BuildException {
- if (outputDir == null) {
- throw new NullPointerException("outputDir");
- }
- if (!outputDir.isDirectory()) {
- throw new BuildException("Output directory is not a directory");
- }
- if (!outputDir.exists()) {
- throw new BuildException("Output directory does not exist");
- }
- this.outputDir = outputDir;
- try {
- outputDirPath = outputDir.getCanonicalPath();
- } catch (IOException ex) {
- outputDirPath = outputDir.toString();
- }
- //
- // load any existing history from file
- // suppressing any records whose corresponding
- // file does not exist, is zero-length or
- // last modified dates differ
- historyFile = new File(outputDir, "history.xml");
- if (historyFile.exists()) {
- SAXParserFactory factory = SAXParserFactory.newInstance();
- factory.setValidating(false);
- try {
- SAXParser parser = factory.newSAXParser();
- parser.parse(historyFile, new TargetHistoryTableHandler(
- history, outputDir));
- } catch (Exception ex) {
- //
- // a failure on loading this history is not critical
- // but should be logged
- task.log("Error reading history.xml: " + ex.toString());
- }
- } else {
- //
- // create empty history file for identifying new files by last
- // modified
- // timestamp comperation (to compare with
- // System.currentTimeMillis() don't work on Unix, because it
- // maesure timestamps only in seconds).
- //
- try {
- FileOutputStream outputStream = new FileOutputStream(
- historyFile);
- byte[] historyElement = new byte[]{0x3C, 0x68, 0x69, 0x73,
- 0x74, 0x6F, 0x72, 0x79, 0x2F, 0x3E};
- outputStream.write(historyElement);
- outputStream.close();
- } catch (IOException ex) {
- throw new BuildException("Can't create history file", ex);
- }
- }
- }
- public void commit() throws IOException {
- //
- // if not dirty, no need to update file
- //
- if (dirty) {
- //
- // build (small) hashtable of config id's in history
- //
- Hashtable configs = new Hashtable(20);
- Enumeration elements = history.elements();
- while (elements.hasMoreElements()) {
- TargetHistory targetHistory = (TargetHistory) elements
- .nextElement();
- String configId = targetHistory.getProcessorConfiguration();
- if (configs.get(configId) == null) {
- configs.put(configId, configId);
- }
- }
- FileOutputStream outStream = new FileOutputStream(historyFile);
- OutputStreamWriter outWriter;
- //
- // early VM's don't support UTF-8 encoding
- // try and fallback to the default encoding
- // otherwise
- String encodingName = "UTF-8";
- try {
- outWriter = new OutputStreamWriter(outStream, "UTF-8");
- } catch (UnsupportedEncodingException ex) {
- outWriter = new OutputStreamWriter(outStream);
- encodingName = outWriter.getEncoding();
- }
- BufferedWriter writer = new BufferedWriter(outWriter);
- writer.write("<?xml version='1.0' encoding='");
- writer.write(encodingName);
- writer.write("'?>\n");
- writer.write("<history>\n");
- StringBuffer buf = new StringBuffer(200);
- Enumeration configEnum = configs.elements();
- while (configEnum.hasMoreElements()) {
- String configId = (String) configEnum.nextElement();
- buf.setLength(0);
- buf.append(" <processor signature=\"");
- buf.append(CUtil.xmlAttribEncode(configId));
- buf.append("\">\n");
- writer.write(buf.toString());
- elements = history.elements();
- while (elements.hasMoreElements()) {
- TargetHistory targetHistory = (TargetHistory) elements
- .nextElement();
- if (targetHistory.getProcessorConfiguration().equals(
- configId)) {
- buf.setLength(0);
- buf.append(" <target file=\"");
- buf.append(CUtil.xmlAttribEncode(targetHistory
- .getOutput()));
- buf.append("\" lastModified=\"");
- buf.append(Long.toHexString(targetHistory
- .getOutputLastModified()));
- buf.append("\">\n");
- writer.write(buf.toString());
- SourceHistory[] sourceHistories = targetHistory
- .getSources();
- for (int i = 0; i < sourceHistories.length; i++) {
- buf.setLength(0);
- buf.append(" <source file=\"");
- buf.append(CUtil.xmlAttribEncode(sourceHistories[i]
- .getRelativePath()));
- buf.append("\" lastModified=\"");
- buf.append(Long.toHexString(sourceHistories[i]
- .getLastModified()));
- buf.append("\"/>\n");
- writer.write(buf.toString());
- }
- writer.write(" </target>\n");
- }
- }
- writer.write(" </processor>\n");
- }
- writer.write("</history>\n");
- writer.close();
- dirty = false;
- }
- }
- public TargetHistory get(String configId, String outputName) {
- TargetHistory targetHistory = (TargetHistory) history.get(outputName);
- if (targetHistory != null) {
- if (!targetHistory.getProcessorConfiguration().equals(configId)) {
- targetHistory = null;
- }
- }
- return targetHistory;
- }
- public void markForRebuild(Hashtable targetInfos) {
- Enumeration targetInfoEnum = targetInfos.elements();
- while (targetInfoEnum.hasMoreElements()) {
- markForRebuild((TargetInfo) targetInfoEnum.nextElement());
- }
- }
- public void markForRebuild(TargetInfo targetInfo) {
- //
- // if it must already be rebuilt, no need to check further
- //
- if (!targetInfo.getRebuild()) {
- TargetHistory history = get(targetInfo.getConfiguration()
- .toString(), targetInfo.getOutput().getName());
- if (history == null) {
- targetInfo.mustRebuild();
- } else {
- SourceHistory[] sourceHistories = history.getSources();
- File[] sources = targetInfo.getSources();
- if (sourceHistories.length != sources.length) {
- targetInfo.mustRebuild();
- } else {
- for (int i = 0; i < sourceHistories.length
- && !targetInfo.getRebuild(); i++) {
- //
- // relative file name, must absolutize it on output
- // directory
- //
- boolean foundMatch = false;
- String historySourcePath = sourceHistories[i]
- .getAbsolutePath(outputDir);
- for (int j = 0; j < sources.length; j++) {
- File targetSource = sources[j];
- String targetSourcePath = targetSource
- .getAbsolutePath();
- if (targetSourcePath.equals(historySourcePath)) {
- foundMatch = true;
- if (targetSource.lastModified() != sourceHistories[i]
- .getLastModified()) {
- targetInfo.mustRebuild();
- break;
- }
- }
- }
- if (!foundMatch) {
- targetInfo.mustRebuild();
- }
- }
- }
- }
- }
- }
- public void update(ProcessorConfiguration config, String[] sources) {
- String configId = config.getIdentifier();
- String[] onesource = new String[1];
- String outputName;
- for (int i = 0; i < sources.length; i++) {
- onesource[0] = sources[i];
- outputName = config.getOutputFileName(sources[i]);
- update(configId, outputName, onesource);
- }
- }
- private void update(String configId, String outputName, String[] sources) {
- File outputFile = new File(outputDir, outputName);
- //
- // if output file doesn't exist or predates the start of the
- // compile step (most likely a compilation error) then
- // do not write add a history entry
- //
- if (outputFile.exists()
- && outputFile.lastModified() >= historyFile.lastModified()) {
- dirty = true;
- history.remove(outputName);
- SourceHistory[] sourceHistories = new SourceHistory[sources.length];
- for (int i = 0; i < sources.length; i++) {
- File sourceFile = new File(sources[i]);
- long lastModified = sourceFile.lastModified();
- String relativePath = CUtil.getRelativePath(outputDirPath,
- sourceFile);
- sourceHistories[i] = new SourceHistory(relativePath,
- lastModified);
- }
- TargetHistory newHistory = new TargetHistory(configId, outputName,
- outputFile.lastModified(), sourceHistories);
- history.put(outputName, newHistory);
- }
- }
- public void update(TargetInfo linkTarget) {
- File outputFile = linkTarget.getOutput();
- String outputName = outputFile.getName();
- //
- // if output file doesn't exist or predates the start of the
- // compile or link step (most likely a compilation error) then
- // do not write add a history entry
- //
- if (outputFile.exists()
- && outputFile.lastModified() >= historyFile.lastModified()) {
- dirty = true;
- history.remove(outputName);
- SourceHistory[] sourceHistories = linkTarget
- .getSourceHistories(outputDirPath);
- TargetHistory newHistory = new TargetHistory(linkTarget
- .getConfiguration().getIdentifier(), outputName, outputFile
- .lastModified(), sourceHistories);
- history.put(outputName, newHistory);
- }
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetInfo.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetInfo.java
deleted file mode 100644
index 3a9dd14b16..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetInfo.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-/**
- * A description of a file built or to be built
- */
-public final class TargetInfo {
- private static final File[] emptyFileArray = new File[0];
- private/* final */ProcessorConfiguration config;
- private/* final */File output;
- private boolean rebuild;
- private/* final */File[] sources;
- private File[] sysSources;
- public TargetInfo(ProcessorConfiguration config, File[] sources,
- File[] sysSources, File output, boolean rebuild) {
- if (config == null) {
- throw new NullPointerException("config");
- }
- if (sources == null) {
- throw new NullPointerException("sources");
- }
- if (output == null) {
- throw new NullPointerException("output");
- }
- this.config = config;
- this.sources = (File[]) sources.clone();
- if (sysSources == null) {
- this.sysSources = emptyFileArray;
- } else {
- this.sysSources = (File[]) sysSources.clone();
- }
- this.output = output;
- this.rebuild = rebuild;
- //
- // if the output doesn't exist, must rebuild it
- //
- if (!output.exists()) {
- rebuild = true;
- }
- }
- public String[] getAllSourcePaths() {
- String[] paths = new String[sysSources.length + sources.length];
- for (int i = 0; i < sysSources.length; i++) {
- paths[i] = sysSources[i].toString();
- }
- int offset = sysSources.length;
- for (int i = 0; i < sources.length; i++) {
- paths[offset + i] = sources[i].toString();
- }
- return paths;
- }
- public File[] getAllSources() {
- File[] allSources = new File[sources.length + sysSources.length];
- for (int i = 0; i < sysSources.length; i++) {
- allSources[i] = sysSources[i];
- }
- int offset = sysSources.length;
- for (int i = 0; i < sources.length; i++) {
- allSources[i + offset] = sources[i];
- }
- return allSources;
- }
- public ProcessorConfiguration getConfiguration() {
- return config;
- }
- public File getOutput() {
- return output;
- }
- public boolean getRebuild() {
- return rebuild;
- }
- /**
- * Returns an array of SourceHistory objects (contains relative path and
- * last modified time) for the source[s] of this target
- */
- public SourceHistory[] getSourceHistories(String basePath) {
- SourceHistory[] histories = new SourceHistory[sources.length];
- for (int i = 0; i < sources.length; i++) {
- String relativeName = CUtil.getRelativePath(basePath, sources[i]);
- long lastModified = sources[i].lastModified();
- histories[i] = new SourceHistory(relativeName, lastModified);
- }
- return histories;
- }
- public String[] getSourcePaths() {
- String[] paths = new String[sources.length];
- for (int i = 0; i < sources.length; i++) {
- paths[i] = sources[i].toString();
- }
- return paths;
- }
- public File[] getSources() {
- File[] clone = (File[]) sources.clone();
- return clone;
- }
- public String[] getSysSourcePaths() {
- String[] paths = new String[sysSources.length];
- for (int i = 0; i < sysSources.length; i++) {
- paths[i] = sysSources[i].toString();
- }
- return paths;
- }
- public File[] getSysSources() {
- File[] clone = (File[]) sysSources.clone();
- return clone;
- }
- public void mustRebuild() {
- this.rebuild = true;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetMatcher.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetMatcher.java
deleted file mode 100644
index 2574e1561f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/TargetMatcher.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.ProcessorConfiguration;
-
-import org.apache.tools.ant.BuildException;
-/**
- * This class matches each visited file with an appropriate compiler
- *
- * @author Curt Arnold
- */
-public final class TargetMatcher implements FileVisitor {
- private LinkerConfiguration linker;
- private Vector objectFiles;
- private File outputDir;
- private ProcessorConfiguration[] processors;
- private final File sourceFiles[] = new File[1];
- private Hashtable targets;
- private CCTask task;
- public TargetMatcher(CCTask task, File outputDir,
- ProcessorConfiguration[] processors, LinkerConfiguration linker,
- Vector objectFiles, Hashtable targets) {
- this.task = task;
- this.outputDir = outputDir;
- this.processors = processors;
- this.targets = targets;
- this.linker = linker;
- this.objectFiles = objectFiles;
- }
- public void visit(File parentDir, String filename) throws BuildException {
- //
- // see if any processor wants to bid
- // on this one
- ProcessorConfiguration selectedCompiler = null;
- int bid = 0;
- if (processors != null) {
- for (int k = 0; k < processors.length; k++) {
- int newBid = processors[k].bid(filename);
- if (newBid > bid) {
- bid = newBid;
- selectedCompiler = processors[k];
- }
- }
- }
- //
- // no processor interested in file
- // log diagnostic message
- if (bid <= 0) {
- if (linker != null) {
- int linkerbid = linker.bid(filename);
- if (linkerbid > 0) {
- File objFile = new File(parentDir, filename);
- objectFiles.addElement(objFile);
- if (linkerbid == 1) {
- task.log("Unrecognized file type " + objFile.toString()
- + " will be passed to linker");
- }
- }
- }
- } else {
- //
- // get output file name
- //
- String outputFileName = selectedCompiler
- .getOutputFileName(filename);
- //
- // if there is some output for this task
- // (that is a source file and not an header file)
- //
- if (outputFileName != null) {
- sourceFiles[0] = new File(parentDir, filename);
- //
- // see if the same output file has already been registered
- //
- TargetInfo previousTarget = (TargetInfo) targets
- .get(outputFileName);
- if (previousTarget == null) {
- targets.put(outputFileName, new TargetInfo(
- selectedCompiler, sourceFiles, null, new File(
- outputDir, outputFileName),
- selectedCompiler.getRebuild()));
- } else {
- if (!previousTarget.getSources()[0].equals(sourceFiles[0])) {
- StringBuffer builder = new StringBuffer(
- "Output filename conflict: ");
- builder.append(outputFileName);
- builder.append(" would be produced from ");
- builder.append(previousTarget.getSources()[0]
- .toString());
- builder.append(" and ");
- builder.append(filename);
- throw new BuildException(builder.toString());
- }
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/VersionInfo.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/VersionInfo.java
deleted file mode 100644
index f55b976fef..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/VersionInfo.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks;
-
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-
-/**
- * Version Information. (Non-functional prototype)
- *
- */
-public class VersionInfo extends DataType {
- /**
- * if property.
- */
- private String ifCond;
- /**
- * unless property.
- */
- private String unlessCond;
-
- /**
- * extends property.
- */
- private String extendsId;
-
- /**
- * file version.
- *
- */
- private String fileVersion;
- /**
- * Product version.
- *
- */
- private String productVersion;
- /**
- * file language.
- *
- */
- private String language;
-
- /**
- * comments.
- *
- */
- private String fileComments;
- /**
- * Company name.
- *
- */
- private String companyName;
- /**
- * Description.
- *
- */
- private String description;
- /**
- * internal name.
- */
- private String internalName;
- /**
- * legal copyright.
- *
- */
- private String legalCopyright;
- /**
- * legal trademark.
- *
- */
- private String legalTrademark;
- /**
- * original filename.
- *
- */
- private String originalFilename;
- /**
- * private build.
- *
- */
- private String privateBuild;
- /**
- * product name.
- *
- */
- private String productName;
- /**
- * Special build
- */
- private String specialBuild;
- /**
- * compatibility version
- *
- */
- private String compatibilityVersion;
-
-
- /**
- * Constructor.
- *
- */
- public VersionInfo() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- *
- * @exception BuildException
- * throws build exception if name is not set
- */
- public final boolean isActive() throws BuildException {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
- /**
- * Sets the name of a version info that this info extends.
- *
- * @param id
- * id
- */
- public void setExtends(String id) {
- extendsId = id;
- }
-
-
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public final void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes should be specified.
- *
- */
- public void setRefid(Reference r) throws BuildException {
- super.setRefid(r);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public final void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Gets file version.
- * @return file version, may be null.
- *
- */
- public String getFileversion() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getFileversion();
- }
- return fileVersion;
- }
- /**
- * Gets Product version.
- * @return product version, may be null
- */
- public String getProductversion() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getProductversion();
- }
- return productVersion;
- }
- /**
- * Gets compatibility version.
- * @return compatibility version, may be null
- */
- public String getCompatibilityversion() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getCompatibilityversion();
- }
- return compatibilityVersion;
- }
- /**
- * Gets file language, should be an IETF RFC 3066 identifier, for example, en-US.
- * @return language, may be null.
- */
- public String getLanguage() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getLanguage();
- }
- return language;
- }
-
- /**
- * Gets comments.
- * @return comments, may be null.
- */
- public String getFilecomments() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getFilecomments();
- }
- return fileComments;
- }
- /**
- * Gets Company name.
- * @return company name, may be null.
- */
- public String getCompanyname() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getCompanyname();
- }
- return companyName;
- }
- /**
- * Gets Description.
- * @return description, may be null.
- */
- public String getDescription() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getDescription();
- }
- return description;
- }
- /**
- * Gets internal name.
- * @return internal name, may be null.
- */
- public String getInternalname() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getInternalname();
- }
- return internalName;
- }
- /**
- * Gets legal copyright.
- * @return legal copyright, may be null.
- */
- public String getLegalcopyright() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getLegalcopyright();
- }
- return legalCopyright;
- }
- /**
- * Gets legal trademark.
- * @return legal trademark, may be null;
- */
- public String getLegaltrademark() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getLegaltrademark();
- }
- return legalTrademark;
- }
- /**
- * Gets original filename.
- * @return original filename, may be null.
- */
- public String getOriginalfilename() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getOriginalfilename();
- }
- return originalFilename;
- }
- /**
- * Gets private build.
- * @return private build, may be null.
- */
- public String getPrivatebuild() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getPrivatebuild();
- }
- return privateBuild;
- }
- /**
- * Gets product name.
- * @return product name, may be null.
- */
- public String getProductname() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getProductname();
- }
- return productName;
- }
- /**
- * Special build
- * @return special build, may be null.
- */
- public String getSpecialbuild() {
- if (isReference()) {
- VersionInfo refVersion = (VersionInfo)
- getCheckedRef(VersionInfo.class,
- "VersionInfo");
- return refVersion.getSpecialbuild();
- }
- return specialBuild;
- }
-
- /**
- * Sets file version.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setFileversion(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- fileVersion = value;
- }
- /**
- * Sets product version.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setProductversion(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- productVersion = value;
- }
- /**
- * Sets compatibility version.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setCompatibilityversion(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- compatibilityVersion = value;
- }
- /**
- * Sets language.
- * @param value new value, should be an IETF RFC 3066 language identifier.
- * @throws BuildException if specified with refid
- */
- public void setLanguage(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- language = value;
- }
- /**
- * Sets comments.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setFilecomments(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- fileComments = value;
- }
-
- /**
- * Sets company name.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setCompanyname(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- companyName = value;
- }
-
-
- /**
- * Sets internal name. Internal name will automatically be
- * specified from build step, only set this value if
- * intentionally overriding that value.
- *
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setInternalname(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- internalName = value;
- }
-
- /**
- * Sets legal copyright.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setLegalcopyright(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- legalCopyright = value;
- }
- /**
- * Sets legal trademark.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setLegaltrademark(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- legalTrademark = value;
- }
- /**
- * Sets original name. Only set this value if
- * intentionally overriding the value from the build set.
- *
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setOriginalfilename(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- originalFilename = value;
- }
- /**
- * Sets private build.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setPrivatebuild(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- privateBuild = value;
- }
- /**
- * Sets product name.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setProductname(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- productName= value;
- }
- /**
- * Sets private build.
- * @param value new value
- * @throws BuildException if specified with refid
- */
- public void setSpecialbuild(String value) throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- specialBuild = value;
- }
-
- /**
- * Writes windows resource
- * @param writer writer, may not be null.
- * @param project project, may not be null
- * @param executableName name of executable
- */
- public void writeResource(final Writer writer,
- final Project p,
- final String executableName) throws IOException {
- // TODO:
-
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSCCompiler.java
deleted file mode 100644
index 78489b8c31..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSCCompiler.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.arm;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the ARM C Compilers
- *
- * See Doc No: ARM DUI 0151A, Issued: Nov 2001 at
- * http://www.arm.com/arm/User_Guides?OpenDocument
- *
- * @author Curt Arnold
- *
- */
-public class ADSCCompiler extends CommandLineCCompiler {
- /**
- * Header file extensions
- */
- private static final String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- /**
- * Source file extensions
- */
- private static final String[] sourceExtensions = new String[]{".c", ".cc",
- ".cpp", ".cxx", ".c++"};
- /**
- * Singleton for ARM 32-bit C compiler
- */
- private static final ADSCCompiler armcc = new ADSCCompiler("armcc", false,
- null);
- /**
- * Singleton for ARM 32-bit C++ compiler
- */
- private static final ADSCCompiler armcpp = new ADSCCompiler("armcpp",
- false, null);
- /**
- * Singleton for ARM 16-bit C compiler
- */
- private static final ADSCCompiler tcc = new ADSCCompiler("tcc", false, null);
- /**
- * Singleton for ARM 16-bit C++ compiler
- */
- private static final ADSCCompiler tcpp = new ADSCCompiler("tcpp", false,
- null);
- /**
- * Singleton for ARM 32-bit C compiler
- */
- public static ADSCCompiler getArmCC() {
- return armcc;
- }
- /**
- * Singleton for ARM 32-bit C++ compiler
- */
- public static ADSCCompiler getArmCpp() {
- return armcpp;
- }
- /**
- * Singleton for ARM 16-bit C compiler
- */
- public static ADSCCompiler getThumbCC() {
- return tcpp;
- }
- /**
- * Singleton for ARM 16-bit C++ compiler
- */
- public static ADSCCompiler getThumbCpp() {
- return tcpp;
- }
- private static void quoteFile(StringBuffer buf, String outPath) {
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- }
- /**
- * Private constructor
- *
- * @param command
- * executable name
- * @param newEnvironment
- * Change environment
- * @param env
- * New environment
- */
- private ADSCCompiler(String command, boolean newEnvironment, Environment env) {
- super(command, "-vsn", sourceExtensions, headerExtensions, ".o", false,
- null, newEnvironment, env);
- }
- /**
- * Adds command switches for generic configuration options
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#addImpliedArgs(java.util.Vector,
- * boolean, boolean, boolean,
- * net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- protected void addImpliedArgs(Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- if (debug) {
- args.addElement("-g");
- }
- //
- // didn't see anything about producing
- // anything other than executables in the docs
- if (linkType.isExecutable()) {
- } else if (linkType.isSharedLibrary()) {
- }
- }
- /**
- * Adds flags that customize the warnings reported
- *
- * Compiler does not appear to have warning levels but ability to turn off
- * specific errors by explicit switches, could fabricate levels by
- * prioritizing errors.
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#addWarningSwitch(java.util.Vector,
- * int)
- */
- protected void addWarningSwitch(Vector args, int warnings) {
- }
- /**
- * Add command line options for preprocessor macro
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getDefineSwitch(java.lang.StringBuffer,
- * java.lang.String, java.lang.String)
- */
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("-D");
- buffer.append(define);
- if (value != null) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- /**
- * ARMINC environment variable contains the default include path
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getEnvironmentIncludePath()
- */
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("ARMINC", ";");
- }
- /**
- * Returns command line option to specify include directory
- *
- */
- protected String getIncludeDirSwitch(String source) {
- StringBuffer buf = new StringBuffer("-I");
- quoteFile(buf, source);
- return buf.toString();
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return ADSLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return ADSLinker.getDllInstance();
- }
- return ADSLinker.getInstance();
- }
- /**
- * Maximum command line length
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getMaximumCommandLength()
- */
- public int getMaximumCommandLength() {
- return 1000;
- }
- /*
- * Adds command to undefine preprocessor macro
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getUndefineSwitch(java.lang.StringBuffer,
- * java.lang.String)
- */
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- buffer.append("-U");
- buffer.append(define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLibrarian.java
deleted file mode 100644
index 0ff53d309f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLibrarian.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.arm;
-
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for ARM Librarian
- *
- * @author Curt Arnold
- */
-public class ADSLibrarian extends CommandLineLinker {
-
- private static final ADSLibrarian instance = new ADSLibrarian();
-
- public static ADSLibrarian getInstance() {
- return instance;
- }
-
- private ADSLibrarian()
- {
- super("armar",null,
- new String[] { ".o" }, new String[0], ".lib", false, null);
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long, java.util.Vector)
- */
- protected void addBase(long base, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean, java.util.Vector)
- */
- protected void addFixed(Boolean fixed, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean, net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
- */
- protected void addImpliedArgs(
- boolean debug,
- LinkType linkType,
- Vector args,
- Boolean defaultflag) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean, java.util.Vector)
- */
- protected void addIncremental(boolean incremental, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean, java.util.Vector)
- */
- protected void addMap(boolean map, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int, java.util.Vector)
- */
- protected void addStack(int stack, Vector args) {
- // TODO Auto-generated method stub
-
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
- */
- protected String getCommandFileSwitch(String commandFile) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
- */
- public File[] getLibraryPath() {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
- */
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return new String[0];
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType linkType) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
- */
- protected int getMaximumCommandLength() {
- // TODO Auto-generated method stub
- return 0;
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
- */
- protected String[] getOutputFileSwitch(String outputFile) {
- // TODO Auto-generated method stub
- return null;
- }
-
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
- */
- public boolean isCaseSensitive() {
- // TODO Auto-generated method stub
- return false;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java
deleted file mode 100644
index 042eb217ec..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/arm/ADSLinker.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.arm;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for the ARM Linker
- *
- * @author CurtA
- */
-public class ADSLinker extends CommandLineLinker {
- private static final ADSLinker dllInstance = new ADSLinker(".o");
- private static final ADSLinker instance = new ADSLinker(".axf");
- public static ADSLinker getDllInstance() {
- return dllInstance;
- }
- public static ADSLinker getInstance() {
- return instance;
- }
- private ADSLinker(String outputSuffix) {
- super("armlink", "-vsn", new String[]{".o", ".lib", ".res"},
- new String[]{".map", ".pdb", ".lnk"}, outputSuffix, false, null);
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,
- * java.util.Vector)
- */
- protected void addBase(long base, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,
- * java.util.Vector)
- */
- protected void addFixed(Boolean fixed, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,
- * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
- */
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (debug) {
- args.addElement("-debug");
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,
- * java.util.Vector)
- */
- protected void addIncremental(boolean incremental, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,
- * java.util.Vector)
- */
- protected void addMap(boolean map, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,
- * java.util.Vector)
- */
- protected void addStack(int stack, Vector args) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * May have to make this String array return
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
- */
- protected String getCommandFileSwitch(String commandFile) {
- return "-via" + commandFile;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
- */
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("ARMLIB", ";");
- }
- /*
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
- */
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- //
- // TODO: looks like bad extension
- //
- return new String[]{".o"};
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType linkType) {
- return this;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
- */
- protected int getMaximumCommandLength() {
- return 1024;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
- */
- protected String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-output", outputFile};
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
- */
- public boolean isCaseSensitive() {
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCCompiler.java
deleted file mode 100644
index 3304c9a860..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCCompiler.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.CompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.PrecompilingCommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Borland(r) C/C++ compiler.
- *
- * @author Curt Arnold
- */
-public class BorlandCCompiler extends PrecompilingCommandLineCCompiler {
- private static final String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- private static final String[] sourceExtensions = new String[]{".c", ".cc",
- ".cpp", ".cxx", ".c++"};
- private static final BorlandCCompiler instance = new BorlandCCompiler(
- false, null);
- public static BorlandCCompiler getInstance() {
- return instance;
- }
- private BorlandCCompiler(boolean newEnvironment, Environment env) {
- super("bcc32", "--version", sourceExtensions, headerExtensions, ".obj", false,
- null, newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- args.addElement("-c");
- //
- // turn off compiler autodependency since
- // we do it ourselves
- args.addElement("-X");
- if (exceptions) {
- args.addElement("-x");
- } else {
- args.addElement("-x-");
- }
- if (multithreaded) {
- args.addElement("-tWM");
- }
- if (debug) {
- args.addElement("-Od");
- args.addElement("-v");
- } else {
- if (optimization != null) {
- if (optimization.isSpeed()) {
- args.addElement("-O1");
- } else {
- if (optimization.isSpeed()) {
- args.addElement("-O2");
- } else {
- if (optimization.isNoOptimization()) {
- args.addElement("-Od");
- }
- }
- }
- }
- }
- if (rtti != null && !rtti.booleanValue()) {
- args.addElement("-RT-");
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- BorlandProcessor.addWarningSwitch(args, level);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new BorlandCCompiler(newEnvironment, env);
- }
- return this;
- }
- protected CompilerConfiguration createPrecompileGeneratingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude) {
- String[] additionalArgs = new String[]{"-H=" + lastInclude, "-Hc"};
- return new CommandLineCompilerConfiguration(baseConfig, additionalArgs,
- null, true);
- }
- protected CompilerConfiguration createPrecompileUsingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude, String[] exceptFiles) {
- String[] additionalArgs = new String[]{"-Hu"};
- return new CommandLineCompilerConfiguration(baseConfig, additionalArgs,
- exceptFiles, false);
- }
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- BorlandProcessor.getDefineSwitch(buffer, define, value);
- }
- protected File[] getEnvironmentIncludePath() {
- return BorlandProcessor.getEnvironmentPath("bcc32", 'I',
- new String[]{"..\\include"});
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return BorlandProcessor.getIncludeDirSwitch("-I", includeDir);
- }
- public Linker getLinker(LinkType type) {
- return BorlandLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- BorlandProcessor.getUndefineSwitch(buffer, define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCfgParser.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCfgParser.java
deleted file mode 100644
index 19daedd203..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandCfgParser.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.parser.AbstractParser;
-import net.sf.antcontrib.cpptasks.parser.AbstractParserState;
-import net.sf.antcontrib.cpptasks.parser.LetterState;
-import net.sf.antcontrib.cpptasks.parser.WhitespaceOrLetterState;
-/**
- * A parser that paths from a borland cfg file
- *
- * @author Curt Arnold
- */
-public final class BorlandCfgParser extends AbstractParser {
- private AbstractParserState newLineState;
- private final Vector path = new Vector();
- /**
- *
- *
- */
- public BorlandCfgParser(char switchChar) {
- //
- // a quoted path (-I"some path")
- // doesn't end till a close quote and will be abandoned
- // if a new line is encountered first
- //
- AbstractParserState quote = new CfgFilenameState(this, new char[]{'"'});
- //
- // an unquoted path (-Ic:\borland\include)
- // ends at the first space or new line
- AbstractParserState unquote = new CfgFilenameState(this, new char[]{
- ' ', '\n', '\r'});
- AbstractParserState quoteBranch = new QuoteBranchState(this, quote,
- unquote);
- AbstractParserState toNextSwitch = new ConsumeToSpaceOrNewLine(this);
- AbstractParserState switchState = new LetterState(this, switchChar,
- quoteBranch, toNextSwitch);
- newLineState = new WhitespaceOrLetterState(this, '-', switchState);
- }
- public void addFilename(String include) {
- path.addElement(include);
- }
- public AbstractParserState getNewLineState() {
- return newLineState;
- }
- public String[] parsePath(Reader reader) throws IOException {
- path.setSize(0);
- super.parse(reader);
- String[] retval = new String[path.size()];
- path.copyInto(retval);
- return retval;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLibrarian.java
deleted file mode 100644
index 5fb3eb0827..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLibrarian.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.File;
-import java.io.IOException;
-import java.util.Vector;
-import org.apache.tools.ant.BuildException;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for the Borland(r) tlib Librarian
- *
- * @author Curt Arnold
- */
-public class BorlandLibrarian extends CommandLineLinker {
- private static final BorlandLibrarian instance = new BorlandLibrarian();
- public static BorlandLibrarian getInstance() {
- return instance;
- }
- private BorlandLibrarian() {
- super("tlib", "--version", new String[]{".obj"}, new String[0], ".lib", false,
- null);
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- protected String getCommandFileSwitch(String cmdFile) {
- return BorlandProcessor.getCommandFileSwitch(cmdFile);
- }
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("LIB", ";");
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return BorlandProcessor.getLibraryPatterns(libnames, libType);
- }
- public Linker getLinker(LinkType type) {
- return BorlandLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- public String[] getOutputFileSwitch(String outFile) {
- return BorlandProcessor.getOutputFileSwitch(outFile);
- }
- public boolean isCaseSensitive() {
- return BorlandProcessor.isCaseSensitive();
- }
- /**
- * Gets identifier for the linker.
- *
- * TLIB will lockup when attempting to get version
- * information. Since the Librarian version isn't critical
- * just return a stock response.
- */
- public String getIdentifier() {
- return "TLIB 4.5 Copyright (c) 1987, 1999 Inprise Corporation";
- }
-
- /**
- * Prepares argument list for exec command.
- *
- * @param outputFile
- * linker output file
- * @param sourceFiles
- * linker input files (.obj, .o, .res)
- * @param args
- * linker arguments
- * @return arguments for runTask
- */
- protected String[] prepareArguments(
- CCTask task,
- String outputDir,
- String outputName,
- String[] sourceFiles,
- CommandLineLinkerConfiguration config) {
- String[] preargs = config.getPreArguments();
- String[] endargs = config.getEndArguments();
- StringBuffer buf = new StringBuffer();
- Vector execArgs = new Vector(preargs.length + endargs.length + 10
- + sourceFiles.length);
-
- execArgs.addElement(this.getCommand());
- String outputFileName = new File(outputDir, outputName).toString();
- execArgs.addElement(quoteFilename(buf, outputFileName));
-
- for (int i = 0; i < preargs.length; i++) {
- execArgs.addElement(preargs[i]);
- }
-
- //
- // add a place-holder for page size
- //
- int pageSizeIndex = execArgs.size();
- execArgs.addElement(null);
-
- int objBytes = 0;
-
- for (int i = 0; i < sourceFiles.length; i++) {
- String last4 = sourceFiles[i]
- .substring(sourceFiles[i].length() - 4).toLowerCase();
- if (last4.equals(".def")) {
- } else {
- if (last4.equals(".res")) {
- } else {
- if (last4.equals(".lib")) {
- } else {
- execArgs.addElement("+" + quoteFilename(buf, sourceFiles[i]));
- objBytes += new File(sourceFiles[i]).length();
- }
- }
- }
- }
-
- for (int i = 0; i < endargs.length; i++) {
- execArgs.addElement(endargs[i]);
- }
-
- String[] execArguments = new String[execArgs.size()];
- execArgs.copyInto(execArguments);
-
- int minPageSize = objBytes >> 16;
- int pageSize = 0;
- for(int i = 4; i <= 15; i++) {
- pageSize = 1 << i;
- if (pageSize > minPageSize) break;
- }
- execArguments[pageSizeIndex] = "/P" + Integer.toString(pageSize);
-
- return execArguments;
- }
-
- /**
- * Prepares argument list to execute the linker using a response file.
- *
- * @param outputFile
- * linker output file
- * @param args
- * output of prepareArguments
- * @return arguments for runTask
- */
- protected String[] prepareResponseFile(File outputFile, String[] args)
- throws IOException {
- return BorlandProcessor.prepareResponseFile(outputFile, args, " & \n");
- }
-
- /**
- * Builds a library
- *
- */
- public void link(CCTask task,
- File outputFile,
- String[] sourceFiles,
- CommandLineLinkerConfiguration config)
- throws BuildException
- {
- //
- // delete any existing library
- outputFile.delete();
- //
- // build a new library
- super.link(task, outputFile, sourceFiles, config);
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLinker.java
deleted file mode 100644
index f425c528bd..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandLinker.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for the Borland(r) ilink32 linker
- *
- * @author Curt Arnold
- */
-public final class BorlandLinker extends CommandLineLinker {
- private static final BorlandLinker dllLinker = new BorlandLinker(".dll");
- private static final BorlandLinker instance = new BorlandLinker(".exe");
- public static BorlandLinker getInstance() {
- return instance;
- }
- private BorlandLinker(String outputSuffix) {
- super("ilink32", "-r", new String[]{".obj", ".lib", ".res"},
- new String[]{".map", ".pdb", ".lnk"}, outputSuffix, false, null);
- }
- protected void addBase(long base, Vector args) {
- if (base >= 0) {
- String baseAddr = Long.toHexString(base);
- args.addElement("-b:" + baseAddr);
- }
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (linkType.isExecutable()) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("/ap");
- } else {
- if (linkType.isSubsystemGUI()) {
- args.addElement("/Tpe");
- }
- }
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("/Tpd");
- args.addElement("/Gi");
- }
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- protected void addMap(boolean map, Vector args) {
- if (!map) {
- args.addElement("-x");
- }
- }
- protected void addStack(int stack, Vector args) {
- if (stack >= 0) {
- String stackStr = Integer.toHexString(stack);
- args.addElement("-S:" + stackStr);
- }
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- public String getIdentifier() {
- return "Borland Linker";
- }
- public File[] getLibraryPath() {
- return BorlandProcessor.getEnvironmentPath("ilink32", 'L',
- new String[]{"..\\lib"});
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return BorlandProcessor.getLibraryPatterns(libnames, libType);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return BorlandLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- public String[] getOutputFileSwitch(String outFile) {
- return BorlandProcessor.getOutputFileSwitch(outFile);
- }
- protected String getStartupObject(LinkType linkType) {
- if (linkType.isSharedLibrary()) {
- return "c0d32.obj";
- }
- if (linkType.isSubsystemGUI()) {
- return "c0w32.obj";
- }
- if (linkType.isSubsystemConsole()) {
- return "c0x32.obj";
- }
- return null;
- }
- public boolean isCaseSensitive() {
- return BorlandProcessor.isCaseSensitive();
- }
- /**
- * Prepares argument list for exec command.
- *
- * @param outputFile
- * linker output file
- * @param sourceFiles
- * linker input files (.obj, .o, .res)
- * @param args
- * linker arguments
- * @return arguments for runTask
- */
- protected String[] prepareArguments(
- CCTask task,
- String outputDir,
- String outputName,
- String[] sourceFiles,
- CommandLineLinkerConfiguration config) {
- String[] preargs = config.getPreArguments();
- String[] endargs = config.getEndArguments();
- Vector execArgs = new Vector(preargs.length + endargs.length + 10
- + sourceFiles.length);
- execArgs.addElement(this.getCommand());
- for (int i = 0; i < preargs.length; i++) {
- execArgs.addElement(preargs[i]);
- }
- for (int i = 0; i < endargs.length; i++) {
- execArgs.addElement(endargs[i]);
- }
- //
- // see if the input files have any known startup obj files
- //
- String startup = null;
- for (int i = 0; i < sourceFiles.length; i++) {
- String filename = new File(sourceFiles[i]).getName().toLowerCase();
- if (startup != null && filename.substring(0, 2).equals("c0")
- && filename.substring(3, 5).equals("32")
- && filename.substring(filename.length() - 4).equals(".obj")) {
- startup = sourceFiles[i];
- }
- }
- //
- // c0w32.obj, c0x32.obj or c0d32.obj depending on
- // link type
- if (startup == null) {
- startup = config.getStartupObject();
- }
- execArgs.addElement(startup);
- Vector resFiles = new Vector();
- Vector libFiles = new Vector();
- String defFile = null;
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < sourceFiles.length; i++) {
- String last4 = sourceFiles[i]
- .substring(sourceFiles[i].length() - 4).toLowerCase();
- if (last4.equals(".def")) {
- defFile = quoteFilename(buf, sourceFiles[i]);
- } else {
- if (last4.equals(".res")) {
- resFiles.addElement(quoteFilename(buf, sourceFiles[i]));
- } else {
- if (last4.equals(".lib")) {
- libFiles.addElement(quoteFilename(buf, sourceFiles[i]));
- } else {
- execArgs.addElement(quoteFilename(buf, sourceFiles[i]));
- }
- }
- }
- }
- //
- // output file name
- //
- String outputFileName = new File(outputDir, outputName).toString();
- execArgs.addElement("," + quoteFilename(buf, outputFileName));
- if (config.getMap()) {
- int lastPeriod = outputFileName.lastIndexOf('.');
- String mapName;
- if (lastPeriod < outputFileName.length() - 4) {
- mapName = outputFileName + ".map";
- } else {
- mapName = outputFileName.substring(0, lastPeriod) + ".map";
- }
- execArgs.addElement("," + quoteFilename(buf, mapName) + ",");
- } else {
- execArgs.addElement(",,");
- }
- //
- // add all the libraries
- //
- Enumeration libEnum = libFiles.elements();
- boolean hasImport32 = false;
- boolean hasCw32 = false;
- while (libEnum.hasMoreElements()) {
- String libName = (String) libEnum.nextElement();
- if (libName.equalsIgnoreCase("import32.lib")) {
- hasImport32 = true;
- }
- if (libName.equalsIgnoreCase("cw32.lib")) {
- hasImport32 = true;
- }
- execArgs.addElement(quoteFilename(buf, libName));
- }
- if (!hasCw32) {
- execArgs.addElement(quoteFilename(buf, "cw32.lib"));
- }
- if (!hasImport32) {
- execArgs.addElement(quoteFilename(buf, "import32.lib"));
- }
- if (defFile == null) {
- execArgs.addElement(",,");
- } else {
- execArgs.addElement("," + quoteFilename(buf, defFile) + ",");
- }
- Enumeration resEnum = resFiles.elements();
- while (resEnum.hasMoreElements()) {
- String resName = (String) resEnum.nextElement();
- execArgs.addElement(quoteFilename(buf, resName));
- }
- String[] execArguments = new String[execArgs.size()];
- execArgs.copyInto(execArguments);
- return execArguments;
- }
- /**
- * Prepares argument list to execute the linker using a response file.
- *
- * @param outputFile
- * linker output file
- * @param args
- * output of prepareArguments
- * @return arguments for runTask
- */
- protected String[] prepareResponseFile(File outputFile, String[] args)
- throws IOException {
- return BorlandProcessor.prepareResponseFile(outputFile, args, " + \n");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java
deleted file mode 100644
index d53f00cc12..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandProcessor.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Vector;
-import java.io.FileWriter;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-/**
- * A add-in class for Borland(r) processor adapters
- *
- *
- */
-public final class BorlandProcessor {
- public static void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("-w-");
- break;
- case 5 :
- args.addElement("-w!");
- break;
- default :
- args.addElement("-w");
- break;
- }
- }
- public static String getCommandFileSwitch(String cmdFile) {
- StringBuffer buf = new StringBuffer("@");
- quoteFile(buf, cmdFile);
- return buf.toString();
- }
- public static void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("-D");
- buffer.append(define);
- if (value != null && value.length() > 0) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- /**
- * This method extracts path information from the appropriate .cfg file in
- * the install directory.
- *
- * @param toolName
- * Tool name, for example, "bcc32", "brc32", "ilink32"
- * @param switchChar
- * Command line switch character, for example "L" for libraries
- * @param defaultRelativePaths
- * default paths relative to executable directory
- * @return path
- */
- public static File[] getEnvironmentPath(String toolName, char switchChar,
- String[] defaultRelativePath) {
- if (toolName == null) {
- throw new NullPointerException("toolName");
- }
- if (defaultRelativePath == null) {
- throw new NullPointerException("defaultRelativePath");
- }
- String[] path = defaultRelativePath;
- File exeDir = CUtil.getExecutableLocation(toolName + ".exe");
- if (exeDir != null) {
- File cfgFile = new File(exeDir, toolName + ".cfg");
- if (cfgFile.exists()) {
- try {
- Reader reader = new BufferedReader(new FileReader(cfgFile));
- BorlandCfgParser cfgParser = new BorlandCfgParser(
- switchChar);
- path = cfgParser.parsePath(reader);
- reader.close();
- } catch (IOException ex) {
- //
- // could be logged
- //
- }
- }
- } else {
- //
- // if can't find the executable,
- // assume current directory to resolve relative paths
- //
- exeDir = new File(System.getProperty("user.dir"));
- }
- int nonExistant = 0;
- File[] resourcePath = new File[path.length];
- for (int i = 0; i < path.length; i++) {
- resourcePath[i] = new File(path[i]);
- if (!resourcePath[i].isAbsolute()) {
- resourcePath[i] = new File(exeDir, path[i]);
- }
- //
- // if any of the entries do not exist or are
- // not directories, null them out
- if (!(resourcePath[i].exists() && resourcePath[i].isDirectory())) {
- resourcePath[i] = null;
- nonExistant++;
- }
- }
- //
- // if there were some non-existant or non-directory
- // entries in the configuration file then
- // create a shorter array
- if (nonExistant > 0) {
- File[] culled = new File[resourcePath.length - nonExistant];
- int index = 0;
- for (int i = 0; i < resourcePath.length; i++) {
- if (resourcePath[i] != null) {
- culled[index++] = resourcePath[i];
- }
- }
- resourcePath = culled;
- }
- return resourcePath;
- }
- public static String getIncludeDirSwitch(String includeOption,
- String includeDir) {
- StringBuffer buf = new StringBuffer(includeOption);
- quoteFile(buf, includeDir);
- return buf.toString();
- }
- public static String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length];
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(libnames[i]);
- buf.append(".lib");
- patterns[i] = buf.toString();
- }
- return patterns;
- }
- public static String[] getOutputFileSwitch(String outFile) {
- return new String[0];
- }
- public static void getUndefineSwitch(StringBuffer buffer, String define) {
- buffer.append("-U");
- buffer.append(define);
- }
- public static boolean isCaseSensitive() {
- return false;
- }
- private static void quoteFile(StringBuffer buf, String outPath) {
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- }
-
- /**
- * Prepares argument list to execute the linker using a response file.
- *
- * @param outputFile
- * linker output file
- * @param args
- * output of prepareArguments
- * @return arguments for runTask
- */
- public static String[] prepareResponseFile(File outputFile,
- String[] args,
- String continuation)
- throws IOException {
- String baseName = outputFile.getName();
- File commandFile = new File(outputFile.getParent(), baseName + ".lnk");
- FileWriter writer = new FileWriter(commandFile);
- for (int i = 1; i < args.length - 1; i++) {
- writer.write(args[i]);
- //
- // if either the current argument ends with
- // or next argument starts with a comma then
- // don't split the line
- if (args[i].endsWith(",") || args[i + 1].startsWith(",")) {
- writer.write(' ');
- } else {
- //
- // split the line to make it more readable
- //
- writer.write(continuation);
- }
- }
- //
- // write the last argument
- //
- if (args.length > 1) {
- writer.write(args[args.length - 1]);
- }
- writer.close();
- String[] execArgs = new String[2];
- execArgs[0] = args[0];
- execArgs[1] = getCommandFileSwitch(commandFile.toString());
- return execArgs;
- }
-
- private BorlandProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandResourceCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandResourceCompiler.java
deleted file mode 100644
index 5e8609797e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/BorlandResourceCompiler.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.compiler.ProgressMonitor;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Borland(r) brc32 Resource compiler.
- *
- * @author Curt Arnold
- */
-public class BorlandResourceCompiler extends CommandLineCompiler {
- private static final BorlandResourceCompiler instance = new BorlandResourceCompiler(
- false, null);
- public static BorlandResourceCompiler getInstance() {
- return instance;
- }
- private BorlandResourceCompiler(boolean newEnvironment, Environment env) {
- super("brc32", "c:\\__bogus\\__bogus.rc", new String[]{".rc"},
- new String[]{".h", ".hpp", ".inl"}, ".res", false, null,
- newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- //
- // compile only
- //
- args.addElement("-r");
- }
- protected void addWarningSwitch(Vector args, int level) {
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new BorlandResourceCompiler(newEnvironment, env);
- }
- return this;
- }
- public void compile(CCTask task, File outputDir, String[] sourceFiles,
- String[] args, String[] endArgs, boolean relentless,
- CommandLineCompilerConfiguration config, ProgressMonitor monitor)
- throws BuildException {
- super.compile(task, outputDir, sourceFiles, args, endArgs, relentless,
- config, monitor);
- }
- /**
- * The include parser for C will work just fine, but we didn't want to
- * inherit from CommandLineCCompiler
- */
- protected Parser createParser(File source) {
- return new CParser();
- }
- protected int getArgumentCountPerInputFile() {
- return 2;
- }
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("-d");
- buffer.append(define);
- if (value != null && value.length() > 0) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- protected File[] getEnvironmentIncludePath() {
- return BorlandProcessor.getEnvironmentPath("brc32", 'i',
- new String[]{"..\\include"});
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return BorlandProcessor.getIncludeDirSwitch("-i", includeDir);
- }
- protected String getInputFileArgument(File outputDir, String filename,
- int index) {
- if (index == 0) {
- String outputFileName = getOutputFileName(filename);
- String fullOutputName = new File(outputDir, outputFileName)
- .toString();
- return "-fo" + fullOutputName;
- }
- return filename;
- }
- public Linker getLinker(LinkType type) {
- return BorlandLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- protected int getMaximumInputFilesPerCommand() {
- return 1;
- }
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- String arg1 = getInputFileArgument(outputDir, inputFile, 0);
- String arg2 = getInputFileArgument(outputDir, inputFile, 1);
- return arg1.length() + arg2.length() + 2;
- }
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/CfgFilenameState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/CfgFilenameState.java
deleted file mode 100644
index a3651d3b25..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/CfgFilenameState.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import net.sf.antcontrib.cpptasks.parser.AbstractParser;
-import net.sf.antcontrib.cpptasks.parser.AbstractParserState;
-import net.sf.antcontrib.cpptasks.parser.FilenameState;
-public class CfgFilenameState extends FilenameState {
- private char terminator;
- public CfgFilenameState(AbstractParser parser, char[] terminators) {
- super(parser, terminators);
- terminator = terminators[0];
- }
- public AbstractParserState consume(char ch) {
- //
- // if a ';' is encountered then
- // close the previous filename by sending a
- // recognized terminator to our super class
- // and stay in this state for more filenamese
- if (ch == ';') {
- super.consume(terminator);
- return this;
- }
- AbstractParserState newState = super.consume(ch);
- //
- // change null (consume to end of line)
- // to look for next switch character
- if (newState == null) {
- newState = getParser().getNewLineState();
- }
- return newState;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/ConsumeToSpaceOrNewLine.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/ConsumeToSpaceOrNewLine.java
deleted file mode 100644
index d1dd072cce..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/ConsumeToSpaceOrNewLine.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import net.sf.antcontrib.cpptasks.parser.AbstractParser;
-import net.sf.antcontrib.cpptasks.parser.AbstractParserState;
-public class ConsumeToSpaceOrNewLine extends AbstractParserState {
- public ConsumeToSpaceOrNewLine(AbstractParser parser) {
- super(parser);
- }
- public AbstractParserState consume(char ch) {
- if (ch == ' ' || ch == '\t' || ch == '\n') {
- return getParser().getNewLineState();
- }
- return this;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/QuoteBranchState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/QuoteBranchState.java
deleted file mode 100644
index 89724b26e5..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/borland/QuoteBranchState.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.borland;
-import net.sf.antcontrib.cpptasks.parser.AbstractParser;
-import net.sf.antcontrib.cpptasks.parser.AbstractParserState;
-public class QuoteBranchState extends AbstractParserState {
- private AbstractParserState quote;
- private AbstractParserState unquote;
- public QuoteBranchState(AbstractParser parser, AbstractParserState quote,
- AbstractParserState unquote) {
- super(parser);
- this.quote = quote;
- this.unquote = unquote;
- }
- public AbstractParserState consume(char ch) {
- if (ch == '"') {
- return quote;
- }
- return unquote.consume(ch);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranCompiler.java
deleted file mode 100644
index e1d3deb8b6..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranCompiler.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compaq;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineFortranCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Compaq(r) Visual Fortran compiler.
- *
- * @author Curt Arnold
- */
-public class CompaqVisualFortranCompiler extends CommandLineFortranCompiler {
- private static final CompaqVisualFortranCompiler[] instance = new CompaqVisualFortranCompiler[]{new CompaqVisualFortranCompiler(
- false, null)};
- public static CompaqVisualFortranCompiler getInstance() {
- return instance[0];
- }
- private CompaqVisualFortranCompiler(boolean newEnvironment, Environment env) {
- super("DF", null, new String[]{".f90", ".for", ".f"}, new String[]{
- ".i", ".i90", ".fpp", ".inc", ".bak", ".exe"}, ".obj", false,
- null, newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- args.addElement("/nologo");
- args.addElement("/compile_only");
- if (debug) {
- args.addElement("/debug:full");
- args.addElement("/define:_DEBUG");
- } else {
- args.addElement("/debug:none");
- args.addElement("/define:NDEBUG");
- }
- if (multithreaded) {
- args.addElement("/threads");
- args.addElement("/define:_MT");
- } else {
- args.addElement("/nothreads");
- }
- boolean staticRuntime = linkType.isStaticRuntime();
- if (staticRuntime) {
- args.addElement("/libs:static");
- } else {
- args.addElement("/libs:dll");
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("/dll");
- args.addElement("/define:_DLL");
- }
- }
- public void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("/nowarn");
- break;
- case 1 :
- break;
- case 2 :
- break;
- case 3 :
- args.addElement("/warn:usage");
- break;
- case 4 :
- args.addElement("/warn:all");
- break;
- case 5 :
- args.addElement("/warn:errors");
- break;
- }
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new CompaqVisualFortranCompiler(newEnvironment, env);
- }
- return this;
- }
- protected void getDefineSwitch(StringBuffer buf, String define, String value) {
- buf.append("/define:");
- buf.append(define);
- if (value != null && value.length() > 0) {
- buf.append('=');
- buf.append(value);
- }
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ";");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- StringBuffer buf = new StringBuffer("/include:");
- if (includeDir.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(includeDir);
- buf.append('"');
- } else {
- buf.append(includeDir);
- }
- return buf.toString();
- }
- public Linker getLinker(LinkType type) {
- return CompaqVisualFortranLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- protected void getUndefineSwitch(StringBuffer buf, String define) {
- buf.append("/undefine:");
- buf.append(define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLibrarian.java
deleted file mode 100644
index eb4a40769e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLibrarian.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compaq;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioLibrarian;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioProcessor;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for the Compaq(r) Visual Fortran Librarian
- *
- * @author Curt Arnold
- */
-public class CompaqVisualFortranLibrarian extends CommandLineLinker {
- private static final CompaqVisualFortranLibrarian instance = new CompaqVisualFortranLibrarian();
- public static CompaqVisualFortranLibrarian getInstance() {
- return instance;
- }
- private CompaqVisualFortranLibrarian() {
- super("lib", "/bogus", new String[]{".obj"}, new String[0], ".lib",
- false, null);
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- args.addElement("/nologo");
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- protected String getCommandFileSwitch(String commandFile) {
- return DevStudioProcessor.getCommandFileSwitch(commandFile);
- }
- public File[] getLibraryPath() {
- return new File[0];
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return new String[0];
- }
- public Linker getLinker(LinkType type) {
- return CompaqVisualFortranLinker.getInstance().getLinker(type);
- }
- protected int getMaximumCommandLength() {
- return DevStudioLibrarian.getInstance().getMaximumCommandLength();
- }
- protected String[] getOutputFileSwitch(String outputFile) {
- return DevStudioLibrarian.getInstance().getOutputFileSwitch(outputFile);
- }
- public boolean isCaseSensitive() {
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java
deleted file mode 100644
index d83e3b213d..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compaq/CompaqVisualFortranLinker.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compaq;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLinker;
-/**
- * Adapter for the Compaq(r) Visual Fortran linker.
- *
- * @author Curt Arnold
- */
-public final class CompaqVisualFortranLinker extends DevStudioCompatibleLinker {
- private static final CompaqVisualFortranLinker dllLinker = new CompaqVisualFortranLinker(
- ".dll");
- private static final CompaqVisualFortranLinker instance = new CompaqVisualFortranLinker(
- ".exe");
- public static CompaqVisualFortranLinker getInstance() {
- return instance;
- }
- private CompaqVisualFortranLinker(String outputSuffix) {
- super("DF", "__bogus__.xxx", outputSuffix);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
- args.addElement("/NOLOGO");
- boolean staticRuntime = linkType.isStaticRuntime();
- if (staticRuntime) {
- args.addElement("/libs:static");
- } else {
- args.addElement("/libs:dll");
- }
- if (debug) {
- args.addElement("/debug");
- } else {
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("/dll");
- } else {
- args.addElement("/exe");
- }
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return CompaqVisualFortranLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
- public String[] getOutputFileSwitch(String outputFile) {
- StringBuffer buf = new StringBuffer("/OUT:");
- if (outputFile.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(outputFile);
- buf.append('"');
- } else {
- buf.append(outputFile);
- }
- return new String[]{buf.toString()};
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAslcompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAslcompiler.java
deleted file mode 100644
index 90c539c965..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAslcompiler.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.AslcompilerDef;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-
-/**
- * An abstract asl compiler implementation.
- *
- */
-public abstract class AbstractAslcompiler extends AbstractProcessor
-implements Aslcompiler {
- private String outputSuffix;
- protected AbstractAslcompiler(String[] sourceExtensions,
- String[] headerExtensions, String outputSuffix) {
- super(sourceExtensions, headerExtensions);
- this.outputSuffix = outputSuffix;
- }
- abstract protected AslcompilerConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- AslcompilerDef specificConfig, TargetDef targetPlatform);
-
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- ProcessorDef specificConfig, TargetDef targetPlatform) {
- if (specificConfig == null) {
- throw new NullPointerException("specificConfig");
- }
- return createConfiguration(task, linkType, baseConfigs,
- (AslcompilerDef) specificConfig, targetPlatform);
- }
-
- public String getOutputFileName(String inputFile) {
- if (bid(inputFile) > 1) {
- String baseName = getBaseOutputName(inputFile);
- return baseName + outputSuffix;
- }
- return null;
- }
- protected String getBaseOutputName(String inputFile) {
- int lastSlash = inputFile.lastIndexOf('/');
- int lastReverse = inputFile.lastIndexOf('\\');
- int lastSep = inputFile.lastIndexOf(File.separatorChar);
- if (lastReverse > lastSlash) {
- lastSlash = lastReverse;
- }
- if (lastSep > lastSlash) {
- lastSlash = lastSep;
- }
- int lastPeriod = inputFile.lastIndexOf('.');
- if (lastPeriod < 0) {
- lastPeriod = inputFile.length();
- }
- return inputFile.substring(lastSlash + 1, lastPeriod);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAssembler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAssembler.java
deleted file mode 100644
index 1d49232a05..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractAssembler.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.AssemblerDef;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-/**
- * An abstract assembler implementation.
- *
- */
-public abstract class AbstractAssembler extends AbstractProcessor
-implements Assembler {
- private String outputSuffix;
- protected AbstractAssembler(String[] sourceExtensions,
- String[] headerExtensions, String outputSuffix) {
- super(sourceExtensions, headerExtensions);
- this.outputSuffix = outputSuffix;
- }
- abstract protected AssemblerConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- AssemblerDef specificConfig, TargetDef targetPlatform);
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- ProcessorDef specificConfig, TargetDef targetPlatform) {
- if (specificConfig == null) {
- throw new NullPointerException("specificConfig");
- }
- return createConfiguration(task, linkType, baseConfigs,
- (AssemblerDef) specificConfig, targetPlatform);
- }
- public String getOutputFileName(String inputFile) {
- if (bid(inputFile) > 1) {
- String baseName = getBaseOutputName(inputFile);
- return baseName + outputSuffix;
- }
- return null;
- }
- protected String getBaseOutputName(String inputFile) {
- int lastSlash = inputFile.lastIndexOf('/');
- int lastReverse = inputFile.lastIndexOf('\\');
- int lastSep = inputFile.lastIndexOf(File.separatorChar);
- if (lastReverse > lastSlash) {
- lastSlash = lastReverse;
- }
- if (lastSep > lastSlash) {
- lastSlash = lastSep;
- }
- int lastPeriod = inputFile.lastIndexOf('.');
- if (lastPeriod < 0) {
- lastPeriod = inputFile.length();
- }
- return inputFile.substring(lastSlash + 1, lastPeriod);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java
deleted file mode 100644
index f16ec6caf3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractCompiler.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.CompilerDef;
-import net.sf.antcontrib.cpptasks.DependencyInfo;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import net.sf.antcontrib.cpptasks.TargetDef;
-
-/**
- * An abstract compiler implementation.
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public abstract class AbstractCompiler extends AbstractProcessor
- implements
- Compiler {
- private static final String[] emptyIncludeArray = new String[0];
- private String outputSuffix;
- protected AbstractCompiler(String[] sourceExtensions,
- String[] headerExtensions, String outputSuffix) {
- super(sourceExtensions, headerExtensions);
- this.outputSuffix = outputSuffix;
- }
- /**
- * Checks file name to see if parse should be attempted
- *
- * Default implementation returns false for files with extensions '.dll',
- * 'tlb', '.res'
- *
- */
- protected boolean canParse(File sourceFile) {
- String sourceName = sourceFile.toString();
- int lastPeriod = sourceName.lastIndexOf('.');
- if (lastPeriod >= 0 && lastPeriod == sourceName.length() - 4) {
- String ext = sourceName.substring(lastPeriod).toUpperCase();
- if (ext.equals(".DLL") || ext.equals(".TLB") || ext.equals(".RES")) {
- return false;
- }
- }
- return true;
- }
- abstract protected CompilerConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- CompilerDef specificConfig, TargetDef targetPlatform);
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- ProcessorDef specificConfig, TargetDef targetPlatform) {
- if (specificConfig == null) {
- throw new NullPointerException("specificConfig");
- }
- return createConfiguration(task, linkType, baseConfigs,
- (CompilerDef) specificConfig, targetPlatform);
- }
- abstract protected Parser createParser(File sourceFile);
- protected String getBaseOutputName(String inputFile) {
- int lastSlash = inputFile.lastIndexOf('/');
- int lastReverse = inputFile.lastIndexOf('\\');
- int lastSep = inputFile.lastIndexOf(File.separatorChar);
- if (lastReverse > lastSlash) {
- lastSlash = lastReverse;
- }
- if (lastSep > lastSlash) {
- lastSlash = lastSep;
- }
- int lastPeriod = inputFile.lastIndexOf('.');
- if (lastPeriod < 0) {
- lastPeriod = inputFile.length();
- }
- return inputFile.substring(lastSlash + 1, lastPeriod);
- }
- public String getOutputFileName(String inputFile) {
- //
- // if a recognized input file
- //
- if (bid(inputFile) > 1) {
- String baseName = getBaseOutputName(inputFile);
- return baseName + outputSuffix;
- }
- return null;
- }
- /**
- * Returns dependency info for the specified source file
- *
- * @param task
- * task for any diagnostic output
- * @param source
- * file to be parsed
- * @param includePath
- * include path to be used to resolve included files
- *
- * @param sysIncludePath
- * sysinclude path from build file, files resolved using
- * sysInclude path will not participate in dependency analysis
- *
- * @param envIncludePath
- * include path from environment variable, files resolved with
- * envIncludePath will not participate in dependency analysis
- *
- * @param baseDir
- * used to produce relative paths in DependencyInfo
- * @param includePathIdentifier
- * used to distinguish DependencyInfo's from different include
- * path settings
- *
- * @author Curt Arnold
- */
- public final DependencyInfo parseIncludes(CCTask task, File source,
- File[] includePath, File[] sysIncludePath, File[] envIncludePath,
- File baseDir, String includePathIdentifier) {
- //
- // if any of the include files can not be identified
- // change the sourceLastModified to Long.MAX_VALUE to
- // force recompilation of anything that depends on it
- long sourceLastModified = source.lastModified();
- File[] sourcePath = new File[1];
- sourcePath[0] = new File(source.getParent());
- Vector onIncludePath = new Vector();
- Vector onSysIncludePath = new Vector();
- String baseDirPath;
- try {
- baseDirPath = baseDir.getCanonicalPath();
- } catch (IOException ex) {
- baseDirPath = baseDir.toString();
- }
- String relativeSource = CUtil.getRelativePath(baseDirPath, source);
- String[] includes = emptyIncludeArray;
- if (canParse(source)) {
- Parser parser = createParser(source);
- try {
- Reader reader = new BufferedReader(new FileReader(source));
- parser.parse(reader);
- includes = parser.getIncludes();
- } catch (IOException ex) {
- task.log("Error parsing " + source.toString() + ":"
- + ex.toString());
- includes = new String[0];
- }
- }
- for (int i = 0; i < includes.length; i++) {
- String includeName = includes[i];
- if (!resolveInclude(includeName, sourcePath, onIncludePath)) {
- if (!resolveInclude(includeName, includePath, onIncludePath)) {
- if (!resolveInclude(includeName, sysIncludePath,
- onSysIncludePath)) {
- if (!resolveInclude(includeName, envIncludePath,
- onSysIncludePath)) {
- //
- // this should be enough to require us to reparse
- // the file with the missing include for dependency
- // information without forcing a rebuild
- sourceLastModified++;
- }
- }
- }
- }
- }
- for (int i = 0; i < onIncludePath.size(); i++) {
- String relativeInclude = CUtil.getRelativePath(baseDirPath,
- (File) onIncludePath.elementAt(i));
- onIncludePath.setElementAt(relativeInclude, i);
- }
- for (int i = 0; i < onSysIncludePath.size(); i++) {
- String relativeInclude = CUtil.getRelativePath(baseDirPath,
- (File) onSysIncludePath.elementAt(i));
- onSysIncludePath.setElementAt(relativeInclude, i);
- }
- return new DependencyInfo(includePathIdentifier, relativeSource,
- sourceLastModified, onIncludePath, onSysIncludePath);
- }
- protected boolean resolveInclude(String includeName, File[] includePath,
- Vector onThisPath) {
- for (int i = 0; i < includePath.length; i++) {
- File includeFile = new File(includePath[i], includeName);
- if (includeFile.exists()) {
- onThisPath.addElement(includeFile);
- return true;
- }
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java
deleted file mode 100644
index 20580e5d33..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractLinker.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerDef;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * An abstract Linker implementation.
- *
- * @author Adam Murdoch
- */
-public abstract class AbstractLinker extends AbstractProcessor
- implements
- Linker {
- public AbstractLinker(String[] objExtensions, String[] ignoredExtensions) {
- super(objExtensions, ignoredExtensions);
- }
- /**
- * Returns the bid of the processor for the file.
- *
- * A linker will bid 1 on any unrecognized file type.
- *
- * @param inputFile
- * filename of input file
- * @return bid for the file, 0 indicates no interest, 1 indicates that the
- * processor recognizes the file but doesn't process it (header
- * files, for example), 100 indicates strong interest
- */
- public int bid(String inputFile) {
- int bid = super.bid(inputFile);
- switch (bid) {
- //
- // unrecognized extension, take the file
- //
- case 0 :
- return 1;
- //
- // discard the ignored extensions
- //
- case 1 :
- return 0;
- }
- return bid;
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- return this;
- }
- abstract protected LinkerConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- LinkerDef specificConfig, TargetDef targetPlatform);
- public ProcessorConfiguration createConfiguration(CCTask task,
- LinkType linkType, ProcessorDef[] baseConfigs,
- ProcessorDef specificConfig,
- TargetDef targetPlatform) {
- if (specificConfig == null) {
- throw new NullPointerException("specificConfig");
- }
- return createConfiguration(task, linkType, baseConfigs,
- (LinkerDef) specificConfig, targetPlatform);
- }
- public String getLibraryKey(File libfile) {
- return libfile.getName();
- }
- public abstract String getOutputFileName(String fileName);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java
deleted file mode 100644
index b6456d5e3e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import org.apache.tools.ant.types.Environment;
-/**
- * An abstract processor (compiler/linker) implementation.
- *
- * @author Curt Arnold
- */
-public abstract class AbstractProcessor implements Processor, Cloneable {
- /**
- * default bid for a file name that the processor recognizes but does not
- * process and does not want to fall through to the linker
- */
- public final static int DEFAULT_DISCARD_BID = 1;
- /**
- * default bid for a file name that the processor desires to process
- */
- public final static int DEFAULT_PROCESS_BID = 100;
- /**
- * Determines the identification of a command line processor by capture the
- * first line of its output for a specific command.
- *
- * @param command
- * array of command line arguments starting with executable
- * name. For example, { "cl" }
- * @param fallback
- * start of identifier if there is an error in executing the
- * command
- * @return identifier for the processor
- */
- protected static String getIdentifier(String[] command, String fallback) {
- String identifier = fallback;
- try {
- String[] cmdout = CaptureStreamHandler.run(command);
- if (cmdout.length > 0) {
- identifier = cmdout[0];
- }
- } catch (Throwable ex) {
- identifier = fallback + ":" + ex.toString();
- }
- return identifier;
- }
- private final String[] headerExtensions;
- private final String[] sourceExtensions;
- protected AbstractProcessor(String[] sourceExtensions,
- String[] headerExtensions) {
- this.sourceExtensions = (String[]) sourceExtensions.clone();
- this.headerExtensions = (String[]) headerExtensions.clone();
- }
- /**
- * Returns the bid of the processor for the file.
- *
- * @param inputFile
- * filename of input file
- * @return bid for the file, 0 indicates no interest, 1 indicates that the
- * processor recognizes the file but doesn't process it (header
- * files, for example), 100 indicates strong interest
- */
- public int bid(String inputFile) {
- String lower = inputFile.toLowerCase();
- for (int i = 0; i < sourceExtensions.length; i++) {
- if (lower.endsWith(sourceExtensions[i])) {
- return DEFAULT_PROCESS_BID;
- }
- }
- for (int i = 0; i < headerExtensions.length; i++) {
- if (lower.endsWith(headerExtensions[i])) {
- return DEFAULT_DISCARD_BID;
- }
- }
- return 0;
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- return this;
- }
- protected Object clone() throws CloneNotSupportedException {
- return super.clone();
- }
- public String[] getHeaderExtensions() {
- return (String[]) this.headerExtensions.clone();
- }
- abstract public String getIdentifier();
- /**
- * Gets the target operating system architecture
- *
- * @return String target operating system architecture
- */
- protected String getOSArch() {
- return System.getProperty("os.arch");
- }
- /**
- * Gets the target operating system name
- *
- * @return String target operating system name
- */
- protected String getOSName() {
- return System.getProperty("os.name");
- }
- public String[] getSourceExtensions() {
- return (String[]) this.sourceExtensions.clone();
- }
- /**
- * Returns true if the target operating system is Mac OS X or Darwin.
- *
- * @return boolean
- */
- protected boolean isDarwin() {
- String osName = getOSName();
- return "Mac OS X".equals(osName);
- }
- public final String toString() {
- return getIdentifier();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Aslcompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Aslcompiler.java
deleted file mode 100644
index a210e1c684..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Aslcompiler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-/**
- * A asl compiler.
- *
- */
-public interface Aslcompiler extends Processor {
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AslcompilerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AslcompilerConfiguration.java
deleted file mode 100644
index 62ac2760c6..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AslcompilerConfiguration.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for an ASL compiler
- *
- */
-public interface AslcompilerConfiguration extends ProcessorConfiguration {
- void aslcompiler(CCTask task, File outputDir, String[] sourceFiles) throws BuildException;
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Assembler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Assembler.java
deleted file mode 100644
index 1b6d7b5d11..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Assembler.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-/**
- * A assembler.
- *
- */
-public interface Assembler extends Processor {
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AssemblerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AssemblerConfiguration.java
deleted file mode 100644
index 9411551b47..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/AssemblerConfiguration.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for an assembler
- *
- */
-public interface AssemblerConfiguration extends ProcessorConfiguration {
- void assembler(CCTask task, File outputDir, String[] sourceFiles) throws BuildException;
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CaptureStreamHandler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CaptureStreamHandler.java
deleted file mode 100644
index 1b89a70a58..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CaptureStreamHandler.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.util.Vector;
-
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.ExecuteStreamHandler;
-/**
- * Implements ExecuteStreamHandler to capture the output of a Execute to an
- * array of strings
- *
- * @author Curt Arnold
- */
-public class CaptureStreamHandler implements ExecuteStreamHandler {
- /**
- * Runs an executable and captures the output in a String array
- *
- * @param cmdline
- * command line arguments
- * @return output of process
- */
- public static String[] run(String[] cmdline) {
- CaptureStreamHandler handler = new CaptureStreamHandler();
- Execute exec = new Execute(handler);
- exec.setCommandline(cmdline);
- try {
- int status = exec.execute();
- } catch (IOException ex) {
- }
- return handler.getOutput();
- }
- private InputStream errorStream;
- private InputStream fromProcess;
- public CaptureStreamHandler() {
- }
- public String[] getOutput() {
- String[] output;
- if (fromProcess != null) {
- Vector lines = new Vector(10);
- try {
- BufferedReader reader = new BufferedReader(
- new InputStreamReader(errorStream));
- for (int i = 0; i < 2; i++) {
- for (int j = 0; j < 100; j++) {
- String line = reader.readLine();
- if (line == null) {
- reader = new BufferedReader(new InputStreamReader(
- fromProcess));
- break;
- }
- lines.addElement(line);
- }
- }
- } catch (IOException ex) {
- }
- output = new String[lines.size()];
- lines.copyInto(output);
- return output;
- }
- output = new String[0];
- return output;
- }
- /**
- * Install a handler for the error stream of the subprocess.
- *
- * @param is
- * input stream to read from the error stream from the
- * subprocess
- */
- public void setProcessErrorStream(InputStream is) throws IOException {
- errorStream = is;
- }
- /**
- * Install a handler for the input stream of the subprocess.
- *
- * @param os
- * output stream to write to the standard input stream of the
- * subprocess
- */
- public void setProcessInputStream(OutputStream os) throws IOException {
- os.close();
- }
- /**
- * Install a handler for the output stream of the subprocess.
- *
- * @param is
- * input stream to read from the error stream from the
- * subprocess
- */
- public void setProcessOutputStream(InputStream is) throws IOException {
- fromProcess = is;
- }
- /**
- * Start handling of the streams.
- */
- public void start() throws IOException {
- }
- /**
- * Stop handling of the streams - will not be restarted.
- */
- public void stop() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompiler.java
deleted file mode 100644
index 88dda5796f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompiler.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.AslcompilerDef;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-
-import org.apache.tools.ant.BuildException;
-/**
- * An abstract ASL Compiler implementation which uses an external program to
- * perform the ASL compile.
- *
- */
-public abstract class CommandLineAslcompiler extends AbstractAslcompiler{
-
- private String command;
- private String identifier;
- private String identifierArg;
-
- protected CommandLineAslcompiler(String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- String outputSuffix) {
- super(sourceExtensions, headerExtensions, outputSuffix);
- this.command = command;
- this.identifierArg = identifierArg;
- }
-
- abstract protected void addImpliedArgs(Vector args, boolean debug,
- Boolean defaultflag);
-
- /**
- * Compile a ACPI source file
- *
- */
- public void aslcompiler(CCTask task, File outputDir, String[] sourceFiles,
- String[] args, String[] endArgs) throws BuildException{
- String command = getCommand();
- int baseLength = command.length() + args.length + endArgs.length;
- for (int i = 0; i < args.length; i++) {
- baseLength += args[i].length();
- }
- for (int i = 0; i < endArgs.length; i++) {
- baseLength += endArgs[i].length();
- }
- if (baseLength > getMaximumCommandLength()) {
- throw new BuildException(
- "Command line is over maximum length without sepcifying source file");
- }
- int maxInputFilesPerCommand = getMaximumInputFilesPerCommand();
- int argumentCountPerInputFile = getArgumentCountPerInputFIle();
- for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) {
- int cmdLength = baseLength;
- int firstFileNextExec;
- for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length
- && (firstFileNextExec - sourceIndex) < maxInputFilesPerCommand; firstFileNextExec++) {
- cmdLength += getTotalArgumentLengthForInputFile(outputDir,
- sourceFiles[firstFileNextExec]);
- if (cmdLength >= getMaximumCommandLength())
- break;
- }
- if (firstFileNextExec == sourceIndex) {
- throw new BuildException(
- "Extremely long file name, can't fit on command line");
- }
- int argCount = args.length + 1 + endArgs.length
- + (firstFileNextExec - sourceIndex)
- * argumentCountPerInputFile;
- String[] commandline = new String[argCount];
- int index = 0;
- commandline[index++] = command;
- for (int j = 0; j < args.length; j++) {
- commandline[index++] = args[j];
- }
- for (int j = sourceIndex; j < firstFileNextExec; j++) {
- for (int k = 0; k < argumentCountPerInputFile; k++) {
- commandline[index++] = getInputFileArgument(outputDir,
- sourceFiles[j], k);
- }
- }
- for (int j = 0; j < endArgs.length; j++) {
- commandline[index++] = endArgs[j];
- }
- int retval = runCommand(task, outputDir, commandline);
- // if with monitor, add more code
- if (retval != 0) {
- throw new BuildException(this.getCommand()
- + " failed with return code " + retval,
- task.getLocation());
- }
- sourceIndex = firstFileNextExec;
- }
- }
-
- protected AslcompilerConfiguration createConfiguration(final CCTask task,
- final LinkType linkType,
- final ProcessorDef[] baseDefs,
- final AslcompilerDef specificDef,
- final TargetDef targetPlatform) {
- Vector args = new Vector();
- AslcompilerDef[] defaultProviders = new AslcompilerDef[baseDefs.length +1];
- for (int i = 0; i < baseDefs.length; i++) {
- defaultProviders[i + 1] = (AslcompilerDef) baseDefs[i];
- }
- defaultProviders[0] = specificDef;
- Vector cmdArgs = new Vector();
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally and specific AslcompilerDef
- //
- CommandLineArgument[] commandArgs;
- for (int i = defaultProviders.length - 1; i >=0; i--){
- commandArgs = defaultProviders[i].getActiveProcessorArgs();
- for (int j = 0; j < commandArgs.length; j++) {
- if (commandArgs[j].getLocation() == 0) {
- args.addElement(commandArgs[j].getValue());
- }
- else {
- cmdArgs.addElement(commandArgs[j]);
- }
- }
- }
- // omit param
- boolean debug = specificDef.getDebug(baseDefs, 0);
- Boolean defaultflag = specificDef.getDefaultflag(defaultProviders, 1);
- this.addImpliedArgs(args, debug, defaultflag);
- Enumeration argEnum = cmdArgs.elements();
- int endCount = 0;
- while( argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum.nextElement();
- switch (arg.getLocation()) {
- case 1 :
- args.addElement(arg.getValue());
- break;
- case 2 :
- endCount++;
- break;
- }
- }
- String[] endArgs = new String[endCount];
- argEnum = cmdArgs.elements();
- int index = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum.nextElement();
- if (arg.getLocation() == 2) {
- endArgs[index++] = arg.getValue();
- }
- }
- String[] argArray = new String[args.size()];
- args.copyInto(argArray);
- return new CommandLineAslcompilerConfiguration(this, argArray, true, endArgs);
- }
-
- protected int getArgumentCountPerInputFile() {
- return 1;
- }
-
- public String getIdentifier() {
- if (identifier == null) {
- if (identifierArg == null) {
- identifier = getIdentifier(new String[]{command}, command);
- }
- else {
- identifier = getIdentifier(
- new String[]{command, identifierArg}, command);
- }
- }
- return identifier;
- }
-
- public final String getCommand() {
- return command;
- }
- abstract public int getMaximumCommandLength();
- public void setCommand(String command) {
- this.command = command;
- }
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- return inputFile.length() + 1;
- }
- protected int runCommand(CCTask task, File workingDir, String[] cmdline)
- throws BuildException {
- return CUtil.runCommand(task, workingDir, cmdline, false, null);
-
- }
- protected int getMaximumInputFilesPerCommand(){
- return 1;
- }
- protected int getArgumentCountPerInputFIle(){
- return 1;
- }
- protected String getInputFileArgument(File outputDir, String filename, int index) {
- //
- // if there is an embedded space,
- // must enclose in quotes
- if (filename.indexOf(' ') >= 0) {
- StringBuffer buf = new StringBuffer("\"");
- buf.append(filename);
- buf.append("\"");
- return buf.toString();
- }
- return filename;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java
deleted file mode 100644
index 9a3457dafb..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAslcompilerConfiguration.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-
-/**
- * A configuration for an ASL compiler
- *
- */
-public final class CommandLineAslcompilerConfiguration implements
- AslcompilerConfiguration {
-
- private String[] args;
-
- private CommandLineAslcompiler acpi;
-
- private String[] endArgs;
-
- private boolean rebuild;
-
- public CommandLineAslcompilerConfiguration (CommandLineAslcompiler acpi,
- String[] args, boolean rebuild, String[] endArgs) {
- if (acpi == null) {
- throw new NullPointerException("acpi");
- }
- if (args == null) {
- this.args = new String[0];
- } else {
- this.args = (String[]) args.clone();
- }
- this.acpi = acpi;
- this.rebuild = rebuild;
- this.endArgs = (String[]) endArgs.clone();
- }
-
- public int bid (String inputFile) {
- int acpiBid = acpi.bid(inputFile);
- return acpiBid;
- }
-
- public void aslcompiler (CCTask task, File outputDir, String[] sourceFiles)
- throws BuildException {
- try {
- acpi.aslcompiler(task, outputDir, sourceFiles, args, endArgs);
- } catch (BuildException ex) {
- throw ex;
- }
- }
-
- public String getIdentifier () {
- return acpi.getCommand();
- }
-
- public ProcessorParam[] getParams () {
- return new ProcessorParam[0];
- }
-
- public boolean getRebuild () {
- return rebuild;
- }
-
- public String[] getPreArguments () {
- return (String[]) args.clone();
- }
-
- public String[] getEndArguments () {
- return (String[]) endArgs.clone();
- }
-
- public String getOutputFileName (String inputFile) {
- return acpi.getOutputFileName(inputFile);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssembler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssembler.java
deleted file mode 100644
index f01fc5ee61..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssembler.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.AssemblerDef;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- * An abstract Assembler implementation which uses an external program to
- * perform the assemble.
- *
- */
-public abstract class CommandLineAssembler extends AbstractAssembler {
-
- private String command;
-
- private String identifier;
-
- private String identifierArg;
-
- protected CommandLineAssembler (String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- String outputSuffix) {
- super(sourceExtensions, headerExtensions, outputSuffix);
- this.command = command;
- this.identifierArg = identifierArg;
- }
-
- abstract protected void addImpliedArgs(Vector args, boolean debug,
- Boolean defaultflag);
-
- /**
- * Adds command-line arguments for include directories.
- *
- * If relativeArgs is not null will add corresponding relative paths include
- * switches to that vector (for use in building a configuration identifier
- * that is consistent between machines).
- *
- * @param baseDirPaths
- * A vector containing the parts of the working directory,
- * produced by CUtil.DecomposeFile.
- * @param includeDirs
- * Array of include directory paths
- * @param args
- * Vector of command line arguments used to execute the task
- * @param relativeArgs
- * Vector of command line arguments used to build the
- * configuration identifier
- */
- protected void addIncludes(String baseDirPath, File[] includeDirs,
- Vector args, Vector relativeArgs, StringBuffer includePathId) {
- for (int i = 0; i < includeDirs.length; i++) {
- args.addElement(getIncludeDirSwitch(includeDirs[i]
- .getAbsolutePath()));
- if (relativeArgs != null) {
- String relative = CUtil.getRelativePath(baseDirPath,
- includeDirs[i]);
- relativeArgs.addElement(getIncludeDirSwitch(relative));
- if (includePathId != null) {
- if (includePathId.length() == 0) {
- includePathId.append("/I");
- } else {
- includePathId.append(" /I");
- }
- includePathId.append(relative);
- }
- }
- }
- }
-
- abstract protected String getIncludeDirSwitch(String source);
-
- /**
- * Assembles a source file
- *
- */
- public void assembler(CCTask task, File outputDir, String[] sourceFiles,
- String[] args, String[] endArgs) throws BuildException {
- String command = getCommand();
- int baseLength = command.length() + args.length + endArgs.length;
- for (int i = 0; i < args.length; i++) {
- baseLength += args[i].length();
- }
- for (int i = 0; i < endArgs.length; i++) {
- baseLength += endArgs[i].length();
- }
- if (baseLength > getMaximumCommandLength()) {
- throw new BuildException(
- "Command line is over maximum length without sepcifying source file");
- }
- int maxInputFilesPerCommand = getMaximumInputFilesPerCommand();
- int argumentCountPerInputFile = getArgumentCountPerInputFIle();
- for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) {
- int cmdLength = baseLength;
- int firstFileNextExec;
- for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length
- && (firstFileNextExec - sourceIndex) < maxInputFilesPerCommand; firstFileNextExec++) {
- cmdLength += getTotalArgumentLengthForInputFile(outputDir,
- sourceFiles[firstFileNextExec]);
- if (cmdLength >= getMaximumCommandLength())
- break;
- }
- if (firstFileNextExec == sourceIndex) {
- throw new BuildException(
- "Extremely long file name, can't fit on command line");
- }
- int argCount = args.length + 1 + endArgs.length
- + (firstFileNextExec - sourceIndex)
- * argumentCountPerInputFile;
- String[] commandline = new String[argCount];
- int index = 0;
- commandline[index++] = command;
- for (int j = 0; j < args.length; j++) {
- commandline[index++] = args[j];
- }
- for (int j = sourceIndex; j < firstFileNextExec; j++) {
- for (int k = 0; k < argumentCountPerInputFile; k++) {
- commandline[index++] = getInputFileArgument(outputDir,
- sourceFiles[j], k);
- }
- }
- for (int j = 0; j < endArgs.length; j++) {
- commandline[index++] = endArgs[j];
- }
- int retval = runCommand(task, outputDir, commandline);
- // if with monitor, add more code
- if (retval != 0) {
- throw new BuildException(this.getCommand()
- + " failed with return code " + retval, task
- .getLocation());
- }
- sourceIndex = firstFileNextExec;
- }
- }
-
- protected AssemblerConfiguration createConfiguration(final CCTask task,
- final LinkType linkType, final ProcessorDef[] baseDefs,
- final AssemblerDef specificDef,
- final TargetDef targetPlatform) {
- Vector args = new Vector();
- AssemblerDef[] defaultProviders = new AssemblerDef[baseDefs.length + 1];
- for (int i = 0; i < baseDefs.length; i++) {
- defaultProviders[i + 1] = (AssemblerDef) baseDefs[i];
- }
- defaultProviders[0] = specificDef;
- Vector cmdArgs = new Vector();
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally and specific AssemblerDef
- //
- CommandLineArgument[] commandArgs;
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- commandArgs = defaultProviders[i].getActiveProcessorArgs();
- for (int j = 0; j < commandArgs.length; j++) {
- if (commandArgs[j].getLocation() == 0) {
- args.addElement(commandArgs[j].getValue());
- } else {
- cmdArgs.addElement(commandArgs[j]);
- }
- }
- }
- // omit param
- boolean debug = specificDef.getDebug(baseDefs, 0);
- Boolean defaultflag = specificDef.getDefaultflag(defaultProviders, 1);
- this.addImpliedArgs(args, debug, defaultflag);
- //
- // Want to have distinct set of arguments with relative
- // path names for includes that are used to build
- // the configuration identifier
- //
- Vector relativeArgs = (Vector) args.clone();
- //
- // add all active include an
- //
- StringBuffer includePathIdentifier = new StringBuffer();
- File baseDir = specificDef.getProject().getBaseDir();
- String baseDirPath;
- try {
- baseDirPath = baseDir.getCanonicalPath();
- } catch (IOException ex) {
- baseDirPath = baseDir.toString();
- }
- Vector includePath = new Vector();
- Vector sysIncludePath = new Vector();
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- String[] incPath = defaultProviders[i].getActiveIncludePaths();
- for (int j = 0; j < incPath.length; j++) {
- includePath.addElement(incPath[j]);
- }
- incPath = defaultProviders[i].getActiveSysIncludePaths();
- for (int j = 0; j < incPath.length; j++) {
- sysIncludePath.addElement(incPath[j]);
- }
- }
- File[] incPath = new File[includePath.size()];
- for (int i = 0; i < includePath.size(); i++) {
- incPath[i] = new File((String) includePath.elementAt(i));
- }
- File[] sysIncPath = new File[sysIncludePath.size()];
- for (int i = 0; i < sysIncludePath.size(); i++) {
- sysIncPath[i] = new File((String) sysIncludePath.elementAt(i));
- }
- addIncludes(baseDirPath, incPath, args, relativeArgs,
- includePathIdentifier);
- addIncludes(baseDirPath, sysIncPath, args, null, null);
- StringBuffer buf = new StringBuffer(getIdentifier());
- for (int i = 0; i < relativeArgs.size(); i++) {
- buf.append(relativeArgs.elementAt(i));
- buf.append(' ');
- }
- buf.setLength(buf.length() - 1);
- Enumeration argEnum = cmdArgs.elements();
- int endCount = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- switch (arg.getLocation()) {
- case 1:
- args.addElement(arg.getValue());
- break;
- case 2:
- endCount++;
- break;
- }
- }
- String[] endArgs = new String[endCount];
- argEnum = cmdArgs.elements();
- int index = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- if (arg.getLocation() == 2) {
- endArgs[index++] = arg.getValue();
- }
- }
- String[] argArray = new String[args.size()];
- args.copyInto(argArray);
- return new CommandLineAssemblerConfiguration(this, incPath, sysIncPath,
- new File[0], argArray, true, endArgs, new String[0]);
- }
-
- protected int getArgumentCountPerInputFile() {
- return 1;
- }
-
- protected abstract File[] getEnvironmentIncludePath();
-
- public String getIdentifier() {
- if (identifier == null) {
- if (identifierArg == null) {
- identifier = getIdentifier(new String[] { command }, command);
- } else {
- identifier = getIdentifier(new String[] { command,
- identifierArg }, command);
- }
- }
- return identifier;
- }
-
- public final String getCommand() {
- return command;
- }
-
- abstract public int getMaximumCommandLength();
-
- public void setCommand(String command) {
- this.command = command;
- }
-
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- return inputFile.length() + 1;
- }
-
- protected int runCommand(CCTask task, File workingDir, String[] cmdline)
- throws BuildException {
- return CUtil.runCommand(task, workingDir, cmdline, false, null);
- }
-
- protected int getMaximumInputFilesPerCommand() {
- return Integer.MAX_VALUE;
- }
-
- protected int getArgumentCountPerInputFIle() {
- return 1;
- }
-
- protected String getInputFileArgument(File outputDir, String filename,
- int index) {
- //
- // if there is an embedded space,
- // must enclose in quotes
- if (filename.indexOf(' ') >= 0) {
- StringBuffer buf = new StringBuffer("\"");
- buf.append(filename);
- buf.append("\"");
- return buf.toString();
- }
- return filename;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssemblerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssemblerConfiguration.java
deleted file mode 100644
index 542d441559..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineAssemblerConfiguration.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-
-/**
- * A configuration for an assember
- *
- */
-public final class CommandLineAssemblerConfiguration implements
- AssemblerConfiguration {
-
- private String[] args;
-
- private CommandLineAssembler assembler;
-
- private String[] endArgs;
-
- //
- // include path from environment variable
- // not explicitly stated in Ant script
- //
- private File[] envIncludePath;
-
- private String[] exceptFiles;
-
- private File[] includePath;
-
- private boolean rebuild;
-
- private File[] sysIncludePath;
-
- public CommandLineAssemblerConfiguration (CommandLineAssembler assembler,
- File[] includePath, File[] sysIncludePath,
- File[] envIncludePath, String[] args, boolean rebuild,
- String[] endArgs, String[] exceptFiles) {
- if (assembler == null) {
- throw new NullPointerException("assembler");
- }
- if (args == null) {
- this.args = new String[0];
- } else {
- this.args = (String[]) args.clone();
- }
- if (includePath == null) {
- this.includePath = new File[0];
- } else {
- this.includePath = (File[]) includePath.clone();
- }
- if (sysIncludePath == null) {
- this.sysIncludePath = new File[0];
- } else {
- this.sysIncludePath = (File[]) sysIncludePath.clone();
- }
- if (envIncludePath == null) {
- this.envIncludePath = new File[0];
- } else {
- this.envIncludePath = (File[]) envIncludePath.clone();
- }
- this.assembler = assembler;
- this.rebuild = rebuild;
- this.endArgs = (String[]) endArgs.clone();
- this.exceptFiles = (String[]) exceptFiles.clone();
- }
-
- public int bid(String inputFile) {
- int assembleBid = assembler.bid(inputFile);
- return assembleBid;
- }
-
- public void assembler(CCTask task, File outputDir, String[] sourceFiles)
- throws BuildException {
- try {
- assembler.assembler(task, outputDir, sourceFiles, args, endArgs);
- } catch (BuildException ex) {
- throw ex;
- }
- }
-
- public String getOutputFileName(String inputFile) {
- return assembler.getOutputFileName(inputFile);
- }
-
- public String getIdentifier() {
- return assembler.getCommand();
- }
-
- public ProcessorParam[] getParams() {
- return new ProcessorParam[0];
- }
-
- public boolean getRebuild() {
- return rebuild;
- }
-
- public String[] getPreArguments() {
- return (String[]) args.clone();
- }
-
- public String[] getEndArguments() {
- return (String[]) endArgs.clone();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java
deleted file mode 100644
index 442d6b8187..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCCompiler.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * An abstract Compiler implementation which uses an external program to
- * perform the compile.
- *
- * @author Adam Murdoch
- */
-public abstract class CommandLineCCompiler extends CommandLineCompiler {
- protected CommandLineCCompiler(String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- String outputSuffix, boolean libtool,
- CommandLineCCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- outputSuffix, libtool, libtoolCompiler, newEnvironment, env);
- }
- protected Parser createParser(File source) {
- return new CParser();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
deleted file mode 100644
index 3f45ce539d..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompiler.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.CompilerDef;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-import net.sf.antcontrib.cpptasks.types.UndefineArgument;
-import net.sf.antcontrib.cpptasks.TargetDef;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;;
-/**
- * An abstract Compiler implementation which uses an external program to
- * perform the compile.
- *
- * @author Adam Murdoch
- */
-public abstract class CommandLineCompiler extends AbstractCompiler {
- private String command;
- private final Environment env;
- private String identifier;
- private String identifierArg;
- private boolean libtool;
- private CommandLineCompiler libtoolCompiler;
- private final boolean newEnvironment;
- protected CommandLineCompiler(String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- String outputSuffix, boolean libtool,
- CommandLineCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(sourceExtensions, headerExtensions, outputSuffix);
- this.command = command;
- if (libtool && libtoolCompiler != null) {
- throw new java.lang.IllegalArgumentException(
- "libtoolCompiler should be null when libtool is true");
- }
- this.libtool = libtool;
- this.libtoolCompiler = libtoolCompiler;
- this.identifierArg = identifierArg;
- this.newEnvironment = newEnvironment;
- this.env = env;
- }
- abstract protected void addImpliedArgs(Vector args, boolean debug,
- boolean multithreaded, boolean exceptions, LinkType linkType,
- Boolean rtti, OptimizationEnum optimization, Boolean defaultflag);
- /**
- * Adds command-line arguments for include directories.
- *
- * If relativeArgs is not null will add corresponding relative paths
- * include switches to that vector (for use in building a configuration
- * identifier that is consistent between machines).
- *
- * @param baseDirPaths
- * A vector containing the parts of the working directory,
- * produced by CUtil.DecomposeFile.
- * @param includeDirs
- * Array of include directory paths
- * @param args
- * Vector of command line arguments used to execute the task
- * @param relativeArgs
- * Vector of command line arguments used to build the
- * configuration identifier
- */
- protected void addIncludes(String baseDirPath, File[] includeDirs,
- Vector args, Vector relativeArgs, StringBuffer includePathId) {
- for (int i = 0; i < includeDirs.length; i++) {
- args.addElement(getIncludeDirSwitch(includeDirs[i]
- .getAbsolutePath()));
- if (relativeArgs != null) {
- String relative = CUtil.getRelativePath(baseDirPath,
- includeDirs[i]);
- relativeArgs.addElement(getIncludeDirSwitch(relative));
- if (includePathId != null) {
- if (includePathId.length() == 0) {
- includePathId.append("/I");
- } else {
- includePathId.append(" /I");
- }
- includePathId.append(relative);
- }
- }
- }
- }
- abstract protected void addWarningSwitch(Vector args, int warnings);
- protected void buildDefineArguments(CompilerDef[] defs, Vector args) {
- //
- // assume that we aren't inheriting defines from containing <cc>
- //
- UndefineArgument[] merged = defs[0].getActiveDefines();
- for (int i = 1; i < defs.length; i++) {
- //
- // if we are inheriting, merge the specific defines with the
- // containing defines
- merged = UndefineArgument.merge(defs[i].getActiveDefines(), merged);
- }
- StringBuffer buf = new StringBuffer(30);
- for (int i = 0; i < merged.length; i++) {
- buf.setLength(0);
- UndefineArgument current = merged[i];
- if (current.isDefine()) {
- getDefineSwitch(buf, current.getName(), current.getValue());
- } else {
- getUndefineSwitch(buf, current.getName());
- }
- args.addElement(buf.toString());
- }
- }
- /**
- * Compiles a source file.
- *
- * @author Curt Arnold
- */
- public void compile(CCTask task, File outputDir, String[] sourceFiles,
- String[] args, String[] endArgs, boolean relentless,
- CommandLineCompilerConfiguration config, ProgressMonitor monitor)
- throws BuildException {
- BuildException exc = null;
- //
- // determine length of executable name and args
- //
- String command = getCommand();
- int baseLength = command.length() + args.length + endArgs.length;
- if (libtool) {
- baseLength += 8;
- }
- for (int i = 0; i < args.length; i++) {
- baseLength += args[i].length();
- }
- for (int i = 0; i < endArgs.length; i++) {
- baseLength += endArgs[i].length();
- }
- if (baseLength > getMaximumCommandLength()) {
- throw new BuildException(
- "Command line is over maximum length without specifying source file");
- }
- //
- // typically either 1 or Integer.MAX_VALUE
- //
- int maxInputFilesPerCommand = getMaximumInputFilesPerCommand();
- int argumentCountPerInputFile = getArgumentCountPerInputFile();
- for (int sourceIndex = 0; sourceIndex < sourceFiles.length;) {
- int cmdLength = baseLength;
- int firstFileNextExec;
- for (firstFileNextExec = sourceIndex; firstFileNextExec < sourceFiles.length
- && (firstFileNextExec - sourceIndex) < maxInputFilesPerCommand; firstFileNextExec++) {
- cmdLength += getTotalArgumentLengthForInputFile(outputDir,
- sourceFiles[firstFileNextExec]);
- if (cmdLength >= getMaximumCommandLength())
- break;
- }
- if (firstFileNextExec == sourceIndex) {
- throw new BuildException(
- "Extremely long file name, can't fit on command line");
- }
- int argCount = args.length + 1 + endArgs.length
- + (firstFileNextExec - sourceIndex)
- * argumentCountPerInputFile;
- if (libtool) {
- argCount++;
- }
- String[] commandline = new String[argCount];
- int index = 0;
- if (libtool) {
- commandline[index++] = "libtool";
- }
- commandline[index++] = command;
- for (int j = 0; j < args.length; j++) {
- commandline[index++] = args[j];
- }
- for (int j = sourceIndex; j < firstFileNextExec; j++) {
- for (int k = 0; k < argumentCountPerInputFile; k++) {
- commandline[index++] = getInputFileArgument(outputDir,
- sourceFiles[j], k);
- }
- }
- for (int j = 0; j < endArgs.length; j++) {
- commandline[index++] = endArgs[j];
- }
- int retval = runCommand(task, outputDir, commandline);
- if (monitor != null) {
- String[] fileNames = new String[firstFileNextExec - sourceIndex];
- for (int j = 0; j < fileNames.length; j++) {
- fileNames[j] = sourceFiles[sourceIndex + j];
- }
- monitor.progress(fileNames);
- }
- //
- // if the process returned a failure code and
- // we aren't holding an exception from an earlier
- // interation
- if (retval != 0 && exc == null) {
- //
- // construct the exception
- //
- exc = new BuildException(this.getCommand()
- + " failed with return code " + retval, task
- .getLocation());
- //
- // and throw it now unless we are relentless
- //
- if (!relentless) {
- throw exc;
- }
- }
- sourceIndex = firstFileNextExec;
- }
- //
- // if the compiler returned a failure value earlier
- // then throw an exception
- if (exc != null) {
- throw exc;
- }
- }
- protected CompilerConfiguration createConfiguration(final CCTask task,
- final LinkType linkType,
- final ProcessorDef[] baseDefs,
- final CompilerDef specificDef,
- final TargetDef targetPlatform) {
- Vector args = new Vector();
- CompilerDef[] defaultProviders = new CompilerDef[baseDefs.length + 1];
- for (int i = 0; i < baseDefs.length; i++) {
- defaultProviders[i + 1] = (CompilerDef) baseDefs[i];
- }
- defaultProviders[0] = specificDef;
- Vector cmdArgs = new Vector();
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally the specific CompilerDef
- CommandLineArgument[] commandArgs;
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- commandArgs = defaultProviders[i].getActiveProcessorArgs();
- for (int j = 0; j < commandArgs.length; j++) {
- if (commandArgs[j].getLocation() == 0) {
- args.addElement(commandArgs[j].getValue());
- } else {
- cmdArgs.addElement(commandArgs[j]);
- }
- }
- }
- Vector params = new Vector();
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally the specific CompilerDef
- ProcessorParam[] paramArray;
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- paramArray = defaultProviders[i].getActiveProcessorParams();
- for (int j = 0; j < paramArray.length; j++) {
- params.add(paramArray[j]);
- }
- }
- paramArray = (ProcessorParam[]) (params
- .toArray(new ProcessorParam[params.size()]));
- boolean multithreaded = specificDef.getMultithreaded(defaultProviders,
- 1);
- boolean debug = specificDef.getDebug(baseDefs, 0);
- boolean exceptions = specificDef.getExceptions(defaultProviders, 1);
- Boolean rtti = specificDef.getRtti(defaultProviders, 1);
- Boolean defaultflag = specificDef.getDefaultflag(defaultProviders, 1);
- OptimizationEnum optimization = specificDef.getOptimization(defaultProviders, 1);
- this.addImpliedArgs(args, debug, multithreaded, exceptions, linkType, rtti, optimization, defaultflag);
- //
- // add all appropriate defines and undefines
- //
- buildDefineArguments(defaultProviders, args);
- //
- // Want to have distinct set of arguments with relative
- // path names for includes that are used to build
- // the configuration identifier
- //
- Vector relativeArgs = (Vector) args.clone();
- //
- // add all active include and sysincludes
- //
- StringBuffer includePathIdentifier = new StringBuffer();
- File baseDir = specificDef.getProject().getBaseDir();
- String baseDirPath;
- try {
- baseDirPath = baseDir.getCanonicalPath();
- } catch (IOException ex) {
- baseDirPath = baseDir.toString();
- }
- Vector includePath = new Vector();
- Vector sysIncludePath = new Vector();
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- String[] incPath = defaultProviders[i].getActiveIncludePaths();
- for (int j = 0; j < incPath.length; j++) {
- includePath.addElement(incPath[j]);
- }
- incPath = defaultProviders[i].getActiveSysIncludePaths();
- for (int j = 0; j < incPath.length; j++) {
- sysIncludePath.addElement(incPath[j]);
- }
- }
- File[] incPath = new File[includePath.size()];
- for (int i = 0; i < includePath.size(); i++) {
- incPath[i] = new File((String) includePath.elementAt(i));
- }
- File[] sysIncPath = new File[sysIncludePath.size()];
- for (int i = 0; i < sysIncludePath.size(); i++) {
- sysIncPath[i] = new File((String) sysIncludePath.elementAt(i));
- }
- addIncludes(baseDirPath, incPath, args, relativeArgs,
- includePathIdentifier);
- addIncludes(baseDirPath, sysIncPath, args, null, null);
- StringBuffer buf = new StringBuffer(getIdentifier());
- for (int i = 0; i < relativeArgs.size(); i++) {
- buf.append(relativeArgs.elementAt(i));
- buf.append(' ');
- }
- buf.setLength(buf.length() - 1);
- String configId = buf.toString();
- int warnings = specificDef.getWarnings(defaultProviders, 0);
- addWarningSwitch(args, warnings);
- Enumeration argEnum = cmdArgs.elements();
- int endCount = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- switch (arg.getLocation()) {
- case 1 :
- args.addElement(arg.getValue());
- break;
- case 2 :
- endCount++;
- break;
- }
- }
- String[] endArgs = new String[endCount];
- argEnum = cmdArgs.elements();
- int index = 0;
- while (argEnum.hasMoreElements()) {
- CommandLineArgument arg = (CommandLineArgument) argEnum
- .nextElement();
- if (arg.getLocation() == 2) {
- endArgs[index++] = arg.getValue();
- }
- }
- String[] argArray = new String[args.size()];
- args.copyInto(argArray);
- boolean rebuild = specificDef.getRebuild(baseDefs, 0);
- File[] envIncludePath = getEnvironmentIncludePath();
- return new CommandLineCompilerConfiguration(this, configId, incPath,
- sysIncPath, envIncludePath, includePathIdentifier.toString(),
- argArray, paramArray, rebuild, endArgs);
- }
- protected int getArgumentCountPerInputFile() {
- return 1;
- }
- protected final String getCommand() {
- return command;
- }
- abstract protected void getDefineSwitch(StringBuffer buffer, String define,
- String value);
- protected abstract File[] getEnvironmentIncludePath();
- public String getIdentifier() {
- if (identifier == null) {
- if (identifierArg == null) {
- identifier = getIdentifier(new String[]{command}, command);
- } else {
- identifier = getIdentifier(
- new String[]{command, identifierArg}, command);
- }
- }
- return identifier;
- }
- abstract protected String getIncludeDirSwitch(String source);
- protected String getInputFileArgument(File outputDir, String filename,
- int index) {
- //
- // if there is an embedded space,
- // must enclose in quotes
- if (filename.indexOf(' ') >= 0) {
- StringBuffer buf = new StringBuffer("\"");
- buf.append(filename);
- buf.append("\"");
- return buf.toString();
- }
- return filename;
- }
- protected final boolean getLibtool() {
- return libtool;
- }
- /**
- * Obtains the same compiler, but with libtool set
- *
- * Default behavior is to ignore libtool
- */
- public final CommandLineCompiler getLibtoolCompiler() {
- if (libtoolCompiler != null) {
- return libtoolCompiler;
- }
- return this;
- }
- abstract public int getMaximumCommandLength();
- protected int getMaximumInputFilesPerCommand() {
- return Integer.MAX_VALUE;
- }
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- return inputFile.length() + 1;
- }
- abstract protected void getUndefineSwitch(StringBuffer buffer, String define);
- /**
- * This method is exposed so test classes can overload and test the
- * arguments without actually spawning the compiler
- */
- protected int runCommand(CCTask task, File workingDir, String[] cmdline)
- throws BuildException {
- return CUtil.runCommand(task, workingDir, cmdline, newEnvironment, env);
- }
- protected final void setCommand(String command) {
- this.command = command;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java
deleted file mode 100644
index 4c53df105b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineCompilerConfiguration.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CompilerParam;
-import net.sf.antcontrib.cpptasks.DependencyInfo;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for a C++ compiler
- *
- * @author Curt Arnold
- */
-public final class CommandLineCompilerConfiguration
- implements
- CompilerConfiguration {
- private/* final */String[] args;
- private/* final */CommandLineCompiler compiler;
- private String[] endArgs;
- //
- // include path from environment variable not
- // explicitly stated in Ant script
- private/* final */File[] envIncludePath;
- private String[] exceptFiles;
- private/* final */String identifier;
- private/* final */File[] includePath;
- private/* final */String includePathIdentifier;
- private boolean isPrecompiledHeaderGeneration;
- private/* final */ProcessorParam[] params;
- private/* final */boolean rebuild;
- private/* final */File[] sysIncludePath;
- public CommandLineCompilerConfiguration(CommandLineCompiler compiler,
- String identifier, File[] includePath, File[] sysIncludePath,
- File[] envIncludePath, String includePathIdentifier, String[] args,
- ProcessorParam[] params, boolean rebuild, String[] endArgs) {
- if (compiler == null) {
- throw new NullPointerException("compiler");
- }
- if (identifier == null) {
- throw new NullPointerException("identifier");
- }
- if (includePathIdentifier == null) {
- throw new NullPointerException("includePathIdentifier");
- }
- if (args == null) {
- this.args = new String[0];
- } else {
- this.args = (String[]) args.clone();
- }
- if (includePath == null) {
- this.includePath = new File[0];
- } else {
- this.includePath = (File[]) includePath.clone();
- }
- if (sysIncludePath == null) {
- this.sysIncludePath = new File[0];
- } else {
- this.sysIncludePath = (File[]) sysIncludePath.clone();
- }
- if (envIncludePath == null) {
- this.envIncludePath = new File[0];
- } else {
- this.envIncludePath = (File[]) envIncludePath.clone();
- }
- this.compiler = compiler;
- this.params = (ProcessorParam[]) params.clone();
- this.rebuild = rebuild;
- this.identifier = identifier;
- this.includePathIdentifier = includePathIdentifier;
- this.endArgs = (String[]) endArgs.clone();
- exceptFiles = null;
- isPrecompiledHeaderGeneration = false;
- }
- public CommandLineCompilerConfiguration(
- CommandLineCompilerConfiguration base, String[] additionalArgs,
- String[] exceptFiles, boolean isPrecompileHeaderGeneration) {
- compiler = base.compiler;
- identifier = base.identifier;
- rebuild = base.rebuild;
- includePath = (File[]) base.includePath.clone();
- sysIncludePath = (File[]) base.sysIncludePath.clone();
- endArgs = (String[]) base.endArgs.clone();
- envIncludePath = (File[]) base.envIncludePath.clone();
- includePathIdentifier = base.includePathIdentifier;
- if (exceptFiles != null) {
- this.exceptFiles = (String[]) exceptFiles.clone();
- }
- this.isPrecompiledHeaderGeneration = isPrecompileHeaderGeneration;
- args = new String[base.args.length + additionalArgs.length];
- for (int i = 0; i < base.args.length; i++) {
- args[i] = base.args[i];
- }
- int index = base.args.length;
- for (int i = 0; i < additionalArgs.length; i++) {
- args[index++] = additionalArgs[i];
- }
- }
- public int bid(String inputFile) {
- int compilerBid = compiler.bid(inputFile);
- if (compilerBid > 0 && exceptFiles != null) {
- for (int i = 0; i < exceptFiles.length; i++) {
- if (inputFile.equals(exceptFiles[i])) {
- return 0;
- }
- }
- }
- return compilerBid;
- }
- public void compile(CCTask task, File outputDir, String[] sourceFiles,
- boolean relentless, ProgressMonitor monitor) throws BuildException {
- if (monitor != null) {
- monitor.start(this);
- }
- try {
- compiler.compile(task, outputDir, sourceFiles, args, endArgs,
- relentless, this, monitor);
- if (monitor != null) {
- monitor.finish(this, true);
- }
- } catch (BuildException ex) {
- if (monitor != null) {
- monitor.finish(this, false);
- }
- throw ex;
- }
- }
- /**
- *
- * This method may be used to get two distinct compiler configurations, one
- * for compiling the specified file and producing a precompiled header
- * file, and a second for compiling other files using the precompiled
- * header file.
- *
- * The last (preferrably only) include directive in the prototype file will
- * be used to mark the boundary between pre-compiled and normally compiled
- * headers.
- *
- * @param prototype
- * A source file (for example, stdafx.cpp) that is used to build
- * the precompiled header file. @returns null if precompiled
- * headers are not supported or a two element array containing
- * the precompiled header generation configuration and the
- * consuming configuration
- *
- */
- public CompilerConfiguration[] createPrecompileConfigurations(
- File prototype, String[] nonPrecompiledFiles) {
- if (compiler instanceof PrecompilingCompiler) {
- return ((PrecompilingCompiler) compiler)
- .createPrecompileConfigurations(this, prototype,
- nonPrecompiledFiles);
- }
- return null;
- }
- /**
- * Returns a string representation of this configuration. Should be
- * canonical so that equivalent configurations will have equivalent string
- * representations
- */
- public String getIdentifier() {
- return identifier;
- }
- public String getIncludePathIdentifier() {
- return includePathIdentifier;
- }
- public String getOutputFileName(String inputFile) {
- return compiler.getOutputFileName(inputFile);
- }
- public CompilerParam getParam(String name) {
- for (int i = 0; i < params.length; i++) {
- if (name.equals(params[i].getName()))
- return (CompilerParam) params[i];
- }
- return null;
- }
- public ProcessorParam[] getParams() {
- return params;
- }
- public boolean getRebuild() {
- return rebuild;
- }
- public boolean isPrecompileGeneration() {
- return isPrecompiledHeaderGeneration;
- }
- public DependencyInfo parseIncludes(CCTask task, File baseDir, File source) {
- return compiler.parseIncludes(task, source, includePath,
- sysIncludePath, envIncludePath, baseDir,
- getIncludePathIdentifier());
- }
- public String toString() {
- return identifier;
- }
- public String[] getPreArguments() {
- return (String[]) args.clone();
- }
- public String[] getEndArguments() {
- return (String[]) endArgs.clone();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java
deleted file mode 100644
index d01cb9e356..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineFortranCompiler.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.parser.FortranParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * An abstract Compiler implementation which uses an external program to
- * perform the compile.
- *
- * @author Curt Arnold
- */
-public abstract class CommandLineFortranCompiler extends CommandLineCompiler {
- protected CommandLineFortranCompiler(String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- String outputSuffix, boolean libtool,
- CommandLineFortranCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- outputSuffix, libtool, libtoolCompiler, newEnvironment, env);
- }
- protected Parser createParser(File source) {
- return new FortranParser();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java
deleted file mode 100644
index 4161469a8f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinker.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.LinkerDef;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.TargetDef;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-
-
-/**
- * An abstract Linker implementation that performs the link via an external
- * command.
- *
- * @author Adam Murdoch
- */
-public abstract class CommandLineLinker extends AbstractLinker
-{
- private String command;
- private Environment env = null;
- private String identifier;
- private String identifierArg;
- private boolean isLibtool;
- private String[] librarySets;
- private CommandLineLinker libtoolLinker;
- private boolean newEnvironment = false;
- private String outputSuffix;
-
-
- /** Creates a comand line linker invocation */
- public CommandLineLinker(String command,
- String identifierArg,
- String[] extensions,
- String[] ignoredExtensions, String outputSuffix,
- boolean isLibtool, CommandLineLinker libtoolLinker)
- {
- super(extensions, ignoredExtensions);
- this.command = command;
- this.identifierArg = identifierArg;
- this.outputSuffix = outputSuffix;
- this.isLibtool = isLibtool;
- this.libtoolLinker = libtoolLinker;
- }
- protected abstract void addBase(long base, Vector args);
-
- protected abstract void addFixed(Boolean fixed, Vector args);
-
- abstract protected void addImpliedArgs(boolean debug,
- LinkType linkType, Vector args, Boolean defaultflag);
- protected abstract void addIncremental(boolean incremental, Vector args);
-
- //
- // Windows processors handle these through file list
- //
- protected String[] addLibrarySets(CCTask task, LibrarySet[] libsets, Vector preargs,
- Vector midargs, Vector endargs) {
- return null;
- }
- protected abstract void addMap(boolean map, Vector args);
- protected abstract void addStack(int stack, Vector args);
- protected abstract void addEntry(String entry, Vector args);
-
- protected LinkerConfiguration createConfiguration(
- CCTask task,
- LinkType linkType,
- ProcessorDef[] baseDefs, LinkerDef specificDef, TargetDef targetPlatform) {
-
- Vector preargs = new Vector();
- Vector midargs = new Vector();
- Vector endargs = new Vector();
- Vector[] args = new Vector[] { preargs, midargs, endargs };
-
- LinkerDef[] defaultProviders = new LinkerDef[baseDefs.length+1];
- defaultProviders[0] = specificDef;
- for(int i = 0; i < baseDefs.length; i++) {
- defaultProviders[i+1] = (LinkerDef) baseDefs[i];
- }
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally the specific CompilerDef
- CommandLineArgument[] commandArgs;
- for(int i = defaultProviders.length-1; i >= 0; i--) {
- commandArgs = defaultProviders[i].getActiveProcessorArgs();
- for(int j = 0; j < commandArgs.length; j++) {
- args[commandArgs[j].getLocation()].
- addElement(commandArgs[j].getValue());
- }
- }
-
- Vector params = new Vector();
- //
- // add command line arguments inherited from <cc> element
- // any "extends" and finally the specific CompilerDef
- ProcessorParam[] paramArray;
- for (int i = defaultProviders.length - 1; i >= 0; i--) {
- paramArray = defaultProviders[i].getActiveProcessorParams();
- for (int j = 0; j < paramArray.length; j++) {
- params.add(paramArray[j]);
- }
- }
-
- paramArray = (ProcessorParam[])(params.toArray(new ProcessorParam[params.size()]));
-
- boolean debug = specificDef.getDebug(baseDefs,0);
-
-
- String startupObject = getStartupObject(linkType);
- Boolean defaultflag = specificDef.getDefaultflag(defaultProviders, 1);
- addImpliedArgs(debug, linkType, preargs, defaultflag);
- addIncremental(specificDef.getIncremental(defaultProviders,1), preargs);
- addFixed(specificDef.getFixed(defaultProviders,1), preargs);
- addMap(specificDef.getMap(defaultProviders,1), preargs);
- addBase(specificDef.getBase(defaultProviders,1), preargs);
- addStack(specificDef.getStack(defaultProviders,1), preargs);
- addEntry(specificDef.getEntry(defaultProviders, 1), preargs);
-
- String[] libnames = null;
- LibrarySet[] libsets = specificDef.getActiveLibrarySets(defaultProviders,1);
- if (libsets.length > 0) {
- libnames = addLibrarySets(task, libsets, preargs, midargs, endargs);
- }
-
- StringBuffer buf = new StringBuffer(getIdentifier());
- for (int i = 0; i < 3; i++) {
- Enumeration argenum = args[i].elements();
- while (argenum.hasMoreElements()) {
- buf.append(' ');
- buf.append(argenum.nextElement().toString());
- }
- }
- String configId = buf.toString();
-
- String[][] options = new String[][] {
- new String[args[0].size() + args[1].size()],
- new String[args[2].size()] };
- args[0].copyInto(options[0]);
- int offset = args[0].size();
- for (int i = 0; i < args[1].size(); i++) {
- options[0][i+offset] = (String) args[1].elementAt(i);
- }
- args[2].copyInto(options[1]);
-
-
- boolean rebuild = specificDef.getRebuild(baseDefs,0);
- boolean map = specificDef.getMap(defaultProviders,1);
-
- //task.log("libnames:"+libnames.length, Project.MSG_VERBOSE);
- return new CommandLineLinkerConfiguration(this,configId,options,
- paramArray,
- rebuild,map,libnames, startupObject);
- }
-
- /**
- * Allows drived linker to decorate linker option.
- * Override by GccLinker to prepend a "-Wl," to
- * pass option to through gcc to linker.
- *
- * @param buf buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg linker argument
- */
- protected String decorateLinkerOption(StringBuffer buf, String arg) {
- return arg;
- }
-
- protected final String getCommand() {
- return command;
- }
- protected abstract String getCommandFileSwitch(String commandFile);
-
-
- public String getIdentifier() {
- if(identifier == null) {
- if (identifierArg == null) {
- identifier = getIdentifier(new String[] { command }, command);
- } else {
- identifier = getIdentifier(new String[] { command, identifierArg },
- command);
- }
- }
- return identifier;
- }
- public final CommandLineLinker getLibtoolLinker() {
- if (libtoolLinker != null) {
- return libtoolLinker;
- }
- return this;
- }
- protected abstract int getMaximumCommandLength();
-
- public String getOutputFileName(String baseName) {
- return baseName + outputSuffix;
- }
-
- protected String[] getOutputFileSwitch(CCTask task, String outputFile) {
- return getOutputFileSwitch(outputFile);
- }
- protected abstract String[] getOutputFileSwitch(String outputFile);
- protected String getStartupObject(LinkType linkType) {
- return null;
- }
-
- /**
- * Performs a link using a command line linker
- *
- */
- public void link(CCTask task,
- File outputFile,
- String[] sourceFiles,
- CommandLineLinkerConfiguration config)
- throws BuildException
- {
- File parentDir = new File(outputFile.getParent());
- String parentPath;
- try {
- parentPath = parentDir.getCanonicalPath();
- } catch(IOException ex) {
- parentPath = parentDir.getAbsolutePath();
- }
- String[] execArgs = prepareArguments(task, parentPath,outputFile.getName(),
- sourceFiles, config);
- int commandLength = 0;
- for(int i = 0; i < execArgs.length; i++) {
- commandLength += execArgs[i].length() + 1;
- }
-
- //
- // if command length exceeds maximum
- // (1024 for Windows) then create a temporary
- // file containing everything but the command name
- if(commandLength >= this.getMaximumCommandLength()) {
- try {
- execArgs = prepareResponseFile(outputFile,execArgs);
- }
- catch(IOException ex) {
- throw new BuildException(ex);
- }
- }
-
- int retval = runCommand(task,parentDir,execArgs);
- //
- // if the process returned a failure code then
- // throw an BuildException
- //
- if(retval != 0) {
- //
- // construct the exception
- //
- throw new BuildException(this.getCommand() + " failed with return code " + retval, task.getLocation());
- }
-
- }
-
-
- /**
- * Prepares argument list for exec command. Will return null
- * if command line would exceed allowable command line buffer.
- *
- * @param outputFile linker output file
- * @param sourceFiles linker input files (.obj, .o, .res)
- * @param args linker arguments
- * @return arguments for runTask
- */
- protected String[] prepareArguments(
- CCTask task,
- String outputDir,
- String outputFile,
- String[] sourceFiles,
- CommandLineLinkerConfiguration config) {
-
- String[] preargs = config.getPreArguments();
- String[] endargs = config.getEndArguments();
- String outputSwitch[] = getOutputFileSwitch(task, outputFile);
- int allArgsCount = preargs.length + 1 + outputSwitch.length +
- sourceFiles.length + endargs.length;
- if (isLibtool) {
- allArgsCount++;
- }
- String[] allArgs = new String[allArgsCount];
- int index = 0;
- if (isLibtool) {
- allArgs[index++] = "libtool";
- }
- allArgs[index++] = this.getCommand();
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < preargs.length; i++) {
- allArgs[index++] = decorateLinkerOption(buf, preargs[i]);
- }
- for (int i = 0; i < outputSwitch.length; i++) {
- allArgs[index++] = outputSwitch[i];
- }
- for (int i = 0; i < sourceFiles.length; i++) {
- allArgs[index++] = prepareFilename(buf,outputDir,sourceFiles[i]);
- }
- for (int i = 0; i < endargs.length; i++) {
- allArgs[index++] = decorateLinkerOption(buf, endargs[i]);
- }
- return allArgs;
- }
-
- /**
- * Processes filename into argument form
- *
- */
- protected String prepareFilename(StringBuffer buf,
- String outputDir, String sourceFile) {
- String relativePath = CUtil.getRelativePath(outputDir,
- new File(sourceFile));
- return quoteFilename(buf,relativePath);
- }
-
- /**
- * Prepares argument list to execute the linker using a
- * response file.
- *
- * @param outputFile linker output file
- * @param args output of prepareArguments
- * @return arguments for runTask
- */
- protected String[] prepareResponseFile(File outputFile,String[] args) throws IOException
- {
- String baseName = outputFile.getName();
- File commandFile = new File(outputFile.getParent(),baseName + ".rsp");
- FileWriter writer = new FileWriter(commandFile);
- int execArgCount = 1;
- if (isLibtool) {
- execArgCount++;
- }
- String[] execArgs = new String[execArgCount+1];
- for (int i = 0; i < execArgCount; i++) {
- execArgs[i] = args[i];
- }
- execArgs[execArgCount] = getCommandFileSwitch(commandFile.toString());
- for(int i = execArgCount; i < args.length; i++) {
- //
- // if embedded space and not quoted then
- // quote argument
- if (args[i].indexOf(" ") >= 0 && args[i].charAt(0) != '\"') {
- writer.write('\"');
- writer.write(args[i]);
- writer.write("\"\n");
- } else {
- writer.write(args[i]);
- writer.write('\n');
- }
- }
- writer.close();
- return execArgs;
- }
-
-
- protected String quoteFilename(StringBuffer buf,String filename) {
- if(filename.indexOf(' ') >= 0) {
- buf.setLength(0);
- buf.append('\"');
- buf.append(filename);
- buf.append('\"');
- return buf.toString();
- }
- return filename;
- }
-
- /**
- * This method is exposed so test classes can overload
- * and test the arguments without actually spawning the
- * compiler
- */
- protected int runCommand(CCTask task, File workingDir,String[] cmdline)
- throws BuildException {
- return CUtil.runCommand(task,workingDir,cmdline, newEnvironment, env);
- }
-
- protected final void setCommand(String command) {
- this.command = command;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
deleted file mode 100644
index b3a7290b00..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CommandLineLinkerConfiguration.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-import net.sf.antcontrib.cpptasks.TargetInfo;
-
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for a command line linker
- *
- * @author Curt Arnold
- */
-public final class CommandLineLinkerConfiguration
- implements
- LinkerConfiguration {
- private/* final */String[][] args;
- private/* final */String identifier;
- private String[] libraryNames;
- private/* final */CommandLineLinker linker;
- private/* final */boolean map;
- private/* final */ProcessorParam[] params;
- private/* final */boolean rebuild;
- private String startupObject;
- public CommandLineLinkerConfiguration(CommandLineLinker linker,
- String identifier, String[][] args, ProcessorParam[] params,
- boolean rebuild, boolean map, String[] libraryNames,
- String startupObject) {
- if (linker == null) {
- throw new NullPointerException("linker");
- }
- if (args == null) {
- throw new NullPointerException("args");
- } else {
- this.args = (String[][]) args.clone();
- }
- this.linker = linker;
- this.params = (ProcessorParam[]) params.clone();
- this.rebuild = rebuild;
- this.identifier = identifier;
- this.map = map;
- if (libraryNames == null) {
- this.libraryNames = new String[0];
- } else {
- this.libraryNames = (String[]) libraryNames.clone();
- }
- this.startupObject = startupObject;
- }
- public int bid(String filename) {
- return linker.bid(filename);
- }
- public String[] getEndArguments() {
- String[] clone = (String[]) args[1].clone();
- return clone;
- }
- /**
- * Returns a string representation of this configuration. Should be
- * canonical so that equivalent configurations will have equivalent string
- * representations
- */
- public String getIdentifier() {
- return identifier;
- }
- public String[] getLibraryNames() {
- String[] clone = (String[]) libraryNames.clone();
- return clone;
- }
- public boolean getMap() {
- return map;
- }
- public String getOutputFileName(String inputFile) {
- return linker.getOutputFileName(inputFile);
- }
- public LinkerParam getParam(String name) {
- for (int i = 0; i < params.length; i++) {
- if (name.equals(params[i].getName()))
- return (LinkerParam) params[i];
- }
- return null;
- }
- public ProcessorParam[] getParams() {
- return params;
- }
- public String[] getPreArguments() {
- String[] clone = (String[]) args[0].clone();
- return clone;
- }
- public boolean getRebuild() {
- return rebuild;
- }
- public String getStartupObject() {
- return startupObject;
- }
- public void link(CCTask task, TargetInfo linkTarget) throws BuildException {
- //
- // AllSourcePath's include any syslibsets
- //
- String[] sourcePaths = linkTarget.getAllSourcePaths();
- linker.link(task, linkTarget.getOutput(), sourcePaths, this);
- }
- public String toString() {
- return identifier;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Compiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Compiler.java
deleted file mode 100644
index bbb6c99c5d..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Compiler.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-/**
- * A compiler.
- *
- * @author Adam Murdoch
- */
-public interface Compiler extends Processor {
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CompilerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CompilerConfiguration.java
deleted file mode 100644
index 72abb8b5f4..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/CompilerConfiguration.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CompilerParam;
-import net.sf.antcontrib.cpptasks.DependencyInfo;
-
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for a compiler
- *
- * @author Curt Arnold
- */
-public interface CompilerConfiguration extends ProcessorConfiguration {
- void compile(CCTask task, File outputDir, String[] sourceFiles,
- boolean relentless, ProgressMonitor monitor) throws BuildException;
- /**
- *
- * This method may be used to get two distinct compiler configurations, one
- * for compiling the specified file and producing a precompiled header
- * file, and a second for compiling other files using the precompiled
- * header file.
- *
- * The last (preferrably only) include directive in the prototype file will
- * be used to mark the boundary between pre-compiled and normally compiled
- * headers.
- *
- * @param prototype
- * A source file (for example, stdafx.cpp) that is used to build
- * the precompiled header file. @returns null if precompiled
- * headers are not supported or a two element array containing
- * the precompiled header generation configuration and the
- * consuming configuration
- *
- */
- CompilerConfiguration[] createPrecompileConfigurations(File prototype,
- String[] nonPrecompiledFiles);
- /**
- * Returns an digest for the include path for the configuration.
- *
- * This is used to determine if cached dependency information is invalid
- * because the include paths have changed
- */
- String getIncludePathIdentifier();
- public CompilerParam getParam(String name);
- boolean isPrecompileGeneration();
- DependencyInfo parseIncludes(CCTask task, File baseDir, File source);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkType.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkType.java
deleted file mode 100644
index 7d6041ff93..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkType.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import net.sf.antcontrib.cpptasks.OutputTypeEnum;
-import net.sf.antcontrib.cpptasks.SubsystemEnum;
-/**
- * This class represents the target platform for the compile and link step. The
- * name is an anachronism and should be changed.
- *
- * @author Curt Arnold
- */
-public class LinkType {
- private OutputTypeEnum outputType = new OutputTypeEnum();
- private boolean staticRuntime = false;
- private SubsystemEnum subsystem = new SubsystemEnum();
- /**
- * Constructor
- *
- * By default, an gui executable with a dynamically linked runtime
- *
- */
- public LinkType() {
- }
- /**
- * Gets whether the link should produce an executable
- *
- * @return boolean
- */
- public boolean isExecutable() {
- String value = outputType.getValue();
- return value.equals("executable");
- }
- /**
- * Gets whether the link should produce a plugin module.
- *
- * @return boolean
- */
- public boolean isPluginModule() {
- String value = outputType.getValue();
- return value.equals("plugin");
- }
- /**
- * Gets whether the link should produce a shared library.
- *
- * @return boolean
- */
- public boolean isSharedLibrary() {
- String value = outputType.getValue();
- return value.equals("shared") || value.equals("plugin");
- }
- /**
- * Gets whether the link should produce a static library.
- *
- * @return boolean
- */
- public boolean isStaticLibrary() {
- String value = outputType.getValue();
- return value.equals("static");
- }
- /**
- * Gets whether the module should use a statically linked runtime library.
- *
- * @return boolean
- */
- public boolean isStaticRuntime() {
- return staticRuntime;
- }
- /**
- * Gets whether the link should produce a module for a console subsystem.
- *
- * @return boolean
- */
- public boolean isSubsystemConsole() {
- String value = subsystem.getValue();
- return value.equals("console");
- }
- /**
- * Gets whether the link should produce a module for a graphical user
- * interface subsystem.
- *
- * @return boolean
- */
- public boolean isSubsystemGUI() {
- String value = subsystem.getValue();
- return value.equals("gui");
- }
- /**
- * Sets the output type (execuable, shared, etc).
- *
- * @param outputType,
- * may not be null
- */
- public void setOutputType(OutputTypeEnum outputType) {
- if (outputType == null) {
- throw new IllegalArgumentException("outputType");
- }
- this.outputType = outputType;
- }
- /**
- * Requests use of a static runtime library.
- *
- * @param staticRuntime
- * if true, use static runtime library if possible.
- */
- public void setStaticRuntime(boolean staticRuntime) {
- this.staticRuntime = staticRuntime;
- }
- /**
- * Sets the subsystem (gui, console, etc).
- *
- * @param subsystem
- * subsystem, may not be null
- */
- public void setSubsystem(SubsystemEnum subsystem) {
- if (subsystem == null) {
- throw new IllegalArgumentException("subsystem");
- }
- this.subsystem = subsystem;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Linker.java
deleted file mode 100644
index 776a808ac7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Linker.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-/**
- * A linker for executables, and static and dynamic libraries.
- *
- * @author Adam Murdoch
- */
-public interface Linker extends Processor {
- /**
- * Extracts the significant part of a library name to ensure there aren't
- * collisions
- */
- String getLibraryKey(File libname);
- /**
- * returns the library path for the linker
- */
- File[] getLibraryPath();
- /**
- * Returns a set of filename patterns corresponding to library names.
- *
- * For example, "advapi32" would be expanded to "advapi32.dll" by
- * DevStudioLinker and to "libadvapi32.a" and "libadvapi32.so" by
- * GccLinker.
- *
- * @param libnames
- * array of library names
- */
- String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libraryType);
- /**
- * Gets the linker for the specified link type.
- *
- * @return appropriate linker or null, will return this if this linker can
- * handle the specified link type
- */
- Linker getLinker(LinkType linkType);
- /**
- * Returns true if the linker is case-sensitive
- */
- boolean isCaseSensitive();
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java
deleted file mode 100644
index c2d62c4137..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/LinkerConfiguration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.TargetInfo;
-
-import org.apache.tools.ant.BuildException;
-/**
- * A configuration for a linker
- *
- * @author Curt Arnold
- */
-public interface LinkerConfiguration extends ProcessorConfiguration {
- public LinkerParam getParam(String name);
- void link(CCTask task, TargetInfo linkTarget) throws BuildException;
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCCompiler.java
deleted file mode 100644
index eb64119299..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCCompiler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * A command line C compiler that can utilize precompilation of header files
- *
- * @author Curt Arnold
- */
-public abstract class PrecompilingCommandLineCCompiler
- extends
- PrecompilingCommandLineCompiler {
- protected PrecompilingCommandLineCCompiler(String command,
- String identifierArg, String[] sourceExtensions,
- String[] headerExtensions, String outputSuffix, boolean libtool,
- PrecompilingCommandLineCCompiler libtoolCompiler,
- boolean newEnvironment, Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- outputSuffix, libtool, libtoolCompiler, newEnvironment, env);
- }
- protected Parser createParser(File source) {
- return new CParser();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCompiler.java
deleted file mode 100644
index 6e3c145675..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCommandLineCompiler.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.Reader;
-
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-/**
- * A command line C compiler that can utilize precompilation of header files
- *
- * @author Curt Arnold
- */
-public abstract class PrecompilingCommandLineCompiler
- extends
- CommandLineCompiler implements PrecompilingCompiler {
- protected PrecompilingCommandLineCompiler(String command,
- String identifierArg, String[] sourceExtensions,
- String[] headerExtensions, String outputSuffix, boolean libtool,
- PrecompilingCommandLineCompiler libtoolCompiler,
- boolean newEnvironment, Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- outputSuffix, libtool, libtoolCompiler, newEnvironment, env);
- }
- /**
- *
- * This method may be used to get two distinct compiler configurations, one
- * for compiling the specified file and producing a precompiled header
- * file, and a second for compiling other files using the precompiled
- * header file.
- *
- * The last (preferrably only) include directive in the prototype file will
- * be used to mark the boundary between pre-compiled and normally compiled
- * headers.
- *
- * @param config
- * base configuration
- * @param prototype
- * A source file (for example, stdafx.cpp) that is used to build
- * the precompiled header file. @returns null if precompiled
- * headers are not supported or a two element array containing
- * the precompiled header generation configuration and the
- * consuming configuration
- *
- */
- public CompilerConfiguration[] createPrecompileConfigurations(
- CompilerConfiguration config, File prototype, String[] exceptFiles) {
- //
- // cast should success or someone is passing us a configuration
- // that was prepared by another processor
- //
- CommandLineCompilerConfiguration cmdLineConfig = (CommandLineCompilerConfiguration) config;
- //
- // parse prototype file to determine last header
- //
- Parser parser = createParser(prototype);
- String[] includes;
- try {
- Reader reader = new BufferedReader(new FileReader(prototype));
- parser.parse(reader);
- includes = parser.getIncludes();
- } catch (IOException ex) {
- throw new BuildException(
- "Error parsing precompiled header protoype: "
- + prototype.toString() + ":" + ex.toString());
- }
- if (includes.length == 0) {
- throw new BuildException("Precompiled header prototype: "
- + prototype.toString()
- + " does not contain any include directives.");
- }
- CompilerConfiguration[] configs = new CompilerConfiguration[2];
- configs[0] = createPrecompileGeneratingConfig(cmdLineConfig, prototype,
- includes[0]);
- configs[1] = createPrecompileUsingConfig(cmdLineConfig, prototype,
- includes[0], exceptFiles);
- return configs;
- }
- abstract protected CompilerConfiguration createPrecompileGeneratingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude);
- abstract protected CompilerConfiguration createPrecompileUsingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude, String[] exceptFiles);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCompiler.java
deleted file mode 100644
index e60b1da8e6..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/PrecompilingCompiler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import java.io.File;
-/**
- * A compiler that can utilize precompilation of header files
- *
- * @author Curt Arnold
- */
-public interface PrecompilingCompiler {
- /**
- *
- * This method may be used to get two distinct compiler configurations, one
- * for compiling the specified file and producing a precompiled header
- * file, and a second for compiling other files using the precompiled
- * header file.
- *
- * The last (preferrably only) include directive in the prototype file will
- * be used to mark the boundary between pre-compiled and normally compiled
- * headers.
- *
- * @param config
- * base configuration
- * @param prototype
- * A source file (for example, stdafx.cpp) that is used to build
- * the precompiled header file. @returns null if precompiled
- * headers are not supported or a two element array containing
- * the precompiled header generation configuration and the
- * consuming configuration
- *
- */
- CompilerConfiguration[] createPrecompileConfigurations(
- CompilerConfiguration config, File prototype,
- String[] nonPrecompiledFiles);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Processor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Processor.java
deleted file mode 100644
index 6fb74e9ea3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/Processor.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.TargetDef;
-import org.apache.tools.ant.types.Environment;
-/**
- * A processor. Base interface for Compiler and Linker
- *
- * @author Curt Arnold
- */
-public interface Processor {
- /**
- * Returns a bid indicating the desire of this compiler to process the
- * file.
- *
- * @param inputFile
- * input file
- * @return 0 = no interest, 100 = high interest
- */
- int bid(String inputFile);
- Processor changeEnvironment(boolean newEnvironment, Environment env);
- /**
- * Returns the compiler configuration for <cc>or <compiler>element.
- *
- * @param defaultProviders
- * When specificConfig corresponds to a <compiler>or linker
- * element, defaultProvider will be a zero to two element array.
- * If there is an extends attribute, the first element will be
- * the referenced ProcessorDef, unless inherit = false, the last
- * element will be the containing <cc>element
- * @param specificConfig
- * A <cc>or <compiler>element.
- * @return resulting configuration
- */
- ProcessorConfiguration createConfiguration(CCTask task, LinkType linkType,
- ProcessorDef[] defaultProviders, ProcessorDef specificConfig,
- TargetDef targetPlatform);
- /**
- * Retrieve an identifier that identifies the specific version of the
- * compiler. Compilers with the same identifier should produce the same
- * output files for the same input files and command line switches.
- */
- String getIdentifier();
- /**
- * Gets the linker that is associated with this processors
- */
- Linker getLinker(LinkType type);
- /**
- * Output file name (no path components) corresponding to source file
- *
- * @param inputFile
- * input file
- * @return output file name or null if no output file or name not
- * determined by input file
- */
- String getOutputFileName(String inputFile);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProcessorConfiguration.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProcessorConfiguration.java
deleted file mode 100644
index dd75483d6d..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProcessorConfiguration.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-import net.sf.antcontrib.cpptasks.ProcessorParam;
-/**
- * A configuration for a C++ compiler, linker or other processor
- *
- * @author Curt Arnold
- */
-public interface ProcessorConfiguration {
- /**
- * An indication of how much this compiler would like to process this file
- *
- * @return 0 is no interest to process, 100 is strong interest to process
- */
- int bid(String filename);
- /**
- * Returns a string representation of this configuration. Should be
- * canonical so that equivalent configurations will have equivalent string
- * representations
- */
- String getIdentifier();
- /**
- * Output file name (no path components) corresponding to source file
- *
- * @param inputFile
- * input file
- * @return output file name or null if no output file or name not
- * determined by input file
- */
- String getOutputFileName(String inputFile);
- ProcessorParam[] getParams();
- /**
- * If true, all files using this configuration should be rebuilt and any
- * existing output files should be ignored
- */
- boolean getRebuild();
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProgressMonitor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProgressMonitor.java
deleted file mode 100644
index 2206ed874e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/compiler/ProgressMonitor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.compiler;
-/**
- * Interface to receive notification of compile progress
- *
- * @author Curt Arnold
- */
-public interface ProgressMonitor {
- public void finish(ProcessorConfiguration config, boolean normal);
- /**
- * Called to notify monitor of progress
- *
- */
- void progress(String[] sources);
- public void start(ProcessorConfiguration config);
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAslcompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAslcompiler.java
deleted file mode 100644
index f0be5945a3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAslcompiler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineAslcompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-/**
- * Adaptor for Microsoft ASL compiler.
- *
- */
-public final class DevStudioAslcompiler extends CommandLineAslcompiler {
- private final static String[] sourceExtensions = new String[] { ".asl" };
-
- private final static String[] headerExtensions = new String[] {};
-
- private final static String[] defaultflags = new String[] {};
-
- private static final DevStudioAslcompiler instance = new DevStudioAslcompiler(
- "asl", sourceExtensions, headerExtensions, false);
-
- /**
- * Gets asl adapter
- */
- public static DevStudioAslcompiler getInstance() {
- return instance;
- }
-
- /**
- * Private constructor. Use DevStudioAslcompiler.getInstance() to get
- * singleton instance of this class.
- */
- private DevStudioAslcompiler (String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool) {
- super(command, null, sourceExtensions, headerExtensions, ".aml");
- }
-
- public void addImpliedArgs(Vector args, boolean debug, Boolean defaultflag) {
- if (defaultflag != null && defaultflag.booleanValue()) {
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- }
-
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-
- public Linker getLinker(LinkType linkType) {
- return DevStudioLinker.getInstance().getLinker(linkType);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAssembler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAssembler.java
deleted file mode 100644
index 23d319ecd9..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioAssembler.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineAssembler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-/**
- * Adaptor for Microsoft MASM
- *
- */
-public final class DevStudioAssembler extends CommandLineAssembler {
- private final static String[] sourceExtensions = new String[] { ".asm" };
-
- private final static String[] headerExtensions = new String[] { ".h",
- ".inc" };
-
- private final static String[] defaultflags = new String[] { "/nologo", "/c" };
-
- private static final DevStudioAssembler instance = new DevStudioAssembler(
- "ml", sourceExtensions, headerExtensions, false);
-
- /**
- * Gets masm adapter
- */
- public static DevStudioAssembler getInstance() {
- return instance;
- }
-
- /**
- * Private constructor. Use DevStudioAssembler.getInstance() to get
- * singleton instance of this class.
- */
- private DevStudioAssembler (String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool) {
- super(command, null, sourceExtensions, headerExtensions, ".obj");
- }
-
- public void addImpliedArgs(Vector args, boolean debug, Boolean defaultflag) {
- if (defaultflag != null && defaultflag.booleanValue()) {
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- if (debug) {
- args.addElement("Zi");
- }
- }
-
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-
- public Linker getLinker(LinkType linkType) {
- return DevStudioLinker.getInstance().getLinker(linkType);
- }
-
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ";");
- }
-
- protected String getIncludeDirSwitch(String includeDir) {
- return "/I" + includeDir.replace('/', '\\');
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCCompiler.java
deleted file mode 100644
index 3bb5181250..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCCompiler.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Microsoft(r) C/C++ Optimizing Compiler
- *
- * @author Adam Murdoch
- */
-public final class DevStudioCCompiler extends DevStudioCompatibleCCompiler {
- private static final DevStudioCCompiler instance = new DevStudioCCompiler(
- "cl", false, null);
- public static DevStudioCCompiler getInstance() {
- return instance;
- }
- private DevStudioCCompiler(String command, boolean newEnvironment,
- Environment env) {
- super(command, "/bogus", newEnvironment, env);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new DevStudioCCompiler(getCommand(), newEnvironment, env);
- }
- return this;
- }
- public Linker getLinker(LinkType type) {
- return DevStudioLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 4096;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java
deleted file mode 100644
index 5e29a323c7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleCCompiler.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.CompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.PrecompilingCommandLineCCompiler;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * An abstract base class for compilers that are basically command line
- * compatible with Microsoft(r) C/C++ Optimizing Compiler
- *
- * @author Curt Arnold
- */
-public abstract class DevStudioCompatibleCCompiler
- extends
- PrecompilingCommandLineCCompiler {
- private static String[] mflags = new String[]{
- //
- // first four are single-threaded
- // (runtime=static,debug=false), (..,debug=true),
- // (runtime=dynamic,debug=true), (..,debug=false), (not supported)
- // next four are multi-threaded, same sequence
- "/ML", "/MLd", null, null, "/MT", "/MTd", "/MD", "/MDd"};
- private static String[] defaultflags = new String[]{"/nologo", "/c"};
- protected DevStudioCompatibleCCompiler(String command,
- String identifierArg, boolean newEnvironment, Environment env) {
- super(command, identifierArg, new String[]{".c", ".cc", ".cpp", ".cxx",
- ".c++"}, new String[]{".h", ".hpp", ".inl"}, ".obj", false,
- null, newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- if (defaultflag != null && defaultflag.booleanValue()) {
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- if (exceptions) {
- args.addElement("/GX");
- }
- int mindex = 0;
- if (multithreaded) {
- mindex += 4;
- }
- boolean staticRuntime = linkType.isStaticRuntime();
- if (!staticRuntime) {
- mindex += 2;
- }
- if (debug) {
- mindex += 1;
- args.addElement("/Zi");
- args.addElement("/Od");
- args.addElement("/GZ");
- args.addElement("/D_DEBUG");
- } else {
- if (optimization != null) {
- if (optimization.isSize()) {
- args.addElement("/O1");
- }
- if (optimization.isSpeed()) {
- args.addElement("/O2");
- }
- }
- args.addElement("/DNDEBUG");
- }
- String mflag = mflags[mindex];
- if (mflag == null) {
- throw new BuildException(
- "multithread='false' and runtime='dynamic' not supported");
- }
- args.addElement(mflag);
- if (rtti != null && rtti.booleanValue()) {
- args.addElement("/GR");
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- DevStudioProcessor.addWarningSwitch(args, level);
- }
- protected CompilerConfiguration createPrecompileGeneratingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude) {
- String[] additionalArgs = new String[]{
- "/Fp" + CUtil.getBasename(prototype) + ".pch", "/Yc"};
- return new CommandLineCompilerConfiguration(baseConfig, additionalArgs,
- null, true);
- }
- protected CompilerConfiguration createPrecompileUsingConfig(
- CommandLineCompilerConfiguration baseConfig, File prototype,
- String lastInclude, String[] exceptFiles) {
- String[] additionalArgs = new String[]{
- "/Fp" + CUtil.getBasename(prototype) + ".pch",
- "/Yu" + lastInclude};
- return new CommandLineCompilerConfiguration(baseConfig, additionalArgs,
- exceptFiles, false);
- }
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- DevStudioProcessor.getDefineSwitch(buffer, define, value);
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ";");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return DevStudioProcessor.getIncludeDirSwitch(includeDir);
- }
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- DevStudioProcessor.getUndefineSwitch(buffer, define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLibrarian.java
deleted file mode 100644
index 40bef6e239..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLibrarian.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-/**
- * Abstract base adapter for librarians with command line options compatible
- * with the Microsoft(r) Library Manager
- *
- * @author Curt Arnold
- */
-public abstract class DevStudioCompatibleLibrarian extends CommandLineLinker {
- private static String[] defaultflags = new String[]{"/nologo"};
- public DevStudioCompatibleLibrarian(String command, String identifierArg) {
- super(command, identifierArg, new String[]{".obj"}, new String[0],
- ".lib", false, null);
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType,
- Vector args, Boolean defaultflag) {
- if(defaultflag != null && defaultflag.booleanValue()){
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- protected String getCommandFileSwitch(String cmdFile) {
- return "@" + cmdFile;
- }
- public File[] getLibraryPath() {
- return new File[0];
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return new String[0];
- }
- public int getMaximumCommandLength() {
- return 4096;
- }
- public String[] getOutputFileSwitch(String outFile) {
- StringBuffer buf = new StringBuffer("/OUT:");
- if (outFile.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(outFile);
- buf.append('"');
- } else {
- buf.append(outFile);
- }
- return new String[]{buf.toString()};
- }
- public boolean isCaseSensitive() {
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLinker.java
deleted file mode 100644
index 9e156b0426..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioCompatibleLinker.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-/**
- * Abstract base class for linkers that try to mimic the command line arguments
- * for the Microsoft (r) Incremental Linker
- *
- * @author Curt Arnold
- */
-public abstract class DevStudioCompatibleLinker extends CommandLineLinker {
- private static String[] defaultflags = new String[]{"/NOLOGO"};
- public DevStudioCompatibleLinker(String command, String identifierArg,
- String outputSuffix) {
- super(command, identifierArg, new String[]{".obj", ".lib", ".res"},
- new String[]{".map", ".pdb", ".lnk", ".dll"}, outputSuffix,
- false, null);
- }
- protected void addBase(long base, Vector args) {
- if (base >= 0) {
- String baseAddr = Long.toHexString(base);
- args.addElement("/BASE:0x" + baseAddr);
- }
- }
- protected void addFixed(Boolean fixed, Vector args) {
- if (fixed != null) {
- if (fixed.booleanValue()) {
- args.addElement("/FIXED");
- } else {
- args.addElement("/FIXED:NO");
- }
- }
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType,
- Vector args, Boolean defaultflag) {
- if(defaultflag != null && defaultflag.booleanValue()){
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- if (debug) {
- args.addElement("/DEBUG");
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("/DLL");
- }
- /*
- * if(linkType.isSubsystemGUI()) {
- * args.addElement("/SUBSYSTEM:WINDOWS"); } else {
- * if(linkType.isSubsystemConsole()) {
- * args.addElement("/SUBSYSTEM:CONSOLE"); } }
- */
- }
- protected void addIncremental(boolean incremental, Vector args) {
- if (incremental) {
- args.addElement("/INCREMENTAL:YES");
- } else {
- args.addElement("/INCREMENTAL:NO");
- }
- }
- protected void addMap(boolean map, Vector args) {
- if (map) {
- args.addElement("/MAP");
- }
- }
- protected void addStack(int stack, Vector args) {
- if (stack >= 0) {
- String stackStr = Integer.toHexString(stack);
- args.addElement("/STACK:0x" + stackStr);
- }
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- if (entry != null) {
- args.addElement("/ENTRY:" + entry);
- }
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("LIB", ";");
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length];
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(libnames[i]);
- buf.append(".lib");
- patterns[i] = buf.toString();
- }
- return patterns;
- }
- public int getMaximumCommandLength() {
- return 4096;
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"/OUT:" + outputFile};
- }
- public boolean isCaseSensitive() {
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLibrarian.java
deleted file mode 100644
index 06eac71e19..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLibrarian.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-/**
- * Adapter for the Microsoft (r) Library Manager
- *
- * @author Curt Arnold
- */
-public final class DevStudioLibrarian extends DevStudioCompatibleLibrarian {
- private static final DevStudioLibrarian instance = new DevStudioLibrarian();
- public static DevStudioLibrarian getInstance() {
- return instance;
- }
- private DevStudioLibrarian() {
- super("lib", "/bogus");
- }
- public Linker getLinker(LinkType type) {
- return DevStudioLinker.getInstance().getLinker(type);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLinker.java
deleted file mode 100644
index 7ae0178a8b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioLinker.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-/**
- * Adapter for the Microsoft (r) Incremental Linker
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public final class DevStudioLinker extends DevStudioCompatibleLinker {
- private static final DevStudioLinker dllLinker = new DevStudioLinker(".dll");
- private static final DevStudioLinker instance = new DevStudioLinker(".exe");
- public static DevStudioLinker getInstance() {
- return instance;
- }
- private DevStudioLinker(String outputSuffix) {
- super("link", "/DLL", outputSuffix);
- }
- public Linker getLinker(LinkType type) {
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- if (type.isStaticLibrary()) {
- return DevStudioLibrarian.getInstance();
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioMIDLCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioMIDLCompiler.java
deleted file mode 100644
index 7df898b92f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioMIDLCompiler.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * Adapter for the Microsoft (r) MIDL Compiler
- *
- * @author Curt Arnold
- */
-public final class DevStudioMIDLCompiler extends CommandLineCompiler {
- private static final DevStudioMIDLCompiler instance = new DevStudioMIDLCompiler(
- false, null);
- public static DevStudioMIDLCompiler getInstance() {
- return instance;
- }
- private DevStudioMIDLCompiler(boolean newEnvironment, Environment env) {
- super("midl", null, new String[]{".idl", ".odl"}, new String[]{},
- ".tlb", false, null, newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- }
- protected void addWarningSwitch(Vector args, int level) {
- DevStudioProcessor.addWarningSwitch(args, level);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new DevStudioMIDLCompiler(newEnvironment, env);
- }
- return this;
- }
- /**
- * The include parser for C will work just fine, but we didn't want to
- * inherit from CommandLineCCompiler
- */
- protected Parser createParser(File source) {
- return new CParser();
- }
- protected int getArgumentCountPerInputFile() {
- return 3;
- }
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- DevStudioProcessor.getDefineSwitch(buffer, define, value);
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ";");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return DevStudioProcessor.getIncludeDirSwitch(includeDir);
- }
- protected String getInputFileArgument(File outputDir, String filename,
- int index) {
- switch (index) {
- case 0 :
- return "/tlb";
- case 1 :
- return new File(outputDir, getOutputFileName(filename))
- .getAbsolutePath();
- }
- return filename;
- }
- public Linker getLinker(LinkType type) {
- return DevStudioLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- protected int getMaximumInputFilesPerCommand() {
- return 1;
- }
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- String arg1 = getInputFileArgument(outputDir, inputFile, 0);
- String arg2 = getInputFileArgument(outputDir, inputFile, 1);
- String arg3 = getInputFileArgument(outputDir, inputFile, 2);
- return arg1.length() + arg2.length() + arg3.length() + 3;
- }
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- DevStudioProcessor.getUndefineSwitch(buffer, define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java
deleted file mode 100644
index 6b2af7ed54..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioProcessor.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.util.Vector;
-/**
- * A add-in class for Microsoft Developer Studio processors
- *
- *
- */
-public class DevStudioProcessor {
- public static void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("/W0");
- break;
- case 1 :
- args.addElement("/W1");
- break;
- case 2 :
- break;
- case 3 :
- args.addElement("/W3");
- break;
- case 4 :
- args.addElement("/W4");
- break;
- case 5 :
- args.addElement("/WX");
- break;
- }
- }
- public static String getCommandFileSwitch(String cmdFile) {
- StringBuffer buf = new StringBuffer("@");
- if (cmdFile.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(cmdFile.replace('/', '\\'));
- buf.append('\"');
- } else {
- buf.append(cmdFile);
- }
- return buf.toString();
- }
- public static void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("/D");
- buffer.append(define);
- if (value != null && value.length() > 0) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- public static String getIncludeDirSwitch(String includeDir) {
- return "/I" + includeDir.replace('/', '\\');
- }
- public static String[] getOutputFileSwitch(String outPath) {
- StringBuffer buf = new StringBuffer("/Fo");
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- String[] retval = new String[]{buf.toString()};
- return retval;
- }
- public static void getUndefineSwitch(StringBuffer buffer, String define) {
- buffer.append("/U");
- buffer.append(define);
- }
- public static boolean isCaseSensitive() {
- return false;
- }
- private DevStudioProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java
deleted file mode 100644
index d6e2fd4442..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/devstudio/DevStudioResourceCompiler.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.devstudio;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Microsoft (r) Windows 32 Resource Compiler
- *
- * @author Curt Arnold
- */
-public final class DevStudioResourceCompiler extends CommandLineCompiler {
- private static final DevStudioResourceCompiler instance = new DevStudioResourceCompiler(
- false, null);
- public static DevStudioResourceCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private DevStudioResourceCompiler(boolean newEnvironment, Environment env) {
- super("rc", null, new String[]{".rc"}, new String[]{".h", ".hpp",
- ".inl"}, ".res", false, null, newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- if (debug) {
- args.addElement("/D_DEBUG");
- } else {
- args.addElement("/DNDEBUG");
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new DevStudioResourceCompiler(newEnvironment, env);
- }
- return this;
- }
- /**
- * The include parser for C will work just fine, but we didn't want to
- * inherit from CommandLineCCompiler
- */
- protected Parser createParser(File source) {
- return new CParser();
- }
- protected int getArgumentCountPerInputFile() {
- return 2;
- }
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- DevStudioProcessor.getDefineSwitch(buffer, define, value);
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ";");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return DevStudioProcessor.getIncludeDirSwitch(includeDir);
- }
- protected String getInputFileArgument(File outputDir, String filename,
- int index) {
- if (index == 0) {
- String outputFileName = getOutputFileName(filename);
- String fullOutputName = new File(outputDir, outputFileName)
- .toString();
- return "/fo" + fullOutputName;
- }
- return filename;
- }
- public Linker getLinker(LinkType type) {
- return DevStudioLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
- protected int getMaximumInputFilesPerCommand() {
- return 1;
- }
- protected int getTotalArgumentLengthForInputFile(File outputDir,
- String inputFile) {
- String arg1 = getInputFileArgument(outputDir, inputFile, 0);
- String arg2 = getInputFileArgument(outputDir, inputFile, 1);
- return arg1.length() + arg2.length() + 2;
- }
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- DevStudioProcessor.getUndefineSwitch(buffer, define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java
deleted file mode 100644
index f7bb2eab95..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the "ar" tool
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public abstract class AbstractArLibrarian extends CommandLineLinker {
- private/* final */
- String outputPrefix;
- private static String[] defaultflags = new String[]{};
- protected AbstractArLibrarian(String command, String identificationArg,
- String[] inputExtensions, String[] ignoredExtensions,
- String outputPrefix, String outputExtension, boolean isLibtool,
- AbstractArLibrarian libtoolLibrarian) {
- super(command, identificationArg, inputExtensions, ignoredExtensions,
- outputExtension, isLibtool, libtoolLibrarian);
- this.outputPrefix = outputPrefix;
- }
- public void addBase(long base, Vector args) {
- }
- public void addFixed(Boolean fixed, Vector args) {
- }
- public void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if(defaultflag != null && defaultflag.booleanValue()){
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- }
- public void addIncremental(boolean incremental, Vector args) {
- }
- public void addMap(boolean map, Vector args) {
- }
- public void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return null;
- }
- public File[] getLibraryPath() {
- return new File[0];
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return new String[0];
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- public String getOutputFileName(String baseName) {
- return outputPrefix + super.getOutputFileName(baseName);
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return GccProcessor.getOutputFileSwitch("rvs", outputFile);
- }
- public boolean isCaseSensitive() {
- return true;
- }
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- //
- // if there is an existing library then
- // we must delete it before executing "ar"
- if (outputFile.exists()) {
- if (!outputFile.delete()) {
- throw new BuildException("Unable to delete "
- + outputFile.getAbsolutePath());
- }
- }
- //
- // delegate to CommandLineLinker
- //
- super.link(task, outputFile, sourceFiles, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
deleted file mode 100644
index f6e376643f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Abstract adapter for ld-like linkers
- *
- * @author Curt Arnold
- */
-public abstract class AbstractLdLinker extends CommandLineLinker {
- private String outputPrefix;
- private static String[] defaultflags = new String[]{};
- protected AbstractLdLinker(String command, String identifierArg,
- String[] extensions, String[] ignoredExtensions,
- String outputPrefix, String outputSuffix, boolean isLibtool,
- AbstractLdLinker libtoolLinker) {
- super(command, identifierArg, extensions, ignoredExtensions,
- outputSuffix, isLibtool, libtoolLinker);
- this.outputPrefix = outputPrefix;
- }
- public void addBase(long base, Vector args) {
- if (base >= 0) {
- args.addElement("--image-base");
- args.addElement(Long.toHexString(base));
- }
- }
- public void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if(defaultflag != null && defaultflag.booleanValue()){
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- if (debug) {
- args.addElement("-g");
- }
- if (isDarwin()) {
- if (linkType.isPluginModule()) {
- args.addElement("-bundle");
- } else {
- if (linkType.isSharedLibrary()) {
- args.addElement("-prebind");
- args.addElement("-dynamiclib");
- }
- }
- } else {
- if (linkType.isStaticRuntime()) {
- args.addElement("-static");
- }
- if (linkType.isPluginModule()) {
- args.addElement("-shared");
- } else {
- if (linkType.isSharedLibrary()) {
- args.addElement("-shared");
- }
- }
- }
- }
- public void addIncremental(boolean incremental, Vector args) {
- if (incremental) {
- args.addElement("-i");
- }
- }
- protected int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
- public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- Vector libnames = new Vector();
- super.addLibrarySets(task, libsets, preargs, midargs, endargs);
- LibraryTypeEnum previousLibraryType = null;
- for (int i = 0; i < libsets.length; i++) {
- LibrarySet set = libsets[i];
- File libdir = set.getDir(null);
- String[] libs = set.getLibs();
- if (libdir != null) {
- if (set.getType() != null &&
- "framework".equals(set.getType().getValue()) &&
- isDarwin()) {
- endargs.addElement("-F" + libdir.getAbsolutePath());
- } else {
- endargs.addElement("-L" + libdir.getAbsolutePath());
- }
- }
- //
- // if there has been a change of library type
- //
- if (set.getType() != previousLibraryType) {
- if (set.getType() != null && "static".equals(set.getType().getValue())) {
- endargs.addElement("-Bstatic");
- previousLibraryType = set.getType();
- } else {
- if (set.getType() == null ||
- !"framework".equals(set.getType().getValue()) ||
- !isDarwin()) {
- endargs.addElement("-Bdynamic");
- previousLibraryType = set.getType();
- }
- }
- }
- StringBuffer buf = new StringBuffer("-l");
- if (set.getType() != null &&
- "framework".equals(set.getType().getValue()) &&
- isDarwin()) {
- buf.setLength(0);
- buf.append("-framework ");
- }
- int initialLength = buf.length();
- for (int j = 0; j < libs.length; j++) {
- //
- // reset the buffer to just "-l"
- //
- buf.setLength(initialLength);
- //
- // add the library name
- buf.append(libs[j]);
- libnames.addElement(libs[j]);
- //
- // add the argument to the list
- endargs.addElement(buf.toString());
- }
- }
- String rc[] = new String[libnames.size()];
- for (int i = 0; i < libnames.size(); i++) {
- rc[i] = (String) libnames.elementAt(i);
- }
- return rc;
- }
- public void addMap(boolean map, Vector args) {
- if (map) {
- args.addElement("-M");
- }
- }
- public void addStack(int stack, Vector args) {
- if (stack > 0) {
- args.addElement("--stack");
- args.addElement(Integer.toString(stack));
- }
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- if (entry != null) {
- args.addElement("-e");
- args.addElement(entry);
- }
- }
-
- public String getCommandFileSwitch(String commandFile) {
- throw new IllegalStateException("ld does not support command files");
- }
- /**
- * Returns library path.
- *
- */
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("LIB", ":");
- }
- public String getLibraryKey(File libfile) {
- String libname = libfile.getName();
- int lastDot = libname.lastIndexOf('.');
- if (lastDot >= 0) {
- return libname.substring(0, lastDot);
- }
- return libname;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- return new File[0];
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- int patternCount = libnames.length;
- if (libType == null) {
- patternCount *= 2;
- }
- String[] patterns = new String[patternCount];
- int offset = 0;
- if (libType == null || "static".equals(libType.getValue())) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- }
- if (libType != null && "framework".equals(libType.getValue()) && isDarwin()) {
- for(int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(libnames[i]);
- buf.append(".framework/");
- buf.append(libnames[i]);
- patterns[offset++] = buf.toString();
- }
- } else {
- if (libType == null || !"static".equals(libType.getValue())) {
- if (isHPUX()) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".sl", patterns,
- offset);
- } else {
- offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns,
- offset);
- }
- }
- }
- return patterns;
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- public String getOutputFileName(String baseName) {
- return outputPrefix + super.getOutputFileName(baseName);
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return GccProcessor.getOutputFileSwitch("-o", outputFile);
- }
- public boolean isCaseSensitive() {
- return true;
- }
- protected boolean isHPUX() {
- String osname = System.getProperty("os.name").toLowerCase();
- if (osname.indexOf("hp") >= 0 && osname.indexOf("ux") >= 0) {
- return true;
- }
- return false;
- }
- /**
- * Prepares argument list for exec command. Will return null if command
- * line would exceed allowable command line buffer.
- *
- * @param outputFile
- * linker output file
- * @param sourceFiles
- * linker input files (.obj, .o, .res)
- * @param args
- * linker arguments
- * @return arguments for runTask
- */
- public String[] prepareArguments(CCTask task, String outputDir,
- String outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) {
- //
- // need to suppress sources that correspond to
- // library set entries since they are already
- // in the argument list
- String[] libnames = config.getLibraryNames();
- if (libnames == null || libnames.length == 0) {
- return super.prepareArguments(task, outputDir, outputFile,
- sourceFiles, config);
- }
- //
- //
- // null out any sources that correspond to library names
- //
- String[] localSources = (String[]) sourceFiles.clone();
- int extra = 0;
- for (int i = 0; i < libnames.length; i++) {
- String libname = libnames[i];
- for (int j = 0; j < localSources.length; j++) {
- if (localSources[j] != null
- && localSources[j].indexOf(libname) > 0
- && localSources[j].indexOf("lib") > 0) {
- String filename = new File(localSources[j]).getName();
- if (filename.startsWith("lib")
- && filename.substring(3).startsWith(libname)) {
- String extension = filename
- .substring(libname.length() + 3);
- if (extension.equals(".a") || extension.equals(".so")
- || extension.equals(".sl")) {
- localSources[j] = null;
- extra++;
- }
- }
- }
- }
- }
- if (extra == 0) {
- return super.prepareArguments(task, outputDir, outputFile,
- sourceFiles, config);
- }
- String[] finalSources = new String[localSources.length - extra];
- int index = 0;
- for (int i = 0; i < localSources.length; i++) {
- if (localSources[i] != null) {
- finalSources[index++] = localSources[i];
- }
- }
- return super.prepareArguments(task, outputDir, outputFile,
- finalSources, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccAssembler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccAssembler.java
deleted file mode 100644
index 412bffa847..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccAssembler.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineAssembler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-/**
- * Adapter for gcc assemble
- *
- */
-public final class GccAssembler extends CommandLineAssembler {
- private final static String[] sourceExtensions = new String[] { ".asm" };
-
- private final static String[] headerExtensions = new String[] { ".h",
- ".inc" };
-
- private static final GccAssembler instance = new GccAssembler("gas",
- sourceExtensions, headerExtensions, false);
-
- /**
- * Gets gcc adapter
- */
- public static GccAssembler getInstance() {
- return instance;
- }
-
- /**
- * Private constructor. Use GccAssembler.getInstance() to get singleton
- * instance of this class.
- */
- private GccAssembler (String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool) {
- super(command, null, sourceExtensions, headerExtensions,
- isLibtool ? ".fo" : ".o");
- }
-
- public void addImpliedArgs(Vector args, boolean debug, Boolean defaultflag) {
-
- }
-
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-
- public Linker getLinker(LinkType linkType) {
- return GccLinker.getInstance().getLinker(linkType);
- }
-
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ":");
- }
-
- protected String getIncludeDirSwitch(String includeDir) {
- return "-I" + includeDir;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java
deleted file mode 100644
index af3b26b134..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.FortranParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * Adapter for the GCC C/C++ compiler
- *
- * @author Adam Murdoch
- */
-public final class GccCCompiler extends GccCompatibleCCompiler {
- private final static String[] sourceExtensions = new String[]{".c", /* C */
- ".cc", /* C++ */
- ".cpp", /* C++ */
- ".cxx", /* C++ */
- ".c++", /* C++ */
- ".i", /* preprocessed C */
- ".ii", /* preprocessed C++ */
- ".f", /* FORTRAN */
- ".for", /* FORTRAN */
- ".m", /* Objective-C */
- ".mm", /* Objected-C++ */
- ".s" /* Assembly */
- };
- private final static String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- private static final GccCCompiler cppInstance = new GccCCompiler("c++",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("c++", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler g77Instance = new GccCCompiler("g77",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("g77", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler gppInstance = new GccCCompiler("g++",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("g++", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler instance = new GccCCompiler("gcc",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("gcc", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- /**
- * Gets c++ adapter
- */
- public static GccCCompiler getCppInstance() {
- return cppInstance;
- }
- /**
- * Gets g77 adapter
- */
- public static GccCCompiler getG77Instance() {
- return g77Instance;
- }
- /**
- * Gets gpp adapter
- */
- public static GccCCompiler getGppInstance() {
- return gppInstance;
- }
- /**
- * Gets gcc adapter
- */
- public static GccCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- private boolean isPICMeaningful = true;
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- private GccCCompiler(String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool,
- GccCCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(command, null, sourceExtensions, headerExtensions, isLibtool,
- libtoolCompiler, newEnvironment, env);
- isPICMeaningful = System.getProperty("os.name").indexOf("Windows") < 0;
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- super.addImpliedArgs(args, debug, multithreaded,
- exceptions, linkType, rtti, optimization, defaultflag);
- if (isPICMeaningful && linkType.isSharedLibrary()) {
- args.addElement("-fPIC");
- }
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new GccCCompiler(getCommand(), this.getSourceExtensions(),
- this.getHeaderExtensions(), this.getLibtool(),
- (GccCCompiler) this.getLibtoolCompiler(), newEnvironment,
- env);
- }
- return this;
- }
- /**
- * Create parser to determine dependencies.
- *
- * Will create appropriate parser (C++, FORTRAN) based on file extension.
- *
- */
- protected Parser createParser(File source) {
- if (source != null) {
- String sourceName = source.getName();
- int lastDot = sourceName.lastIndexOf('.');
- if (lastDot >= 0 && lastDot + 1 < sourceName.length()) {
- char afterDot = sourceName.charAt(lastDot + 1);
- if (afterDot == 'f' || afterDot == 'F') {
- return new FortranParser();
- }
- }
- }
- return new CParser();
- }
- public File[] getEnvironmentIncludePath() {
- if (includePath == null) {
- //
- // construct default include path from machine id and version id
- //
- String[] defaultInclude = new String[1];
- StringBuffer buf = new StringBuffer("/lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- buf.append("/include");
- defaultInclude[0] = buf.toString();
- //
- // read specs file and look for -istart and -idirafter
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] optionValues = GccProcessor.parseSpecs(specs, "*cpp:",
- new String[]{"-isystem ", "-idirafter "});
- //
- // if no entries were found, then use a default path
- //
- if (optionValues[0].length == 0 && optionValues[1].length == 0) {
- optionValues[0] = new String[]{"/usr/local/include",
- "/usr/include", "/usr/include/win32api"};
- }
- //
- // remove mingw entries.
- // For MinGW compiles this will mean the
- // location of the sys includes will be
- // wrong in dependencies.xml
- // but that should have no significant effect
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j].indexOf("mingw") > 0) {
- optionValues[i][j] = null;
- }
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(optionValues[0]);
- GccProcessor.convertCygwinFilenames(optionValues[1]);
- GccProcessor.convertCygwinFilenames(defaultInclude);
- }
- int count = CUtil.checkDirectoryArray(optionValues[0]);
- count += CUtil.checkDirectoryArray(optionValues[1]);
- count += CUtil.checkDirectoryArray(defaultInclude);
- includePath = new File[count];
- int index = 0;
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j] != null) {
- includePath[index++] = new File(optionValues[i][j]);
- }
- }
- }
- for (int i = 0; i < defaultInclude.length; i++) {
- if (defaultInclude[i] != null) {
- includePath[index++] = new File(defaultInclude[i]);
- }
- }
- }
- return (File[]) includePath.clone();
- }
- public String getIdentifier() throws BuildException {
- if (identifier == null) {
- StringBuffer buf;
- if (getLibtool()) {
- buf = new StringBuffer("libtool ");
- } else {
- buf = new StringBuffer(' ');
- }
- buf.append(getCommand());
- buf.append(' ');
- buf.append(GccProcessor.getVersion());
- buf.append(' ');
- buf.append(GccProcessor.getMachine());
- identifier = buf.toString();
- }
- return identifier;
- }
- public Linker getLinker(LinkType linkType) {
- return GccLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java
deleted file mode 100644
index 98f086ed61..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccCompatibleCCompiler.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * Abstract base class for compilers that attempt to be command line compatible
- * with GCC
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public abstract class GccCompatibleCCompiler extends CommandLineCCompiler {
- private final static String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- private final static String[] sourceExtensions = new String[]{".c", ".cc",
- ".cpp", ".cxx", ".c++", ".i", ".f", ".for"};
- private final static String[] defaultflags = new String[]{"-c"};
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- protected GccCompatibleCCompiler(String command, String identifierArg,
- boolean libtool, GccCompatibleCCompiler libtoolCompiler,
- boolean newEnvironment, Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- libtool ? ".fo" : ".o", libtool, libtoolCompiler,
- newEnvironment, env);
- }
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- protected GccCompatibleCCompiler(String command, String identifierArg,
- String[] sourceExtensions, String[] headerExtensions,
- boolean libtool, GccCompatibleCCompiler libtoolCompiler,
- boolean newEnvironment, Environment env) {
- super(command, identifierArg, sourceExtensions, headerExtensions,
- libtool ? ".fo" : ".o", libtool, libtoolCompiler,
- newEnvironment, env);
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- //
- // -fPIC is too much trouble
- // users have to manually add it for
- // operating systems that make sense
- //
- if (defaultflag != null && defaultflag.booleanValue()) {
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- if (debug) {
- args.addElement("-g");
- } else {
- if (optimization != null) {
- if (optimization.isSize()) {
- args.addElement("-Os");
- } else if (optimization.isSpeed()) {
- if ("full".equals(optimization.getValue())) {
- args.addElement("-O2");
- } else {
- if ("speed".equals(optimization.getValue())) {
- args.addElement("-O1");
- } else {
- args.addElement("-O3");
- }
- }
- }
- }
- }
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- if (rtti != null && !rtti.booleanValue()) {
- args.addElement("-fno-rtti");
- }
-
- }
- /**
- * Adds an include path to the command.
- */
- public void addIncludePath(String path, Vector cmd) {
- cmd.addElement("-I" + path);
- }
- public void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("-w");
- break;
- case 5 :
- args.addElement("-Werror");
- /* nobreak */
- case 4 :
- args.addElement("-W");
- /* nobreak */
- case 3 :
- args.addElement("-Wall");
- break;
- }
- }
- public void getDefineSwitch(StringBuffer buffer, String define, String value) {
- buffer.append("-D");
- buffer.append(define);
- if (value != null && value.length() > 0) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ":");
- }
- public String getIncludeDirSwitch(String includeDir) {
- return "-I" + includeDir;
- }
- public void getUndefineSwitch(StringBuffer buffer, String define) {
- buffer.append("-U");
- buffer.append(define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLibrarian.java
deleted file mode 100644
index 62500021cf..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLibrarian.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-/**
- * Adapter for the 'ar' archiver
- *
- * @author Adam Murdoch
- */
-public final class GccLibrarian extends AbstractArLibrarian {
- private static String[] objFileExtensions = new String[]{".o"};
- private static GccLibrarian instance = new GccLibrarian("ar",
- objFileExtensions, false, new GccLibrarian("ar", objFileExtensions,
- true, null));
- public static GccLibrarian getInstance() {
- return instance;
- }
- private GccLibrarian(String command, String[] inputExtensions,
- boolean isLibtool, GccLibrarian libtoolLibrarian) {
- super(command, "V", inputExtensions, new String[0], "lib", ".a",
- isLibtool, libtoolLibrarian);
- }
- public Linker getLinker(LinkType type) {
- return GccLinker.getInstance().getLinker(type);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
deleted file mode 100644
index f37f55092a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccLinker.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-/**
- * Adapter for the GCC linker
- *
- * @author Adam Murdoch
- */
-public class GccLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle",
- "-dynamiclib", "-nostartfiles", "-nostdlib", "-prebind", "-s",
- "-static", "-shared", "-symbolic", "-Xlinker",
- "--export-all-symbols", "-static-libgcc",};
- private static final GccLinker dllLinker = new GccLinker("gcc", objFiles,
- discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles,
- discardFiles, "lib", ".so", true, null));
- private static final GccLinker instance = new GccLinker("gcc", objFiles,
- discardFiles, "", "", false, null);
- private static final GccLinker machBundleLinker = new GccLinker("gcc",
- objFiles, discardFiles, "lib", ".bundle", false, null);
- private static final GccLinker machDllLinker = new GccLinker("gcc",
- objFiles, discardFiles, "lib", ".dylib", false, null);
- public static GccLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- protected GccLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GccLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- }
- /**
- * Allows drived linker to decorate linker option. Override by GccLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- case 'v' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- //
- // construct gcc lib path from machine and version
- //
- StringBuffer buf = new StringBuffer("/lib/gcc-lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- //
- // build default path from gcc and system /lib and /lib/w32api
- //
- String[] impliedLibPath = new String[]{buf.toString(),
- "/lib/w32api", "/lib"};
- //
- // read gcc specs file for other library paths
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] libpaths = GccProcessor.parseSpecs(specs, "*link:",
- new String[]{"%q"});
- String[] libpath;
- if (libpaths[0].length > 0) {
- libpath = new String[libpaths[0].length + 3];
- int i = 0;
- for (; i < libpaths[0].length; i++) {
- libpath[i] = libpaths[0][i];
- }
- libpath[i++] = buf.toString();
- libpath[i++] = "/lib/w32api";
- libpath[i++] = "/lib";
- } else {
- //
- // if a failure to find any matches then
- // use some default values for lib path entries
- libpath = new String[]{"/usr/local/lib/mingw",
- "/usr/local/lib", "/usr/lib/w32api", "/usr/lib/mingw",
- "/usr/lib", buf.toString(), "/lib/w32api", "/lib"};
- }
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i].indexOf("mingw") >= 0) {
- libpath[i] = null;
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(libpath);
- }
- //
- // check that remaining entries are actual directories
- //
- int count = CUtil.checkDirectoryArray(libpath);
- //
- // populate return array with remaining entries
- //
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (isDarwin()) {
- return machBundleLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (isDarwin()) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccProcessor.java
deleted file mode 100644
index 236969f5e7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GccProcessor.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-/**
- * A add-in class for Gcc processors
- *
- *
- */
-public class GccProcessor {
- // the results from gcc -dumpmachine
- private static String machine;
- private static String[] specs;
- // the results from gcc -dumpversion
- private static String version;
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
- /**
- * Converts absolute Cygwin file or directory names to the corresponding
- * Win32 name.
- *
- * @param names
- * array of names, some elements may be null, will be changed in
- * place.
- */
- public static void convertCygwinFilenames(String[] names) {
- if (names == null) {
- throw new NullPointerException("names");
- }
- File gccDir = CUtil.getExecutableLocation("gcc.exe");
- if (gccDir != null) {
- String prefix = gccDir.getAbsolutePath() + "/..";
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- if (name != null && name.length() > 1 && name.charAt(0) == '/') {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(name);
- names[i] = buf.toString();
- }
- }
- }
- }
- public static String[] getLibraryPatterns(String[] libnames) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length * 2];
- int offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- if (isHPUX()) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".sl", patterns,
- offset);
- } else {
- offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns,
- offset);
- }
- return patterns;
- }
- public static String getMachine() {
- if (machine == null) {
- String[] args = new String[]{"gcc", "-dumpmachine"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- machine = "nomachine";
- } else {
- machine = cmdout[0];
- }
- }
- return machine;
- }
- public static String[] getOutputFileSwitch(String letter, String outputFile) {
- StringBuffer buf = new StringBuffer();
- if (outputFile.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(outputFile.replace('\\', '/'));
- buf.append('"');
- } else {
- buf.append(outputFile.replace('\\', '/'));
- }
- String[] retval = new String[]{letter, buf.toString()};
- return retval;
- }
- /**
- * Returns the contents of the gcc specs file.
- *
- * The implementation locates gcc.exe in the executable path and then
- * builds a relative path name from the results of -dumpmachine and
- * -dumpversion. Attempts to use gcc -dumpspecs to provide this information
- * resulted in stalling on the Execute.run
- *
- * @returns contents of the specs file
- */
- public static String[] getSpecs() {
- if (specs == null) {
- File gccParent = CUtil.getExecutableLocation("gcc.exe");
- if (gccParent != null) {
- //
- // build a relative path like
- // ../lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
- //
- StringBuffer buf = new StringBuffer("../lib/gcc-lib/");
- buf.append(getMachine());
- buf.append('/');
- buf.append(getVersion());
- buf.append("/specs");
- //
- // resolve it relative to the location of gcc.exe
- //
- String relativePath = buf.toString();
- File specsFile = new File(gccParent, relativePath);
- //
- // found the specs file
- //
- try {
- //
- // read the lines in the file
- //
- BufferedReader reader = new BufferedReader(new FileReader(
- specsFile));
- Vector lines = new Vector(100);
- String line = reader.readLine();
- while (line != null) {
- lines.addElement(line);
- line = reader.readLine();
- }
- specs = new String[lines.size()];
- lines.copyInto(specs);
- } catch (IOException ex) {
- }
- }
- }
- if (specs == null) {
- specs = new String[0];
- }
- return specs;
- }
- public static String getVersion() {
- if (version == null) {
- String[] args = new String[]{"gcc", "-dumpversion"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- version = "noversion";
- } else {
- version = cmdout[0];
- }
- }
- return version;
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- /**
- * Determines if task is running with cygwin
- *
- * @return true if cygwin was detected
- */
- public static boolean isCygwin() {
- return getMachine().indexOf("cygwin") > 0;
- }
- private static boolean isHPUX() {
- String osname = System.getProperty("os.name").toLowerCase();
- if (osname.indexOf("hp") >= 0 && osname.indexOf("ux") >= 0) {
- return true;
- }
- return false;
- }
- /**
- *
- * Parses the results of the specs file for a specific processor and
- * options
- *
- * @param specsContent
- * Contents of specs file as returned from getSpecs
- * @param specSectionStart
- * start of spec section, for example "*cpp:"
- * @param options
- * command line switches such as "-istart"
- */
- public static String[][] parseSpecs(String[] specsContent,
- String specSectionStart, String[] options) {
- if (specsContent == null) {
- throw new NullPointerException("specsContent");
- }
- if (specSectionStart == null) {
- throw new NullPointerException("specSectionStart");
- }
- if (options == null) {
- throw new NullPointerException("option");
- }
- String[][] optionValues = new String[options.length][];
- StringBuffer optionValue = new StringBuffer(40);
- for (int i = 0; i < specsContent.length; i++) {
- String specLine = specsContent[i];
- //
- // if start of section then start paying attention
- //
- if (specLine.startsWith(specSectionStart)) {
- Vector[] optionVectors = new Vector[options.length];
- for (int j = 0; j < options.length; j++) {
- optionVectors[j] = new Vector(10);
- }
- //
- // go to next line and examine contents
- // and repeat until end of file
- //
- for (i++; i < specsContent.length; i++) {
- specLine = specsContent[i];
- for (int j = 0; j < options.length; j++) {
- int optionStart = specLine.indexOf(options[j]);
- while (optionStart >= 0) {
- optionValue.setLength(0);
- //
- // walk rest of line looking for first non
- // whitespace
- // and then next space
- boolean hasNonBlank = false;
- int k = optionStart + options[j].length();
- for (; k < specLine.length(); k++) {
- //
- // either a blank or a "}" (close of
- // conditional)
- // section will end the path
- //
- if (specLine.charAt(k) == ' '
- || specLine.charAt(k) == '}') {
- if (hasNonBlank) {
- break;
- }
- } else {
- hasNonBlank = true;
- optionValue.append(specLine.charAt(k));
- }
- }
- //
- // transition back to whitespace
- // value is over, add it to vector
- if (hasNonBlank) {
- optionVectors[j].addElement(optionValue
- .toString());
- }
- //
- // find next occurance on line
- //
- optionStart = specLine.indexOf(options[j], k);
- }
- }
- }
- //
- // copy vectors over to option arrays
- //
- for (int j = 0; j < options.length; j++) {
- optionValues[j] = new String[optionVectors[j].size()];
- optionVectors[j].copyInto(optionValues[j]);
- }
- }
- }
- //
- // fill in any missing option values with
- // a zero-length string array
- for (int i = 0; i < optionValues.length; i++) {
- String[] zeroLenArray = new String[0];
- if (optionValues[i] == null) {
- optionValues[i] = zeroLenArray;
- }
- }
- return optionValues;
- }
- private GccProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GppLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
deleted file mode 100644
index e7036abe16..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/GppLinker.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-/**
- * Adapter for the g++ variant of the GCC linker
- *
- * @author Stephen M. Webb <stephen.webb@bregmasoft.com>
- */
-public class GppLinker extends AbstractLdLinker {
- protected static final String[] discardFiles = new String[0];
- protected static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final GppLinker dllLinker = new GppLinker("gcc", objFiles,
- discardFiles, "lib", ".so", false, new GppLinker("gcc", objFiles,
- discardFiles, "lib", ".so", true, null));
- private final static String libPrefix = "libraries: =";
- protected static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle", "-dylib",
- "-dynamic", "-dynamiclib", "-nostartfiles", "-nostdlib",
- "-prebind", "-s", "-static", "-shared", "-symbolic", "-Xlinker"};
- private static final GppLinker instance = new GppLinker("gcc", objFiles,
- discardFiles, "", "", false, null);
- private static final GppLinker machDllLinker = new GppLinker("gcc",
- objFiles, discardFiles, "lib", ".dylib", false, null);
- private static final GppLinker machPluginLinker = new GppLinker("gcc",
- objFiles, discardFiles, "lib", ".bundle", false, null);
- public static GppLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private String runtimeLibrary;
- protected GppLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GppLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- if (linkType.isStaticRuntime()) {
- String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"};
- String[] cmdout = CaptureStreamHandler.run(cmdin);
- if (cmdout.length > 0) {
- runtimeLibrary = cmdout[0];
- } else {
- runtimeLibrary = null;
- }
- } else {
- runtimeLibrary = "-lstdc++";
- }
- }
- public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- String[] rs = super.addLibrarySets(task, libsets, preargs, midargs,
- endargs);
- if (runtimeLibrary != null) {
- endargs.addElement(runtimeLibrary);
- }
- return rs;
- }
- /**
- * Allows drived linker to decorate linker option. Override by GppLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- Vector dirs = new Vector();
- // Ask GCC where it will look for its libraries.
- String[] args = new String[]{"g++", "-print-search-dirs"};
- String[] cmdout = CaptureStreamHandler.run(args);
- for (int i = 0; i < cmdout.length; ++i) {
- int prefixIndex = cmdout[i].indexOf(libPrefix);
- if (prefixIndex >= 0) {
- // Special case DOS-type GCCs like MinGW or Cygwin
- int s = prefixIndex + libPrefix.length();
- int t = cmdout[i].indexOf(';', s);
- while (t > 0) {
- dirs.addElement(cmdout[i].substring(s, t));
- s = t + 1;
- t = cmdout[i].indexOf(';', s);
- }
- dirs.addElement(cmdout[i].substring(s));
- ++i;
- for (; i < cmdout.length; ++i) {
- dirs.addElement(cmdout[i]);
- }
- }
- }
- // Eliminate all but actual directories.
- String[] libpath = new String[dirs.size()];
- dirs.copyInto(libpath);
- int count = CUtil.checkDirectoryArray(libpath);
- // Build return array.
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; ++i) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machPluginLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/LdLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/LdLinker.java
deleted file mode 100644
index e05fa5b2db..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/LdLinker.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-/**
- * Adapter for the 'ld' linker
- *
- * @author Curt Arnold
- */
-public final class LdLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final LdLinker dllLinker = new LdLinker("ld", objFiles,
- discardFiles, "lib", ".so", false, new LdLinker("ld", objFiles,
- discardFiles, "lib", ".so", true, null));
- private static final LdLinker instance = new LdLinker("ld", objFiles,
- discardFiles, "", "", false, null);
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- public static LdLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private LdLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, LdLinker libtoolLinker) {
- super(command, "-version", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, isLibtool, libtoolLinker);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccCCompiler.java
deleted file mode 100644
index 6a5697eb80..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccCCompiler.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.CompilerParam;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCompilerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.compiler.ProgressMonitor;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.FortranParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * Adapter for the GCC C/C++ compiler
- *
- * @author Adam Murdoch
- */
-public final class GccCCompiler extends GccCompatibleCCompiler {
- private final static String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- private final static String[] sourceExtensions = new String[]{".c", /* C */
- ".cc", /* C++ */
- ".cpp", /* C++ */
- ".cxx", /* C++ */
- ".c++", /* C++ */
- ".i", /* preprocessed C */
- ".ii", /* preprocessed C++ */
- ".f", /* FORTRAN */
- ".for", /* FORTRAN */
- ".m", /* Objective-C */
- ".mm", /* Objected-C++ */
- ".s" /* Assembly */
- };
- private static final GccCCompiler cppInstance = new GccCCompiler("c++",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("c++", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler g77Instance = new GccCCompiler("g77",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("g77", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler gppInstance = new GccCCompiler("g++",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("g++", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- private static final GccCCompiler instance = new GccCCompiler("gcc",
- sourceExtensions, headerExtensions, false,
- new GccCCompiler("gcc", sourceExtensions, headerExtensions, true,
- null, false, null), false, null);
- /**
- * Gets c++ adapter
- */
- public static GccCCompiler getCppInstance() {
- return cppInstance;
- }
- /**
- * Gets g77 adapter
- */
- public static GccCCompiler getG77Instance() {
- return g77Instance;
- }
- /**
- * Gets gpp adapter
- */
- public static GccCCompiler getGppInstance() {
- return gppInstance;
- }
- /**
- * Gets gcc adapter
- */
- public static GccCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- private boolean isPICMeaningful = true;
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- private GccCCompiler(String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool,
- GccCCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(command, null, sourceExtensions, headerExtensions, isLibtool,
- libtoolCompiler, newEnvironment, env);
- isPICMeaningful = System.getProperty("os.name").indexOf("Windows") < 0;
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- super.addImpliedArgs(args, debug, multithreaded,
- exceptions, linkType, rtti, optimization, defaultflag);
- if (isPICMeaningful && linkType.isSharedLibrary()) {
- args.addElement("-fPIC");
- }
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new GccCCompiler(getCommand(), this.getSourceExtensions(),
- this.getHeaderExtensions(), this.getLibtool(),
- (GccCCompiler) this.getLibtoolCompiler(), newEnvironment,
- env);
- }
- return this;
- }
- protected Object clone() throws CloneNotSupportedException {
- GccCCompiler clone = (GccCCompiler) super.clone();
- return clone;
- }
- public void compile(CCTask task, File outputDir, String[] sourceFiles,
- String[] args, String[] endArgs, boolean relentless,
- CommandLineCompilerConfiguration config, ProgressMonitor monitor)
- throws BuildException {
- try {
- GccCCompiler clone = (GccCCompiler) this.clone();
- CompilerParam param = config.getParam("target");
- if (param != null)
- clone.setCommand(param.getValue() + "-" + this.getCommand());
- clone.supercompile(task, outputDir, sourceFiles, args, endArgs,
- relentless, config, monitor);
- } catch (CloneNotSupportedException e) {
- supercompile(task, outputDir, sourceFiles, args, endArgs,
- relentless, config, monitor);
- }
- }
- /**
- * Create parser to determine dependencies.
- *
- * Will create appropriate parser (C++, FORTRAN) based on file extension.
- *
- */
- protected Parser createParser(File source) {
- if (source != null) {
- String sourceName = source.getName();
- int lastDot = sourceName.lastIndexOf('.');
- if (lastDot >= 0 && lastDot + 1 < sourceName.length()) {
- char afterDot = sourceName.charAt(lastDot + 1);
- if (afterDot == 'f' || afterDot == 'F') {
- return new FortranParser();
- }
- }
- }
- return new CParser();
- }
- public File[] getEnvironmentIncludePath() {
- if (includePath == null) {
- //
- // construct default include path from machine id and version id
- //
- String[] defaultInclude = new String[1];
- StringBuffer buf = new StringBuffer("/lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- buf.append("/include");
- defaultInclude[0] = buf.toString();
- //
- // read specs file and look for -istart and -idirafter
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] optionValues = GccProcessor.parseSpecs(specs, "*cpp:",
- new String[]{"-isystem ", "-idirafter "});
- //
- // if no entries were found, then use a default path
- //
- if (optionValues[0].length == 0 && optionValues[1].length == 0) {
- optionValues[0] = new String[]{"/usr/local/include",
- "/usr/include", "/usr/include/win32api"};
- }
- //
- // remove mingw entries.
- // For MinGW compiles this will mean the
- // location of the sys includes will be
- // wrong in dependencies.xml
- // but that should have no significant effect
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j].indexOf("mingw") > 0) {
- optionValues[i][j] = null;
- }
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(optionValues[0]);
- GccProcessor.convertCygwinFilenames(optionValues[1]);
- GccProcessor.convertCygwinFilenames(defaultInclude);
- }
- int count = CUtil.checkDirectoryArray(optionValues[0]);
- count += CUtil.checkDirectoryArray(optionValues[1]);
- count += CUtil.checkDirectoryArray(defaultInclude);
- includePath = new File[count];
- int index = 0;
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j] != null) {
- includePath[index++] = new File(optionValues[i][j]);
- }
- }
- }
- for (int i = 0; i < defaultInclude.length; i++) {
- if (defaultInclude[i] != null) {
- includePath[index++] = new File(defaultInclude[i]);
- }
- }
- }
- return (File[]) includePath.clone();
- }
- public String getIdentifier() throws BuildException {
- if (identifier == null) {
- StringBuffer buf;
- if (getLibtool()) {
- buf = new StringBuffer("libtool ");
- } else {
- buf = new StringBuffer(' ');
- }
- buf.append(getCommand());
- buf.append(' ');
- buf.append(GccProcessor.getVersion());
- buf.append(' ');
- buf.append(GccProcessor.getMachine());
- identifier = buf.toString();
- }
- return identifier;
- }
- public Linker getLinker(LinkType linkType) {
- return GccLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- private void supercompile(CCTask task, File outputDir,
- String[] sourceFiles, String[] args, String[] endArgs,
- boolean relentless, CommandLineCompilerConfiguration config,
- ProgressMonitor monitor) throws BuildException {
- super.compile(task, outputDir, sourceFiles, args, endArgs, relentless,
- config, monitor);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLibrarian.java
deleted file mode 100644
index ea2278a6e7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLibrarian.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractArLibrarian;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the 'ar' archiver
- *
- * @author Adam Murdoch
- */
-public final class GccLibrarian extends AbstractArLibrarian {
- private static String[] objFileExtensions = new String[]{".o"};
- private static GccLibrarian instance = new GccLibrarian("ar",
- objFileExtensions, false, new GccLibrarian("ar", objFileExtensions,
- true, null));
- public static GccLibrarian getInstance() {
- return instance;
- }
- private GccLibrarian(String command, String[] inputExtensions,
- boolean isLibtool, GccLibrarian libtoolLibrarian) {
- super(command, "V", inputExtensions, new String[0], "lib", ".a",
- isLibtool, libtoolLibrarian);
- }
- protected Object clone() throws CloneNotSupportedException {
- GccLibrarian clone = (GccLibrarian) super.clone();
- return clone;
- }
- public Linker getLinker(LinkType type) {
- return GccLinker.getInstance().getLinker(type);
- }
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- try {
- GccLibrarian clone = (GccLibrarian) this.clone();
- LinkerParam param = config.getParam("target");
- if (param != null)
- clone.setCommand(param.getValue() + "-" + this.getCommand());
- clone.superlink(task, outputFile, sourceFiles, config);
- } catch (CloneNotSupportedException e) {
- superlink(task, outputFile, sourceFiles, config);
- }
- }
- private void superlink(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- super.link(task, outputFile, sourceFiles, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLinker.java
deleted file mode 100644
index 3293829d13..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccLinker.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.File;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the GCC linker
- *
- * @author Adam Murdoch
- */
-public class GccLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final GccLinker dllLinker = new GccLinker("gcc", objFiles,
- discardFiles, "lib", ".so", false, new GccLinker("gcc", objFiles,
- discardFiles, "lib", ".so", true, null));
- private static final GccLinker instance = new GccLinker("gcc", objFiles,
- discardFiles, "", "", false, null);
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle",
- "-dynamiclib", "-nostartfiles", "-nostdlib", "-prebind", "-s",
- "-static", "-shared", "-symbolic", "-Xlinker",
- "--export-all-symbols", "-static-libgcc",};
- private static final GccLinker machBundleLinker = new GccLinker("gcc",
- objFiles, discardFiles, "lib", ".bundle", false, null);
- private static final GccLinker machDllLinker = new GccLinker("gcc",
- objFiles, discardFiles, "lib", ".dylib", false, null);
- public static GccLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- protected GccLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GccLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- }
- protected Object clone() throws CloneNotSupportedException {
- GccLinker clone = (GccLinker) super.clone();
- return clone;
- }
- /**
- * Allows drived linker to decorate linker option. Override by GccLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- case 'v' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- //
- // construct gcc lib path from machine and version
- //
- StringBuffer buf = new StringBuffer("/lib/gcc-lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- //
- // build default path from gcc and system /lib and /lib/w32api
- //
- String[] impliedLibPath = new String[]{buf.toString(),
- "/lib/w32api", "/lib"};
- //
- // read gcc specs file for other library paths
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] libpaths = GccProcessor.parseSpecs(specs, "*link:",
- new String[]{"%q"});
- String[] libpath;
- if (libpaths[0].length > 0) {
- libpath = new String[libpaths[0].length + 3];
- int i = 0;
- for (; i < libpaths[0].length; i++) {
- libpath[i] = libpaths[0][i];
- }
- libpath[i++] = buf.toString();
- libpath[i++] = "/lib/w32api";
- libpath[i++] = "/lib";
- } else {
- //
- // if a failure to find any matches then
- // use some default values for lib path entries
- libpath = new String[]{"/usr/local/lib/mingw",
- "/usr/local/lib", "/usr/lib/w32api", "/usr/lib/mingw",
- "/usr/lib", buf.toString(), "/lib/w32api", "/lib"};
- }
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i].indexOf("mingw") >= 0) {
- libpath[i] = null;
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(libpath);
- }
- //
- // check that remaining entries are actual directories
- //
- int count = CUtil.checkDirectoryArray(libpath);
- //
- // populate return array with remaining entries
- //
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (isDarwin()) {
- return machBundleLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (isDarwin()) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- try {
- GccLinker clone = (GccLinker) this.clone();
- LinkerParam param = config.getParam("target");
- if (param != null)
- clone.setCommand(param.getValue() + "-" + this.getCommand());
- clone.superlink(task, outputFile, sourceFiles, config);
- } catch (CloneNotSupportedException e) {
- superlink(task, outputFile, sourceFiles, config);
- }
- }
- private void superlink(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- super.link(task, outputFile, sourceFiles, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccProcessor.java
deleted file mode 100644
index 283df63314..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GccProcessor.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-
-/**
- * A add-in class for Gcc processors
- *
- *
- */
-public class GccProcessor {
- // the results from gcc -dumpmachine
- private static String machine;
- private static String[] specs;
- // the results from gcc -dumpversion
- private static String version;
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
- /**
- * Converts absolute Cygwin file or directory names to the corresponding
- * Win32 name.
- *
- * @param names
- * array of names, some elements may be null, will be changed in
- * place.
- */
- public static void convertCygwinFilenames(String[] names) {
- if (names == null) {
- throw new NullPointerException("names");
- }
- File gccDir = CUtil.getExecutableLocation("gcc.exe");
- if (gccDir != null) {
- String prefix = gccDir.getAbsolutePath() + "/..";
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- if (name != null && name.length() > 1 && name.charAt(0) == '/') {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(name);
- names[i] = buf.toString();
- }
- }
- }
- }
-
- public static String getMachine() {
- if (machine == null) {
- String[] args = new String[]{"gcc", "-dumpmachine"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- machine = "nomachine";
- } else {
- machine = cmdout[0];
- }
- }
- return machine;
- }
- public static String[] getOutputFileSwitch(String letter, String outputFile) {
- StringBuffer buf = new StringBuffer();
- if (outputFile.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(outputFile.replace('\\', '/'));
- buf.append('"');
- } else {
- buf.append(outputFile.replace('\\', '/'));
- }
- String[] retval = new String[]{letter, buf.toString()};
- return retval;
- }
- /**
- * Returns the contents of the gcc specs file.
- *
- * The implementation locates gcc.exe in the executable path and then
- * builds a relative path name from the results of -dumpmachine and
- * -dumpversion. Attempts to use gcc -dumpspecs to provide this information
- * resulted in stalling on the Execute.run
- *
- * @returns contents of the specs file
- */
- public static String[] getSpecs() {
- if (specs == null) {
- File gccParent = CUtil.getExecutableLocation("gcc.exe");
- if (gccParent != null) {
- //
- // build a relative path like
- // ../lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
- //
- StringBuffer buf = new StringBuffer("../lib/gcc-lib/");
- buf.append(getMachine());
- buf.append('/');
- buf.append(getVersion());
- buf.append("/specs");
- //
- // resolve it relative to the location of gcc.exe
- //
- String relativePath = buf.toString();
- File specsFile = new File(gccParent, relativePath);
- //
- // found the specs file
- //
- try {
- //
- // read the lines in the file
- //
- BufferedReader reader = new BufferedReader(new FileReader(
- specsFile));
- Vector lines = new Vector(100);
- String line = reader.readLine();
- while (line != null) {
- lines.addElement(line);
- line = reader.readLine();
- }
- specs = new String[lines.size()];
- lines.copyInto(specs);
- } catch (IOException ex) {
- }
- }
- }
- if (specs == null) {
- specs = new String[0];
- }
- return specs;
- }
- public static String getVersion() {
- if (version == null) {
- String[] args = new String[]{"gcc", "-dumpversion"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- version = "noversion";
- } else {
- version = cmdout[0];
- }
- }
- return version;
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- /**
- * Determines if task is running with cygwin
- *
- * @return true if cygwin was detected
- */
- public static boolean isCygwin() {
- return getMachine().indexOf("cygwin") > 0;
- }
- private static boolean isHPUX() {
- String osname = System.getProperty("os.name").toLowerCase();
- if (osname.indexOf("hp") >= 0 && osname.indexOf("ux") >= 0) {
- return true;
- }
- return false;
- }
- /**
- *
- * Parses the results of the specs file for a specific processor and
- * options
- *
- * @param specsContent
- * Contents of specs file as returned from getSpecs
- * @param specSectionStart
- * start of spec section, for example "*cpp:"
- * @param options
- * command line switches such as "-istart"
- */
- public static String[][] parseSpecs(String[] specsContent,
- String specSectionStart, String[] options) {
- if (specsContent == null) {
- throw new NullPointerException("specsContent");
- }
- if (specSectionStart == null) {
- throw new NullPointerException("specSectionStart");
- }
- if (options == null) {
- throw new NullPointerException("option");
- }
- String[][] optionValues = new String[options.length][];
- StringBuffer optionValue = new StringBuffer(40);
- for (int i = 0; i < specsContent.length; i++) {
- String specLine = specsContent[i];
- //
- // if start of section then start paying attention
- //
- if (specLine.startsWith(specSectionStart)) {
- Vector[] optionVectors = new Vector[options.length];
- for (int j = 0; j < options.length; j++) {
- optionVectors[j] = new Vector(10);
- }
- //
- // go to next line and examine contents
- // and repeat until end of file
- //
- for (i++; i < specsContent.length; i++) {
- specLine = specsContent[i];
- for (int j = 0; j < options.length; j++) {
- int optionStart = specLine.indexOf(options[j]);
- while (optionStart >= 0) {
- optionValue.setLength(0);
- //
- // walk rest of line looking for first non
- // whitespace
- // and then next space
- boolean hasNonBlank = false;
- int k = optionStart + options[j].length();
- for (; k < specLine.length(); k++) {
- //
- // either a blank or a "}" (close of
- // conditional)
- // section will end the path
- //
- if (specLine.charAt(k) == ' '
- || specLine.charAt(k) == '}') {
- if (hasNonBlank) {
- break;
- }
- } else {
- hasNonBlank = true;
- optionValue.append(specLine.charAt(k));
- }
- }
- //
- // transition back to whitespace
- // value is over, add it to vector
- if (hasNonBlank) {
- optionVectors[j].addElement(optionValue
- .toString());
- }
- //
- // find next occurance on line
- //
- optionStart = specLine.indexOf(options[j], k);
- }
- }
- }
- //
- // copy vectors over to option arrays
- //
- for (int j = 0; j < options.length; j++) {
- optionValues[j] = new String[optionVectors[j].size()];
- optionVectors[j].copyInto(optionValues[j]);
- }
- }
- }
- //
- // fill in any missing option values with
- // a zero-length string array
- for (int i = 0; i < optionValues.length; i++) {
- String[] zeroLenArray = new String[0];
- if (optionValues[i] == null) {
- optionValues[i] = zeroLenArray;
- }
- }
- return optionValues;
- }
- private GccProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GppLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GppLinker.java
deleted file mode 100644
index 3ba8f06bf8..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/GppLinker.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the g++ variant of the GCC linker
- *
- * @author Stephen M. Webb <stephen.webb@bregmasoft.com>
- */
-public class GppLinker extends AbstractLdLinker {
- protected static final String[] discardFiles = new String[0];
- protected static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final GppLinker dllLinker = new GppLinker("gcc", objFiles,
- discardFiles, "lib", ".so", false, new GppLinker("gcc", objFiles,
- discardFiles, "lib", ".so", true, null));
- private final static String libPrefix = "libraries: =";
- protected static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle", "-dylib",
- "-dynamic", "-dynamiclib", "-nostartfiles", "-nostdlib",
- "-prebind", "-s", "-static", "-shared", "-symbolic", "-Xlinker"};
- private static final GppLinker instance = new GppLinker("gcc", objFiles,
- discardFiles, "", "", false, null);
- private static final GppLinker machDllLinker = new GppLinker("gcc",
- objFiles, discardFiles, "lib", ".dylib", false, null);
- private static final GppLinker machPluginLinker = new GppLinker("gcc",
- objFiles, discardFiles, "lib", ".bundle", false, null);
- public static GppLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private String runtimeLibrary;
- protected GppLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GppLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- if (linkType.isStaticRuntime()) {
- String[] cmdin = new String[]{"g++", "-print-file-name=libstdc++.a"};
- String[] cmdout = CaptureStreamHandler.run(cmdin);
- if (cmdout.length > 0) {
- runtimeLibrary = cmdout[0];
- } else {
- runtimeLibrary = null;
- }
- } else {
- runtimeLibrary = "-lstdc++";
- }
- }
- public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- String[] rs = super.addLibrarySets(task, libsets, preargs, midargs,
- endargs);
- if (runtimeLibrary != null) {
- endargs.addElement(runtimeLibrary);
- }
- return rs;
- }
- protected Object clone() throws CloneNotSupportedException {
- GppLinker clone = (GppLinker) super.clone();
- return clone;
- }
- /**
- * Allows drived linker to decorate linker option. Override by GppLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- Vector dirs = new Vector();
- // Ask GCC where it will look for its libraries.
- String[] args = new String[]{"g++", "-print-search-dirs"};
- String[] cmdout = CaptureStreamHandler.run(args);
- for (int i = 0; i < cmdout.length; ++i) {
- int prefixIndex = cmdout[i].indexOf(libPrefix);
- if (prefixIndex >= 0) {
- // Special case DOS-type GCCs like MinGW or Cygwin
- int s = prefixIndex + libPrefix.length();
- int t = cmdout[i].indexOf(';', s);
- while (t > 0) {
- dirs.addElement(cmdout[i].substring(s, t));
- s = t + 1;
- t = cmdout[i].indexOf(';', s);
- }
- dirs.addElement(cmdout[i].substring(s));
- ++i;
- for (; i < cmdout.length; ++i) {
- dirs.addElement(cmdout[i]);
- }
- }
- }
- // Eliminate all but actual directories.
- String[] libpath = new String[dirs.size()];
- dirs.copyInto(libpath);
- int count = CUtil.checkDirectoryArray(libpath);
- // Build return array.
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; ++i) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machPluginLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- try {
- GppLinker clone = (GppLinker) this.clone();
- LinkerParam param = config.getParam("target");
- if (param != null)
- clone.setCommand(param.getValue() + "-" + this.getCommand());
- clone.superlink(task, outputFile, sourceFiles, config);
- } catch (CloneNotSupportedException e) {
- superlink(task, outputFile, sourceFiles, config);
- }
- }
- private void superlink(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- super.link(task, outputFile, sourceFiles, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/LdLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/LdLinker.java
deleted file mode 100644
index 8ac0cf82a7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/LdLinker.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.LinkerParam;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the 'ld' linker
- *
- * @author Curt Arnold
- */
-public final class LdLinker extends AbstractLdLinker {
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final String[] discardFiles = new String[0];
- private static final LdLinker dllLinker = new LdLinker("ld", objFiles,
- discardFiles, "lib", ".so", false, new LdLinker("ld", objFiles,
- discardFiles, "lib", ".so", true, null));
- private static final LdLinker instance = new LdLinker("ld", objFiles,
- discardFiles, "", "", false, null);
- public static LdLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private LdLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, LdLinker libtoolLinker) {
- super(command, "-version", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, isLibtool, libtoolLinker);
- }
- protected Object clone() throws CloneNotSupportedException {
- LdLinker clone = (LdLinker) super.clone();
- return clone;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- try {
- LdLinker clone = (LdLinker) this.clone();
- LinkerParam param = config.getParam("target");
- if (param != null)
- clone.setCommand(param.getValue() + "-" + this.getCommand());
- clone.superlink(task, outputFile, sourceFiles, config);
- } catch (CloneNotSupportedException e) {
- superlink(task, outputFile, sourceFiles, config);
- }
- }
- private void superlink(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- super.link(task, outputFile, sourceFiles, config);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccCCompiler.java
deleted file mode 100644
index 62d65b910c..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccCCompiler.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-import net.sf.antcontrib.cpptasks.parser.CParser;
-import net.sf.antcontrib.cpptasks.parser.FortranParser;
-import net.sf.antcontrib.cpptasks.parser.Parser;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.Environment;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-/**
- * Adapter for the GCC C/C++ compiler
- *
- * @author Adam Murdoch
- */
-public final class GccCCompiler extends GccCompatibleCCompiler {
- private final static String[] sourceExtensions = new String[]{".c", /* C */
- ".cc", /* C++ */
- ".cpp", /* C++ */
- ".cxx", /* C++ */
- ".c++", /* C++ */
- ".i", /* preprocessed C */
- ".ii", /* preprocessed C++ */
- ".f", /* FORTRAN */
- ".for", /* FORTRAN */
- ".m", /* Objective-C */
- ".mm", /* Objected-C++ */
- ".s" /* Assembly */
- };
- private final static String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- public static final String CMD_PREFIX = "sparc-sun-solaris2-";
- private static final GccCCompiler cppInstance = new GccCCompiler(CMD_PREFIX
- + "c++", sourceExtensions, headerExtensions, false,
- new GccCCompiler(CMD_PREFIX + "c++", sourceExtensions,
- headerExtensions, true, null, false, null), false, null);
- private static final GccCCompiler g77Instance = new GccCCompiler(CMD_PREFIX
- + "g77", sourceExtensions, headerExtensions, false,
- new GccCCompiler(CMD_PREFIX + "g77", sourceExtensions,
- headerExtensions, true, null, false, null), false, null);
- private static final GccCCompiler gppInstance = new GccCCompiler(CMD_PREFIX
- + "g++", sourceExtensions, headerExtensions, false,
- new GccCCompiler(CMD_PREFIX + "g++", sourceExtensions,
- headerExtensions, true, null, false, null), false, null);
- private static final GccCCompiler instance = new GccCCompiler(CMD_PREFIX
- + "gcc", sourceExtensions, headerExtensions, false,
- new GccCCompiler(CMD_PREFIX + "gcc", sourceExtensions,
- headerExtensions, true, null, false, null), false, null);
- /**
- * Gets c++ adapter
- */
- public static GccCCompiler getCppInstance() {
- return cppInstance;
- }
- /**
- * Gets g77 adapter
- */
- public static GccCCompiler getG77Instance() {
- return g77Instance;
- }
- /**
- * Gets gpp adapter
- */
- public static GccCCompiler getGppInstance() {
- return gppInstance;
- }
- /**
- * Gets gcc adapter
- */
- public static GccCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- private boolean isPICMeaningful = true;
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- private GccCCompiler(String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool,
- GccCCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super(command, null, sourceExtensions, headerExtensions, isLibtool,
- libtoolCompiler, newEnvironment, env);
- isPICMeaningful = System.getProperty("os.name").indexOf("Windows") < 0;
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- super.addImpliedArgs(args, debug, multithreaded,
- exceptions, linkType, rtti, optimization, defaultflag);
- if (isPICMeaningful && linkType.isSharedLibrary()) {
- args.addElement("-fPIC");
- }
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new GccCCompiler(getCommand(), this.getSourceExtensions(),
- this.getHeaderExtensions(), this.getLibtool(),
- (GccCCompiler) this.getLibtoolCompiler(), newEnvironment,
- env);
- }
- return this;
- }
- /**
- * Create parser to determine dependencies.
- *
- * Will create appropriate parser (C++, FORTRAN) based on file extension.
- *
- */
- protected Parser createParser(File source) {
- if (source != null) {
- String sourceName = source.getName();
- int lastDot = sourceName.lastIndexOf('.');
- if (lastDot >= 0 && lastDot + 1 < sourceName.length()) {
- char afterDot = sourceName.charAt(lastDot + 1);
- if (afterDot == 'f' || afterDot == 'F') {
- return new FortranParser();
- }
- }
- }
- return new CParser();
- }
- public File[] getEnvironmentIncludePath() {
- if (includePath == null) {
- //
- // construct default include path from machine id and version id
- //
- String[] defaultInclude = new String[1];
- StringBuffer buf = new StringBuffer("/lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- buf.append("/include");
- defaultInclude[0] = buf.toString();
- //
- // read specs file and look for -istart and -idirafter
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] optionValues = GccProcessor.parseSpecs(specs, "*cpp:",
- new String[]{"-isystem ", "-idirafter "});
- //
- // if no entries were found, then use a default path
- //
- if (optionValues[0].length == 0 && optionValues[1].length == 0) {
- optionValues[0] = new String[]{"/usr/local/include",
- "/usr/include", "/usr/include/win32api"};
- }
- //
- // remove mingw entries.
- // For MinGW compiles this will mean the
- // location of the sys includes will be
- // wrong in dependencies.xml
- // but that should have no significant effect
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j].indexOf("mingw") > 0) {
- optionValues[i][j] = null;
- }
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(optionValues[0]);
- GccProcessor.convertCygwinFilenames(optionValues[1]);
- GccProcessor.convertCygwinFilenames(defaultInclude);
- }
- int count = CUtil.checkDirectoryArray(optionValues[0]);
- count += CUtil.checkDirectoryArray(optionValues[1]);
- count += CUtil.checkDirectoryArray(defaultInclude);
- includePath = new File[count];
- int index = 0;
- for (int i = 0; i < optionValues.length; i++) {
- for (int j = 0; j < optionValues[i].length; j++) {
- if (optionValues[i][j] != null) {
- includePath[index++] = new File(optionValues[i][j]);
- }
- }
- }
- for (int i = 0; i < defaultInclude.length; i++) {
- if (defaultInclude[i] != null) {
- includePath[index++] = new File(defaultInclude[i]);
- }
- }
- }
- return (File[]) includePath.clone();
- }
- public String getIdentifier() throws BuildException {
- if (identifier == null) {
- StringBuffer buf;
- if (getLibtool()) {
- buf = new StringBuffer("libtool ");
- } else {
- buf = new StringBuffer(' ');
- }
- buf.append(getCommand());
- buf.append(' ');
- buf.append(GccProcessor.getVersion());
- buf.append(' ');
- buf.append(GccProcessor.getMachine());
- identifier = buf.toString();
- }
- return identifier;
- }
- public Linker getLinker(LinkType linkType) {
- return GccLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLibrarian.java
deleted file mode 100644
index bb243879af..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLibrarian.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractArLibrarian;
-/**
- * Adapter for the 'ar' archiver
- *
- * @author Adam Murdoch
- */
-public final class GccLibrarian extends AbstractArLibrarian {
- private static String[] objFileExtensions = new String[]{".o"};
- private static GccLibrarian instance = new GccLibrarian(
- GccCCompiler.CMD_PREFIX + "ar", objFileExtensions, false,
- new GccLibrarian(GccCCompiler.CMD_PREFIX + "ar", objFileExtensions,
- true, null));
- public static GccLibrarian getInstance() {
- return instance;
- }
- private GccLibrarian(String command, String[] inputExtensions,
- boolean isLibtool, GccLibrarian libtoolLibrarian) {
- super(command, "V", inputExtensions, new String[0], "lib", ".a",
- isLibtool, libtoolLibrarian);
- }
- public Linker getLinker(LinkType type) {
- return GccLinker.getInstance().getLinker(type);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java
deleted file mode 100644
index 914da34439..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccLinker.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-/**
- * Adapter for the GCC linker
- *
- * @author Adam Murdoch
- */
-public class GccLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle",
- "-dynamiclib", "-nostartfiles", "-nostdlib", "-prebind", "-s",
- "-static", "-shared", "-symbolic", "-Xlinker",
- "--export-all-symbols", "-static-libgcc",};
- private static final GccLinker dllLinker = new GccLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".so", false, new GccLinker(GccCCompiler.CMD_PREFIX + "gcc",
- objFiles, discardFiles, "lib", ".so", true, null));
- private static final GccLinker instance = new GccLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "", "",
- false, null);
- private static final GccLinker machBundleLinker = new GccLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".bundle", false, null);
- private static final GccLinker machDllLinker = new GccLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".dylib", false, null);
- public static GccLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- protected GccLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GccLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- }
- /**
- * Allows drived linker to decorate linker option. Override by GccLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- case 'v' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- //
- // construct gcc lib path from machine and version
- //
- StringBuffer buf = new StringBuffer("/lib/gcc-lib/");
- buf.append(GccProcessor.getMachine());
- buf.append('/');
- buf.append(GccProcessor.getVersion());
- //
- // build default path from gcc and system /lib and /lib/w32api
- //
- String[] impliedLibPath = new String[]{buf.toString(),
- "/lib/w32api", "/lib"};
- //
- // read gcc specs file for other library paths
- //
- String[] specs = GccProcessor.getSpecs();
- String[][] libpaths = GccProcessor.parseSpecs(specs, "*link:",
- new String[]{"%q"});
- String[] libpath;
- if (libpaths[0].length > 0) {
- libpath = new String[libpaths[0].length + 3];
- int i = 0;
- for (; i < libpaths[0].length; i++) {
- libpath[i] = libpaths[0][i];
- }
- libpath[i++] = buf.toString();
- libpath[i++] = "/lib/w32api";
- libpath[i++] = "/lib";
- } else {
- //
- // if a failure to find any matches then
- // use some default values for lib path entries
- libpath = new String[]{"/usr/local/lib/mingw",
- "/usr/local/lib", "/usr/lib/w32api", "/usr/lib/mingw",
- "/usr/lib", buf.toString(), "/lib/w32api", "/lib"};
- }
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i].indexOf("mingw") >= 0) {
- libpath[i] = null;
- }
- }
- //
- // if cygwin then
- // we have to prepend location of gcc32
- // and .. to start of absolute filenames to
- // have something that will exist in the
- // windows filesystem
- if (GccProcessor.isCygwin()) {
- GccProcessor.convertCygwinFilenames(libpath);
- }
- //
- // check that remaining entries are actual directories
- //
- int count = CUtil.checkDirectoryArray(libpath);
- //
- // populate return array with remaining entries
- //
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; i++) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (isDarwin()) {
- return machBundleLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (isDarwin()) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java
deleted file mode 100644
index 599d6a8013..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GccProcessor.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * A add-in class for Gcc processors
- *
- *
- */
-public class GccProcessor {
- // the results from gcc -dumpmachine
- private static String machine;
- private static String[] specs;
- // the results from gcc -dumpversion
- private static String version;
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
- /**
- * Converts absolute Cygwin file or directory names to the corresponding
- * Win32 name.
- *
- * @param names
- * array of names, some elements may be null, will be changed in
- * place.
- */
- public static void convertCygwinFilenames(String[] names) {
- if (names == null) {
- throw new NullPointerException("names");
- }
- File gccDir = CUtil.getExecutableLocation(GccCCompiler.CMD_PREFIX
- + "gcc.exe");
- if (gccDir != null) {
- String prefix = gccDir.getAbsolutePath() + "/..";
- StringBuffer buf = new StringBuffer();
- for (int i = 0; i < names.length; i++) {
- String name = names[i];
- if (name != null && name.length() > 1 && name.charAt(0) == '/') {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(name);
- names[i] = buf.toString();
- }
- }
- }
- }
- public static String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length * 2];
- int offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- if (isHPUX()) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".sl", patterns,
- offset);
- } else {
- offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns,
- offset);
- }
- return patterns;
- }
- public static String getMachine() {
- if (machine == null) {
- String[] args = new String[]{GccCCompiler.CMD_PREFIX + "gcc",
- "-dumpmachine"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- machine = "nomachine";
- } else {
- machine = cmdout[0];
- }
- }
- return machine;
- }
- public static String[] getOutputFileSwitch(String letter, String outputFile) {
- StringBuffer buf = new StringBuffer();
- if (outputFile.indexOf(' ') >= 0) {
- buf.append('"');
- buf.append(outputFile.replace('\\', '/'));
- buf.append('"');
- } else {
- buf.append(outputFile.replace('\\', '/'));
- }
- String[] retval = new String[]{letter, buf.toString()};
- return retval;
- }
- /**
- * Returns the contents of the gcc specs file.
- *
- * The implementation locates gcc.exe in the executable path and then
- * builds a relative path name from the results of -dumpmachine and
- * -dumpversion. Attempts to use gcc -dumpspecs to provide this information
- * resulted in stalling on the Execute.run
- *
- * @returns contents of the specs file
- */
- public static String[] getSpecs() {
- if (specs == null) {
- File gccParent = CUtil
- .getExecutableLocation(GccCCompiler.CMD_PREFIX + "gcc.exe");
- if (gccParent != null) {
- //
- // build a relative path like
- // ../lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
- //
- StringBuffer buf = new StringBuffer("../lib/gcc-lib/");
- buf.append(getMachine());
- buf.append('/');
- buf.append(getVersion());
- buf.append("/specs");
- //
- // resolve it relative to the location of gcc.exe
- //
- String relativePath = buf.toString();
- File specsFile = new File(gccParent, relativePath);
- //
- // found the specs file
- //
- try {
- //
- // read the lines in the file
- //
- BufferedReader reader = new BufferedReader(new FileReader(
- specsFile));
- Vector lines = new Vector(100);
- String line = reader.readLine();
- while (line != null) {
- lines.addElement(line);
- line = reader.readLine();
- }
- specs = new String[lines.size()];
- lines.copyInto(specs);
- } catch (IOException ex) {
- }
- }
- }
- if (specs == null) {
- specs = new String[0];
- }
- return specs;
- }
- public static String getVersion() {
- if (version == null) {
- String[] args = new String[]{GccCCompiler.CMD_PREFIX + "gcc",
- "-dumpversion"};
- String[] cmdout = CaptureStreamHandler.run(args);
- if (cmdout.length == 0) {
- version = "noversion";
- } else {
- version = cmdout[0];
- }
- }
- return version;
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- /**
- * Determines if task is running with cygwin
- *
- * @return true if cygwin was detected
- */
- public static boolean isCygwin() {
- return getMachine().indexOf("cygwin") > 0;
- }
- private static boolean isHPUX() {
- String osname = System.getProperty("os.name").toLowerCase();
- if (osname.indexOf("hp") >= 0 && osname.indexOf("ux") >= 0) {
- return true;
- }
- return false;
- }
- /**
- *
- * Parses the results of the specs file for a specific processor and
- * options
- *
- * @param specsContent
- * Contents of specs file as returned from getSpecs
- * @param specSectionStart
- * start of spec section, for example "*cpp:"
- * @param options
- * command line switches such as "-istart"
- */
- public static String[][] parseSpecs(String[] specsContent,
- String specSectionStart, String[] options) {
- if (specsContent == null) {
- throw new NullPointerException("specsContent");
- }
- if (specSectionStart == null) {
- throw new NullPointerException("specSectionStart");
- }
- if (options == null) {
- throw new NullPointerException("option");
- }
- String[][] optionValues = new String[options.length][];
- StringBuffer optionValue = new StringBuffer(40);
- for (int i = 0; i < specsContent.length; i++) {
- String specLine = specsContent[i];
- //
- // if start of section then start paying attention
- //
- if (specLine.startsWith(specSectionStart)) {
- Vector[] optionVectors = new Vector[options.length];
- for (int j = 0; j < options.length; j++) {
- optionVectors[j] = new Vector(10);
- }
- //
- // go to next line and examine contents
- // and repeat until end of file
- //
- for (i++; i < specsContent.length; i++) {
- specLine = specsContent[i];
- for (int j = 0; j < options.length; j++) {
- int optionStart = specLine.indexOf(options[j]);
- while (optionStart >= 0) {
- optionValue.setLength(0);
- //
- // walk rest of line looking for first non
- // whitespace
- // and then next space
- boolean hasNonBlank = false;
- int k = optionStart + options[j].length();
- for (; k < specLine.length(); k++) {
- //
- // either a blank or a "}" (close of
- // conditional)
- // section will end the path
- //
- if (specLine.charAt(k) == ' '
- || specLine.charAt(k) == '}') {
- if (hasNonBlank) {
- break;
- }
- } else {
- hasNonBlank = true;
- optionValue.append(specLine.charAt(k));
- }
- }
- //
- // transition back to whitespace
- // value is over, add it to vector
- if (hasNonBlank) {
- optionVectors[j].addElement(optionValue
- .toString());
- }
- //
- // find next occurance on line
- //
- optionStart = specLine.indexOf(options[j], k);
- }
- }
- }
- //
- // copy vectors over to option arrays
- //
- for (int j = 0; j < options.length; j++) {
- optionValues[j] = new String[optionVectors[j].size()];
- optionVectors[j].copyInto(optionValues[j]);
- }
- }
- }
- //
- // fill in any missing option values with
- // a zero-length string array
- for (int i = 0; i < optionValues.length; i++) {
- String[] zeroLenArray = new String[0];
- if (optionValues[i] == null) {
- optionValues[i] = zeroLenArray;
- }
- }
- return optionValues;
- }
- private GccProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GppLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GppLinker.java
deleted file mode 100644
index 6a4c0ab14b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/GppLinker.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*
- *
- * Copyright 2003-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CaptureStreamHandler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-/**
- * Adapter for the g++ variant of the GCC linker
- *
- * @author Stephen M. Webb <stephen.webb@bregmasoft.com>
- */
-public class GppLinker extends AbstractLdLinker {
- protected static final String[] discardFiles = new String[0];
- protected static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private final static String libPrefix = "libraries: =";
- protected static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static String[] linkerOptions = new String[]{"-bundle", "-dylib",
- "-dynamic", "-dynamiclib", "-nostartfiles", "-nostdlib",
- "-prebind", "-s", "-static", "-shared", "-symbolic", "-Xlinker"};
- private static final GppLinker dllLinker = new GppLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".so", false, new GppLinker(GccCCompiler.CMD_PREFIX + "gcc",
- objFiles, discardFiles, "lib", ".so", true, null));
- private static final GppLinker instance = new GppLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "", "",
- false, null);
- private static final GppLinker machDllLinker = new GppLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".dylib", false, null);
- private static final GppLinker machPluginLinker = new GppLinker(
- GccCCompiler.CMD_PREFIX + "gcc", objFiles, discardFiles, "lib",
- ".bundle", false, null);
- public static GppLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private String runtimeLibrary;
- protected GppLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, GppLinker libtoolLinker) {
- super(command, "-dumpversion", extensions, ignoredExtensions,
- outputPrefix, outputSuffix, isLibtool, libtoolLinker);
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- super.addImpliedArgs(debug, linkType, args, defaultflag);
- if (getIdentifier().indexOf("mingw") >= 0) {
- if (linkType.isSubsystemConsole()) {
- args.addElement("-mconsole");
- }
- if (linkType.isSubsystemGUI()) {
- args.addElement("-mwindows");
- }
- }
- if (linkType.isStaticRuntime()) {
- String[] cmdin = new String[]{GccCCompiler.CMD_PREFIX + "g++",
- "-print-file-name=libstdc++.a"};
- String[] cmdout = CaptureStreamHandler.run(cmdin);
- if (cmdout.length > 0) {
- runtimeLibrary = cmdout[0];
- } else {
- runtimeLibrary = null;
- }
- } else {
- runtimeLibrary = "-lstdc++";
- }
- }
- public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- String[] rs = super.addLibrarySets(task, libsets, preargs, midargs,
- endargs);
- if (runtimeLibrary != null) {
- endargs.addElement(runtimeLibrary);
- }
- return rs;
- }
- /**
- * Allows drived linker to decorate linker option. Override by GppLinker to
- * prepend a "-Wl," to pass option to through gcc to linker.
- *
- * @param buf
- * buffer that may be used and abused in the decoration process,
- * must not be null.
- * @param arg
- * linker argument
- */
- public String decorateLinkerOption(StringBuffer buf, String arg) {
- String decoratedArg = arg;
- if (arg.length() > 1 && arg.charAt(0) == '-') {
- switch (arg.charAt(1)) {
- //
- // passed automatically by GCC
- //
- case 'g' :
- case 'f' :
- case 'F' :
- /* Darwin */
- case 'm' :
- case 'O' :
- case 'W' :
- case 'l' :
- case 'L' :
- case 'u' :
- break;
- default :
- boolean known = false;
- for (int i = 0; i < linkerOptions.length; i++) {
- if (linkerOptions[i].equals(arg)) {
- known = true;
- break;
- }
- }
- if (!known) {
- buf.setLength(0);
- buf.append("-Wl,");
- buf.append(arg);
- decoratedArg = buf.toString();
- }
- break;
- }
- }
- return decoratedArg;
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- Vector dirs = new Vector();
- // Ask GCC where it will look for its libraries.
- String[] args = new String[]{GccCCompiler.CMD_PREFIX + "g++",
- "-print-search-dirs"};
- String[] cmdout = CaptureStreamHandler.run(args);
- for (int i = 0; i < cmdout.length; ++i) {
- int prefixIndex = cmdout[i].indexOf(libPrefix);
- if (prefixIndex >= 0) {
- // Special case DOS-type GCCs like MinGW or Cygwin
- int s = prefixIndex + libPrefix.length();
- int t = cmdout[i].indexOf(';', s);
- while (t > 0) {
- dirs.addElement(cmdout[i].substring(s, t));
- s = t + 1;
- t = cmdout[i].indexOf(';', s);
- }
- dirs.addElement(cmdout[i].substring(s));
- ++i;
- for (; i < cmdout.length; ++i) {
- dirs.addElement(cmdout[i]);
- }
- }
- }
- // Eliminate all but actual directories.
- String[] libpath = new String[dirs.size()];
- dirs.copyInto(libpath);
- int count = CUtil.checkDirectoryArray(libpath);
- // Build return array.
- libDirs = new File[count];
- int index = 0;
- for (int i = 0; i < libpath.length; ++i) {
- if (libpath[i] != null) {
- libDirs[index++] = new File(libpath[i]);
- }
- }
- }
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isPluginModule()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machPluginLinker;
- } else {
- return dllLinker;
- }
- }
- if (type.isSharedLibrary()) {
- if (GccProcessor.getMachine().indexOf("darwin") >= 0) {
- return machDllLinker;
- } else {
- return dllLinker;
- }
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/LdLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/LdLinker.java
deleted file mode 100644
index fc7761e87c..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/gcc/cross/sparc_sun_solaris2/LdLinker.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.gcc.cross.sparc_sun_solaris2;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-/**
- * Adapter for the 'ld' linker
- *
- * @author Curt Arnold
- */
-public final class LdLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final LdLinker dllLinker = new LdLinker(
- GccCCompiler.CMD_PREFIX + "ld", objFiles, discardFiles, "lib",
- ".so", false, new LdLinker(GccCCompiler.CMD_PREFIX + "ld",
- objFiles, discardFiles, "lib", ".so", true, null));
- private static final LdLinker instance = new LdLinker(
- GccCCompiler.CMD_PREFIX + "ld", objFiles, discardFiles, "", "",
- false, null);
- public static LdLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private LdLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix,
- String outputSuffix, boolean isLibtool, LdLinker libtoolLinker) {
- super(command, "-version", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, isLibtool, libtoolLinker);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java
deleted file mode 100644
index 951bfc1a75..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCCompiler.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.hp;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the HP aC++ C++ compiler
- *
- * @author Curt Arnold
- */
-public final class aCCCompiler extends GccCompatibleCCompiler {
- private static final aCCCompiler instance = new aCCCompiler("aCC", false,
- null);
- /**
- * Gets singleton instance of this class
- */
- public static aCCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- /**
- * Private constructor. Use GccCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- private aCCCompiler(String command, boolean newEnvironment, Environment env) {
- super(command, "-help", false, null, newEnvironment, env);
- }
- public void addImpliedArgs(Vector args, boolean debug,
- boolean multithreaded, boolean exceptions, LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization) {
- args.addElement("-c");
- if (debug) {
- args.addElement("-g");
- }
- /*
- * if (multithreaded) { args.addElement("-mt"); }
- */
- if (linkType.isSharedLibrary()) {
- args.addElement("+z");
- }
- }
- public void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("-w");
- break;
- case 1 :
- case 2 :
- args.addElement("+w");
- break;
- /*
- * case 3: case 4: case 5: args.addElement("+w2"); break;
- */
- }
- }
- public File[] getEnvironmentIncludePath() {
- if (includePath == null) {
- File ccLoc = CUtil.getExecutableLocation("aCC");
- if (ccLoc != null) {
- File compilerIncludeDir = new File(
- new File(ccLoc, "../include").getAbsolutePath());
- if (compilerIncludeDir.exists()) {
- includePath = new File[2];
- includePath[0] = compilerIncludeDir;
- }
- }
- if (includePath == null) {
- includePath = new File[1];
- }
- includePath[includePath.length - 1] = new File("/usr/include");
- }
- return includePath;
- }
- public Linker getLinker(LinkType linkType) {
- return aCCLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCLinker.java
deleted file mode 100644
index 86b22e0522..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/hp/aCCLinker.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.hp;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-/**
- * Adapter for Sun (r) Forte(tm) C++ Linker
- *
- * @author Curt Arnold
- */
-public final class aCCLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final aCCLinker arLinker = new aCCLinker("aCC", objFiles,
- discardFiles, "", ".a");
- private static final aCCLinker dllLinker = new aCCLinker("aCC", objFiles,
- discardFiles, "lib", ".sl");
- private static final aCCLinker instance = new aCCLinker("aCC", objFiles,
- discardFiles, "", "");
- public static aCCLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private aCCLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix, String outputSuffix) {
- super(command, "-help", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, false, null);
- }
- public void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
- if (debug) {
- args.addElement("-g");
- }
- /*
- * if(linkType.isStaticRuntime()) { args.addElement("-static"); }
- */
- if (linkType.isSharedLibrary()) {
- args.addElement("-b");
- }
- /*
- * if (linkType.isStaticLibrary()) { args.addElement("-Wl,-noshared"); }
- */
- }
- public void addIncremental(boolean incremental, Vector args) {
- /*
- * if (incremental) { args.addElement("-xidlon"); } else {
- * args.addElement("-xidloff"); }
- */
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- File CCloc = CUtil.getExecutableLocation("aCC");
- if (CCloc != null) {
- File compilerLib = new File(new File(CCloc, "../lib")
- .getAbsolutePath());
- if (compilerLib.exists()) {
- libDirs = new File[2];
- libDirs[0] = compilerLib;
- }
- }
- if (libDirs == null) {
- libDirs = new File[1];
- }
- }
- libDirs[libDirs.length - 1] = new File("/usr/lib");
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return arLinker;
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java
deleted file mode 100644
index f181c0e3af..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeCCompiler.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.ibm;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the IBM(r) Visual Age(tm) C++ compiler for AIX(tm)
- *
- * @author Curt Arnold
- */
-public final class VisualAgeCCompiler extends GccCompatibleCCompiler {
- private static final VisualAgeCCompiler instance = new VisualAgeCCompiler(
- "xlC", false, null);
- /**
- * Gets singleton instance of this class
- */
- public static VisualAgeCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- /**
- * Private constructor. Use getInstance() to get singleton instance of this
- * class.
- */
- private VisualAgeCCompiler(String command, boolean newEnvironment,
- Environment env) {
- super(command, "-help", false, null, newEnvironment, env);
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization) {
- args.addElement("-c");
- if (debug) {
- args.addElement("-g");
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("-fpic");
- }
- if (rtti != null) {
- if (rtti.booleanValue()) {
- args.addElement("-qrtti=all");
- } else {
- args.addElement("-qnortti");
- }
- }
- }
- public void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("-w");
- break;
- case 1 :
- args.addElement("-qflag=s:s");
- break;
- case 2 :
- args.addElement("-qflag=e:e");
- break;
- case 3 :
- args.addElement("-qflag=w:w");
- break;
- case 4 :
- args.addElement("-qflag=i:i");
- break;
- case 5 :
- args.addElement("-qhalt=w:w");
- break;
- }
- }
- public Linker getLinker(LinkType linkType) {
- return VisualAgeLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- /**
- * Gets identifier for the compiler.
- *
- * Initial attempt at extracting version information
- * would lock up. Using a stock response.
- */
- public String getIdentifier() {
- return "VisualAge compiler - unidentified version";
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java
deleted file mode 100644
index f0a811b4ea..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.ibm;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;
-/**
- * Adapter for IBM(r) Visual Age(tm) Linker for AIX(tm)
- *
- * @author Curt Arnold
- */
-public final class VisualAgeLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[]{};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final VisualAgeLinker dllLinker = new VisualAgeLinker(
- "makeC++SharedLib", objFiles, discardFiles, "lib", ".so");
- private static final VisualAgeLinker instance = new VisualAgeLinker("xlC",
- objFiles, discardFiles, "", "");
- public static VisualAgeLinker getInstance() {
- return instance;
- }
- private VisualAgeLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix, String outputSuffix) {
- //
- // just guessing that -? might display something useful
- //
- super(command, "-?", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, false, null);
- }
- public void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
- if (debug) {
- //args.addElement("-g");
- }
- if (linkType.isSharedLibrary()) {
- //args.addElement("-G");
- }
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
- /**
- * Gets identifier for the compiler.
- *
- * Initial attempt at extracting version information
- * would lock up. Using a stock response.
- */
- public String getIdentifier() {
- return "VisualAge linker - unidentified version";
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java
deleted file mode 100644
index 65402f41fb..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32CCompiler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Intel (r) C/C++ compiler for IA-32 Linux (r)
- *
- * The Intel (r) C/C++ compiler for IA32 Linux mimics the command options for
- * gcc compiler.
- *
- * @author Curt Arnold
- */
-public final class IntelLinux32CCompiler extends GccCompatibleCCompiler {
- private static final IntelLinux32CCompiler instance = new IntelLinux32CCompiler(
- false, new IntelLinux32CCompiler(true, null, false, null), false,
- null);
- public static IntelLinux32CCompiler getInstance() {
- return instance;
- }
- private IntelLinux32CCompiler(boolean isLibtool,
- IntelLinux32CCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super("icc", "-V", isLibtool, libtoolCompiler, newEnvironment, env);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new IntelLinux32CCompiler(getLibtool(),
- (IntelLinux32CCompiler) getLibtoolCompiler(),
- newEnvironment, env);
- }
- return this;
- }
- public Linker getLinker(LinkType type) {
- return IntelLinux32Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java
deleted file mode 100644
index 268f490ff3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux32Linker.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;
-/**
- * Adapter for the Intel (r) Linker for Linux (r) for IA-32
- *
- * @author Curt Arnold
- */
-public final class IntelLinux32Linker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final IntelLinux32Linker dllLinker = new IntelLinux32Linker(
- "lib", ".so", false, new IntelLinux32Linker("lib", ".so", true,
- null));
- private static final IntelLinux32Linker instance = new IntelLinux32Linker(
- "", "", false, null);
- public static IntelLinux32Linker getInstance() {
- return instance;
- }
- private IntelLinux32Linker(String outputPrefix, String outputSuffix,
- boolean isLibtool, IntelLinux32Linker libtoolLinker) {
- super("icc", "-V", objFiles, discardFiles, outputPrefix, outputSuffix,
- isLibtool, libtoolLinker);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java
deleted file mode 100644
index 5a506e0d85..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64CCompiler.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Intel (r) C/C++ compiler for IA-64 Linux (r)
- *
- * The Intel C/C++ compiler for IA-64 Linux mimics the command options for gcc
- * compiler.
- *
- * @author Curt Arnold
- */
-public final class IntelLinux64CCompiler extends GccCompatibleCCompiler {
- private static final IntelLinux64CCompiler instance = new IntelLinux64CCompiler(
- false, new IntelLinux64CCompiler(true, null, false, null), false,
- null);
- public static IntelLinux64CCompiler getInstance() {
- return instance;
- }
- private IntelLinux64CCompiler(boolean isLibtool,
- IntelLinux64CCompiler libtoolCompiler, boolean newEnvironment,
- Environment env) {
- super("ecc", "-V", isLibtool, libtoolCompiler, newEnvironment, env);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new IntelLinux64CCompiler(getLibtool(),
- (IntelLinux64CCompiler) this.getLibtoolCompiler(),
- newEnvironment, env);
- }
- return this;
- }
- public Linker getLinker(LinkType type) {
- return IntelLinux64Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java
deleted file mode 100644
index f381403510..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelLinux64Linker.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-import net.sf.antcontrib.cpptasks.gcc.GccLibrarian;
-/**
- * Adapter for the Intel (r) linker for Linux for IA-64
- *
- * @author Curt Arnold
- */
-public final class IntelLinux64Linker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[0];
- private static final String[] libtoolObjFiles = new String[]{".fo", ".a",
- ".lib", ".dll", ".so", ".sl"};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib",
- ".dll", ".so", ".sl"};
- private static final IntelLinux64Linker dllLinker = new IntelLinux64Linker(
- "lib", ".so", false, new IntelLinux64Linker("lib", ".so", true,
- null));
- private static final IntelLinux64Linker instance = new IntelLinux64Linker(
- "", "", false, null);
- public static IntelLinux64Linker getInstance() {
- return instance;
- }
- private IntelLinux64Linker(String outputPrefix, String outputSuffix,
- boolean isLibtool, IntelLinux64Linker libtoolLinker) {
- super("ecc", "-V", objFiles, discardFiles, outputPrefix, outputSuffix,
- isLibtool, libtoolLinker);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return GccLibrarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java
deleted file mode 100644
index d1b4eafec5..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelProcessor.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioProcessor;
-/**
- * A add-in class for Intel (r) compilers and linkers
- *
- *
- */
-public class IntelProcessor {
- public static void addWarningSwitch(Vector args, int level) {
- DevStudioProcessor.addWarningSwitch(args, level);
- }
- public static String getCommandFileSwitch(String cmdFile) {
- return DevStudioProcessor.getCommandFileSwitch(cmdFile);
- }
- public static void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- DevStudioProcessor.getDefineSwitch(buffer, define, value);
- }
- public static String getIncludeDirSwitch(String includeDir) {
- return DevStudioProcessor.getIncludeDirSwitch(includeDir);
- }
- public static String[] getOutputFileSwitch(String outPath) {
- return DevStudioProcessor.getOutputFileSwitch(outPath);
- }
- public static void getUndefineSwitch(StringBuffer buffer, String define) {
- DevStudioProcessor.getUndefineSwitch(buffer, define);
- }
- public static boolean isCaseSensitive() {
- return false;
- }
- private IntelProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Aslcompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Aslcompiler.java
deleted file mode 100644
index 5255cb90ce..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Aslcompiler.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineAslcompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioLinker;
-/**
- * Adapter for Intel ASL compiler
- *
- */
-public final class IntelWin32Aslcompiler extends CommandLineAslcompiler{
- private final static String[] sourceExtensions = new String[]{".asl"};
- private final static String[] headerExtensions = new String[]{};
- private final static String[] defaultflags = new String[]{};
- private static final IntelWin32Aslcompiler instance = new IntelWin32Aslcompiler("iasl",
- sourceExtensions, headerExtensions, false);
-
- /**
- * Gets gcc adapter
- */
- public static IntelWin32Aslcompiler getInstance() {
- return instance;
- }
-
- /**
- * Private constructor. Use GccAssembler.getInstance() to get singleton
- * instance of this class.
- */
- private IntelWin32Aslcompiler(String command, String[] sourceExtensions,
- String[] headerExtensions, boolean isLibtool){
- super(command, null, sourceExtensions, headerExtensions,
- ".aml");
- }
- public void addImpliedArgs(Vector args, boolean debug,
- Boolean defaultflag){
- if (defaultflag != null && defaultflag.booleanValue()) {
- for (int i = 0; i < defaultflags.length; i++) {
- args.addElement(defaultflags[i]);
- }
- }
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- public Linker getLinker(LinkType linkType) {
- return DevStudioLinker.getInstance().getLinker(linkType);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java
deleted file mode 100644
index 7aef79999f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32CCompiler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleCCompiler;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Intel (r) C++ compiler for 32-bit applications
- *
- * The Intel (r) C++ compiler for IA32 Windows mimics the command options for
- * the Microsoft (r) C++ compiler.
- *
- * @author Curt Arnold
- */
-public final class IntelWin32CCompiler extends DevStudioCompatibleCCompiler {
- private static final IntelWin32CCompiler instance = new IntelWin32CCompiler(
- false, null);
- public static IntelWin32CCompiler getInstance() {
- return instance;
- }
- private IntelWin32CCompiler(boolean newEnvironment, Environment env) {
- super("icl", null, newEnvironment, env);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new IntelWin32CCompiler(newEnvironment, env);
- }
- return this;
- }
- public Linker getLinker(LinkType type) {
- return IntelWin32Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java
deleted file mode 100644
index e83da1ce0b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Librarian.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLibrarian;
-/**
- * Adapter for the xilib from the Intel(r) C++ Compiler for IA-32 or IA-64
- * systems running Microsoft (r) operating systems
- *
- * @author Curt Arnold
- */
-public class IntelWin32Librarian extends DevStudioCompatibleLibrarian {
- private static final IntelWin32Librarian instance = new IntelWin32Librarian();
- public static IntelWin32Librarian getInstance() {
- return instance;
- }
- protected IntelWin32Librarian() {
- super("xilib", "/bogus");
- }
- public Linker getLinker(LinkType type) {
- return IntelWin32Linker.getInstance().getLinker(type);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java
deleted file mode 100644
index 51258e23ca..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin32Linker.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleLinker;
-/**
- * Adapter for the Intel (r) linker for 32-bit applications
- *
- * @author Curt Arnold
- */
-public final class IntelWin32Linker extends DevStudioCompatibleLinker {
- private static final IntelWin32Linker dllLinker = new IntelWin32Linker(
- ".dll");
- private static final IntelWin32Linker instance = new IntelWin32Linker(
- ".exe");
- public static IntelWin32Linker getInstance() {
- return instance;
- }
- private IntelWin32Linker(String outputSuffix) {
- super("xilink", "/bogus", outputSuffix);
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return IntelWin32Librarian.getInstance();
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java
deleted file mode 100644
index 9b8d2c9db4..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/intel/IntelWin64CCompiler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.intel;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.devstudio.DevStudioCompatibleCCompiler;
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Intel C++ compiler for Itanium(TM) Applications
- *
- * @author Curt Arnold
- */
-public final class IntelWin64CCompiler extends DevStudioCompatibleCCompiler {
- private static final IntelWin64CCompiler instance = new IntelWin64CCompiler(
- false, null);
- public static IntelWin64CCompiler getInstance() {
- return instance;
- }
- private IntelWin64CCompiler(boolean newEnvironment, Environment env) {
- super("ecl", null, newEnvironment, env);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new IntelWin64CCompiler(newEnvironment, env);
- }
- return this;
- }
- public Linker getLinker(LinkType type) {
- //
- // currently the Intel Win32 and Win64 linkers
- // are command line equivalent
- return IntelWin32Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return 1024;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390CCompiler.java
deleted file mode 100644
index 633b55ec0c..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390CCompiler.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os390;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.CompilerDef;
-import net.sf.antcontrib.cpptasks.compiler.AbstractCompiler;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.types.DefineArgument;
-import net.sf.antcontrib.cpptasks.types.UndefineArgument;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the IBM (R) OS/390 (tm) C++ Compiler
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class OS390CCompiler extends CommandLineCCompiler {
- private static final AbstractCompiler instance = new OS390CCompiler(false,
- null);
- public static AbstractCompiler getInstance() {
- return instance;
- }
- private OS390CCompiler(boolean newEnvironment, Environment env) {
- super("cxx", null, new String[]{".c", ".cc", ".cpp", ".cxx", ".c++",
- ".s"}, new String[]{".h", ".hpp"}, ".o", false, null,
- newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- // Specifies that only compilations and assemblies be done.
- // Link-edit is not done
- args.addElement("-c");
- args.addElement("-W");
- args.addElement("c,NOEXPMAC,NOSHOWINC");
- /*
- * if (exceptions) { args.addElement("/GX"); }
- */
- if (debug) {
- args.addElement("-g");
- args.addElement("-D");
- args.addElement("_DEBUG");
- /*
- * if (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MTd"); } else { args.addElement("/MDd");
- * args.addElement("/D_DLL"); } } else { args.addElement("/MLd"); }
- */
- } else {
- args.addElement("-D");
- args.addElement("NEBUG");
- /*
- * if (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MT"); } else { args.addElement("/MD");
- * args.addElement("/D_DLL"); } } else { args.addElement("/ML"); }
- */
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- OS390Processor.addWarningSwitch(args, level);
- }
- /**
- * The buildDefineArguments implementation CommandLineCCompiler is not good
- * for us because os390 defines are give by -D definex instead of
- * /Ddefinex, 2 args not 1! since we implement this ourslefs, we do not
- * have to implement the getDefineSwitch() and the getUndefineSwitch().
- */
- protected void buildDefineArguments(CompilerDef[] defs, Vector args) {
- //
- // assume that we aren't inheriting defines from containing <cc>
- //
- UndefineArgument[] merged = defs[0].getActiveDefines();
- for (int i = 1; i < defs.length; i++) {
- //
- // if we are inheriting, merge the specific defines with the
- // containing defines
- merged = DefineArgument.merge(defs[i].getActiveDefines(), merged);
- }
- StringBuffer buf = new StringBuffer(30);
- for (int i = 0; i < merged.length; i++) {
- buf.setLength(0);
- UndefineArgument current = merged[i];
- if (current.isDefine()) {
- args.addElement("-D");
- buf.append(current.getName());
- if (current.getValue() != null
- && current.getValue().length() > 0) {
- buf.append('=');
- buf.append(current.getValue());
- }
- args.addElement(buf.toString());
- } else {
- args.addElement("-U");
- args.addElement(current.getName());
- }
- }
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new OS390CCompiler(newEnvironment, env);
- }
- return this;
- }
- /*
- * @see CommandLineCompiler#getDefineSwitch(StringBuffer, String, String)
- */
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ":");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return OS390Processor.getIncludeDirSwitch(includeDir);
- }
- public Linker getLinker(LinkType type) {
- return OS390Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- /* Only compile one file at time for now */
- protected int getMaximumInputFilesPerCommand() {
- return Integer.MAX_VALUE;
- }
- /*
- * @see CommandLineCompiler#getUndefineSwitch(StringBuffer, String)
- */
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Linker.java
deleted file mode 100644
index f6653b7be4..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Linker.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os390;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the IBM (R) OS/390 (tm) Linker
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public final class OS390Linker extends CommandLineLinker {
- private static final OS390Linker datasetLinker = new OS390Linker();
- private static final OS390Linker dllLinker = new OS390Linker("", ".dll");
- private static final OS390Linker instance = new OS390Linker("", "");
- public static OS390Linker getDataSetInstance() {
- return datasetLinker;
- }
- public static OS390Linker getInstance() {
- return instance;
- }
- private boolean isADatasetLinker;
- File outputFile;
- private String outputPrefix;
- CCTask task;
- private OS390Linker() {
- super("cxx", "/bogus", new String[]{".o", ".a", ".lib", ".xds"},
- new String[]{".dll", ".x"}, ".xds", false, null);
- this.outputPrefix = "";
- this.isADatasetLinker = true;
- }
- private OS390Linker(String outputPrefix, String outputSuffix) {
- super("cxx", "/bogus", new String[]{".o", ".a", ".lib", ".x"},
- new String[]{".dll"}, outputSuffix, false, null);
- this.outputPrefix = outputPrefix;
- this.isADatasetLinker = false;
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (linkType.isSharedLibrary()) {
- args.addElement("-W");
- args.addElement("l,DLL");
- }
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- /*
- * @see CommandLineLinker#addLibrarySets(LibrarySet[], Vector, Vector,
- * Vector)
- */
- protected String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- // If yo want to link against a library sitting in a dataset and
- // not in the HFS, you can just use the //'dataset' notation
- // to specify it. e.g:
- // <libset dir="." libs="//'MQM.V5R2M0.SCSQLOAD'"/>
- //
- // We have to have special handling here because the file is not
- // on the normal filesystem so the task will not noramly include it
- // as part of the link command.
- if (libsets != null) {
- for (int i = 0; i < libsets.length; i++) {
- String libs[] = libsets[i].getLibs();
- for (int j = 0; j < libs.length; j++) {
- if (libs[j].startsWith("//")) {
- endargs.addElement("-l");
- endargs.addElement(libs[j]);
- } else if (libsets[i].getDataset() != null) {
- String ds = libsets[i].getDataset();
- endargs.addElement("//'" + ds + "(" + libs[j] + ")'");
- }
- }
- }
- }
- return super.addLibrarySets(task, libsets, preargs, midargs, endargs);
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- protected void addEntry(String entry, Vector args) {
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("LIB", ";");
- }
-
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length * 3];
- int offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- offset = addLibraryPatterns(libnames, buf, "", ".x", patterns, offset);
- offset = addLibraryPatterns(libnames, buf, "", ".o", patterns, offset);
- return patterns;
- }
-
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
-
- public Linker getLinker(LinkType linkType) {
- if (this == datasetLinker)
- return datasetLinker;
- if (linkType.isSharedLibrary())
- return dllLinker;
- return instance;
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- public String getOutputFileName(String baseName) {
- return outputPrefix + super.getOutputFileName(baseName);
- }
- protected String[] getOutputFileSwitch(CCTask task, String outputFile) {
- if (isADatasetLinker && task.getDataset() != null) {
- String ds = task.getDataset();
- outputFile = "//'" + ds + "(" + outputFile + ")'";
- }
- return getOutputFileSwitch(outputFile);
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-o", outputFile};
- }
- public boolean isCaseSensitive() {
- return OS390Processor.isCaseSensitive();
- }
- /*
- * @see CommandLineLinker#link(Task, File, String[],
- * CommandLineLinkerConfiguration)
- */
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- this.task = task;
- this.outputFile = outputFile;
- if (isADatasetLinker) {
- int p = outputFile.getName().indexOf(".");
- if (p >= 0) {
- String newname = outputFile.getName().substring(0, p);
- outputFile = new File(outputFile.getParent(), newname);
- }
- }
- super.link(task, outputFile, sourceFiles, config);
- }
- /*
- * @see CommandLineLinker#runCommand(Task, File, String[])
- */
- protected int runCommand(CCTask task, File workingDir, String[] cmdline)
- throws BuildException {
- int rc = super.runCommand(task, workingDir, cmdline);
- // create the .xds file if everything was ok.
- if (rc == 0) {
- try {
- outputFile.delete();
- new FileOutputStream(outputFile).close();
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- }
- }
- return rc;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Processor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Processor.java
deleted file mode 100644
index 2c209dd6bb..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os390/OS390Processor.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os390;
-import java.util.Vector;
-/**
- * A add-in class for IBM (r) OS/390 compilers and linkers
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class OS390Processor {
- public static void addWarningSwitch(Vector args, int level) {
- switch (level) {
- /*
- * case 0: args.addElement("/W0"); break;
- *
- * case 1: args.addElement("/W1"); break;
- *
- * case 2: break;
- *
- * case 3: args.addElement("/W3"); break;
- *
- * case 4: args.addElement("/W4"); break;
- */
- }
- }
- public static String getCommandFileSwitch(String cmdFile) {
- StringBuffer buf = new StringBuffer("@");
- if (cmdFile.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(cmdFile);
- buf.append('\"');
- } else {
- buf.append(cmdFile);
- }
- return buf.toString();
- }
- public static String getIncludeDirSwitch(String includeDir) {
- return "-I" + includeDir;
- }
- public static String[] getOutputFileSwitch(String outPath) {
- StringBuffer buf = new StringBuffer("-o ");
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- String[] retval = new String[]{buf.toString()};
- return retval;
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- private OS390Processor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccCompiler.java
deleted file mode 100644
index f40858f71b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccCompiler.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os400;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.AbstractCompiler;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the IBM (R) OS/390 (tm) C++ Compiler
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class IccCompiler extends CommandLineCCompiler {
- private static final AbstractCompiler instance = new IccCompiler(false,
- null);
- public static AbstractCompiler getInstance() {
- return instance;
- }
- private IccCompiler(boolean newEnvironment, Environment env) {
- super("icc", null, new String[]{".c", ".cc", ".cpp", ".cxx", ".c++",
- ".s"}, new String[]{".h", ".hpp"}, ".o", false, null,
- newEnvironment, env);
- }
- protected void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- // Specifies that only compilations and assemblies be done.
- // Link-edit is not done
- args.addElement("-c");
- /*
- * if (exceptions) { args.addElement("/GX"); }
- */
- if (debug) {
- args.addElement("-g");
- /*
- * args.addElement("-D"); args.addElement("_DEBUG"); if
- * (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MTd"); } else { args.addElement("/MDd");
- * args.addElement("/D_DLL"); } } else { args.addElement("/MLd"); }
- */
- } else {
- /*
- * args.addElement("-D"); args.addElement("NEBUG"); if
- * (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MT"); } else { args.addElement("/MD");
- * args.addElement("/D_DLL"); } } else { args.addElement("/ML"); }
- */
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- IccProcessor.addWarningSwitch(args, level);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new IccCompiler(newEnvironment, env);
- }
- return this;
- }
- /*
- * @see CommandLineCompiler#getDefineSwitch(StringBuffer, String, String)
- */
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("-q");
- buffer.append(define);
- if (value != null && value.length() > 0) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ":");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return IccProcessor.getIncludeDirSwitch(includeDir);
- }
- public Linker getLinker(LinkType type) {
- return IccLinker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- /* Only compile one file at time for now */
- protected int getMaximumInputFilesPerCommand() {
- return 1;
- //return Integer.MAX_VALUE;
- }
- /*
- * @see CommandLineCompiler#getUndefineSwitch(StringBuffer, String)
- */
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- /*
- * buffer.addElement("-q"); buf.append(define);
- */
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccLinker.java
deleted file mode 100644
index 5e4e2f229a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccLinker.java
+++ /dev/null
@@ -1,202 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os400;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-import org.apache.tools.ant.BuildException;
-/**
- * Adapter for the IBM (R) OS/390 (tm) Linker
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public final class IccLinker extends CommandLineLinker {
- private static final IccLinker datasetLinker = new IccLinker();
- private static final IccLinker dllLinker = new IccLinker("", ".dll");
- private static final IccLinker instance = new IccLinker("", "");
- public static IccLinker getDataSetInstance() {
- return datasetLinker;
- }
- public static IccLinker getInstance() {
- return instance;
- }
- private boolean isADatasetLinker;
- File outputFile;
- private String outputPrefix;
- CCTask task;
- private IccLinker() {
- super("icc", "/bogus", new String[]{".o", ".a", ".lib", ".xds"},
- new String[]{".dll", ".x"}, ".xds", false, null);
- this.outputPrefix = "";
- this.isADatasetLinker = true;
- }
- private IccLinker(String outputPrefix, String outputSuffix) {
- super("icc", "/bogus", new String[]{".o", ".a", ".lib", ".x"},
- new String[]{".dll"}, outputSuffix, false, null);
- this.outputPrefix = outputPrefix;
- this.isADatasetLinker = false;
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (linkType.isSharedLibrary()) {
- args.addElement("-W");
- args.addElement("l,DLL");
- }
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- /*
- * @see CommandLineLinker#addLibrarySets(LibrarySet[], Vector, Vector,
- * Vector)
- */
- protected String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- // If yo want to link against a library sitting in a dataset and
- // not in the HFS, you can just use the //'dataset' notation
- // to specify it. e.g:
- // <libset dir="." libs="//'MQM.V5R2M0.SCSQLOAD'"/>
- //
- // We have to have special handling here because the file is not
- // on the normal filesystem so the task will not noramly include it
- // as part of the link command.
- if (libsets != null) {
- for (int i = 0; i < libsets.length; i++) {
- String libs[] = libsets[i].getLibs();
- for (int j = 0; j < libs.length; j++) {
- if (libs[j].startsWith("//")) {
- endargs.addElement("-l");
- endargs.addElement(libs[j]);
- } else if (libsets[i].getDataset() != null) {
- String ds = libsets[i].getDataset();
- endargs.addElement("//'" + ds + "(" + libs[j] + ")'");
- }
- }
- }
- }
- return super.addLibrarySets(task, libsets, preargs, midargs, endargs);
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("LIB", ";");
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- String[] patterns = new String[libnames.length * 3];
- int offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- offset = addLibraryPatterns(libnames, buf, "", ".x", patterns, offset);
- offset = addLibraryPatterns(libnames, buf, "", ".o", patterns, offset);
- return patterns;
- }
-
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
-
-
- public Linker getLinker(LinkType linkType) {
- if (this == datasetLinker)
- return datasetLinker;
- if (linkType.isSharedLibrary())
- return dllLinker;
- return instance;
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- protected String[] getOutputFileSwitch(CCTask task, String outputFile) {
- if (isADatasetLinker && task.getDataset() != null) {
- String ds = task.getDataset();
- outputFile = "//'" + ds + "(" + outputFile + ")'";
- }
- return getOutputFileSwitch(outputFile);
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-o", outputFile};
- }
- public boolean isCaseSensitive() {
- return IccProcessor.isCaseSensitive();
- }
- /*
- * @see CommandLineLinker#link(Task, File, String[],
- * CommandLineLinkerConfiguration)
- */
- public void link(CCTask task, File outputFile, String[] sourceFiles,
- CommandLineLinkerConfiguration config) throws BuildException {
- this.task = task;
- this.outputFile = outputFile;
- if (isADatasetLinker) {
- int p = outputFile.getName().indexOf(".");
- if (p >= 0) {
- String newname = outputFile.getName().substring(0, p);
- outputFile = new File(outputFile.getParent(), newname);
- }
- }
- super.link(task, outputFile, sourceFiles, config);
- }
- /*
- * @see CommandLineLinker#runCommand(Task, File, String[])
- */
- protected int runCommand(CCTask task, File workingDir, String[] cmdline)
- throws BuildException {
- int rc = super.runCommand(task, workingDir, cmdline);
- // create the .xds file if everything was ok.
- if (rc == 0) {
- try {
- outputFile.delete();
- new FileOutputStream(outputFile).close();
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- }
- }
- return rc;
- }
- public String xgetOutputFileName(String baseName) {
- return outputPrefix + super.getOutputFileName(baseName);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccProcessor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccProcessor.java
deleted file mode 100644
index 4cc7b36ab3..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/os400/IccProcessor.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.os400;
-import java.util.Vector;
-/**
- * A add-in class for IBM (r) OS/390 compilers and linkers
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class IccProcessor {
- public static void addWarningSwitch(Vector args, int level) {
- switch (level) {
- /*
- * case 0: args.addElement("/W0"); break;
- *
- * case 1: args.addElement("/W1"); break;
- *
- * case 2: break;
- *
- * case 3: args.addElement("/W3"); break;
- *
- * case 4: args.addElement("/W4"); break;
- */
- }
- }
- public static String getCommandFileSwitch(String cmdFile) {
- StringBuffer buf = new StringBuffer("@");
- if (cmdFile.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(cmdFile);
- buf.append('\"');
- } else {
- buf.append(cmdFile);
- }
- return buf.toString();
- }
- public static String getIncludeDirSwitch(String includeDir) {
- return "-I" + includeDir;
- }
- public static String[] getOutputFileSwitch(String outPath) {
- StringBuffer buf = new StringBuffer("-o ");
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- String[] retval = new String[]{buf.toString()};
- return retval;
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- private IccProcessor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParser.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParser.java
deleted file mode 100644
index 6f0b79c072..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParser.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-import java.io.IOException;
-import java.io.Reader;
-/**
- * An abstract base class for simple parsers
- *
- * @author Curt Arnold
- */
-public abstract class AbstractParser {
- /**
- *
- *
- */
- protected AbstractParser() {
- }
- protected abstract void addFilename(String filename);
- public abstract AbstractParserState getNewLineState();
- protected void parse(Reader reader) throws IOException {
- char[] buf = new char[4096];
- AbstractParserState newLineState = getNewLineState();
- AbstractParserState state = newLineState;
- int charsRead = -1;
- do {
- charsRead = reader.read(buf, 0, buf.length);
- if (state == null) {
- for (int i = 0; i < charsRead; i++) {
- if (buf[i] == '\n') {
- state = newLineState;
- break;
- }
- }
- }
- if (state != null) {
- for (int i = 0; i < charsRead; i++) {
- state = state.consume(buf[i]);
- //
- // didn't match a production, skip to a new line
- //
- if (state == null) {
- for (; i < charsRead; i++) {
- if (buf[i] == '\n') {
- state = newLineState;
- break;
- }
- }
- }
- }
- }
- } while (charsRead >= 0);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParserState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParserState.java
deleted file mode 100644
index fe66dbbef0..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/AbstractParserState.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-/**
- * An base class for objects that represent the state of an AbstractParser.
- *
- * @author CurtArnold
- * @see AbstractParser
- */
-public abstract class AbstractParserState {
- private AbstractParser parser;
- protected AbstractParserState(AbstractParser parser) {
- if (parser == null) {
- throw new NullPointerException("parser");
- }
- this.parser = parser;
- }
- /**
- * Consume a character
- *
- * @return new state, may be null to ignore the rest of the line
- */
- public abstract AbstractParserState consume(char ch);
- protected AbstractParser getParser() {
- return parser;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/BranchState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/BranchState.java
deleted file mode 100644
index 370c7d5836..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/BranchState.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-public class BranchState extends AbstractParserState {
- private char[] branchChars;
- private AbstractParserState[] branchStates;
- private AbstractParserState noMatchState;
- public BranchState(AbstractParser parser, char[] branchChars,
- AbstractParserState[] branchStates, AbstractParserState noMatchState) {
- super(parser);
- this.branchChars = (char[]) branchChars.clone();
- this.branchStates = (AbstractParserState[]) branchStates.clone();
- this.noMatchState = noMatchState;
- }
- public AbstractParserState consume(char ch) {
- AbstractParserState state;
- for (int i = 0; i < branchChars.length; i++) {
- if (ch == branchChars[i]) {
- state = branchStates[i];
- return state.consume(ch);
- }
- }
- state = getNoMatchState();
- if (state != null) {
- return state.consume(ch);
- }
- return state;
- }
- protected AbstractParserState getNoMatchState() {
- return noMatchState;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CParser.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CParser.java
deleted file mode 100644
index 07f8eba4e2..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CParser.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Vector;
-/**
- * A parser that extracts #include statements from a Reader.
- *
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public final class CParser extends AbstractParser implements Parser {
- private final Vector includes = new Vector();
- private AbstractParserState newLineState;
- /**
- *
- *
- */
- public CParser() {
- AbstractParserState quote = new FilenameState(this, new char[]{'"'});
- AbstractParserState bracket = new FilenameState(this, new char[]{'>'});
- AbstractParserState postE = new PostE(this, bracket, quote);
- //
- // nclude
- //
- AbstractParserState e = new LetterState(this, 'e', postE, null);
- AbstractParserState d = new LetterState(this, 'd', e, null);
- AbstractParserState u = new LetterState(this, 'u', d, null);
- AbstractParserState l = new LetterState(this, 'l', u, null);
- AbstractParserState c = new LetterState(this, 'c', l, null);
- AbstractParserState n = new LetterState(this, 'n', c, null);
- //
- // mport is equivalent to nclude
- //
- AbstractParserState t = new LetterState(this, 't', postE, null);
- AbstractParserState r = new LetterState(this, 'r', t, null);
- AbstractParserState o = new LetterState(this, 'o', r, null);
- AbstractParserState p = new LetterState(this, 'p', o, null);
- AbstractParserState m = new LetterState(this, 'm', p, null);
- //
- // switch between
- //
- AbstractParserState n_m = new BranchState(this, new char[]{'n', 'm'},
- new AbstractParserState[]{n, m}, null);
- AbstractParserState i = new WhitespaceOrLetterState(this, 'i', n_m);
- newLineState = new LetterState(this, '#', i, null);
- }
- public void addFilename(String include) {
- includes.addElement(include);
- }
- public String[] getIncludes() {
- String[] retval = new String[includes.size()];
- includes.copyInto(retval);
- return retval;
- }
- public AbstractParserState getNewLineState() {
- return newLineState;
- }
- public void parse(Reader reader) throws IOException {
- includes.setSize(0);
- super.parse(reader);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CaseInsensitiveLetterState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CaseInsensitiveLetterState.java
deleted file mode 100644
index a86700f166..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/CaseInsensitiveLetterState.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-
-/**
- * This parser state checks consumed characters against a specific character
- * (case insensitive).
- *
- * @author Curt Arnold
- */
-public final class CaseInsensitiveLetterState
- extends AbstractParserState {
- /**
- * Next state if a match is found.
- */
- private final AbstractParserState nextState;
-
- /**
- * Next state if not match is found.
- */
- private final AbstractParserState noMatchState;
-
- /**
- * Lower case version of character to match.
- */
- private final char lowerLetter;
-
- /**
- * Lower case version of character to match.
- */
- private final char upperLetter;
-
- /**
- * Constructor.
- *
- * @param parser
- * parser
- * @param matchLetter
- * letter to match
- * @param nextStateArg
- * next state if a match on the letter
- * @param noMatchStateArg
- * state if no match on letter
- */
- public CaseInsensitiveLetterState(final AbstractParser parser,
- final char matchLetter,
- final AbstractParserState nextStateArg,
- final AbstractParserState noMatchStateArg) {
- super(parser);
- this.lowerLetter = Character.toLowerCase(matchLetter);
- this.upperLetter = Character.toUpperCase(matchLetter);
- this.nextState = nextStateArg;
- this.noMatchState = noMatchStateArg;
- }
-
- /**
- * Consumes a character and returns the next state for the parser.
- *
- * @param ch
- * next character
- * @return the configured nextState if ch is the expected character or the
- * configure noMatchState otherwise.
- */
- public AbstractParserState consume(final char ch) {
- if (ch == lowerLetter || ch == upperLetter) {
- return nextState;
- }
- if (ch == '\n') {
- getParser().getNewLineState();
- }
- return noMatchState;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FilenameState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FilenameState.java
deleted file mode 100644
index f33940b0a7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FilenameState.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-public class FilenameState extends AbstractParserState {
- private final StringBuffer buf = new StringBuffer();
- private final char[] terminators;
- public FilenameState(AbstractParser parser, char[] terminators) {
- super(parser);
- this.terminators = (char[]) terminators.clone();
- }
- public AbstractParserState consume(char ch) {
- for (int i = 0; i < terminators.length; i++) {
- if (ch == terminators[i]) {
- getParser().addFilename(buf.toString());
- buf.setLength(0);
- return null;
- }
- }
- if (ch == '\n') {
- buf.setLength(0);
- return getParser().getNewLineState();
- } else {
- buf.append(ch);
- }
- return this;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FortranParser.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FortranParser.java
deleted file mode 100644
index 261e95ad81..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/FortranParser.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-
-import java.io.IOException;
-import java.io.Reader;
-import java.util.Vector;
-
-/**
- * A parser that extracts INCLUDE statements from a Reader.
- *
- * @author Curt Arnold
- */
-public final class FortranParser
- extends AbstractParser
- implements Parser {
- /**
- * List of included filenames.
- */
- private final Vector includes = new Vector();
-
- /**
- * State that starts consuming content at the beginning of a line.
- */
- private final AbstractParserState newLineState;
-
- /**
- * Default constructor.
- *
- */
- public FortranParser() {
- AbstractParserState filename = new FilenameState(this, new char[] {'\'',
- '/'});
- AbstractParserState apos = new WhitespaceOrLetterState(this, '\'',
- filename);
- AbstractParserState blank = new LetterState(this, ' ', apos, null);
- AbstractParserState e = new CaseInsensitiveLetterState(this, 'E',
- blank, null);
- AbstractParserState d = new CaseInsensitiveLetterState(this, 'D', e,
- null);
- AbstractParserState u = new CaseInsensitiveLetterState(this, 'U', d,
- null);
- AbstractParserState l = new CaseInsensitiveLetterState(this, 'L', u,
- null);
- AbstractParserState c = new CaseInsensitiveLetterState(this, 'C', l,
- null);
- AbstractParserState n = new CaseInsensitiveLetterState(this, 'N', c,
- null);
- newLineState = new WhitespaceOrCaseInsensitiveLetterState(this, 'I', n);
- }
-
- /**
- * Called by FilenameState at completion of file name production.
- *
- * @param include
- * include file name
- */
- public void addFilename(final String include) {
- includes.addElement(include);
- }
-
- /**
- * Gets collection of include file names encountered in parse.
- * @return include file names
- */
- public String[] getIncludes() {
- String[] retval = new String[includes.size()];
- includes.copyInto(retval);
- return retval;
- }
-
- /**
- * Get the state for the beginning of a new line.
- * @return start of line state
- */
- public AbstractParserState getNewLineState() {
- return newLineState;
- }
-
- /**
- * Collects all included files from the content of the reader.
- *
- * @param reader
- * character reader containing a FORTRAN source module
- * @throws IOException
- * throw if I/O error during parse
- */
- public void parse(final Reader reader) throws IOException {
- includes.setSize(0);
- super.parse(reader);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/LetterState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/LetterState.java
deleted file mode 100644
index 945ae91233..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/LetterState.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-
-/**
- * This parser state checks consumed characters against a specific character.
- *
- * @author Curt Arnold
- */
-public final class LetterState
- extends AbstractParserState {
- /**
- * Next state if a match is found.
- */
- private final AbstractParserState nextState;
-
- /**
- * Next state if not match is found.
- */
- private final AbstractParserState noMatchState;
-
- /**
- * Character to match.
- */
- private final char thisLetter;
-
- /**
- * Constructor.
- *
- * @param parser
- * parser
- * @param matchLetter
- * letter to match
- * @param nextStateArg
- * next state if a match on the letter
- * @param noMatchStateArg
- * state if no match on letter
- */
- public LetterState(final AbstractParser parser,
- final char matchLetter,
- final AbstractParserState nextStateArg,
- final AbstractParserState noMatchStateArg) {
- super(parser);
- this.thisLetter = matchLetter;
- this.nextState = nextStateArg;
- this.noMatchState = noMatchStateArg;
- }
-
- /**
- * Consumes a character and returns the next state for the parser.
- *
- * @param ch
- * next character
- * @return the configured nextState if ch is the expected character or the
- * configure noMatchState otherwise.
- */
- public AbstractParserState consume(final char ch) {
- if (ch == thisLetter) {
- return nextState;
- }
- if (ch == '\n') {
- getParser().getNewLineState();
- }
- return noMatchState;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/Parser.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/Parser.java
deleted file mode 100644
index cf759fc7d5..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/Parser.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-import java.io.IOException;
-import java.io.Reader;
-/**
- * A parser that extracts #include statements from a Reader.
- *
- * @author Curt Arnold
- */
-public interface Parser {
- String[] getIncludes();
- void parse(Reader reader) throws IOException;
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/PostE.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/PostE.java
deleted file mode 100644
index fe225fb35a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/PostE.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-public class PostE extends AbstractParserState {
- private AbstractParserState bracket;
- private AbstractParserState quote;
- public PostE(CParser parser, AbstractParserState bracket,
- AbstractParserState quote) {
- super(parser);
- this.bracket = bracket;
- this.quote = quote;
- }
- public AbstractParserState consume(char ch) {
- switch (ch) {
- case ' ' :
- case '\t' :
- return this;
- case '<' :
- return bracket;
- case '"' :
- return quote;
- case '\n' :
- return getParser().getNewLineState();
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrCaseInsensitiveLetterState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrCaseInsensitiveLetterState.java
deleted file mode 100644
index 9d42feeaad..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrCaseInsensitiveLetterState.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-
-/**
- * This parser state checks consumed characters against a specific character
- * (case insensitive) or whitespace.
- *
- * @author Curt Arnold
- */
-public final class WhitespaceOrCaseInsensitiveLetterState
- extends
- AbstractParserState {
- /**
- * Next state if the character is found.
- */
- private final AbstractParserState nextState;
-
- /**
- * Character to match (lower case).
- */
- private final char lowerLetter;
-
- /**
- * Character to match (upper case).
- */
- private final char upperLetter;
-
- /**
- * Constructor.
- *
- * @param parser
- * parser
- * @param matchLetter
- * letter to match
- * @param nextStateArg
- * next state if a match on the letter
- */
- public WhitespaceOrCaseInsensitiveLetterState(final AbstractParser parser,
- final char matchLetter,
- final AbstractParserState
- nextStateArg) {
- super(parser);
- this.lowerLetter = Character.toLowerCase(matchLetter);
- this.upperLetter = Character.toUpperCase(matchLetter);
- this.nextState = nextStateArg;
- }
-
- /**
- * Consumes a character and returns the next state for the parser.
- *
- * @param ch
- * next character
- * @return the configured nextState if ch is the expected character or the
- * configure noMatchState otherwise.
- */
- public AbstractParserState consume(final char ch) {
- if (ch == lowerLetter || ch == upperLetter) {
- return nextState;
- }
- if (ch == ' ' || ch == '\t') {
- return this;
- }
- if (ch == '\n') {
- getParser().getNewLineState();
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrLetterState.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrLetterState.java
deleted file mode 100644
index 824abe6b68..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/parser/WhitespaceOrLetterState.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.parser;
-
-/**
- * This parser state checks consumed characters against a specific character or
- * whitespace.
- *
- * @author Curt Arnold
- */
-public final class WhitespaceOrLetterState
- extends AbstractParserState {
- /**
- * Next state if the character is found.
- */
- private final AbstractParserState nextState;
-
- /**
- * Character to match.
- */
- private final char thisLetter;
-
- /**
- * Constructor.
- *
- * @param parser
- * parser
- * @param matchLetter
- * letter to match
- * @param nextStateArg
- * next state if a match on the letter
- */
- public WhitespaceOrLetterState(final AbstractParser parser,
- final char matchLetter,
- final AbstractParserState nextStateArg) {
- super(parser);
- this.thisLetter = matchLetter;
- this.nextState = nextStateArg;
- }
-
- /**
- * Consumes a character and returns the next state for the parser.
- *
- * @param ch
- * next character @returns the configured nextState if ch is the
- * expected character or the configure noMatchState otherwise.
- * @return next state
- */
- public AbstractParserState consume(final char ch) {
- if (ch == thisLetter) {
- return nextState;
- }
- if (ch == ' ' || ch == '\t') {
- return this;
- }
- if (ch == '\n') {
- getParser().getNewLineState();
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89CCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89CCompiler.java
deleted file mode 100644
index 6679c239dd..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89CCompiler.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.sun;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.AbstractCompiler;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.compiler.Processor;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for the Sun C89 C++ Compiler
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class C89CCompiler extends CommandLineCCompiler {
- private static final AbstractCompiler instance = new C89CCompiler(false,
- null);
- public static AbstractCompiler getInstance() {
- return instance;
- }
- private C89CCompiler(boolean newEnvironment, Environment env) {
- super("c89", null, new String[]{".c", ".cc", ".cpp", ".cxx", ".c++"},
- new String[]{".h", ".hpp"}, ".o", false, null, newEnvironment,
- env);
- }
- protected void addImpliedArgs(
- final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- // Specifies that only compilations and assemblies be done.
- args.addElement("-c");
- /*
- * if (exceptions) { args.addElement("/GX"); }
- */
- if (debug) {
- args.addElement("-g");
- args.addElement("-D_DEBUG");
- /*
- * if (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MTd"); } else { args.addElement("/MDd");
- * args.addElement("/D_DLL"); } } else { args.addElement("/MLd"); }
- */
- } else {
- args.addElement("-DNDEBUG");
- /*
- * if (multithreaded) { args.addElement("/D_MT"); if (staticLink) {
- * args.addElement("/MT"); } else { args.addElement("/MD");
- * args.addElement("/D_DLL"); } } else { args.addElement("/ML"); }
- */
- }
- }
- protected void addWarningSwitch(Vector args, int level) {
- C89Processor.addWarningSwitch(args, level);
- }
- public Processor changeEnvironment(boolean newEnvironment, Environment env) {
- if (newEnvironment || env != null) {
- return new C89CCompiler(newEnvironment, env);
- }
- return this;
- }
- protected void getDefineSwitch(StringBuffer buf, String define, String value) {
- C89Processor.getDefineSwitch(buf, define, value);
- }
- protected File[] getEnvironmentIncludePath() {
- return CUtil.getPathFromEnvironment("INCLUDE", ":");
- }
- protected String getIncludeDirSwitch(String includeDir) {
- return C89Processor.getIncludeDirSwitch(includeDir);
- }
- public Linker getLinker(LinkType type) {
- return C89Linker.getInstance().getLinker(type);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- /* Only compile one file at time for now */
- protected int getMaximumInputFilesPerCommand() {
- return 1;
- }
- protected void getUndefineSwitch(StringBuffer buf, String define) {
- C89Processor.getUndefineSwitch(buf, define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Linker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Linker.java
deleted file mode 100644
index 37b3950bbe..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Linker.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.sun;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for the Sun C89 Linker
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public final class C89Linker extends CommandLineLinker {
- private static final C89Linker dllLinker = new C89Linker("lib", ".so");
- private static final C89Linker instance = new C89Linker("", "");
- public static C89Linker getInstance() {
- return instance;
- }
- private String outputPrefix;
- private C89Linker(String outputPrefix, String outputSuffix) {
- super("ld", "/bogus", new String[]{".o", ".a", ".lib", ".x"},
- new String[]{}, outputSuffix, false, null);
- this.outputPrefix = outputPrefix;
- }
- protected void addBase(long base, Vector args) {
- }
- protected void addFixed(Boolean fixed, Vector args) {
- }
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (linkType.isSharedLibrary()) {
- args.addElement("-G");
- }
- }
- protected void addIncremental(boolean incremental, Vector args) {
- }
- public String[] addLibrarySets(CCTask task, LibrarySet[] libsets,
- Vector preargs, Vector midargs, Vector endargs) {
- super.addLibrarySets(task, libsets, preargs, midargs, endargs);
- StringBuffer buf = new StringBuffer("-l");
- for (int i = 0; i < libsets.length; i++) {
- LibrarySet set = libsets[i];
- File libdir = set.getDir(null);
- String[] libs = set.getLibs();
- if (libdir != null) {
- endargs.addElement("-L");
- endargs.addElement(libdir.getAbsolutePath());
- }
- for (int j = 0; j < libs.length; j++) {
- //
- // reset the buffer to just "-l"
- //
- buf.setLength(2);
- //
- // add the library name
- buf.append(libs[j]);
- //
- // add the argument to the list
- endargs.addElement(buf.toString());
- }
- }
- return null;
- }
- protected void addMap(boolean map, Vector args) {
- }
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- public String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- public File[] getLibraryPath() {
- return CUtil.getPathFromEnvironment("LIB", ";");
- }
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return C89Processor.getLibraryPatterns(libnames, libType);
- }
- public Linker getLinker(LinkType linkType) {
- if (linkType.isSharedLibrary()) {
- return dllLinker;
- }
- /*
- * if(linkType.isStaticLibrary()) { return
- * OS390Librarian.getInstance(); }
- */
- return instance;
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
- public String getOutputFileName(String baseName) {
- return outputPrefix + super.getOutputFileName(baseName);
- }
- public String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-o", outputFile};
- }
- public boolean isCaseSensitive() {
- return C89Processor.isCaseSensitive();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Processor.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Processor.java
deleted file mode 100644
index c54c866966..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/C89Processor.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.sun;
-import java.util.Vector;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * A add-in class for Sun C89 compilers and linkers
- *
- * @author Hiram Chirino (cojonudo14@hotmail.com)
- */
-public class C89Processor {
- private static int addLibraryPatterns(String[] libnames, StringBuffer buf,
- String prefix, String extension, String[] patterns, int offset) {
- for (int i = 0; i < libnames.length; i++) {
- buf.setLength(0);
- buf.append(prefix);
- buf.append(libnames[i]);
- buf.append(extension);
- patterns[offset + i] = buf.toString();
- }
- return offset + libnames.length;
- }
- public static void addWarningSwitch(Vector args, int level) {
- switch (level) {
- /*
- * case 0: args.addElement("/W0"); break;
- *
- * case 1: args.addElement("/W1"); break;
- *
- * case 2: break;
- *
- * case 3: args.addElement("/W3"); break;
- *
- * case 4: args.addElement("/W4"); break;
- */
- }
- }
- public static String getCommandFileSwitch(String cmdFile) {
- StringBuffer buf = new StringBuffer("@");
- if (cmdFile.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(cmdFile);
- buf.append('\"');
- } else {
- buf.append(cmdFile);
- }
- return buf.toString();
- }
- public static void getDefineSwitch(StringBuffer buf, String define,
- String value) {
- buf.setLength(0);
- buf.append("-D");
- buf.append(define);
- if (value != null && value.length() > 0) {
- buf.append('=');
- buf.append(value);
- }
- }
- public static String getIncludeDirSwitch(String includeDir) {
- return "-I" + includeDir;
- }
- public static String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- StringBuffer buf = new StringBuffer();
- int patternCount = libnames.length*2;
- if (libType != null) {
- patternCount = libnames.length;
- }
- String[] patterns = new String[patternCount];
- int offset = 0;
- if (libType == null || "static".equals(libType.getValue())) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0);
- }
- if (libType == null || !"static".equals(libType.getValue())) {
- offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns,
- offset);
- }
- return patterns;
- }
- public static String[] getOutputFileSwitch(String outPath) {
- StringBuffer buf = new StringBuffer("-o ");
- if (outPath.indexOf(' ') >= 0) {
- buf.append('\"');
- buf.append(outPath);
- buf.append('\"');
- } else {
- buf.append(outPath);
- }
- String[] retval = new String[]{buf.toString()};
- return retval;
- }
- public static void getUndefineSwitch(StringBuffer buf, String define) {
- buf.setLength(0);
- buf.append("-U");
- buf.append(define);
- }
- public static boolean isCaseSensitive() {
- return true;
- }
- private C89Processor() {
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
deleted file mode 100644
index a35d01af49..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCCompiler.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.sun;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.GccCompatibleCCompiler;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-/**
- * Adapter for the Sun (r) Forte (tm) C++ compiler
- *
- * @author Curt Arnold
- */
-public final class ForteCCCompiler extends GccCompatibleCCompiler {
- private static final ForteCCCompiler instance = new ForteCCCompiler("CC");
- /**
- * Gets singleton instance of this class
- */
- public static ForteCCCompiler getInstance() {
- return instance;
- }
- private String identifier;
- private File[] includePath;
- /**
- * Private constructor. Use ForteCCCompiler.getInstance() to get singleton
- * instance of this class.
- */
- private ForteCCCompiler(String command) {
- super(command, "-V", false, null, false, null);
- }
- public void addImpliedArgs(final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization) {
- args.addElement("-c");
- if (debug) {
- args.addElement("-g");
- }
- if (optimization != null) {
- if (optimization.isSpeed()) {
- args.addElement("-xO2");
- }
- }
- if (rtti != null) {
- if (rtti.booleanValue()) {
- args.addElement("-features=rtti");
- } else {
- args.addElement("-features=no%rtti");
- }
- }
- if (multithreaded) {
- args.addElement("-mt");
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("-KPIC");
- }
-
- }
- public void addWarningSwitch(Vector args, int level) {
- switch (level) {
- case 0 :
- args.addElement("-w");
- break;
- case 1 :
- case 2 :
- args.addElement("+w");
- break;
- case 3 :
- case 4 :
- case 5 :
- args.addElement("+w2");
- break;
- }
- }
- public File[] getEnvironmentIncludePath() {
- if (includePath == null) {
- File ccLoc = CUtil.getExecutableLocation("CC");
- if (ccLoc != null) {
- File compilerIncludeDir = new File(
- new File(ccLoc, "../include").getAbsolutePath());
- if (compilerIncludeDir.exists()) {
- includePath = new File[2];
- includePath[0] = compilerIncludeDir;
- }
- }
- if (includePath == null) {
- includePath = new File[1];
- }
- includePath[includePath.length - 1] = new File("/usr/include");
- }
- return includePath;
- }
- public Linker getLinker(LinkType linkType) {
- return ForteCCLinker.getInstance().getLinker(linkType);
- }
- public int getMaximumCommandLength() {
- return Integer.MAX_VALUE;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCLinker.java
deleted file mode 100644
index c39071af9f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/sun/ForteCCLinker.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.sun;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.gcc.AbstractLdLinker;
-/**
- * Adapter for Sun (r) Forte(tm) C++ Linker
- *
- * @author Curt Arnold
- */
-public final class ForteCCLinker extends AbstractLdLinker {
- private static final String[] discardFiles = new String[]{".dll", ".so",
- ".sl"};
- private static final String[] objFiles = new String[]{".o", ".a", ".lib"};
- private static final ForteCCLinker arLinker = new ForteCCLinker("CC",
- objFiles, discardFiles, "lib", ".a");
- private static final ForteCCLinker dllLinker = new ForteCCLinker("CC",
- objFiles, discardFiles, "lib", ".so");
- private static final ForteCCLinker instance = new ForteCCLinker("CC",
- objFiles, discardFiles, "", "");
- public static ForteCCLinker getInstance() {
- return instance;
- }
- private File[] libDirs;
- private ForteCCLinker(String command, String[] extensions,
- String[] ignoredExtensions, String outputPrefix, String outputSuffix) {
- super(command, "-V", extensions, ignoredExtensions, outputPrefix,
- outputSuffix, false, null);
- }
- public void addImpliedArgs(boolean debug, LinkType linkType, Vector args) {
- if (debug) {
- args.addElement("-g");
- }
- if (linkType.isStaticRuntime()) {
- args.addElement("-static");
- }
- if (linkType.isSharedLibrary()) {
- args.addElement("-G");
- }
- if (linkType.isStaticLibrary()) {
- args.addElement("-xar");
- }
- }
- public void addIncremental(boolean incremental, Vector args) {
- /*
- * if (incremental) { args.addElement("-xidlon"); } else {
- * args.addElement("-xidloff"); }
- */
- }
- /**
- * Returns library path.
- *
- */
- public File[] getLibraryPath() {
- if (libDirs == null) {
- File CCloc = CUtil.getExecutableLocation("CC");
- if (CCloc != null) {
- File compilerLib = new File(new File(CCloc, "../lib")
- .getAbsolutePath());
- if (compilerLib.exists()) {
- libDirs = new File[2];
- libDirs[0] = compilerLib;
- }
- }
- if (libDirs == null) {
- libDirs = new File[1];
- }
- }
- libDirs[libDirs.length - 1] = new File("/usr/lib");
- return libDirs;
- }
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- return arLinker;
- }
- if (type.isSharedLibrary()) {
- return dllLinker;
- }
- return instance;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxCCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxCCompiler.java
deleted file mode 100644
index d08b9fbbf6..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxCCompiler.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.ti;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.compiler.CommandLineCCompiler;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.OptimizationEnum;
-
-
-import org.apache.tools.ant.types.Environment;
-/**
- * Adapter for TI DSP compilers with cl** commands
- *
- * @author CurtA
- */
-public class ClxxCCompiler extends CommandLineCCompiler {
- /**
- * Header file extensions
- */
- private static final String[] headerExtensions = new String[]{".h", ".hpp",
- ".inl"};
- /**
- * Source file extensions
- */
- private static final String[] sourceExtensions = new String[]{".c", ".cc",
- ".cpp", ".cxx", ".c++"};
- /**
- * Singleton for TMS320C55x
- */
- private static final ClxxCCompiler cl55 = new ClxxCCompiler("cl55", false,
- null);
- /**
- * Singleton for TMS320C6000
- */
- private static final ClxxCCompiler cl6x = new ClxxCCompiler("cl6x", false,
- null);
- public static ClxxCCompiler getCl55Instance() {
- return cl55;
- }
- public static ClxxCCompiler getCl6xInstance() {
- return cl6x;
- }
- /**
- * Private constructor
- *
- * @param command
- * executable name
- * @param newEnvironment
- * Change environment
- * @param env
- * New environment
- */
- private ClxxCCompiler(String command, boolean newEnvironment,
- Environment env) {
- super(command, "-h", sourceExtensions, headerExtensions, ".o", false,
- null, newEnvironment, env);
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#addImpliedArgs(java.util.Vector,
- * boolean, boolean, boolean,
- * net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- protected void addImpliedArgs(
- final Vector args,
- final boolean debug,
- final boolean multithreaded,
- final boolean exceptions,
- final LinkType linkType,
- final Boolean rtti,
- final OptimizationEnum optimization,
- final Boolean defaultflag) {
- if (debug) {
- args.addElement("-gw");
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#addWarningSwitch(java.util.Vector,
- * int)
- */
- protected void addWarningSwitch(Vector args, int warnings) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getDefineSwitch(java.lang.StringBuffer,
- * java.lang.String, java.lang.String)
- */
- protected void getDefineSwitch(StringBuffer buffer, String define,
- String value) {
- buffer.append("-d");
- buffer.append(define);
- if (value != null) {
- buffer.append('=');
- buffer.append(value);
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getEnvironmentIncludePath()
- */
- protected File[] getEnvironmentIncludePath() {
- File[] c_dir = CUtil.getPathFromEnvironment("C_DIR", ";");
- File[] cx_dir = CUtil.getPathFromEnvironment("C6X_C_DIR", ";");
- if (c_dir.length == 0) {
- return cx_dir;
- }
- if (cx_dir.length == 0) {
- return c_dir;
- }
- File[] combo = new File[c_dir.length + cx_dir.length];
- for (int i = 0; i < cx_dir.length; i++) {
- combo[i] = cx_dir[i];
- }
- for (int i = 0; i < c_dir.length; i++) {
- combo[i + cx_dir.length] = c_dir[i];
- }
- return combo;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getIncludeDirSwitch(java.lang.String)
- */
- protected String getIncludeDirSwitch(String source) {
- return "-I" + source;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType type) {
- if (type.isStaticLibrary()) {
- if (this == cl6x) {
- return ClxxLibrarian.getCl6xInstance();
- }
- return ClxxLibrarian.getCl55Instance();
- }
- if (type.isSharedLibrary()) {
- if (this == cl6x) {
- return ClxxLinker.getCl6xDllInstance();
- }
- return ClxxLinker.getCl55DllInstance();
- }
- if (this == cl6x) {
- return ClxxLinker.getCl6xInstance();
- }
- return ClxxLinker.getCl55Instance();
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getMaximumCommandLength()
- */
- public int getMaximumCommandLength() {
- return 1024;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineCompiler#getUndefineSwitch(java.lang.StringBuffer,
- * java.lang.String)
- */
- protected void getUndefineSwitch(StringBuffer buffer, String define) {
- buffer.append("-u");
- buffer.append(define);
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLibrarian.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLibrarian.java
deleted file mode 100644
index 082d1a477f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLibrarian.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.ti;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- *
- * Adapter for TI DSP librarian
- * *
- * @author CurtA
- */
-public class ClxxLibrarian extends CommandLineLinker {
- private static final ClxxLibrarian cl55Instance = new ClxxLibrarian("ar55");
- private static final ClxxLibrarian cl6xInstance = new ClxxLibrarian("ar6x");
- public static final ClxxLibrarian getCl55Instance() {
- return cl55Instance;
- }
- public static final ClxxLibrarian getCl6xInstance() {
- return cl6xInstance;
- }
- private ClxxLibrarian(String command) {
- super(command, null, new String[]{".o"}, new String[0], ".lib", false,
- null);
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,
- * java.util.Vector)
- */
- protected void addBase(long base, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,
- * java.util.Vector)
- */
- protected void addFixed(Boolean fixed, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,
- * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
- */
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,
- * java.util.Vector)
- */
- protected void addIncremental(boolean incremental, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,
- * java.util.Vector)
- */
- protected void addMap(boolean map, Vector args) {
- // TODO Auto-generated method stub
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,
- * java.util.Vector)
- */
- protected void addStack(int stack, Vector args) {
- // TODO Auto-generated method stub
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
- */
- protected String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
- */
- public File[] getLibraryPath() {
- return new File[0];
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
- */
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- return new String[0];
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType linkType) {
- return null;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
- */
- protected int getMaximumCommandLength() {
- return 1024;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
- */
- protected String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-o", outputFile};
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
- */
- public boolean isCaseSensitive() {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java
deleted file mode 100644
index 43ee7c0662..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/ti/ClxxLinker.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.ti;
-import java.io.File;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.compiler.CommandLineLinker;
-import net.sf.antcontrib.cpptasks.compiler.LinkType;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum;
-
-/**
- * Adapter for TI DSP linkers
- * *
- * @author CurtA
- *
- */
-public class ClxxLinker extends CommandLineLinker {
- private static final ClxxLinker cl55DllInstance = new ClxxLinker("lnk55",
- ".dll");
- private static final ClxxLinker cl55Instance = new ClxxLinker("lnk55",
- ".exe");
- private static final ClxxLinker cl6xDllInstance = new ClxxLinker("lnk6x",
- ".dll");
- private static final ClxxLinker cl6xInstance = new ClxxLinker("lnk6x",
- ".exe");
- public static ClxxLinker getCl55DllInstance() {
- return cl55DllInstance;
- }
- public static ClxxLinker getCl55Instance() {
- return cl55Instance;
- }
- public static ClxxLinker getCl6xDllInstance() {
- return cl6xDllInstance;
- }
- public static ClxxLinker getCl6xInstance() {
- return cl6xInstance;
- }
- private ClxxLinker(String command, String outputSuffix) {
- super(command, "-h", new String[]{".o", ".lib", ".res"}, new String[]{
- ".map", ".pdb", ".lnk"}, outputSuffix, false, null);
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addBase(long,
- * java.util.Vector)
- */
- protected void addBase(long base, Vector args) {
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addFixed(java.lang.Boolean,
- * java.util.Vector)
- */
- protected void addFixed(Boolean fixed, Vector args) {
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addImpliedArgs(boolean,
- * net.sf.antcontrib.cpptasks.compiler.LinkType, java.util.Vector)
- */
- protected void addImpliedArgs(boolean debug, LinkType linkType, Vector args, Boolean defaultflag) {
- if (linkType.isSharedLibrary()) {
- args.addElement("-abs");
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addIncremental(boolean,
- * java.util.Vector)
- */
- protected void addIncremental(boolean incremental, Vector args) {
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addMap(boolean,
- * java.util.Vector)
- */
- protected void addMap(boolean map, Vector args) {
- if (map) {
- args.addElement("-m");
- }
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addStack(int,
- * java.util.Vector)
- */
- protected void addStack(int stack, Vector args) {
- }
- /* (non-Javadoc)
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#addEntry(int, java.util.Vector)
- */
- protected void addEntry(String entry, Vector args) {
- }
-
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getCommandFileSwitch(java.lang.String)
- */
- protected String getCommandFileSwitch(String commandFile) {
- return "@" + commandFile;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPath()
- */
- public File[] getLibraryPath() {
- return new File[0];
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#getLibraryPatterns(java.lang.String[])
- */
- public String[] getLibraryPatterns(String[] libnames, LibraryTypeEnum libType) {
- //
- // TODO: Looks bogus, should be .a or .so's not .o's
- //
- String[] libpats = new String[libnames.length];
- for (int i = 0; i < libnames.length; i++) {
- libpats[i] = libnames[i] + ".o";
- }
- return libpats;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Processor#getLinker(net.sf.antcontrib.cpptasks.compiler.LinkType)
- */
- public Linker getLinker(LinkType linkType) {
- return this;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getMaximumCommandLength()
- */
- protected int getMaximumCommandLength() {
- return 1024;
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.CommandLineLinker#getOutputFileSwitch(java.lang.String)
- */
- protected String[] getOutputFileSwitch(String outputFile) {
- return new String[]{"-o", outputFile};
- }
- /*
- * (non-Javadoc)
- *
- * @see net.sf.antcontrib.cpptasks.compiler.Linker#isCaseSensitive()
- */
- public boolean isCaseSensitive() {
- // TODO Auto-generated method stub
- return false;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java
deleted file mode 100644
index 87babcf740..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AslcompilerArgument.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-
-/**
- * A aslcompiler command line argument.
- */
-public class AslcompilerArgument extends CommandLineArgument {
- public AslcompilerArgument () {
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java
deleted file mode 100644
index 1b5f54d9a7..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/AssemblerArgument.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright 2001-2005 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-
-/**
- * A assembler command line argument.
- */
-public class AssemblerArgument extends CommandLineArgument {
- public AssemblerArgument () {
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java
deleted file mode 100644
index 91ab2f6327..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CommandLineArgument.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-
-import org.apache.tools.ant.types.EnumeratedAttribute;
-import java.io.File;
-/**
- * An compiler/linker command line flag.
- */
-public class CommandLineArgument {
- /**
- * Enumerated attribute with the values "start", "mid" and "end",
- */
- public static class LocationEnum extends EnumeratedAttribute {
- public String[] getValues() {
- return new String[]{"start", "mid", "end"};
- }
- }
- private String ifCond;
- private int location;
- private String unlessCond;
- private String value;
- private File file;
- public CommandLineArgument() {
- }
- public int getLocation() {
- return location;
- }
- public String getValue() {
- return value;
- }
- public File getFile() {
- return file;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p) {
- if (value == null) {
- return false;
- }
- if (ifCond != null && p.getProperty(ifCond) == null) {
- return false;
- } else if (unlessCond != null && p.getProperty(unlessCond) != null) {
- return false;
- }
- return true;
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The argument will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies relative location of argument on command line. "start" will
- * place argument at start of command line, "mid" will place argument after
- * all "start" arguments but before filenames, "end" will place argument
- * after filenames.
- *
- */
- public void setLocation(LocationEnum location) {
- this.location = location.getIndex();
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the argument will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Specifies the string that should appear on the command line. The
- * argument will be quoted if it contains embedded blanks. Use multiple
- * arguments to avoid quoting.
- *
- */
- public void setValue(String value) {
- this.value = value;
- }
- /**
- * Specifies the file which lists many strings that should appear on
- * the command line. Each line is one argument. The argument will be
- * quated if it contains embedded blanks. Use multiple arguments in
- * file to avoid quating.
- *
- * @param file
- * name of the file
- */
- public void setFile(File file) {
- this.file = file;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java
deleted file mode 100644
index ca9e90e732..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/CompilerArgument.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-/**
- * A compiler command line argument.
- */
-public class CompilerArgument extends CommandLineArgument {
- public CompilerArgument() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java
deleted file mode 100644
index af2d141e99..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalFileSet.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.AbstractFileSet;
-import org.apache.tools.ant.types.FileSet;
-/**
- * An Ant FileSet object augmented with if and unless conditions.
- *
- * @author Curt Arnold
- */
-public class ConditionalFileSet extends FileSet {
- private String ifCond;
- private String unlessCond;
- public ConditionalFileSet() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * overrides FileSet's implementation which would throw an exception since
- * the referenced object isn't this type.
- */
- protected AbstractFileSet getRef(Project p) {
- return (AbstractFileSet) getRefid().getReferencedObject(p);
- }
- /**
- * Returns true if the Path's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive() throws BuildException {
- Project p = getProject();
- if (p == null) {
- throw new java.lang.IllegalStateException(
- "setProject() should have been called");
- }
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The fileset will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the fileset will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java
deleted file mode 100644
index dc21189c15..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/ConditionalPath.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.Path;
-/**
- * An Ant Path object augmented with if and unless conditionals
- *
- * @author Curt Arnold
- */
-public class ConditionalPath extends Path {
- private String ifCond;
- private String unlessCond;
- private File file;
- public ConditionalPath(Project project) {
- super(project);
- }
- public ConditionalPath(Project p, String path) {
- super(p, path);
- }
- public File getFile() {
- return file;
- }
- /**
- * Returns true if the Path's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p)
- throws BuildException {
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The path will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the path will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
- /**
- * Specifies the file which lists many include paths that should appear on
- * the command line. Each line is an include path. The includepath will be
- * quated if it contains embedded blanks.
- *
- * @param file
- * name of the file
- */
- public void setFile(File file) {
- this.file = file;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java
deleted file mode 100644
index 824e939481..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineArgument.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-/**
- * Preprocessor macro definition.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- */
-public class DefineArgument extends UndefineArgument {
- private String value;
- public DefineArgument() {
- super(true);
- }
- /** Returns the value of the define */
- public final String getValue() {
- return value;
- }
- /** Set the value attribute */
- public final void setValue(String value) {
- this.value = value;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java
deleted file mode 100644
index 9d229fb0ff..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/DefineSet.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Reference;
-/**
- * Set of preprocessor macro defines and undefines.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- * @author Adam Murdoch
- */
-public class DefineSet extends DataType {
- private Vector defineList = new Vector();
- private String ifCond = null;
- private String unlessCond = null;
- /**
- *
- * Adds a define element.
- *
- * @throws BuildException
- * if reference
- */
- public void addDefine(DefineArgument arg) throws BuildException {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- defineList.addElement(arg);
- }
- /** Adds defines/undefines. */
- private void addDefines(String[] defs, boolean isDefine) {
- for (int i = 0; i < defs.length; i++) {
- UndefineArgument def;
- if (isDefine) {
- def = new DefineArgument();
- } else {
- def = new UndefineArgument();
- }
- def.setName(defs[i]);
- defineList.addElement(def);
- }
- }
- /**
- *
- * Adds an undefine element.
- *
- * @throws BuildException
- * if reference
- */
- public void addUndefine(UndefineArgument arg) throws BuildException {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- defineList.addElement(arg);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /** Returns the defines and undefines in this set. */
- public UndefineArgument[] getDefines() throws BuildException {
- if (isReference()) {
- DefineSet defset = (DefineSet) getCheckedRef(DefineSet.class,
- "DefineSet");
- return defset.getDefines();
- } else {
- if (isActive()) {
- UndefineArgument[] defs = new UndefineArgument[defineList
- .size()];
- defineList.copyInto(defs);
- return defs;
- } else {
- return new UndefineArgument[0];
- }
- }
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- *
- * @exception BuildException
- * throws build exception if name is not set
- */
- public final boolean isActive() throws BuildException {
- return CUtil.isActive(getProject(), ifCond, unlessCond);
- }
- /**
- * A comma-separated list of preprocessor macros to define. Use nested
- * define elements to define macro values.
- *
- * @param defList
- * comma-separated list of preprocessor macros
- * @throws BuildException
- * throw if defineset is a reference
- */
- public void setDefine(CUtil.StringArrayBuilder defList)
- throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- addDefines(defList.getValue(), true);
- }
- /**
- * Sets a description of the current data type.
- */
- public void setDescription(String desc) {
- super.setDescription(desc);
- }
- /**
- * Sets an id that can be used to reference this element.
- *
- * @param id
- * id
- */
- public void setId(String id) {
- //
- // this is actually accomplished by a different
- // mechanism, but we can document it
- //
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public final void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Specifies that this element should behave as if the content of the
- * element with the matching id attribute was inserted at this location. If
- * specified, no other attributes or child content should be specified,
- * other than "description".
- *
- */
- public void setRefid(Reference r) throws BuildException {
- if (!defineList.isEmpty()) {
- throw tooManyAttributes();
- }
- super.setRefid(r);
- }
- /**
- * A comma-separated list of preprocessor macros to undefine.
- *
- * @param undefList
- * comma-separated list of preprocessor macros
- * @throws BuildException
- * throw if defineset is a reference
- */
- public void setUndefine(CUtil.StringArrayBuilder undefList)
- throws BuildException {
- if (isReference()) {
- throw tooManyAttributes();
- }
- addDefines(undefList.getValue(), false);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public final void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java
deleted file mode 100644
index d95959f631..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/FlexLong.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *
- * Copyright 2002-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import java.lang.reflect.Method;
-
-/**
- * Helper class which can be used for Ant task attribute setter methods to
- * allow the build file to specify a long in either decimal, octal, or
- * hexadecimal format.
- * // FlexInteger author
- * @author Erik Hatcher
- * @see org.apache.tools.ant.types.FlexInteger
- */
-public class FlexLong {
- private Long value;
- /**
- * Constructor used by Ant's introspection mechanism for attribute
- * population
- */
- public FlexLong(String value) {
- // Java 1.1 did not support Long.decode().. so we call it by
- // reflection.
- try {
- Method m = Long.class
- .getMethod("decode", new Class[]{String.class});
- Object rc = m.invoke(null, new Object[]{value});
- this.value = (Long) rc;
- } catch (Exception e) {
- // Try it the old fashioned way, we must be on a 1.1 jre
- this.value = new Long(value);
- }
- }
- /**
- * Returns the decimal integer value
- */
- public long longValue() {
- return value.longValue();
- }
- /**
- * Overridden method to return the decimal value for display
- */
- public String toString() {
- return value.toString();
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java
deleted file mode 100644
index edcc42103c..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/IncludePath.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import org.apache.tools.ant.Project;
-/**
- * An include path.
- *
- * Works like other paths in Ant with with the addition of "if" and "unless"
- * conditions.
- *
- * @author Curt Arnold
- */
-public class IncludePath extends ConditionalPath {
- public IncludePath(Project project) {
- super(project);
- }
- public IncludePath(Project p, String path) {
- super(p, path);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java
deleted file mode 100644
index d522ccc36f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibrarySet.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import java.io.File;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.FileVisitor;
-import net.sf.antcontrib.cpptasks.compiler.Linker;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.ProjectComponent;
-import org.apache.tools.ant.types.FileSet;
-import org.apache.tools.ant.types.PatternSet;
-/**
- * A set of library names. Libraries can also be added to a link by specifying
- * them in a fileset.
- *
- * For most Unix-like compilers, libset will result in a series of -l and -L
- * linker arguments. For Windows compilers, the library names will be used to
- * locate the appropriate library files which will be added to the linkers
- * input file list as if they had been specified in a fileset.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- * @author Adam Murdoch
- * @author Curt Arnold
- */
-public class LibrarySet extends ProjectComponent {
- private String dataset;
- private boolean explicitCaseSensitive;
- private String ifCond;
- private String[] libnames;
- private final FileSet set = new FileSet();
- private String unlessCond;
- private LibraryTypeEnum libraryType;
- public LibrarySet() {
- libnames = new String[0];
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /**
- * Gets the dataset. Used on OS390 if the libs are in a dataset.
- *
- * @return Returns a String
- */
- public String getDataset() {
- return dataset;
- }
- public File getDir(Project project) {
- return set.getDir(project);
- }
- protected FileSet getFileSet() {
- return set;
- }
- public String[] getLibs() {
- String[] retval = (String[]) libnames.clone();
- return retval;
- }
-
- /**
- * Gets preferred library type
- *
- * @return library type, may be null.
- */
- public LibraryTypeEnum getType() {
- return libraryType;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- */
- public boolean isActive(org.apache.tools.ant.Project p) {
- if (p == null) {
- throw new NullPointerException("p");
- }
- if (ifCond != null) {
- String ifValue = p.getProperty(ifCond);
- if (ifValue != null) {
- if (ifValue.equals("no") || ifValue.equals("false")) {
- throw new BuildException(
- "property "
- + ifCond
- + " used as if condition has value "
- + ifValue
- + " which suggests a misunderstanding of if attributes");
- }
- } else {
- return false;
- }
- }
- if (unlessCond != null) {
- String unlessValue = p.getProperty(unlessCond);
- if (unlessValue != null) {
- if (unlessValue.equals("no") || unlessValue.equals("false")) {
- throw new BuildException(
- "property "
- + unlessCond
- + " used as unless condition has value "
- + unlessValue
- + " which suggests a misunderstanding of unless attributes");
- }
- return false;
- }
- }
- if (libnames.length == 0) {
- p.log("libnames not specified or empty.", Project.MSG_WARN);
- return false;
- }
- return true;
- }
- /**
- * Sets case sensitivity of the file system. If not set, will default to
- * the linker's case sensitivity.
- *
- * @param isCaseSensitive
- * "true"|"on"|"yes" if file system is case sensitive,
- * "false"|"off"|"no" when not.
- */
- public void setCaseSensitive(boolean isCaseSensitive) {
- explicitCaseSensitive = true;
- set.setCaseSensitive(isCaseSensitive);
- }
- /**
- * Sets the dataset. Used on OS390 if the libs are in a dataset.
- *
- * @param dataset
- * The dataset to set
- */
- public void setDataset(String dataset) {
- this.dataset = dataset;
- }
- /**
- * Library directory.
- *
- * @param dir
- * library directory
- *
- */
- public void setDir(File dir) throws BuildException {
- set.setDir(dir);
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The library set will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public void setIf(String propName) {
- ifCond = propName;
- }
- /**
- * Comma-separated list of library names without leading prefixes, such as
- * "lib", or extensions, such as ".so" or ".a".
- *
- */
- public void setLibs(CUtil.StringArrayBuilder libs) throws BuildException {
- libnames = libs.getValue();
- // If this is not active.. then it's ok if the lib names are invalid.
- // so we can do a: <libset if="x.lib" dir="." libs="${x.lib}"/>
- if (!isActive(getProject()))
- return;
- for (int i = 0; i < libnames.length; i++) {
- int lastDot = libnames[i].lastIndexOf('.');
- if (lastDot >= 0) {
- String extension = libnames[i].substring(lastDot);
- if (extension.equalsIgnoreCase(".lib")
- || extension.equalsIgnoreCase(".so")
- || extension.equalsIgnoreCase(".a")) {
- getProject().log(
- "Suspicious library name ending with \""
- + extension + "\": " + libnames[i], Project.MSG_DEBUG );
- }
- }
- if (libnames[i].length() >= 3
- && libnames[i].substring(0, 3).equalsIgnoreCase("lib")) {
- getProject().log(
- "Suspicious library name starting with \"lib\": "
- + libnames[i], Project.MSG_DEBUG);
- }
- }
- }
- public void setProject(Project project) {
- set.setProject(project);
- super.setProject(project);
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the library set will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public void setUnless(String propName) {
- unlessCond = propName;
- }
-
- /**
- * Sets the preferred library type. Supported values "shared", "static", and
- * "framework". "framework" is equivalent to "shared" on non-Darwin platforms.
- */
- public void setType(LibraryTypeEnum type) {
- this.libraryType = type;
- }
-
- public void visitLibraries(Project project, Linker linker, File[] libpath,
- FileVisitor visitor) throws BuildException {
- FileSet localSet = (FileSet) set.clone();
- //
- // unless explicitly set
- // will default to the linker case sensitivity
- //
- if (!explicitCaseSensitive) {
- boolean linkerCaseSensitive = linker.isCaseSensitive();
- localSet.setCaseSensitive(linkerCaseSensitive);
- }
- //
- // if there was a libs attribute then
- // add the corresponding patterns to the FileSet
- //
- if (libnames != null && libnames.length > 0) {
- String[] patterns = linker.getLibraryPatterns(libnames, libraryType);
- //
- // if no patterns, then linker does not support libraries
- //
- if (patterns.length > 0) {
- for (int i = 0; i < patterns.length; i++) {
- PatternSet.NameEntry entry = localSet.createInclude();
- entry.setName(patterns[i]);
- }
- //
- // if there was no specified directory then
- // run through the libpath backwards
- //
- if (localSet.getDir(project) == null) {
- //
- // scan libpath in reverse order
- // to give earlier entries priority
- //
- for (int j = libpath.length - 1; j >= 0; j--) {
- FileSet clone = (FileSet) localSet.clone();
- clone.setDir(libpath[j]);
- DirectoryScanner scanner = clone.getDirectoryScanner(project);
- File basedir = scanner.getBasedir();
- String[] files = scanner.getIncludedFiles();
- for (int k = 0; k < files.length; k++) {
- visitor.visit(basedir, files[k]);
- }
- }
- } else {
- DirectoryScanner scanner = localSet.getDirectoryScanner(project);
- File basedir = scanner.getBasedir();
- String[] files = scanner.getIncludedFiles();
- for (int k = 0; k < files.length; k++) {
- visitor.visit(basedir, files[k]);
- }
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java
deleted file mode 100644
index 82d7947bf2..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LibraryTypeEnum.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright 2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import org.apache.tools.ant.types.EnumeratedAttribute;
-/**
- * Enumeration of library types for LibrarySet
- *
- * @author Curt Arnold
- *
- */
-public class LibraryTypeEnum extends EnumeratedAttribute {
- /**
- * Constructor
- *
- * Set by default to "shared"
- *
- * @see java.lang.Object#Object()
- */
- public LibraryTypeEnum() {
- setValue("shared");
- }
- /**
- * Gets list of acceptable values
- *
- * @see org.apache.tools.ant.types.EnumeratedAttribute#getValues()
- */
- public String[] getValues() {
- return new String[]{"shared", // prefer shared libraries
- "static", // prefer static libraries
- "framework" // framework libraries (Mac OS/X)
- // equiv to shared on other platforms
- };
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java
deleted file mode 100644
index 89bff1881b..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/LinkerArgument.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-/**
- * A linker command line argument.
- */
-public class LinkerArgument extends CommandLineArgument {
- public LinkerArgument() {
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java
deleted file mode 100644
index be0dbd537a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemIncludePath.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import org.apache.tools.ant.Project;
-/**
- * A system include path.
- *
- * Files located using a system include path will not participate in dependency
- * analysis.
- *
- * Standard include paths for a compiler should not be specified since these
- * should be determined from environment variables or configuration files by
- * the compiler adapter.
- *
- * Works like other paths in Ant with with the addition of "if" and "unless"
- * conditions.
- *
- * @author Curt Arnold
- */
-public class SystemIncludePath extends ConditionalPath {
- public SystemIncludePath(Project project) {
- super(project);
- }
- public SystemIncludePath(Project p, String path) {
- super(p, path);
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java
deleted file mode 100644
index 02d08c8ac8..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/SystemLibrarySet.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-/**
- * A set of system library names. Timestamp or location of system libraries are
- * not considered in dependency analysis.
- *
- * Libraries can also be added to a link by specifying them in a fileset.
- *
- * For most Unix-like compilers, syslibset will result in a series of -l and -L
- * linker arguments. For Windows compilers, the library names will be used to
- * locate the appropriate library files which will be added to the linkers
- * input file list as if they had been specified in a fileset.
- */
-public class SystemLibrarySet extends LibrarySet {
- public SystemLibrarySet() {
- super();
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java
deleted file mode 100644
index 2a18fca6d1..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/types/UndefineArgument.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.types;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CUtil;
-
-import org.apache.tools.ant.BuildException;
-/**
- * Preprocessor macro undefinition.
- *
- * @author Mark A Russell <a
- * href="mailto:mark_russell@csgsystems.com">mark_russell@csg_systems.com
- * </a>
- */
-public class UndefineArgument {
- /**
- * This method returns an array of UndefineArgument and DefineArgument's by
- * merging a base list with an override list.
- *
- * Any define in the base list with a name that appears in the override
- * list is suppressed. All entries in the override list are preserved
- *
- */
- public static UndefineArgument[] merge(UndefineArgument[] base,
- UndefineArgument[] override) {
- if (base.length == 0) {
- UndefineArgument[] overrideClone = (UndefineArgument[]) override
- .clone();
- return overrideClone;
- }
- if (override.length == 0) {
- UndefineArgument[] baseClone = (UndefineArgument[]) base.clone();
- return baseClone;
- }
- Vector unduplicated = new Vector(base.length);
- for (int i = 0; i < base.length; i++) {
- UndefineArgument current = base[i];
- String currentName = current.getName();
- boolean match = false;
- if (currentName == null) {
- match = true;
- } else {
- for (int j = 0; j < override.length; j++) {
- UndefineArgument over = override[j];
- String overName = over.getName();
- if (overName != null && overName.equals(currentName)) {
- match = true;
- break;
- }
- }
- }
- if (!match) {
- unduplicated.addElement(current);
- }
- }
- UndefineArgument[] combined = new UndefineArgument[unduplicated.size()
- + override.length];
- unduplicated.copyInto(combined);
- int offset = unduplicated.size();
- for (int i = 0; i < override.length; i++) {
- combined[offset + i] = override[i];
- }
- return combined;
- }
- private boolean define = false;
- private String ifCond;
- private String name;
- private String unlessCond;
- public UndefineArgument() {
- }
- protected UndefineArgument(boolean isDefine) {
- this.define = isDefine;
- }
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
- /** Returns the name of the define */
- public final String getName() {
- return name;
- }
- /** Returns the value of the define */
- public String getValue() {
- return null;
- }
- /**
- * Returns true if the define's if and unless conditions (if any) are
- * satisfied.
- *
- * @exception BuildException
- * throws build exception if name is not set
- */
- public final boolean isActive(org.apache.tools.ant.Project p)
- throws BuildException {
- if (name == null) {
- throw new BuildException("<define> is missing name attribute");
- }
- return CUtil.isActive(p, ifCond, unlessCond);
- }
- /** Returns true if this is a define, false if an undefine. */
- public final boolean isDefine() {
- return define;
- }
- /**
- * Sets the property name for the 'if' condition.
- *
- * The define will be ignored unless the property is defined.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") will throw an exception when
- * evaluated.
- *
- * @param propName
- * property name
- */
- public final void setIf(String propName) {
- ifCond = propName;
- }
- /** Set the name attribute */
- public final void setName(String name) {
- this.name = name;
- }
- /**
- * Set the property name for the 'unless' condition.
- *
- * If named property is set, the define will be ignored.
- *
- * The value of the property is insignificant, but values that would imply
- * misinterpretation ("false", "no") of the behavior will throw an
- * exception when evaluated.
- *
- * @param propName
- * name of property
- */
- public final void setUnless(String propName) {
- unlessCond = propName;
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java
deleted file mode 100644
index 3ed6c9652f..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/CommandLineUserDefine.java
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.userdefine;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Vector;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-import net.sf.antcontrib.cpptasks.CUtil;
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-import net.sf.antcontrib.cpptasks.types.ConditionalFileSet;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.Environment;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.types.Environment.Variable;
-
-/**
- *
- */
-public class CommandLineUserDefine {
-
- String includePathDelimiter = null;
-
- String outputDelimiter = null;
-
- public void command(CCTask cctask, UserDefineDef userdefine) {
- boolean isGccCommand = userdefine.getFamily().equalsIgnoreCase("GCC");
- File workdir;
- Project project = cctask.getProject();
- if (userdefine.getWorkdir() == null) {
- workdir = new File(".");
- } else {
- workdir = userdefine.getWorkdir();
- }
-
- //
- // generate cmdline= command + args + includepath + endargs + outfile
- //
- Vector args = new Vector();
- Vector argsWithoutSpace = new Vector();
- Vector endargs = new Vector();
- Vector endargsWithoutSpace = new Vector();
- Vector includePath = new Vector();
-
- //
- // get Args.
- //
- CommandLineArgument[] argument = userdefine.getActiveProcessorArgs();
- for (int j = 0; j < argument.length; j++) {
- if (argument[j].getLocation() == 0) {
- args.addElement(argument[j].getValue());
- } else {
- endargs.addElement(argument[j].getValue());
- }
- }
-
- //
- // get include path.
- //
- String[] incPath = userdefine.getActiveIncludePaths();
- for (int j = 0; j < incPath.length; j++) {
- includePath.addElement(includePathDelimiter + incPath[j]);
- }
-
- //
- // Remove space in args and endargs.
- //
- for (int i = 0; i < args.size(); i++) {
- String str = (String) args.get(i);
- StringTokenizer st = new StringTokenizer(str, " \t");
- while (st.hasMoreTokens()) {
- argsWithoutSpace.addElement(st.nextToken());
- }
- }
- for (int i = 0; i < endargs.size(); i++) {
- String str = (String) endargs.get(i);
- StringTokenizer st = new StringTokenizer(str, " \t");
- while (st.hasMoreTokens()) {
- endargsWithoutSpace.addElement(st.nextToken());
- }
- }
-
- int cmdLen = 0;
- //
- // command + args + endargs + includepath + sourcefile
- //
- cmdLen = 1 + argsWithoutSpace.size() + endargsWithoutSpace.size()
- + includePath.size() + 1;
- String[] libSet = userdefine.getLibset();
- if (libSet != null && libSet.length > 0) {
- cmdLen = cmdLen + libSet.length;
- if (isGccCommand) {
- cmdLen += 2; // we need -( and -) to group libs for GCC
- }
- }
-
- //
- // In gcc the "cr" flag should follow space then add outputfile name,
- // otherwise
- // it will pop error.
- // TBD
- if (outputDelimiter != null && userdefine.getOutputFile() != null
- && outputDelimiter.trim().length() > 0) {
- if (outputDelimiter.trim().equalsIgnoreCase("-cr")) {
- cmdLen = cmdLen + 2;
- } else {
- cmdLen++;
- }
- }
-
- //
- // for every source file
- // if file is header file, just skip it (add later)
- //
- Vector srcSets = userdefine.getSrcSets();
-
- //
- // if have source file append source file in command line.
- //
- Set allSrcFiles = new LinkedHashSet();
-
- for (int i = 0; i < srcSets.size(); i++) {
- ConditionalFileSet srcSet = (ConditionalFileSet) srcSets
- .elementAt(i);
- if (srcSet.isActive()) {
- //
- // Find matching source files
- //
- DirectoryScanner scanner = srcSet.getDirectoryScanner(project);
- //
- // Check each source file - see if it needs compilation
- //
- String[] fileNames = scanner.getIncludedFiles();
- for (int j = 0; j < fileNames.length; j++) {
- allSrcFiles.add(scanner.getBasedir() + "/" + fileNames[j]);
- if (isGccCommand) {
- System.out.println("[" + userdefine.getType() + "] "
- + fileNames[j]);
- }
- }
- }
- }
-
- String[] fileNames = (String[]) allSrcFiles
- .toArray(new String[allSrcFiles.size()]);
- String[] cmd = new String[cmdLen - 1 + fileNames.length];
- int index = 0;
- cmd[index++] = userdefine.getCmd();
-
- Iterator iter = argsWithoutSpace.iterator();
- while (iter.hasNext()) {
- cmd[index++] = project.replaceProperties((String) iter.next());
- }
-
- iter = endargsWithoutSpace.iterator();
- while (iter.hasNext()) {
- cmd[index++] = project.replaceProperties((String) iter.next());
- }
-
- //
- // Add outputFileFlag and output file to cmd
- //
- if (outputDelimiter != null && userdefine.getOutputFile() != null
- && outputDelimiter.length() > 0) {
- if (outputDelimiter.trim().equalsIgnoreCase("-cr")) {
- cmd[index++] = outputDelimiter;
- cmd[index++] = userdefine.getOutputFile();
- } else {
- cmd[index++] = outputDelimiter + userdefine.getOutputFile();
- }
- }
-
- iter = includePath.iterator();
- while (iter.hasNext()) {
- cmd[index++] = (String) iter.next();
- }
-
- if (libSet != null && libSet.length > 0) {
- if (isGccCommand) {
- cmd[index++] = "-(";
- }
- for (int k = 0; k < libSet.length; k++) {
- cmd[index++] = libSet[k];
- }
- if (isGccCommand) {
- cmd[index++] = "-)";
- }
- }
- for (int j = 0; j < fileNames.length; j++) {
- cmd[index++] = fileNames[j];
- }
-
-// StringBuffer logLine = new StringBuffer();
-// for(int i = 0; i < cmd.length; i++) {
-// logLine.append(cmd[i] + " ");
-// }
-// project.log(logLine.toString(), Project.MSG_VERBOSE);
-
- Environment newEnv = new Environment();
-
- //
- // Prepare for environment variable PATH
- //
- if (userdefine.getDpath() != null && userdefine.getDpath().trim().length() != 0) {
- String pathName = getPathName("PATH");
- String existPath = System.getenv(pathName);
-
- Variable var = new Variable();
- var.setKey(pathName);
- var.setPath(new Path(project, userdefine.getDpath() + ";" + existPath));
- newEnv.addVariable(var);
- }
-
- //
- // Prepare for environment variable LIB
- //
- if (userdefine.getLibpath() != null && userdefine.getLibpath().trim().length() != 0) {
- String pathName = getPathName("LIB");
- String existPath = System.getenv(pathName);
- Variable var = new Variable();
- var.setKey(pathName);
- if (existPath == null) {
- var.setPath(new Path(project, userdefine.getLibpath()));
- } else {
- var.setPath(new Path(project, userdefine.getLibpath() + ";" + existPath));
- }
- newEnv.addVariable(var);
- }
-
- //
- // Prepare for environment variable INCLUDE
- //
- if (userdefine.getInclude() != null && userdefine.getInclude().trim().length() != 0) {
- String pathName = getPathName("INCLUDE");
- String existPath = System.getenv(pathName);
- Variable var = new Variable();
- var.setKey(pathName);
- if (existPath == null) {
- var.setPath(new Path(project, userdefine.getInclude()));
- } else {
- var.setPath(new Path(project, userdefine.getInclude() + ";" + existPath));
- }
- newEnv.addVariable(var);
- }
-
- int retval = runCommand(cctask, workdir, cmd, newEnv);
-
- if (retval != 0) {
- throw new BuildException(userdefine.getCmd()
- + " failed with return code " + retval, cctask
- .getLocation());
- }
- }
-
- private String getPathName(String variableName) {
- Map allEnv = System.getenv();
- Iterator iter = allEnv.keySet().iterator();
- while (iter.hasNext()) {
- String key = (String)iter.next();
- if(key.equalsIgnoreCase(variableName)) {
- return key;
- }
- }
- return variableName;
- }
-
- protected int runCommand(CCTask task, File workingDir, String[] cmdline, Environment env)
- throws BuildException {
- //
- // Write command to File
- //
- return CUtil.runCommand(task, workingDir, cmdline, false, env);
-
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineArgument.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineArgument.java
deleted file mode 100644
index 96d274ad9a..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineArgument.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- *
- * Copyright 2002-2006 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.userdefine;
-
-import net.sf.antcontrib.cpptasks.types.CommandLineArgument;
-
-/**
- * Collect Arguments.
- *
- */
-public class UserDefineArgument extends CommandLineArgument {
-
- public UserDefineArgument() {
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineCompiler.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineCompiler.java
deleted file mode 100644
index 47431e84a0..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineCompiler.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- *
- * Copyright 2002-2006 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.userdefine;
-
-import net.sf.antcontrib.cpptasks.CCTask;
-
-/**
- * Adapter for the User-Defined Compiler
- */
-public class UserDefineCompiler extends CommandLineUserDefine {
-
- public UserDefineCompiler (CCTask cctask, UserDefineDef userdefineDef) {
- String cmdType = userdefineDef.getType();
- String toolchainFamily = userdefineDef.getFamily();
-
- if (userdefineDef.getIncludePathDelimiter() == null) {
- includePathDelimiter = UserDefineMapping.getIncludePathDelimiter(
- toolchainFamily, cmdType);
- } else {
- includePathDelimiter = userdefineDef.getIncludePathDelimiter();
- }
-
- if (userdefineDef.getOutputDelimiter() == null) {
- outputDelimiter = UserDefineMapping.getOutputFileFlag(
- toolchainFamily, cmdType);
- } else {
- outputDelimiter = userdefineDef.getOutputDelimiter();
- }
-
- }
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java
deleted file mode 100644
index c19c98636e..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineDef.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/*
- *
- * Copyright 2002-2006 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.userdefine;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-
-import net.sf.antcontrib.cpptasks.ProcessorDef;
-import net.sf.antcontrib.cpptasks.types.ConditionalPath;
-import net.sf.antcontrib.cpptasks.types.IncludePath;
-import net.sf.antcontrib.cpptasks.types.LibrarySet;
-
-/**
- * A userdefinedef definition. userdefine elements may be placed either as
- * children of a cc element or the project element. A userdefine element with an
- * id attribute may be referenced by userdefine elements with refid or extends
- * attributes.
- *
- */
-public class UserDefineDef extends ProcessorDef {
-
- public UserDefineDef () {
- }
-
- private String type = "CC";
-
- private String family = "MSFT";
-
- private String cmd;
-
- private String includePathDelimiter;
-
- private String outputDelimiter;
-
- private File workdir;
-
- private Vector includePaths = new Vector();
-
- private String outputFile;
-
- private Vector allLibraries = new Vector();
-
- private String dpath = null;
-
- private String libpath = null;
-
- private String include = null;
-
- public void addLibset(LibrarySet libset) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- if (libset == null) {
- throw new NullPointerException("libset");
- }
-
- allLibraries.add(libset);
- }
-
- public void execute() throws org.apache.tools.ant.BuildException {
- throw new org.apache.tools.ant.BuildException(
- "Not an actual task, but looks like one for documentation purposes");
- }
-
- public void addConfiguredArgument(UserDefineArgument arg) {
- if (isReference()) {
- throw noChildrenAllowed();
- }
- addConfiguredProcessorArg(arg);
- }
-
- /**
- * Creates an include path.
- */
- public IncludePath createIncludePath() {
- Project p = getProject();
- if (isReference()) {
- throw noChildrenAllowed();
- }
- IncludePath path = new IncludePath(p);
- includePaths.addElement(path);
- return path;
- }
-
- /**
- * Add a <includepath> if specify the file attribute
- *
- * @param activePath
- * Active Path Vector
- * @param file
- * File with multiple path
- * @throws BuildException
- * if the specify file not exist
- */
- protected void loadFile(Vector activePath, File file) throws BuildException {
- FileReader fileReader;
- BufferedReader in;
- String str;
- if (!file.exists()) {
- throw new BuildException("The file " + file + " is not existed");
- }
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
- while ((str = in.readLine()) != null) {
- if (str.trim().endsWith("")) {
- continue;
- }
- str = getProject().replaceProperties(str);
- activePath.addElement(str.trim());
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- * Returns the specific include path.
- *
- * @return All active include paths
- */
- public String[] getActiveIncludePaths() {
- if (isReference()) {
- return ((UserDefineDef) getCheckedRef(UserDefineDef.class,
- "UserDefineDef")).getActiveIncludePaths();
- }
- return getActivePaths(includePaths);
- }
-
- private String[] getActivePaths(Vector paths) {
- Project p = getProject();
- Vector activePaths = new Vector(paths.size());
- int length = paths.size();
- for (int i = 0; i < length; i++) {
- ConditionalPath path = (ConditionalPath) paths.elementAt(i);
- if (path.isActive(p)) {
- if (path.getFile() == null) {
- String[] pathEntries = path.list();
- for (int j = 0; j < pathEntries.length; j++) {
- activePaths.addElement(pathEntries[j]);
- }
- } else {
- loadFile(activePaths, path.getFile());
- }
- }
- }
- String[] pathNames = new String[activePaths.size()];
- activePaths.copyInto(pathNames);
- return pathNames;
- }
-
- /**
- * Get include path delimiter.
- *
- * @return Include Path Delimiter
- */
- public String getIncludePathDelimiter() {
- if (isReference()) {
- return ((UserDefineDef) getCheckedRef(UserDefineDef.class,
- "UserDefineDef")).getIncludePathDelimiter();
- }
- return includePathDelimiter;
- }
-
- /**
- * Set include path delimiter.
- *
- * @param includePathDelimiter
- * include path delimiter
- */
- public void setIncludePathDelimiter(String includePathDelimiter) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.includePathDelimiter = includePathDelimiter;
- }
-
- /**
- * Get type.
- *
- * @return type
- */
- public String getType() {
- if (isReference()) {
- return ((UserDefineDef) getCheckedRef(UserDefineDef.class,
- "UserDefineDef")).getType();
- }
- return type;
- }
-
- /**
- * Set type.
- *
- * @param type
- * Type
- */
- public void setType(String type) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.type = type;
- }
-
- public String getCmd() {
- return cmd;
- }
-
- public void setCmd(String cmd) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- if (cmd == null || cmd.trim().length() == 0) {
- throw new BuildException("cmd attribute is empty!");
- }
- File cmdProgram = new File(cmd);
- if (cmdProgram.isDirectory()) {
- throw new BuildException(cmd + " is not valid or executable!");
- }
- this.cmd = cmd;
- }
-
- public String getFamily() {
- return family;
- }
-
- public void setFamily(String family) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.family = family;
- }
-
- public String getOutputFile() {
- return outputFile;
- }
-
- public void setOutputFile(String outputFile) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.outputFile = outputFile;
- }
-
- public File getWorkdir() {
- return workdir;
- }
-
- public void setWorkdir(File workdir) {
- if (isReference()) {
- throw tooManyAttributes();
- }
- this.workdir = workdir;
- }
-
- public String[] getLibset() {
- Set libs = new LinkedHashSet();
- Iterator iter = allLibraries.iterator();
- while (iter.hasNext()) {
- LibrarySet librarySet = (LibrarySet) iter.next();
- File basedir = librarySet.getDir(getProject());
- String[] libStrArray = librarySet.getLibs();
- for (int i = 0; i < libStrArray.length; i++) {
- if (basedir != null) {
- File libFile = new File(libStrArray[i]);
- if (libFile.isAbsolute()) {
- libs.add(libFile.getPath());
- } else {
- libs.add(basedir.getPath() + File.separatorChar
- + libFile.getPath());
- }
- } else {
- libs.add(libStrArray[i]);
- }
- }
- }
- return (String[]) libs.toArray(new String[libs.size()]);
- }
-
- public String getOutputDelimiter() {
- return outputDelimiter;
- }
-
- public void setOutputDelimiter(String outputDelimiter) {
- this.outputDelimiter = outputDelimiter;
- }
-
- public String getDpath() {
- return dpath;
- }
-
- public void setDpath(String dpath) {
- this.dpath = dpath;
- }
-
- public String getLibpath() {
- return libpath;
- }
-
- public void setLibpath(String libpath) {
- this.libpath = libpath;
- }
-
- public String getInclude() {
- return include;
- }
-
- public void setInclude(String include) {
- this.include = include;
- }
-
-}
diff --git a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java b/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java
deleted file mode 100644
index 491cadd7f5..0000000000
--- a/Tools/Java/Source/Cpptasks/net/sf/antcontrib/cpptasks/userdefine/UserDefineMapping.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- *
- * Copyright 2001-2004 The Ant-Contrib project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.antcontrib.cpptasks.userdefine;
-
-/**
- * Relationship between {family, command type} and flags
- *
- */
-public class UserDefineMapping {
-
- /**
- * Mapping info: include path delimiter <--> family (vendor) + command type
- */
- public static final String[][] includePathFlag = { { "MSFT_CC", "/I" },
- { "GCC_CC", "-I" }, { "INTEL_CC", "/I" },
- { "WINDDK_CC", "/I" }, { "MSFT_ASM", "/I" },
- { "GCC_ASM", "-I" }, { "WINDDK_CC", "/I" },
- { "MSFT_PP", "/I" }, { "GCC_PP", "-I" },
- { "WINDDK_PP", "/I" } };
-
- /**
- * Mapping info: output file flag <--> family (vendor) + command type
- */
- public static final String[][] outputFileFlag = { { "MSFT_CC", "/Fo" },
- { "GCC_CC", "-o" }, { "INTEL_CC", "/Fo" },
- { "WINDDK_CC", "/Fo" }, { "MSFT_SLINK", "/OUT:" },
- { "GCC_SLINK", "-cr" }, { "INTEL_SLINK", "/OUT:" },
- { "WINDDK_SLINK", "/OUT:" }, { "MSFT_DLINK", "/OUT:" },
- { "GCC_DLINK", "-o" }, { "INTEL_DLINK", "/OUT:" },
- { "WINDDK_DLINK", "/OUT:" }, { "MSFT_ASM", "/Fo" },
- { "GCC_ASM", "-o" }, { "WINDDK_ASM", "/Fo" },
- { "WINDDK_IPF_ASM", "-o" } };
-
- /**
- * Get include delimiter with vendow and command type.
- *
- * @param vendor
- * Vendor
- * @param commandType
- * Command Type
- * @return include path delimiter
- */
- public static String getIncludePathDelimiter(String vendor,
- String commandType) {
- String key = vendor + "_" + commandType;
- for (int i = 0; i < includePathFlag.length; i++) {
- if (includePathFlag[i][0].equalsIgnoreCase(key)) {
- return includePathFlag[i][1];
- }
- }
- return "/I";
- }
-
- /**
- * Get Output Flag with vendor and command type.
- *
- * @param vendor
- * Vendor
- * @param commandType
- * Command Type
- * @return Output File Flag
- */
- public static String getOutputFileFlag(String vendor, String commandType) {
- String key = vendor + "_" + commandType;
- for (int i = 0; i < outputFileFlag.length; i++) {
- if (outputFileFlag[i][0].equalsIgnoreCase(key)) {
- return outputFileFlag[i][1];
- }
- }
- return "/Fo";
- }
-
-} \ No newline at end of file
diff --git a/Tools/Java/Source/DbTools/DbTools.msa b/Tools/Java/Source/DbTools/DbTools.msa
deleted file mode 100644
index 254b0bec2d..0000000000
--- a/Tools/Java/Source/DbTools/DbTools.msa
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <MsaHeader>
- <ModuleName>Database Manipulation Tools</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>c51d72c2-6e85-4fcf-adb2-7c44b2f57f19</GuidValue>
- <Version>0.3</Version>
- <Abstract>The tool manipulates the FrameworkDatabase.db file</Abstract>
- <Description>
-This tool will scan the current workspace and update the FrameworkDatabase.db file if the workspace content is not consistent with the database.
-USAGE:
-DbTool [-v] [-t] [-q] [-V] [--package] [--platform] [-h | -? | --help]</Description>
- <Copyright>Copyright (c) 2006, Intel Corporation All rights reserved.</Copyright>
- <License URL="http://opensource.org/licenses/bsd-license.php">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.</License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>DbTools</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>src/org/tianocore/DbTools/UpdateDb.java</Filename>
- <Filename>src/org/tianocore/DbTools/DbTool.java</Filename>
- <Filename>src/org/tianocore/DbTools/DbCmds.java</Filename>
- <Filename>build.xml</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/DbTools/build.xml b/Tools/Java/Source/DbTools/build.xml
deleted file mode 100644
index 5ae43e9223..0000000000
--- a/Tools/Java/Source/DbTools/build.xml
+++ /dev/null
@@ -1,42 +0,0 @@
-<?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="DbTools" default="DbTools" basedir=".">
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <property name="WORKSPACE" value="${env.WORKSPACE}"/>
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars" includes="*.jar"/>
- <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
- </path>
- <property name="buildDir" value="build"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/Jars"/>
- <target name="DbTools" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="src" destdir="${buildDir}">
- <classpath refid="classpath"/>
- <!-- <compilerarg value="-Xlint"/> -->
- </javac>
- </target>
- <target name="clean">
- <delete dir="${buildDir}"/>
- </target>
- <target name="cleanall">
- <delete dir="${buildDir}"/>
- <delete file="${installLocation}/DbTools.jar"/>
- </target>
- <target name="install" depends="source">
- <jar destfile="${installLocation}/DbTools.jar">
- <fileset dir="${buildDir}"/>
- </jar>
- </target>
-</project>
diff --git a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbCmds.java b/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbCmds.java
deleted file mode 100644
index f4d45a4cbd..0000000000
--- a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbCmds.java
+++ /dev/null
@@ -1,501 +0,0 @@
-// @file
-// DbCmds command-line interface to the classes that
-// update the FrameworkDatabase.db file based on WORKSPACE Contents
-//
-// 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.
-//
-// This program is the command line interface to the CombineMsa class, which
-// will take the following arguments:
-//
-// Input:
-// -t, --test Test the Workspace against the FrameworkDatabase.db file
-// Returns 0 if valid, returns 1 if failed
-//
-// -f, --fix Fix the FrameworkDatabase.db file, so that it matches the
-// the contents of the WORKSPACE
-// Returns 0 if valid, returns 1 if failed
-//
-// -v [-v] Verbose Flag - sum of these will be used to set different
-// levels of verbosity
-//
-// -i Interactive, when used with -f or --fix, will query the user
-// regarding adds and deletes of packages and platforms from
-// the database.
-//
-// -a, --add Add an SPD or FPD file to the FrameworkDatabase.db file. The
-// SPD/FPD file must exist, or the command will fail.
-// Returns 0 if valid, returns 1 if failed
-//
-// -r, --del Remove an SPD or FPD file from the FrameworkDatabase.db file.
-// If the SPD/FPD file exists, the user will be queried to
-// remove it from the directory tree. For SPD files, the user
-// will also be presented with a list of Modules in the SPD
-// file, with the query to remove the modules as well as the
-// SPD file.
-// Returns 0 if valid, returns 1 if failed
-//
-// -u Display the UiName for all Packages and Platforms currently in
-// the FrameworkDatabase.db file.
-// Returns 0 if valid, returns 1 if failed
-//
-// -c Display a CSV listing of Type (SPD|FPD) UiName and Filename of
-// every entry in the FrameworkDatabase.db file.
-// Returns 0 if valid, returns 1 if failed
-//
-// No Options Display a list of Type (Package|Platfrom) and Filename of every
-// entry in the FrameworkDatabase.db file.
-// Returns 0 if valid, returns 1 if failed
-//
-// -h, -?, --help Displays this usage and exits.
-// Returns 0 if valid, returns 1 if failed
-//
-//
-// Output:
-// Displayed information
-//
-// Modifies - OPTIONAL
-// FrameworkDatabase.db
-//
-
-package org.tianocore.DbTools;
-
-import java.io.*;
-
-public class DbCmds {
-
- protected enum Cmd {
- SHOW_CSV, SHOW_PLATFORMS, SHOW_PACKAGES, FIX_DB, TEST_DB, FIND_SOMETHING, SHOW_FAR, ADD_SOMETHING,
- DELETE_SOMETHING
- }
-
- private int DEBUG = 0;
-
- private static final String copyright = "Copyright (c) 2006, Intel Corporation All rights reserved.";
-
- private static final String version = "Version 0.1";
-
- private static final String Specification = "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
-
- private int VERBOSE = 0;
-
- public boolean INTERACTIVE = false;
-
- private String workspace = System.getenv("WORKSPACE");
-
- private final String frameworkDatabase = workspace + File.separator + "Tools" + File.separator + "Conf"
- + File.separator + "FrameworkDatabase.db";
-
- private final int ESUCCESS = 0;
-
- private final int EFAILURE = 1;
-
- private final int MIN_VERBOSE = 0;
-
- private final int MED_VERBOSE = 1;
-
- private final int MAX_VERBOSE = 2;
-
- private final static int FOUND = 1;
-
- private final static int NOTFOUND = 0;
-
- private boolean TEST = false;
-
- private int result = ESUCCESS;
-
- private Cmd commandToCall;
-
- private boolean isPlatform = false;
-
- private boolean isPackage = false;
-
- private boolean isFar = false;
-
- private boolean QUIET = false;
-
- private String commandArgs = "";
-
- private String whatToFind = "";
-
- public int DbUpdateCmdLine(String[] args) {
-
- if (testFile(frameworkDatabase) == NOTFOUND) {
- System.out.println("ERROR: E000 Invalid Workspace!");
- System.out.println("The environment variable, WORKSPACE, does not point to a valid workspace");
- System.out.println("DbUpdate Aborted!");
- System.err.flush();
- System.exit(EFAILURE);
- }
- result = parseCmdLine(args);
- if (result == ESUCCESS) {
- if (DEBUG > 2)
- System.out.println("Parse Succeeded!");
- if (VERBOSE > MAX_VERBOSE)
- System.out.println("WORKSPACE: " + workspace);
- if (DEBUG > 1)
- System.out.println("Command to call: " + commandToCall.toString());
- result = processCmdLine(commandToCall);
- } else {
- if (QUIET == false) {
- System.out.println("Invalid Arguments");
- outputUsage();
- result = EFAILURE;
- }
- }
- if (DEBUG > 2)
- System.out.println(" Result: " + result);
-
- return result;
- }
-
- private int processCmdLine(Cmd cmdCode) {
- UpdateDb dbUp = new UpdateDb();
- int res = ESUCCESS;
- switch (cmdCode) {
- case SHOW_CSV:
- // display current Database contents in CSV format
- // Modifies: NOTHING
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Display contents of the FrameworkDatabase.db file in CSV format.");
- result = dbUp.getCsvEntries(frameworkDatabase, VERBOSE);
- break;
- case FIX_DB:
- // Automatically make the database match the contents of the workspace
- // Modifies: FrameworkDatabase.db
- if ((VERBOSE > MIN_VERBOSE) && (QUIET == false)) {
- if (TEST == false)
- System.out.println("Adjusting the FrameworkDatabase to match the contents of the WORKSPACE: "
- + workspace);
- if (TEST)
- System.out.println("Verify the FrameworkDatabase matches the contents of the WORKSPACE: "
- + workspace);
- }
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Scan the Workspace and update the FrameworkDatabase.db file.");
- result = dbUp.fixDatabase(workspace, VERBOSE, INTERACTIVE, TEST, QUIET);
-
- break;
- case ADD_SOMETHING:
- // Add a Platform, package or FAR to the workspace.
- // Modifies: FrameworkDatabase.db
- if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isPlatform))
- System.out.println("Add Platform " + commandArgs + " to the FrameworkDatabase.db file");
- else if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isPackage))
- System.out.println("Add Package " + commandArgs + " to the FrameworkDatabase.db file");
- else if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isFar))
- System.out.println("Add Framework Archive " + commandArgs + " to the FrameworkDatabase.db file");
- result = dbUp.addItem(frameworkDatabase, commandArgs, VERBOSE, INTERACTIVE);
- break;
- case DELETE_SOMETHING:
- // Remove a platform, package or FAR from the workspace
- // Modifies: FrameworkDatabase.db, AND Filesystem
- if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isPlatform))
- System.out.println("Removing Platform " + commandArgs + " from the FrameworkDatabase.db file");
- else if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isPackage))
- System.out.println("Removing Package " + commandArgs + " from the FrameworkDatabase.db file");
- else if (((DEBUG > 3) || (VERBOSE > MED_VERBOSE)) && (isFar))
- System.out.println("Removing Framework Archive " + commandArgs + " from the FrameworkDatabase.db file");
- result = dbUp.addItem(workspace, commandArgs, VERBOSE, INTERACTIVE);
- break;
- case FIND_SOMETHING:
- // Find something in the workspace
- // Modifies: NOTHING
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Finding " + whatToFind + " " + commandArgs + " in the Workspace");
- result = dbUp.findItem(workspace, VERBOSE, whatToFind, commandArgs);
- break;
- case SHOW_FAR:
- // Display FAR information for all SPDs in the workspace
- // Modifies: NOTHING
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Display Framework Archives in the Workspace");
- result = dbUp.findFars(workspace, VERBOSE);
- break;
- case SHOW_PACKAGES:
- // Display SPD information for all SPDs in the workspace
- // Modifies: NOTHING
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Display Packages in the Workspace");
- result = dbUp.findSpds(workspace, VERBOSE);
- break;
- case SHOW_PLATFORMS:
- // Display FPD information for all SPDs in the workspace
- // Modifies: NOTHING
- if ((DEBUG > 3) || (VERBOSE > MED_VERBOSE))
- System.out.println("Display Platforms in the Workspace");
- result = dbUp.findFpds(workspace, VERBOSE);
- break;
- default:
- // ERROR IF WE GET HERE!
- if ((DEBUG > 3) || (VERBOSE > MAX_VERBOSE))
- System.out.println("We could not process the following: " + commandToCall.toString());
- else if (QUIET == false)
- outputUsage();
- result = EFAILURE;
- break;
- }
- return res;
- }
-
- private int parseCmdLine(String[] args) {
-
- // Default is to fix the database.
- commandToCall = Cmd.FIX_DB;
- if (args.length == NOTFOUND) {
- if ((DEBUG > 3) || (VERBOSE > MAX_VERBOSE))
- System.out.println("NO ARGUMENTS! " + commandToCall.toString());
- return (ESUCCESS);
- }
-
- for (int i = 0; i < args.length; i++)
- if (args[i].toLowerCase().contentEquals("-q"))
- QUIET = true;
-
- for (int i = 0; i < args.length; i++) {
- String arg = args[i].trim();
- // This is the list of valid options
- if (!((arg.toLowerCase().startsWith("-t")) || (arg.toLowerCase().startsWith("--t"))
- || (arg.toLowerCase().startsWith("-q")) || (arg.toLowerCase().startsWith("-i"))
- || (arg.toLowerCase().startsWith("-f")) || (arg.toLowerCase().startsWith("--f"))
- || (arg.toLowerCase().startsWith("-c")) || (arg.toLowerCase().startsWith("--c"))
- || (arg.toLowerCase().startsWith("-a")) || (arg.toLowerCase().startsWith("--a"))
- || (arg.toLowerCase().startsWith("-r")) || (arg.toLowerCase().startsWith("--d"))
- || (arg.toLowerCase().startsWith("-v")) || (arg.toLowerCase().startsWith("--c"))
- || (arg.toLowerCase().startsWith("--p")) || (arg.toLowerCase().startsWith("-h"))
- || (arg.toLowerCase().startsWith("--h")) || (arg.toLowerCase().startsWith("/h")) || (arg
- .toLowerCase()
- .startsWith("-?")))) {
- // This is the fall through, we got something we did not know how to
- // process!
- if (args[i].startsWith("-")) {
- System.out.println("ERROR: E1004 Unknown Option: " + arg);
- System.out.println("Try running with -h or --help");
- } else {
- System.out.println("ERROR: E1005 Unknown Argument: " + arg);
- System.out.println("Try running with -h or --help");
- }
- System.out.println("Program Aborted!");
- System.err.flush();
- System.exit(EFAILURE);
- }
- if ((arg.toLowerCase().contentEquals("-t")) || (arg.toLowerCase().contains("--test"))) {
- // Test Workspace, do not fix.
- TEST = true;
- }
- if (arg.toLowerCase().contentEquals("-q")) {
- QUIET = true;
- }
- if (arg.toLowerCase().contentEquals("-i")) {
- INTERACTIVE = true;
- }
- if ((arg.toLowerCase().contentEquals("-f")) || (arg.toLowerCase().contains("--fix"))) {
- // Non-interactive fix of the database
- commandToCall = Cmd.FIX_DB;
- }
- if ((arg.toLowerCase().contentEquals("-c")) || (arg.toLowerCase().contains("--csv"))) {
- // Dump database in CSV format
- commandToCall = Cmd.SHOW_CSV;
- }
- if ((arg.toLowerCase().trim().contentEquals("-a")) || (arg.toLowerCase().contains("--add"))) {
- i++;
- if (args[i].startsWith("-")) {
- System.out.println("ERROR: E002 Missing Argument!");
- System.out
- .println("The add function requires an argument, either a package name or a platform name!");
- System.out.println("DbUpdate Aborted!");
- System.err.flush();
- System.exit(EFAILURE);
- }
- commandToCall = Cmd.ADD_SOMETHING;
- commandArgs = args[i];
- setArgType(commandArgs);
- }
- if ((arg.toLowerCase().trim().contentEquals("-r")) || (arg.toLowerCase().contains("--del"))) {
- i++;
- if (args[i].startsWith("-")) {
- System.out.println("ERROR: E002 Missing Argument!");
- System.out
- .println("The remove function requires an argument, either a package name or a platform name!");
- System.out.println("DbUpdate Aborted!");
- System.err.flush();
- System.exit(EFAILURE);
- }
- commandToCall = Cmd.DELETE_SOMETHING;
- commandArgs = args[i];
- setArgType(commandArgs);
- }
- if (arg.toLowerCase().contains("--find")) {
- commandToCall = Cmd.FIND_SOMETHING;
- i++;
- if (args[i].toLowerCase().contains("--lib"))
- whatToFind = "LIBRARY";
- else if (args[i].toLowerCase().contains("--guid"))
- whatToFind = "GUID";
- else if (args[i].toLowerCase().contains("--ppi"))
- whatToFind = "PPI";
- else if (args[i].toLowerCase().contains("--prot"))
- whatToFind = "PROTOCOL";
- else if (args[i].toLowerCase().contains("--pcd"))
- whatToFind = "PCD";
- else if (args[i].startsWith("-")) {
- System.out.println("ERROR: E001 Invalid Argument");
- System.out.println("The find function takes either a qualifier of --guid, --ppi,");
- System.out.println(" --proto, --pcd, or the string to search for.");
- System.err.flush();
- System.exit(EFAILURE);
- } else
- commandArgs = args[i];
-
- if (!whatToFind.contentEquals("")) {
- i++;
- if (args[i].startsWith("-")) {
- System.out.println("ERROR: E001 Invalid Argument");
- System.out.println("The find function qualifier (--guid, --ppi, --proto, --pcd)");
- System.out.println(" must be followed by the string to search for.");
- System.err.flush();
- System.exit(EFAILURE);
- } else
- commandArgs = args[i];
- }
-
- }
- if (arg.trim().contentEquals("-v")) {
- VERBOSE++;
- }
- if (arg.toLowerCase().contains("--lib")) {
- whatToFind = "LIBRARY";
- }
- if (arg.toLowerCase().contains("--guid")) {
- whatToFind = "GUID";
- }
- if (arg.toLowerCase().contains("--ppi")) {
- whatToFind = "PPI";
- }
- if (arg.toLowerCase().contains("--prot")) {
- whatToFind = "PROTOCOL";
- }
- if (arg.toLowerCase().contains("--pcd")) {
- whatToFind = "PCD";
- }
- if (arg.toLowerCase().contentEquals("-d") || arg.trim().toLowerCase().contains("--debug")) {
- if ((i + 1 == args.length) || (args[i + 1].trim().startsWith("-"))) {
- DEBUG = 1;
- } else if (i + 1 < args.length) {
- String pattern = "^\\d+";
- if (args[i + 1].trim().matches(pattern)) {
- i++;
- DEBUG = Integer.parseInt(args[i]);
- } else
- DEBUG = 1;
- }
- }
- if (arg.trim().contentEquals("-V")) {
- System.out.println("DbTools, " + version);
- System.out.println(copyright);
- System.out.println(Specification);
- System.err.flush();
- System.exit(ESUCCESS);
- }
- if (arg.toLowerCase().trim().startsWith("--pack")) {
- commandToCall = Cmd.SHOW_PACKAGES;
- }
- if (arg.toLowerCase().trim().startsWith("--far")) {
- commandToCall = Cmd.SHOW_FAR;
- }
- if (arg.toLowerCase().trim().startsWith("--plat")) {
- commandToCall = Cmd.SHOW_PLATFORMS;
- }
- if ((arg.toLowerCase().contentEquals("-h")) || (arg.toLowerCase().contentEquals("-?"))
- || (arg.toLowerCase().startsWith("/h")) || (arg.toLowerCase().contentEquals("--help"))) {
- outputUsage();
- System.exit(EFAILURE);
- }
-
- }
- return ESUCCESS;
- }
-
- private int testFile(String Filename) {
- File tFile = new File(Filename);
- if (DEBUG > 4)
- System.out.println("File is located: " + tFile.getPath());
- if (tFile.exists())
- return FOUND;
- else
- return NOTFOUND;
- }
-
- private void setArgType(String argv) {
- if (argv.trim().toLowerCase().contains(".spd"))
- isPackage = true;
- if (argv.trim().toLowerCase().contains(".fpd"))
- isPlatform = true;
- if (argv.trim().toLowerCase().contains(".far"))
- isFar = true;
- }
-
- public String getArgType() {
- String argt = "UNKNOWN";
- if (isPackage)
- argt = "SPD";
- if (isFar)
- argt = "FAR";
- if (isPlatform)
- argt = "FPD";
- return argt;
- }
-
- private static void outputUsage() {
-
- System.out.println("DbTool, " + version);
- System.out.println(copyright);
- System.out.println("Usage:");
- System.out.println(" DbTool [-v] [-t] [-q] [-V] [--package] [--platform] [-h | -? | --help]");
- System.out.println(" where:");
- System.out.println(" -h | -? | --help OPTIONAL - This Help Text");
- System.out
- .println(" -t | --test OPTIONAL - Test the FrameworkDatabase Contents against the WORKSPACE");
- System.out
- .println(" -q OPTIONAL - Quiet mode - pass or fail only on return value, nothing is printed");
- System.out
- .println(" -f | --fix OPTIONAL - Automatically fix (non-interactive) the Database file to match the WORKSPACE.");
- System.out
- .println(" -v OPTIONAL - Verbose, print information messages. Adding more -v arguments increases verbosity.");
- System.out.println(" --package OPTIONAL - Show all Packages installed in the WORKSPACE.");
- System.out.println(" --platforms OPTIONAL - Show all Platforms installed in the WORKSPACE.");
- System.out.println(" -V OPTIONAL - Display Version information and exit.");
- //
- // TODO: Implement the following options.
- //
- /**
- System.out.println("");
- System.out.println(" =================== Options below this line have not been implemented in this release ===================");
- System.out
- .println(" -i OPTIONAL - Force interactive on commands that modify the WORKSPACE");
- System.out
- .println(" --far OPTIONAL - Show all Framework Archives installed in the WORKSPACE.");
- System.out
- .println(" --find [qualifier] value OPTIONAL - Search the WORKSPACE for value, with one and only one optional Qualifier.");
- System.out.println(" qualifiers: --guid Find a GUID by Guid C Name");
- System.out.println(" --prot Find a Protocol or ProtocolNotify by C Name");
- System.out.println(" --ppi Find a PPI or PpiNotify by C Name");
- System.out.println(" --pcd Find a PCD entry by C Name");
- System.out.println(" --lib Find information about a Library Class");
- System.out
- .println(" -c OPTIONAL - Print a comma separated value listing of TYPE,UiName,Filename");
- System.out
- .println(" -a, --add value OPTIONAL - Add a value (package, platform or far) to the database");
- System.out
- .println(" -r, --del value OPTIONAL - Remove a value (package, platform or far) from the database");
- System.out.println("");
- */
- }
-}
diff --git a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbTool.java b/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbTool.java
deleted file mode 100644
index 5e502b710c..0000000000
--- a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/DbTool.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// @file
-// DbUpdate wrapper
-//
-// 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.
-//
-
-package org.tianocore.DbTools;
-
-public class DbTool {
-
- public static void main(String[] args) {
- if (new DbCmds().DbUpdateCmdLine(args) != 0)
- System.exit(1);
- System.exit(0);
- }
-}
diff --git a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/UpdateDb.java b/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/UpdateDb.java
deleted file mode 100644
index 6d3ef98fc9..0000000000
--- a/Tools/Java/Source/DbTools/src/org/tianocore/DbTools/UpdateDb.java
+++ /dev/null
@@ -1,594 +0,0 @@
-// @file
-// This Class processes multiple MSA files and merges them into a single,
-// merged MSA file. It will optionally add the merged MSA file into a package.
-//
-//
-// 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.
-//
-//
-
-package org.tianocore.DbTools;
-
-import java.io.*;
-import java.util.*;
-// import java.sql.Time;
-
-// import java.lang.*;
-// import java.lang.ExceptionInInitializerError;
-
-// import org.apache.xmlbeans.*;
-import org.apache.xmlbeans.XmlCursor;
-// import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-// import org.apache.xmlbeans.XmlException;
-import org.tianocore.*;
-
-// import org.tianocore.*;
-// FrameworkDatabase.db Schema Elements
-import org.tianocore.FrameworkDatabaseDocument.*;
-import org.tianocore.FdbHeaderDocument.*;
-import org.tianocore.PackageListDocument.*;
-import org.tianocore.PlatformListDocument.*;
-import org.tianocore.FarListDocument.*;
-
-// FAR Schema Elements
-// import org.tianocore.FrameworkArchiveManifestDocument.*;
-// import org.tianocore.FarHeaderDocument.*;
-// import org.tianocore.FarPackageDocument.*;
-// import org.tianocore.FarPlatformDocument.*;
-
-// FPD Schema Elements
-import org.tianocore.PlatformSurfaceAreaDocument.*;
-import org.tianocore.PlatformHeaderDocument.*;
-
-// import org.tianocore.FrameworkModulesDocument.*;
-// import org.tianocore.DynamicPcdBuildDefinitionsDocument.*;
-
-// SPD Schema Elements
-// import org.tianocore.PackageSurfaceAreaDocument.*;
-// import org.tianocore.SpdHeaderDocument.*;
-// import org.tianocore.LibraryClassDeclarationsDocument.*;
-// import org.tianocore.GuidDeclarationsDocument.*;
-// import org.tianocore.ProtocolDeclarationsDocument.*;
-// import org.tianocore.PpiDeclarationsDocument.*;
-// import org.tianocore.PcdDeclarationsDocument.*;
-
-// MSA Schema Elements
-// import org.tianocore.ModuleSurfaceAreaDocument.*;
-// import org.tianocore.MsaHeaderDocument.*;
-// import org.tianocore.LicenseDocument.*;
-// import org.tianocore.LibraryClassDefinitionsDocument.*;
-// import org.tianocore.PackageDependenciesDocument.*;
-// import org.tianocore.ProtocolsDocument.*;
-// import org.tianocore.PPIsDocument.*;
-// import org.tianocore.PcdCodedDocument.*;
-
-public class UpdateDb {
-
- private final int DEBUG = 0;
-
- private final int PASS = 0;
-
- private final int FAIL = 1;
-
- private int dCtr = 0;
-
- private int lCtr = 0;
-
- // Future implementations
- // private XmlCursor cursor = null;
-
- // FrameworkDatabase Component Elements
- // private FrameworkDatabaseDocument fdbDoc = null;
-
- // private FrameworkDatabase fdbInstance = null;
-
- // private FdbHeader fdbHeader = null;
-
- // private PackageList fdbPackageList = null;
-
- // private ArrayList<String> packageList = new ArrayList<String>();
-
- // private PlatformList fdbPlatformList = null;
-
- // private ArrayList<String> platformList = new ArrayList<String>();
-
- // private FarList fdbFarList = null;
-
- // private ArrayList<String> farList = new ArrayList<String>();
-
- private ArrayList<String> spdList = new ArrayList<String>();
-
- private ArrayList<String> fpdList = new ArrayList<String>();
-
- // Platform Components
- // private PlatformSurfaceAreaDocument fpdDoc = null;
-
- // private PlatformSurfaceArea fpd = null;
-
- // private PlatformHeader fpdHeader = null;
-
- private boolean wasModified = false;
-
- private int VERBOSE = 0;
-
- // The combineMsaFiles routine is the primary routine for creating a
- // Merged MSA file.
-
- public UpdateDb() {
- init();
- }
-
- private void init() {
-
- }
-
- public int getAllEntries(String dbFilename, int VERBOSE_FLAG) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int getCsvEntries(String dbFilename, int VERBOSE_FLAG) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int fixDatabase(String workspace, int VERBOSE_FLAG, boolean INTERACTIVE, boolean TEST, boolean QUIET) {
- int result = PASS;
- String dbFile = workspace + File.separator + "Tools" + File.separator + "Conf" + File.separator
- + "FrameworkDatabase.db";
- String dbBak = dbFile + ".bak";
-
- try {
- // Make a backup file for frameworkDatabase
- if (VERBOSE_FLAG > 3)
- System.out.println("Creating Backup file: " + dbBak);
- copyFile(dbFile, dbBak);
- } catch (IOException e) {
- System.out.println("Error: Cannot make backup file " + dbBak);
- return FAIL;
- }
-
- // Datebase update for SPD and FPD files
- result = fixDB(workspace, dbFile, VERBOSE_FLAG, INTERACTIVE, TEST, QUIET);
- if ((result == 0) && (TEST) && (QUIET == false))
- System.out.println("Workspace is consistent with current database!");
- return PASS;
- }
-
- public int addItem(String dbFilename, String item, int VERBOSE_FLAG, boolean INTERACTIVE) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int delItem(String workspace, String item, int VERBOSE_FLAG, boolean INTERACTIVE) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int findItem(String workspace, int VERBOSE_FLAG, String findWhat, String item) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int findFars(String workspace, int VERBOSE_FLAG) {
- System.out.println("Function not yet implemented!");
- return FAIL;
- }
-
- public int findSpds(String workspace, int VERBOSE_FLAG) {
- System.out.println("The following Package (SPD) files are in the workspace" + workspace);
- File wsDir = new File(workspace);
- findSPDFiles(wsDir, workspace, VERBOSE);
- for (int i = 0; i < spdList.size(); i++) {
- String Filename = workspace + File.separator + spdList.get(i).trim();
- File spdFilename = new File(Filename);
- try {
- FileReader fileReader = new FileReader(spdFilename);
- BufferedReader reader = new BufferedReader(fileReader);
- String PackageName = null;
- String rLine = null;
- while ((rLine = reader.readLine()) != null) {
- if (rLine.contains("<PackageName>")) {
- PackageName = rLine.replace("<PackageName>", "").trim();
- PackageName = PackageName.replace("</PackageName>", "").trim();
- System.out.printf(" %25s - %s\n",PackageName, spdList.get(i).trim());
- break;
- }
- }
- reader.close();
- } catch (IOException e) {
- System.out.println("ERROR Reading File: " + Filename + e);
- System.exit(FAIL);
- }
-
- }
- return PASS;
- }
-
- public int findFpds(String workspace, int VERBOSE_FLAG) {
- System.out.println("The following Platform (FPD) files are in the workspace: " + workspace);
- File wsDir = new File(workspace);
- findFPDFiles(wsDir, workspace, VERBOSE);
- for (int i = 0; i < fpdList.size(); i++) {
- String Filename = workspace + File.separator + fpdList.get(i).trim();
- File fpdFilename = new File(Filename);
- try {
- FileReader fileReader = new FileReader(fpdFilename);
- BufferedReader reader = new BufferedReader(fileReader);
- String PlatformName = null;
- String rLine = null;
- while ((rLine = reader.readLine()) != null) {
- if (rLine.contains("<PlatformName>")) {
- PlatformName = rLine.replace("<PlatformName>", "").trim();
- PlatformName = PlatformName.replace("</PlatformName>", "").trim();
- System.out.printf(" %25s - %s\n",PlatformName, fpdList.get(i).trim());
- break;
- }
- }
- reader.close();
- } catch (IOException e) {
- System.out.println("ERROR Reading File: " + Filename + e);
- System.exit(FAIL);
- }
- }
- return PASS;
- }
-
- // copy from source file to destination file
- private int copyFile(String src, String dst) throws IOException {
- try {
- File srcFile = new File(src);
- FileReader fileReader = new FileReader(srcFile);
- BufferedReader reader = new BufferedReader(fileReader);
-
- File dstFile = new File(dst);
- FileWriter fileWriter = new FileWriter(dstFile);
- BufferedWriter writer = new BufferedWriter(fileWriter);
-
- String line = null;
- while ((line = reader.readLine()) != null) {
- writer.write(line);
- writer.newLine();
- }
-
- reader.close();
- writer.close();
- } catch (IOException e) {
- System.out.println("I/O Exception during file copy: " + e);
- }
-
- return PASS;
- }
-
- private int fixDB(String workspace, String dbFile, int VERBOSE, boolean INTERACTIVE, boolean TEST, boolean QUIET) {
- File wsDir = new File(workspace);
- int retValue = PASS;
- // Find all .spd and .fpd files in workspace and put them in spdList and fpdList
- if (VERBOSE > 0)
- System.out.println("SPD File Search ");
- findSPDFiles(wsDir, workspace, VERBOSE);
- dCtr = 0;
- lCtr = 0;
- if (VERBOSE > 0) {
- System.out.println(" ");
- System.out.println("FPD File Search ");
- }
- findFPDFiles(wsDir, workspace, VERBOSE);
- if (VERBOSE > 0)
- System.out.println(" ");
-
- try {
- // check database file for possible update
- retValue = checkDBForUpdate(workspace, dbFile, VERBOSE, INTERACTIVE, TEST, QUIET);
- } catch (IOException e) {
- if (QUIET == false)
- System.out.println("Error: Updating " + dbFile + " file.");
- return FAIL;
- }
-
- if ((VERBOSE > 0) && (TEST) && (wasModified)) {
- System.out.println("FRAMEWORK Database does NOT match the contents of the WORKSPACE");
- retValue = FAIL;
- }
- if ((VERBOSE > 0) && (wasModified == false) && (QUIET == false))
- System.out.println("FRAMEWORK Database matches the contents of the WORKSPACE");
-
- return retValue;
- }
-
- private void findSPDFiles(File dir, String workspace, int VERBOSE) {
- String str;
-
- if (dir.isDirectory()) {
- dCtr++;
- String[] subdir = dir.list();
- if (dCtr >= 10) {
- if (VERBOSE > 2)
- System.out.print(".");
- dCtr = 0;
- lCtr++;
- }
- if (lCtr > 79) {
- if (VERBOSE > 2)
- System.out.println(" ");
- lCtr = 0;
- dCtr = 0;
- }
-
- for (int i = 0; i < subdir.length; i++) {
- findSPDFiles(new File(dir, subdir[i]), workspace, VERBOSE);
- }
- } else {
- if (dir.toString().toLowerCase().endsWith(".spd")) {
- str = dir.getPath().replace('\\', '/');
- workspace = workspace.replace('\\', '/');
- str = strStrip(str, workspace + "/");
- spdList.add(str.toString());
- if (VERBOSE == 2)
- System.out.println(" " + str);
- if (VERBOSE > 2)
- System.out.print("+");
- lCtr++;
- }
- }
-
- }
-
- private void findFPDFiles(File dir, String workspace, int VERBOSE) {
- String str;
-
- if (dir.isDirectory()) {
- String[] subdir = dir.list();
- if (dCtr >= 10) {
- if (VERBOSE > 2)
- System.out.print(".");
- dCtr = 0;
- lCtr++;
- }
- if (lCtr > 79) {
- if (VERBOSE > 2)
- System.out.println(" ");
- lCtr = 0;
- dCtr = 0;
- }
-
- for (int i = 0; i < subdir.length; i++) {
- findFPDFiles(new File(dir, subdir[i]), workspace, VERBOSE);
- }
- } else {
- if (dir.toString().toLowerCase().endsWith(".fpd")) {
- str = dir.getPath().replace('\\', '/');
- workspace = workspace.replace('\\', '/');
- str = strStrip(str, workspace + "/");
- fpdList.add(str.toString());
- if (VERBOSE == 2)
- System.out.println(" " + str);
- if (VERBOSE > 2)
- System.out.print("+");
- lCtr++;
- }
- }
- }
-
- private int checkDBForUpdate(String workspace, String dbFileName, int VERBOSE, boolean INTERACTIVE, boolean TEST, boolean QUIET)
- throws IOException {
- int SpdFlag = 0;
- int FpdFlag = 0;
- String SpdFile = null;
- String SpdFullFile = null;
- String FpdFile = null;
- String FpdFullFile = null;
-
- String tmpDbFile = dbFileName + ".tmp";
- String newSpd = null;
- String newFpd = null;
-
- FileReader fileReader = new FileReader(dbFileName);
- BufferedReader reader = new BufferedReader(fileReader);
-
- FileWriter fileWriter = new FileWriter(tmpDbFile);
- BufferedWriter writer = new BufferedWriter(fileWriter);
-
- String line = null;
- try {
- while ((line = reader.readLine()) != null) {
- if (line.indexOf("Added the following") >= 0) {
- wasModified = true;
- continue;
- }
- //
- // Process for .spd files
- //
- if (line.indexOf("<PackageList") >= 0) {
- SpdFlag = 1;
- } else {
- if (line.indexOf("</PackageList") >= 0) {
- SpdFlag = 2;
- }
- }
- if (SpdFlag == 1 && line.indexOf("Filename") >= 0) {
- SpdFile = strStrip(line, "<Filename>");
- SpdFile = strStrip(SpdFile, "</Filename>");
- SpdFile = SpdFile.trim();
- SpdFullFile = workspace + File.separator + SpdFile;
- if (!(new File(SpdFullFile)).exists()) {
- if (VERBOSE > 0)
- System.out.println("WARNING: Removing SPD file: " + SpdFile
- + "from the DB, as it does not exist!");
- wasModified = true;
- continue;
- }
- // Don't add files that are already in the database
- spdList.remove(SpdFile);
- }
- if (SpdFlag == 2) {
- int cflag = 0;
- for (int i = 0; i < spdList.size(); i++) {
- newSpd = spdList.get(i);
- newSpd = newSpd.trim();
- if (newSpd.length() > 0) {
- if (cflag == 0) {
- Calendar c = Calendar.getInstance();
- if (TEST == false)
- writer.write(" <!-- Adding the following SPD files " + c.getTime() + " -->\n");
- }
- if (VERBOSE > 0)
- System.out.println(" Adding SPD file: " + newSpd);
- if (TEST == false)
- writer.write(" <Filename>" + newSpd + "</Filename>\n");
- cflag++;
- wasModified = true;
- }
- }
- SpdFlag++;
- }
- //
- // Process for .fpd files
- //
- if (line.indexOf("<PlatformList") >= 0) {
- FpdFlag = 1;
- } else {
- if (line.indexOf("</PlatformList") >= 0) {
- FpdFlag = 2;
- }
- }
- if (FpdFlag == 1 && line.indexOf("Filename") >= 0) {
- FpdFile = strStrip(line, "<Filename>");
- FpdFile = strStrip(FpdFile, "</Filename>");
- FpdFile = FpdFile.trim();
- FpdFullFile = workspace + File.separator + FpdFile;
- if (!(new File(FpdFullFile)).exists()) {
- if (VERBOSE > 0)
- System.out.println("WARNING: Removing FPD file: " + FpdFile
- + " from the DB, as it does not exist!");
- wasModified = true;
- continue;
- }
- // Don't add files that are already in the database
- fpdList.remove(FpdFile);
- }
- if (FpdFlag == 2) {
- int cflag = 0;
- for (int i = 0; i < fpdList.size(); i++) {
- newFpd = fpdList.get(i);
- newFpd = newFpd.trim();
- if (newFpd.length() > 0) {
- if (cflag == 0) {
- Calendar c = Calendar.getInstance();
- if (TEST == false)
- writer.write(" <!-- Adding the following FPD files " + c.getTime() + " -->\n");
- }
- if (VERBOSE > 0)
- System.out.println(" Adding FPD file: " + newFpd);
- if (TEST == false)
- writer.write(" <Filename>" + newFpd + "</Filename>\n");
- cflag++;
- wasModified = true;
- }
- }
- FpdFlag++;
- }
-
- if (DEBUG > 2) {
- System.out.println(line);
- }
- if (TEST == false) {
- writer.write(line);
- writer.newLine();
- }
- }
- reader.close();
- writer.close();
-
- } catch (IOException e) {
- System.out.println("ERROR I/O Exception occured! " + e);
- System.exit(FAIL);
- }
-
- if (wasModified) {
- if ((VERBOSE > 0) && (QUIET == false))
- System.out.println("FrameworkDatabase has been UPDATED for this Workspace!\n");
- if (TEST == false)
- copyFile(tmpDbFile, dbFileName);
- } else {
- if ((VERBOSE > 0) && (QUIET == false))
- System.out.println("FrameworkDatabase correct for this Workspace!\n");
- }
-
- if (TEST == false) {
- File tmpFile = new File(tmpDbFile);
- if (tmpFile.exists()) {
- tmpFile.delete();
- }
- }
-
- return PASS;
- }
-
- static String strStrip(String str, String pattern) {
- int ps = 0;
- int pe = 0;
- StringBuffer result = new StringBuffer();
-
- while ((pe = str.indexOf(pattern, ps)) >= 0) {
- result.append(str.substring(ps, pe));
- ps = pe + pattern.length();
- }
- result.append(str.substring(ps));
- return result.toString();
- }
-
- private String checkDuplicateStrings(String aString, ArrayList<String> aList) {
- // This routine checks a string against an array.
- // If the string is found, it will return an empty string.
- // If the string is not found, it adds the string to the array, and
- // returns the string to the caller.
- for (int lctr = 0; lctr < aList.size(); lctr++) {
- if (DEBUG > 8)
- System.out.println("Comparing: \n" + aString.replace(" ", "").replace("\n", "") + "\nTo: \n"
- + aList.get(lctr).replace(" ", "").replace("\n", "").toString().trim());
- if (aString.replace(" ", "").replace("\n", "").contains(
- aList.get(lctr).replace(" ", "").replace("\n", "")
- .toString().trim())) {
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Found a duplicate String, skipping!");
- return "";
- }
- }
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Returning UNIQUE String!\n " + aString);
- aList.add(aString);
- return aString;
- }
-
- private static class XmlConfig {
- public static XmlCursor setupXmlCursor(XmlCursor cursor) {
- String uri = "http://www.TianoCore.org/2006/Edk2.0";
- cursor.push();
- cursor.toNextToken();
- cursor.insertNamespace("", uri);
- cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
- cursor.pop();
- return cursor;
-
- }
-
- public static XmlOptions setupXmlOptions() {
- XmlOptions options = new XmlOptions();
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- return options;
- }
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/FrameworkTasks.msa b/Tools/Java/Source/FrameworkTasks/FrameworkTasks.msa
deleted file mode 100644
index f7b1b6225f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/FrameworkTasks.msa
+++ /dev/null
@@ -1,81 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>Framework Tasks</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>50E76367-0233-4242-A1CA-42B1A4B36C07</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano Tool Resources Module</Abstract>
- <Description>
- This Module provides the EFI/Tiano Tools that are used to create EFI/Tiano
- Modules and Platform Binary Files (PBF)
- These tools require compilation only once if the Developer Workstation and
- the Developer's choice of HOST tool chain are stable. If the developer
- updates either the OS or the HOST tool chain, these tools should be rebuilt.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>frameworktasks.tasks</Filename>
- <Filename>org/tianocore/framework/tasks/Compress.java</Filename>
- <Filename>org/tianocore/framework/tasks/CompressHeader.java</Filename>
- <Filename>org/tianocore/framework/tasks/CompressSection.java</Filename>
- <Filename>org/tianocore/framework/tasks/CreateMtFileTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/Database.java</Filename>
- <Filename>org/tianocore/framework/tasks/EfiCompressTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/EfiDefine.java</Filename>
- <Filename>org/tianocore/framework/tasks/EfiRomTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/FfsHeader.java</Filename>
- <Filename>org/tianocore/framework/tasks/FfsTypes.java</Filename>
- <Filename>org/tianocore/framework/tasks/FileArg.java</Filename>
- <Filename>org/tianocore/framework/tasks/FlashMapTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/FwImageTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenAcpiTableTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenCRC32SectionTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenCapsuleHdrTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenDepexTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenFfsFileTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenFvImageTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenSectionTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GenTeImageTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/GuidChkTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/IncludePath.java</Filename>
- <Filename>org/tianocore/framework/tasks/Input.java</Filename>
- <Filename>org/tianocore/framework/tasks/InputFile.java</Filename>
- <Filename>org/tianocore/framework/tasks/MakeDeps.java</Filename>
- <Filename>org/tianocore/framework/tasks/ModifyInfTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/NestElement.java</Filename>
- <Filename>org/tianocore/framework/tasks/PeiReBaseTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/SecApResetVectorFixupTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/SecFixupTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/SectFile.java</Filename>
- <Filename>org/tianocore/framework/tasks/Section.java</Filename>
- <Filename>org/tianocore/framework/tasks/SetStampTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/SkipExt.java</Filename>
- <Filename>org/tianocore/framework/tasks/SplitfileTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/StrGatherTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/StripTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/Tool.java</Filename>
- <Filename>org/tianocore/framework/tasks/ToolArg.java</Filename>
- <Filename>org/tianocore/framework/tasks/VfrCompilerTask.java</Filename>
- <Filename>org/tianocore/framework/tasks/ZeroDebugDataTask.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/FrameworkTasks/build.xml b/Tools/Java/Source/FrameworkTasks/build.xml
deleted file mode 100644
index c3c86c987c..0000000000
--- a/Tools/Java/Source/FrameworkTasks/build.xml
+++ /dev/null
@@ -1,53 +0,0 @@
-<?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="FrameworkTasks" default="FrameworkTasks">
- <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="FrameworkTasks" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath>
- <fileset dir="${WORKSPACE}/Tools/Jars">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/FrameworkTasks" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: frameworktasks.jar"/>
- <delete file="${installLocation}/frameworktasks.jar"/>
- <if>
- <available file="${installLocation}/frameworktasks.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/frameworktasks.jar"/>
- <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>
- </then>
- </if>
- </target>
- <target name="install" depends="source">
- <copy file="frameworktasks.tasks" toDir="${buildDir}"/>
- <jar destfile="${installLocation}/frameworktasks.jar"
- basedir="${buildDir}"
- includes="**"
- />
- </target>
-</project>
diff --git a/Tools/Java/Source/FrameworkTasks/frameworktasks.tasks b/Tools/Java/Source/FrameworkTasks/frameworktasks.tasks
deleted file mode 100644
index 386c6e886a..0000000000
--- a/Tools/Java/Source/FrameworkTasks/frameworktasks.tasks
+++ /dev/null
@@ -1,25 +0,0 @@
-fwimage=org.tianocore.framework.tasks.FwImageTask
-setstamp=org.tianocore.framework.tasks.SetStampTask
-gendepex=org.tianocore.framework.tasks.GenDepexTask
-gensection=org.tianocore.framework.tasks.GenSectionTask
-genffsfile=org.tianocore.framework.tasks.GenFfsFileTask
-vfrcompile=org.tianocore.framework.tasks.VfrCompilerTask
-strgather=org.tianocore.framework.tasks.StrGatherTask
-genfvimage=org.tianocore.framework.tasks.GenFvImageTask
-guidchk= org.tianocore.framework.tasks.GuidChkTask
-gencrc32section=org.tianocore.framework.tasks.GenCRC32SectionTask
-makedeps=org.tianocore.framework.tasks.MakeDeps
-edkStrip=org.tianocore.framework.tasks.StripTask
-splitfile=org.tianocore.framework.tasks.SplitfileTask
-genacpitable=org.tianocore.framework.tasks.GenAcpiTableTask
-genteimage=org.tianocore.framework.tasks.GenTeImageTask
-secfixup=org.tianocore.framework.tasks.SecFixupTask
-peirebase=org.tianocore.framework.tasks.PeiReBaseTask
-eficompress=org.tianocore.framework.tasks.EfiCompressTask
-zerodebugdata=org.tianocore.framework.tasks.ZeroDebugDataTask
-createmtfile=org.tianocore.framework.tasks.CreateMtFileTask
-efirom=org.tianocore.framework.tasks.EfiRomTask
-secapresetvectorfixup=org.tianocore.framework.tasks.SecApResetVectorFixupTask
-gencapsulehdr=org.tianocore.framework.tasks.GenCapsuleHdrTask
-flashmap=org.tianocore.framework.tasks.FlashMapTask
-modifyinf=org.tianocore.framework.tasks.ModifyInfTask
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Compress.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Compress.java
deleted file mode 100644
index 4410ecdda1..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Compress.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/** @file
- Compress class.
-
- This class is to call CompressDll.dll to compress section.
-
- 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.
-
- **/
-
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-/**
-
- This class is to call CompressDll.dll to compress section.
-
-**/
-public class Compress {
- byte[] inputBuffer;
- byte[] outputBuffer;
- int size;
-
- static {
- String dllPath;
-
- dllPath = GenFfsFileTask.path;
- dllPath = dllPath +
- File.separator +
- "CompressDll.dll";
-
- System.load(dllPath);
- }
-
- /**
- CallCompress
-
- This function is to call the compressDll.dll to compress the contents in
- buffer.
-
- @param inputBuffer The input buffer.
- @param size The size of buffer in byte.
- @param dllPath The compressDll.dll path.
- @return The buffer contained the comrpessed input.
- **/
- public native byte[] CallCompress (byte[] inputBuffer, int size, String dllPath);
-
- /**
- Construct function
-
- This function is to initialize the class member and call the compress
- function.
-
- @param inBuffer The input buffer.
- @param size The size of buffer in byte.
- **/
- public Compress (byte[] inBuffer, int size){
- this.inputBuffer = inBuffer;
- this.size = size;
- String path = GenFfsFileTask.path;
-
- //
- // Call Compress function.
- //
- this.outputBuffer = CallCompress (
- this.inputBuffer,
- this.size,
- path
- );
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressHeader.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressHeader.java
deleted file mode 100644
index e1823329ff..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressHeader.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file
- CompressHeader class.
-
- This class is to generate the compressed section header.
-
- 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.
-
- **/
-
-package org.tianocore.framework.tasks;
-
-import org.apache.tools.ant.BuildException;
-/**
-
- Internal class: This class is to generate the compressed section header.
-
-**/
-public class CompressHeader {
-
- /**
- CommonSectionHeader
-
- This class define the compressed header structor.
-
- **/
- public class CommonSectionHeader {
- byte[] Size = new byte[3];
- byte type;
- }
-
- ///
- /// Section header.
- ///
- public CommonSectionHeader SectionHeader = new CommonSectionHeader();
-
- ///
- /// Length of uncompress section in byte.
- ///
- public int UncompressLen;
- ///
- /// Compress type.
- ///
- public byte CompressType;
-
- ///
- /// The size of compress header in byte.
- ///
- public int GetSize (){
- return 9;
- }
-
- ///
- /// Write class member to buffer.
- ///
- public void StructToBuffer (byte[] Buffer){
- if (Buffer.length != GetSize()) {
- throw new BuildException ("CompressHeader Buffer size is not correct!");
- }
- for (int i = 0; i < 3; i++){
- Buffer[i] = SectionHeader.Size[i];
- }
- Buffer[3] = SectionHeader.type;
- Buffer[4] = (byte)(UncompressLen & 0xff);
- Buffer[5] = (byte)((UncompressLen & 0xff00)>>8);
- Buffer[6] = (byte)((UncompressLen & 0xff0000)>>16);
- Buffer[7] = (byte)((UncompressLen & 0xff000000)>>24);
- Buffer[8] = CompressType;
- }
-
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java
deleted file mode 100644
index 3e2a98f695..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CompressSection.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/** @file
- CompressSection class.
-
- CompressSection indicate that all section which in it should be compressed.
-
- 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.
-
- **/
-
-
-package org.tianocore.framework.tasks;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tools.ant.BuildException;
-
-
-/**
- CompressSection
-
- CompressSection indicate that all section which in it should be compressed.
-
-**/
-public class CompressSection implements Section, FfsTypes {
- private int alignment = 0;
- //
- // The attribute of compressName.
- //
- private String compressName = "";
- //
- // The list contained the SectFile element.
- //
- private List<Section> sectList = new ArrayList<Section>();
-
- public static Object semaphore = new Object();
- /**
- toBuffer
-
- This function is to collect all sectFile and compress it , then output
- the result to buffer.
-
- @param Buffer The point of output buffer
-
- **/
- public void toBuffer (DataOutputStream buffer){
-
- Section sect;
-
- //
- // Get section file in compress node.
- //
- try{
-
- ByteArrayOutputStream bo = new ByteArrayOutputStream ();
- DataOutputStream Do = new DataOutputStream (bo);
-
- //
- // Get each section which under the compress {};
- // And add it is contains to File;
- //
- Iterator SectionIter = sectList.iterator();
- while (SectionIter.hasNext()){
- sect = (Section)SectionIter.next();
-
- //
- // Call each section class's toBuffer function.
- //
- try {
- sect.toBuffer(Do);
- }
- catch (BuildException e) {
- System.out.print(e.getMessage());
- throw new BuildException ("Compress.toBuffer failed at section");
- }
-
- }
- Do.close();
-
- synchronized (semaphore) {
- //
- // Call compress
- //
- byte[] fileBuffer = bo.toByteArray();
- Compress myCompress = new Compress(fileBuffer, fileBuffer.length);
-
- //
- // Add Compress header
- //
- CompressHeader Ch = new CompressHeader();
- Ch.SectionHeader.Size[0] = (byte)((myCompress.outputBuffer.length +
- Ch.GetSize()) &
- 0xff
- );
- Ch.SectionHeader.Size[1] = (byte)(((myCompress.outputBuffer.length +
- Ch.GetSize())&
- 0xff00) >> 8
- );
- Ch.SectionHeader.Size[2] = (byte)(((myCompress.outputBuffer.length +
- Ch.GetSize()) &
- 0xff0000) >> 16
- );
- Ch.SectionHeader.type = (byte) EFI_SECTION_COMPRESSION;
-
- //
- // Note: The compressName was not efsfective now. Using the
- // EFI_STANDARD_COMPRSSION for compressType .
- // That is follow old Genffsfile tools. Some code will be added for
- // the different compressName;
- //
- Ch.UncompressLen = fileBuffer.length;
- Ch.CompressType = EFI_STANDARD_COMPRESSION;
-
- //
- // Change header struct to byte buffer
- //
- byte [] headerBuffer = new byte[Ch.GetSize()];
- Ch.StructToBuffer(headerBuffer);
-
- //
- // First add CompressHeader to Buffer, then add Compress data.
- //
- buffer.write (headerBuffer);
- buffer.write(myCompress.outputBuffer);
-
- //
- // Buffer 4 Byte aligment
- //
- int size = Ch.GetSize() + myCompress.outputBuffer.length;
-
- while ((size & 0x03) != 0){
- size ++;
- buffer.writeByte(0);
- }
- //
- // Delete temp file
- //
- //di.close();
- //compressOut.delete();
- }
-
- }
- catch (Exception e){
- throw new BuildException("compress.toBuffer failed!\n");
- }
- }
-
- /**
- getCompressName
-
- This function is to get compressName.
-
- @return The compressName.
- **/
- public String getCompressName() {
- return compressName;
- }
-
- /**
- setCompressName
-
- This function is to set compressName.
-
- @param compressName The string of compressName
- **/
- public void setCompressName(String compressName) {
- this.compressName = compressName;
- }
-
- /**
- addSectFile
-
- This function is to add sectFile element to SectList.
-
- @param sectFile SectFile element which succeed from section class.
- **/
- public void addSectFile (SectFile sectFile) {
- sectList.add(sectFile);
-
- }
-
- /**
- addTool
-
- This function is to add tool element to SectList.
- @param tool Tool element which succeed from section class.
- **/
- public void addTool (Tool tool) {
- sectList.add(tool);
- }
-
- public int getAlignment() {
- return alignment;
- }
-
- public void setAlignment(int alignment) {
- if (alignment > 7) {
- this.alignment = 7;
- } else {
- this.alignment = alignment;
- }
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java
deleted file mode 100644
index 773df8e13b..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/CreateMtFileTask.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/** @file
- CreateMtFileTask class.
-
- CreateMtFileTask is used to call CreateMtFile.exe to create MT file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- CreateMtFileTask class.
-
- CreateMtFileTask is used to call CreateMtFile.exe to create MT file.
-**/
-public class CreateMtFileTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private String toolName = "CreateMtFile";
- //
- // file size
- //
- private ToolArg fileSize = new ToolArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
- /**
- execute
-
- StripTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + outputFile + fileSize;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.outputFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_ERROR, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getFileSize
-
- This function is to get class member "fileSize".
-
- @return fileSize string of file size.
- **/
- public String getFileSize() {
- return this.fileSize.getValue();
- }
-
- /**
- setFileSize
-
- This function is to set class member "fileSize".
-
- @param fileSize
- string of file size value.
- **/
- public void setFileSize(String fileSize) {
- this.fileSize.setArg(" ", fileSize);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Database.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Database.java
deleted file mode 100644
index ade950807c..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Database.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/** @file
- Database class.
-
- Database represents an exceplicity name list of database file.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-/**
- Database represents an exceplicity name list of database file.
-**/
-public class Database extends NestElement {
- /**
- Override NestElement.toString() to return a string with leading "-db"
-
- @return String
- **/
- public String toString() {
- return super.toString(" -db ");
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java
deleted file mode 100644
index f36aad6481..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiCompressTask.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/** @file
- EfiCompressTask class.
-
- EfiCompressTask is used to call EfiCompress.exe to strip input file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- EfiCompressTask class.
-
- EfiCompressTask is used to call EfiCompress.exe to strip input file.
-**/
-public class EfiCompressTask extends Task implements EfiDefine {
- //
- //
- //
- private final static String toolName = "EfiCompress";
- //
- // input file
- //
- private FileArg inputFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
- /**
- execute
-
- EfiCompressTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + inputFile + outputFile;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.inputFile.toFileList() + " => "
- + this.outputFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_ERROR, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
-
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiDefine.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiDefine.java
deleted file mode 100644
index 6f12f00f43..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiDefine.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- EfiDefine class.
-
- EfiDefine class records the UEFI return status value.
-
- 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.
-
- **/
-
-package org.tianocore.framework.tasks;
-
-/**
- EfiDefine class.
-
- EfiDefine class records the UEFI return status value.
-**/
-public interface EfiDefine {
- //
- // EFI define Interface for define constant related to UEFI.
- //
- static final int EFI_SUCCESS = 0;
- static final int EFI_LOAD_ERROR = 0x80000001;
- static final int EFI_INVALID_PARAMETER = 0x80000002;
- static final int EFI_UNSUPPORTED = 0x80000003;
- static final int EFI_BAD_BUFFER_SIZE = 0x80000004;
- static final int EFI_BUFFER_TOO_SMALL = 0x80000005;
- static final int EFI_NOT_READY = 0x80000006;
- static final int EFI_DEVICE_ERROR = 0x80000007;
- static final int EFI_WRITE_PROTECTED = 0x80000008;
- static final int EFI_OUT_OF_RESOURCES = 0x80000009;
- static final int EFI_VOLUME_CORRUPTED = 0x8000000a;
- static final int EFI_VOLUME_FULL = 0x8000000b;
- static final int EFI_NO_MEDIA = 0x8000000c;
- static final int EFI_MEDIA_CHANGED = 0x8000000d;
- static final int EFI_NOT_FOUND = 0x8000000e;
- static final int EFI_ACCESS_DENIED = 0x8000000f;
- static final int EFI_NO_RESPONSE = 0x80000010;
- static final int EFI_NO_MAPPING = 0x80000011;
- static final int EFI_TIMEOUT = 0x80000012;
- static final int EFI_NOT_STARTED = 0x80000013;
- static final int EFI_ALREADY_STARTED = 0x80000014;
- static final int EFI_ABORTED = 0x80000015;
- static final int EFI_ICMP_ERROR = 0x80000016;
- static final int EFI_TFTP_ERROR = 0x80000017;
- static final int EFI_PROTOCOL_ERROR = 0x80000018;
- static final int EFI_INCOMPATIBLE_VERSION = 0x80000019;
- static final int EFI_SECURITY_VIOLATION = 0x80000020;
- static final int EFI_CRC_ERROR = 0x80000021;
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java
deleted file mode 100644
index acfb2ba572..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/EfiRomTask.java
+++ /dev/null
@@ -1,376 +0,0 @@
-/** @file
- EfiRomTask class.
-
- EfiRomTask is used to call FlashMap.exe to lay out the flash.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-import java.util.LinkedList;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.tianocore.common.logger.EdkLog;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-/**
- SecFixupTask class.
-
- SecFixupTask is used to call SecFixup.exe to fix up sec image.
- **/
-public class EfiRomTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private final static String toolName = "EfiRom";
-
- //
- // Flash default file
- //
- private ToolArg verbose = new ToolArg();
-
- //
- // Flash device
- //
- private ToolArg venderId = new ToolArg();
-
- //
- // Flash device Image
- //
- private ToolArg deviceId = new ToolArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // binary file
- //
- private Input binaryFileList = new Input();
-
- //
- // Efi PE32 image file
- //
- private Input pe32FileList = new Input();
-
- //
- // Compress efi PE32 image file
- //
- private Input pe32ComprFileList = new Input();
-
- //
- // Hex class code in the PCI data strutor header
- //
- private ToolArg classCode = new ToolArg();
-
- //
- // Hex revision in the PCI data header.
- //
- private ToolArg revision = new ToolArg();
-
- //
- // Dump the headers of an existing option rom image.
- //
- private ToolArg dump = new ToolArg();
-
- //
- // output directory
- //
- private String outputDir = ".";
-
- //
- // command and argument list
- //
- LinkedList<String> argList = new LinkedList<String>();
-
- /**
- execute
-
- EfiRomTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- String argument = "" + verbose + venderId + deviceId + dump + revision + classCode
- + binaryFileList.toStringWithSinglepPrefix(" -b ")
- + pe32FileList.toStringWithSinglepPrefix(" -e ")
- + pe32ComprFileList.toStringWithSinglepPrefix(" -ec ")
- + outputFile;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, binaryFileList.toFileList()
- + pe32FileList.toFileList() + pe32ComprFileList.toFileList()
- + " => " + outputFile.toFileList());
-
- int exitCode = runner.execute();
- if (exitCode != 0) {
- //
- // command execution fail
- //
- EdkLog.log(this, "ERROR = " + Integer.toHexString(exitCode));
- throw new BuildException(toolName + " failed!");
- } else {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getVerbose
-
- This function is to get class member "verbose"
-
- @return verbose for verbose output.
- **/
- public String getVerbose() {
- return verbose.getValue();
- }
-
- /**
- setVerbose
-
- This function is to set class member "verbose"
-
- @param verbose for verbose output.
- **/
- public void setVerbose(boolean verbose) {
- if (verbose){
- this.verbose.setArg(" -", "p");
- }
- }
-
- /**
- getVenderId
-
- This function is to get class member "venderId"
-
- @return venderId String of venderId.
- **/
- public String getVenderId() {
- return venderId.getValue();
- }
-
- /**
- setVenderId
-
- This function is to set class member "venderId"
-
- @param venderId String of venderId.
- **/
- public void setVenderId(String venderId) {
- this.venderId.setArg(" -v ", venderId);
- }
-
- /**
- getDeviceId
-
- This function is to get class member "deviceId"
-
- @return deviceId String of device ID.
- **/
- public String getDeviceId() {
- return this.deviceId.getValue();
- }
-
- /**
- setDeviceId
-
- This function is to set class member "deviceId"
-
- @param deviceId String of device ID.
- **/
- public void setDeviceId(String deviceId) {
- this.deviceId.setArg(" -d ", deviceId);
- }
-
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile name of output directory.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "dscFile"
-
- @param outputFile name of DSC file
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" -o ", outputFile);
- }
-
- /**
- getClassCode
-
- This function is to get class member "classCode"
-
- @return fdImage name of class code file.
- **/
- public String getClassCode() {
- return classCode.getValue();
- }
-
- /**
- setclassCode
-
- This function is to set class member "classCode"
-
- @param fdImage name of class code file.
- **/
- public void setclassCode(String classCode) {
- this.classCode.setArg(" -cc ", classCode);
- }
-
- /**
- getRevision
-
- This function is to get class member "revision".
-
- @return revision hex revision in the PDI data header.
- **/
- public String getRevision() {
- return revision.getValue();
- }
-
- /**
- setRevision
-
- This function is to set class member "revision"
-
- @param revision hex revision in the PDI data header.
- **/
- public void setRevision(String revision) {
- this.revision.setArg(" -rev ", revision);
- }
-
- /**
- getFlashDeviceImage
-
- This function is to get class member "dump"
-
- @return flashDeviceImage name of flash device image
- **/
- public String getDump() {
- return dump.getValue();
- }
-
- /**
- setFlashDeviceImage
-
- This function is to set class member "dump"
-
- @param flashDeviceImage name of flash device image
- **/
- public void setDump(boolean dump) {
- if (dump) {
- this.dump.setArg(" -", "dump");
- }
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir string of output directory
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- addBinaryFile
-
- This function is to add binary file to binaryFile list.
-
- @param binaryFile name of binary file.
- **/
- public void addConfiguredBinaryFile(Input binaryFile){
- this.binaryFileList.insert(binaryFile);
- }
-
- /**
- addPe32File
-
- This function is to add pe32 file to pe32File list.
-
- @param pe32File name of pe32 file.
- **/
- public void addConfiguredPe32File(Input pe32File){
- this.pe32FileList.insert(pe32File);
- }
-
- /**
- addPe32ComprFile
-
- This function os to add compressed pe32 file to pe32ComprFile list.
-
- @param pe32ComprFile name of compressed pe32 file.
- **/
- public void addConfiguredPe32ComprFile(Input pe32ComprFile){
- this.pe32ComprFileList.insert(pe32ComprFile);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsHeader.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsHeader.java
deleted file mode 100644
index 24cb3df266..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsHeader.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/** @file
- FfsHeader
-
- FfsHeader class describe the struct of Ffs file header.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- FfsHeader
-
- FfsHeader class describe the struct of Ffs file header.
-**/
-public class FfsHeader {
-
- /**
- FfsGuid
-
- FfsGuid is interal class of FfsHeader, it describe the struct of Guid.
- **/
- public class FfsGuid {
-
- int data1 = 0;
- short data2 = 0;
- short data3 = 0;
- byte[] data4 = new byte[8];
- byte[] dataBuffer = new byte[16];
-
- /**
- bufferToStruct
-
- This function is to convert GUID to ffsGuid class member.
-
- @param dataBuffer Buffer contained the GUID value in byte.
- For example: if the input string as : "A6F691AC
- 31C8 4444 854C E2C1A6950F92"
- Then Data1: AC91F6A6
- Data2: C831
- Data3: 4444
- Data4: 4C85E2C1A6950F92
- **/
- public void bufferToStruct (byte[] dataBuffer){
- if (dataBuffer.length != 16) {
- throw new BuildException ("Buffer is not sized [" + dataBuffer.length + "] for data type, GUID!");
- }
-
- data1 = (int)(dataBuffer[3]& 0xff);
- data1 = data1 << 8;
- data1 = (int)data1 | (dataBuffer[2]& 0xff);
- data1 = ((data1 << 8) & 0xffff00) | (dataBuffer[1]& 0xff);
- data1 = ((data1 << 8) & 0xffffff00) | (dataBuffer[0]& 0xff);
-
-
- data2 = (short) (dataBuffer[5] & 0xff);
- data2 = (short)((data2 << 8) | (dataBuffer[4]& 0xff));
-
- data3 = (short)(dataBuffer[7] & 0xff);
- data3 = (short)((data3 << 8) | (dataBuffer[6] & 0xff));
-
- for (int i = 0; i < 8; i++) {
- data4[i] = dataBuffer[i+8];
- }
-
- }
-
- /**
- structToBuffer
-
- This function is to store ffsHeader class member to buffer.
-
- @return Byte buffer which contained the ffsHeader class member
- **/
- public byte[] structToBuffer (){
-
- byte[] buffer = new byte [16];
-
- buffer[3] = (byte)(data1 & 0x000000ff);
- buffer[2] = (byte)((data1 & 0x0000ff00)>> 8);
- buffer[1] = (byte)((data1 & 0x00ff0000)>> 16);
- buffer[0] = (byte)((data1 & 0xff000000)>> 24);
-
- buffer[5] = (byte)(data2 & 0x00ff);
- buffer[4] = (byte)((data2 & 0xff00)>> 8);
-
- buffer[7] = (byte)(data3 & 0x00ff);
- buffer[6] = (byte)((data3 & 0xff00)>> 8);
-
- for (int i = 8; i < 16; i++) {
- buffer[i] = data4[i-8];
- }
- return buffer;
- }
-
-
- }
-
- /**
- integrityCheckSum
-
- This class is used to record the struct of checksum.
- **/
- public class IntegrityCheckSum {
- byte header;
- byte file;
- }
-
- ///
- /// Guid
- ///
- FfsGuid name = new FfsGuid();
-
- ///
- /// CheckSum
- ///
- IntegrityCheckSum integrityCheck = new IntegrityCheckSum();
-
- ///
- /// File type
- ///
- byte fileType;
- ///
- /// Ffs attributes.
- ///
- byte ffsAttributes;
- ///
- /// Ffs file size
- ///
- byte[] ffsFileSize = new byte[3];
- ///
- /// Ffs state.
- ///
- byte ffsState;
-
- /**
- structToBuffer
-
- This function is to store FfsHeader class member to buffer.
-
- @return Byte buffer which contained the FfsHeader class member.
- **/
- public byte[] structToBuffer () {
- int i;
- byte[] buffer1;
- byte[] buffer = new byte[24];
- buffer1 = name.structToBuffer();
-
- for (i = 0; i < 16; i++) {
- buffer[i] = buffer1[i];
- }
-
- buffer[16] = integrityCheck.header;
- buffer[17] = integrityCheck.file;
- buffer[18] = fileType;
- buffer[19] = ffsAttributes;
-
- for (i=20; i < 23; i++) {
- buffer[i] = ffsFileSize[i-20];
- }
-
- buffer[23] = ffsState;
- return buffer;
- }
-
- /**
- getSize
-
- This function is to get the size of FfsHeader in byte.
-
- @return The size of FfsHeader.
- **/
- public int getSize(){
- return 24;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsTypes.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsTypes.java
deleted file mode 100644
index 6afc3a90ad..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FfsTypes.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/** @file
- FfsTypes class.
-
- FfsType class record the costant value of Ffs File attribute, type, and
- architecture.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-/**
- FfsType
-
- FfsType class record the costant value of Ffs File attribute, type, and
- architecture.
-
-**/
-public interface FfsTypes {
- //
- // Ffs file attributes
- //
- static final int FFS_ATTRIB_TAIL_PRESENT = 0x01;
-
- static final int FFS_ATTRIB_RECOVERY = 0x02;
-
- static final int FFS_ATTRIB_HEADER_EXTENSION = 0x04;
-
- static final int FFS_ATTRIB_DATA_ALIGNMENT = 0x38;
-
- static final int FFS_ATTRIB_CHECKSUM = 0x40;
-
- //
- // Ffs states difinitions
- //
- static final int EFI_FILE_HEADER_CONSTRUCTION = 0x01;
-
- static final int EFI_FILE_HEADER_VALID = 0x02;
-
- static final int EFI_FILE_DATA_VALID = 0x04;
-
- static final int EFI_FILE_MARKED_FOR_UPDATE = 0x08;
-
- static final int EFI_FILE_DELETED = 0x10;
-
- static final int EFI_FILE_HEADER_INVALID = 0x20;
-
- //
- // FFS_FIXED_CHECKSUM is the default checksum value used when the
- // FFS_ATTRIB_CHECKSUM attribute bit is clear note this is NOT an
- // architecturally defined value, but is in this file for implementation
- // convenience
- //
- static final int FFS_FIXED_CHECKSUM = 0x5a;
-
- //
- // Architectural file types
- //
- static final int EFI_FV_FILETYPE_ALL = 0x00;
-
- static final int EFI_FV_FILETYPE_RAW = 0x01;
-
- static final int EFI_FV_FILETYPE_FREEFORM = 0x02;
-
- static final int EFI_FV_FILETYPE_SECURITY_CORE = 0x03;
-
- static final int EFI_FV_FILETYPE_PEI_CORE = 0x04;
-
- static final int EFI_FV_FILETYPE_DXE_CORE = 0x05;
-
- static final int EFI_FV_FILETYPE_PEIM = 0x06;
-
- static final int EFI_FV_FILETYPE_DRIVER = 0x07;
-
- static final int EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER = 0x08;
-
- static final int EFI_FV_FILETYPE_APPLICATION = 0x09;
-
- static final int EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE = 0x0B;
-
- static final int EFI_FV_FILETYPE_FFS_PAD = 0xF0;
-
- //
- // Ffs file type
- //
- static final String EFI_FV_FFS_FILETYPE_STR = ".FFS";
- static final String EFI_FV_DXE_FILETYPE_STR = ".DXE";
- static final String EFI_FV_PEI_FILETYPE_STR = ".PEI";
- static final String EFI_FV_APP_FILETYPE_STR = ".APP";
- static final String EFI_FV_FVI_FILETYPE_STR = ".FVI";
- static final String EFI_FV_SEC_FILETYPE_STR = ".SEC";
-
- //
- // Section Type copy from EfiImageFormat.h
- //
- static final int EFI_SECTION_COMPRESSION = 0x01;
- static final int EFI_SECTION_GUID_DEFINED = 0x02;
-
- //
- // CompressionType values, we currently don't support
- // "EFI_CUSTOMIZED_COMPRESSION".
- //
- static final int EFI_NOT_COMPRESSED = 0x00;
- static final int EFI_STANDARD_COMPRESSION = 0x01;
- static final int EFI_CUSTOMIZED_COMPRESSION = 0x02;
-
-
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FileArg.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FileArg.java
deleted file mode 100644
index 86adb07581..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FileArg.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/** @file
-This file is used to nest elements which is meant for file path
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-/**
- FileArg class is defined to represent tool's argument which specifies file path.
- **/
-public class FileArg extends ToolArg {
- /**
- Default constructor
- **/
- public FileArg() {
- }
-
- /**
- Constructor which accepts argument prefix and its value as parameters
-
- @param prefix The prefix of argument
- @param value The value of argument
- **/
- public FileArg(String prefix, String value) {
- super(prefix);
- this.setValue(value);
- }
-
- /**
- Set the prefix and value of an argument
-
- @param prefix The prefix of argument
- @param value The value of argument
- **/
- public void setArg(String prefix, String value) {
- super.setPrefix(prefix);
- this.setValue(value);
- }
-
- /**
- Set the value of an argument
-
- @param value The value of the argument
- **/
- public void setValue(String value) {
- super.setFile(value);
- }
-
- /**
- Add a value of an argument
-
- @param value The value of the argument
- **/
- public void insValue(String value) {
- super.insFile(value);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java
deleted file mode 100644
index 9a3c61e6c8..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FlashMapTask.java
+++ /dev/null
@@ -1,848 +0,0 @@
-/** @file
- FlashMapTask class.
-
- FlashMapTask is used to call FlashMap.exe to lay out the flash.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.BufferedReader;
-
-import java.util.List;
-import java.util.ArrayList;
-import java.util.regex.Pattern;
-import java.util.regex.Matcher;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- * FlashMapTask class.
- *
- * FlashMapTask is used to call FlashMap.exe to generate flash map defition files and fd files.
- */
-public class FlashMapTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private static final String toolName = "FlashMap";
-
- //
- //
- //
- private static Pattern fileBlock = Pattern.compile("\\s*File\\s*\\{([^\\{\\}]+)\\}");
- private static Pattern fileNameDef = Pattern.compile("\\bName\\s*=\\s*\"([^\"]+)\"");
-
- //
- // Flash definition file
- //
- private FileArg flashDefFile = new FileArg();
-
- //
- // Flash device
- //
- private ToolArg flashDevice = new ToolArg();
-
- //
- // Flash device Image
- //
- private ToolArg flashDeviceImage = new ToolArg();
-
- //
- // MCI file
- //
- private FileArg mciFile = new FileArg();
-
- //
- // MCO file
- //
- private FileArg mcoFile = new FileArg();
-
- //
- // Discover FD image
- //
- private ToolArg fdImage = new ToolArg();
-
- //
- // Dsc file
- //
- private FileArg dscFile = new FileArg();
-
- //
- // Asm INC file
- //
- private FileArg asmIncFile = new FileArg();
-
- //
- // Image out file
- //
- private FileArg imageOutFile = new FileArg();
-
- //
- // Header file
- //
- private FileArg headerFile = new FileArg();
-
- //
- // Input string file
- //
- private String inStrFile = "";
-
- //
- // Output string file
- //
- private String outStrFile = "";
-
- //
- //
- //
- private FileArg strFile = new FileArg();
- //
- // Base address
- //
- private ToolArg baseAddr = new ToolArg();
-
- //
- // Aligment
- //
- private ToolArg aligment = new ToolArg();
-
- //
- // Padding value
- //
- private ToolArg padValue = new ToolArg();
-
- //
- // output directory
- //
- private String outputDir = ".";
-
- //
- // MCI file array
- //
- FileArg mciFileArray = new FileArg();
-
- /**
- execute
-
- FlashMapTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
- if (isUptodate()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, headerFile.toFileList()
- + imageOutFile.toFileList()
- + mcoFile.toFileList()
- + dscFile.toFileList()
- + asmIncFile.toFileList()
- + outStrFile
- + " is up-to-date!");
- return;
- }
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- //
- // add substituted input file and output file
- //
- if (this.inStrFile != null && this.outStrFile != null
- && this.inStrFile.length() > 0 && this.outStrFile.length() > 0) {
- strFile.setPrefix(" -strsub ");
- strFile.insValue(this.inStrFile);
- strFile.insValue(this.outStrFile);
- }
-
- String argument = "" + flashDefFile + flashDevice + flashDeviceImage
- + mciFile + mcoFile + fdImage + dscFile + asmIncFile
- + imageOutFile + headerFile + strFile + baseAddr
- + aligment + padValue + mciFileArray;
-
-
- //
- // lauch the program
- //
- // ProcessBuilder pb = new ProcessBuilder(argList);
- // pb.directory(new File(outputDir));
- int exitCode = 0;
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
-
- if (outputDir != null) {
- runner.setWorkingDirectory(new File(outputDir));
- }
- //
- // log command line string.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, flashDefFile.toFileList()
- + mciFile.toFileList()
- + mciFileArray.toFileList()
- + fdImage.toFileList()
- + inStrFile
- + " => "
- + headerFile.toFileList()
- + imageOutFile.toFileList()
- + mcoFile.toFileList()
- + dscFile.toFileList()
- + asmIncFile.toFileList()
- + outStrFile);
-
- exitCode = runner.execute();
- if (exitCode != 0) {
- EdkLog.log(this, "ERROR = " + Integer.toHexString(exitCode));
- } else {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "FlashMap succeeded!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- } finally {
- if (exitCode != 0) {
- throw new BuildException("FlashMap failed!");
- }
- }
- }
-
- /**
- getFlashDefFile
-
- This function is to get class member "flashDefFile"
-
- @return flashDeFile Name of flash definition file.
- **/
- public String getFlashDefFile() {
- return this.flashDefFile.getValue();
- }
-
- /**
- setFlashDefFile
-
- This function is to set class member "flashDefFile"
-
- @param flashDefFile
- Name of flash definition file.
- **/
- public void setFlashDefFile(String flashDefFile) {
- this.flashDefFile.setArg(" -fdf ", flashDefFile);
- }
-
- /**
- getAligment
-
- This function is to get class member "aligment"
-
- @return aligment String of aligment value.
- **/
- public String getAligment() {
- return this.aligment.getValue();
- }
-
- /**
- setAligment
-
- This function is to set class member "aligment"
-
- @param aligment
- String of aligment value.
- **/
- public void setAligment(String aligment) {
- this.aligment.setArg(" -align ", aligment);
- }
-
- /**
- getAsmIncFile
-
- This function is to get class member "asmIncFile"
-
- @return asmIncFile String of ASM include file.
- **/
- public String getAsmIncFile() {
- return this.asmIncFile.getValue();
- }
-
- /**
- setAsmIncFile
-
- This function is to set class member "asmIncFile"
-
- @param asmIncFile
- String of ASM include file.
- **/
- public void setAsmIncFile(String asmIncFile) {
- this.asmIncFile.setArg(" -asmincfile ", asmIncFile);
- }
-
- /**
- getBaseAddr
-
- This function is to get class member "baseAddr"
-
- @return baseAddr String of base address value.
- **/
- public String getBaseAddr() {
- return this.baseAddr.getValue();
- }
-
- /**
- setBaseAddr
-
- This function is to set class member "baseAddr"
-
- @param baseAddr
- String of base address value.
- **/
- public void setBaseAddr(String baseAddr) {
- this.baseAddr.setArg(" -baseaddr ", baseAddr);
- }
-
- /**
- getDscFile
-
- This function is to get class member "dscFile"
-
- @return dscFile name of DSC file
- **/
- public String getDscFile() {
- return this.dscFile.getValue();
- }
-
- /**
- setDscFile
-
- This function is to set class member "dscFile"
-
- @param dscFile
- name of DSC file
- **/
- public void setDscFile(String dscFile) {
- this.dscFile.setArg(" -dsc ", dscFile);
- }
-
- /**
- getFdImage
-
- This function is to get class member "fdImage"
-
- @return fdImage name of input FDI image file.
- **/
- public String getFdImage() {
- return this.fdImage.getValue();
- }
-
- /**
- setFdImage
-
- This function is to set class member "fdImage"
-
- @param fdImage
- name of input FDI image file.
- **/
- public void setFdImage(String fdImage) {
- this.fdImage.setArg(" -discover ", fdImage);
- }
-
- /**
- getFlashDevice
-
- This function is to get class member "flashDevice".
-
- @return flashDevice name of flash device.
- **/
- public String getFlashDevice() {
- return this.flashDevice.getValue();
- }
-
- /**
- setFlashDevice
-
- This function is to set class member "flashDevice"
-
- @param flashDevice
- name of flash device.
- **/
- public void setFlashDevice(String flashDevice) {
- this.flashDevice.setArg(" -flashdevice ", flashDevice);
- }
-
- /**
- getFlashDeviceImage
-
- This function is to get class member "flashDeviceImage"
-
- @return flashDeviceImage name of flash device image
- **/
- public String getFlashDeviceImage() {
- return this.flashDeviceImage.getValue();
- }
-
- /**
- setFlashDeviceImage
-
- This function is to set class member "flashDeviceImage"
-
- @param flashDeviceImage
- name of flash device image
- **/
- public void setFlashDeviceImage(String flashDeviceImage) {
- this.flashDeviceImage.setArg(" -flashdeviceimage ", flashDeviceImage);
-
- }
-
- /**
- getHeaderFile
-
- This function is to get class member "headerFile"
-
- @return headerFile name of include file
- **/
- public String getHeaderFile() {
- return this.headerFile.getValue();
- }
-
- /**
- setHeaderFile
-
- This function is to set class member "headerFile"
-
- @param headerFile
- name of include file
- **/
- public void setHeaderFile(String headerFile) {
- this.headerFile.setArg(" -hfile ", headerFile);
- }
-
- /**
- getImageOutFile
-
- This function is to get class member "imageOutFile"
-
- @return imageOutFile name of output image file
- **/
- public String getImageOutFile() {
- return this.imageOutFile.getValue();
- }
-
- /**
- setImageOutFile
-
- This function is to set class member "ImageOutFile"
-
- @param imageOutFile
- name of output image file
- **/
- public void setImageOutFile(String imageOutFile) {
- this.imageOutFile.setArg(" -imageout ", imageOutFile);
- }
-
- /**
- getInStrFile
-
- This function is to get class member "inStrFile"
-
- @return inStrFile name of input file which used to replace symbol names.
- **/
- public String getInStrFile() {
- return this.inStrFile;
- }
-
- /**
- setInStrFile
-
- This function is to set class member "inStrFile"
-
- @param inStrFile
- name of input file which used to replace symbol names.
- **/
- public void setInStrFile(String inStrFile) {
- this.inStrFile = inStrFile;
- }
-
- /**
- getMciFile
-
- This function is to get class member "mciFile"
-
- @return mciFile name of input microcode file
- **/
- public String getMciFile() {
- return this.mciFile.getValue();
- }
-
- /**
- setMciFile
-
- This function is to set class member "mciFile"
-
- @param mciFile
- name of input microcode file
- **/
- public void setMciFile(String mciFile) {
- this.mciFile.setArg(" -mci ", mciFile);
- }
-
- /**
- getMcoFile
-
- This function is to get class member "mcoFile"
-
- @return mcoFile name of output binary microcode image
- **/
- public String getMcoFile() {
- return this.mcoFile.getValue();
- }
-
- /**
- setMcoFile
-
- This function is to set class member "mcoFile"
-
- @param mcoFile
- name of output binary microcode image
- **/
- public void setMcoFile(String mcoFile) {
- this.mcoFile.setArg(" -mco ", mcoFile);
- }
-
- /**
- getOutStrFile
-
- This function is to get class member "outStrFile"
-
- @return outStrFile name of output string substitution file
- **/
- public String getOutStrFile() {
- return this.outStrFile;
- }
-
- /**
- setOutStrFile
-
- This function is to set class member "outStrFile"
-
- @param outStrFile
- name of output string substitution file
- **/
- public void setOutStrFile(String outStrFile) {
- this.outStrFile = outStrFile;
- }
-
- /**
- getPadValue
-
- This function is to get class member "padValue"
-
- @return padValue string of byte value to use as padding
- **/
- public String getPadValue() {
- return this.padValue.getValue();
- }
-
- /**
- setPadValue
-
- This function is to set class member "padValue"
-
- @param padValue
- string of byte value to use as padding
- **/
- public void setPadValue(String padValue) {
- this.padValue.setArg(" -padvalue ", padValue);
- }
-
- /**
- addMciFile
-
- This function is to add Microcode binary file
-
- @param mciFile
- instance of input class
- **/
- public void addConfiguredMciFile(FileArg mciFile) {
- this.mciFileArray.setPrefix(" -mcmerge ");
- this.mciFileArray.insert(mciFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- //
- // Dependency check
- //
- private boolean isUptodate() {
- long srcTimeStamp = 0;
- String srcName = "";
- String dstName = "";
- long timeStamp = 0;
-
- if (!flashDefFile.isEmpty()) {
- srcName = flashDefFile.getValue();
- timeStamp = new File(srcName).lastModified();
- if (timeStamp > srcTimeStamp) {
- srcTimeStamp = timeStamp;
- }
- }
-
- if (!mciFile.isEmpty()) {
- srcName = mciFile.getValue();
- timeStamp = new File(srcName).lastModified();
- if (timeStamp > srcTimeStamp) {
- srcTimeStamp = timeStamp;
- }
- }
-
- if (!fdImage.isEmpty()) {
- srcName = fdImage.getValue();
- timeStamp = new File(srcName).lastModified();
- if (timeStamp > srcTimeStamp) {
- srcTimeStamp = timeStamp;
- }
- }
-
- if (inStrFile.length() != 0) {
- srcName = inStrFile;
- timeStamp = new File(srcName).lastModified();
- if (timeStamp > srcTimeStamp) {
- srcTimeStamp = timeStamp;
- }
- }
-
- if (!mciFileArray.isEmpty()) {
- for (int i = 0; i < mciFileArray.nameList.size(); ++i) {
- srcName += mciFileArray.nameList.get(i) + " ";
- timeStamp = new File(mciFileArray.nameList.get(i)).lastModified();
- if (timeStamp > srcTimeStamp) {
- srcTimeStamp = timeStamp;
- }
- }
- }
-
- if (!headerFile.isEmpty()) {
- dstName = headerFile.getValue();
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
- }
-
- if (!imageOutFile.isEmpty()) {
- dstName = imageOutFile.getValue();
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
-
- //
- // we need to check the time stamp of each FV file specified in fdf file
- //
- if (!isFdUptodate(dstName, getFvFiles(flashDefFile.getValue()))) {
- return false;
- }
- }
-
- if (!mcoFile.isEmpty()) {
- dstName = mcoFile.getValue();
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
- }
-
- if (!dscFile.isEmpty()) {
- dstName = dscFile.getValue();
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
- }
-
- if (!asmIncFile.isEmpty()) {
- dstName = asmIncFile.getValue();
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
- }
-
- if (outStrFile.length() != 0) {
- dstName = outStrFile;
- File dstFile = new File(dstName);
- if (!dstFile.isAbsolute()) {
- dstName = outputDir + File.separator + dstName;
- dstFile = new File(dstName);
- }
-
- if (srcTimeStamp > dstFile.lastModified()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, srcName + " has been changed since last build!");
- return false;
- }
- }
-
- return true;
- }
-
- //
- // Parse the flash definition file and find out the FV file names
- //
- private List<String> getFvFiles(String fdfFileName) {
- File fdfFile = new File(fdfFileName);
- int fileLength = (int)fdfFile.length();
- char[] fdfContent = new char[fileLength];
- List<String> fileList = new ArrayList<String>();
-
- try {
- FileReader reader = new FileReader(fdfFile);
- BufferedReader in = new BufferedReader(reader);
-
- in.read(fdfContent, 0, fileLength);
- String str = new String(fdfContent);
-
- //
- // match the
- // File {
- // ...
- // }
- // block
- //
- Matcher matcher = fileBlock.matcher(str);
- while (matcher.find()) {
- String fileBlockContent = str.substring(matcher.start(1), matcher.end(1));
- //
- // match the definition like
- // Name = "..."
- //
- Matcher nameMatcher = fileNameDef.matcher(fileBlockContent);
- if (nameMatcher.find()) {
- fileList.add(fileBlockContent.substring(nameMatcher.start(1), nameMatcher.end(1)));
- }
- }
-
- in.close();
- reader.close();
- } catch (Exception ex) {
- throw new BuildException(ex.getMessage());
- }
-
- return fileList;
- }
-
- private boolean isFdUptodate(String fdFile, List<String> fvFileList) {
- String fvDir = ".";
- File fd = new File(fdFile);
-
- if (outputDir.equals(".")) {
- if (!fd.isAbsolute()) {
- //
- // If we cannot get the absolute path of fd file, we caanot
- // get its time stamp. Re-generate it always in such situation.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "Cannot retrieve the time stamp of " + fdFile);
- return false;
- }
- fvDir = fd.getParent();
- } else {
- fvDir = outputDir;
- if (!fd.isAbsolute()) {
- fd = new File(fvDir + File.separator + fdFile);
- }
- }
-
- long fdTimeStamp = fd.lastModified();
- for (int i = 0; i < fvFileList.size(); ++i) {
- File fv = new File(fvDir + File.separator + fvFileList.get(i));
- if (fv.lastModified() > fdTimeStamp) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, fv.getPath() + " has been changed since last build!");
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java
deleted file mode 100644
index 78d9cbeb18..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/FwImageTask.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/** @file
- FwImageTask class.
-
- FwImageTask is used to call FwImage.ext to generate the FwImage.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- FwImageTask class.
-
- FwImageTask is used to call FwImage.ext to generate the FwImage.
-**/
-public class FwImageTask extends Task implements EfiDefine {
- //
- // fwimage tool name
- //
- private static String toolName = "FwImage";
- //
- // time&data
- //
- private ToolArg time = new ToolArg();
- //
- // input PE image
- //
- private FileArg peImage = new FileArg();
- //
- // output EFI image
- //
- private FileArg outImage = new FileArg();
- //
- // component type
- //
- private ToolArg componentType = new ToolArg();
-
- /**
- execute
-
- FwimageTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- String argument = "" + time + componentType + peImage + outImage;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, peImage.toFileList() + " => " + outImage.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "FwImage succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException("FwImage failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- setTime
-
- This function is to set operation of class member "time".
-
- @param time string of time
- **/
- public void setTime(String time) {
- this.time.setArg(" -t ", time);
- }
-
- /**
- getTime
-
- This function is to get class member "time"
- @return time string of time
- **/
- public String getTime() {
- return this.time.getValue();
- }
-
- /**
- getPeImage
-
- This function is to get class member "peImage".
- @return name of PE image
- **/
- public String getPeImage() {
- return this.peImage.getValue();
- }
-
- /**
- setPeImage
-
- This function is to set class member "peImage"
- @param peImage name of PE image
- **/
- public void setPeImage(String peImage) {
- this.peImage.setArg(" ", peImage);
- }
-
- /**
- getOutImage
-
- This function is to get class member "outImage".
- @return name of output EFI image
- **/
- public String getOutImage() {
- return this.outImage.getValue();
- }
-
- /**
- setOutImage
-
- This function is to set class member "outImage".
- @param outImage name of output EFI image
- **/
- public void setOutImage(String outImage) {
- this.outImage.setArg(" ", outImage);
- }
-
- /**
- getComponentType
-
- This function is to get class member "componentType".
-
- @return string of componentType
- **/
- public String getComponentType() {
- return this.componentType.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "componentType".
- @param componentType string of component type
- **/
- public void setComponentType(String componentType) {
- this.componentType.setArg(" ", componentType);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java
deleted file mode 100644
index 40d38f349f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenAcpiTableTask.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/** @file
- GenAcpiTable class.
-
- GenAcpiTable is used to call GenAcpiTable.exe to generate ACPI Table image .
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenAcpiTable class.
-
- GenAcpiTable is used to call GenAcpiTable.exe to generate ACPI Table image .
-**/
-public class GenAcpiTableTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private static String toolName = "GenAcpiTable";
-
- //
- // input file
- //
- private FileArg inputFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
- /**
- execute
-
- StripTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + inputFile + outputFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.inputFile.toFileList() + " => "
- + this.outputFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java
deleted file mode 100644
index d9273acf7b..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCRC32SectionTask.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/** @file
- GenCRC32SectionTask class.
-
- GenCRC32SectionTask is to call GenCRC32Section.exe to generate crc32 section.
-
- 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.
-
- **/
-
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenCRC32SectionTask
-
- GenCRC32SectionTask is to call GenCRC32Section.exe to generate crc32 section.
-
-**/
-public class GenCRC32SectionTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private static String toolName = "GenCRC32Section";
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
- //
- // inputFile list
- //
- private InputFile inputFileList = new InputFile();
-
- //
- // Project
- //
- static private Project project;
-
- /**
- execute
-
- GenCRC32SectionTask execute is to assemble tool command line & execute
- tool command line
-
- @throws BuildException
- **/
- public void execute() throws BuildException {
-
- project = this.getOwningTarget().getProject();
- ///
- /// absolute path of efi tools
- ///
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName ;
- }
- //
- // assemble argument
- //
- String argument = "" + inputFileList.toStringWithSinglepPrefix(" -i ") + outputFile;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this, Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, inputFileList.toFileList() + " => " + outputFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl){
- //
- // command execution success
- //
- EdkLog.log(this, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, "ERROR = " + Integer.toHexString(revl));
- // LAH Added This Line
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- addInputFile
-
- This function is to add a inputFile element into list
- @param inputFile : inputFile element
- **/
- public void addConfiguredInputfile(InputFile inputFile) {
- inputFileList.insert(inputFile);
- }
-
- /**
- get class member "outputFile"
- @return name of output file
- **/
- public String getOutputFile() {
- return this.outputFile.getValue();
- }
- /**
- set class member "outputFile"
- @param outputFile : outputFile parameter
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" -o ", outputFile);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java
deleted file mode 100644
index c5b74b5d7e..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenCapsuleHdrTask.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/** @file
- GenCapsuleHdrTask class.
-
- GenCapsuleHdrTask is used to call GenCapsuleHdr.exe to generate capsule.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenCapsuleHdrTask class.
-
- GenCapsuleHdrTask is used to call GenCapsuleHdr.exe to generate capsule.
-**/
-public class GenCapsuleHdrTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "GenCapsuleHdr";
-
- //
- // script file
- //
- private FileArg scriptFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
- //
- // Verbose flag
- //
- private ToolArg verbose = new ToolArg();
-
- //
- // Dump flag
- //
- private ToolArg dump = new ToolArg();
-
- //
- // Split size
- //
- private ToolArg size = new ToolArg();
-
- //
- // capsule into one image flag
- //
- private ToolArg joinFlag = new ToolArg();
-
- //
- // capsule file
- //
- private FileArg capsuleFile = new FileArg();
-
-
- /**
- execute
-
- GenCapsuleHdrTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + this.verbose + this.dump + this.outputFile
- + this.scriptFile + this.size + this.joinFlag + this.capsuleFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, scriptFile.toFileList() + " => " +
- outputFile.toFileList() + capsuleFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_ERROR, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "scriptFile".
-
- @return string of input file name.
- **/
- public String getScriptFile() {
- return this.scriptFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setScriptFile(String scriptFile) {
- this.scriptFile.setArg(" -script ", scriptFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" -o ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- getVerbose
-
- This function is to get class member "verbose"
-
- @return verbose the flag of verbose.
- **/
- public String getVerbose() {
- return this.verbose.getValue();
- }
-
- /**
- setVerbose
-
- This function is to set class member "verbose"
-
- @param verbose
- True or False.
- **/
- public void setVerbose(boolean verbose) {
- if (verbose) {
- this.verbose.setArg(" -", "v");
- }
- }
-
- /**
- getDump
-
- This function is to get class member "dump"
-
- @return verbose the flag of dump.
- **/
- public String getDump() {
- return dump.getValue();
- }
-
- /**
- setDump
-
- This function is to set class member "dump".
-
- @param dump
- True or False.
- **/
- public void setDump(boolean dump) {
- if (dump) {
- this.dump.setArg(" -", "dump");
- }
- }
-
- /**
- getSize
-
- This function is to set class member "size".
-
- @return size string of size value
- **/
- public String getSize() {
- return size.getValue();
- }
-
- /**
- setSize
-
- This function is to set class member "size".
-
- @param size string of size value.
- **/
- public void setSize(String size) {
- this.size.setArg(" -split ", size);
- }
-
- /**
- getCapsuleFile
-
- This function is to get class member "capsuleFile"
-
- @return capsuleFile capsule file name
- **/
- public String getCapsuleFile() {
- return capsuleFile.getValue();
- }
-
- /**
- setCapsuleFile
-
- This function is to set class member "capsuleFile"
-
- @param capsuleFile capsule file name
- **/
- public void setCapsuleFile(String capsuleFile) {
- this.capsuleFile.setArg(" ", capsuleFile);
- }
-
- /**
- isJoinFlag
-
- This function is to get class member "joinFlag"
-
- @return joinFlag flag of if need to join split capsule images into
- a single image.
- **/
- public String getJoinFlag() {
- return joinFlag.getValue();
- }
-
- /**
- setJoinFlag
-
- This function is to set class member "joinFlag"
-
- @param joinFlag flag of if need to join split capsule images into
- a single image.
- **/
- public void setJoinFlag(boolean joinFlag) {
- if (joinFlag){
- this.joinFlag.setArg(" -", "j");
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java
deleted file mode 100644
index 0e0ad9cc2f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenDepexTask.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/** @file
- GenDepexTask class.
-
- GenDepexTask is to call GenDepex.exe to generate depex section.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenDepexTask
-
- GenDepexTask is to call GenDepex.exe to generate depex section.
-
-**/
-public class GenDepexTask extends Task implements EfiDefine {
- private static String toolName = "GenDepex";
- //
- // output binary dependency files name
- //
- private FileArg outputFile = new FileArg();
- //
- // input pre-processed dependency text files name
- //
- private FileArg inputFile = new FileArg();
- //
- // padding integer value
- //
- private ToolArg padding = new FileArg();
- /**
- execute
-
- GenDepexTask execute is to assemble tool command line & execute tool
- command line.
- */
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of edk tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of GenDepex tool
- //
- String argument = "" + inputFile + outputFile + padding;
- //
- // reture value of GenDepex execution
- //
- int returnVal = -1;
-
- try {
- Commandline commandLine = new Commandline();
- commandLine.setExecutable(command);
- commandLine.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
-
- Execute runner = new Execute(streamHandler, null);
- runner.setAntRun(project);
- runner.setCommandline(commandLine.getCommandline());
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(commandLine.getCommandline()));
- EdkLog.log(this, inputFile.toFileList() + " => " + outputFile.toFileList());
-
- returnVal = runner.execute();
- if (EFI_SUCCESS == returnVal) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "GenDepex succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, "ERROR = " + Integer.toHexString(returnVal));
- throw new BuildException("GenDepex failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
- @param outputFileName name of output file
- **/
- public void setOutputFile(String outputFileName) {
- this.outputFile.setArg(" -O ", outputFileName);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile".
-
- @return name of ouput file
- **/
- public String getOutputFile() {
- return this.outputFile.getValue();
- }
-
- /**
- setInputFile
-
- This function is to set class member "inputFile".
- @param inputFileName name of inputFile
- **/
- public void setInputFile(String inputFileName) {
- this.inputFile.setArg(" -I ", inputFileName);
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile"
- @return name of input file
- **/
- public String getInputFile() {
- return this.inputFile.getValue();
- }
-
- /**
- setPadding
-
- This function is to set class member "padding"
- @param paddingNum padding value
- **/
- public void setPadding(String paddingNum) {
- this.padding.setArg(" -P ", paddingNum);
- }
-
- /**
- getPadding
-
- This function is to get class member "padding"
- @return value of padding
- **/
- public String getPadding() {
- return this.padding.getValue();
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java
deleted file mode 100644
index ebc26b92a4..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFfsFileTask.java
+++ /dev/null
@@ -1,1010 +0,0 @@
-/** @file
- GenFfsFileTask class.
-
- GenFfsFileTaks is to generate ffs file.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenFfsFileTask
-
- GenFfsFileTaks is to generate ffs file.
-
-**/
-public class GenFfsFileTask extends Task implements EfiDefine, FfsTypes {
- /**
- * GenFfsFile Task Class
- * class member
- * -baseName : module baseName
- * -ffsFileGuid : module Guid.
- * -ffsFileType : Ffs file type.
- * -ffsAttributeRecovery : The file is required for recovery.
- * -ffsAligment : The file data alignment (0 if none required). See FFS
- * specification for supported alignments (0-7 are only possible
- * values). *
- * -ffsAttributeCheckSum : The file data is checksummed. If this is FALSE a
- * value of 0x5A will be inserted in the file
- * checksum field of the file header. *
- * -sectFileDir : specifies the full path to the component build directory.
- * Required.
- * -ffsAttrib : Data recorde attribute added result.
- * -sectionList : List recorded all section elemet in task.
- */
- ///
- /// module baseName
- ///
- String baseName = "";
- ///
- ///
- ///
- String moduleType;
- ///
- /// module Guid
- ///
- String ffsFileGuid = "";
- ///
- /// Ffs file type
- ///
- String ffsFileType = "";
- ///
- /// ffsAttribHeaderExtension value is used to set the corresponding bit in
- /// the output FFS file header
- ///
- boolean ffsAttribHeaderExtension = false;
- ///
- /// ffsAttribTailPresent value is used to set the corresponding bit in the
- /// output FFS file header
- ///
- boolean ffsAttribTailPresent = false;
- ///
- /// ffsAttribRecovery value is used to set the corresponding bit in the
- /// output FFS file header
- ///
- boolean ffsAttribRecovery = false;
- ///
- /// ffsAttribDataAlignment value is used to set the corresponding bit in the output
- /// FFS file header.The specified FFS alignment must be a value between 0
- /// and 7 inclusive
- ///
- int ffsAttribDataAlignment = 0;
- ///
- /// ffsAttribChecksum value is used to set the corresponding bit in the
- /// output FFS file header
- ///
- boolean FfsAttribChecksum = false;
- ///
- /// Attribute is used to record the sum of all bit in the output FFS file.
- ///
- byte attributes = 0;
- ///
- /// The output directory of ffs file.
- ///
- String outputDir = "";
- ///
- /// List of section.
- ///
- List<Object> sectionList = new ArrayList<Object>();
-
- ///
- /// The path of Framewor_Tools_Paht.
- ///
- static String path = "";
-
- ///
- /// Gensection
- ///
- List<GenSectionTask> genSectList = new ArrayList<GenSectionTask>();
-
- /**
- execute
-
- GenFfsFileTask execute is to generate ffs file according to input section
- dscriptive information.
- **/
- public void execute() throws BuildException {
-
- String ffsSuffix = "";
- String outputPath = "";
-
- //
- // Get Fraemwork_Tools_Path
- //
- Project pj = this.getOwningTarget().getProject();
- path = pj.getProperty("env.FRAMEWORK_TOOLS_PATH");
-
- //
- // Check does the BaseName, Guid, FileType set value.
- //
- if (this.baseName.equals("")) {
- throw new BuildException ("Must set OutputFileBasename!\n");
- }
-
- if (this.ffsFileGuid.equals("")) {
- throw new BuildException ("Must set ffsFileGuid!\n");
- }
-
- if (this.ffsFileType.equals("")) {
- throw new BuildException ("Must set ffsFileType!\n");
- }
- //
- // Create ffs file. File name = FfsFileGuid + BaseName + ffsSuffix.
- // If outputDir's value was set, file will output to the outputDir.
- //
- ffsSuffix = TypeToSuffix (this.moduleType);
- if (!this.outputDir.equals("")) {
- String temp;
- outputPath = this.outputDir;
- temp = outputPath.replace('\\', File.separatorChar);
- outputPath = temp.replace('/', File.separatorChar);
- if (outputPath.charAt(outputPath.length()-1) != File.separatorChar) {
- outputPath = outputPath + File.separator;
- }
-
- }
-
- String ffsFilePath = outputPath + this.ffsFileGuid + '-' + this.baseName + ffsSuffix;
- File ffsFile = new File (ffsFilePath);
- try{
- genFfs(ffsFile);
- }catch (BuildException e){
- if (ffsFile != null && ffsFile.exists()){
- ffsFile.deleteOnExit();
- }
- throw new BuildException(e.getMessage());
-
- }
-
- }
-
- /**
- addCompress
-
- This function is to add compress section to section list.
- @param compress Section of compress
- **/
- public void addCompress(CompressSection compress) {
- this.sectionList.add(compress);
- }
-
- /**
- addTool
-
- This function is to add tool section to section list.
- @param tool Section of tool
- **/
- public void addTool(Tool tool) {
- this.sectionList.add(tool);
- }
-
- /**
- addSectionFile
-
- This function is to add sectFile section to section list.
- @param sectFile Section of sectFile.
- **/
- public void addSectFile (SectFile sectFile) {
- this.sectionList.add(sectFile);
- }
-
- /**
- getBaseName
-
- This function is to get basename
-
- @return String of base name
- **/
- public String getBaseName() {
- return this.baseName;
- }
-
- /**
- setBaseName
-
- This function is to set base name.
- @param baseName
- **/
- public void setBaseName(String baseName) {
- this.baseName = baseName.trim();
- }
-
- /**
- getFfsAligment
-
- This function is to get the ffsAligment
- @return The value of ffsAligment.
- **/
- public int getFfsAttribDataAlignment() {
- return this.ffsAttribDataAlignment;
- }
-
- /**
- setFfsAligment
-
- This function is to set ffsAligment
- @param ffsAligment The value of ffsAligment.
- **/
- public void setFfsAttribDataAlignment(String ffsAligment) {
- this.ffsAttribDataAlignment = stringToInt(ffsAligment.replaceAll(" ", "").toLowerCase());
- if (this.ffsAttribDataAlignment < 0 || this.ffsAttribDataAlignment > 7) {
- throw new BuildException ("FFS_ATTRIB_DATA_ALIGMENT must be an integer value from 0 through 7, inclusive");
- } else {
- attributes |= (((byte)this.ffsAttribDataAlignment) << 3);
- }
- }
-
- /**
- getFfsAttribCheckSum
-
- This function is to get ffsAttribCheckSum
-
- @return Value of ffsAttribChecksum
- **/
- public boolean getFfsAttribChecksum() {
- return this.FfsAttribChecksum;
- }
-
- /**
- setFfsAttribChecksum
-
- This function is to set ffsAttribChecksum
- @param ffsAttributeCheckSum Value of ffsAttribCheckSum
- **/
- public void setFfsAttribChecksum(boolean ffsAttributeCheckSum) {
- this.FfsAttribChecksum = ffsAttributeCheckSum;
- if (ffsAttributeCheckSum) {
- attributes |= FFS_ATTRIB_CHECKSUM;
- }
- }
-
- /**
- getFfsAttribRecovery
-
- This function is to get ffsAttribRecovery
- @return Value of ffsAttribRecovery
- **/
- public boolean getFfsAttribRecovery() {
- return this.ffsAttribRecovery;
- }
-
- /**
- setRecovery
-
- This function is to set ffsAttributeRecovery
-
- @param ffsAttributeRecovery Value of ffsAttributeRecovery
- **/
- public void setRecovery(boolean ffsAttributeRecovery) {
- this.ffsAttribRecovery = ffsAttributeRecovery;
- if (ffsAttributeRecovery) {
- attributes |= FFS_ATTRIB_RECOVERY;
- }
- }
-
- /**
- getFileGuid
-
- This function is to get fileGuid
- @return Guid
- **/
- public String getFileGuid() {
- return this.ffsFileGuid;
- }
-
- /**
- setFileGuid
-
- This function is to set fileGuid
- @param ffsFileGuid String of GUID
- **/
- public void setFileGuid(String ffsFileGuid) {
- this.ffsFileGuid = ffsFileGuid.trim();
- }
-
- /**
- getFfsFileType
-
- This function is to get ffsFileType.
-
- @return value of ffsFileType
- **/
- public String getFfsFileType() {
- return this.ffsFileType;
- }
-
- /**
- setFfsFileType
-
- This function is to set ffsFileType.
-
- @param ffsFileType
- **/
- public void setFfsFileType(String ffsFileType) {
- this.ffsFileType = ffsFileType.trim();
- }
-
- /**
- ffsAttribHeaderExtension
-
- This function is to get ffsAttribHeaderExtension
-
- @return Value of ffsAttribHeaderExtension
- **/
- public boolean isFfsAttribHeaderExtension() {
- return this.ffsAttribHeaderExtension;
- }
-
- /**
- setHeaderExension
-
- This function is to set headerExtension
- @param headerExtension Value of headerExension
- **/
- public void setHeaderExtension(boolean headerExtension) {
- this.ffsAttribHeaderExtension = headerExtension;
- if (headerExtension) {
- attributes |= FFS_ATTRIB_HEADER_EXTENSION;
- }
- }
-
- /**
- isFfsAttribTailPresent
-
- This function is to get ffsAttribTailPresent value.
- @return Value of ffsAttribTailPresent.
- **/
- public boolean isFfsAttribTailPresent() {
- return this.ffsAttribTailPresent;
- }
-
- /**
- setFfsAttribTailPresent
-
- This function is to set ffsAttribTailPresent.
- @param tailPresent Value of ffsAttribTailPresent.
- **/
- public void setFfsAttribTailPresent(boolean tailPresent) {
- this.ffsAttribTailPresent = tailPresent;
- if (tailPresent) {
- attributes |= FFS_ATTRIB_TAIL_PRESENT;
- }
- }
-
-
- /**
- stringToGuid
-
- This function is to convert string to GUID.
- * @param GuidStr String of GUID.
- * @param Guid GUID form.
- */
- private void stringToGuid (String GuidStr, FfsHeader.FfsGuid Guid){
-
- int i = 0;
- int j = 0;
- int k = 0;
- char [] charArry;
- String [] SplitStr;
-
- byte[] buffer = new byte[16];
- if (GuidStr.length()!=36) {
- throw new BuildException ("The GUID length [" + GuidStr.length() + "] is not correct!");
- }
-
-
- SplitStr = GuidStr.split("-");
- if (SplitStr.length != 5) {
- throw new BuildException ("The GUID format is not correct!");
- }
-
-
-
- for (i= 0; i < SplitStr.length; i++) {
- String str = SplitStr[i];
- charArry = str.toCharArray();
-
- for (j =0; j < (str.toCharArray().length)/2; j++) {
-
- buffer[k] = hexCharToByte (charArry[j*2]);
- buffer[k] = (byte)( buffer[k]& 0x0f);
- buffer[k] = (byte)((buffer[k]<< 4));
- buffer[k] = (byte)( buffer[k]& 0xf0);
- buffer[k] = (byte)( buffer[k]|hexCharToByte(charArry[j*2+1]));
- k++;
- }
- }
- Guid.bufferToStruct(buffer);
- }
-
- /**
- typeToSuffix
-
- This function is to get suffix of ffs file according to ffsFileType.
-
- @param ffsFileType ffsFileType
- @return The suffix of ffs file
- **/
- private String TypeToSuffix (String ffsFileType){
- String[][] suffix = { { "BASE", ".FFS"},
- { "SEC", ".SEC" }, { "PEI_CORE", ".PEI" },
- { "PEIM", ".PEI" }, { "DXE_CORE", ".DXE" },
- { "DXE_DRIVER", ".DXE" }, { "DXE_RUNTIME_DRIVER", ".DXE" },
- { "DXE_SAL_DRIVER", ".DXE" }, { "DXE_SMM_DRIVER", ".DXE" },
- { "TOOL", ".FFS" }, { "UEFI_DRIVER", ".DXE" },
- { "UEFI_APPLICATION", ".APP" }, { "USER_DEFINED", ".FFS" } };
-
- for (int i = 0; i < suffix.length; i++) {
- if (suffix[i][0].equalsIgnoreCase(moduleType)) {
- return suffix[i][1];
- }
- }
-
- return ".FFS";
- }
-
-
- /**
- stringToType
-
- This function is to get ffsFileType integer value according to ffsFileType.
- @param ffsFileType String value of ffsFileType
- @return Integer value of ffsFileType.
- **/
- private byte stringToType (String ffsFileType){
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_ALL")) {
- return(byte)EFI_FV_FILETYPE_ALL;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_RAW")) {
- return(byte)EFI_FV_FILETYPE_RAW;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_FREEFORM")) {
- return(byte)EFI_FV_FILETYPE_FREEFORM;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_SECURITY_CORE")) {
- return(byte)EFI_FV_FILETYPE_SECURITY_CORE;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_PEI_CORE")) {
- return(byte) EFI_FV_FILETYPE_PEI_CORE;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_DXE_CORE")) {
- return(byte)EFI_FV_FILETYPE_DXE_CORE;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_PEIM")) {
- return(byte)EFI_FV_FILETYPE_PEIM;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_DRIVER")) {
- return(byte) EFI_FV_FILETYPE_DRIVER;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER")) {
- return(byte)EFI_FV_FILETYPE_COMBINED_PEIM_DRIVER;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_APPLICATION")) {
- return(byte)EFI_FV_FILETYPE_APPLICATION;
- }
-
- if (ffsFileType.equals("EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE")) {
- return(byte)EFI_FV_FILETYPE_FIRMWARE_VOLUME_IMAGE;
- }
- if (ffsFileType.equals("EFI_FV_FILETYPE_FFS_PAD")) {
- return(byte) EFI_FV_FILETYPE_FFS_PAD;
- }
-
- return -1;
- }
-
-
-
- /**
- calculateCheckSum8
-
- This function is to calculate the value needed for a valid UINT8 checksum
- @param buffer Byte buffer containing byte data of component.
- @param size Size of the buffer.
- @return The 8 bit checksum value needed.
- **/
- private byte calculateChecksum8 (byte[] buffer, int size){
- return(byte) (0x100 - calculateSum8 (buffer, size));
- }
-
-
- /**
- calculateSum8
-
- This function is to calculate the UINT8 sum for the requested region.
- @param buffer Byte buffer containing byte data of component
- @param size Size of the buffer.
- @return The 8 bit checksum value needed.
- **/
- private short calculateSum8 (byte[] buffer, int size){
- int Index;
- byte Sum;
- Sum = 0;
-
- //
- // Perform the word sum for buffer
- //
- for (Index = 0; Index < size; Index++) {
- Sum = (byte) (Sum + buffer[Index]);
- }
-
- return(byte) Sum;
- }
-
- /**
- hexCharToByte
-
- This function is to convert hex character to byte
-
- @param hexChar hex character
- @return Byte which corresponding to the character.
- **/
- private byte hexCharToByte (char hexChar){
- switch (hexChar) {
- case '0':
- return(byte)0x00;
- case '1':
- return(byte)0x01;
- case '2':
- return(byte)0x02;
- case '3':
- return(byte)0x03;
- case '4':
- return(byte)0x04;
- case '5':
- return(byte)0x05;
- case '6':
- return(byte)0x06;
- case '7':
- return(byte)0x07;
- case '8':
- return(byte)0x08;
- case '9':
- return(byte)0x09;
- case 'a':
- case 'A':
- return(byte)0x0a;
- case 'b':
- case 'B':
- return(byte)0x0b;
- case 'c':
- case 'C':
- return(byte)0x0c;
-
- case 'd':
- case 'D':
- return(byte)0x0d;
-
- case 'e':
- case 'E':
- return(byte)0x0e;
- case 'f':
- case 'F':
- return(byte)0x0f;
-
- default:
- return(byte)0xff;
- }
- }
-
- /**
- adjustFileSize
-
- This function is used to adjusts file size to insure sectioned file is exactly the right length such
- that it ends on exactly the last byte of the last section. ProcessScript()
- may have padded beyond the end of the last section out to a 4 byte boundary.
- This padding is stripped.
-
- @param buffer Byte buffer contains a section stream
- @return Corrected size of file.
- **/
- private int adjustFileSize (byte[] buffer){
-
- int orignalLen = buffer.length;
- int adjustLen = 0;
- int sectionPoint = 0;
- int nextSectionPoint = 0;
- int sectionLen = 0;
- int totalLen = 0;
- int firstSectionHeader = 0;
-
-
- firstSectionHeader = buffer[0]& 0xff;
- firstSectionHeader = ((buffer[1]&0xff)<<8) | firstSectionHeader;
- firstSectionHeader = ((buffer[2]&0xff)<<16)| firstSectionHeader;
-
-
- while (sectionPoint < buffer.length) {
- sectionLen = buffer[0 + sectionPoint]& 0xff;
- sectionLen = ((buffer[1 + sectionPoint]&0xff)<<8)| sectionLen;
- sectionLen = ((buffer[2 + sectionPoint]&0xff)<<16)| sectionLen;
- totalLen = totalLen + sectionLen;
-
- if (totalLen == orignalLen) {
- return totalLen;
- }
-
- sectionPoint = sectionPoint + sectionLen;
- adjustLen = sectionPoint;
-
- nextSectionPoint = (sectionPoint + 0x03) & (~0x03);
- totalLen = totalLen + nextSectionPoint - sectionLen;
- sectionPoint = nextSectionPoint;
- }
- return adjustLen;
- }
-
- /**
- getOutputDir
-
- This function is to get output directory.
-
- @return Path of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set output directory.
-
- @param outputDir The output direcotry.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- getModuleTyp
-
- This function is to get string of module type.
-
- @return moduleType The string of module type.
- **/
- public String getModuleType() {
- return this.moduleType;
- }
-
- /**
- setModuleType
-
- This function is to set moduleType.
-
- @param moduleType The string of module type.
- **/
- public void setModuleType(String moduleType) {
- this.moduleType = moduleType;
- }
-
- /**
- Convert a string to a integer.
-
- @param intString The string representing a integer
-
- @retval int The value of integer represented by the
- given string; -1 is returned if the format
- of the string is wrong.
- **/
- private int stringToInt(String intString) {
- int value;
- int hexPrefixPos = intString.indexOf("0x");
- int radix = 10;
- String intStringNoPrefix;
-
- if (hexPrefixPos >= 0) {
- radix = 16;
- intStringNoPrefix = intString.substring(hexPrefixPos + 2, intString.length());
- } else {
- intStringNoPrefix = intString;
- }
-
- try {
- value = Integer.parseInt(intStringNoPrefix, radix);
- } catch (NumberFormatException e) {
- EdkLog.log(this, EdkLog.EDK_ERROR, "Incorrect format of int [" + intString + "]. -1 is assumed");
- return -1;
- }
-
- return value;
- }
-
- private void alignSection(DataOutputStream dataBuffer, int dataSize, int alignment) throws BuildException {
- if (alignment == 0) {
- return;
- }
- dataSize += 4; // take the section header into account
- int[] alignedBytes = {0, 16, 128, 512, 1024, 4096, 32768, 65536};
- int padSize = (alignedBytes[alignment] - dataSize) & (alignedBytes[alignment] - 1);
- if (padSize == 0) {
- //
- // already aligned
- //
- return;
- }
- //
- // if the pad size is not times of 4, there must be something wrong in previous sections
- //
- if (((4 - padSize) & (4 - 1)) != 0) {
- EdkLog.log(this, EdkLog.EDK_ERROR, "PAD section size must be 4-byte aligned (" + padSize + ")!");
- throw new BuildException ("Alignment can't be satisfied!");
- }
- byte[] pad = new byte[padSize];
- //
- // first three byte stores the section size
- //
- pad[0] = (byte)(padSize & 0xff);
- pad[1] = (byte)((padSize >> 8) & 0xff);
- pad[2] = (byte)((padSize >> 16) & 0xff);
- //
- // the fourth byte are section type. use raw type (0x19)
- //
- pad[3] = 0x19;
- try {
- dataBuffer.write(pad);
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- genFfs
-
- This function is to generate FFS file.
-
- @param ffsFile Name of FFS file.
- @param isOrg Flag to indicate generate ORG ffs file or not.
- **/
- private void genFfs(File ffsFile) throws BuildException {
- Section sect;
- int fileSize;
- int fileDataSize;
- FfsHeader ffsHeader = new FfsHeader();
- FfsHeader orgFfsHeader = new FfsHeader();
-
- EdkLog.log(this, EdkLog.EDK_INFO, ffsFile.getName());
-
- try {
- //
- // Create file output stream -- dataBuffer.
- //
- FileOutputStream dataFs = new FileOutputStream (ffsFile.getAbsolutePath());
- DataOutputStream dataBuffer = new DataOutputStream (dataFs);
-
- //
- // Search SectionList find earch section and call it's
- // ToBuffer function.
- //
- Iterator sectionIter = this.sectionList.iterator();
- while (sectionIter.hasNext()) {
- sect = (Section)sectionIter.next();
-
- try {
- int alignment = sect.getAlignment();
- if (this.ffsAttribDataAlignment < alignment) {
- this.ffsAttribDataAlignment = alignment;
- }
- alignSection(dataBuffer, dataBuffer.size(), alignment);
- //
- // The last section don't need 4 byte ffsAligment.
- //
- sect.toBuffer((DataOutputStream)dataBuffer);
- } catch (Exception e) {
- if (dataBuffer != null){
- dataBuffer.close();
- }
- throw new BuildException (e.getMessage());
- }
- }
- dataBuffer.close();
- } catch (Exception e) {
- throw new BuildException (e.getMessage());
- }
-
- //
- // Creat Ffs file header
- //
- try {
-
- //
- // create input stream to read file data
- //
- byte[] fileBuffer = new byte[(int)ffsFile.length()];
- FileInputStream fi = new FileInputStream (ffsFile.getAbsolutePath());
- DataInputStream di = new DataInputStream (fi);
- di.read(fileBuffer);
- di.close();
-
- //
- // Add GUID to header struct
- //
- if (this.ffsFileGuid != null) {
- stringToGuid (this.ffsFileGuid, ffsHeader.name);
- }
-
- //
- // because we may have changed the ffsAttribDataAlignment, we need to refresh attributes
- //
- this.attributes &= ~(((byte)7) << 3);
- this.attributes |= (((byte)this.ffsAttribDataAlignment) << 3);
-
- ffsHeader.ffsAttributes = this.attributes;
- if ((ffsHeader.fileType = stringToType(this.ffsFileType))== -1) {
- throw new BuildException ("FFS_FILE_TYPE unknow!\n");
- }
-
- //
- // Copy ffsHeader.ffsAttribute and fileType to orgFfsHeader.ffsAttribute
- // and fileType
- //
- orgFfsHeader.ffsAttributes = ffsHeader.ffsAttributes;
- orgFfsHeader.fileType = ffsHeader.fileType;
-
- //
- // Adjust file size. The function is used to tripe the last
- // section padding of 4 binary boundary.
- //
- //
- if (ffsHeader.fileType != EFI_FV_FILETYPE_RAW) {
-
- fileDataSize = adjustFileSize (fileBuffer);
- } else {
- fileDataSize = fileBuffer.length;
- }
-
- //
- // 1. add header size to file size
- //
- fileSize = fileDataSize + ffsHeader.getSize();
-
- if ((ffsHeader.ffsAttributes & FFS_ATTRIB_TAIL_PRESENT) != 0) {
- if (ffsHeader.fileType == EFI_FV_FILETYPE_FFS_PAD) {
-
- throw new BuildException (
- "FFS_ATTRIB_TAIL_PRESENT=TRUE is " +
- "invalid for PAD files"
- );
- }
- if (fileSize == ffsHeader.getSize()) {
- throw new BuildException (
- "FFS_ATTRIB_TAIL_PRESENT=TRUE is " +
- "invalid for 0-length files"
- );
- }
- fileSize = fileSize + 2;
- }
-
- //
- // 2. set file size to header struct
- //
- ffsHeader.ffsFileSize[0] = (byte)(fileSize & 0x00FF);
- ffsHeader.ffsFileSize[1] = (byte)((fileSize & 0x00FF00)>>8);
- ffsHeader.ffsFileSize[2] = (byte)(((int)fileSize & 0xFF0000)>>16);
-
- //
- // Fill in checksums and state, these must be zero for checksumming
- //
- ffsHeader.integrityCheck.header = calculateChecksum8 (
- ffsHeader.structToBuffer(),
- ffsHeader.getSize()
- );
-
- if ((this.attributes & FFS_ATTRIB_CHECKSUM) != 0) {
- if ((this.attributes & FFS_ATTRIB_TAIL_PRESENT) != 0) {
- ffsHeader.integrityCheck.file = calculateChecksum8 (
- fileBuffer,
- fileDataSize
- );
- } else {
- ffsHeader.integrityCheck.file = calculateChecksum8 (
- fileBuffer,
- fileDataSize
- );
- }
- } else {
- ffsHeader.integrityCheck.file = FFS_FIXED_CHECKSUM;
- orgFfsHeader.integrityCheck.file = FFS_FIXED_CHECKSUM;
- }
-
- //
- // Set the state now. Spec says the checksum assumes the state is 0.
- //
- ffsHeader.ffsState = EFI_FILE_HEADER_CONSTRUCTION |
- EFI_FILE_HEADER_VALID |
- EFI_FILE_DATA_VALID;
-
- //
- // create output stream to first write header data in file, then write sect data in file.
- //
- FileOutputStream headerFfs = new FileOutputStream (ffsFile.getAbsolutePath());
- DataOutputStream ffsBuffer = new DataOutputStream (headerFfs);
-
- //
- // Add header struct and file data to FFS file
- //
- ffsBuffer.write(ffsHeader.structToBuffer());
- ffsBuffer.write(fileBuffer, 0, fileDataSize);
-
-
-
- //
- // If there is a tail, then set it
- //
- if ((this.attributes & FFS_ATTRIB_TAIL_PRESENT) != 0) {
- short tailValue ;
- byte [] tailByte = new byte[2];
-
- //
- // reverse tailvalue , integritycheck.file as hight byte, and
- // integritycheck.header as low byte.
- //
- tailValue = (short)(ffsHeader.integrityCheck.header & 0xff);
- tailValue = (short)((tailValue) | ((ffsHeader.integrityCheck.file << 8) & 0xff00));
- tailValue = (short)~tailValue;
-
- //
- // Change short to byte[2]
- //
- tailByte[0] = (byte)(tailValue & 0xff);
- tailByte[1] = (byte)((tailValue & 0xff00)>>8);
- ffsBuffer.write(tailByte[0]);
- ffsBuffer.write(tailByte[1]);
-
- }
-
- //
- // close output stream. Note if don't close output stream
- // the buffer can't be rewritten to file.
- //
- ffsBuffer.close();
- } catch (Exception e) {
- EdkLog.log(this, EdkLog.EDK_ERROR, "genffsfile failed!");
- throw new BuildException (e.getMessage());
- }
-
- }
-
- /**
- addGenSection
-
- This function is to add gensection instance to list
-
- @param task Instance of GenSectionTask
- **/
- public void addGenSection (GenSectionTask task){
- this.sectionList.add(task);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java
deleted file mode 100644
index 0f25032f7f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenFvImageTask.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/** @file
- GenFvImageTask class.
-
- GenFvImageTask is to call GenFvImage.exe to generate FvImage.
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import java.io.File;
-import java.util.LinkedList;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.List;
-import java.util.Iterator;
-import java.io.BufferedReader;
-import java.io.FileReader;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GenFvImageTask
-
- GenFvImageTask is to call GenFvImage.exe to generate the FvImage.
-
-**/
-public class GenFvImageTask extends Task implements EfiDefine{
- //
- // tool name
- //
- static final private String toolName = "GenFvImage";
- //
- // Pattern to match the section header (e.g. [options], [files])
- //
- static final private Pattern sectionHeader = Pattern.compile("\\[([^\\[\\]]+)\\]");
- //
- // The name of input inf file
- //
- private FileArg infFile = new FileArg();
- //
- // Output directory
- //
- private String outputDir = ".";
-
- /**
- execute
-
- GenFvImageTask execute is to assemble tool command line & execute tool
- command line.
- **/
- public void execute() throws BuildException {
- Project project = this.getOwningTarget().getProject();
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
-
- if (isUptodate()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, infFile.toFileList() + " is uptodate!");
- return;
- }
-
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- String argument = "" + infFile;
- //
- // lauch the program
- //
- int exitCode = 0;
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
- //
- // log command line string.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, infFile.toFileList());
-
- exitCode = runner.execute();
- if (exitCode != 0) {
- EdkLog.log(this, "ERROR = " + Integer.toHexString(exitCode));
- } else {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "GenFvImage succeeded!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- } finally {
- if (exitCode != 0) {
- throw new BuildException("GenFvImage: failed to generate FV file!");
- }
- }
- }
- /**
- getInfFile
-
- This function is to get class member of infFile
- @return String name of infFile
- **/
- public String getInfFile() {
- return infFile.getValue();
- }
-
- /**
- setInfFile
-
- This function is to set class member of infFile.
-
- @param infFile name of infFile
- **/
- public void setInfFile(String infFile) {
- this.infFile.setArg(" -I ", infFile);
- }
-
- /**
- getOutputDir
-
- This function is to get output directory.
-
- @return Path of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set output directory.
-
- @param outputDir The output direcotry.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- //
- // dependency check
- //
- private boolean isUptodate() {
- String infName = this.infFile.getValue();
- String fvName = "";
- List<String> ffsFiles = new LinkedList<String>();
- File inf = new File(infName);
-
- try {
- FileReader reader = new FileReader(inf);
- BufferedReader in = new BufferedReader(reader);
- String str;
-
- //
- // Read the inf file line by line
- //
- boolean inFiles = false;
- boolean inOptions = false;
- while ((str = in.readLine()) != null) {
- str = str.trim();
- if (str.length() == 0) {
- continue;
- }
-
- Matcher matcher = sectionHeader.matcher(str);
- if (matcher.find()) {
- //
- // We take care of only "options" and "files" section
- //
- String sectionName = str.substring(matcher.start(1), matcher.end(1));
- if (sectionName.equalsIgnoreCase("options")) {
- inOptions = true;
- inFiles = false;
- } else if (sectionName.equalsIgnoreCase("files")) {
- inFiles = true;
- inOptions = false;
- } else {
- inFiles = false;
- inOptions = false;
- }
- continue;
- }
-
- //
- // skip invalid line
- //
- int equalMarkPos = str.indexOf("=");
- if (equalMarkPos < 0) {
- continue;
- }
-
- //
- // we have only interest in EFI_FILE_NAME
- //
- String fileNameFlag = str.substring(0, equalMarkPos).trim();
- String fileName = str.substring(equalMarkPos + 1).trim();
- if (!fileNameFlag.equalsIgnoreCase("EFI_FILE_NAME")
- || fileName.length() == 0) {
- continue;
- }
-
- if (inFiles) {
- //
- // files specified beneath the [files] section are source files
- //
- ffsFiles.add(fileName);
- } else if (inOptions) {
- //
- // file specified beneath the [options] section is the target file
- //
- fvName = outputDir + File.separator + fileName;
- }
- }
- } catch (Exception ex) {
- throw new BuildException(ex.getMessage());
- }
-
- //
- // if destionation file doesn't exist, we need to generate it.
- //
- File fvFile = new File(fvName);
- if (!fvFile.exists()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, fvName + " doesn't exist!");
- return false;
- }
-
- //
- // the inf file itself will be taken as source file, check its timestamp
- // against the target file
- //
- long fvFileTimeStamp = fvFile.lastModified();
- if (inf.lastModified() > fvFileTimeStamp) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, infName + " has been changed since last build!");
- return false;
- }
-
- //
- // no change in the inf file, we need to check each source files in it
- // against the target file
- //
- for (Iterator it = ffsFiles.iterator(); it.hasNext(); ) {
- String fileName = (String)it.next();
- File file = new File(fileName);
- if (file.lastModified() > fvFileTimeStamp) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, fileName + " has been changed since last build!");
- return false;
- }
- }
-
- return true;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java
deleted file mode 100644
index 82844f080f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenSectionTask.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/** @file
- GenSectionTask class.
-
- GenSectionTask is to call GenSection.exe to generate Section.
-
- 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.
-
-**/
-
-package org.tianocore.framework.tasks;
-
-import java.io.ByteArrayOutputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-import org.tianocore.common.logger.EdkLog;
-
-public class GenSectionTask extends Task implements EfiDefine, Section, FfsTypes {
- private int alignment = 0;
- //
- // Tool name
- //
- private final static String toolName = "GenSection";
- //
- // inputfile name
- //
- private FileArg inputFile = new FileArg();
-
- //
- // outputfile name
- //
- private FileArg outputFile = new FileArg();
-
- //
- // section type
- //
- private ToolArg sectionType = new ToolArg();
-
- //
- // version number
- //
- private ToolArg versionNum = new ToolArg();
-
- //
- // interface string
- //
- private ToolArg interfaceString = new ToolArg();
-
- //
- // Section file list
- //
- private List<Section> sectFileList = new ArrayList<Section>();
-
- //
- // flag indicated the <tool> element
- //
- private boolean haveTool = false;
-
- /**
- execute
-
- GenSectionTaks execute is to assemble tool command line & execute tool
- command line.
-
- @throws BuildException
- **/
- public void execute() throws BuildException {
- String command;
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- String argument = "" + inputFile + outputFile + sectionType + versionNum + interfaceString;
- //
- // return value of gensection execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
-
- EdkLog.log(this, inputFile.toFileList() + versionNum.getValue()
- + interfaceString.getValue() + " => " + outputFile.toFileList());
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return name of input file
- **/
- public String getInputFile() {
- return this.inputFile.getValue();
- }
-
- /**
- setInputFile
-
- This function is to set class member "inputFile".
-
- @param inputFile name of input file
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" -i ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile".
-
- @return name of output file
- **/
- public String getOutputFile() {
- return this.outputFile.getValue();
- }
-
- /**
- setOutputfile
-
- This function is to set class member "outputFile".
- @param outputFile name of output file
- **/
- public void setOutputfile(String outputFile) {
- this.outputFile.setArg(" -o ", outputFile);
- }
-
- /**
- getSectionType
-
- This function is to get class member "sectionType".
-
- @return sectoin type
- **/
- public String getSectionType() {
- return this.sectionType.getValue();
- }
-
- /**
- setSectionType
-
- This function is to set class member "sectionType".
-
- @param sectionType section type
- **/
- public void setSectionType(String sectionType) {
- this.sectionType.setArg(" -s ", sectionType);
- }
-
- /**
- getVersionNum
-
- This function is to get class member "versionNum".
- @return version number
- **/
- public String getVersionNum() {
- return this.versionNum.getValue();
- }
-
- /**
- setVersionNume
-
- This function is to set class member "versionNum".
- @param versionNum version number
- **/
- public void setVersionNum(String versionNum) {
- this.versionNum.setArg(" -v ", versionNum);
- }
-
- /**
- getInterfaceString
-
- This function is to get class member "interfaceString".
- @return interface string
- **/
- public String getInterfaceString() {
- return this.interfaceString.getValue();
- }
-
- /**
- setInterfaceString
-
- This funcion is to set class member "interfaceString".
- @param interfaceString interface string
- **/
- public void setInterfaceString(String interfaceString) {
- this.interfaceString.setArg(" -a ", "\"" + interfaceString + "\"");
- }
-
- /**
- addSectFile
-
- This function is to add sectFile to list.
-
- @param sectFile instance of sectFile.
- **/
- public void addSectFile(SectFile sectFile){
- this.sectFileList.add(sectFile);
- }
-
- /**
- setTool
-
- This function is to set the class member "Tool";
-
- @param tool
- **/
- public void addTool(Tool tool) {
- this.sectFileList.add(tool);
- this.haveTool = true;
- }
-
- /**
- addGenSection
-
- This function is to add GenSectin element to list
- @param task Instance of genSection
- **/
- public void addGenSection(GenSectionTask task){
- this.sectFileList.add(task);
- }
-
- public int getAlignment() {
- return alignment;
- }
-
- public void setAlignment(int alignment) {
- if (alignment > 7) {
- this.alignment = 7;
- } else {
- this.alignment = alignment;
- }
- }
-
- public void toBuffer(DataOutputStream buffer){
- //
- // Search SectionList find earch section and call it's
- // ToBuffer function.
- //
- if (this.sectionType.getValue().equalsIgnoreCase(
- "EFI_SECTION_COMPRESSION")
- && !this.haveTool) {
- Section sect;
-
- //
- // Get section file in compress node.
- //
- try {
- ByteArrayOutputStream bo = new ByteArrayOutputStream();
- DataOutputStream Do = new DataOutputStream(bo);
-
- //
- // Get each section which under the compress {};
- // And add it is contains to File;
- //
- Iterator SectionIter = this.sectFileList.iterator();
- while (SectionIter.hasNext()) {
- sect = (Section) SectionIter.next();
-
- //
- // Call each section class's toBuffer function.
- //
- try {
- sect.toBuffer(Do);
- } catch (BuildException e) {
- System.out.print(e.getMessage());
- throw new BuildException(
- "Compress.toBuffer failed at section");
- } finally {
- if (Do != null){
- Do.close();
- }
- }
- }
- //
- // Call compress
- //
- byte[] fileBuffer = bo.toByteArray();
-
- synchronized (CompressSection.semaphore) {
- Compress myCompress = new Compress(fileBuffer,
- fileBuffer.length);
-
- //
- // Add Compress header
- //
- CompressHeader Ch = new CompressHeader();
- Ch.SectionHeader.Size[0] = (byte) ((myCompress.outputBuffer.length + Ch
- .GetSize()) & 0xff);
- Ch.SectionHeader.Size[1] = (byte) (((myCompress.outputBuffer.length + Ch
- .GetSize()) & 0xff00) >> 8);
- Ch.SectionHeader.Size[2] = (byte) (((myCompress.outputBuffer.length + Ch
- .GetSize()) & 0xff0000) >> 16);
- Ch.SectionHeader.type = (byte) EFI_SECTION_COMPRESSION;
-
- //
- // Note: The compressName was not efsfective now. Using the
- // EFI_STANDARD_COMPRSSION for compressType .
- // That is follow old Genffsfile tools. Some code will be
- // added for
- // the different compressName;
- //
- Ch.UncompressLen = fileBuffer.length;
- Ch.CompressType = EFI_STANDARD_COMPRESSION;
-
- //
- // Change header struct to byte buffer
- //
- byte[] headerBuffer = new byte[Ch.GetSize()];
- Ch.StructToBuffer(headerBuffer);
-
- //
- // First add CompressHeader to Buffer, then add Compress
- // data.
- //
- buffer.write(headerBuffer);
- buffer.write(myCompress.outputBuffer);
-
- //
- // Buffer 4 Byte aligment
- //
- int size = Ch.GetSize() + myCompress.outputBuffer.length;
-
- while ((size & 0x03) != 0) {
- size++;
- buffer.writeByte(0);
- }
- }
- } catch (Exception e) {
- throw new BuildException("GenSection<SectionType=EFI_SECTION_COMPRESSION> to Buffer failed!\n");
- }
- } else {
- Section sect;
- Iterator sectionIter = this.sectFileList.iterator();
- while (sectionIter.hasNext()) {
- sect = (Section) sectionIter.next();
- try {
- //
- // The last section don't need 4 byte ffsAligment.
- //
- sect.toBuffer(buffer);
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java
deleted file mode 100644
index 34a7987f43..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GenTeImageTask.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/** @file
- GenTeImageTask class.
-
- GenTeImageTask is used to call GenTEImage.exe to generate TE image .
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- * GenTeImageTask class.
- *
- * GenTeImageTask is used to call GenAcpiTable.exe to generate ACPI Table image .
- */
-public class GenTeImageTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "GenTeImage";
- //
- // input file
- //
- private FileArg inputFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = "";
-
- //
- // Verbose flag
- //
- private ToolArg verbose = new ToolArg();
-
- //
- // Dump flag
- //
- private ToolArg dump = new ToolArg();
-
- /**
- execute
-
- GenTeImgaeTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + this.verbose + this.dump + this.outputFile + this.inputFile;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.inputFile.toFileList()
- + " => " + this.outputFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" -o ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-
- /**
- getVerbose
-
- This function is to get class member "verbose"
-
- @return verbose the flag of verbose.
- **/
- public String getVerbose() {
- return this.verbose.getValue();
- }
-
- /**
- setVerbose
-
- This function is to set class member "verbose"
-
- @param verbose
- True or False.
- **/
- public void setVerbose(boolean verbose) {
- if (verbose) {
- this.verbose.setArg(" -", "v");
- }
- }
-
- /**
- getDump
-
- This function is to get class member "dump"
-
- @return verbose the flag of dump.
- **/
- public String getDump() {
- return dump.getValue();
- }
-
- /**
- setDump
-
- This function is to set class member "dump"
-
- @param dump
- True or False.
- **/
- public void setDump(boolean dump) {
- if (dump) {
- this.dump.setArg(" -", "dump");
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java
deleted file mode 100644
index 2f892a7cd4..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/GuidChkTask.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file
- GuidChkTask class.
-
- GuidChkTask is to call GuidChk.exe to generate Section.
-
- 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.
-
-**/
-package org.tianocore.framework.tasks;
-import java.io.BufferedReader;
-import java.io.InputStreamReader;
-import java.io.PrintWriter;
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- GuidChkTask
-
- GuidChkTask is to call GuidChk.exe to generate Section.
-
-**/
-public class GuidChkTask extends Task implements EfiDefine{
- /**
- * GuidChk task class
- * class member
- * -exDir : directory name of exclusion searching
- * -exFile : file name of exclusion searching
- * -exExt : extension name of exclusion searching
- * -exSubDir: extesnion name of sub dir which excluded searching
- * -outFile : out put file wrote internal GUID+basename list
- * -chkGui : check for duplicate guids
- * -chkSign : check for duplicate signatures
- * -printGuiDef : if set will print guid+defined symbol name
- * -printAllGuid: if set will print all GUIDS found
- * -outPut : redirection file name
- * -fos : out put redirect to this file
- *
- */
- //
- // Tool name
- //
- private static String toolName = "GuidChk";
- //
- // Directory name of exclusion searching
- //
- private FileArg exDir = new FileArg();
- //
- // File name of exclusion searching.
- //
- private FileArg exFile = new FileArg();
- //
- // Extension name of exclusion searching.
- //
- private FileArg exExt = new FileArg();
- //
- // Extesnion name of sub dir which excluded searching.
- //
- private FileArg exSubDir = new FileArg();
- //
- // Out put file wrote internal GUID+basename list
- //
- private FileArg outFile = new FileArg();
- //
- // Check for duplicate guids.
- //
- private ToolArg chkGui = new ToolArg();
- //
- // Check for duplicate signatures
- //
- private ToolArg chkSign = new ToolArg();
- //
- // If set will print guid+defined symbol name
- //
- private ToolArg printGuiDef = new ToolArg();
- //
- // If set will print all GUIDS found
- //
- private ToolArg printAllGuid = new ToolArg();
- //
- // redirection file name.
- //
- private String outPut = "";
- //
- // out put redirect to this file.
- //
- protected PrintWriter fos = null;
-
- //
- // overload class execute method
- //
- public void execute() throws BuildException {
- Project project = this.getOwningTarget().getProject();
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separatorChar + toolName;
- }
- String argument = "" + exDir +
- exFile +
- exExt +
- exSubDir +
- outFile +
- chkGui +
- chkSign +
- printGuiDef +
- printAllGuid;
- try {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, command + " " + argument);
- //
- // execute command line
- //
- Process proc = Runtime.getRuntime().exec(command + " " + argument);
- //
- // if set output, redirect out put to output file, else print output to screen
- //
- if ( !this.outPut.equals("")) {
- fos = new PrintWriter(this.outPut);
- BufferedReader bin = new BufferedReader(new InputStreamReader(proc.getInputStream()));
- String line = bin.readLine();
- while (line != null ){
- fos.println(line);
- line = bin.readLine();
- }
- fos.close();
- }
- else {
- BufferedReader bin = new BufferedReader(new InputStreamReader(proc.getInputStream()));
- String line = bin.readLine();
- while (line != null ){
- line = bin.readLine();
- }
- }
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " Succeeded!");
- } catch (Exception e) {
- throw new BuildException(toolName + " failed!");
- }
- }
- /**
- getChkGui
-
- This function is to get the string of flag of ChkGui
-
- @return string of flag of ChkGui
- **/
- public String getChkGui() {
- return chkGui.getValue();
- }
-
- /**
- setChkGui
-
- This function is to set chkGui
-
- @param chkGui set class member of chkGui
- **/
- public void setChkGui(boolean chkGui) {
- if (chkGui) {
- this.chkGui.setArg(" -", "g");
- }
- }
-
- /**
- getChkSign
-
- This function is to get chkSign
-
- @return chkSign
- **/
- public String getChkSign() {
- return chkSign.getValue();
- }
-
- /**
- setChkSign
-
- This function is to set class member of chkSign
- * @param chkSign
- */
- public void setChkSign(boolean chkSign) {
- if (chkSign){
- this.chkSign.setArg(" -", "s");
- }
- }
- /**
- getExDir
-
- This function is to get class member of exDir
-
- @return exDir
- **/
- public String getExDir() {
- return exDir.getValue();
- }
-
- /**
- setExDir
-
- This function is to set class member of exDir
-
- @param exDir
- **/
- public void setExDir(String exDir) {
- this.exDir.setArg(" -d ", exDir);
- }
-
- /**
- getExExt
-
- This function is to get class member of exExt
-
- @return exExt
- **/
- public String getExExt() {
- return exExt.getValue();
- }
-
- /**
- setExExt
-
- This function is to set class member of exExt
- @param exExt
- **/
- public void setExExt(String exExt) {
- this.exExt.setArg(" -e ", exExt);
- }
-
- /**
- getExFile
-
- This function is to get class member of exFile
- @return exFile
- **/
- public String getExFile() {
- return exFile.getValue();
- }
-
- /**
- setExFile
-
- This function is to set class member of exFile.
-
- @param exFile
- **/
- public void setExFile(String exFile) {
- this.exFile.setArg(" -f ", exFile);
- }
-
- /**
- getExSubDir
-
- This function is to get class member of exSubDir
-
- @return exSubDir
- **/
- public String getExSubDir() {
- return exSubDir.getValue();
- }
-
- /**
- setExSubDir
-
- This function is to set class member of exSubDir.
- @param exSubDir
- **/
- public void setExSubDir(String exSubDir) {
- this.exSubDir.setArg(" -u ", exSubDir);
- }
-
- /**
- getOutFile
-
- This function is to get outFile
-
- @return outFile
- **/
- public String getOutFile() {
- return outFile.getValue();
- }
- /**
- * set class member of outFile
- * @param outFile
- */
- public void setOutFile(String outFile) {
- this.outFile.setArg(" -b ", outFile);
- }
- /**
- getPrintGuidDef
-
- This function is to get printGuidDef
-
- @return flage of printing (guid+defined symbol name)
- **/
- public String getPrintGuiDef() {
- return printGuiDef.getValue();
- }
-
-
- /**
- setPrintGuidDef
-
- This function is to set class member of printGuiDef.
- @param printGuiDef
- **/
- public void setPrintGuiDef(boolean printGuiDef) {
- if (printGuiDef){
- this.printGuiDef.setArg(" -", "x");
- }
-
- }
-
- /**
- getOutput
-
- This function is to get output
-
- @return name of outPut file
- **/
- public String getOutPut() {
- return outPut;
- }
-
- /**
- setOutPut
-
- This function is to set class member of outPut.
- @param outPut
- **/
- public void setOutPut(String outPut) {
- this.outPut = outPut;
- }
-
- /**
- getPrintAllGuid
-
- This function is to get printAllGuid
- @return printAllGuid
- **/
- public String getPrintAllGuid() {
- return printAllGuid.getValue();
- }
-
- /**
- setPrintAllGuid
-
- This function is to set class member of printAllGuid.
- @param printAllGuid
- **/
- public void setPrintAllGuid(boolean printAllGuid) {
- if (printAllGuid) {
- this.printAllGuid.setArg(" -", "p");
- }
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/IncludePath.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/IncludePath.java
deleted file mode 100644
index 4591406bbf..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/IncludePath.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @file
-This file is used to nest elements which is meant for include path name
-
-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.
-
-**/
-
-package org.tianocore.framework.tasks;
-
-/**
- IncludePath class is generally used to pass arguments with "-i" before each
- of them.
- **/
-public class IncludePath extends NestElement {
- public String toString() {
- return super.toString(" -i ");
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Input.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Input.java
deleted file mode 100644
index 088d37883b..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Input.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-This file is used to nest elements which is meant for file path
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-/**
- Input class is defined to be as nested elements of other elements, to specify
- the path of file(s).
- **/
-public class Input extends NestElement {
- public String toString() {
- return super.toString(" -f ");
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/InputFile.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/InputFile.java
deleted file mode 100644
index fe0cc83eb2..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/InputFile.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-This file is used to nest elements which is meant for specifying files
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-/**
- InputFile is always used to pass arguments separated by space
- **/
-public class InputFile extends NestElement {
- public String toString() {
- return super.toString(" ");
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java
deleted file mode 100644
index 86f39adafc..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/MakeDeps.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/** @file
-This file is to wrap MakeDeps.exe tool as ANT task, which is used to generate
-dependency files for source code.
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.BufferedInputStream;
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Stack;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.tianocore.common.cache.FileTimeStamp;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- Class MakeDeps is used to wrap MakeDeps.exe as an ANT task.
- **/
-public class MakeDeps extends Task {
-
- //
- // private members, use set/get to access them
- //
- private String targetFile = "";
- private String depsFilePath = "";
- private IncludePath includePathList = new IncludePath();
- private Input inputFileList = new Input();
- //
- // cache the including files to speed up dependency check
- //
- private static HashMap<String, Set<String>> includesCache = new HashMap<String, Set<String>>();
- //
- // regular expression for "#include ..." directive
- //
- private static final Pattern incPattern = Pattern.compile("[\n\r \t#]*include[ \t]+[\"<]*([^\n\r\"<>]+)[>\" \t]*");
-
- public MakeDeps() {
-
- }
-
- /**
- The Standard execute method for ANT task. It will check if it's necessary
- to generate the dependency list file. If no file is found or the dependency
- is changed, it will compose the command line and call MakeDeps.exe to
- generate the dependency list file.
-
- @throws BuildException
- **/
- public void execute() throws BuildException {
- //
- // if target file is specified and it hasn't been generated, don't generate
- // dep file
- //
- if (targetFile.length() != 0 && (new File(targetFile)).exists() == false) {
- return;
- }
- //
- // check if the dependency list file is uptodate or not
- //
- if (isUptodate()) {
- return;
- }
-
- //
- // if no include path is specified, try locally
- //
- if (includePathList.isEmpty()) {
- includePathList.insPath(".");
- }
-
- Set<String> depFiles = getDependencies(inputFileList.toArray());
-
- File depsFile = new File(depsFilePath);
- FileWriter fileWriter = null;
- BufferedWriter bufWriter = null;
-
- try {
- fileWriter = new FileWriter(depsFile);
- bufWriter = new BufferedWriter(fileWriter);
-
-
- for (Iterator it = depFiles.iterator(); it.hasNext();) {
- String depFile = (String)it.next();
- bufWriter.write(depFile, 0, depFile.length());
- bufWriter.write("\n", 0, 1);
- }
- //
- // put a "tab" at the end of file as file ending flag
- //
- bufWriter.write("\t", 0, 1);
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- } finally {
- try {
- if (bufWriter != null) {
- bufWriter.close();
- }
- if (fileWriter != null) {
- fileWriter.close();
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- //
- // update time stamp of dependency file
- //
- FileTimeStamp.update(depsFilePath, depsFile.lastModified());
- }
-
- public void setTargetFile(String name) {
- targetFile = name;
- }
-
- public String getTargetFile() {
- return targetFile;
- }
-
- /**
- Set method for "DepsFile" attribute
-
- @param name The name of dependency list file
- **/
- public void setDepsFile(String name) {
- depsFilePath = name;
- }
-
- /**
- Get method for "DepsFile" attribute
-
- @returns The name of dependency list file
- **/
- public String getDepsFile() {
- return depsFilePath;
- }
-
- /**
- Add method for "IncludePath" nested element
-
- @param path The IncludePath object from nested IncludePath type of element
- **/
- public void addConfiguredIncludepath(IncludePath path) {
- includePathList.insert(path);
- }
-
- /**
- Add method for "Input" nested element
-
- @param input The Input object from nested Input type of element
- **/
- public void addConfiguredInput(Input inputFile) {
- inputFileList.insert(inputFile);
- }
-
- /**
- Check if the dependency list file should be (re-)generated or not.
-
- @returns true The dependency list file is uptodate. No re-generation is needed.
- @returns false The dependency list file is outofdate. Re-generation is needed.
- **/
- private boolean isUptodate() {
- File df = new File(depsFilePath);
- if (!df.exists()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, depsFilePath + " doesn't exist!");
- return false;
- }
-
- //
- // If the source file(s) is newer than dependency list file, we need to
- // re-generate the dependency list file
- //
- long depsFileTimeStamp = FileTimeStamp.get(depsFilePath);
- List<String> fileList = inputFileList.getNameList();
- for (int i = 0, length = fileList.size(); i < length; ++i) {
- String sf = fileList.get(i);
- if (FileTimeStamp.get(sf) > depsFileTimeStamp) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, sf + " has been changed since last build!");
- return false;
- }
- }
-
- //
- // If the source files haven't been changed since last time the dependency
- // list file was generated, we need to check each file in the file list to
- // see if any of them is changed or not. If anyone of them is newer than
- // the dependency list file, MakeDeps.exe is needed to run again.
- //
- LineNumberReader lineReader = null;
- FileReader fileReader = null;
- boolean ret = false;
- try {
- fileReader = new FileReader(df);
- lineReader = new LineNumberReader(fileReader);
-
- String line = null;
- int lines = 0;
- while ((line = lineReader.readLine()) != null) {
- //
- // check file end flag "\t" to see if the .dep was generated correctly
- //
- if (line.equals("\t")) {
- ret = true;
- continue;
- }
- line = line.trim();
- //
- // skip empty line
- //
- if (line.length() == 0) {
- continue;
- }
- ++lines;
-
- //
- // If a file cannot be found (moved or removed) or newer, regenerate the dep file
- //
- File sourceFile = new File(line);
- if ((!sourceFile.exists()) || (FileTimeStamp.get(line) > depsFileTimeStamp)) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, sourceFile.getPath() + " has been (re)moved or changed since last build!");
- ret = false;
- break;
- }
- }
-
- //
- // check if the .dep file is empty
- //
- if (lines == 0) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, depsFilePath + " is empty!");
- ret = false;
- }
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- } finally {
- try {
- if (lineReader != null) {
- lineReader.close();
- }
- if (fileReader != null) {
- fileReader.close();
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- return ret;
- }
-
- //
- // get dependent files list by parsing "#include" directive
- //
- private synchronized Set<String> getDependencies(String[] sourceFiles) {
- Set<String> dependencies = new LinkedHashSet<String>();
- String[] searchPathList = includePathList.toArray();
-
- Stack<String> pendingFiles = new Stack<String>();
- for (int i = 0; i < sourceFiles.length; ++i) {
- File srcFile = new File(sourceFiles[i]);
- if (srcFile.exists()) {
- //
- // a file must depend itself
- //
- dependencies.add(srcFile.getAbsolutePath());
- pendingFiles.push(sourceFiles[i]);
- }
- }
-
- while (!pendingFiles.empty()) {
- String src = pendingFiles.pop();
- File srcFile = new File(src);
- int fileLength = (int)srcFile.length();
- if (!srcFile.exists() || fileLength == 0) {
- continue;
- }
- //
- // try cache first
- //
- Set<String> incFiles = includesCache.get(src);
- if (incFiles == null) {
- incFiles = new HashSet<String>();
- FileInputStream fileReader = null;
- BufferedInputStream bufReader = null;
- String fileContent = "";
-
- try {
- fileReader = new FileInputStream(srcFile);
- bufReader = new BufferedInputStream(fileReader);
- byte[] buf = new byte[fileLength];
-
- bufReader.read(buf, 0, fileLength);
- //
- // check if the file is utf-16 encoded
- //
- if (buf[0] == (byte)0xff || buf[0] == (byte)0xfe) {
- fileContent = new String(buf, "UTF-16");
- buf = fileContent.getBytes("UTF-8");
- }
- fileContent = new String(buf);
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- } finally {
- try {
- if (bufReader != null) {
- bufReader.close();
- }
- if (fileReader != null) {
- fileReader.close();
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- //
- // find out all "#include" lines
- //
- Matcher matcher = incPattern.matcher(fileContent);
- while (matcher.find()) {
- String incFilePath = fileContent.substring(matcher.start(1), matcher.end(1));
- incFiles.add(incFilePath);
- }
-
- //
- // put the includes in cache to avoid re-parsing
- //
- includesCache.put(src, incFiles);
- }
-
- //
- // try each include search path to see if the include file exists or not
- //
- for (Iterator<String> it = incFiles.iterator(); it.hasNext();) {
- String depFilePath = it.next();
-
- for (int i = 0; i < searchPathList.length; ++i) {
- File depFile = new File(searchPathList[i] + File.separator + depFilePath);
- String filePath = depFile.getAbsolutePath();
- //
- // following check is a must. it can prevent dead loop if two
- // files include each other
- //
- if (depFile.exists() && !dependencies.contains(filePath)) {
- dependencies.add(filePath);
- pendingFiles.push(filePath);
- break;
- }
- }
- }
- }
-
- return dependencies;
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java
deleted file mode 100644
index 5892064509..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ModifyInfTask.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/** @file
- ModifyInfTask class.
-
- ModifyInfTask is used to call Modify.exe to generate inf file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- ModifyInfTask class.
-
- ModifyInfTask is used to call Modify.exe to generate inf file.
-**/
-public class ModifyInfTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "ModifyInf";
-
- //
- // input FV inf file
- //
- private FileArg inputFVInfFile = new FileArg();
-
- //
- // output FV inf file
- //
- private FileArg outputFVInfFile = new FileArg();
-
- //
- // pattern string
- //
- private ToolArg patternStr = new ToolArg();
-
- //
- // Output dir
- //
- private String outputDir = ".";
-
- /**
- execute
-
- ModifyInfTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separatorChar + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + this.inputFVInfFile + this.outputFVInfFile + this.patternStr;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.inputFVInfFile.toFileList()
- + " => " + this.inputFVInfFile.toFileList());
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getinputFVInfFile
-
- This function is to get class member "inputFVInfFile".
-
- @return string of input inf file name.
- **/
- public String getinputFVInfFile() {
- return this.inputFVInfFile.getValue();
- }
-
- /**
- setinputFVInfFile
-
- This function is to set class member "inputFVInfFile".
-
- @param inputFile
- string of input inf file name.
- **/
- public void setinputFVInfFile(String inputFVInfFileName) {
- this.inputFVInfFile.setArg(" ", inputFVInfFileName);
- }
-
- /**
- getoutputFVInfFile
-
- This function is to get class member "outputFVInfFile"
-
- @return outputFVInfFile string of output inf file name.
- **/
- public String getoutputFVInfFile() {
- return this.outputFVInfFile.getValue();
- }
-
- /**
- setoutputFVInfFile
-
- This function is to set class member "outputFVInfFile"
-
- @param outputFVInfFile
- string of output inf file name.
- **/
- public void setoutputFVInfFile(String outputFVInfFileName) {
- this.outputFVInfFile.setArg(" ", outputFVInfFileName);
- }
-
- /**
- getpatternStr
-
- This function is to get class member "patternStr"
-
- @return patternStr string of pattern.
- **/
- public String getpatternStr() {
- return this.patternStr.getValue();
- }
-
- /**
- setpatternStr
-
- This function is to set class member "patternStr"
-
- @param patternStr
- string of patternStr.
- **/
- public void setpatternStr(String patternStr) {
- this.patternStr.setArg(" ", patternStr);
- }
-
- /**
- getoutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getoutputDir() {
- return this.outputDir;
- }
-
- /**
- setoutputDir
-
- This function is to set class member "outputDir"
-
- @param patternStr
- string of output directory.
- **/
- public void setoutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/NestElement.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/NestElement.java
deleted file mode 100644
index dd36c9127b..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/NestElement.java
+++ /dev/null
@@ -1,366 +0,0 @@
-/** @file
-This file is to define common interfaces for nested element of frameworktasks
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-import java.util.List;
-import java.util.ArrayList;
-import java.io.FileReader;
-import java.io.BufferedReader;
-import java.util.StringTokenizer;
-
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.BuildException;
-
-/**
- Interface NestElement is to define common interfaces for nested element
- **/
-public class NestElement extends DataType {
- //
- // The name list. All the name strings got from setXXX methods will be put
- // in here.
- //
- protected List<String> nameList = new ArrayList<String>();
-
- /**
- Insert content in the newElement into this NestElement
-
- @param newElement The new NestElement
- **/
- public void insert(NestElement newElement) {
- this.nameList.addAll(newElement.getNameList());
- }
-
- /**
- Handle "name" attribute. No delimiter and special treatment are assumed.
-
- @param name A single string value of "name" attribute
- **/
- public void setName(String name) {
- if (name.length() > 0) {
- this.nameList.clear();
- this.nameList.add(name);
- }
- }
-
- public void insName(String name) {
- if (name.length() > 0) {
- this.nameList.add(name);
- }
- }
-
- /**
- Handle "list" attribute. The value of "list" is assumed as string
- separated by space, tab, comma or semmicolon.
-
- @param nameList The value of "list" separated by " \t,;"
- **/
- public void setList(String nameList) {
- if (nameList.length() == 0) {
- return;
- }
-
- this.nameList.clear();
- StringTokenizer tokens = new StringTokenizer(nameList, " \t,;", false);
- while (tokens.hasMoreTokens()) {
- String name = tokens.nextToken().trim();
- if (name.length() > 0) {
- this.nameList.add(name);
- }
- }
- }
-
- /**
- Handle "ListFile" attribute. The value of "ListFile" should be the path of
- a file which contains name strings, one name per line.
-
- @param listFileName The file path
- **/
- public void setListFile(String listFileName) {
- FileReader fileReader = null;
- BufferedReader in = null;
- String str;
-
- //
- // Check if the file exists or not
- //
- File file = new File(listFileName);
- if (!file.exists()) {
- throw new BuildException("The file, " + file + " does not exist!");
- }
-
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
-
- //
- // Read line by line
- //
- nameList.clear();
- while((str = in.readLine()) != null){
- str = str.trim();
- if (str.length() == 0){
- continue;
- }
-
- //getProject().replaceProperties(str);
- this.nameList.add(str);
- }
- } catch (Exception e){
- throw new BuildException(e.getMessage());
- } finally {
- try {
- //
- // close the file
- //
- if (in != null) {
- in.close();
- }
- if (fileReader != null) {
- fileReader.close();
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
- }
-
- /**
- Handle "file" attribute. The value of "file" should be a path.
-
- @param file The path name of a file
- **/
- public void setFile(String file) {
- setPath(file);
- }
-
- /**
- Add a file or file list into the file list
-
- @param file The path of a file
- **/
- public void insFile(String file) {
- insPath(file);
- }
-
- /**
- Handle "path" attribute. The value of "path" may contain compound path
- separator (/ or \) which should be cleaned up. Because the "path" string
- will always be passed to external native program which may not handle
- non-native path separator, the clean-up action is a must. And the value
- of "path" may contains several path separated by space, tab, comma or
- semmicolon. We need to split it and put each part in nameList.
-
- @param path String value of a file system path
- **/
- public void setPath(String path) {
- this.nameList.clear();
- insPath(path);
- }
-
- /**
- Add a path or path list into the path list
-
- @param path The path string
- **/
- public void insPath(String path) {
- if (path.length() == 0) {
- return;
- }
-
- //
- // split the value of "path" into separated single path
- //
- StringTokenizer tokens = new StringTokenizer(path, " \t,;", false);
- while (tokens.hasMoreTokens()) {
- String pathName = tokens.nextToken().trim();
- if (pathName.length() > 0) {
- //
- // Make clean the path string before storing it
- //
- this.nameList.add(cleanupPath(pathName));
- }
- }
- }
-
- /**
- Handle "FileName" attribute. The value of "FileName" should be the path
- of a file which contains path strings, one path per line.
-
- @param pathFileName
- **/
- public void setPathFile(String pathFileName) {
- FileReader fileReader = null;
- BufferedReader in = null;
- String path;
-
- //
- // Check if the file exists or not
- //
- File file = new File(pathFileName);
- if (!file.exists()) {
- throw new BuildException("The file, " + file + " does not exist!");
- }
-
- try {
- fileReader = new FileReader(file);
- in = new BufferedReader(fileReader);
-
- //
- // Read the file line by line, skipping empty ones
- //
- nameList.clear();
- while((path = in.readLine()) != null){
- path = path.trim();
- if (path.length() == 0){
- continue;
- }
- //getProject().replaceProperties(path);
-
- //
- // Make clean the path string before storing it.
- //
- nameList.add(cleanupPath(path));
- }
- } catch (Exception e){
- throw new BuildException(e.getMessage());
- } finally {
- try {
- //
- // close the file
- //
- if (in != null) {
- in.close();
- }
- if (fileReader != null) {
- fileReader.close();
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
- }
-
- /**
- Return the name list.
-
- @return List<String> The list contains the name(path) strings
- **/
- public List<String> getNameList() {
- return nameList;
- }
-
- /**
- Compose and return the the name/path string without any delimiter. The trick
- here is that it's actually used to return the value of nameList which
- has just one name/string.
-
- @return String
- **/
- public String toString() {
- return toString("");
- }
-
- /**
- Compose and return the name/path string concatenated by leading "prefix".
-
- @param prefix The string will be put before each name/string in nameList
-
- @return String The string concatenated with "prefix"
- **/
- public String toString(String prefix) {
- StringBuffer string = new StringBuffer(1024);
- int length = nameList.size();
-
- for (int i = 0; i < length; ++i) {
- string.append(prefix);
- string.append(nameList.get(i));
- }
-
- return string.toString();
- }
-
- /**
- Compose and return the name/path string concatenated by space and
- with only one "prefix".
-
- @param prefix The prefix at the beginning of the string
-
- @return String The string with one prefix at the beginning
- **/
- public String toStringWithSinglepPrefix(String prefix) {
- return prefix + toString(" ");
- }
-
- /**
- Compose a string list with file names only, separated by spcified string
-
- @param separator The separator string
-
- @return String The file list
- **/
- public String toFileList(String separator) {
- StringBuffer string = new StringBuffer(1024);
- int length = nameList.size();
-
- for (int i = 0; i < length; ++i) {
- File file = new File(nameList.get(i));
- string.append(file.getName());
- string.append(separator);
- }
-
- return string.toString();
- }
-
- /**
- Compose a string list with file names only, separated by space
-
- @return String The list string
- **/
- public String toFileList() {
- return toFileList(" ");
- }
-
- /**
- Get the array of names
-
- @return String[] The array contains the names
- **/
- public String[] toArray() {
- return nameList.toArray(new String[nameList.size()]);
- }
-
- /**
- Check if we have any name or not
-
- @return boolean
- **/
- public boolean isEmpty() {
- return nameList.isEmpty();
- }
-
- //
- // Remove any duplicated path separator or inconsistent path separator
- //
- private String cleanupPath(String path) {
- String separator = "\\" + File.separator;
- String duplicateSeparator = separator + "{2}";
-
- path = Path.translateFile(path);
- path = path.replaceAll(duplicateSeparator, separator);
-
- return path;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java
deleted file mode 100644
index ab563823e8..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/PeiReBaseTask.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/** @file
- PeiReBaseTask class.
-
- PeiReBaseTask is used to call PeiReBase.exe to rebase efi fv file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- PeiReBaseTask class.
-
- PeiReBaseTask is used to call PeiReBase.exe to rebase efi fv file.
-**/
-public class PeiReBaseTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "PeiReBase";
- //
- // Input file
- //
- private FileArg inputFile = new FileArg();
- //
- // Output file
- //
- private FileArg outputFile = new FileArg();
- //
- // Base address
- //
- private ToolArg baseAddr = new ToolArg();
- //
- // Fv.inf file
- //
- private FileArg fvinfFile = new FileArg();
- //
- // map file
- //
- private FileArg mapFile = new FileArg();
- //
- // Architecture
- //
- private String arch = "IA32";
-
- /**
- execute
-
- PeiReBaseTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
- if (isUptodate()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, outputFile.toFileList() + " is up-to-date!");
- return;
- }
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (this.arch.equalsIgnoreCase("IA32")){
- command = toolName + "_IA32";
- } else if (this.arch.equalsIgnoreCase("X64")){
- command = toolName + "_X64";
- } else if (this.arch.equalsIgnoreCase("IPF")){
- command = toolName + "_IPF";
- } else {
- command = toolName + "_IA32";
- }
- if (path != null) {
- command = path + File.separator + command;
- }
-
- //
- // argument of tools
- //
- if (mapFile.getValue().length() == 0) {
- mapFile.setArg(" -M ", outputFile.getValue() + ".map");
- }
- argument = "" + inputFile + outputFile + baseAddr + fvinfFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, inputFile.toFileList() + " => "
- + outputFile.toFileList()
- + mapFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "PeiReBase succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException("PeiReBase failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" -I ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" -O ", outputFile);
- }
-
- /**
- getBaseAddr
-
- This function is to get class member "baseAddr"
-
- @return baseAddr string of base address.
- **/
- public String getBaseAddr() {
- return baseAddr.getValue();
- }
-
- /**
- setBaseAddr
-
- This function is to set class member "baseAddr"
-
- @param baseAddr string of base address
- **/
- public void setBaseAddr(String baseAddr) {
- this.baseAddr.setArg(" -B ", baseAddr);
- }
-
- /**
- getArch
-
- This function is to get class member "arch".
-
- @return arch Architecture
- **/
- public String getArch() {
- return arch;
- }
-
- /**
- setArch
-
- This function is to set class member "arch"
-
- @param arch Architecture
- **/
- public void setArch(String arch) {
- this.arch = arch;
- }
-
- /**
- Get the value of fv.inf file
-
- @return String The fv.inf file path
- **/
- public String getFvInfFile() {
- return fvinfFile.getValue();
- }
-
- /**
- Set "-F FvinfFile" argument
-
- @param fvinfFile The path of fv.inf file
- **/
- public void setFvInfFile(String fvinfFile) {
- this.fvinfFile.setArg(" -F ", fvinfFile);
- }
-
- /**
- Get the value of map file
-
- @return String The map file path
- **/
- public String getMapFile() {
- return mapFile.getValue();
- }
-
- /**
- Set "-M MapFile" argument
-
- @param mapFile The path of map file
- **/
- public void setMapFile(String mapFile) {
- this.mapFile.setArg(" -M ", mapFile);
- }
-
- //
- // Dependency check
- //
- private boolean isUptodate() {
- File srcFile = new File(inputFile.getValue());
- File dstFile = new File(outputFile.getValue());
-
- if (srcFile.lastModified() > dstFile.lastModified()) {
- return false;
- }
-
- return true;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java
deleted file mode 100644
index 310cb6a814..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecApResetVectorFixupTask.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/** @file
- SecApResetVectorFixupTask class.
-
- SecApResetVectorFixupTask is used to call SecApResetVectorFixup.exe to place
- Ap reset vector.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- SecApResetVectorFixupTask class.
-
- SecApResetVectorFixupTask is used to call SecApResetVectorFixup.exe to place
- Ap reset vector.
-**/
-public class SecApResetVectorFixupTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "SecApResetVectorFixup";
- //
- // input FV recovery file
- //
- private FileArg fvInputFile = new FileArg();
-
- //
- // output file
- //
- private FileArg fvOutputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
-
- /**
- execute
-
- SecApResetVectorFixupTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + this.fvInputFile + this.fvOutputFile;
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, this.fvInputFile.toFileList()
- + " => " + this.fvOutputFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "fvInputFile".
-
- @return string of input file name.
- **/
- public String getfvInputFile() {
- return this.fvInputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "fvInputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setFvInputFile(String inputFile) {
- this.fvInputFile.setArg(" ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "fvOutputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return this.fvOutputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "fvOutputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setFvOutputFile(String outputFile) {
- this.fvOutputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java
deleted file mode 100644
index 2f9bc46b8f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SecFixupTask.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/** @file
- SecFixupTask class.
-
- SecFixupTask is used to call SecFixup.exe to fix up sec image.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- * SecFixupTask class.
- *
- * SecFixupTask is used to call SecFixup.exe to fix up sec image.
- */
-public class SecFixupTask extends Task implements EfiDefine {
- //
- // tool name
- //
- private String toolName = "SecFixup";
-
- //
- // input file
- //
- private FileArg secExeFile = new FileArg();
-
- //
- // output file
- //
- private FileArg resetVectorDataFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
- /**
- execute
-
- SecFixupTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separatorChar + toolName;
- }
- //
- // argument of tools
- //
- argument = "" + secExeFile + resetVectorDataFile + outputFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, secExeFile.toFileList()
- + resetVectorDataFile.toFileList() + " => " + outputFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = "+ Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getSecExeFile
-
- This function is to get class member "secExeFile".
-
- @return string of sectExe file name.
- **/
- public String getSecExeFile() {
- return this.secExeFile.getValue();
- }
-
- /**
- setSecExeFile
-
- This function is to set class member "secExeFile".
-
- @param secExeFile
- string of secExe file name.
- **/
- public void setSecExeFile(String secExeFile) {
- this.secExeFile.setArg(" ", secExeFile);
- }
-
- /**
- getResetVectorDataFile
-
- This function is to get class member "resetVectorDataFile"
-
- @return resetVectorDataFile string of resetVectorData file name.
- **/
- public String getResetVectorDataFile() {
- return this.resetVectorDataFile.getValue();
- }
-
- /**
- setResetVectorDataFile
-
- This function is to set class member "resetVectorDataFile"
-
- @param resetVectorDataFile
- string of resetVectorData file name.
- **/
- public void setResetVectorDataFile(String resetVectorDataFile) {
- this.resetVectorDataFile.setArg(" ", resetVectorDataFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return this.outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir name of output directory
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- name of output directory
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SectFile.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SectFile.java
deleted file mode 100644
index 9d53a21999..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SectFile.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/** @file
-This file is to define nested element which is meant for specifying section file
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import org.apache.tools.ant.BuildException;
-
-/**
- Class SectFile is to define a class corresponding to ANT nested element. It's
- used to specify section file(s) when used with GenFfsFile task
- **/
-public class SectFile implements Section {
- private String fileName = ""; /// section file name
- private int alignment = 0;
-
- /**
- Get method of ANT task/datatype for "FileName" attribute
-
- @returns The name of section file
- **/
- public String getFileName() {
- return fileName;
- }
-
- /**
- Set method of ANT task/datatype for "FileName" attribute
-
- @param fileName The name of section file
- **/
- public void setFileName(String fileName) {
- this.fileName = fileName;
- }
-
- public int getAlignment() {
- return alignment;
- }
-
- public void setAlignment(int alignment) {
- if (alignment > 7) {
- this.alignment = 7;
- } else {
- this.alignment = alignment;
- }
- }
-
- public SectFile (){
- }
-
- /**
- Put the content of section file into specified buffer with extra bytes for
- alignment requirement.
-
- @param Buffer buffer to contain the section file content with alignment
- **/
- public void toBuffer (DataOutputStream buffer){
- File sectFile;
- int fileLen;
-
- ///
- /// open file
- ///
- sectFile = new File (this.fileName);
-
- ///
- /// check if file exist.
- ///
- if (! sectFile.exists()) {
- throw new BuildException("The file " + this.fileName + " is not exist!\n");
- }
-
-
- ///
- /// Read section file and add it's contains to buffer.
- ///
- try {
-
- FileInputStream fs = new FileInputStream (sectFile.getAbsoluteFile());
- DataInputStream In = new DataInputStream (fs);
- fileLen = (int)sectFile.length();
- byte[] sectBuffer = new byte[fileLen];
- In.read(sectBuffer);
- buffer.write(sectBuffer);
-
- ///
- /// 4 byte alignment
- ///
- while ((fileLen & 0x03)!= 0) {
- fileLen ++;
- buffer.writeByte(0);
- }
-
- ///
- /// close inputStream
- ///
- In.close();
-
- } catch (Exception e) {
- System.out.print(e.getMessage());
- throw new BuildException("SectFile, toBuffer failed!\n");
- }
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Section.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Section.java
deleted file mode 100644
index ff4c6d6d11..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Section.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/** @file
-This file is to define interface for manipulating section file
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.DataOutputStream;
-
-/**
- Section interface is for geting the contain buffer form compress, tool, and sectFile
- **/
-public interface Section {
- int alignment = 0;
- public void toBuffer (DataOutputStream buffer);
- public void setAlignment(int alignment);
- public int getAlignment();
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java
deleted file mode 100644
index dc3a96e8e5..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SetStampTask.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/** @file
-This file is to define an ANT task to wrap setstamp.exe tool
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- Class SetStampTask is a wrap class for setstamp.exe.
- **/
-public class SetStampTask extends Task implements EfiDefine {
- /**
- SetStamp Task Class
- class member
- -peFile : file of PE
- -timeFile: Txt file of time
- **/
-
- private static String toolName = "SetStamp";
-
- private FileArg peFile = new FileArg();
-
- private FileArg timeFile = new FileArg();
-
- private String outputDir = ".";
-
- /**
- assemble tool command line & execute tool command line
-
- @throws BuildException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
- ///
- /// absolute path of edk tools
- ///
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
- ///
- /// argument of SetStamp tool
- ///
- String argument = "" + peFile + timeFile;
- ///
- /// reture value of SetStamp execution
- ///
- int returnVal = -1;
-
- try {
- Commandline commandLine = new Commandline();
- commandLine.setExecutable(command);
- commandLine.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
-
- Execute runner = new Execute(streamHandler, null);
- runner.setAntRun(project);
- runner.setCommandline(commandLine.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(commandLine.getCommandline()));
- EdkLog.log(this, peFile.toFileList() + " < " + timeFile.toFileList());
-
- returnVal = runner.execute();
- if (EFI_SUCCESS == returnVal) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- ///
- /// command execution fail
- ///
- EdkLog.log(this, "ERROR = " + Integer.toHexString(returnVal));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- set operation of class member "peFile"
-
- @param peFile name of PE File
- **/
- public void setPeFile(String peFile) {
- this.peFile.setArg(" ", peFile);
- }
-
- /**
- get operation of class member "peFile"
-
- @return peFile name of PE file
- **/
- public String getPeFile() {
- return this.peFile.getValue();
- }
-
- /**
- set operation of class member "timeFile"
-
- @param timeFile name of time file
- **/
- public void setTimeFile(String timeFile) {
- this.timeFile.setArg(" ", timeFile);
- }
-
- /**
- get class member "timeFile"
-
- @returns name of time file
- **/
- public String getTimeFile() {
- return this.timeFile.getValue();
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SkipExt.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SkipExt.java
deleted file mode 100644
index 20883c98e3..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SkipExt.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/** @file
-This file is to define nested element which is meant for specifying skipped file list
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-/**
- SkipExt nested element Class
- **/
-public class SkipExt extends NestElement {
- public String toString() {
- return super.toString(" -skipext ");
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java
deleted file mode 100644
index 7c1882aaf0..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/SplitfileTask.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- SplitfileTask class.
-
- SplitfileTask is used to call splitfile.exe to split input file to 2 output
- file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- SplitfileTask class.
-
- SplitfileTask is used to call splitfile.exe to split input file to 2 output
- file.
-**/
-public class SplitfileTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private static String toolName = "SplitFile";
-
- //
- // input file
- //
- private FileArg inputFile = new FileArg();
-
- //
- // offset value
- //
- private ToolArg offset = new ToolArg();
-
- //
- // Output directory
- //
- private String outputDir = ".";
-
- /**
- execute
-
- SplitfleTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- //
- // argument of tools
- //
- argument = "" + inputFile + offset;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- String fileName = inputFile.toFileList();
- EdkLog.log(this, EdkLog.EDK_INFO, fileName + " => " + fileName + "1 " + fileName + "2");
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" ", inputFile);
- }
-
- /**
- getOffset
-
- This function is to get class member "offset"
-
- @return offset value of string.
- **/
- public String getOffset() {
- return offset.getValue();
- }
-
- /**
- setOffset
-
- This function is to set class member "offset"
-
- @param offset
- string of offset value.
- **/
- public void setOffset(String offset) {
- this.offset.setArg(" ", offset);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java
deleted file mode 100644
index 541e96f54f..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StrGatherTask.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/** @file
-This file is to define an ANT task which wraps StrGather.exe tool.
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- StrGather Task Class
- class memberg
- -commandType : command type [parse/scan/dump]
- -baseName : base name of component
- -verbose : level of verbose [all/read/write]
- -outputDatabase : file name of output database file
- -databaseList : file name list of database files
- -inputFileList : file name list of input files
- -newDatabase : whether to need new database [ture/false]
- -unquotedString : whether to unquoted strings are used [ture/false]
- -includePathList: path list of include paths
- -ignoreNotFound : whether to ignore a given STRING_TOKEN(STR) is not found in database [ture/false]
- -skipExtList : skip scan of files with extension name
- -outputString : write string data to filename
- -outputDefines : write string defines to filename
- -outputUnicode : dump database to unicode file filename
- -lang : only dump for the language
- -indirectionFile: specify an indirection file
- -outputHpk : create an HII export pack of the strings
- **/
-public class StrGatherTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private static String toolName = "StrGather";
-
- //
- // common options
- //
- private ToolArg commandType = new ToolArg();
-
- private ToolArg baseName = new ToolArg();
-
- //
- // "all/read/write"
- //
- private ToolArg verbose = new ToolArg();
-
- private FileArg outputDatabase = new FileArg();
-
- private Database databaseList = new Database();
-
- private InputFile inputFileList = new InputFile();
-
- //
- // parse options newDatabase -- "ture/false" unquoteString -- "ture/false"
- //
- private ToolArg newDatabase = new ToolArg();
-
- private ToolArg unquotedString = new ToolArg();
-
- private IncludePath includePathList = new IncludePath();
-
- //
- // scan options ignoreNotFound -- "ture/false"
- //
- private ToolArg ignoreNotFound = new ToolArg();
-
- private SkipExt skipExtList = new SkipExt();
-
- //
- // dump options
- //
- private ToolArg outputString = new ToolArg();
-
- private ToolArg outputDefines = new ToolArg();
-
- private ToolArg outputUnicode = new ToolArg();
-
- private ToolArg lang = new ToolArg();
-
- private FileArg indirectionFile = new FileArg();
-
- private FileArg outputHpk = new FileArg();
-
- //
- // global variable
- //
- static private Project project;
-
- /**
- assemble tool command line & execute tool command line
-
- @throws BuildException
- **/
- public void execute() throws BuildException {
-
- project = this.getOwningTarget().getProject();
- ///
- /// absolute path of efi tools
- ///
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- ///
- /// assemble argument
- ///
- String argument = "" + commandType + verbose + databaseList + baseName
- + outputDatabase + includePathList + newDatabase + unquotedString
- + skipExtList + ignoreNotFound + outputString + outputDefines
- + outputUnicode + lang + indirectionFile + outputHpk
- + inputFileList;
- ///
- /// return value of fwimage execution
- ///
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
-
- String cmdType = getCommandType();
- if (cmdType.equalsIgnoreCase("parse")) {
- EdkLog.log(this, "(parse) " + inputFileList.toFileList() + " => "
- + databaseList.toFileList());
- } else if (cmdType.equalsIgnoreCase("scan")) {
- EdkLog.log(this, "(scan) " + databaseList.toFileList() + " => "
- + outputDatabase.toFileList());
- } else {
- EdkLog.log(this, "(dump) " + databaseList.toFileList() + " => "
- + outputDefines.toFileList() + outputString.toFileList() + outputHpk.toFileList());
- }
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
-
- revl = runner.execute();
- if (EFI_SUCCESS == revl) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- ///
- /// command execution fail
- ///
- EdkLog.log(this, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- get class member "commandType"
-
- @returns commandType parameter
- **/
- public String getCommandType() {
- return this.commandType.getValue();
- }
-
- /**
- set class member ""
-
- @param commandType type of strgather command [parse/scan/dump]
- **/
- public void setCommandType(String commandType) {
- this.commandType.setArg(" -", commandType);
- }
-
- /**
- get class member "verbose"
-
- @returns verbose parameter
- **/
- public String getVerbose() {
- return this.verbose.getValue();
- }
-
- /**
- set class member "verbose"
-
- @param verbose verbose level [all/read/write]
- **/
- public void setVerbose(String verbose) {
- if (verbose.equals("all")) {
- ///
- /// for verbose output
- ///
- this.verbose.setArg(" -", "v");
- } else if (verbose.equals("read")) {
- ///
- /// for verbose output when reading database
- ///
- this.verbose.setArg(" -", "vdbr");
- } else if (verbose.equals("write")) {
- ///
- /// for verbose output when writing database
- ///
- this.verbose.setArg(" -", "vdbw");
- }
- }
-
- /**
- get class member baseName
-
- @returns baseName parameter
- **/
- public String getBaseName() {
- return this.baseName.getValue();
- }
-
- /**
- set class member baseName
-
- @param baseName name of the output files of .c and .h
- **/
- public void setBaseName(String baseName) {
- this.baseName.setArg(" -bn ", baseName);
- }
-
- /**
- get class member "outputDatabase"
-
- @returns outputDatabase parameter
- **/
- public String getOutputDatabase() {
- return this.outputDatabase.getValue();
- }
-
- /**
- set class member "outputDatabase"
-
- @param outputDatabase filename of output database file
- **/
- public void setOutputDatabase(String outputDatabase) {
- this.outputDatabase.setArg(" -od ", outputDatabase);
- }
-
- /**
- get class member "newDatabase"
-
- @returns newDatabase parameter
- **/
- public boolean getNewDatabse() {
- return this.newDatabase.getPrefix().length() > 0;
- }
-
- /**
- set class member "newDatabase"
-
- @param newDatabase whether to not read in existing database file
- **/
- public void setNewDatabase(boolean newDatabase) {
- if (newDatabase) {
- this.newDatabase.setArg(" -", "newdb");
- }
- }
-
- /**
- get class member "unquotedString"
-
- @returns unquotedString parameter
- **/
- public boolean getUnquotedString() {
- return this.unquotedString.getValue().length() > 0;
- }
-
- /**
- set class member "unquotedString"
-
- @param unquotedString :
- whether to indicate that unquoted strings are used
- **/
- public void setUnquotedString(boolean unquotedString) {
- if (unquotedString) {
- this.unquotedString.setArg(" -", "uqs");
- }
- }
-
- /**
- get class member "ignoreNotFound"
-
- @returns ignoreNotFound parameter
- **/
- public boolean getIgnoreNotFound() {
- return this.ignoreNotFound.getValue().length() > 0;
- }
-
- /**
- set class member "ignoreNotFound"
-
- @param ignoreNotFound whether to ignore if a given STRING_TOKEN(STR)
- is not found in the database
- **/
- public void setIgnoreNotFound(boolean ignoreNotFound) {
- if (ignoreNotFound) {
- this.ignoreNotFound.setArg(" -", "ignorenotfound");
- }
- }
-
- /**
- get class member "outputString"
-
- @returns outputString parameter
- **/
- public String getOutputString() {
- return this.outputString.getValue();
- }
-
- /**
- set class member "outputString"
-
- @param outputString filename of string data file
- **/
- public void setOutputString(String outputString) {
- this.outputString.setArg(" -oc ", outputString);
- }
-
- /**
- get class member "outputDefines"
-
- @returns outputDefines parameter
- **/
- public String getOutputDefines() {
- return this.outputDefines.getValue();
- }
-
- /**
- set class member "outputDefines"
-
- @param outputDefines filename of string defines file
- **/
- public void setOutputDefines(String outputDefines) {
- this.outputDefines.setArg(" -oh ", outputDefines);
- }
-
- /**
- get class member "outputUnicode"
-
- @returns outputUnicode parameter
- **/
- public String getOutputUnicode() {
- return this.outputUnicode.getValue();
- }
-
- /**
- set class member "outputUnicode"
-
- @param outputUnicode filename of unicode file to be dumped database
- **/
- public void setOutputUnicode(String outputUnicode) {
- this.outputUnicode.setArg(" -ou ", outputUnicode);
- }
-
- /**
- get class member "lang"
-
- @returns lang parameter
- **/
- public String getLang() {
- return this.lang.getValue();
- }
-
- /**
- set class member "lang"
-
- @param lang language of dump
- **/
- public void setLang(String lang) {
- this.lang.setArg(" -lang ", lang);
- }
-
- /**
- get class member "indirectionFile"
-
- @returns indirectionFile parameter
- **/
- public String getIndirectionFile() {
- return this.indirectionFile.getValue();
- }
-
- /**
- set class member "indirectionFile"
-
- @param indirectionFile filename of indirection file
- **/
- public void setIndirectionFile(String indirectionFile) {
- this.indirectionFile.setArg(" -if ", indirectionFile);
- }
-
- /**
- get class member "outputHpk"
-
- @returns outputHpk parameter
- **/
- public String getOutputHpk() {
- return this.outputHpk.getValue();
- }
-
- /**
- set class member "outputHpk"
-
- @param outputHpk filename of output HII export pack of the strings
- **/
- public void setOutputHpk(String outputHpk) {
- this.outputHpk.setArg(" -hpk ", outputHpk);
- }
-
- /**
- add a skipExt element into list
-
- @param skipExt skipExt element
- **/
- public void addConfiguredSkipext(SkipExt skipExt) {
- this.skipExtList.insert(skipExt);
- };
-
- /**
- add a includePath element into list
-
- @param includePath includePath element
- **/
- public void addConfiguredIncludepath(IncludePath includePath) {
- this.includePathList.insert(includePath);
- };
-
- /**
- add a inputFile element into list
-
- @param inputFile inputFile element
- **/
- public void addConfiguredInputfile(InputFile inputFile) {
- this.inputFileList.insert(inputFile);
- };
-
- /**
- add a database element into list
-
- @param database :
- database element
- **/
- public void addConfiguredDatabase(Database database) {
- this.databaseList.insert(database);
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java
deleted file mode 100644
index 9558f703b9..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/StripTask.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/** @file
- StripTask class.
-
- StripTask is used to call Strip.exe to strip input file.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- StripTask class.
-
- StripTask is used to call Strip.exe to strip input file.
- */
-public class StripTask extends Task implements EfiDefine {
- //
- //
- //
- private static String toolName = "Strip";
- //
- // input file
- //
- private FileArg inputFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg();
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
-
- /**
- execute
-
- StripTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
-
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separator + toolName;
- }
-
- //
- // argument of tools
- //
- argument = "" + inputFile + outputFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
-
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, inputFile.toFileList() + " => " + outputFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, toolName + " succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException(toolName + " failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getInputFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getInputFile() {
- return inputFile.getValue();
- }
-
- /**
- setComponentType
-
- This function is to set class member "inputFile".
-
- @param inputFile
- string of input file name.
- **/
- public void setInputFile(String inputFile) {
- this.inputFile.setArg(" ", inputFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java
deleted file mode 100644
index ea320366b1..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/Tool.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/** @file
-This file is to define nested element which is meant for specifying a tool
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Random;
-
-import org.apache.tools.ant.BuildException;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- Class Tool is to define an external tool to be used for genffsfile
- **/
-public class Tool implements EfiDefine, Section {
-
- private int alignment = 0;
- private String toolName = "";
- private ToolArg toolArgList = new ToolArg();
- private Input inputFiles = new Input();
- private Input tempInputFile = new Input();
- private String outputPath;
- private String outputFileName ;
- private static Random ran = new Random(9999);
- private List<Section> gensectList = new ArrayList<Section>();
- /**
- Call extern tool
-
- @param buffer The buffer to put the result with alignment
- **/
- public void toBuffer (DataOutputStream buffer){
- ///
- /// call extern tool
- ///
- try {
- executeTool ();
- } catch (Exception e) {
- throw new BuildException("Call to executeTool failed!\n" + e.getMessage());
- }
-
- ///
- /// check if file exist
- ///
- File outputFile = new File (this.outputFileName);
- if (!outputFile.exists()) {
- throw new BuildException("The file " + outputFile.getPath() + " does not exist!\n");
- }
-
- ///
- /// Read output file and write it's cotains to buffer
- ///
- FileInputStream fs = null;
- DataInputStream in = null;
- try {
- fs = new FileInputStream (outputFile);
- in = new DataInputStream (fs);
-
-
- int fileLen = (int)outputFile.length();
- byte[] data = new byte[fileLen];
- in.read(data);
- buffer.write(data, 0, fileLen);
-
- ///
- /// 4 byte alignment
- ///
- while ((fileLen & 0x03) != 0) {
- fileLen++;
- buffer.writeByte(0);
- }
- } catch (Exception e) {
- EdkLog.log(e.getMessage());
- throw new BuildException("Tool call, toBuffer failed!\n");
- } finally {
- try {
- if (in != null) {
- in.close();
- }
- if (fs != null) {
- fs.close();
- }
- outputFile.delete();
- } catch (Exception e) {
- EdkLog.log("WARNING: Cannot close " + outputFile.getPath());
- }
- }
- }
-
- ///
- /// execute external tool for genffsfile
- ///
- private void executeTool () {
- String command = "";
- String argument = "";
- command = toolName;
-
- //
- // Get each section which under the compress {};
- // And add it is contains to File;
- //
- Section sect;
- try{
- Iterator SectionIter = this.gensectList.iterator();
- while (SectionIter.hasNext()){
- sect = (Section)SectionIter.next();
- //
- // Parse <genSection> element
- //
- File outputFile = File.createTempFile("temp", "sec1", new File(outputPath));
- FileOutputStream bo = new FileOutputStream(outputFile);
- DataOutputStream Do = new DataOutputStream (bo);
- //
- // Call each section class's toBuffer function.
- //
- try {
- sect.toBuffer(Do);
- }
- catch (BuildException e) {
- EdkLog.log(e.getMessage());
- throw new BuildException ("GenSection failed at Tool!");
- } finally {
- if (Do != null){
- Do.close();
- }
-
- }
- this.tempInputFile.insFile(outputFile.getPath());
- }
- } catch (IOException e){
- throw new BuildException ("Gensection failed at tool!");
- }
-
- try {
- this.outputFileName = "Temp" + getRand();
- argument = toolArgList + inputFiles.toStringWithSinglepPrefix(" -i ")
- + tempInputFile.toString(" ")+ " -o " + outputFileName;
- EdkLog.log(this, EdkLog.EDK_VERBOSE, command + " " + argument);
- ///
- /// execute command line
- ///
- Process process = Runtime.getRuntime().exec(command + " " + argument);
- process.waitFor();
- Iterator tempFile = tempInputFile.getNameList().iterator();
- while (tempFile.hasNext()){
- File file = new File((String)tempFile.next());
- if (file.exists()) {
- file.delete();
- }
- }
- } catch (Exception e) {
- EdkLog.log(e.getMessage());
- throw new BuildException("Execution of externalTool task failed!\n");
- }
- }
-
- /**
- Add method of ANT task/datatype for nested ToolArg type of element
-
- @param toolArg The ToolArg object containing arguments for the tool
- **/
- public void addConfiguredToolArg (ToolArg toolArg) {
- toolArgList.insert(toolArg);
- }
-
- /**
- Get method of ANT task/datatype for attribute "OutputPath"
-
- @returns The name of output path
- **/
- public String getOutputPath() {
- return outputPath;
- }
-
- /**
- Set method of ANT task/datatype for attribute "OutputPath"
-
- @param outputPath The name of output path
- **/
- public void setOutputPath(String outPutPath) {
- this.outputPath = outPutPath;
- }
-
- /**
- Get method of ANT task/datatype for attribute "ToolName"
-
- @returns The name of the tool.
- **/
- public String getToolName() {
- return toolName;
- }
-
- /**
- Set method of ANT task/datatype for attribute "ToolName"
-
- @param toolName The name of the tool
- **/
- public void setToolName(String toolName) {
- this.toolName = toolName;
- }
-
- /**
- Add method of ANT task/datatype for nested Input type of element
-
- @param file The Input objec which represents a file
- **/
- public void addConfiguredInput(Input file) {
- inputFiles.insert(file);
- }
-
-// /**
-// addTool
-//
-// This function is to add instance of Tool to list.
-//
-// @param tool instance of Tool.
-// **/
-// public void addTool(Tool tool){
-// this.toolList.add(tool);
-// }
-
- public void addGenSection(GenSectionTask genSect){
- this.gensectList.add(genSect);
- }
-
- /**
- Get random number.
-
- @returns The random integer.
- **/
- public synchronized int getRand() {
- return ran.nextInt();
- }
-
- public int getAlignment() {
- return alignment;
- }
-
- public void setAlignment(int alignment) {
- if (alignment > 7) {
- this.alignment = 7;
- } else {
- this.alignment = alignment;
- }
- }
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ToolArg.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ToolArg.java
deleted file mode 100644
index ade6817955..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ToolArg.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/** @file
-This file is used to nest elements which is meant for tool's argument
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-/**
- ToolArg class is defined to represent the argument of a tool. The argument
- includes the prefix (e.g. -I, -o) and the value.
- **/
-public class ToolArg extends NestElement {
- ///
- /// A constant which is used to represent an empty argument
- ///
- public final static ToolArg EMPTY_ARG = new ToolArg();
-
- //
- // Keep track the prefix of this argument
- //
- private String prefix = "";
-
- /**
- Default constructor
- **/
- public ToolArg() {
- }
-
- /**
- Constructor which will initialize the prefix of this argument
-
- @param prefix The string of prefix
- */
- public ToolArg(String prefix) {
- this.prefix = prefix;
- }
-
- /**
- Constructor which will initialize both the prefix and value of this argument
-
- @param prefix The prefix of this argument
- @param value The value of this argument
- */
- public ToolArg(String prefix, String value) {
- setArg(prefix, value);
- }
-
- /**
- Set the prefix and value of this argument
-
- @param prefix The prefix of this argument
- @param value The value of this argument
- */
- public void setArg(String prefix, String value) {
- this.prefix = prefix;
- super.setName(value);
- }
-
- /**
- Set the prefix of this argument
-
- @param prefix The prefix of this argument
- */
- public void setPrefix(String prefix) {
- this.prefix = prefix;
- }
-
- /**
- Get the prefix of this argument
-
- @return String The prefix of this argument
- */
- public String getPrefix() {
- return this.prefix.trim();
- }
-
- /**
- Set the value of this argument
-
- @param value The value of this argument
- */
- public void setValue(String value) {
- super.setName(value);
- }
-
- /**
- Add a value for this argument
-
- @param value The value of this argument
- */
- public void insValue(String value) {
- super.insName(value);
- }
-
- /**
- Get the value list of this argument, separated by space
-
- @return String The value list
- */
- public String getValue() {
- return super.toString(" ").trim();
- }
-
- /**
- Set the argument as a whole
-
- @param line The argument string line
- */
- public void setLine(String line) {
- //
- // Since the prefix is in the "line", we don't need another prefix.
- //
- this.prefix = " ";
- super.setName(line);
- }
-
- /**
- Get the argument line
-
- @return String The argument string line
- */
- public String getLine() {
- return this.toString();
- }
-
- /**
- Compose a complete argument string.
-
- @return String The complete argument
- */
- public String toString() {
- return super.toString(prefix);
- }
-
- /**
- Check if the argument is empty or not
-
- @return boolean
- **/
- public boolean isEmpty() {
- return (prefix.length() == 0) && (nameList.isEmpty());
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java
deleted file mode 100644
index 178e92ae66..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/VfrCompilerTask.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/** @file
-This file is to define an ANT task which wraps VfrCompile.exe tool
-
-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.
-
-**/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- VfrcompilerTask Task Class
- class member
- -createListFile : create an output IFR listing file.
- -outPutDir : deposit all output files to directory OutputDir (default=cwd)
- -createIfrBinFile: create an IFR HII pack file
- -vfrFile : name of the input VFR script file
- -processArg : c processer argument
- -includepathList : add IncPath to the search path for VFR included files
- **/
-public class VfrCompilerTask extends Task implements EfiDefine {
- private static String toolName = "VfrCompile";
-
- private ToolArg createListFile = new ToolArg();
- private ToolArg createIfrBinFile = new ToolArg();
- private ToolArg processerArg = new ToolArg();
- private FileArg vfrFile = new FileArg();
- private IncludePath includepathList = new IncludePath();
- private FileArg outPutDir = new FileArg(" -od ", ".");
- private String dllPath = "";
-
- /**
- get class member of createList file
-
- @returns file name of createList
- **/
- public boolean getCreateListFile() {
- return this.createListFile.getValue().length() > 0;
- }
-
- /**
- set class member of createList file
-
- @param createListFile if createList string equal "on" set '-l' flag
- **/
- public void setCreateListFile(boolean createListFile) {
- if (createListFile) {
- this.createListFile.setArg(" -", "l");
- }
- }
-
- /**
- get output dir
-
- @returns name of output dir
- **/
- public String getOutPutDir() {
- return this.outPutDir.getValue();
- }
-
- /**
- set class member of outPutDir
-
- @param outPutDir The directory name for ouput file
- **/
- public void setOutPutDir(String outPutDir) {
- this.outPutDir.setArg(" -od ", outPutDir);
- }
-
-
- /**
- get class member of ifrBinFile
-
- @return file name of ifrBinFile
- **/
- public boolean getCreateIfrBinFile() {
- return this.createIfrBinFile.getValue().length() > 0;
- }
-
- /**
- set class member of ifrBinFile
-
- @param createIfrBinFile The flag to specify if the IFR binary file should
- be generated or not
- */
- public void setCreateIfrBinFile(boolean createIfrBinFile) {
- if (createIfrBinFile) {
- this.createIfrBinFile.setArg(" -", "ibin");
- }
- }
-
- /**
- get class member of vfrFile
-
- @returns name of vfrFile
- **/
- public String getVfrFile() {
- return this.vfrFile.getValue();
- }
-
- /**
- set class member of vfrFile
-
- @param vfrFile The name of VFR file
- **/
- public void setVfrFile(String vfrFile) {
- this.vfrFile.setArg(" ", vfrFile);
- }
-
- /**
- add includePath in includepath List
-
- @param includepath The IncludePath object which represents include path
- **/
- public void addConfiguredIncludepath(IncludePath includepath){
- this.includepathList.insert(includepath);
- }
-
- /**
- get class member of processerArg
-
- @returns processer argument
- **/
- public String getProcesserArg() {
- return this.processerArg.getValue();
- }
-
-
- /**
- set class member of processerArg
-
- @param processerArg The processor argument
- */
- public void setProcesserArg(String processerArg) {
- this.processerArg.setArg(" -ppflag ", processerArg);
- }
-
- public void setDllPath(String dllPath) {
- this.dllPath = dllPath;
- }
-
- /**
- The standard execute method of ANT task.
- **/
- public void execute() throws BuildException {
- Project project = this.getProject();
- String toolPath= project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- if (toolPath == null) {
- command = toolName;
- } else {
- command = toolPath + File.separator + toolName;
- }
-
- String argument = "" + createIfrBinFile
- + processerArg
- + includepathList
- + outPutDir
- + createListFile
- + vfrFile;
- try {
- ///
- /// constructs the command-line
- ///
- Commandline commandLine = new Commandline();
- commandLine.setExecutable(command);
- commandLine.createArgument().setLine(argument);
-
- ///
- /// configures the Execute object
- ///
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO,
- Project.MSG_WARN);
-
- Execute runner = new Execute(streamHandler,null);
- runner.setAntRun(project);
- runner.setCommandline(commandLine.getCommandline());
- runner.setWorkingDirectory(new File(outPutDir.getValue()));
- runner.setEnvironment(new String[]{"PATH", dllPath});
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(commandLine.getCommandline()));
- EdkLog.log(this, vfrFile.toFileList());
-
- int returnVal = runner.execute();
- if (EFI_SUCCESS == returnVal) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "VfrCompile succeeded!");
- } else {
- EdkLog.log(this, "ERROR = " + Integer.toHexString(returnVal));
- throw new BuildException("VfrCompile failed!");
- }
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java b/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java
deleted file mode 100644
index f60b8a6bb8..0000000000
--- a/Tools/Java/Source/FrameworkTasks/org/tianocore/framework/tasks/ZeroDebugDataTask.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
- ZeroDebugDataTask class.
-
- ZeroDebugDataTask is used to call ZeroDebugData.exe to remove debug data.
-
-
- 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.
-
- **/
-package org.tianocore.framework.tasks;
-
-import java.io.File;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Execute;
-import org.apache.tools.ant.taskdefs.LogStreamHandler;
-import org.apache.tools.ant.types.Commandline;
-
-import org.tianocore.common.logger.EdkLog;
-
-/**
- ZeroDebugDataTask class.
-
- ZeroDebugDataTask is used to call ZeroDebugData.exe to remove debug data.
-**/
-public class ZeroDebugDataTask extends Task implements EfiDefine {
- //
- // Tool name
- //
- private static String toolName = "ZeroDebugData";
- //
- // input PE file
- //
- private FileArg peFile = new FileArg();
-
- //
- // output file
- //
- private FileArg outputFile = new FileArg(" ", "DebugData.dat");
-
- //
- // output directory, this variable is added by jave wrap
- //
- private String outputDir = ".";
-
-
- /**
- execute
-
- ZeroDebugDataTask execute function is to assemble tool command line & execute
- tool command line
-
- @throws BuidException
- **/
- public void execute() throws BuildException {
-
- Project project = this.getOwningTarget().getProject();
-
- //
- // absolute path of efi tools
- //
- String path = project.getProperty("env.FRAMEWORK_TOOLS_PATH");
- String command;
- String argument;
- if (path == null) {
- command = toolName;
- } else {
- command = path + File.separatorChar + toolName;
- }
-
- //
- // argument of tools
- //
- argument = "" + peFile + outputFile;
-
- //
- // return value of fwimage execution
- //
- int revl = -1;
-
- try {
- Commandline cmdline = new Commandline();
- cmdline.setExecutable(command);
- cmdline.createArgument().setLine(argument);
-
- LogStreamHandler streamHandler = new LogStreamHandler(this,
- Project.MSG_INFO, Project.MSG_WARN);
- Execute runner = new Execute(streamHandler, null);
-
- runner.setAntRun(project);
- runner.setCommandline(cmdline.getCommandline());
- runner.setWorkingDirectory(new File(outputDir));
- //
- // Set debug log information.
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, Commandline.toString(cmdline.getCommandline()));
- EdkLog.log(this, EdkLog.EDK_INFO, peFile.toFileList() + " => " + outputFile.toFileList());
-
- revl = runner.execute();
-
- if (EFI_SUCCESS == revl) {
- //
- // command execution success
- //
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "ZeroDebugData succeeded!");
- } else {
- //
- // command execution fail
- //
- EdkLog.log(this, EdkLog.EDK_INFO, "ERROR = " + Integer.toHexString(revl));
- throw new BuildException("ZeroDebugData failed!");
- }
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- getPeFile
-
- This function is to get class member "inputFile".
-
- @return string of input file name.
- **/
- public String getPeFile() {
- return this.peFile.getValue();
- }
-
- /**
- setPeFile
-
- This function is to set class member "peFile".
-
- @param peFile
- string of input file name.
- **/
- public void setPeFile(String peFile) {
- this.peFile.setArg(" ", peFile);
- }
-
- /**
- getOutputFile
-
- This function is to get class member "outputFile"
-
- @return outputFile string of output file name.
- **/
- public String getOutputFile() {
- return this.outputFile.getValue();
- }
-
- /**
- setOutputFile
-
- This function is to set class member "outputFile"
-
- @param outputFile
- string of output file name.
- **/
- public void setOutputFile(String outputFile) {
- this.outputFile.setArg(" ", outputFile);
- }
-
- /**
- getOutputDir
-
- This function is to get class member "outputDir"
-
- @return outputDir string of output directory.
- **/
- public String getOutputDir() {
- return outputDir;
- }
-
- /**
- setOutputDir
-
- This function is to set class member "outputDir"
-
- @param outputDir
- string of output directory.
- **/
- public void setOutputDir(String outputDir) {
- this.outputDir = outputDir;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/FrameworkWizard.msa b/Tools/Java/Source/FrameworkWizard/FrameworkWizard.msa
deleted file mode 100644
index 85d1b88fe6..0000000000
--- a/Tools/Java/Source/FrameworkWizard/FrameworkWizard.msa
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>Framework Wizard</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>EAC548CB-1B55-4d32-B3E1-F790095BF590</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano Tool Resources Module</Abstract>
- <Description>
- This Module provides the EFI/Tiano Tools that are used to create EFI/Tiano
- Modules and Platform Binary Files (PBF)
- These tools require compilation only once if the Developer Workstation and
- the Developer's choice of HOST tool chain are stable. If the developer
- updates either the OS or the HOST tool chain, these tools should be rebuilt.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>MANIFEST.MF</Filename>
- <Filename>rsc/resources/images/logo.gif</Filename>
- <Filename>rsc/resources/images/No.JPG</Filename>
- <Filename>rsc/resources/images/Yes.JPG</Filename>
- <Filename>src/org/tianocore/frameworkwizard/About.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/Clone.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/FrameworkWizardUI.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/NewFileChooser.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/SelectModuleBelong.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/SplashScreen.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/ToolChainConfig.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/DataType.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/DataValidation.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/EnumerationData.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/FileOperation.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/GlobalData.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/IDefaultTableModel.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/IFileFilter.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Log.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/OpenFile.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/SaveFile.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Sort.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Tools.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/XmlConfig.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/Find.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/FindResult.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/FindResultId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/GuidId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/PcdFindResultId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/PcdId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/PpiId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/find/ProtocolId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/Identification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IComboBox.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IDialog.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IFrame.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/ITree.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/StarLabel.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/AggregationOperation.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/DistributeRule.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/Far.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarFileItem.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarHeader.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarInterface.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarMd5.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarPackage.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarPlatformItem.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/FarStringDefinition.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/Manifest.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/ManifestInterface.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/PackageQuery.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/PackageQueryInterface.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/PackageIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/GenGuidDialog.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/GuidEditor.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageDefinitions.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/DynamicTree.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdFvOptions.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/GenListDialog.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/GenLongTextDialog.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/LongTextEditor.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/TableSorter.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/global/LibraryClassDescriptor.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/toolchain/Preferences.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/workspace/Workspace.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java</Filename>
- <Filename>src/org/tianocore/frameworkwizard/workspace/ui/SwitchWorkspace.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/FrameworkWizard/MANIFEST.MF b/Tools/Java/Source/FrameworkWizard/MANIFEST.MF
deleted file mode 100644
index cfce7f7552..0000000000
--- a/Tools/Java/Source/FrameworkWizard/MANIFEST.MF
+++ /dev/null
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: org.tianocore.frameworkwizard.FrameworkWizardUI
diff --git a/Tools/Java/Source/FrameworkWizard/build.xml b/Tools/Java/Source/FrameworkWizard/build.xml
deleted file mode 100644
index 5c71edbd19..0000000000
--- a/Tools/Java/Source/FrameworkWizard/build.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?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="FrameworkWizard" default="FrameworkWizard" basedir=".">
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <property name="WORKSPACE" value="${env.WORKSPACE}"/>
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars" includes="*.jar"/>
- <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
- </path>
- <property name="buildDir" value="build"/>
- <property name="resourceDir" value="rsc"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/bin"/>
- <target name="FrameworkWizard" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="src" destdir="${buildDir}">
- <classpath refid="classpath"/>
- <!-- <compilerarg value="-Xlint"/> -->
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/FrameworkWizard" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: FrameworkWizard.jar"/>
- <delete file="${installLocation}/FrameworkWizard.jar"/>
- </target>
- <target name="install" depends="source">
- <jar destfile="${installLocation}/FrameworkWizard.jar" manifest="MANIFEST.MF">
- <fileset dir="${buildDir}"/>
- <fileset dir="${resourceDir}"/>
- </jar>
- </target>
-</project>
diff --git a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/No.JPG b/Tools/Java/Source/FrameworkWizard/rsc/resources/images/No.JPG
deleted file mode 100644
index c3f312b279..0000000000
--- a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/No.JPG
+++ /dev/null
Binary files differ
diff --git a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/Yes.JPG b/Tools/Java/Source/FrameworkWizard/rsc/resources/images/Yes.JPG
deleted file mode 100644
index 67d6539e74..0000000000
--- a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/Yes.JPG
+++ /dev/null
Binary files differ
diff --git a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/logo.gif b/Tools/Java/Source/FrameworkWizard/rsc/resources/images/logo.gif
deleted file mode 100644
index a9e0c8d921..0000000000
--- a/Tools/Java/Source/FrameworkWizard/rsc/resources/images/logo.gif
+++ /dev/null
Binary files differ
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
deleted file mode 100644
index 95c06b8200..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/About.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/** @file
-
- To show a about window with copyright information
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowEvent;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import javax.swing.ImageIcon;
-
-/**
- The class is used to show a about window with copyright information
- It extends IDialog
-
- **/
-public class About extends IDialog {
-
- ///
- /// Define Class Serial Version UID
- ///
- private static final long serialVersionUID = 2958136136667310962L;
-
- ///
- /// Define Class Members
- ///
- private JPanel jContentPane = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel1 = null;
-
- private JLabel jLabel2 = null;
-
- private JButton jButtonOK = null;
-
- private JLabel jLabelImage = null;
-
- /**
- This method initializes jButtonOK
-
- @return javax.swing.JButton jButtonOK
-
- **/
- private JButton getJButtonOK() {
- if (jButtonOK == null) {
- jButtonOK = new JButton();
- jButtonOK.setBounds(new java.awt.Rectangle(115, 200, 90, 20));
- jButtonOK.setText("OK");
- jButtonOK.addActionListener(this);
- }
- return jButtonOK;
- }
-
- /**
- This is the default constructor
-
- **/
- public About() {
- super();
- init();
- }
-
- /**
- This is the default constructor
-
- **/
- public About(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- init();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(320, 265);
- this.setContentPane(getJContentPane());
- this.setTitle("About");
- this.getRootPane().setDefaultButton(jButtonOK);
- this.centerWindow();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelImage = new JLabel();
- jLabelImage.setBounds(new java.awt.Rectangle(63, 20, 193, 58));
- jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/logo.gif")));
-
- jLabel2 = new JLabel();
- jLabel2.setBounds(new java.awt.Rectangle(25, 160, 270, 20));
- jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel2.setText("All rights reserved");
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(25, 130, 270, 20));
- jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel1.setText("Copyright (c) 2006, Intel Corporation");
- jLabel = new JLabel();
- jLabel.setToolTipText("");
- jLabel.setBounds(new java.awt.Rectangle(25, 90, 270, 20));
- jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel.setText(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION);
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(320, 235));
- jContentPane.add(jLabel, null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(jLabel2, null);
- jContentPane.add(getJButtonOK(), null);
- jContentPane.add(jLabelImage, null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOK) {
- returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- /**
- Dispose when windows is closing
-
- @param arg0
-
- **/
- public void windowClosing(WindowEvent arg0) {
- this.dispose();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
deleted file mode 100644
index f4aebe0483..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/Clone.java
+++ /dev/null
@@ -1,1291 +0,0 @@
-/** @file
-
- The file is used to clone workspace, module, package and platform
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.Vector;
-
-import javax.swing.JFileChooser;
-import javax.swing.JPanel;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import javax.swing.JButton;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.ModuleDefinitionsDocument.ModuleDefinitions;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageDefinitionsDocument.PackageDefinitions;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformDefinitionsDocument.PlatformDefinitions;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.FileOperation;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.common.SaveFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-import javax.swing.JComboBox;
-
-/**
- The class is used to provide functions to clone workspace, module, package and platform
- It extends IDialog
-
- **/
-public class Clone extends IDialog {
-
- ///
- /// Define Class Serial Version UID
- ///
- private static final long serialVersionUID = -5469299324965727137L;
-
- ///
- /// Define Class Members
- ///
- private JPanel jContentPane = null;
-
- private JLabel jLabelType = null;
-
- private JTextField jTextFieldType = null;
-
- private JLabel jLabelSource = null;
-
- private JTextField jTextFieldSource = null;
-
- private JButton jButtonBrowse = null;
-
- private JLabel jLabelDestinationFile = null;
-
- private JTextField jTextFieldFilePath = null;
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelBelong = null;
-
- private JComboBox jComboBoxExistingPackage = null;
-
- ///
- /// Define members not for UI
- ///
-
- private int mode = -1;
-
- private Vector<PackageIdentification> packages = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Identification oldId = null;
-
- private Identification newId = null;
-
- private ModuleIdentification mid = null;
-
- private PackageIdentification pid = null;
-
- private PlatformIdentification fid = null;
-
- /**
- This method initializes jTextFieldType
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldType() {
- if (jTextFieldType == null) {
- jTextFieldType = new JTextField();
- jTextFieldType.setBounds(new java.awt.Rectangle(210, 10, 320, 20));
- jTextFieldType.setEditable(false);
- }
- return jTextFieldType;
- }
-
- /**
- This method initializes jTextFieldSource
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldSource() {
- if (jTextFieldSource == null) {
- jTextFieldSource = new JTextField();
- jTextFieldSource.setBounds(new java.awt.Rectangle(210, 35, 320, 20));
- jTextFieldSource.setEditable(false);
- }
- return jTextFieldSource;
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(445, 85, 85, 20));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.addActionListener(this);
- }
- return jButtonBrowse;
- }
-
- /**
- This method initializes jTextFieldDestinationFile
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldFilePath() {
- if (jTextFieldFilePath == null) {
- jTextFieldFilePath = new JTextField();
- jTextFieldFilePath.setBounds(new java.awt.Rectangle(210, 85, 230, 20));
- }
- return jTextFieldFilePath;
- }
-
- /**
- This method initializes jTextFieldBaseName
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(210, 110, 320, 20));
- }
- return jTextFieldBaseName;
- }
-
- /**
- This method initializes jTextFieldGuid
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(210, 135, 230, 20));
- }
- return jTextFieldGuid;
- }
-
- /**
- This method initializes jTextFieldVersion
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(210, 160, 320, 20));
- }
- return jTextFieldVersion;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(285, 200, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(405, 200, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jButtonGenerateGuid
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(445, 135, 85, 20));
- jButtonGenerateGuid.setText("Gen");
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- This method initializes jComboBoxExistingPackage
-
- @return javax.swing.JComboBox
-
- **/
- private JComboBox getJComboBoxExistingPackage() {
- if (jComboBoxExistingPackage == null) {
- jComboBoxExistingPackage = new JComboBox();
- jComboBoxExistingPackage.setBounds(new java.awt.Rectangle(210, 60, 320, 20));
- }
- return jComboBoxExistingPackage;
- }
-
- /**
- This is the default constructor
-
- **/
- public Clone() {
- super();
- init();
- }
-
- /**
- This is the override constructor
-
- @param parentFrame The parent frame which starts this frame
- @param modal To identify the frame's modal
- @param fileType To identify the clone target type
- @param identification The clone target's identification
-
- **/
- public Clone(IFrame parentFrame, boolean modal, int fileType, Identification identification) {
- super(parentFrame, modal);
- this.mode = fileType;
- if (identification != null) {
- this.oldId = new Identification(identification.getName(), identification.getGuid(),
- identification.getVersion(), identification.getPath());
- this.newId = new Identification(identification.getName(), identification.getGuid(),
- identification.getVersion(), identification.getPath());
- }
- init(mode);
- }
-
- /**
- Query all existing packages and fill them into combox
-
- **/
- private void initExistingPackage() {
- packages = wt.getAllPackages();
- for (int index = 0; index < packages.size(); index++) {
- this.jComboBoxExistingPackage.addItem(packages.elementAt(index).getName());
- }
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(550, 260);
- this.setContentPane(getJContentPane());
- this.setTitle("Clone");
- this.centerWindow();
- }
-
- /**
- This method initializes this with given clone target type.
- Customize the frame interface via different clone target type.
-
- @param mode To identify the clone target type
-
- **/
- private void init(int mode) {
- init();
- //
- // For MODULE_SURFACE_AREA
- //
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- this.jTextFieldType.setText(DataType.MODULE_SURFACE_AREA);
- String s = oldId.getPath();
- s = Tools.getRelativePath(s, Tools.getFilePathOnly(wt.getPackageIdByModuleId(oldId).getPath()));
- this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));
- initExistingPackage();
- this.jButtonBrowse.setVisible(false);
- this.jTextFieldFilePath
- .setToolTipText("<html>Input the module's relative path and filename, for example:<br>Application\\HelloWorld\\HelloWorld.msa</html>");
- this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
- this.jLabelDestinationFile.setText("New Module Path and Filename");
- }
- //
- // For PACKAGE_SURFACE_AREA
- //
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- this.jTextFieldType.setText(DataType.PACKAGE_SURFACE_AREA);
- String s = oldId.getPath();
- s = Tools.getRelativePath(oldId.getPath(), Workspace.getCurrentWorkspace());
- this.jTextFieldSource.setText(Tools.convertPathToCurrentOsType(s));
- this.jLabelBelong.setEnabled(false);
- this.jComboBoxExistingPackage.setEnabled(false);
- this.jButtonBrowse.setVisible(false);
- this.jTextFieldFilePath
- .setToolTipText("<html>Input the package's relative path and file name, for example:<br>MdePkg\\MdePkg.spd</html>");
- this.jTextFieldFilePath.setSize(320, this.jTextFieldFilePath.getSize().height);
- this.jLabelDestinationFile.setText("New Package Path and Filename");
-
- //
- // Check if the package can be cloned
- //
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.openingPackageList
- .getIdByPath(this.oldId
- .getPath()));
- if (spd != null) {
- if (spd.getPackageDefinitions() != null) {
- if (!spd.getPackageDefinitions().getRePackage()) {
- Log.wrn("Clone Package", "This package can't repackaged and cloned");
- this.jTextFieldBaseName.setEnabled(false);
- this.jTextFieldFilePath.setEnabled(false);
- this.jTextFieldGuid.setEnabled(false);
- this.jTextFieldVersion.setEnabled(false);
- this.jButtonGenerateGuid.setEnabled(false);
- this.jButtonOk.setEnabled(false);
- }
- }
- }
- }
- //
- // For PLATFORM_SURFACE_AREA
- //
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- this.jTextFieldType.setText(DataType.PLATFORM_SURFACE_AREA);
- this.jTextFieldSource.setText(oldId.getPath());
- this.jLabelBelong.setEnabled(false);
- this.jComboBoxExistingPackage.setEnabled(false);
- this.jTextFieldFilePath
- .setToolTipText("<html>Select the platform's relative path and filename. For example:<br>C:\\MyWorkspace\\EdkNt32Pkg\\Nt32.fpd</html>");
- this.jLabelDestinationFile.setText("New Platform Path and Filename");
- }
- //
- // For WORKSPACE
- //
- if (mode == DataType.RETURN_TYPE_WORKSPACE) {
- this.jTextFieldType.setText(DataType.WORKSPACE);
- this.jTextFieldSource.setText(Workspace.getCurrentWorkspace());
- this.jLabelBelong.setEnabled(false);
- this.jComboBoxExistingPackage.setEnabled(false);
- this.jLabelBaseName.setEnabled(false);
- this.jTextFieldBaseName.setEditable(false);
- this.jLabelGuid.setEnabled(false);
- this.jTextFieldGuid.setEnabled(false);
- this.jButtonGenerateGuid.setEnabled(false);
- this.jLabelVersion.setEnabled(false);
- this.jTextFieldVersion.setEnabled(false);
- this.jTextFieldFilePath
- .setToolTipText("<html>Input the workspace path, for example:<br>C:\\MyWorkspace</html>");
- this.jLabelDestinationFile.setText("New Workspace Path");
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelBelong = new JLabel();
- jLabelBelong.setBounds(new java.awt.Rectangle(15, 60, 190, 20));
- jLabelBelong.setText("Clone Package");
- jLabelVersion = new JLabel();
- jLabelVersion.setBounds(new java.awt.Rectangle(15, 160, 190, 20));
- jLabelVersion.setText("Version");
- jLabelGuid = new JLabel();
- jLabelGuid.setBounds(new java.awt.Rectangle(15, 135, 190, 20));
- jLabelGuid.setText("Guid");
- jLabelBaseName = new JLabel();
- jLabelBaseName.setBounds(new java.awt.Rectangle(15, 110, 190, 20));
- jLabelBaseName.setText("Base Name");
- jLabelDestinationFile = new JLabel();
- jLabelDestinationFile.setBounds(new java.awt.Rectangle(15, 85, 190, 20));
- jLabelDestinationFile.setText("Destination File Name");
- jLabelSource = new JLabel();
- jLabelSource.setBounds(new java.awt.Rectangle(15, 35, 190, 20));
- jLabelSource.setText("Source");
- jLabelType = new JLabel();
- jLabelType.setBounds(new java.awt.Rectangle(15, 10, 190, 20));
- jLabelType.setText("Type");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(540, 227));
- jContentPane.add(jLabelType, null);
- jContentPane.add(getJTextFieldType(), null);
- jContentPane.add(jLabelSource, null);
- jContentPane.add(getJTextFieldSource(), null);
- jContentPane.add(jLabelDestinationFile, null);
- jContentPane.add(getJTextFieldFilePath(), null);
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonBrowse(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelBelong, null);
- jContentPane.add(getJComboBoxExistingPackage(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonCancel) {
- this.setVisible(false);
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (this.check()) {
- try {
- //
- // Save to file
- //
- this.save();
- } catch (IOException e) {
- Log.wrn("Clone", e.getMessage());
- Log.err("Clone", e.getMessage());
- return;
- } catch (XmlException e) {
- Log.wrn("Clone", e.getMessage());
- Log.err("Clone", e.getMessage());
- return;
- } catch (Exception e) {
- Log.wrn("Clone", e.getMessage());
- Log.err("Clone", e.getMessage());
- return;
- }
- } else {
- return;
- }
- this.setVisible(false);
- }
-
- if (arg0.getSource() == this.jButtonGenerateGuid) {
- this.jTextFieldGuid.setText(Tools.generateUuidString());
- }
-
- //
- // Use different file ext for different clone target type
- //
- if (arg0.getSource() == this.jButtonBrowse) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
-
- if (mode == DataType.RETURN_TYPE_WORKSPACE) {
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- }
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())
- .getPath()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.MODULE_SURFACE_AREA_EXT));
- }
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.PACKAGE_SURFACE_AREA_EXT));
- }
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.PLATFORM_SURFACE_AREA_EXT));
- }
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldFilePath.setText(Tools.addPathExt(fc.getSelectedFile().getPath(), mode));
- }
- }
- }
-
- /**
- Check name, guid and version.
- If all of them are valid, save information to new id
-
- @retval true All name, guid and version are valid
- @retval false Any one of name, guid and version is invalid
-
- **/
- private boolean checkId(int mode) {
- String name = this.jTextFieldBaseName.getText();
- String guid = this.jTextFieldGuid.getText();
- String version = this.jTextFieldVersion.getText();
-
- //
- // Check Basename
- //
- if (isEmpty(name)) {
- Log.wrn("Clone", "The Name is required!");
- return false;
- }
- if (!DataValidation.isBaseName(name)) {
- Log
- .wrn("Clone",
- "<html>Incorrect data type for the Name, it must<br>be a single word, starting with an alpha character.</html>");
- return false;
- }
-
- //
- // Check Guid
- //
- if (isEmpty(guid)) {
- Log.wrn("Clone", "A Guid is required!!");
- return false;
- }
- if (!DataValidation.isGuid(guid)) {
- Log
- .wrn(
- "Clone",
- "<html>Incorrect data type for Guid, which must<br>be in registry format (8-4-4-4-12) for example:<br>d3adb123-eef1-466d-39ac-02febcaf5997</html>");
- return false;
- }
-
- //
- // Check Version
- //
- if (isEmpty(version)) {
- Log.wrn("Clone", "A Version must be entered!");
- return false;
- }
- if (!DataValidation.isVersion(version)) {
- Log
- .wrn(
- "Clone",
- "<html>Incorrect data type for Version, which must<br>be one or more digits, optionally followed by sequence<br>of one or more dot, one or more digits; examples:<br>1.0 1.0.1 12.25.256</html>");
- return false;
- }
-
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- String packageGuid = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getGuid();
- String packageVersion = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getVersion();
- if (GlobalData.findModuleId(guid, version, packageGuid, packageVersion) != null) {
- Log.wrn("Clone", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- if (GlobalData.findPackageId(guid, version) != null) {
- Log.wrn("Clone", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- if (GlobalData.findPlatformId(guid, version) != null) {
- Log.wrn("Clone", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- //
- // Save information to id
- //
- newId.setName(this.jTextFieldBaseName.getText());
- newId.setGuid(this.jTextFieldGuid.getText());
- newId.setVersion(this.jTextFieldVersion.getText());
- newId.setPath(this.jTextFieldFilePath.getText());
-
- return true;
- }
-
- /**
- Check before save
-
- @retval true All check points are passed
- @retval false Any one of check points is failed
-
- **/
- private boolean check() {
- String src = this.oldId.getPath();
- String trg = this.jTextFieldFilePath.getText();
- File srcFile = new File(src);
- File trgFile = new File(trg);
-
- //
- // Common Check
- //
- if (!srcFile.exists()) {
- Log.wrn("Clone", "The source file does not exist!");
- return false;
- }
- if (isEmpty(trg)) {
- Log.wrn("Clone", "The destination file path must be entered!");
- return false;
- }
- if (src.equals(trg)) {
- Log.wrn("Clone", "The source and destination can not be same!");
- return false;
- }
- if (trgFile.exists()) {
- Log.wrn("Clone", "The destination already exists!");
- return false;
- }
-
- //
- // Check for workspace
- //
- if (mode == DataType.RETURN_TYPE_WORKSPACE) {
- if (trg.indexOf(src + DataType.FILE_SEPARATOR) == 0) {
- Log.wrn("Clone", "The new workspace can not be located within the current workspace!");
- return false;
- }
- }
-
- //
- // Check for Module
- //
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- trg = this.getModulePath();
- if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {
- Log.wrn("Clone", "The source and destination paths for cloning a module must be different!");
- return false;
- }
- trgFile = new File(trg);
- if (trgFile.exists()) {
- Log.wrn("Clone", "The target module already exists!");
- return false;
- }
-
- //
- // Check if path already exists
- // Currently we allow user to add multiple msa files in one same directory
- // Remove this checkpoint
- //
-// if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {
-// Log.wrn("Clone", "There already exists a same directory with a module");
-// return false;
-// }
-
- return checkId(mode);
- }
-
- //
- // Check for Package
- //
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- if (trg.indexOf(DataType.DOS_FILE_SEPARATOR) == -1 && trg.indexOf(DataType.UNIX_FILE_SEPARATOR) == -1) {
- Log.wrn("Clone", "The package name must include a path!");
- return false;
- }
- trg = this.getPackagePath();
- if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {
- Log.wrn("Clone", "The source and destination paths for cloning a package must be different!");
- return false;
- }
- trgFile = new File(trg);
- if (trgFile.exists()) {
- Log.wrn("Clone", "The target package already exists!");
- return false;
- }
- if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {
- Log.wrn("Clone", "There already exists a same directory with a package");
- return false;
- }
-
- return checkId(mode);
- }
-
- //
- // Check for Platform
- //
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- if (trg.indexOf(Workspace.getCurrentWorkspace()) != 0) {
- Log.wrn("Clone", "The platform clone must be located in the current workspace!");
- return false;
- }
- if (Tools.getFilePathOnly(src).equals(Tools.getFilePathOnly(trg))) {
- Log.wrn("Clone", "The source and destination paths for cloning a platform must be different!");
- return false;
- }
- trgFile = new File(trg);
- if (trgFile.exists()) {
- Log.wrn("Clone", "The target platform already exists.");
- return false;
- }
- if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(trg), mode)) {
- Log.wrn("Clone", "There already exists a same directory with a platform");
- return false;
- }
-
- return checkId(mode);
- }
-
- return true;
- }
-
- /**
- Save clone target to new location
-
- @throws IOException
- @throws XmlException
- @throws Exception
-
- **/
- private void save() throws IOException, XmlException, Exception {
- String src = this.oldId.getPath();
- String trg = this.jTextFieldFilePath.getText();
- Vector<String> vFiles = new Vector<String>();
-
- //
- // Clone Workspace
- //
- if (mode == DataType.RETURN_TYPE_WORKSPACE) {
- FileOperation.copyFolder(src, trg);
- this.returnType = DataType.RETURN_TYPE_WORKSPACE;
- }
-
- //
- // Clone Module Surface Area
- //
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- //
- // Get target path from source path
- //
- trg = getModulePath();
- newId.setPath(trg);
- vFiles = wt.getAllFilesPathOfModule(src);
-
- String oldPackagePath = GlobalData.openingModuleList.getIdByPath(src).getPackageId().getPath();
- String newPackagePath = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath();
-
- //
- // First copy all files to new directory
- //
- FileOperation.copyFile(src, trg);
- for (int index = 1; index < vFiles.size(); index++) {
- String oldFile = vFiles.get(index);
- String newFile = "";
- if (oldFile.indexOf(Tools.getFilePathOnly(src)) > -1) {
- //
- // The file is not include header
- //
- newFile = oldFile.replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));
- } else if (oldFile.indexOf(Tools.getFilePathOnly(oldPackagePath)) > -1) {
- //
- // The file is include header
- //
- newFile = oldFile.replace(Tools.getFilePathOnly(oldPackagePath),
- Tools.getFilePathOnly(newPackagePath));
- }
-
- FileOperation.copyFile(oldFile, newFile);
- }
-
- //
- // Create new msa file
- //
- ModuleSurfaceArea msa = null;
- msa = OpenFile.openMsaFile(src);
-
- //
- // Update to memory
- //
- msa.getMsaHeader().setModuleName(newId.getName());
- msa.getMsaHeader().setGuidValue(newId.getGuid());
- msa.getMsaHeader().setVersion(newId.getVersion());
-
- //
- // Update <Cloned> Section
- //
- updateModuleClonedId(msa, oldId);
-
- //
- // Save to file
- //
- SaveFile.saveMsaFile(trg, msa);
-
- //
- // Update to platformId
- //
- this.setMid(new ModuleIdentification(newId,
- packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())));
-
- //
- // Open belonging package
- //
- PackageSurfaceArea psa = PackageSurfaceArea.Factory.newInstance();
- psa = OpenFile.openSpdFile(mid.getPackageId().getPath());
-
- //
- // Update the db file
- //
- wt.addModuleToPackage(mid, psa);
-
- //
- // Update GlobalData
- //
- GlobalData.vModuleList.addElement(mid);
- GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);
-
- this.returnType = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
- }
-
- //
- // Clone Package Surface Area
- //
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- //
- // Get target path from source path
- //
- trg = this.getPackagePath();
- newId.setPath(trg);
- vFiles = wt.getAllFilesPathOfPakcage(src);
-
- //
- // First copy all files to new directory
- //
- FileOperation.copyFile(src, trg);
- for (int index = 1; index < vFiles.size(); index++) {
- String oldFile = vFiles.get(index);
- String newFile = vFiles.get(index).replace(Tools.getFilePathOnly(src), Tools.getFilePathOnly(trg));
- FileOperation.copyFile(oldFile, newFile);
- }
-
- //
- // Create new spd file
- //
- PackageSurfaceArea spd = null;
- spd = OpenFile.openSpdFile(src);
-
- //
- // Update to memory
- //
- spd.getSpdHeader().setPackageName(newId.getName());
- spd.getSpdHeader().setGuidValue(newId.getGuid());
- spd.getSpdHeader().setVersion(newId.getVersion());
-
- //
- // Update <Cloned> Section
- //
- updatePackageClonedId(spd, oldId);
-
- //
- // Save to file
- //
- SaveFile.saveSpdFile(trg, spd);
-
- //
- // Update to platformId
- //
- this.setPid(new PackageIdentification(newId));
-
- //
- // Update the db file
- //
- wt.addPackageToDatabase(pid);
-
- //
- // Update GlobalData
- //
- GlobalData.vPackageList.addElement(pid);
- GlobalData.openingPackageList.insertToOpeningPackageList(pid, spd);
-
- //
- // Add all cloned modules
- //
- Vector<String> modulePaths = GlobalData.getAllModulesOfPackage(pid.getPath());
- String modulePath = null;
- ModuleSurfaceArea msa = null;
-
- for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
- try {
- modulePath = modulePaths.get(indexJ);
- msa = OpenFile.openMsaFile(modulePath);
- } catch (IOException e) {
- Log.err("Open Module Surface Area " + modulePath, e.getMessage());
- continue;
- } catch (XmlException e) {
- Log.err("Open Module Surface Area " + modulePath, e.getMessage());
- continue;
- } catch (Exception e) {
- Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
- continue;
- }
- Identification id = Tools.getId(modulePath, msa);
- mid = new ModuleIdentification(id, pid);
- GlobalData.vModuleList.addElement(mid);
- GlobalData.openingModuleList.insertToOpeningModuleList(mid, msa);
- }
-
- this.returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
- }
-
- //
- // Clone Platform Surface Area
- //
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- PlatformSurfaceArea fpd = null;
- fpd = OpenFile.openFpdFile(src);
-
- //
- // Update to memory
- //
- fpd.getPlatformHeader().setPlatformName(newId.getName());
- fpd.getPlatformHeader().setGuidValue(newId.getGuid());
- fpd.getPlatformHeader().setVersion(newId.getVersion());
-
- //
- // Update Cloned From element
- //
- updatePlatformClonedId(fpd, oldId);
-
- //
- // Save to file
- //
- SaveFile.saveFpdFile(trg, fpd);
-
- //
- // Update to platformId
- //
- this.setFid(new PlatformIdentification(newId));
-
- //
- // Update the db file
- //
- wt.addPlatformToDatabase(fid);
-
- //
- // Update GlobalData
- //
- GlobalData.vPlatformList.addElement(fid);
- GlobalData.openingPlatformList.insertToOpeningPlatformList(fid, fpd);
-
- this.returnType = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
- }
- vFiles = null;
- }
-
- /**
- Get the path of selected package
-
- @return String The path of selected package
-
- **/
- private String getSelectPackagePath() {
- return Tools.getFilePathOnly(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath());
- }
-
- /**
- Get the path of source module
- Since the path of source module is relative, make it up to full path.
-
- @return String The full path of source module
-
- **/
- private String getModulePath() {
- String trg = this.jTextFieldFilePath.getText();
- trg = Tools.addPathExt(trg, mode);
- trg = Tools.addFileSeparator(getSelectPackagePath()) + trg;
- Tools.convertPathToCurrentOsType(trg);
- return trg;
- }
-
- /**
- Get the path of source package
- Since the path of source package is relative, make it up to full path.
-
- @return String The full path of source package
-
- **/
- private String getPackagePath() {
- String trg = this.jTextFieldFilePath.getText();
- trg = Tools.addPathExt(trg, mode);
- trg = Tools.addFileSeparator(Workspace.getCurrentWorkspace()) + trg;
- trg = Tools.convertPathToCurrentOsType(trg);
- return trg;
- }
-
- /**
- Set msa file's <Cloned> section via given identification
-
- @param msa ModuleSurfaceArea for clone target
- @param id Identification of clone source
-
- **/
- private void updateModuleClonedId(ModuleSurfaceArea msa, Identification id) {
- //
- // Get PlatformDefinitions First
- //
- ModuleDefinitions pd = null;
- if (msa.getModuleDefinitions() == null) {
- pd = ModuleDefinitions.Factory.newInstance();
- msa.addNewModuleDefinitions();
- } else {
- pd = msa.getModuleDefinitions();
- }
-
- //
- // Get ClonedFrom then
- //
- ModuleDefinitions.ClonedFrom cf = null;
- BigInteger count = new BigInteger("-1");
- if (pd.getClonedFrom() == null) {
- cf = ModuleDefinitions.ClonedFrom.Factory.newInstance();
- } else {
- cf = pd.getClonedFrom();
- if (cf != null) {
- for (int index = 0; index < cf.getClonedList().size(); index++) {
- if (cf.getClonedList().get(index).getId() != null) {
- count = count.max(cf.getClonedList().get(index).getId());
- }
- }
- }
- }
-
- //
- // Set new Cloned item
- //
- ModuleDefinitions.ClonedFrom.Cloned c = ModuleDefinitions.ClonedFrom.Cloned.Factory.newInstance();
- c.setModuleGuid(id.getGuid());
- c.setModuleVersion(id.getVersion());
- c.setPackageGuid(wt.getPackageIdByModuleId(oldId).getGuid());
- c.setPackageVersion(wt.getPackageIdByModuleId(oldId).getVersion());
- c.setId(count.add(new BigInteger("1")));
- String guid = wt.getModuleFarGuid(oldId);
- if (guid != null && !guid.equals("")) {
- c.setFarGuid(guid);
- }
-
- cf.addNewCloned();
- cf.setClonedArray(cf.getClonedList().size() - 1, c);
- pd.addNewClonedFrom();
- pd.setClonedFrom(cf);
- msa.setModuleDefinitions(pd);
- }
-
- /**
- Set spd file's <Cloned> section via given identification
-
- @param spd PackageSurfaceArea for clone target
- @param id Identification of clone source
-
- **/
- private void updatePackageClonedId(PackageSurfaceArea spd, Identification id) {
- //
- // Get PlatformDefinitions First
- //
- PackageDefinitions pd = null;
- if (spd.getPackageDefinitions() == null) {
- pd = PackageDefinitions.Factory.newInstance();
- spd.addNewPackageDefinitions();
- } else {
- pd = spd.getPackageDefinitions();
- }
-
- //
- // Get ClonedFrom then
- //
- PackageDefinitions.ClonedFrom cf = null;
- BigInteger count = new BigInteger("-1");
- if (pd.getClonedFrom() == null) {
- cf = PackageDefinitions.ClonedFrom.Factory.newInstance();
- } else {
- cf = pd.getClonedFrom();
- if (cf != null) {
- for (int index = 0; index < cf.getClonedList().size(); index++) {
- if (cf.getClonedList().get(index).getId() != null) {
- count = count.max(cf.getClonedList().get(index).getId());
- }
- }
- }
- }
-
- //
- // Set new Cloned item
- //
- PackageDefinitions.ClonedFrom.Cloned c = PackageDefinitions.ClonedFrom.Cloned.Factory.newInstance();
- c.setPackageGuid(id.getGuid());
- c.setPackageVersion(id.getVersion());
- c.setId(count.add(new BigInteger("1")));
- String guid = wt.getPackageFarGuid(oldId);
- if (guid != null && !guid.equals("")) {
- c.setFarGuid(guid);
- }
-
- cf.addNewCloned();
- cf.setClonedArray(cf.getClonedList().size() - 1, c);
- pd.addNewClonedFrom();
- pd.setClonedFrom(cf);
- spd.setPackageDefinitions(pd);
- }
-
- /**
- Set fpd file's <Cloned> section via given identification
-
- @param fpd PlatformSurfaceArea for clone target
- @param id Identification of clone source
-
- **/
- private void updatePlatformClonedId(PlatformSurfaceArea fpd, Identification id) {
- //
- // Get PlatformDefinitions First
- //
- PlatformDefinitions pd = null;
- if (fpd.getPlatformDefinitions() == null) {
- pd = PlatformDefinitions.Factory.newInstance();
- fpd.addNewPlatformDefinitions();
- } else {
- pd = fpd.getPlatformDefinitions();
- }
-
- //
- // Get ClonedFrom then
- //
- PlatformDefinitions.ClonedFrom cf = null;
- BigInteger count = new BigInteger("-1");
- if (pd.getClonedFrom() == null) {
- cf = PlatformDefinitions.ClonedFrom.Factory.newInstance();
- } else {
- cf = pd.getClonedFrom();
- if (cf != null) {
- for (int index = 0; index < cf.getClonedList().size(); index++) {
- if (cf.getClonedList().get(index).getId() != null) {
- count = count.max(cf.getClonedList().get(index).getId());
- }
- }
- }
- }
-
- //
- // Set new Cloned item
- //
- PlatformDefinitions.ClonedFrom.Cloned c = PlatformDefinitions.ClonedFrom.Cloned.Factory.newInstance();
- c.setPlatformGuid(id.getGuid());
- c.setPlatformVersion(id.getVersion());
- c.setId(count.add(new BigInteger("1")));
- String guid = wt.getPlatformFarGuid(oldId);
- if (guid != null && !guid.equals("")) {
- c.setFarGuid(guid);
- }
-
- cf.addNewCloned();
- cf.setClonedArray(cf.getClonedList().size() - 1, c);
- pd.addNewClonedFrom();
- pd.setClonedFrom(cf);
- fpd.setPlatformDefinitions(pd);
- }
-
- /**
- Get PlatformIdentification
-
- @return PlatformIdentification
-
- **/
- public PlatformIdentification getFid() {
- return fid;
- }
-
- /**
- Set PlatformIdentification
-
- @param fid PlatformIdentification
-
- **/
- public void setFid(PlatformIdentification fid) {
- this.fid = fid;
- }
-
- /**
- Get ModuleIdentification
-
- @return ModuleIdentification
-
- **/
- public ModuleIdentification getMid() {
- return mid;
- }
-
- /**
- Set ModuleIdentification
-
- @param mid ModuleIdentification
-
- **/
- public void setMid(ModuleIdentification mid) {
- this.mid = mid;
- }
-
- /**
- Get PackageIdentification
-
- @return PackageIdentification
-
- **/
- public PackageIdentification getPid() {
- return pid;
- }
-
- /**
- Set PackageIdentification
-
- @param pid PackageIdentification
-
- **/
- public void setPid(PackageIdentification pid) {
- this.pid = pid;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
deleted file mode 100644
index 69d47423a5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/FrameworkWizardUI.java
+++ /dev/null
@@ -1,3789 +0,0 @@
-/** @file
-
- The main GUI for module editor.
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.WindowEvent;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBoxMenuItem;
-import javax.swing.JDesktopPane;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JInternalFrame;
-import javax.swing.JMenu;
-import javax.swing.JMenuBar;
-import javax.swing.JMenuItem;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JSplitPane;
-import javax.swing.JTabbedPane;
-import javax.swing.ToolTipManager;
-import javax.swing.event.MenuEvent;
-import javax.swing.event.MenuListener;
-import javax.swing.event.TreeSelectionEvent;
-import javax.swing.event.TreeSelectionListener;
-import javax.swing.tree.TreePath;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.SaveFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.find.FindResult;
-import org.tianocore.frameworkwizard.common.ui.IDefaultMutableTreeNode;
-import org.tianocore.frameworkwizard.common.ui.IDesktopManager;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.ITree;
-import org.tianocore.frameworkwizard.far.createui.CreateStepOne;
-import org.tianocore.frameworkwizard.far.deleteui.DeleteStepOne;
-import org.tianocore.frameworkwizard.far.installui.InstallStepOne;
-import org.tianocore.frameworkwizard.far.updateui.UpdateStepOne;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.ui.ModuleBootModes;
-import org.tianocore.frameworkwizard.module.ui.ModuleBuildOptions;
-import org.tianocore.frameworkwizard.module.ui.ModuleDataHubs;
-import org.tianocore.frameworkwizard.module.ui.ModuleEvents;
-import org.tianocore.frameworkwizard.module.ui.ModuleExterns;
-import org.tianocore.frameworkwizard.module.ui.ModuleGuids;
-import org.tianocore.frameworkwizard.module.ui.ModuleHiiPackages;
-import org.tianocore.frameworkwizard.module.ui.ModuleHobs;
-import org.tianocore.frameworkwizard.module.ui.ModuleLibraryClassDefinitions;
-import org.tianocore.frameworkwizard.module.ui.ModulePCDs;
-import org.tianocore.frameworkwizard.module.ui.ModulePackageDependencies;
-import org.tianocore.frameworkwizard.module.ui.ModulePpis;
-import org.tianocore.frameworkwizard.module.ui.ModuleProtocols;
-import org.tianocore.frameworkwizard.module.ui.ModuleSourceFiles;
-import org.tianocore.frameworkwizard.module.ui.ModuleSystemTables;
-import org.tianocore.frameworkwizard.module.ui.ModuleVariables;
-import org.tianocore.frameworkwizard.module.ui.MsaHeader;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.packaging.ui.SpdGuidDecls;
-import org.tianocore.frameworkwizard.packaging.ui.SpdHeader;
-import org.tianocore.frameworkwizard.packaging.ui.SpdLibClassDecls;
-import org.tianocore.frameworkwizard.packaging.ui.SpdMsaFiles;
-import org.tianocore.frameworkwizard.packaging.ui.SpdPackageHeaders;
-import org.tianocore.frameworkwizard.packaging.ui.SpdPcdDefs;
-import org.tianocore.frameworkwizard.packaging.ui.SpdPpiDecls;
-import org.tianocore.frameworkwizard.packaging.ui.SpdProtocolDecls;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.platform.ui.FpdBuildOptions;
-import org.tianocore.frameworkwizard.platform.ui.FpdDynamicPcdBuildDefinitions;
-import org.tianocore.frameworkwizard.platform.ui.FpdFlash;
-import org.tianocore.frameworkwizard.platform.ui.FpdFrameworkModules;
-import org.tianocore.frameworkwizard.platform.ui.FpdHeader;
-import org.tianocore.frameworkwizard.platform.ui.FpdPlatformDefs;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-import org.tianocore.frameworkwizard.workspace.ui.SwitchWorkspace;
-import org.tianocore.frameworkwizard.toolchain.Preferences;
-
-/**
- The class is used to show main GUI of FrameworkWizard
- It extends IFrame implements MouseListener, TreeSelectionListener, ComponentListener and MenuListener
-
- **/
-public class FrameworkWizardUI extends IFrame implements KeyListener, MouseListener, TreeSelectionListener,
- MenuListener {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7103240960573031772L;
-
- //
- // Set ToolTipText Show Time
- //
- static { ToolTipManager.sharedInstance().setDismissDelay(18000); }
-
- ///
- /// Used to record current operation target
- ///
- private int currentOpeningModuleIndex = -1;
-
- private int currentOpeningPackageIndex = -1;
-
- private int currentOpeningPlatformIndex = -1;
-
- ///
- /// Used to generate tree structure
- ///
- private IDefaultMutableTreeNode dmtnRoot = null;
-
- private IDefaultMutableTreeNode dmtnModuleDescription = null;
-
- private IDefaultMutableTreeNode dmtnPackageDescription = null;
-
- private IDefaultMutableTreeNode dmtnPlatformDescription = null;
-
- ///
- /// Used for UI
- ///
- private JPanel jContentPane = null;
-
- private JMenuBar jMenuBar = null;
-
- private JMenu jMenuFile = null;
-
- private JMenuItem jMenuItemFileNew = null;
-
- private JMenuItem jMenuItemFileRefresh = null;
-
- private JMenuItem jMenuItemFileSaveAs = null;
-
- private JMenuItem jMenuItemFileExit = null;
-
- private JMenu jMenuEdit = null;
-
- private JDesktopPane jDesktopPaneModule = null;
-
- private JDesktopPane jDesktopPanePackage = null;
-
- private JDesktopPane jDesktopPanePlatform = null;
-
- private JTabbedPane jTabbedPaneTree = null;
-
- private JTabbedPane jTabbedPaneEditor = null;
-
- private IDesktopManager iDesktopManager = new IDesktopManager();
-
- private JScrollPane jScrollPaneTree = null;
-
- private ITree iTree = null;
-
- private JMenu jMenuHelp = null;
-
- private JMenuItem jMenuItemHelpAbout = null;
-
- private JMenuItem jMenuItemEditDelete = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private JMenuItem jMenuItemFileSave = null;
-
- private JMenuItem jMenuItemFileClose = null;
-
- private JMenu jMenuTools = null;
-
- private JMenu jMenuWindow = null;
-
- private JPanel jPanelOperation = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JMenuItem jMenuItemFileOpen = null;
-
- private JMenuItem jMenuItemFileCloseAll = null;
-
- private JMenuItem jMenuItemFileSaveAll = null;
-
- private JMenuItem jMenuItemFilePageSetup = null;
-
- private JMenuItem jMenuItemFilePrint = null;
-
- private JMenuItem jMenuItemFileImport = null;
-
- private JMenuItem jMenuItemFileProperties = null;
-
- private JMenu jMenuFileRecentFiles = null;
-
- private JSplitPane jSplitPane = null;
-
- private JMenuItem jMenuItemEditUndo = null;
-
- private JMenuItem jMenuItemEditRedo = null;
-
- private JMenuItem jMenuItemEditCut = null;
-
- private JMenuItem jMenuItemEditCopy = null;
-
- private JMenuItem jMenuItemEditPaste = null;
-
- private JMenuItem jMenuItemEditSelectAll = null;
-
- private JMenuItem jMenuItemEditFindNext = null;
-
- private JMenu jMenuView = null;
-
- private JMenu jMenuViewToolbars = null;
-
- private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsFile = null;
-
- private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsEdit = null;
-
- private JCheckBoxMenuItem jCheckBoxMenuItemViewToolbarsWindow = null;
-
- private JMenuItem jMenuItemViewStandard = null;
-
- private JMenuItem jMenuItemViewAdvanced = null;
-
- private JMenu jMenuProject = null;
-
- private JMenuItem jMenuItemProjectAdmin = null;
-
- private JMenuItem jMenuItemProjectChangeWorkspace = null;
-
- private JMenuItem jMenuItemToolsBuildPreferences = null;
-
- // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsDebug = null;
-
- // private JCheckBoxMenuItem jCheckBoxMenuItemProjectBuildTargetsRelease = null;
-
- private JMenuItem jMenuItemToolsToolChainConfiguration = null;
-
- private JMenuItem jMenuItemToolsClone = null;
-
- private JMenuItem jMenuItemToolsCodeScan = null;
-
- private JMenuItem jMenuItemWindowDisplaySide = null;
-
- private JMenuItem jMenuItemWindowDisplayTopBottom = null;
-
- private JMenuItem jMenuItemViewXML = null;
-
- private JMenuItem jMenuItemWindowTabView = null;
-
- private JMenuItem jMenuItemWindowSource = null;
-
- private JMenuItem jMenuItemWindowXML = null;
-
- private JMenuItem jMenuItemWindowPreferences = null;
-
- private JMenuItem jMenuItemHelpContents = null;
-
- private JMenuItem jMenuItemHelpIndex = null;
-
- private JMenuItem jMenuItemHelpSearch = null;
-
- private JMenuItem jMenuItemProjectInstallFar = null;
-
- private JMenuItem jMenuItemProjectUpdateFar = null;
-
- private JMenuItem jMenuItemProjectRemoveFar = null;
-
- private JMenuItem jMenuItemProjectCreateFar = null;
-
- private JMenu jMenuEditFind = null;
-
- private JMenuItem jMenuItemEditFindPcd = null;
-
- private JMenuItem jMenuItemEditFindLibraryClass = null;
-
- private JMenuItem jMenuItemEditFindPpi = null;
-
- private JMenuItem jMenuItemEditFindProtocol = null;
-
- private JMenuItem jMenuItemEditFindGuid = null;
-
- private JMenuItem jMenuItemEditFindLibraryInstance = null;
-
- ///
- /// A static definition for this class itself
- ///
- private static FrameworkWizardUI fwui = null;
-
- private JMenuItem jMenuItemToolsGenerateGuidsXref = null;
-
- /**
- If the class hasn't an instnace, new one.
-
- @return FrameworkWizardUI The instance of this class
-
- **/
- public static FrameworkWizardUI getInstance(String[] args) {
- if (fwui == null) {
- fwui = new FrameworkWizardUI(args);
- }
- return fwui;
- }
-
- /**
- If the class hasn't an instnace, new one.
-
- @return FrameworkWizardUI The instance of this class
-
- **/
- public static FrameworkWizardUI getInstance() {
- return fwui;
- }
-
- /**
- This method initializes jMenuBar
-
- @return javax.swing.JMenuBar Main menu bar for the entire GUI
-
- **/
- private JMenuBar getjJMenuBar() {
- if (jMenuBar == null) {
- jMenuBar = new JMenuBar();
- jMenuBar.setPreferredSize(new java.awt.Dimension(0, 18));
- jMenuBar.add(getJMenuFile());
- jMenuBar.add(getJMenuEdit());
- jMenuBar.add(getJMenuView());
- jMenuBar.add(getJMenuProject());
- jMenuBar.add(getJMenuTools());
- jMenuBar.add(getJMenuWindow());
- jMenuBar.add(getJMenuHelp());
- }
- return jMenuBar;
- }
-
- /**
- This method initializes jSplitPane
-
- @return javax.swing.JSplitPane
-
- **/
- private JSplitPane getJSplitPane() {
- if (jSplitPane == null) {
- jSplitPane = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, getJTabbedPaneTree(), getJTabbedPaneEditor());
- jSplitPane.setBounds(new java.awt.Rectangle(0, 1, DataType.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT));
- jSplitPane.addComponentListener(this);
- }
- return jSplitPane;
- }
-
- /**
- This method initializes jTabbedPaneEditor
-
- @return javax.swing.JTabbedPane
-
- **/
- private JTabbedPane getJTabbedPaneEditor() {
- if (jTabbedPaneEditor == null) {
- jTabbedPaneEditor = new JTabbedPane();
- jTabbedPaneEditor.setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,
- DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jTabbedPaneEditor
- .setMinimumSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jTabbedPaneEditor.addTab("Module", null, getJDesktopPaneModule(), null);
- jTabbedPaneEditor.addTab("Package", null, getJDesktopPanePackage(), null);
- jTabbedPaneEditor.addTab("Platform", null, getJDesktopPanePlatform(), null);
- }
- return jTabbedPaneEditor;
- }
-
- /**
- This method initializes jTabbedPaneTree
-
- @return javax.swing.JTabbedPane
-
- **/
- private JTabbedPane getJTabbedPaneTree() {
- if (jTabbedPaneTree == null) {
- jTabbedPaneTree = new JTabbedPane();
- jTabbedPaneTree
- .setPreferredSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));
- jTabbedPaneTree
- .setMinimumSize(new java.awt.Dimension(DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));
- jTabbedPaneTree.addTab("Workspace Explorer", null, getJScrollPaneTree(), null);
- }
- return jTabbedPaneTree;
- }
-
- /**
- This method initializes jMenuFile
-
- @return javax.swing.JMenu jMenuModule
-
- **/
- private JMenu getJMenuFile() {
- if (jMenuFile == null) {
- //
- // Set jMenuFile's attributes
- //
- jMenuFile = new JMenu();
- jMenuFile.setText("File");
- jMenuFile.setMnemonic('F');
- jMenuFile.addMenuListener(this);
-
- //
- // Add sub menu items
- //
- jMenuFile.add(getJMenuItemFileNew());
- jMenuFile.add(getJMenuItemFileOpen());
- jMenuFile.add(getJMenuItemFileClose());
- jMenuFile.add(getJMenuItemFileCloseAll());
- jMenuFile.addSeparator();
-
- jMenuFile.add(getJMenuFileRecentFiles());
- jMenuFile.add(getJMenuItemFileSave());
- jMenuFile.add(getJMenuItemFileSaveAs());
- jMenuFile.add(getJMenuItemFileSaveAll());
- jMenuFile.addSeparator();
-
- jMenuFile.add(getJMenuItemFileRefresh());
- jMenuFile.addSeparator();
-
- jMenuFile.add(getJMenuItemFilePageSetup());
- jMenuFile.add(getJMenuItemFilePrint());
- jMenuFile.add(getJMenuItemFileImport());
- jMenuFile.add(getJMenuItemFileProperties());
-
- jMenuFile.add(getJMenuItemFileExit());
- }
- return jMenuFile;
- }
-
- /**
- This method initializes jMenuItemFileSaveAs
-
- @return javax.swing.JMenuItem jMenuItemFileSaveAs
-
- **/
- private JMenuItem getJMenuItemFileSaveAs() {
- if (jMenuItemFileSaveAs == null) {
- jMenuItemFileSaveAs = new JMenuItem();
- jMenuItemFileSaveAs.setText("Save As...");
- jMenuItemFileSaveAs.setMnemonic('a');
- jMenuItemFileSaveAs.addActionListener(this);
- jMenuItemFileSaveAs.setEnabled(false);
- jMenuItemFileSaveAs.setVisible(false);
- }
- return jMenuItemFileSaveAs;
- }
-
- /**
- This method initializes jMenuItemFileRefresh
-
- @return javax.swing.JMenuItem jMenuItemFileRefresh
-
- **/
- private JMenuItem getJMenuItemFileRefresh() {
- if (jMenuItemFileRefresh == null) {
- jMenuItemFileRefresh = new JMenuItem();
- jMenuItemFileRefresh.setText("Refresh");
- jMenuItemFileRefresh.setMnemonic('R');
- jMenuItemFileRefresh.addActionListener(this);
- jMenuItemFileRefresh.setVisible(true);
- }
- return jMenuItemFileRefresh;
- }
-
- /**
- This method initializes jMenuItemModuleExit
-
- @return javax.swing.JMenuItem jMenuItemModuleExit
-
- **/
- private JMenuItem getJMenuItemFileExit() {
- if (jMenuItemFileExit == null) {
- jMenuItemFileExit = new JMenuItem();
- jMenuItemFileExit.setText("Exit");
- jMenuItemFileExit.setMnemonic('x');
- jMenuItemFileExit.addActionListener(this);
- }
- return jMenuItemFileExit;
- }
-
- /**
- This method initializes jMenuEdit
-
- @return javax.swing.JMenu jMenuEdit
-
- **/
- private JMenu getJMenuEdit() {
- if (jMenuEdit == null) {
- //
- // Set jMenuEdit's attributes
- //
- jMenuEdit = new JMenu();
- jMenuEdit.setText("Edit");
- jMenuEdit.setMnemonic('E');
- jMenuEdit.setVisible(true);
-
- //
- // Add sub menu items
- //
- jMenuEdit.add(getJMenuItemEditUndo());
- jMenuEdit.add(getJMenuItemEditRedo());
- //jMenuEdit.addSeparator();
-
- jMenuEdit.add(getJMenuItemEditCut());
- jMenuEdit.add(getJMenuItemEditCopy());
- jMenuEdit.add(getJMenuItemEditPaste());
- jMenuEdit.add(getJMenuItemEditDelete());
- //jMenuEdit.addSeparator();
-
- jMenuEdit.add(getJMenuItemEditSelectAll());
- jMenuEdit.add(getJMenuEditFind());
- jMenuEdit.add(getJMenuItemEditFindNext());
- //jMenuEdit.addSeparator();
- }
- return jMenuEdit;
- }
-
- /**
- This method initializes jDesktopPane
-
- @return javax.swing.JDesktopPane jDesktopPane
-
- **/
- private JDesktopPane getJDesktopPaneModule() {
- if (jDesktopPaneModule == null) {
- jDesktopPaneModule = new JDesktopPane();
- jDesktopPaneModule
- .setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,
- DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPaneModule
- .setMinimumSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPaneModule.setDesktopManager(iDesktopManager);
- jDesktopPaneModule.addComponentListener(this);
- }
- return jDesktopPaneModule;
- }
-
- /**
- This method initializes jDesktopPane
-
- @return javax.swing.JDesktopPane jDesktopPane
-
- **/
- private JDesktopPane getJDesktopPanePackage() {
- if (jDesktopPanePackage == null) {
- jDesktopPanePackage = new JDesktopPane();
- jDesktopPanePackage
- .setBounds(new java.awt.Rectangle(DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,
- DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPanePackage
- .setMinimumSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPanePackage.setDesktopManager(iDesktopManager);
- jDesktopPanePackage.addComponentListener(this);
- }
- return jDesktopPanePackage;
- }
-
- /**
- This method initializes jDesktopPane
-
- @return javax.swing.JDesktopPane jDesktopPane
-
- **/
- private JDesktopPane getJDesktopPanePlatform() {
- if (jDesktopPanePlatform == null) {
- jDesktopPanePlatform = new JDesktopPane();
- jDesktopPanePlatform
- .setBounds(new java.awt.Rectangle(
- DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_X,
- DataType.MAIN_FRAME_EDITOR_PANEL_LOCATION_Y,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPanePlatform
- .setMinimumSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT));
- jDesktopPanePlatform.setDesktopManager(iDesktopManager);
- jDesktopPanePlatform.addComponentListener(this);
- }
- return jDesktopPanePlatform;
- }
-
- /**
- This method initializes jScrollPaneTree
-
- @return javax.swing.JScrollPane jScrollPaneTree
-
- **/
- private JScrollPane getJScrollPaneTree() {
- if (jScrollPaneTree == null) {
- jScrollPaneTree = new JScrollPane();
- jScrollPaneTree
- .setPreferredSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH,
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));
- jScrollPaneTree
- .setMinimumSize(new java.awt.Dimension(
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH / 2,
- DataType.MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT));
- jScrollPaneTree.setViewportView(getITree());
- }
- return jScrollPaneTree;
- }
-
- /**
- This method initializes iTree
-
- @return org.tianocore.packaging.common.ui.ITree iTree
-
- **/
- private ITree getITree() {
- //
- //Before open a real module, use an empty root node for the tree
- //
- makeEmptyTree();
- return iTree;
- }
-
- /**
- This method initializes jMenuHelp
-
- @return javax.swing.JMenu jMenuHelp
-
- **/
- private JMenu getJMenuHelp() {
- if (jMenuHelp == null) {
- //
- // Set jMenuHelp's attributes
- //
- jMenuHelp = new JMenu();
- jMenuHelp.setText("Help");
- jMenuHelp.setMnemonic('H');
-
- //
- // Add sub menu items
- //
- jMenuHelp.add(getJMenuItemHelpContents());
- jMenuHelp.add(getJMenuItemHelpIndex());
- jMenuHelp.add(getJMenuItemHelpSearch());
-
- jMenuHelp.add(getJMenuItemHelpAbout());
- }
- return jMenuHelp;
- }
-
- /**
- This method initializes jMenuItemHelpAbout
-
- @return javax.swing.JMenuItem jMenuItemHelpAbout
-
- **/
- private JMenuItem getJMenuItemHelpAbout() {
- if (jMenuItemHelpAbout == null) {
- jMenuItemHelpAbout = new JMenuItem();
- jMenuItemHelpAbout.setText("About");
- jMenuItemHelpAbout.setMnemonic('A');
- jMenuItemHelpAbout.addActionListener(this);
- }
- return jMenuItemHelpAbout;
- }
-
- /**
- This method initializes jMenuItemEditDelete
-
- @return javax.swing.JMenuItem jMenuItemEditDelete
-
- **/
- private JMenuItem getJMenuItemEditDelete() {
- if (jMenuItemEditDelete == null) {
- jMenuItemEditDelete = new JMenuItem();
- jMenuItemEditDelete.setText("Delete");
- jMenuItemEditDelete.setMnemonic('D');
- jMenuItemEditDelete.setVisible(false);
- jMenuItemEditDelete.setEnabled(false);
- jMenuItemEditDelete.addActionListener(this);
- //
- //Disabled first when no module is open
- //
- jMenuItemEditDelete.setEnabled(false);
- }
- return jMenuItemEditDelete;
- }
-
- /**
- This method initializes jMenuFileNew
-
- @return javax.swing.JMenuItem jMenuFileNew
-
- **/
- private JMenuItem getJMenuItemFileNew() {
- if (jMenuItemFileNew == null) {
- jMenuItemFileNew = new JMenuItem();
- jMenuItemFileNew.setText("New...");
- jMenuItemFileNew.setMnemonic('N');
- jMenuItemFileNew.addActionListener(this);
- }
- return jMenuItemFileNew;
- }
-
- /**
- This method initializes jMenuItemFileSave
-
- @return javax.swing.JMenuItem jMenuItemModuleSave
-
- **/
- private JMenuItem getJMenuItemFileSave() {
- if (jMenuItemFileSave == null) {
- jMenuItemFileSave = new JMenuItem();
- jMenuItemFileSave.setText("Save");
- jMenuItemFileSave.setMnemonic('S');
- jMenuItemFileSave.addActionListener(this);
- jMenuItemFileSave.setEnabled(true);
- }
- return jMenuItemFileSave;
- }
-
- /**
- This method initializes jMenuItemModuleClose
-
- @return javax.swing.JMenuItem jMenuItemModuleClose
-
- **/
- private JMenuItem getJMenuItemFileClose() {
- if (jMenuItemFileClose == null) {
- jMenuItemFileClose = new JMenuItem();
- jMenuItemFileClose.setText("Close");
- jMenuItemFileClose.setMnemonic('C');
- jMenuItemFileClose.setEnabled(true);
- jMenuItemFileClose.addActionListener(this);
- }
- return jMenuItemFileClose;
- }
-
- /**
- This method initializes jMenuTools
- Reserved
-
- @return javax.swing.JMenu jMenuTools
-
- **/
- private JMenu getJMenuTools() {
- if (jMenuTools == null) {
- //
- // Set jMenuTools's attributes
- //
- jMenuTools = new JMenu();
- jMenuTools.setText("Tools");
- jMenuTools.setMnemonic('T');
- jMenuTools.addMenuListener(this);
-
- //
- // Add sub menu items
- //
-
- jMenuTools.add(getJMenuItemToolsClone());
- jMenuTools.add(getJMenuItemToolsCodeScan());
- jMenuTools.addSeparator();
-
- jMenuTools.add(getJMenuItemToolsToolChainConfiguration());
- jMenuTools.add(getJMenuItemToolsBuildPreferences());
- jMenuTools.addSeparator();
-
- jMenuTools.add(getJMenuItemToolsGenerateGuidsXref());
- }
- return jMenuTools;
- }
-
- /**
- This method initializes jMenuWindow
- Reserved
-
- @return javax.swing.JMenu jMenuWindow
-
- **/
- private JMenu getJMenuWindow() {
- if (jMenuWindow == null) {
- //
- // Set jMenuWindow's attribute
- //
- jMenuWindow = new JMenu();
- jMenuWindow.setText("Window");
- jMenuWindow.setMnemonic('W');
- jMenuWindow.setVisible(false);
-
- //
- // Add sub menu items
- //
- jMenuWindow.add(getJMenuItemWindowDisplaySide());
- jMenuWindow.add(getJMenuItemWindowDisplayTopBottom());
- jMenuWindow.addSeparator();
-
- jMenuWindow.add(getJMenuItemWindowTabView());
- jMenuWindow.addSeparator();
-
- jMenuWindow.add(getJMenuItemWindowSource());
- jMenuWindow.add(getJMenuItemWindowXML());
- jMenuWindow.addSeparator();
-
- jMenuWindow.add(getJMenuItemWindowPreferences());
- }
- return jMenuWindow;
- }
-
- /**
- This method initializes jPanelOperation
- Reserved
-
- @return javax.swing.JPanel jPanelOperation
-
- **/
- private JPanel getJPanelOperation() {
- if (jPanelOperation == null) {
- jPanelOperation = new JPanel();
- jPanelOperation.setLayout(null);
- jPanelOperation.setBounds(new java.awt.Rectangle(295, 520, 500, 25));
- jPanelOperation.add(getJButtonOk(), null);
- jPanelOperation.add(getJButtonCancel(), null);
- jPanelOperation.setVisible(false);
- }
- return jPanelOperation;
- }
-
- /**
- This method initializes jButtonOk
- Reserved
-
- @return javax.swing.JButton jButtonOk
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(395, 2, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.setEnabled(false);
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
- Reserved
-
- @return javax.swing.JButton jButtonCancel
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(395, 2, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.setEnabled(false);
- jButtonCancel.addActionListener(this);
- jButtonCancel.setVisible(false);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jMenuItemFileOpen
-
- @return javax.swing.JMenuItem jMenuItemFileOpen
-
- **/
- private JMenuItem getJMenuItemFileOpen() {
- if (jMenuItemFileOpen == null) {
- jMenuItemFileOpen = new JMenuItem();
- jMenuItemFileOpen.setText("Open...");
- jMenuItemFileOpen.setMnemonic('O');
- jMenuItemFileOpen.addActionListener(this);
- }
- return jMenuItemFileOpen;
- }
-
- /**
- This method initializes jMenuItemFileCloseAll
-
- @return javax.swing.JMenuItem jMenuItemFileOpen
-
- **/
- private JMenuItem getJMenuItemFileCloseAll() {
- if (jMenuItemFileCloseAll == null) {
- jMenuItemFileCloseAll = new JMenuItem();
- jMenuItemFileCloseAll.setText("Close All");
- jMenuItemFileCloseAll.setMnemonic('A');
- jMenuItemFileCloseAll.setEnabled(true);
- jMenuItemFileCloseAll.addActionListener(this);
- }
- return jMenuItemFileCloseAll;
- }
-
- /**
- This method initializes jMenuItemFileSaveAll
-
- @return javax.swing.JMenuItem jMenuItemFileSaveAll
-
- **/
- private JMenuItem getJMenuItemFileSaveAll() {
- if (jMenuItemFileSaveAll == null) {
- jMenuItemFileSaveAll = new JMenuItem();
- jMenuItemFileSaveAll.setText("Save All");
- jMenuItemFileSaveAll.setMnemonic('v');
- jMenuItemFileSaveAll.setEnabled(true);
- jMenuItemFileSaveAll.addActionListener(this);
- }
- return jMenuItemFileSaveAll;
- }
-
- /**
- This method initializes jMenuItemFilePageSetup
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemFilePageSetup() {
- if (jMenuItemFilePageSetup == null) {
- jMenuItemFilePageSetup = new JMenuItem();
- jMenuItemFilePageSetup.setText("Page Setup");
- jMenuItemFilePageSetup.setMnemonic('u');
- jMenuItemFilePageSetup.setEnabled(false);
- jMenuItemFilePageSetup.addActionListener(this);
- jMenuItemFilePageSetup.setVisible(false);
- }
- return jMenuItemFilePageSetup;
- }
-
- /**
- This method initializes jMenuItemFilePrint
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemFilePrint() {
- if (jMenuItemFilePrint == null) {
- jMenuItemFilePrint = new JMenuItem();
- jMenuItemFilePrint.setText("Print");
- jMenuItemFilePrint.setMnemonic('P');
- jMenuItemFilePrint.setEnabled(false);
- jMenuItemFilePrint.addActionListener(this);
- jMenuItemFilePrint.setVisible(false);
- }
- return jMenuItemFilePrint;
- }
-
- /**
- This method initializes jMenuItemFileImport
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemFileImport() {
- if (jMenuItemFileImport == null) {
- jMenuItemFileImport = new JMenuItem();
- jMenuItemFileImport.setText("Import");
- jMenuItemFileImport.setMnemonic('I');
- jMenuItemFileImport.setEnabled(false);
- jMenuItemFileImport.addActionListener(this);
- jMenuItemFileImport.setVisible(false);
- }
- return jMenuItemFileImport;
- }
-
- /**
- This method initializes jMenuItemFileProperties
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemFileProperties() {
- if (jMenuItemFileProperties == null) {
- jMenuItemFileProperties = new JMenuItem();
- jMenuItemFileProperties.setText("Properties");
- jMenuItemFileProperties.setMnemonic('t');
- jMenuItemFileProperties.setEnabled(false);
- jMenuItemFileProperties.addActionListener(this);
- jMenuItemFileProperties.setVisible(false);
- }
- return jMenuItemFileProperties;
- }
-
- /**
- This method initializes jMenuFileRecentFiles
-
- @return javax.swing.JMenu
-
- **/
- private JMenu getJMenuFileRecentFiles() {
- if (jMenuFileRecentFiles == null) {
- jMenuFileRecentFiles = new JMenu();
- jMenuFileRecentFiles.setText("Recent Files");
- jMenuFileRecentFiles.setMnemonic('F');
- jMenuFileRecentFiles.setEnabled(false);
- jMenuFileRecentFiles.addActionListener(this);
- jMenuFileRecentFiles.setVisible(false);
- }
- return jMenuFileRecentFiles;
- }
-
- /**
- This method initializes jMenuItemEditUndo
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditUndo() {
- if (jMenuItemEditUndo == null) {
- jMenuItemEditUndo = new JMenuItem();
- jMenuItemEditUndo.setText("Undo");
- jMenuItemEditUndo.setMnemonic('U');
- jMenuItemEditUndo.setEnabled(false);
- jMenuItemEditUndo.setVisible(false);
- jMenuItemEditUndo.addActionListener(this);
- }
- return jMenuItemEditUndo;
- }
-
- /**
- This method initializes jMenuItemEditRedo
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditRedo() {
- if (jMenuItemEditRedo == null) {
- jMenuItemEditRedo = new JMenuItem();
- jMenuItemEditRedo.setText("Redo");
- jMenuItemEditRedo.setMnemonic('R');
- jMenuItemEditRedo.setEnabled(false);
- jMenuItemEditRedo.setVisible(false);
- jMenuItemEditRedo.addActionListener(this);
- }
- return jMenuItemEditRedo;
- }
-
- /**
- This method initializes jMenuItemEditCut
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditCut() {
- if (jMenuItemEditCut == null) {
- jMenuItemEditCut = new JMenuItem();
- jMenuItemEditCut.setText("Cut");
- jMenuItemEditCut.setMnemonic('t');
- jMenuItemEditCut.setEnabled(false);
- jMenuItemEditCut.setVisible(false);
- jMenuItemEditCut.addActionListener(this);
- }
- return jMenuItemEditCut;
- }
-
- /**
- This method initializes jMenuItemEditCopy
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditCopy() {
- if (jMenuItemEditCopy == null) {
- jMenuItemEditCopy = new JMenuItem();
- jMenuItemEditCopy.setText("Copy");
- jMenuItemEditCopy.setMnemonic('C');
- jMenuItemEditCopy.setEnabled(false);
- jMenuItemEditCopy.setVisible(false);
- jMenuItemEditCopy.addActionListener(this);
- }
- return jMenuItemEditCopy;
- }
-
- /**
- This method initializes jMenuItemEditPaste
-
- return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditPaste() {
- if (jMenuItemEditPaste == null) {
- jMenuItemEditPaste = new JMenuItem();
- jMenuItemEditPaste.setText("Paste");
- jMenuItemEditPaste.setMnemonic('P');
- jMenuItemEditPaste.setEnabled(false);
- jMenuItemEditPaste.setVisible(false);
- jMenuItemEditPaste.addActionListener(this);
- }
- return jMenuItemEditPaste;
- }
-
- /**
- This method initializes jMenuItem
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditSelectAll() {
- if (jMenuItemEditSelectAll == null) {
- jMenuItemEditSelectAll = new JMenuItem();
- jMenuItemEditSelectAll.setText("Select All");
- jMenuItemEditSelectAll.setMnemonic('A');
- jMenuItemEditSelectAll.setEnabled(false);
- jMenuItemEditSelectAll.setVisible(false);
- jMenuItemEditSelectAll.addActionListener(this);
- }
- return jMenuItemEditSelectAll;
- }
-
- /**
- This method initializes jMenuItemEditFindNext
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemEditFindNext() {
- if (jMenuItemEditFindNext == null) {
- jMenuItemEditFindNext = new JMenuItem();
- jMenuItemEditFindNext.setText("Find Next");
- jMenuItemEditFindNext.setMnemonic('n');
- jMenuItemEditFindNext.setEnabled(false);
- jMenuItemEditFindNext.setVisible(false);
- jMenuItemEditFindNext.addActionListener(this);
- }
- return jMenuItemEditFindNext;
- }
-
- /**
- This method initializes jMenuView
-
- @return javax.swing.JMenu
-
- **/
- private JMenu getJMenuView() {
- if (jMenuView == null) {
- //
- // Set jMenuView's attributes
- //
- jMenuView = new JMenu();
- jMenuView.setText("View");
- jMenuView.setMnemonic('V');
- jMenuView.setVisible(false);
-
- //
- // Add sub menu items
- //
- jMenuView.add(getJMenuViewToolbars());
- jMenuView.add(getJMenuItemViewAdvanced());
- jMenuView.add(getJMenuItemViewStandard());
- jMenuView.add(getJMenuItemViewXML());
- }
- return jMenuView;
- }
-
- /**
- This method initializes jMenuViewToolbars
-
- @return javax.swing.JMenu
-
- **/
- private JMenu getJMenuViewToolbars() {
- if (jMenuViewToolbars == null) {
- jMenuViewToolbars = new JMenu();
- jMenuViewToolbars.setText("Toolbars");
- jMenuViewToolbars.setMnemonic('T');
-
- jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsFile());
- jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsEdit());
- jMenuViewToolbars.add(getJCheckBoxMenuItemViewToolbarsWindow());
- }
- return jMenuViewToolbars;
- }
-
- /**
- This method initializes jCheckBoxMenuItemViewToolbarsFile
-
- @return javax.swing.JCheckBoxMenuItem
-
- **/
- private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsFile() {
- if (jCheckBoxMenuItemViewToolbarsFile == null) {
- jCheckBoxMenuItemViewToolbarsFile = new JCheckBoxMenuItem();
- jCheckBoxMenuItemViewToolbarsFile.setText("File");
- jCheckBoxMenuItemViewToolbarsFile.setEnabled(false);
- jCheckBoxMenuItemViewToolbarsFile.addActionListener(this);
- }
- return jCheckBoxMenuItemViewToolbarsFile;
- }
-
- /**
- This method initializes jCheckBoxMenuItemViewToolbarsEdit
-
- @return javax.swing.JCheckBoxMenuItem
-
- **/
- private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsEdit() {
- if (jCheckBoxMenuItemViewToolbarsEdit == null) {
- jCheckBoxMenuItemViewToolbarsEdit = new JCheckBoxMenuItem();
- jCheckBoxMenuItemViewToolbarsEdit.setText("Edit");
- jCheckBoxMenuItemViewToolbarsEdit.setEnabled(false);
- jCheckBoxMenuItemViewToolbarsEdit.addActionListener(this);
- }
- return jCheckBoxMenuItemViewToolbarsEdit;
- }
-
- /**
- This method initializes jCheckBoxMenuItemViewToolbarsWindow
-
- @return javax.swing.JCheckBoxMenuItem
-
- **/
- private JCheckBoxMenuItem getJCheckBoxMenuItemViewToolbarsWindow() {
- if (jCheckBoxMenuItemViewToolbarsWindow == null) {
- jCheckBoxMenuItemViewToolbarsWindow = new JCheckBoxMenuItem();
- jCheckBoxMenuItemViewToolbarsWindow.setText("Window");
- jCheckBoxMenuItemViewToolbarsWindow.setEnabled(false);
- jCheckBoxMenuItemViewToolbarsWindow.addActionListener(this);
- }
- return jCheckBoxMenuItemViewToolbarsWindow;
- }
-
- /**
- This method initializes jMenuItemStandard
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemViewStandard() {
- if (jMenuItemViewStandard == null) {
- jMenuItemViewStandard = new JMenuItem();
- jMenuItemViewStandard.setText("Standard");
- jMenuItemViewStandard.setMnemonic('S');
- jMenuItemViewStandard.setEnabled(false);
- jMenuItemViewStandard.addActionListener(this);
- }
- return jMenuItemViewStandard;
- }
-
- /**
- This method initializes jMenuItemAdvanced
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemViewAdvanced() {
- if (jMenuItemViewAdvanced == null) {
- jMenuItemViewAdvanced = new JMenuItem();
- jMenuItemViewAdvanced.setText("Advanced");
- jMenuItemViewAdvanced.setMnemonic('A');
- jMenuItemViewAdvanced.setEnabled(false);
- jMenuItemViewAdvanced.addActionListener(this);
- }
- return jMenuItemViewAdvanced;
- }
-
- /**
- This method initializes jMenuProject
-
- @return javax.swing.JMenu
-
- **/
- private JMenu getJMenuProject() {
- if (jMenuProject == null) {
- //
- // Set jMenuProject's attributes
- //
- jMenuProject = new JMenu();
- jMenuProject.setText("Project");
- jMenuProject.setMnemonic('P');
-
- //
- // Add sub menu items
- //
- jMenuProject.add(getJMenuItemProjectAdmin());
-
- jMenuProject.add(getJMenuItemProjectChangeWorkspace());
- jMenuProject.addSeparator();
-
- jMenuProject.add(getJMenuItemProjectCreateFar());
- jMenuProject.add(getJMenuItemProjectInstallFar());
- jMenuProject.add(getJMenuItemProjectUpdateFar());
- jMenuProject.add(getJMenuItemProjectRemoveFar());
-
- }
- return jMenuProject;
- }
-
- /**
- This method initializes jMenuItemProjectAdmin
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemProjectAdmin() {
- if (jMenuItemProjectAdmin == null) {
- jMenuItemProjectAdmin = new JMenuItem();
- jMenuItemProjectAdmin.setText("Admin...");
- jMenuItemProjectAdmin.setMnemonic('A');
- jMenuItemProjectAdmin.setEnabled(false);
- jMenuItemProjectAdmin.addActionListener(this);
- jMenuItemProjectAdmin.setVisible(false);
- }
- return jMenuItemProjectAdmin;
- }
-
- /**
- This method initializes jMenuItemProjectChangeWorkspace
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemProjectChangeWorkspace() {
- if (jMenuItemProjectChangeWorkspace == null) {
- jMenuItemProjectChangeWorkspace = new JMenuItem();
- jMenuItemProjectChangeWorkspace.setText("Change WORKSPACE...");
- jMenuItemProjectChangeWorkspace.setMnemonic('W');
- jMenuItemProjectChangeWorkspace.setEnabled(true);
- jMenuItemProjectChangeWorkspace.addActionListener(this);
- }
- return jMenuItemProjectChangeWorkspace;
- }
-
- /**
- This method initializes jMenuProjectBuildPreferences
-
- @return javax.swing.JMenu
-
- **/
- private JMenuItem getJMenuItemToolsBuildPreferences() {
- if (jMenuItemToolsBuildPreferences == null) {
- jMenuItemToolsBuildPreferences = new JMenuItem();
- jMenuItemToolsBuildPreferences.setText("Build Preferences...");
- jMenuItemToolsBuildPreferences.setMnemonic('P');
- jMenuItemToolsBuildPreferences.setEnabled(true);
- jMenuItemToolsBuildPreferences.addActionListener(this);
- }
- return jMenuItemToolsBuildPreferences;
- }
-
- /**
- This method initializes jMenuItemToolsToolChainConfiguration
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemToolsToolChainConfiguration() {
- if (jMenuItemToolsToolChainConfiguration == null) {
- jMenuItemToolsToolChainConfiguration = new JMenuItem();
- jMenuItemToolsToolChainConfiguration.setText("Tool Chain Configuration...");
- jMenuItemToolsToolChainConfiguration.setMnemonic('C');
- jMenuItemToolsToolChainConfiguration.addActionListener(this);
- }
- return jMenuItemToolsToolChainConfiguration;
- }
-
- /**
- This method initializes jMenuItemToolsClone
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemToolsClone() {
- if (jMenuItemToolsClone == null) {
- jMenuItemToolsClone = new JMenuItem();
- jMenuItemToolsClone.setText("Clone...");
- jMenuItemToolsClone.setMnemonic('l');
- jMenuItemToolsClone.setEnabled(true);
- jMenuItemToolsClone.addActionListener(this);
- }
- return jMenuItemToolsClone;
- }
-
- /**
- This method initializes jMenuItemToolsCodeScan
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemToolsCodeScan() {
- if (jMenuItemToolsCodeScan == null) {
- jMenuItemToolsCodeScan = new JMenuItem();
- jMenuItemToolsCodeScan.setText("Code Scan...");
- jMenuItemToolsCodeScan.setMnemonic('S');
- jMenuItemToolsCodeScan.setEnabled(false);
- jMenuItemToolsCodeScan.addActionListener(this);
- jMenuItemToolsCodeScan.setVisible(false);
- }
- return jMenuItemToolsCodeScan;
- }
-
- /**
- This method initializes jMenuItemWindowSplitVertical
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowDisplaySide() {
- if (jMenuItemWindowDisplaySide == null) {
- jMenuItemWindowDisplaySide = new JMenuItem();
- jMenuItemWindowDisplaySide.setText("Display Side by Side");
- jMenuItemWindowDisplaySide.setMnemonic('S');
- jMenuItemWindowDisplaySide.setEnabled(false);
- jMenuItemWindowDisplaySide.addActionListener(this);
- }
- return jMenuItemWindowDisplaySide;
- }
-
- /**
- This method initializes jMenuItemWindowSplitHorizontal
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowDisplayTopBottom() {
- if (jMenuItemWindowDisplayTopBottom == null) {
- jMenuItemWindowDisplayTopBottom = new JMenuItem();
- jMenuItemWindowDisplayTopBottom.setText("Display Top and Bottom");
- jMenuItemWindowDisplayTopBottom.setMnemonic('B');
- jMenuItemWindowDisplayTopBottom.setEnabled(false);
- jMenuItemWindowDisplayTopBottom.addActionListener(this);
- }
- return jMenuItemWindowDisplayTopBottom;
- }
-
- /**
- This method initializes jMenuItemViewXML
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemViewXML() {
- if (jMenuItemViewXML == null) {
- jMenuItemViewXML = new JMenuItem();
- jMenuItemViewXML.setText("XML");
- jMenuItemViewXML.setMnemonic('X');
- jMenuItemViewXML.setEnabled(false);
- jMenuItemViewXML.addActionListener(this);
- }
- return jMenuItemViewXML;
- }
-
- /**
- This method initializes jMenuItemWindowTabView
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowTabView() {
- if (jMenuItemWindowTabView == null) {
- jMenuItemWindowTabView = new JMenuItem();
- jMenuItemWindowTabView.setText("Tab View");
- jMenuItemWindowTabView.setMnemonic('T');
- jMenuItemWindowTabView.setEnabled(false);
- jMenuItemWindowTabView.addActionListener(this);
- }
- return jMenuItemWindowTabView;
- }
-
- /**
- This method initializes jMenuItemWindowSource
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowSource() {
- if (jMenuItemWindowSource == null) {
- jMenuItemWindowSource = new JMenuItem();
- jMenuItemWindowSource.setText("Source");
- jMenuItemWindowSource.setMnemonic('S');
- jMenuItemWindowSource.setEnabled(false);
- jMenuItemWindowSource.addActionListener(this);
- }
- return jMenuItemWindowSource;
- }
-
- /**
- This method initializes jMenuItemWindowXML
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowXML() {
- if (jMenuItemWindowXML == null) {
- jMenuItemWindowXML = new JMenuItem();
- jMenuItemWindowXML.setText("XML");
- jMenuItemWindowXML.setMnemonic('X');
- jMenuItemWindowXML.setEnabled(false);
- jMenuItemWindowXML.addActionListener(this);
- }
- return jMenuItemWindowXML;
- }
-
- /**
- This method initializes jMenuItemWindowPreferences
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemWindowPreferences() {
- if (jMenuItemWindowPreferences == null) {
- jMenuItemWindowPreferences = new JMenuItem();
- jMenuItemWindowPreferences.setText("Preferences");
- jMenuItemWindowPreferences.setMnemonic('P');
- jMenuItemWindowPreferences.setEnabled(false);
- jMenuItemWindowPreferences.addActionListener(this);
- }
- return jMenuItemWindowPreferences;
- }
-
- /**
- This method initializes jMenuItemHelpContents
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemHelpContents() {
- if (jMenuItemHelpContents == null) {
- jMenuItemHelpContents = new JMenuItem();
- jMenuItemHelpContents.setText("Contents");
- jMenuItemHelpContents.setMnemonic('C');
- jMenuItemHelpContents.setEnabled(false);
- jMenuItemHelpContents.addActionListener(this);
- jMenuItemHelpContents.setVisible(false);
- }
- return jMenuItemHelpContents;
- }
-
- /**
- This method initializes jMenuItemHelpIndex
-
- @return javax.swing.JMenuItem
-
- **/
- private JMenuItem getJMenuItemHelpIndex() {
- if (jMenuItemHelpIndex == null) {
- jMenuItemHelpIndex = new JMenuItem();
- jMenuItemHelpIndex.setText("Index");
- jMenuItemHelpIndex.setMnemonic('I');
- jMenuItemHelpIndex.setEnabled(false);
- jMenuItemHelpIndex.addActionListener(this);
- jMenuItemHelpIndex.setVisible(false);
- }
- return jMenuItemHelpIndex;
- }
-
- /**
- This method initializes jMenuItemHelpSearch
-
- @return javax.swing.JMenuItem
-
- */
- private JMenuItem getJMenuItemHelpSearch() {
- if (jMenuItemHelpSearch == null) {
- jMenuItemHelpSearch = new JMenuItem();
- jMenuItemHelpSearch.setText("Search");
- jMenuItemHelpSearch.setMnemonic('S');
- jMenuItemHelpSearch.setEnabled(false);
- jMenuItemHelpSearch.addActionListener(this);
- jMenuItemHelpSearch.setVisible(false);
- }
- return jMenuItemHelpSearch;
- }
-
- /**
- * This method initializes jMenuItemToolsInstallPackage
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemProjectInstallFar() {
- if (jMenuItemProjectInstallFar == null) {
- jMenuItemProjectInstallFar = new JMenuItem();
- jMenuItemProjectInstallFar.setText("Install FAR...");
- jMenuItemProjectInstallFar.setMnemonic('I');
- jMenuItemProjectInstallFar.setEnabled(true);
- jMenuItemProjectInstallFar.addActionListener(this);
- }
- return jMenuItemProjectInstallFar;
- }
-
- /**
- * This method initializes jMenuItemToolsUpdatePackage
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemProjectUpdateFar() {
- if (jMenuItemProjectUpdateFar == null) {
- jMenuItemProjectUpdateFar = new JMenuItem();
- jMenuItemProjectUpdateFar.setText("Update FAR...");
- jMenuItemProjectUpdateFar.setMnemonic('U');
- jMenuItemProjectUpdateFar.setEnabled(true);
- jMenuItemProjectUpdateFar.addActionListener(this);
- jMenuItemProjectUpdateFar.setVisible(true);
- }
- return jMenuItemProjectUpdateFar;
- }
-
- /**
- * This method initializes jMenuItemRemovePackage
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemProjectRemoveFar() {
- if (jMenuItemProjectRemoveFar == null) {
- jMenuItemProjectRemoveFar = new JMenuItem();
- jMenuItemProjectRemoveFar.setText("Remove FAR...");
- jMenuItemProjectRemoveFar.setMnemonic('R');
- jMenuItemProjectRemoveFar.setEnabled(true);
- jMenuItemProjectRemoveFar.addActionListener(this);
- }
- return jMenuItemProjectRemoveFar;
- }
-
- /**
- * This method initializes jMenuItemProjectCreateFar
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemProjectCreateFar() {
- if (jMenuItemProjectCreateFar == null) {
- jMenuItemProjectCreateFar = new JMenuItem();
- jMenuItemProjectCreateFar.setText("Create FAR...");
- jMenuItemProjectCreateFar.setMnemonic('C');
- jMenuItemProjectCreateFar.addActionListener(this);
- }
- return jMenuItemProjectCreateFar;
- }
-
- /**
- * This method initializes jMenuEditFind
- *
- * @return javax.swing.JMenu
- */
- private JMenu getJMenuEditFind() {
- if (jMenuEditFind == null) {
- jMenuEditFind = new JMenu();
- jMenuEditFind.setText("Find");
- jMenuEditFind.setMnemonic('F');
-
- jMenuEditFind.add(getJMenuItemEditFindPpi());
- jMenuEditFind.add(getJMenuItemEditFindProtocol());
- jMenuEditFind.add(getJMenuItemEditFindGuid());
- jMenuEditFind.add(getJMenuItemEditFindPcd());
- jMenuEditFind.add(getJMenuItemEditFindLibraryClass());
- jMenuEditFind.add(getJMenuItemEditFindLibraryInstance());
- }
- return jMenuEditFind;
- }
-
- /**
- * This method initializes jMenuItemEditFindPcd
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindPcd() {
- if (jMenuItemEditFindPcd == null) {
- jMenuItemEditFindPcd = new JMenuItem();
- jMenuItemEditFindPcd.setText("All PCD entries");
- jMenuItemEditFindPcd.setMnemonic('P');
- jMenuItemEditFindPcd.addActionListener(this);
- }
- return jMenuItemEditFindPcd;
- }
-
- /**
- * This method initializes jMenuItemEditFindLibraryClass
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindLibraryClass() {
- if (jMenuItemEditFindLibraryClass == null) {
- jMenuItemEditFindLibraryClass = new JMenuItem();
- jMenuItemEditFindLibraryClass.setText("All Library Classes");
- jMenuItemEditFindLibraryClass.setMnemonic('C');
- jMenuItemEditFindLibraryClass.addActionListener(this);
- }
- return jMenuItemEditFindLibraryClass;
- }
-
- /**
- * This method initializes jMenuItemEditFindPpi
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindPpi() {
- if (jMenuItemEditFindPpi == null) {
- jMenuItemEditFindPpi = new JMenuItem();
- jMenuItemEditFindPpi.setText("All PPIs");
- jMenuItemEditFindPpi.setMnemonic('I');
- jMenuItemEditFindPpi.addActionListener(this);
- }
- return jMenuItemEditFindPpi;
- }
-
- /**
- * This method initializes jMenuItemEditFindProtocol
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindProtocol() {
- if (jMenuItemEditFindProtocol == null) {
- jMenuItemEditFindProtocol = new JMenuItem();
- jMenuItemEditFindProtocol.setText("All Protocols");
- jMenuItemEditFindProtocol.setMnemonic('r');
- jMenuItemEditFindProtocol.addActionListener(this);
- }
- return jMenuItemEditFindProtocol;
- }
-
- /**
- * This method initializes jMenuItemEditFindGuid
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindGuid() {
- if (jMenuItemEditFindGuid == null) {
- jMenuItemEditFindGuid = new JMenuItem();
- jMenuItemEditFindGuid.setText("All GUIDs");
- jMenuItemEditFindGuid.setMnemonic('G');
- jMenuItemEditFindGuid.addActionListener(this);
- }
- return jMenuItemEditFindGuid;
- }
-
- /**
- * This method initializes jMenuItemEditFindLibraryInstance
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemEditFindLibraryInstance() {
- if (jMenuItemEditFindLibraryInstance == null) {
- jMenuItemEditFindLibraryInstance = new JMenuItem();
- jMenuItemEditFindLibraryInstance.setText("All Library Instances");
- jMenuItemEditFindLibraryInstance.setMnemonic('n');
- jMenuItemEditFindLibraryInstance.addActionListener(this);
- jMenuItemEditFindLibraryInstance.setVisible(false);
- }
- return jMenuItemEditFindLibraryInstance;
- }
-
- /**
- * This method initializes jMenuItemProjectGenerateGuidsXref
- *
- * @return javax.swing.JMenuItem
- */
- private JMenuItem getJMenuItemToolsGenerateGuidsXref() {
- if (jMenuItemToolsGenerateGuidsXref == null) {
- jMenuItemToolsGenerateGuidsXref = new JMenuItem();
- jMenuItemToolsGenerateGuidsXref.setText("Generate guids.xref...");
- jMenuItemToolsGenerateGuidsXref.setMnemonic('G');
- jMenuItemToolsGenerateGuidsXref.addActionListener(this);
- }
- return jMenuItemToolsGenerateGuidsXref;
- }
-
- /* (non-Javadoc)
- * @see org.tianocore.packaging.common.ui.IFrame#main(java.lang.String[])
- *
- * Main class, start the GUI
- *
- */
- public static void main(String[] args) {
- //
- // Start Main UI
- //
- FrameworkWizardUI module = FrameworkWizardUI.getInstance(args);
- module.setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public FrameworkWizardUI(String[] args) {
- super();
- init(args);
- }
-
- /**
- This method initializes this
-
-
- **/
- private void init(String[] args) {
- //
- // Set current workspace and check
- // Check if exists WORKSPACE
- //
- Workspace.setCurrentWorkspace(System.getenv("WORKSPACE"));
- this.checkWorkspace();
-
- //
- // Show splash screen
- //
- SplashScreen ss = new SplashScreen();
- ss.setVisible(true);
-
- //
- // Go through args to check if enable log
- //
- for (int index = 0; index < args.length; index++) {
- if (args[index].equals("--log") || args[index].equals("-l")) {
- Log.setSaveLog(true);
- }
- }
-
- //
- // Init Global Data
- //
- GlobalData.init();
-
- //
- // Close splash screen
- //
- ss.dispose();
-
- //
- // Init the frame
- //
- this.setSize(DataType.MAIN_FRAME_PREFERRED_SIZE_WIDTH, DataType.MAIN_FRAME_PREFERRED_SIZE_HEIGHT);
- this.setResizable(true);
- this.setJMenuBar(getjJMenuBar());
- this.setContentPane(getJContentPane());
- this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["
- + Workspace.getCurrentWorkspace() + "]");
- this.setExitType(1);
-
- //
- // max the window
- //
- this.setExtendedState(JFrame.MAXIMIZED_BOTH);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJPanelOperation(), null);
- jContentPane.add(getJSplitPane(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- //
- // Operations of Menu
- //
- if (arg0.getSource() == this.jMenuItemFileNew) {
- this.fileNew();
- }
-
- if (arg0.getSource() == this.jMenuItemFileOpen) {
- this.open();
- }
-
- if (arg0.getSource() == this.jMenuItemFileClose) {
- this.close();
- }
-
- if (arg0.getSource() == this.jMenuItemFileCloseAll) {
- this.closeAll();
- this.refresh();
- this.makeEmptyTree();
- }
-
- if (arg0.getSource() == this.jMenuItemFileSave) {
- this.save();
- }
-
- if (arg0.getSource() == this.jMenuItemFileSaveAs) {
- this.saveAs();
- }
-
- if (arg0.getSource() == this.jMenuItemFileSaveAll) {
- this.saveAll();
- }
-
- if (arg0.getSource() == this.jMenuItemFileRefresh) {
- if (this.closeAll() == 0) {
- this.refresh();
- this.makeEmptyTree();
- }
- }
-
- if (arg0.getSource() == this.jMenuItemFileExit) {
- this.exit();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindPpi) {
- this.findPpi();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindProtocol) {
- this.findProtocol();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindGuid) {
- this.findGuid();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindPcd) {
- this.findPcd();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindLibraryClass) {
- this.findLibraryClass();
- }
-
- if (arg0.getSource() == this.jMenuItemEditFindLibraryInstance) {
- this.findLibraryInstance();
- }
-
- if (arg0.getSource() == jMenuItemToolsBuildPreferences) {
- configBuildPreferences();
- }
-
- if (arg0.getSource() == this.jMenuItemProjectChangeWorkspace) {
- this.changeWorkspace();
- }
-
- if (arg0.getSource() == this.jMenuItemProjectCreateFar) {
- this.createFar();
- }
-
- if (arg0.getSource() == this.jMenuItemProjectInstallFar) {
- this.installFar();
- }
-
- if (arg0.getSource() == this.jMenuItemProjectRemoveFar) {
- this.removeFar();
- }
-
- if (arg0.getSource() == this.jMenuItemProjectUpdateFar) {
- this.updateFar();
- }
-
- if (arg0.getSource() == this.jMenuItemToolsClone) {
- this.cloneItem();
- }
-
- if (arg0.getSource() == this.jMenuItemToolsToolChainConfiguration) {
- this.setupToolChainConfiguration();
- }
-
- if (arg0.getSource() == this.jMenuItemToolsGenerateGuidsXref) {
- this.generateGuidsXref();
- }
-
- if (arg0.getSource() == this.jMenuItemHelpAbout) {
- About a = new About(this, true);
- int result = a.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- a.dispose();
- }
- }
- }
-
- /**
- Create an empty tree if no file is open
-
- **/
- private void makeEmptyTree() {
- //
- // Make root
- //
- dmtnRoot = new IDefaultMutableTreeNode("WORKSPACE", IDefaultMutableTreeNode.WORKSPACE, false, null, null);
-
- //
- // Make Module Description
- //
- dmtnModuleDescription = new IDefaultMutableTreeNode("Modules", IDefaultMutableTreeNode.MODULE_DESCRIPTION,
- false, null, dmtnRoot);
-
- //
- // First add package
- //
- if (GlobalData.vPackageList.size() > 0) {
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- IDefaultMutableTreeNode dmtnModulePackage = null;
- IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
- IDefaultMutableTreeNode dmtnModulePackageModule = null;
-
- dmtnModulePackage = new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index).getName(),
- IDefaultMutableTreeNode.MODULE_PACKAGE, false,
- GlobalData.vPackageList.elementAt(index),
- this.dmtnModuleDescription);
- dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY,
- false, GlobalData.vPackageList.elementAt(index),
- this.dmtnModuleDescription);
- dmtnModulePackageModule = new IDefaultMutableTreeNode("Module",
- IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, GlobalData.vPackageList.elementAt(index),
- this.dmtnModuleDescription);
- //
- // And then add each module in its package
- //
- Vector<ModuleIdentification> vModule = wt.getAllModules(GlobalData.vPackageList.elementAt(index));
- for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
- if (vModule.get(indexJ).isLibrary()) {
- dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ),
- this.dmtnModuleDescription));
- } else {
- dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ),
- this.dmtnModuleDescription));
- }
- }
- if (dmtnModulePackageModule.getChildCount() > 0) {
- dmtnModulePackage.add(dmtnModulePackageModule);
- }
- if (dmtnModulePackageLibrary.getChildCount() > 0) {
- dmtnModulePackage.add(dmtnModulePackageLibrary);
- }
-
- dmtnModuleDescription.add(dmtnModulePackage);
- }
- }
-
- //
- // Make Package Description
- //
- dmtnPackageDescription = new IDefaultMutableTreeNode("Packages", IDefaultMutableTreeNode.PACKAGE_DESCRIPTION,
- false, null, this.dmtnRoot);
- if (GlobalData.vPackageList.size() > 0) {
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- dmtnPackageDescription.add(new IDefaultMutableTreeNode(GlobalData.vPackageList.elementAt(index)
- .getName(),
- IDefaultMutableTreeNode.PACKAGE, false,
- GlobalData.vPackageList.elementAt(index),
- this.dmtnPackageDescription));
- }
- }
-
- //
- // Make Platform Description
- //
- dmtnPlatformDescription = new IDefaultMutableTreeNode("Platforms",
- IDefaultMutableTreeNode.PLATFORM_DESCRIPTION, false,
- null, this.dmtnRoot);
- if (GlobalData.vPlatformList.size() > 0) {
- for (int index = 0; index < GlobalData.vPlatformList.size(); index++) {
- dmtnPlatformDescription.add(new IDefaultMutableTreeNode(GlobalData.vPlatformList.elementAt(index)
- .getName(),
- IDefaultMutableTreeNode.PLATFORM, false,
- GlobalData.vPlatformList.elementAt(index),
- this.dmtnPlatformDescription));
- }
- }
-
- //
- // Add sub nodes to root node
- //
- dmtnRoot.add(dmtnModuleDescription);
- dmtnRoot.add(dmtnPackageDescription);
- dmtnRoot.add(dmtnPlatformDescription);
- iTree = new ITree(dmtnRoot);
- iTree.addMouseListener(this);
- iTree.addKeyListener(this);
- jScrollPaneTree.setViewportView(iTree);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to popup warning message to confirm quit
- *
- */
- public void windowClosing(WindowEvent arg0) {
- this.exit();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- * Override mouseClicked to check if need display popup menu
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- //
- // When double click
- //
- if (arg0.getClickCount() == 2) {
- doubleClickModuleTreeNode();
- }
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- /**
- Remove all Internal Frame of Module Desktop Pane
-
- **/
- private void cleanDesktopPaneModule() {
- if (jDesktopPaneModule != null) {
- JInternalFrame[] iif = this.jDesktopPaneModule.getAllFrames();
- for (int index = 0; index < iif.length; index++) {
- iif[index].dispose();
- }
- }
- }
-
- /**
- Remove all Internal Frame of package Desktop Pane
-
- **/
- private void cleanDesktopPanePackage() {
- if (jDesktopPanePlatform != null) {
- JInternalFrame[] iif = this.jDesktopPanePackage.getAllFrames();
- for (int index = 0; index < iif.length; index++) {
- iif[index].dispose();
- }
- }
- }
-
- /**
- Remove all Internal Frame of platform Desktop Pane
-
- **/
- private void cleanDesktopPanePlatform() {
- if (jDesktopPanePlatform != null) {
- JInternalFrame[] iif = this.jDesktopPanePlatform.getAllFrames();
- for (int index = 0; index < iif.length; index++) {
- iif[index].dispose();
- }
- }
- }
-
- /**
- Remove all Internal Frame of all Desktop Panes
-
- **/
- private void cleanDesktopPane() {
- cleanDesktopPaneModule();
- cleanDesktopPanePackage();
- cleanDesktopPanePlatform();
- }
-
- /**
- Set file filter as input ext
-
- @param ext
- @return
-
- **/
- private int getNewFilePath(String ext) {
- JFileChooser fc = new JFileChooser(Workspace.getCurrentWorkspace());
- fc.setAcceptAllFileFilterUsed(false);
- fc.addChoosableFileFilter(new IFileFilter(ext));
- return fc.showSaveDialog(new JPanel());
- }
-
- /**
- Add a module to tree
-
- @param mid The module node to be added
-
- **/
- private void addModuleToTree(ModuleIdentification mid) {
- //
- // Add new MsaHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(mid.getName(), IDefaultMutableTreeNode.MODULE,
- false, mid, this.dmtnModuleDescription);
- //
- // First find the module belongs to which package
- //
- IDefaultMutableTreeNode packageNode = iTree.getNodeById(dmtnModuleDescription, mid.getPackageId(),
- IDefaultMutableTreeNode.MODULE_PACKAGE);
- //
- // To check if has module node or library node
- //
- IDefaultMutableTreeNode parentModuleNode = null;
- IDefaultMutableTreeNode parentLibraryNode = null;
- boolean hasModule = false;
- boolean hasLibrary = false;
- for (int index = 0; index < packageNode.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) packageNode.getChildAt(index);
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY) {
- hasLibrary = true;
- parentLibraryNode = iNode;
- }
- if (iNode.getCategory() == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
- hasModule = true;
- parentModuleNode = iNode;
- }
- }
-
- //
- // If is a module
- //
- if (!mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasModule) {
- parentModuleNode = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, mid.getPackageId(), this.dmtnModuleDescription);
- iTree.addNode(packageNode, parentModuleNode);
- }
-
- iTree.addNode(parentModuleNode, node);
- }
-
- //
- // If is a Library
- //
- if (mid.isLibrary()) {
- //
- // Create parent node first if has no parent node
- //
- if (!hasLibrary) {
- parentLibraryNode = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
- mid.getPackageId(), this.dmtnModuleDescription);
- iTree.addNode(packageNode, parentLibraryNode);
- }
-
- iTree.addNode(parentLibraryNode, node);
- }
- }
-
- /**
- Open Module
-
- @param path input file path
-
- **/
- private void openModule(String path, IDefaultMutableTreeNode belongNode) {
- ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(path);
- if (id == null) {
- //
- // The module is not in existing packages
- //
- Log.wrn("Open Module", "The module does not belong to any package in the current workspace!");
- return;
- }
-
- //
- // Make the node selected
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(belongNode, id, IDefaultMutableTreeNode.MODULE)));
-
- //
- // Update opening Module list information
- //
- if (!iTree.getSelectNode().isOpening()) {
- //
- // Insert sub node of module
- //
- insertModuleTreeNode(id, belongNode);
- iTree.getSelectNode().setOpening(true);
-
- //
- // Update opening module list
- //
- GlobalData.openingModuleList.setModuleOpen(id, true);
- Set<TreePath> temp = GlobalData.openingModuleList.getTreePathById(id);
- temp.add(iTree.getSelectionPath());
- GlobalData.openingModuleList.setTreePathById(id, temp);
- }
- //
- // Select msa header node and show it in editor panel
- //
- iTree
- .setSelectionPath(iTree
- .getPathOfNode(iTree
- .getNodeById(belongNode, id, IDefaultMutableTreeNode.MSA_HEADER)));
- showModuleElement(IDefaultMutableTreeNode.MSA_HEADER, GlobalData.openingModuleList.getOpeningModuleById(id));
- this.currentOpeningModuleIndex = GlobalData.openingModuleList.findIndexOfListById(id);
- }
-
- /**
- Open Package
-
- @param path input file path
-
- **/
- private void openPackage(String path) {
- PackageIdentification id = GlobalData.openingPackageList.getIdByPath(path);
- if (id == null) {
- //
- // The package is not in current workspace
- //
- Log.wrn("Open Package", "The package has not been installed in the current workspace!");
- return;
- }
-
- //
- // Make the node selected
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,
- IDefaultMutableTreeNode.PACKAGE)));
- //
- // Update opening package list information
- //
- if (!GlobalData.openingPackageList.getPackageOpen(id)) {
- //
- // Insert sub node of module
- //
- insertPackageTreeNode(id);
- iTree.getSelectNode().setOpening(true);
-
- //
- // Update opening module list
- //
- GlobalData.openingPackageList.setPackageOpen(id, true);
- Set<TreePath> temp = GlobalData.openingPackageList.getTreePathById(id);
- temp.add(iTree.getSelectionPath());
- GlobalData.openingPackageList.setTreePathById(id, temp);
- }
- //
- // Show spd header in editor panel
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPackageDescription, id,
- IDefaultMutableTreeNode.SPD_HEADER)));
- showPackageElement(IDefaultMutableTreeNode.SPD_HEADER, GlobalData.openingPackageList.getOpeningPackageById(id));
- this.currentOpeningPackageIndex = GlobalData.openingPackageList.findIndexOfListById(id);
- }
-
- /**
- Open Package
-
- @param path input file path
-
- **/
- private void openPlatform(String path) {
- PlatformIdentification id = GlobalData.openingPlatformList.getIdByPath(path);
- if (id == null) {
- //
- // The platform is not in current workspace
- //
- Log.wrn("Open Platform", "The platform has not been installed in the current workspace!");
- return;
- }
-
- //
- // Make the node selected
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,
- IDefaultMutableTreeNode.PLATFORM)));
- //
- // Update opening package list information
- //
- if (!GlobalData.openingPlatformList.getPlatformOpen(id)) {
- //
- // Insert sub node of module
- //
- insertPlatformTreeNode(id);
- iTree.getSelectNode().setOpening(true);
-
- //
- // Update opening module list
- //
- GlobalData.openingPlatformList.setPlatformOpen(id, true);
- Set<TreePath> temp = GlobalData.openingPlatformList.getTreePathById(id);
- temp.add(iTree.getSelectionPath());
- GlobalData.openingPlatformList.setTreePathById(id, temp);
- }
- //
- // Show fpd header in editor panel
- //
- iTree.setSelectionPath(iTree.getPathOfNode(iTree.getNodeById(this.dmtnPlatformDescription, id,
- IDefaultMutableTreeNode.FPD_PLATFORMHEADER)));
- showPlatformElement(IDefaultMutableTreeNode.FPD_PLATFORMHEADER,
- GlobalData.openingPlatformList.getOpeningPlatformById(id));
- this.currentOpeningPlatformIndex = GlobalData.openingPlatformList.findIndexOfListById(id);
- }
-
- /**
- Save module
-
- **/
- private void saveModule(int index) {
- OpeningModuleType omt = GlobalData.openingModuleList.getOpeningModuleByIndex(index);
- if (omt.isNew()) {
- if (getNewFilePath(DataType.MODULE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {
- return;
- }
- }
- try {
- SaveFile.saveMsaFile(omt.getId().getPath(), omt.getXmlMsa());
- GlobalData.openingModuleList.setNew(omt.getId(), false);
- GlobalData.openingModuleList.setModuleSaved(omt.getId(), true);
- } catch (Exception e) {
- Log.wrn("Save Module", e.getMessage());
- Log.err("Save Module", e.getMessage());
- }
- }
-
- /**
- Save package
-
- **/
- private void savePackage(int index) {
- OpeningPackageType opt = GlobalData.openingPackageList.getOpeningPackageByIndex(index);
- if (opt.isNew()) {
- if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {
- return;
- }
- }
- try {
- SaveFile.saveSpdFile(opt.getId().getPath(), opt.getXmlSpd());
- GlobalData.openingPackageList.setNew(opt.getId(), false);
- GlobalData.openingPackageList.setPackageSaved(opt.getId(), true);
- } catch (Exception e) {
- Log.wrn("Save Package", e.getMessage());
- Log.err("Save Package", e.getMessage());
- }
- }
-
- /**
- Save platform
-
- **/
- private void savePlatform(int index) {
- OpeningPlatformType opt = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index);
- if (opt.isNew()) {
- if (getNewFilePath(DataType.PACKAGE_SURFACE_AREA_EXT) != JFileChooser.APPROVE_OPTION) {
- return;
- }
- }
- try {
- SaveFile.saveFpdFile(opt.getId().getPath(), opt.getXmlFpd());
- GlobalData.openingPlatformList.setNew(opt.getId(), false);
- GlobalData.openingPlatformList.setPlatformSaved(opt.getId(), true);
- } catch (Exception e) {
- Log.wrn("Save Package", e.getMessage());
- Log.err("Save Package", e.getMessage());
- }
- }
-
- public void componentResized(ComponentEvent arg0) {
- if (this.jSplitPane != null) {
- this.jSplitPane.setSize(this.getWidth() - DataType.MAIN_FRAME_WIDTH_SPACING,
- this.getHeight() - DataType.MAIN_FRAME_HEIGHT_SPACING);
- this.jSplitPane.validate();
- resizeDesktopPanel();
- }
- }
-
- /**
- Resize JDesktopPanel
-
- */
- private void resizeDesktopPanel() {
- resizeDesktopPanel(this.jDesktopPaneModule);
- resizeDesktopPanel(this.jDesktopPanePackage);
- resizeDesktopPanel(this.jDesktopPanePlatform);
- }
-
- /**
- Resize JDesktopPanel
-
- */
- private void resizeDesktopPanel(JDesktopPane jdk) {
- JInternalFrame[] iif = jdk.getAllFrames();
- for (int index = 0; index < iif.length; index++) {
- iif[index].setSize(jdk.getWidth(), jdk.getHeight());
- }
- }
-
- private void insertModuleTreeNode(Identification id, IDefaultMutableTreeNode belongNode) {
- iTree.addNode(new IDefaultMutableTreeNode("Module Header", IDefaultMutableTreeNode.MSA_HEADER, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Source Files", IDefaultMutableTreeNode.MSA_SOURCEFILES, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Library Class Definitions",
- IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS, true, id,
- belongNode));
- iTree
- .addNode(new IDefaultMutableTreeNode("Package Dependencies",
- IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Protocols", IDefaultMutableTreeNode.MSA_PROTOCOLS, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Events", IDefaultMutableTreeNode.MSA_EVENTS, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Hobs", IDefaultMutableTreeNode.MSA_HOBS, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Ppis", IDefaultMutableTreeNode.MSA_PPIS, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Variables", IDefaultMutableTreeNode.MSA_VARIABLES, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Boot Modes", IDefaultMutableTreeNode.MSA_BOOTMODES, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("System Tables", IDefaultMutableTreeNode.MSA_SYSTEMTABLES, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Data Hubs", IDefaultMutableTreeNode.MSA_DATAHUBS, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Hii Packages", IDefaultMutableTreeNode.MSA_HIIPACKAGES, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Guids", IDefaultMutableTreeNode.MSA_GUIDS, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("External Defintions", IDefaultMutableTreeNode.MSA_EXTERNS, true, id,
- belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Pcd Coded", IDefaultMutableTreeNode.MSA_PCDS, true, id, belongNode));
- iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.MSA_BUILDOPTIONS, true, id, belongNode));
- }
-
- private void insertPackageTreeNode(Identification id) {
- IDefaultMutableTreeNode idmtTemp = this.dmtnPackageDescription;
- iTree.addNode(new IDefaultMutableTreeNode("Package Header", IDefaultMutableTreeNode.SPD_HEADER, true, id,
- idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Library Class Declarations",
- IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS, true, id,
- idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Msa Files", IDefaultMutableTreeNode.SPD_MSAFILES, false, id,
- idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Package Includes", IDefaultMutableTreeNode.SPD_PACKAGEHEADERS, true,
- id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Guid Declarations", IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS,
- true, id, idmtTemp));
- iTree
- .addNode(new IDefaultMutableTreeNode("Protocol Declarations",
- IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS, true, id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Ppi Declarations", IDefaultMutableTreeNode.SPD_PPIDECLARATIONS,
- true, id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Pcd Declarations", IDefaultMutableTreeNode.SPD_PCDDECLARATIONS,
- true, id, idmtTemp));
- //
- // Add modules in this package
- //
- IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
- IDefaultMutableTreeNode dmtnModulePackageModule = null;
-
- dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
- id, idmtTemp);
- dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, id, idmtTemp);
-
- Vector<ModuleIdentification> vModule = wt.getAllModules(new PackageIdentification(id));
- for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
- if (vModule.get(indexJ).isLibrary()) {
- dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ), idmtTemp));
- } else {
- dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ), idmtTemp));
- }
- }
- if (dmtnModulePackageModule.getChildCount() > 0) {
- iTree.addNode(dmtnModulePackageModule);
- }
- if (dmtnModulePackageLibrary.getChildCount() > 0) {
- iTree.addNode(dmtnModulePackageLibrary);
- }
- }
-
- private void insertPlatformTreeNode(Identification id) {
- IDefaultMutableTreeNode idmtTemp = this.dmtnPlatformDescription;
- iTree.addNode(new IDefaultMutableTreeNode("Platform Header", IDefaultMutableTreeNode.FPD_PLATFORMHEADER, true,
- id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Platform Definitions",
- IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS, true, id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Flash Information", IDefaultMutableTreeNode.FPD_FLASH, true, id,
- idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Framework Modules", IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES,
- true, id, idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Dynamic PCD Build Declarations",
- IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS, true, id,
- idmtTemp));
- iTree.addNode(new IDefaultMutableTreeNode("Build Options", IDefaultMutableTreeNode.FPD_BUILDOPTIONS, true, id,
- idmtTemp));
-
- //
- // Add modules in this platform
- //
- IDefaultMutableTreeNode dmtnModulePackageLibrary = null;
- IDefaultMutableTreeNode dmtnModulePackageModule = null;
-
- dmtnModulePackageLibrary = new IDefaultMutableTreeNode("Library",
- IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY, false,
- id, idmtTemp);
- dmtnModulePackageModule = new IDefaultMutableTreeNode("Module", IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE,
- false, id, idmtTemp);
-
- Vector<ModuleIdentification> vModule = wt.getAllModules(new PlatformIdentification(id));
- for (int indexJ = 0; indexJ < vModule.size(); indexJ++) {
- if (vModule.get(indexJ).isLibrary()) {
- dmtnModulePackageLibrary.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ), idmtTemp));
- } else {
- dmtnModulePackageModule.add(new IDefaultMutableTreeNode(vModule.get(indexJ).getName(),
- IDefaultMutableTreeNode.MODULE, false,
- vModule.get(indexJ), idmtTemp));
- }
- }
- if (dmtnModulePackageModule.getChildCount() > 0) {
- iTree.addNode(dmtnModulePackageModule);
- }
- if (dmtnModulePackageLibrary.getChildCount() > 0) {
- iTree.addNode(dmtnModulePackageLibrary);
- }
- }
-
- /**
- Operate when double click a tree node
-
- **/
- private void doubleClickModuleTreeNode() {
- Identification id = null;
- int intCategory = -1;
- String path = null;
- IDefaultMutableTreeNode belongNode = null;
-
- try {
- //
- // Get selected tree node
- //
- if (iTree.getSelectNode() != null) {
- id = iTree.getSelectNode().getId();
- }
-
- //
- // If id is null, return directly
- //
- if (id == null) {
- return;
- }
-
- intCategory = iTree.getSelectCategory();
- belongNode = iTree.getSelectNode().getBelongNode();
-
- //
- // If the node is not opened yet
- // Insert top level elements first
- //
- if (intCategory == IDefaultMutableTreeNode.MODULE) {
- path = iTree.getSelectNode().getId().getPath();
- openModule(path, belongNode);
- return;
- }
- if (intCategory == IDefaultMutableTreeNode.PACKAGE) {
- path = iTree.getSelectNode().getId().getPath();
- openPackage(path);
- return;
- }
- if (intCategory == IDefaultMutableTreeNode.PLATFORM) {
- path = iTree.getSelectNode().getId().getPath();
- openPlatform(path);
- return;
- }
-
- //
- // Show editor panel
- //
- if (intCategory >= IDefaultMutableTreeNode.MSA_HEADER && intCategory < IDefaultMutableTreeNode.SPD_HEADER) {
- showModuleElement(intCategory,
- GlobalData.openingModuleList.getOpeningModuleById(new ModuleIdentification(id)));
- this.currentOpeningModuleIndex = GlobalData.openingModuleList
- .findIndexOfListById(new ModuleIdentification(
- id));
- }
- if (intCategory >= IDefaultMutableTreeNode.SPD_HEADER
- && intCategory < IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
- showPackageElement(intCategory,
- GlobalData.openingPackageList.getOpeningPackageById(new PackageIdentification(id)));
- this.currentOpeningPackageIndex = GlobalData.openingPackageList
- .findIndexOfListById(new PackageIdentification(
- id));
- }
- if (intCategory >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER) {
- showPlatformElement(
- intCategory,
- GlobalData.openingPlatformList
- .getOpeningPlatformById(new PlatformIdentification(id)));
- this.currentOpeningPlatformIndex = GlobalData.openingPlatformList
- .findIndexOfListById(new PlatformIdentification(
- id));
- }
- } catch (Exception e) {
- Log.err("double click category: " + intCategory);
- Log.err("double click belong node: " + belongNode.toString());
- Log.err("double click id path: " + id);
- Log.err("double click exception: " + e.getMessage());
- }
- }
-
- /**
- Show content of editor panel via selected element
-
- @param elementType
- @param fpd
-
- **/
- private void showPlatformElement(int elementType, OpeningPlatformType fpd) {
- this.cleanDesktopPanePlatform();
-
- switch (elementType) {
- case IDefaultMutableTreeNode.FPD_PLATFORMDEFINITIONS:
- FpdPlatformDefs frmFpdPlatformDefs = new FpdPlatformDefs(fpd);
- getJDesktopPanePlatform().add(frmFpdPlatformDefs, 1);
- break;
- case IDefaultMutableTreeNode.FPD_PLATFORMHEADER:
- FpdHeader frmFpdHeader = new FpdHeader(fpd);
- getJDesktopPanePlatform().add(frmFpdHeader, 1);
- break;
- case IDefaultMutableTreeNode.FPD_FLASH:
- FpdFlash frmFpdFlash = new FpdFlash(fpd);
- getJDesktopPanePlatform().add(frmFpdFlash, 1);
- break;
- case IDefaultMutableTreeNode.FPD_FRAMEWORKMODULES:
- FpdFrameworkModules frmFpdFrameworkModules = new FpdFrameworkModules(fpd);
- getJDesktopPanePlatform().add(frmFpdFrameworkModules, 1);
- break;
- case IDefaultMutableTreeNode.FPD_PCDDYNAMICBUILDDECLARATIONS:
- FpdDynamicPcdBuildDefinitions frmFpdDynamicPcdBuildDefinitions = new FpdDynamicPcdBuildDefinitions(fpd);
- getJDesktopPanePlatform().add(frmFpdDynamicPcdBuildDefinitions, 1);
- break;
- case IDefaultMutableTreeNode.FPD_BUILDOPTIONS:
- FpdBuildOptions frmFpdBuildOptions = new FpdBuildOptions(fpd);
- getJDesktopPanePlatform().add(frmFpdBuildOptions, 1);
- break;
- }
- this.jTabbedPaneEditor.setSelectedIndex(2);
- resizeDesktopPanel();
- }
-
- /**
- Show content of editor panel via selected element
-
- @param elementType
- @param spd
-
- */
- private void showPackageElement(int elementType, OpeningPackageType spd) {
- this.cleanDesktopPanePackage();
- Tools.dirForNewSpd = spd.getId().getPath();
- switch (elementType) {
- case IDefaultMutableTreeNode.SPD_HEADER:
- SpdHeader frmSpdHeader = new SpdHeader(spd);
- getJDesktopPanePackage().add(frmSpdHeader, 1);
- break;
- case IDefaultMutableTreeNode.SPD_LIBRARYCLASSDECLARATIONS:
- SpdLibClassDecls frmSlcd = new SpdLibClassDecls(spd, this);
- getJDesktopPanePackage().add(frmSlcd, 1);
- break;
- case IDefaultMutableTreeNode.SPD_MSAFILES:
- SpdMsaFiles frmSmf = new SpdMsaFiles(spd, this);
- getJDesktopPanePackage().add(frmSmf, 1);
- break;
- case IDefaultMutableTreeNode.SPD_PACKAGEHEADERS:
- SpdPackageHeaders frmSph = new SpdPackageHeaders(spd, this);
- getJDesktopPanePackage().add(frmSph, 1);
- break;
- case IDefaultMutableTreeNode.SPD_GUIDDECLARATIONS:
- SpdGuidDecls frmSgd = new SpdGuidDecls(spd, this);
- getJDesktopPanePackage().add(frmSgd, 1);
- break;
- case IDefaultMutableTreeNode.SPD_PROTOCOLDECLARATIONS:
- SpdProtocolDecls frmSprod = new SpdProtocolDecls(spd, this);
- getJDesktopPanePackage().add(frmSprod, 1);
- break;
- case IDefaultMutableTreeNode.SPD_PPIDECLARATIONS:
- SpdPpiDecls frmSppid = new SpdPpiDecls(spd, this);
- getJDesktopPanePackage().add(frmSppid, 1);
- break;
- case IDefaultMutableTreeNode.SPD_PCDDECLARATIONS:
- SpdPcdDefs frmSpcdd = new SpdPcdDefs(spd, this);
- getJDesktopPanePackage().add(frmSpcdd, 1);
- break;
- }
- this.jTabbedPaneEditor.setSelectedIndex(1);
- resizeDesktopPanel();
- }
-
- /**
- Show content of editor panel via selected element
-
- @param elementType
- @param msa
-
- */
- private void showModuleElement(int elementType, OpeningModuleType msa) {
- this.cleanDesktopPaneModule();
- switch (elementType) {
- case IDefaultMutableTreeNode.MSA_HEADER:
- MsaHeader frmMsaHeader = new MsaHeader(msa);
- getJDesktopPaneModule().add(frmMsaHeader, 1);
- break;
- case IDefaultMutableTreeNode.MSA_LIBRARYCLASSDEFINITIONS:
- ModuleLibraryClassDefinitions frmMlcd = new ModuleLibraryClassDefinitions(msa, this);
- getJDesktopPaneModule().add(frmMlcd, 1);
- break;
- case IDefaultMutableTreeNode.MSA_PACKAGEDEPENDENCIES:
- ModulePackageDependencies frmMpd = new ModulePackageDependencies(msa, this);
- getJDesktopPaneModule().add(frmMpd, 1);
- break;
- case IDefaultMutableTreeNode.MSA_SOURCEFILES:
- ModuleSourceFiles frmMsf = new ModuleSourceFiles(msa, this);
- getJDesktopPaneModule().add(frmMsf, 1);
- break;
- case IDefaultMutableTreeNode.MSA_PROTOCOLS:
- ModuleProtocols frmMp = new ModuleProtocols(msa, this);
- getJDesktopPaneModule().add(frmMp, 1);
- break;
- case IDefaultMutableTreeNode.MSA_EVENTS:
- ModuleEvents frmMe = new ModuleEvents(msa, this);
- getJDesktopPaneModule().add(frmMe, 1);
- break;
- case IDefaultMutableTreeNode.MSA_HOBS:
- ModuleHobs frmMh = new ModuleHobs(msa, this);
- getJDesktopPaneModule().add(frmMh, 1);
- break;
- case IDefaultMutableTreeNode.MSA_PPIS:
- ModulePpis frmMpp = new ModulePpis(msa, this);
- getJDesktopPaneModule().add(frmMpp, 1);
- break;
- case IDefaultMutableTreeNode.MSA_VARIABLES:
- ModuleVariables frmMv = new ModuleVariables(msa, this);
- getJDesktopPaneModule().add(frmMv, 1);
- break;
- case IDefaultMutableTreeNode.MSA_BOOTMODES:
- ModuleBootModes frmMbm = new ModuleBootModes(msa, this);
- getJDesktopPaneModule().add(frmMbm, 1);
- break;
- case IDefaultMutableTreeNode.MSA_SYSTEMTABLES:
- ModuleSystemTables frmMst = new ModuleSystemTables(msa, this);
- getJDesktopPaneModule().add(frmMst, 1);
- break;
- case IDefaultMutableTreeNode.MSA_DATAHUBS:
- ModuleDataHubs frmMdh = new ModuleDataHubs(msa, this);
- getJDesktopPaneModule().add(frmMdh, 1);
- break;
- case IDefaultMutableTreeNode.MSA_HIIPACKAGES:
- ModuleHiiPackages frmMf = new ModuleHiiPackages(msa, this);
- getJDesktopPaneModule().add(frmMf, 1);
- break;
- case IDefaultMutableTreeNode.MSA_GUIDS:
- ModuleGuids frmGuid = new ModuleGuids(msa, this);
- getJDesktopPaneModule().add(frmGuid, 1);
- break;
- case IDefaultMutableTreeNode.MSA_EXTERNS:
- ModuleExterns frmMex = new ModuleExterns(msa, this);
- getJDesktopPaneModule().add(frmMex, 1);
- break;
- case IDefaultMutableTreeNode.MSA_PCDS:
- ModulePCDs frmPcd = new ModulePCDs(msa, this);
- getJDesktopPaneModule().add(frmPcd, 1);
- break;
- case IDefaultMutableTreeNode.MSA_BUILDOPTIONS:
- ModuleBuildOptions frmMbo = new ModuleBuildOptions(msa, this);
- getJDesktopPaneModule().add(frmMbo, 1);
- break;
- }
- this.jTabbedPaneEditor.setSelectedIndex(0);
- resizeDesktopPanel();
- }
-
- //
- // Define operations of menu
- //
- /**
- New a file
-
- **/
- private void fileNew() {
- int result = -1;
- //
- // Selece new file type
- //
- NewFileChooser nfc = new NewFileChooser(this, true);
- result = nfc.showDialog();
-
- if (result == DataType.RETURN_TYPE_CANCEL) {
- nfc.dispose();
- return;
- } else if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- //
- // To new a module
- //
- SelectModuleBelong smb = new SelectModuleBelong(this, true, result);
- result = smb.showDialog();
-
- if (result == DataType.RETURN_TYPE_CANCEL) {
- nfc.dispose();
- smb.dispose();
- return;
- } else if (result == DataType.RETURN_TYPE_OK) {
- ModuleIdentification mid = smb.getMid();
- if (mid != null) {
- //
- // Update package of workspace first
- //
- PackageSurfaceAreaDocument.PackageSurfaceArea psa = null;
- if (GlobalData.openingPackageList.existsPackage(mid.getPackageId())) {
- psa = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(mid.getPackageId());
- }
- try {
- wt.addModuleToPackage(mid, psa);
- } catch (IOException e) {
- Log.wrn("Update MsaFiles in Package", e.getMessage());
- Log.err("Update MsaFiles in Package", e.getMessage());
- return;
- } catch (XmlException e) {
- Log.wrn("Update MsaFiles in Package", e.getMessage());
- Log.err("Update MsaFiles in Package", e.getMessage());
- return;
- } catch (Exception e) {
- Log.wrn("Update MsaFiles in Package", e.getMessage());
- Log.err("Update MsaFiles in Package", e.getMessage());
- return;
- }
-
- //
- // Update Global Data
- //
- GlobalData.openingModuleList.insertToOpeningModuleList(mid, smb.getMsa());
- GlobalData.vModuleList.addElement(mid);
-
- //
- // Create new node on the tree
- //
- addModuleToTree(mid);
-
- //
- // Open the node
- //
- this.openModule(mid.getPath(), this.dmtnModuleDescription);
- }
- }
- } else if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- //
- // To new a package
- //
- SelectModuleBelong smb = new SelectModuleBelong(this, true, result);
- result = smb.showDialog();
-
- if (result == DataType.RETURN_TYPE_CANCEL) {
- nfc.dispose();
- smb.dispose();
- return;
- } else if (result == DataType.RETURN_TYPE_OK) {
- PackageIdentification pid = smb.getPid();
- if (pid != null) {
- try {
- wt.addPackageToDatabase(smb.getPid());
- } catch (Exception e) {
- Log.err("addPackageToDatabase", e.getMessage());
- }
-
- //
- // Update Global Data
- //
- GlobalData.openingPackageList.insertToOpeningPackageList(pid, smb.getSpd());
- GlobalData.vPackageList.addElement(pid);
-
- //
- // Add to Module Description node
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(pid.getName(),
- IDefaultMutableTreeNode.MODULE_PACKAGE,
- false, pid, this.dmtnModuleDescription);
-
- iTree.addNode(dmtnModuleDescription, node);
-
- //
- // Add new SpdHeader node to the tree
- //
- node = new IDefaultMutableTreeNode(pid.getName(), IDefaultMutableTreeNode.PACKAGE, true, pid,
- this.dmtnPackageDescription);
- iTree.addNode(dmtnPackageDescription, node);
-
- this.openPackage(pid.getPath());
- }
- }
- } else if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- //
- // To new a platform
- //
- SelectModuleBelong smb = new SelectModuleBelong(this, true, result);
- result = smb.showDialog();
-
- if (result == DataType.RETURN_TYPE_CANCEL) {
- nfc.dispose();
- smb.dispose();
- return;
- } else if (result == DataType.RETURN_TYPE_OK) {
- PlatformIdentification fid = smb.getFid();
- if (fid != null) {
- try {
- wt.addPlatformToDatabase(fid);
- } catch (Exception e) {
- Log.err("addPlatformToDatabase", e.getMessage());
- }
-
- //
- // Update global data
- //
- GlobalData.openingPlatformList.insertToOpeningPlatformList(fid, smb.getFpd());
- GlobalData.vPlatformList.addElement(fid);
- //
- // Add new SpdHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(fid.getName(),
- IDefaultMutableTreeNode.PLATFORM, true,
- fid, this.dmtnPlatformDescription);
- iTree.addNode(dmtnPlatformDescription, node);
- this.openPlatform(fid.getPath());
- }
- }
- }
- }
-
- /**
- Open a file
-
- **/
- private void open() {
- JFileChooser fc = new JFileChooser(Workspace.getCurrentWorkspace());
- fc.setAcceptAllFileFilterUsed(false);
- IFileFilter iffM = new IFileFilter(DataType.MODULE_SURFACE_AREA_EXT);
- IFileFilter iffP = new IFileFilter(DataType.PACKAGE_SURFACE_AREA_EXT);
- IFileFilter iffF = new IFileFilter(DataType.PLATFORM_SURFACE_AREA_EXT);
- fc.addChoosableFileFilter(iffM);
- fc.addChoosableFileFilter(iffP);
- fc.addChoosableFileFilter(iffF);
- fc.setFileFilter(iffM);
-
- int result = fc.showOpenDialog(new JPanel());
-
- if (result == JFileChooser.APPROVE_OPTION) {
- String path = fc.getSelectedFile().getPath();
- String match = path.substring(path.length() - 4);
- if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.MODULE_SURFACE_AREA_EXT)) {
- openModule(path, this.dmtnModuleDescription);
- } else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PACKAGE_SURFACE_AREA_EXT)) {
- openPackage(path);
- } else if (match.equals(DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT)) {
- openPlatform(path);
- }
- }
- }
-
- /**
- Close files
-
- **/
- private void close() {
- TreePath item = null;
- switch (this.jTabbedPaneEditor.getSelectedIndex()) {
- //
- // Current is module
- //
- case 0:
- if (this.currentOpeningModuleIndex > -1) {
- if (!GlobalData.openingModuleList.getModuleSaved(currentOpeningModuleIndex)) {
- int result = showSaveDialog();
- if (result == JOptionPane.YES_OPTION) {
- this.save();
- }
- if (result == JOptionPane.NO_OPTION) {
- // Do nothing
- }
- if (result == JOptionPane.CANCEL_OPTION) {
- return;
- }
- }
-
- //
- // Remove all tree paths for the module
- //
- Set<TreePath> openingTreePaths = GlobalData.openingModuleList
- .getTreePathByIndex(currentOpeningModuleIndex);
- Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
- while (openingTreePathsIter.hasNext()) {
- item = openingTreePathsIter.next();
- iTree.getNodeByPath(item).setOpening(false);
- iTree.removeNodeChildrenByPath(item);
- }
-
- GlobalData.openingModuleList.reload(this.currentOpeningModuleIndex);
- GlobalData.openingModuleList.setModuleOpen(this.currentOpeningModuleIndex, false);
- GlobalData.openingModuleList.setModuleSaved(this.currentOpeningModuleIndex, true);
-
- this.cleanDesktopPaneModule();
- this.currentOpeningModuleIndex = -1;
- }
- break;
- //
- // Current is package
- //
- case 1:
- if (this.currentOpeningPackageIndex > -1) {
- if (!GlobalData.openingPackageList.getPackageSaved(currentOpeningPackageIndex)) {
- int result = showSaveDialog();
- if (result == JOptionPane.YES_OPTION) {
- this.save();
- }
- if (result == JOptionPane.NO_OPTION) {
- // Do nothing
- }
- if (result == JOptionPane.CANCEL_OPTION) {
- return;
- }
- }
-
- //
- // Remove all tree paths for the module
- //
- Set<TreePath> openingTreePaths = GlobalData.openingPackageList
- .getTreePathByIndex(currentOpeningPackageIndex);
- Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
- while (openingTreePathsIter.hasNext()) {
- item = openingTreePathsIter.next();
- iTree.getNodeByPath(item).setOpening(false);
- iTree.removeNodeChildrenByPath(item);
- }
-
- GlobalData.openingPackageList.reload(this.currentOpeningPackageIndex);
- GlobalData.openingPackageList.setPackageOpen(this.currentOpeningPackageIndex, false);
- GlobalData.openingPackageList.setPackageSaved(this.currentOpeningPackageIndex, true);
- this.cleanDesktopPanePackage();
- this.currentOpeningPackageIndex = -1;
- }
- break;
- //
- // Current is platform
- //
- case 2:
- if (this.currentOpeningPlatformIndex > -1) {
- if (!GlobalData.openingPlatformList.getPlatformSaved(currentOpeningPlatformIndex)) {
- int result = showSaveDialog();
- if (result == JOptionPane.YES_OPTION) {
- this.save();
- }
- if (result == JOptionPane.NO_OPTION) {
- // Do nothing
- }
- if (result == JOptionPane.CANCEL_OPTION) {
- return;
- }
- }
-
- //
- // Remove all tree paths for the module
- //
- Set<TreePath> openingTreePaths = GlobalData.openingPlatformList
- .getTreePathByIndex(currentOpeningPlatformIndex);
- Iterator<TreePath> openingTreePathsIter = openingTreePaths.iterator();
- while (openingTreePathsIter.hasNext()) {
- item = openingTreePathsIter.next();
- iTree.getNodeByPath(item).setOpening(false);
- iTree.removeNodeChildrenByPath(item);
- }
-
- GlobalData.openingPlatformList.reload(this.currentOpeningPlatformIndex);
- GlobalData.openingPlatformList.setPlatformOpen(this.currentOpeningPlatformIndex, false);
- GlobalData.openingPlatformList.setPlatformSaved(this.currentOpeningPlatformIndex, true);
- this.cleanDesktopPanePlatform();
- this.currentOpeningPlatformIndex = -1;
- }
- break;
- }
- }
-
- /**
- Close all opening files and clean all showing internal frame
-
- **/
- private int closeAll() {
- int result = JOptionPane.NO_OPTION;
- if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()
- || !GlobalData.openingPlatformList.isSaved()) {
- result = showSaveDialog();
- }
- if (result == JOptionPane.YES_OPTION) {
- this.saveAll();
- }
- if (result == JOptionPane.NO_OPTION) {
- //
- // Do nothing
- //
- }
- if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {
- return -1;
- }
- this.cleanDesktopPane();
- GlobalData.openingModuleList.closeAll();
- GlobalData.openingPackageList.closeAll();
- GlobalData.openingPlatformList.closeAll();
-
- return 0;
- }
-
- /**
- Refresh all global data from disk to memory
-
- **/
- private void refresh() {
- GlobalData.init();
- }
-
- /**
- Save currentModule when press button OK
-
- **/
- private void save() {
- switch (this.jTabbedPaneEditor.getSelectedIndex()) {
- case 0:
- if (this.currentOpeningModuleIndex > -1) {
- saveModule(this.currentOpeningModuleIndex);
- }
- break;
- case 1:
- if (this.currentOpeningPackageIndex > -1) {
- savePackage(this.currentOpeningPackageIndex);
- }
- break;
- case 2:
- if (this.currentOpeningPlatformIndex > -1) {
- savePlatform(this.currentOpeningPlatformIndex);
- }
- break;
- }
- }
-
- private void saveAs() {
-
- }
-
- private void saveAll() {
- //
- // Save all modules
- //
- for (int index = 0; index < GlobalData.openingModuleList.size(); index++) {
- if (!GlobalData.openingModuleList.getModuleSaved(index)) {
- saveModule(index);
- }
- }
-
- //
- // Save all packages
- //
- for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {
- if (!GlobalData.openingPackageList.getPackageSaved(index)) {
- savePackage(index);
- }
- }
-
- //
- // Save all platforms
- //
- for (int index = 0; index < GlobalData.openingPlatformList.size(); index++) {
- if (!GlobalData.openingPlatformList.getPlatformSaved(index)) {
- savePlatform(index);
- }
- }
- }
-
- /**
- To save changed items before exit.
-
- **/
- private void exit() {
- int result = JOptionPane.NO_OPTION;
- if (!GlobalData.openingModuleList.isSaved() || !GlobalData.openingPackageList.isSaved()
- || !GlobalData.openingPlatformList.isSaved()) {
- result = showSaveDialog();
- }
- if (result == JOptionPane.YES_OPTION) {
- this.saveAll();
- } else if (result == JOptionPane.NO_OPTION) {
- // Do nothing
- } else if (result == JOptionPane.CANCEL_OPTION || result == JOptionPane.CLOSED_OPTION) {
- return;
- }
- this.dispose();
- System.exit(0);
- }
-
- /**
- To find all defined PPIs in workspace
-
- **/
- private void findPpi() {
- FindResult fr = FindResult.getInstance("PPI");
- fr.setVisible(true);
- }
-
- /**
- To find all defined PROTOCOLs in workspace
-
- **/
- private void findProtocol() {
- FindResult fr = FindResult.getInstance("PROTOCOL");
- fr.setVisible(true);
- }
-
- /**
- To find all defined PROTOCOLs in workspace
-
- **/
- private void findGuid() {
- FindResult fr = FindResult.getInstance("GUID");
- fr.setVisible(true);
- }
-
- /**
- To find all defined PROTOCOLs in workspace
-
- **/
- private void findPcd() {
- FindResult fr = FindResult.getInstance("PCD");
- fr.setVisible(true);
- }
-
- /**
- To find all defined Library Classes in workspace
-
- **/
- private void findLibraryClass() {
- FindResult fr = FindResult.getInstance("LIBRARY_CLASS");
- fr.setVisible(true);
- }
-
- /**
- To find all defined Library Instances in workspace
-
- **/
- private void findLibraryInstance() {
- FindResult fr = FindResult.getInstance("LIBRARY_INSTANCE");
- fr.setVisible(true);
- }
-
- /**
- Switch current workspace to others
-
- **/
- private void changeWorkspace() {
- SwitchWorkspace sw = new SwitchWorkspace(this, true);
- int result = sw.showDialog();
- if (result == DataType.RETURN_TYPE_CANCEL) {
- return;
- } else if (result == DataType.RETURN_TYPE_OK) {
- //
- // Reinit whole window
- //
- this.closeAll();
- this.setTitle(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION + " " + "- ["
- + Workspace.getCurrentWorkspace() + "]");
- //
- // Refrash the tree
- //
- this.refresh();
- this.makeEmptyTree();
- }
- sw.dispose();
- }
-
- /**
- To create a Far file from current workspace
-
- **/
- private void createFar() {
- CreateStepOne cso = new CreateStepOne(this, true);
- int result = cso.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- String strReturn = "Far Creation Completed!";
- JOptionPane.showConfirmDialog(this, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
- }
- cso.dispose();
- }
-
- /**
- To install a Far file to current workspace
-
- **/
- private void installFar() {
- InstallStepOne iso = new InstallStepOne(this, true);
- int result = iso.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- String strReturn = "<html>Far Installalation completed!<br>Refreshing the WORKSPACE!</html>";
- JOptionPane.showConfirmDialog(this, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
- this.closeAll();
- this.refresh();
- this.makeEmptyTree();
- }
- iso.dispose();
- }
-
- /**
- To remove a Far's items from current workspace
-
- **/
- private void removeFar() {
- DeleteStepOne dso = new DeleteStepOne(this, true);
- int result = dso.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- String strReturn = "<html>Far Deletion completed!<br>Refreshing the WORKSPACE!</html>";
- JOptionPane.showConfirmDialog(this, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
- this.closeAll();
- this.refresh();
- this.makeEmptyTree();
- }
- dso.dispose();
- }
-
- /**
- To update an existing Far file
-
- **/
- private void updateFar() {
- UpdateStepOne uso = new UpdateStepOne(this, true);
- int result = uso.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- String strReturn = "<html>Far Update completed!<br>Refreshing the WORKSPACE!</html>";
- JOptionPane.showConfirmDialog(this, strReturn, "Done", JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
- this.closeAll();
- this.refresh();
- this.makeEmptyTree();
- }
- uso.dispose();
- }
-
- /**
- Show Tool Chain Configuration Dialog to setup Tool Chain
-
- **/
- private void setupToolChainConfiguration() {
- ToolChainConfig tcc = ToolChainConfig.getInstance();
- tcc.showDialog();
- }
-
- private void configBuildPreferences() {
- Preferences bt = Preferences.getInstance();
- bt.showDialog();
- }
-
- /**
- Clone selected item
-
- **/
- private void cloneItem() {
- int mode = -1;
-
- //
- // Check if there is any item can be cloned
- //
- if (iTree.getSelectionPath() == null) {
- Log.wrn("Clone", "Please select a target to clone!");
- return;
- }
- int category = iTree.getSelectCategory();
- Identification id = iTree.getSelectNode().getId();
-
- if (category == IDefaultMutableTreeNode.WORKSPACE) {
- mode = DataType.RETURN_TYPE_WORKSPACE;
- id = null;
- }
- if ((category == IDefaultMutableTreeNode.MODULE)
- || (category >= IDefaultMutableTreeNode.MSA_HEADER && category < IDefaultMutableTreeNode.SPD_HEADER)) {
- mode = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
- }
- if ((category == IDefaultMutableTreeNode.PACKAGE)
- || (category >= IDefaultMutableTreeNode.SPD_HEADER && category < IDefaultMutableTreeNode.FPD_PLATFORMHEADER)) {
- mode = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
- }
- if ((category == IDefaultMutableTreeNode.PLATFORM) || (category >= IDefaultMutableTreeNode.FPD_PLATFORMHEADER)) {
- mode = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
- }
-
- Clone c = new Clone(this, true, mode, id);
- int result = c.showDialog();
-
- if (result == DataType.RETURN_TYPE_CANCEL) {
- c.dispose();
- }
- if (result == DataType.RETURN_TYPE_WORKSPACE) {
- Tools.showInformationMessage("Workspace Clone Completed!");
- }
- if (result == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- Tools.showInformationMessage("Module Clone Completed!");
- addModuleToTree(c.getMid());
- }
- if (result == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- Tools.showInformationMessage("Package Clone Completed!");
- //
- // Add new SpdHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(GlobalData.vPackageList.lastElement().getName(),
- IDefaultMutableTreeNode.PACKAGE, false,
- GlobalData.vPackageList.lastElement(),
- this.dmtnPackageDescription);
- iTree.addNode(this.dmtnPackageDescription, node);
- }
- if (result == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- Tools.showInformationMessage("Platform Surface Area Clone Finished");
- //
- // Add new SpdHeader node to the tree
- //
- IDefaultMutableTreeNode node = new IDefaultMutableTreeNode(
- GlobalData.vPlatformList.lastElement().getName(),
- IDefaultMutableTreeNode.PLATFORM, false,
- GlobalData.vPlatformList.lastElement(),
- this.dmtnPlatformDescription);
- iTree.addNode(this.dmtnPlatformDescription, node);
- }
- if (result == DataType.RETURN_TYPE_OK) {
-
- }
- }
-
- public void valueChanged(TreeSelectionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void menuCanceled(MenuEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void menuDeselected(MenuEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void menuSelected(MenuEvent arg0) {
- if (arg0.getSource() == jMenuFile) {
- //
- // Enable close/close all if some files are opened
- //
- switch (this.jTabbedPaneEditor.getSelectedIndex()) {
- case 0:
- jMenuItemFileClose
- .setEnabled(GlobalData.openingModuleList
- .getModuleOpen(this.currentOpeningModuleIndex));
- jMenuItemFileSave
- .setEnabled(!GlobalData.openingModuleList
- .getModuleSaved(this.currentOpeningModuleIndex));
- break;
- case 1:
- jMenuItemFileClose
- .setEnabled(GlobalData.openingPackageList
- .getPackageOpen(this.currentOpeningPackageIndex));
- jMenuItemFileSave
- .setEnabled(!GlobalData.openingPackageList
- .getPackageSaved(this.currentOpeningPackageIndex));
- break;
- case 2:
- jMenuItemFileClose
- .setEnabled(GlobalData.openingPlatformList
- .getPlatformOpen(this.currentOpeningPlatformIndex));
- jMenuItemFileSave
- .setEnabled(!GlobalData.openingPlatformList
- .getPlatformSaved(this.currentOpeningPlatformIndex));
- break;
- }
- jMenuItemFileCloseAll.setEnabled(GlobalData.openingModuleList.isOpen()
- || GlobalData.openingPackageList.isOpen()
- || GlobalData.openingPlatformList.isOpen());
-
- //
- // Enable save/save all if some files are changed
- //
- jMenuItemFileSaveAll.setEnabled(!GlobalData.openingModuleList.isSaved()
- || !GlobalData.openingPackageList.isSaved()
- || !GlobalData.openingPlatformList.isSaved());
- }
-
- if (arg0.getSource() == jMenuTools) {
- //
- // Enable clone when select some items
- //
- if (iTree.getSelectionPath() == null) {
- jMenuItemToolsClone.setEnabled(false);
- } else {
- int category = iTree.getSelectCategory();
- if (category == IDefaultMutableTreeNode.MODULE_DESCRIPTION
- || category == IDefaultMutableTreeNode.PACKAGE_DESCRIPTION
- || category == IDefaultMutableTreeNode.PLATFORM_DESCRIPTION
- || category == IDefaultMutableTreeNode.MODULE_PACKAGE
- || category == IDefaultMutableTreeNode.MODULE_PACKAGE_LIBRARY
- || category == IDefaultMutableTreeNode.MODULE_PACKAGE_MODULE) {
- jMenuItemToolsClone.setEnabled(false);
- } else {
- jMenuItemToolsClone.setEnabled(true);
- }
- }
- }
- }
-
- public void keyTyped(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyPressed(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyReleased(KeyEvent arg0) {
- if (arg0.getSource() == this.iTree) {
- if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
- this.doubleClickModuleTreeNode();
- }
- }
- }
-
- /**
- Search whole workspace and find all module's name and guid, and save them to a file
-
- **/
- private void generateGuidsXref() {
- //
- // Init File Chooser
- //
- JFileChooser fc = new JFileChooser();
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.setSelectedFile(new File(Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + DataType.GUIDS_XREF_FILE_NAME));
- fc.setMultiSelectionEnabled(false);
-
- //
- // Get guids xref and save to file
- //
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- Vector<String> v = wt.getAllModuleGuidXref();
- if (v.size() < 1) {
- Log.wrn("No guids found!!!");
- return;
- }
- File f = fc.getSelectedFile();
- if (!f.exists()) {
- try {
- f.createNewFile();
- } catch (IOException e) {
- Log.wrn("Fail to create file", e.getMessage());
- Log.err("Fail to create file when generating guids.xref", e.getMessage());
- }
- }
- FileWriter fw = null;
- BufferedWriter bw = null;
- try {
- fw = new FileWriter(f);
- bw = new BufferedWriter(fw);
- for (int index = 0; index < v.size(); index++) {
- bw.write(v.get(index));
- bw.newLine();
- }
- bw.flush();
- fw.flush();
- bw.close();
- fw.close();
- } catch (IOException e) {
- Log.wrn("Fail to write file", e.getMessage());
- Log.err("Fail to write file when generating guids.xref", e.getMessage());
- return;
- }
-
- JOptionPane.showConfirmDialog(this, "File is created", "Generate guids.xref", JOptionPane.DEFAULT_OPTION,
- JOptionPane.INFORMATION_MESSAGE);
- }
- }
-
- /**
- Check if WORKSPACE Environment is valid
-
- **/
- private void checkWorkspace() {
- switch (Workspace.checkCurrentWorkspace()) {
- case Workspace.WORKSPACE_VALID:
- break;
- case Workspace.WORKSPACE_NOT_DEFINED:
- JOptionPane
- .showConfirmDialog(
- this,
- "WORKSPACE Environment Variable Is Not Defined, Please select a valid WORKSPACE directory. "
- + DataType.LINE_SEPARATOR
- + DataType.LINE_SEPARATOR
- + "NOTICE:"
- + DataType.LINE_SEPARATOR
- + "This does not change the System Environment Variable."
- + DataType.LINE_SEPARATOR
- + "It only applies to where the Wizard will manage modification and file creations.",
- "Error", JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
- SwitchWorkspace sw = new SwitchWorkspace(this, true);
- int result = sw.showDialog();
- if (result == DataType.RETURN_TYPE_CANCEL) {
- this.dispose();
- System.exit(0);
- } else if (result == DataType.RETURN_TYPE_OK) {
- sw.dispose();
- break;
- }
- case Workspace.WORKSPACE_NOT_EXIST:
- JOptionPane.showConfirmDialog(this, "Defined WORKSPACE Is Not Existed", "Error",
- JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
- this.dispose();
- System.exit(0);
- case Workspace.WORKSPACE_NOT_DIRECTORY:
- JOptionPane.showConfirmDialog(this, "Defined WORKSPACE Is Not A Directory", "Error",
- JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
- this.dispose();
- System.exit(0);
- case Workspace.WORKSPACE_NOT_VALID:
- JOptionPane.showConfirmDialog(this, "WORKSPACE Environment Variable Is Not Valid", "Error",
- JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
- this.dispose();
- System.exit(0);
- case Workspace.WORKSPACE_NO_TARGET_FILE:
- JOptionPane.showConfirmDialog(this, "Target.txt File Is Not Existed", "Error", JOptionPane.DEFAULT_OPTION,
- JOptionPane.ERROR_MESSAGE);
- this.dispose();
- System.exit(0);
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/NewFileChooser.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/NewFileChooser.java
deleted file mode 100644
index 18cbdb8a8b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/NewFileChooser.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/** @file
-
- The file is used to show a new file chooser dialog
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JPanel;
-import javax.swing.JButton;
-import javax.swing.JRadioButton;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-
-public class NewFileChooser extends IDialog {
-
- /**
- Define class members
-
- **/
- private static final long serialVersionUID = -3657926400683618281L;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonNext = null;
-
- private JButton jButtonCancel = null;
-
- private JRadioButton jRadioButtonModule = null;
-
- private JRadioButton jRadioButtonPackage = null;
-
- private JRadioButton jRadioButtonPlatform = null;
-
- private JRadioButton jRadioButtonBuildXml = null;
-
- private final ButtonGroup buttonGroup = new ButtonGroup();
-
- /**
- This is the default constructor
-
- **/
- public NewFileChooser() {
- super();
- init();
- }
-
- /**
- This is the default constructor
-
- **/
- public NewFileChooser(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- init();
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(90, 150, 80, 20));
- jButtonNext.setText("Next");
- jButtonNext.addActionListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(180, 150, 80, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jRadioButtonModule
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonModule() {
- if (jRadioButtonModule == null) {
- jRadioButtonModule = new JRadioButton();
- jRadioButtonModule.setText(DataType.MODULE_SURFACE_AREA);
- jRadioButtonModule.setBounds(new java.awt.Rectangle(20, 20, 240, 20));
- jRadioButtonModule.setSelected(true);
- }
- return jRadioButtonModule;
- }
-
- /**
- * This method initializes jRadioButtonPackage
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonPackage() {
- if (jRadioButtonPackage == null) {
- jRadioButtonPackage = new JRadioButton();
- jRadioButtonPackage.setText(DataType.PACKAGE_SURFACE_AREA);
- jRadioButtonPackage.setBounds(new java.awt.Rectangle(20, 50, 240, 20));
- }
- return jRadioButtonPackage;
- }
-
- /**
- * This method initializes jRadioButtonPlatform
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonPlatform() {
- if (jRadioButtonPlatform == null) {
- jRadioButtonPlatform = new JRadioButton();
- jRadioButtonPlatform.setText(DataType.PLATFORM_SURFACE_AREA);
- jRadioButtonPlatform.setBounds(new java.awt.Rectangle(20, 80, 240, 20));
- }
- return jRadioButtonPlatform;
- }
-
- /**
- * This method initializes jRadioButtonBuildXml
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonBuildXml() {
- if (jRadioButtonBuildXml == null) {
- jRadioButtonBuildXml = new JRadioButton();
- jRadioButtonBuildXml.setText(DataType.ANT_BUILD_FILE);
- jRadioButtonBuildXml.setBounds(new java.awt.Rectangle(20, 110, 240, 20));
- jRadioButtonBuildXml.setVisible(false);
- }
- return jRadioButtonBuildXml;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- NewFileChooser nfc = new NewFileChooser();
- nfc.setVisible(true);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void init() {
- this.setSize(310, 220);
- this.setContentPane(getJContentPane());
- this.setTitle("Select New File Type");
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJRadioButtonModule(), null);
- jContentPane.add(getJRadioButtonPackage(), null);
- jContentPane.add(getJRadioButtonPlatform(), null);
- jContentPane.add(getJRadioButtonBuildXml(), null);
- buttonGroup.add(this.getJRadioButtonModule());
- buttonGroup.add(this.getJRadioButtonPackage());
- buttonGroup.add(this.getJRadioButtonPlatform());
- buttonGroup.add(this.getJRadioButtonBuildXml());
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonCancel) {
- this.setVisible(false);
- returnType = DataType.RETURN_TYPE_CANCEL;
- }
-
- if (arg0.getSource() == jButtonNext) {
- this.setVisible(false);
- if (this.jRadioButtonModule.isSelected()) {
- returnType = DataType.RETURN_TYPE_MODULE_SURFACE_AREA;
- }
- if (this.jRadioButtonPackage.isSelected()) {
- returnType = DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA;
- }
- if (this.jRadioButtonPlatform.isSelected()) {
- returnType = DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA;
- }
- if (this.jRadioButtonBuildXml.isSelected()) {
- returnType = DataType.RETURN_TYPE_BUILD_XML;
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java
deleted file mode 100644
index 6572067efe..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SelectModuleBelong.java
+++ /dev/null
@@ -1,809 +0,0 @@
-/** @file
-
- The file is used to let user choose to create module in an existing package
- or to create a new package first.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.util.Vector;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.SpdHeaderDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformHeaderDocument.PlatformHeader;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.SaveFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-import javax.swing.JRadioButton;
-
-public class SelectModuleBelong extends IDialog {
-
- /**
- Define class members
-
- **/
- private static final long serialVersionUID = 4171355136991448972L;
-
- private JPanel jContentPane = null;
-
- private JComboBox jComboBoxExistingPackage = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private Vector<PackageIdentification> packages = null;
-
- private JLabel jLabelPackage = null;
-
- private JLabel jLabelFilePath = null;
-
- private JTextField jTextFieldFilePath = null;
-
- private JButton jButtonBrowse = null;
-
- private JLabel jLabelName = null;
-
- private JTextField jTextFieldName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JButton jButtonGen = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private ButtonGroup bg = new ButtonGroup();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private ModuleIdentification mid = null;
-
- private PackageIdentification pid = null;
-
- private PlatformIdentification fid = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PackageSurfaceArea spd = null;
-
- private PlatformSurfaceArea fpd = null;
-
- private int mode = -1;
-
- private JLabel jLabelIsLibrary = null;
-
- private JRadioButton jRadioButtonYes = null;
-
- private JRadioButton jRadioButtonNo = null;
-
- /**
- * This method initializes jComboBoxExistingPackage
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxExistingPackage() {
- if (jComboBoxExistingPackage == null) {
- jComboBoxExistingPackage = new JComboBox();
- jComboBoxExistingPackage.setBounds(new java.awt.Rectangle(140, 10, 340, 20));
- }
- return jComboBoxExistingPackage;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(310, 165, 80, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(395, 165, 80, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jTextFieldFilePath
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFilePath() {
- if (jTextFieldFilePath == null) {
- jTextFieldFilePath = new JTextField();
- jTextFieldFilePath.setBounds(new java.awt.Rectangle(140, 60, 250, 20));
- }
- return jTextFieldFilePath;
- }
-
- /**
- * This method initializes jButtonBrowse
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(395, 60, 85, 20));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.addActionListener(this);
- }
- return jButtonBrowse;
- }
-
- /**
- * This method initializes jTextFieldModuleName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldName() {
- if (jTextFieldName == null) {
- jTextFieldName = new JTextField();
- jTextFieldName.setBounds(new java.awt.Rectangle(140, 85, 340, 20));
- }
- return jTextFieldName;
- }
-
- /**
- * This method initializes jTextFieldGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(140, 110, 250, 20));
- }
- return jTextFieldGuid;
- }
-
- /**
- * This method initializes jButtonGen
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonGen() {
- if (jButtonGen == null) {
- jButtonGen = new JButton();
- jButtonGen.setBounds(new java.awt.Rectangle(395, 110, 85, 20));
- jButtonGen.setText("GEN");
- jButtonGen.addActionListener(this);
- }
- return jButtonGen;
- }
-
- /**
- * This method initializes jTextFieldVersion
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(140, 135, 340, 20));
- }
- return jTextFieldVersion;
- }
-
- /**
- * This method initializes jRadioButtonYes
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonYes() {
- if (jRadioButtonYes == null) {
- jRadioButtonYes = new JRadioButton();
- jRadioButtonYes.setBounds(new java.awt.Rectangle(140, 35, 100, 20));
- jRadioButtonYes.setSelected(false);
- jRadioButtonYes.setText("Yes");
- }
- return jRadioButtonYes;
- }
-
- /**
- * This method initializes jRadioButtonNo
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonNo() {
- if (jRadioButtonNo == null) {
- jRadioButtonNo = new JRadioButton();
- jRadioButtonNo.setBounds(new java.awt.Rectangle(300, 35, 110, 20));
- jRadioButtonNo.setSelected(true);
- jRadioButtonNo.setText("No");
- }
- return jRadioButtonNo;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- SelectModuleBelong smb = new SelectModuleBelong();
- smb.setVisible(true);
- }
-
- /**
- * This is the default constructor
- */
- public SelectModuleBelong() {
- super();
- init();
- }
-
- /**
- * This is the default constructor
- */
- public SelectModuleBelong(IFrame parentFrame, boolean modal, int fileType) {
- super(parentFrame, modal);
- this.mode = fileType;
- init();
- initExistingPackage();
- if (mode != DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- this.jStarLabel1.setVisible(false);
- this.jLabelPackage.setVisible(false);
- this.jComboBoxExistingPackage.setVisible(false);
- this.jLabelIsLibrary.setVisible(false);
- this.jRadioButtonYes.setVisible(false);
- this.jRadioButtonNo.setVisible(false);
- upLocation(this.jStarLabel2, 50);
- upLocation(this.jStarLabel3, 50);
- upLocation(this.jStarLabel4, 50);
- upLocation(this.jStarLabel5, 50);
- upLocation(this.jLabelFilePath, 50);
- upLocation(this.jLabelName, 50);
- upLocation(this.jLabelGuid, 50);
- upLocation(this.jLabelVersion, 50);
- upLocation(this.jTextFieldFilePath, 50);
- upLocation(this.jTextFieldName, 50);
- upLocation(this.jTextFieldGuid, 50);
- upLocation(this.jTextFieldVersion, 50);
- upLocation(this.jButtonBrowse, 50);
- upLocation(this.jButtonGen, 50);
- }
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void init() {
- this.setSize(500, 230);
- this.setContentPane(getJContentPane());
- this.setTitle("New");
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelIsLibrary = new JLabel();
- jLabelIsLibrary.setBounds(new java.awt.Rectangle(15, 35, 120, 20));
- jLabelIsLibrary.setText("Is this a Library");
- jLabelVersion = new JLabel();
- jLabelVersion.setBounds(new java.awt.Rectangle(15, 135, 120, 20));
- jLabelVersion.setText("Version");
- jLabelGuid = new JLabel();
- jLabelGuid.setBounds(new java.awt.Rectangle(15, 110, 120, 20));
- jLabelGuid.setText("Guid");
- jLabelName = new JLabel();
- jLabelName.setBounds(new java.awt.Rectangle(15, 85, 120, 20));
- jLabelName.setText("Module Name");
- jLabelFilePath = new JLabel();
- jLabelFilePath.setBounds(new java.awt.Rectangle(15, 60, 120, 20));
- jLabelFilePath.setText("File Path");
- jLabelPackage = new JLabel();
- jLabelPackage.setBounds(new java.awt.Rectangle(15, 10, 120, 20));
- jLabelPackage.setText("Choose a Package");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(490, 198));
- jContentPane.add(getJComboBoxExistingPackage(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(jLabelPackage, null);
- jContentPane.add(jLabelFilePath, null);
- jContentPane.add(getJTextFieldFilePath(), null);
- jContentPane.add(getJButtonBrowse(), null);
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJTextFieldName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(getJButtonGen(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
-
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0, 60));
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(0, 85));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(0, 110));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(0, 135));
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jLabelIsLibrary, null);
- jContentPane.add(getJRadioButtonYes(), null);
- jContentPane.add(getJRadioButtonNo(), null);
- bg.add(getJRadioButtonNo());
- bg.add(getJRadioButtonYes());
- }
- return jContentPane;
- }
-
- /**
- Query all existing packages and fill them into combox
-
- **/
- private void initExistingPackage() {
- packages = wt.getAllPackages();
- for (int index = 0; index < packages.size(); index++) {
- this.jComboBoxExistingPackage.addItem(packages.elementAt(index).getName());
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonCancel) {
- this.setVisible(false);
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (this.check()) {
- this.save();
- } else {
- return;
- }
- this.setVisible(false);
- this.returnType = DataType.RETURN_TYPE_OK;
- }
-
- if (arg0.getSource() == this.jButtonGen) {
- this.jTextFieldGuid.setText(Tools.generateUuidString());
- }
-
- if (arg0.getSource() == this.jButtonBrowse) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
-
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex())
- .getPath()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.MODULE_SURFACE_AREA_EXT));
- }
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.PACKAGE_SURFACE_AREA_EXT));
- }
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
- fc.addChoosableFileFilter(new IFileFilter(DataType.PLATFORM_SURFACE_AREA_EXT));
- }
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldFilePath.setText(Tools.addPathExt(fc.getSelectedFile().getPath(), mode));
- }
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean check() {
- String path = this.jTextFieldFilePath.getText();
- path = Tools.addPathExt(path, mode);
- String guid = this.jTextFieldGuid.getText();
- String version = this.jTextFieldVersion.getText();
-
- //
- // Check if all required fields are not empty
- //
- if (isEmpty(path)) {
- Log.wrn("New File", "A File Path must be entered!");
- return false;
- }
- if (isEmpty(this.jTextFieldName.getText())) {
- Log.wrn("New File", "A Name must be entered");
- return false;
- }
- if (isEmpty(guid)) {
- Log.wrn("New File", "The Guid must be entered!");
- return false;
- }
- if (isEmpty(version)) {
- Log.wrn("New File", "A Version number must be entered!");
- return false;
- }
-
- //
- // Check if all fields have correct data types
- //
- if (!DataValidation.isBaseName(this.jTextFieldName.getText())) {
- Log.wrn("New File", "Incorrect data type for the Name!");
- return false;
- }
- if (!DataValidation.isGuid((guid))) {
- Log.wrn("New File", "Incorrect data type for Guid, which must be in registry format! (8-4-4-4-12)");
- return false;
- }
-
- //
- // Check if path is valid
- //
- File f = new File(path);
- if (!f.isAbsolute()) {
- Log.wrn("New File", "Please type a complete file path!");
- return false;
- }
- f = null;
-
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- //
- // Check if the module is already existed in current package
- //
- String packagePath = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getPath();
- String modulePath = Tools.convertPathToCurrentOsType(path);
- Vector<String> msaFile = wt.getAllModulesOfPackage(packagePath);
-
- for (int index = 0; index < msaFile.size(); index++) {
- if (msaFile.elementAt(index).equals(modulePath)) {
- Log.wrn("New File", "This module is already exists in the selected package!");
- return false;
- }
- }
-
- //
- // Check if the module is in selected package
- //
- if (Tools.getFilePathOnly(modulePath).indexOf(Tools.getFilePathOnly(packagePath)) < 0) {
- Log.wrn("New File", "This module should be in the directory of selected package!");
- return false;
- }
-
- //
- // Check if Guid+Version is unique
- //
- String packageGuid = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getGuid();
- String packageVersion = packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()).getVersion();
- if (GlobalData.findModuleId(guid, version, packageGuid, packageVersion) != null) {
- Log.wrn("New File", "A module with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- //
- // Check if the package is already existed in database
- //
- path = Tools.convertPathToCurrentOsType(path);
- Vector<PackageIdentification> vPackageList = wt.getAllPackages();
- if (vPackageList != null && vPackageList.size() > 0) {
- for (int index = 0; index < vPackageList.size(); index++) {
- if (vPackageList.get(index).getPath().equals(path)) {
- Log.wrn("New File", "This package is already exists in this workspace!");
- return false;
- }
- }
- }
-
- //
- // Check if path already exists
- //
- if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(path), mode)) {
- Log.wrn("New File", "There already exists a same directory with a package");
- return false;
- }
-
- //
- // Check if Guid+Version is unique
- //
- if (GlobalData.findPackageId(guid, version) != null) {
- Log.wrn("New File", "A package with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- //
- // Check if the platform is already existed in database
- //
- path = Tools.convertPathToCurrentOsType(path);
- Vector<PlatformIdentification> vPlatfromList = wt.getAllPlatforms();
- if (vPlatfromList != null && vPlatfromList.size() > 0) {
- for (int index = 0; index < vPlatfromList.size(); index++) {
- if (vPlatfromList.get(index).getPath().equals(path)) {
- Log.wrn("New File", "This platform is already exists in this workspace!");
- return false;
- }
- }
- }
-
- //
- // Check if path already exists
- //
- if (GlobalData.isDuplicateRelativePath(Tools.getFilePathOnly(path), mode)) {
- Log.wrn("New File", "There already exists a same directory with a platform");
- return false;
- }
-
- //
- // Check if Guid+Version is unique
- //
- if (GlobalData.findPlatformId(guid, version) != null) {
- Log.wrn("New File", "A platform with same Guid and same Version already exists, please selece a new Guid or Version!");
- return false;
- }
- }
-
- return true;
- }
-
- /**
- Save file
-
- **/
- public void save() {
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- this.saveModule();
- }
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- this.savePackage();
- }
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- this.savePlatform();
- }
- }
-
- /**
- Save all components of Msa Header
-
- **/
- private void saveModule() {
- msa = null;
- String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
-
- //
- // Save to memory
- //
- try {
- MsaHeaderDocument.MsaHeader msaHeader = null;
-
- msa = ModuleSurfaceArea.Factory.newInstance();
- msaHeader = MsaHeaderDocument.MsaHeader.Factory.newInstance();
-
- msaHeader.setModuleName(this.jTextFieldName.getText());
- msaHeader.setGuidValue(this.jTextFieldGuid.getText());
- msaHeader.setVersion(this.jTextFieldVersion.getText());
- msaHeader.setModuleType(ModuleTypeDef.BASE);
-
- msa.setMsaHeader(msaHeader);
- } catch (Exception e) {
- Log.err("Save ModuleSurfaceArea Document", e.getMessage());
- return;
- }
-
- //
- // Save to real file
- //
- try {
- SaveFile.saveMsaFile(path, msa);
- } catch (Exception e) {
- Log.wrn("Save Module to file system", e.getMessage());
- Log.err("Save Module to file system", e.getMessage());
- return;
- }
-
- //
- // Save to identification
- //
- mid = new ModuleIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
- this.jTextFieldVersion.getText(), path, jRadioButtonYes.isSelected());
- mid.setPackageId(packages.elementAt(this.jComboBoxExistingPackage.getSelectedIndex()));
- }
-
- /**
- Save all components of Spd Header
-
- **/
- private void savePackage() {
- spd = null;
- String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
-
- //
- // Save to memory
- //
- try {
- SpdHeaderDocument.SpdHeader spdHeader = null;
-
- spd = PackageSurfaceArea.Factory.newInstance();
- spdHeader = SpdHeaderDocument.SpdHeader.Factory.newInstance();
-
- spdHeader.setPackageName(this.jTextFieldName.getText());
- spdHeader.setGuidValue(this.jTextFieldGuid.getText());
- spdHeader.setVersion(this.jTextFieldVersion.getText());
-
- spd.setSpdHeader(spdHeader);
- } catch (Exception e) {
- Log.wrn("Save Package Surface Area Description Document", e.getMessage());
- return;
- }
-
- //
- // Save to real file
- //
- try {
- SaveFile.saveSpdFile(path, spd);
-
- } catch (Exception e) {
- Log.wrn("Save Package to file system", e.getMessage());
- Log.err("Save Package to file system", e.getMessage());
- return;
- }
-
- //
- // Save to identification
- //
- pid = new PackageIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
- this.jTextFieldVersion.getText(), path);
- }
-
- /**
- Save all components of Fpd Header
-
- **/
- private void savePlatform() {
- fpd = null;
- String path = Tools.convertPathToCurrentOsType(this.jTextFieldFilePath.getText());
-
- //
- // Save to memory
- //
- try {
- PlatformHeader fpdHeader = null;
-
- fpd = PlatformSurfaceArea.Factory.newInstance();
- fpdHeader = PlatformHeader.Factory.newInstance();
-
- fpdHeader.setPlatformName(this.jTextFieldName.getText());
- fpdHeader.setGuidValue(this.jTextFieldGuid.getText());
- fpdHeader.setVersion(this.jTextFieldVersion.getText());
-
- fpd.setPlatformHeader(fpdHeader);
- } catch (Exception e) {
- Log.wrn("Save Framework Platform Description Document", e.getMessage());
- return;
- }
-
- //
- // Save to real file
- //
- try {
- SaveFile.saveFpdFile(path, fpd);
-
- } catch (Exception e) {
- Log.wrn("Save Platform to file system", e.getMessage());
- Log.err("Save Platform to file system", e.getMessage());
- return;
- }
-
- //
- // Save to identification
- //
- fid = new PlatformIdentification(this.jTextFieldName.getText(), this.jTextFieldGuid.getText(),
- this.jTextFieldVersion.getText(), path);
- }
-
- public ModuleIdentification getMid() {
- return mid;
- }
-
- public PlatformIdentification getFid() {
- return fid;
- }
-
- public PackageIdentification getPid() {
- return pid;
- }
-
- private void upLocation(Component c, int size) {
- c.setLocation(c.getLocation().x, c.getLocation().y - size);
- }
-
- public PlatformSurfaceArea getFpd() {
- return fpd;
- }
-
- public ModuleSurfaceArea getMsa() {
- return msa;
- }
-
- public PackageSurfaceArea getSpd() {
- return spd;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SplashScreen.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SplashScreen.java
deleted file mode 100644
index 16fa4911de..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/SplashScreen.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/** @file
-
- To show a splash screen when starting
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard;
-
-import javax.swing.ImageIcon;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JRootPane;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-
-public class SplashScreen extends IFrame {
-
- ///
- /// Serial Version UID
- ///
- private static final long serialVersionUID = 1077736364497801470L;
-
- private JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="10,54"
-
- private JLabel jLabelImage = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel1 = null;
-
- private JLabel jLabel2 = null;
-
-
- /**
- * This is the default constructor
- */
- public SplashScreen() {
- super();
- init();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void init() {
- this.setSize(320, 205);
- this.setUndecorated(true);
- this.setContentPane(getJContentPane());
- this.getRootPane().setWindowDecorationStyle(JRootPane.NONE);
- this.setTitle("Init");
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelImage = new JLabel();
- jLabelImage.setBounds(new java.awt.Rectangle(63, 20, 193, 58));
- jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/logo.gif")));
-
- jLabel2 = new JLabel();
- jLabel2.setBounds(new java.awt.Rectangle(25, 120, 270, 20));
- jLabel2.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel2.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 14));
- jLabel2.setText("Initializing...");
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(3,166,270,20));
- jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
- jLabel1.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 8));
- jLabel1.setText("Copyright (c) 2006, Intel Corporation");
- jLabel = new JLabel();
- jLabel.setToolTipText("");
- jLabel.setBounds(new java.awt.Rectangle(25, 90, 270, 20));
- jLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- jLabel.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 18));
- jLabel.setText(DataType.PROJECT_NAME + " " + DataType.PROJECT_VERSION);
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(320,199));
- jContentPane.setBackground(java.awt.SystemColor.inactiveCaptionText);
- jContentPane.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jContentPane.add(jLabel, null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(jLabel2, null);
- jContentPane.add(jLabelImage, null);
- }
- return jContentPane;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
deleted file mode 100644
index cef7e85531..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfig.java
+++ /dev/null
@@ -1,508 +0,0 @@
-/** @file
-
- The file is used to setup tool chain configuration
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.WindowEvent;
-import java.io.File;
-import java.io.IOException;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigId;
-import org.tianocore.frameworkwizard.common.Identifications.ToolChainConfigVector;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class ToolChainConfig extends IFrame implements ListSelectionListener, TableModelListener{
-
- ///
- /// Define Class Members
- ///
- private static final long serialVersionUID = 1486930966278269085L;
-
- private JPanel jContentPane = null;
-
- private JScrollPane jScrollPane = null;
-
- private DefaultTableModel model = null;
-
- private JTable jTable = null;
-
- private JButton jButtonOpen = null;
-
- private JButton jButtonSave = null;
-
- private JButton jButtonClose = null;
-
- private String toolsDir = Tools.addFileSeparator(Workspace.getCurrentWorkspace()) + "Tools"
- + DataType.FILE_SEPARATOR + "Conf";
-
- private String currentFile = Tools.addFileSeparator(toolsDir) + "tools_def.template";
-
- private ToolChainConfigVector vtcc = new ToolChainConfigVector();
-
- private JLabel jLabelName = null;
-
- private JTextField jTextFieldName = null;
-
- private JLabel jLabelValue = null;
-
- private JTextField jTextFieldValue = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private int selectedRow = -1;
-
- private JButton jButtonHelp = null;
-
- private static ToolChainConfig tcc = null;
-
- private ToolChainConfigHelp tcch = null;
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(15, 15, 555, 345));
- jScrollPane.setViewportView(getJTable());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
-
- **/
- private JTable getJTable() {
- if (jTable == null) {
- model = new DefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Property");
- model.addColumn("Value");
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- }
- return jTable;
- }
-
- /**
- This method initializes jButtonOpen
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOpen() {
- if (jButtonOpen == null) {
- jButtonOpen = new JButton();
- jButtonOpen.setBounds(new java.awt.Rectangle(40, 405, 120, 20));
- jButtonOpen.setText("Open File");
- jButtonOpen.addActionListener(this);
- }
- return jButtonOpen;
- }
-
- /**
- This method initializes jButtonSave
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonSave() {
- if (jButtonSave == null) {
- jButtonSave = new JButton();
- jButtonSave.setBounds(new java.awt.Rectangle(170, 405, 120, 20));
- jButtonSave.setText("Save File");
- jButtonSave.addActionListener(this);
- }
- return jButtonSave;
- }
-
- /**
- This method initializes jButtonClose
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonClose() {
- if (jButtonClose == null) {
- jButtonClose = new JButton();
- jButtonClose.setBounds(new java.awt.Rectangle(490, 405, 80, 20));
- jButtonClose.setText("Close");
- jButtonClose.addActionListener(this);
- }
- return jButtonClose;
- }
-
- /**
- This method initializes jTextFieldName
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldName() {
- if (jTextFieldName == null) {
- jTextFieldName = new JTextField();
- jTextFieldName.setBounds(new java.awt.Rectangle(60, 365, 140, 20));
- }
- return jTextFieldName;
- }
-
- /**
- This method initializes jTextFieldValue
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldValue() {
- if (jTextFieldValue == null) {
- jTextFieldValue = new JTextField();
- jTextFieldValue.setBounds(new java.awt.Rectangle(250, 365, 140, 20));
- }
- return jTextFieldValue;
- }
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(400, 365, 80, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(490, 365, 80, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- * This method initializes jButtonHelp
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonHelp() {
- if (jButtonHelp == null) {
- jButtonHelp = new JButton();
- jButtonHelp.setBounds(new java.awt.Rectangle(300,405,120,20));
- jButtonHelp.setText("Help");
- jButtonHelp.addActionListener(this);
- }
- return jButtonHelp;
- }
-
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- public static ToolChainConfig getInstance() {
- if (tcc == null) {
- tcc = new ToolChainConfig();
- }
- return tcc;
- }
-
- /**
- * This is the default constructor
- */
- public ToolChainConfig() {
- super();
- init();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(600, 480);
- this.setContentPane(getJContentPane());
- this.setTitle("Tool Chain Configuration");
- this.centerWindow();
-
- //
- // Read default file
- //
- File f = new File(currentFile);
- if (f.exists()) {
- try {
- vtcc.removeAll();
- vtcc.parseFile(this.currentFile);
- this.setTitle("Tool Chain Configuration" + " [" + currentFile + "]");
- } catch (IOException e) {
- Log.log(this.currentFile + "Read Error", e.getMessage());
- e.printStackTrace();
- }
- } else {
- Log.log("File Open Error: ", this.currentFile + " File Not Found");
- }
-
- showTable();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelValue = new JLabel();
- jLabelValue.setBounds(new java.awt.Rectangle(205, 365, 40, 20));
- jLabelValue.setText("Value");
- jLabelName = new JLabel();
- jLabelName.setBounds(new java.awt.Rectangle(15, 365, 40, 20));
- jLabelName.setText("Name");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(getJButtonOpen(), null);
- jContentPane.add(getJButtonSave(), null);
- jContentPane.add(getJButtonClose(), null);
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJTextFieldName(), null);
- jContentPane.add(jLabelValue, null);
- jContentPane.add(getJTextFieldValue(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonHelp(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonClose) {
- this.exit();
- }
-
- if (arg0.getSource() == jButtonOpen) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);
- fc.addChoosableFileFilter(iff);
- fc.setCurrentDirectory(new File(toolsDir));
-
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- try {
- vtcc.removeAll();
- vtcc.parseFile(fc.getSelectedFile().getPath());
- currentFile = fc.getSelectedFile().getPath();
- this.setTitle("Tool Chain Configuration" + " [" + currentFile + "]");
- } catch (IOException e) {
- Log.wrn(this.currentFile + "Read Error", e.getMessage());
- Log.err(this.currentFile + "Read Error", e.getMessage());
- return;
- }
- this.showTable();
- }
- }
-
- if (arg0.getSource() == jButtonSave) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- IFileFilter iff = new IFileFilter(DataType.TEXT_FILE_EXT);
- fc.addChoosableFileFilter(iff);
- fc.setCurrentDirectory(new File(toolsDir));
-
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- currentFile = fc.getSelectedFile().getPath();
- currentFile = Tools.addPathExt(currentFile, DataType.RETURN_TYPE_TEXT);
- try {
- vtcc.saveFile(currentFile);
- } catch (IOException e) {
- Log.wrn(this.currentFile + "Write Error", e.getMessage());
- Log.err(this.currentFile + "Write Error", e.getMessage());
- return;
- }
- }
- }
-
- if (arg0.getSource() == jButtonAdd) {
- if (check()) {
- String[] row = { jTextFieldName.getText(), jTextFieldValue.getText() };
- this.vtcc.addToolChainConfigs(new ToolChainConfigId(row[0], row[1]));
- this.model.addRow(row);
- }
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- if (selectedRow > -1) {
- this.model.removeRow(selectedRow);
- this.vtcc.removeToolChainConfigs(selectedRow);
- selectedRow = -1;
- }
- }
-
- if (arg0.getSource() == jButtonHelp) {
- tcch = ToolChainConfigHelp.getInstance();
- tcch.setVisible(true);
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vtcc.size() > 0) {
- for (int index = 0; index < vtcc.size(); index++) {
- model.addRow(vtcc.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Check if name or value is empty
-
- @return
-
- **/
- private boolean check() {
- if (isEmpty(this.jTextFieldName.getText())) {
- Log.wrn("Add Tool Chain", "The Property Name must be entered!");
- return false;
- }
-
- if (isEmpty(this.jTextFieldValue.getText())) {
- Log.wrn("Add Tool Chain", "The Property Value must be entered!");
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- public void tableChanged(TableModelEvent arg0) {
- int row = arg0.getFirstRow();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
- this.vtcc.getToolChainConfigs(row).setName(m.getValueAt(row, 0).toString());
- this.vtcc.getToolChainConfigs(row).setValue(m.getValueAt(row, 1).toString());
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to popup warning message to confirm quit
- *
- */
- public void windowClosing(WindowEvent arg0) {
- this.exit();
- }
-
- private void exit() {
- this.setVisible(false);
- if (tcch != null) {
- tcch.dispose();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java
deleted file mode 100644
index 0156cc902f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/ToolChainConfigHelp.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.tianocore.frameworkwizard;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JTextPane;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import javax.swing.JButton;
-
-
-public class ToolChainConfigHelp extends JFrame implements ActionListener {
-
- ///
- ///
- ///
- private static final long serialVersionUID = -6315081029366587222L;
-
- private JPanel jContentPane = null;
-
- private String helpContent = "";
-
- private JTextPane jTextPane = null;
-
- private JButton jButtonClose = null;
-
- private static ToolChainConfigHelp tcch = null;
-
- /**
- * This method initializes jTextPane
- *
- * @return javax.swing.JTextPane
- */
- private JTextPane getJTextPane() {
- if (jTextPane == null) {
- jTextPane = new JTextPane();
- jTextPane.setBounds(new java.awt.Rectangle(10,10,600,420));
- jTextPane.setBackground(new java.awt.Color(238,238,238));
- jTextPane.setEditable(false);
- helpContent = helpContent
- + "The template for the Property is: TARGET_TAGNAME_ARCH_COMMAND_ATTR" + DataType.UNIX_LINE_SEPARATOR
- + "The Value, is either a full path, full path and filename or a reserved word." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "TARGET - DEBUG and RELEASE are predefined, however the user may define one or more of their own TARGET types in this file." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "TAGNAME - HOST, MSFT, GCC, INTC are predefined, however the user may define one or more of their own TAGNAME keywords in this file." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "ARCH - EDK II supports IA32, X64, IPF and EBC at this time." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "COMMAND - Predefined command codes are listed in the tools_def.txt file, however the user can specify additional command codes for their one, non-standard tools." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "ATTR - Predefined Attributes are listed in the tools_def.txt file." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "NOTE: The TAGNAME: HOST is reserved and MUST be defined in order to build the included Tiano tools from their C source files. These tools have been built and tested using both Microsoft and GCC tool chains." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR
- + "NOTE: The \"*\" symbol may be used as a wildcard character in most of these fields, refer to the tools_def.txt and the \"EDK II Build and Packaging Architecture Specification\" for more details." + DataType.UNIX_LINE_SEPARATOR
- + DataType.UNIX_LINE_SEPARATOR;
-
- jTextPane.setText(helpContent);
- }
- return jTextPane;
- }
-
- /**
- * This method initializes jButtonClose
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonClose() {
- if (jButtonClose == null) {
- jButtonClose = new JButton();
- jButtonClose.setBounds(new java.awt.Rectangle(480,450,80,20));
- jButtonClose.setText("Close");
- jButtonClose.addActionListener(this);
- }
- return jButtonClose;
- }
-
- public static ToolChainConfigHelp getInstance() {
- if (tcch == null) {
- tcch = new ToolChainConfigHelp();
- }
- return tcch;
- }
-
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
- ToolChainConfigHelp tcch = new ToolChainConfigHelp();
- tcch.setVisible(true);
- }
-
- /**
- * This is the default constructor
- */
- public ToolChainConfigHelp() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(625, 520);
- this.setResizable(false);
- this.setTitle("How to Modify a Tool Chain Configuration");
- this.setContentPane(getJContentPane());
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextPane(), null);
- jContentPane.add(getJButtonClose(), null);
- }
- return jContentPane;
- }
-
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonClose) {
- this.dispose();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
deleted file mode 100644
index 03a64a69a6..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataType.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/** @file
-
- The file is used to define all used final variables
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-/**
- The class is used to define all used final variables
-
- **/
-public class DataType {
-
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
-
- }
-
- //
- // Define all return types
- //
- public static final int RETURN_TYPE_OK = 1;
-
- public static final int RETURN_TYPE_CANCEL = 2;
-
- public static final int RETURN_TYPE_NEXT = 3;
-
- public static final int RETURN_TYPE_BACK = 4;
-
- public static final int RETURN_TYPE_MODULE_SURFACE_AREA = 11;
-
- public static final int RETURN_TYPE_PACKAGE_SURFACE_AREA = 12;
-
- public static final int RETURN_TYPE_PLATFORM_SURFACE_AREA = 13;
-
- public static final int RETURN_TYPE_BUILD_XML = 14;
-
- public static final int RETURN_TYPE_WORKSPACE = 15;
-
- public static final int RETURN_TYPE_TEXT = 16;
-
- public static final int RETURN_TYPE_FAR_SURFACE_AREA = 17;
-
-
- //
- // Define all used final variables
- //
- public static final String DOS_LINE_SEPARATOR = "\r\n";
-
- public static final String UNIX_LINE_SEPARATOR = "\n";
-
- public static final String LINE_SEPARATOR = UNIX_LINE_SEPARATOR;
-
- public static final String HTML_LINE_SEPARATOR = "<br>";
-
- public static final String EMPTY_SELECT_ITEM = "----";
-
- public static final String DOS_FILE_SEPARATOR = "\\";
-
- public static final String UNIX_FILE_SEPARATOR = "/";
-
- //
- // Define xml files ext
- //
- public static final String COPY_OF = "Copy of ";
-
- public static final String FILE_EXT_SEPARATOR = ".";
-
- public static final String WORKSPACE = "Workspace";
-
- public static final String MODULE_SURFACE_AREA = "Module Surface Area Description";
-
- public static final String MODULE_SURFACE_AREA_EXT = "msa";
-
- public static final String MODULE_SURFACE_AREA_EXT_DESCRIPTION = MODULE_SURFACE_AREA + " (*."
- + MODULE_SURFACE_AREA_EXT + ")";
-
- public static final String PACKAGE_SURFACE_AREA = "Package Surface Area Description";
-
- public static final String PACKAGE_SURFACE_AREA_EXT = "spd";
-
- public static final String PACKAGE_SURFACE_AREA_EXT_DESCRIPTION = PACKAGE_SURFACE_AREA + " (*."
- + PACKAGE_SURFACE_AREA_EXT + ")";
-
- public static final String PLATFORM_SURFACE_AREA = "Platform Surface Area Description";
-
- public static final String PLATFORM_SURFACE_AREA_EXT = "fpd";
-
- public static final String PLATFORM_SURFACE_AREA_EXT_DESCRIPTION = PLATFORM_SURFACE_AREA + " (*."
- + PLATFORM_SURFACE_AREA_EXT + ")";
-
- public static final String ANT_BUILD_FILE = "ANT Build File";
-
- public static final String ANT_BUILD_FILE_EXT = "xml";
-
- public static final String ANT_BUILD_FILE_EXT_DESCRIPTION = ANT_BUILD_FILE + " (*." + ANT_BUILD_FILE_EXT + ")";
-
- public static final String TEXT_FILE = "Text File";
-
- public static final String TEXT_FILE_EXT = "txt";
-
- public static final String TEXT_FILE_EXT_DESCRIPTION = TEXT_FILE + " (*." + TEXT_FILE_EXT + ")";
-
- public static final String FAR_SURFACE_AREA = "Framework Archive";
-
- public static final String FAR_SURFACE_AREA_EXT = "far";
-
- public static final String FAR_SURFACE_AREA_EXT_DESCRIPTION = FAR_SURFACE_AREA + " (*." + FAR_SURFACE_AREA_EXT + ")";
- //
- // Define file separator for current OS
- //
- public static String FILE_SEPARATOR = System.getProperty("file.separator");
-
- //
- // Defien all used frame, container component's sizes
- //
- public static final int MAIN_FRAME_PREFERRED_SIZE_WIDTH = 800;
-
- public static final int MAIN_FRAME_PREFERRED_SIZE_HEIGHT = 600;
-
- public static final int MAIN_FRAME_MAX_SIZE_WIDTH = 1920;
-
- public static final int MAIN_FRAME_MAX_SIZE_HEIGHT = 1200;
-
- public static final int MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH = 790;
-
- public static final int MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT = 545;
-
- public static final int MAIN_FRAME_WIDTH_SPACING = MAIN_FRAME_PREFERRED_SIZE_WIDTH
- - MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_WIDTH;
-
- public static final int MAIN_FRAME_HEIGHT_SPACING = MAIN_FRAME_PREFERRED_SIZE_HEIGHT
- - MAIN_FRAME_SPLIT_PANEL_PREFERRED_SIZE_HEIGHT;
-
- public static final int MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_WIDTH = 273;
-
- public static final int MAIN_FRAME_TREE_PANEL_PREFERRED_SIZE_HEIGHT = 545;
-
- public static final int MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_WIDTH = 515;
-
- public static final int MAIN_FRAME_EDITOR_PANEL_PREFERRED_SIZE_HEIGHT = 545;
-
- public static final int MAIN_FRAME_EDITOR_PANEL_LOCATION_X = 260;
-
- public static final int MAIN_FRAME_EDITOR_PANEL_LOCATION_Y = 1;
-
- public static final int SPACE_TO_RIGHT_FOR_GENERATE_BUTTON = 10;
-
- public static final int SPACE_TO_RIGHT_FOR_OK_BUTTON = 10;
-
- public static final int SPACE_TO_RIGHT_FOR_ADD_BUTTON = 200;
-
- public static final int SPACE_TO_RIGHT_FOR_REMOVE_BUTTON = 105;
-
- public static final int SPACE_TO_RIGHT_FOR_UPDATE_BUTTON = 10;
-
- public static final int SPACE_TO_BOTTOM_FOR_ADD_BUTTON = 30;
-
- public static final int SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON = 30;
-
- public static final int SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON = 30;
-
- public static final int SPACE_TO_RIGHT_FOR_CLOSE_BUTTON = 240;
-
- public static final int SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON = 25;
-
- public static final int SPACE_TO_RIGHT_FOR_PROTOCOL_NOTIFY = 25;
-
- public static final int LEFT_WIDTH = 160;
-
- public static final int LEFT_HEIGHT = 20;
-
- public static final int RIGHT_WIDTH = 320;
-
- public static final int RIGHT_HEIGHT = 20;
-
- public static final int RIGHT_MULTIPLE_HEIGHT = 4 * RIGHT_HEIGHT;
-
- public static final int BUTTON_GEN_WIDTH = 65;
-
- public static final int BUTTON_GEN_HEIGHT = 20;
-
- public static final int BUTTON_BROWSE_WIDTH = 65;
-
- public static final int BUTTON_BROWSE_HEIGHT = 20;
-
- public static final int BUTTON_ADD_WIDTH = 80;
-
- public static final int BUTTON_ADD_HEIGHT = 20;
-
- public static final int BUTTON_UPDATE_WIDTH = 80;
-
- public static final int BUTTON_UPDATE_HEIGHT = 20;
-
- public static final int BUTTON_REMOVE_WIDTH = 80;
-
- public static final int BUTTON_REMOVE_HEIGHT = 20;
-
- public static final int SCROLLBAR_WIDTH = 18;
-
- public static final int SCROLLBAR_HEIGHT = 18;
-
- //
- // Common Help Text
- // First defined here
- // Will be replaced by resource file later
- //
- public static final String SUP_ARCH_LIST_HELP_TEXT = "<html>Selecting a checkbox is a restriction of only the selected architectures;<br>If none of boxes are selected, all architectures are supported.<html>";
-
- //
- // Project name and version
- //
- public static final String PROJECT_NAME = "Framework Wizard";
-
- public static final String PROJECT_VERSION = "1.0";
-
- //
- // Sort Type
- //
- public static final int SORT_TYPE_ASCENDING = 1;
-
- public static final int SORT_TYPE_DESCENDING = 2;
-
- //
- // Module Type
- //
- public static final String MODULE_TYPE_LIBRARY = "Library";
-
- public static final String MODULE_TYPE_MODULE = "Module";
-
- //
- // Hex String Header
- //
- public static final String HEX_STRING_HEADER = "0x";
-
- //
- // The String of Boolean
- //
- public static final String TRUE = "True";
-
- public static final String FALSE = "False";
-
- //
- // The String for USAGE type
- //
- public final static String USAGE_TYPE_ALWAYS_CONSUMED = "ALWAYS_CONSUMED";
-
- public final static String USAGE_TYPE_SOMETIMES_CONSUMED = "SOMETIMES_CONSUMED";
-
- public final static String USAGE_TYPE_ALWAYS_PRODUCED = "ALWAYS_PRODUCED";
-
- public final static String USAGE_TYPE_SOMETIMES_PRODUCED = "SOMETIMES_PRODUCED";
-
- public final static String USAGE_TYPE_PRIVATE = "PRIVATE";
-
- public final static String USAGE_TYPE_TO_START = "TO_START";
-
- public final static String USAGE_TYPE_BY_START = "BY_START";
-
- //
- // The String for PCD type
- //
- public final static String PCD_ITEM_TYPE_FEATURE_FLAG = "FEATURE_FLAG";
-
- public final static String PCD_ITEM_TYPE_FIXED_AT_BUILD = "FIXED_AT_BUILD";
-
- public final static String PCD_ITEM_TYPE_PATCHABLE_IN_MODULE = "PATCHABLE_IN_MODULE";
-
- public final static String PCD_ITEM_TYPE_DYNAMIC = "DYNAMIC";
-
- public final static String PCD_ITEM_TYPE_DYNAMIC_EX = "DYNAMIC_EX";
-
- //
- // The String for PPI type
- //
- public final static String PPI_TYPE_PPI = "Ppi";
-
- public final static String PPI_TYPE_PPI_NOTIFY = "Ppi Notify";
-
- //
- // The String for Protocol type
- //
- public final static String PROTOCOL_TYPE_PROTOCOL = "Protocol";
-
- public final static String PROTOCOL_TYPE_PROTOCOL_NOTIFY = "Protocol Notify";
-
- //
- // The default file name for guids.xref file
- //
- public final static String GUIDS_XREF_FILE_NAME = "guids.xref";
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
deleted file mode 100644
index 82724d4338..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/DataValidation.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/** @file
-
- The file is used to provides all kinds of Data Validation interface
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- The class is used to provides all kinds of data validation interface
-
- <p>All provided interfaces are in static mode</p>
-
- **/
-public class DataValidation {
-
- /**
- Reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
-
- }
-
- //
- // The below is used to check common data types
- //
-
- /**
- Check if the imput data is int
-
- @param strInt The input string which needs validation
-
- @retval true - The input is Int
- @retval false - The input is not Int
-
- **/
- public static boolean isInt(String strInt) {
- return isMatch("^-?[0-9]\\d*$", strInt);
- }
-
- /**
- Check if the input data is int and it is in the valid scope
- The scope is provided by String
-
- @param strNumber The input string which needs validation
- @param BeginNumber The left boundary of the scope
- @param EndNumber The right boundary of the scope
-
- @retval true - The input is Int and in the scope;
- @retval false - The input is not Int or not in the scope
-
- **/
- public static boolean isInt(String strNumber, int BeginNumber, int EndNumber) {
- //
- //Check if the input data is int first
- //
- if (!isInt(strNumber)) {
- return false;
- }
- //
- //And then check if the data is between the scope
- //
- Integer intTemp = new Integer(strNumber);
- if ((intTemp.intValue() < BeginNumber) || (intTemp.intValue() > EndNumber)) {
- return false;
- }
- return true;
- }
-
- /**
- Check if the input data is long int and it is in the valid scope
- The scope is provided by String
-
- @param strNumber The input string which needs validation
- @param BeginNumber The left boundary of the scope
- @param EndNumber The right boundary of the scope
-
- @retval true - The input is Int and in the scope;
- @retval false - The input is not Int or not in the scope
-
- **/
- public static boolean isLongInt(String strNumber, long BeginNumber, long EndNumber) throws Exception{
- //
- //Check if the input data is int first
- //
- if (!isInt(strNumber)) {
- return false;
- }
- //
- //And then check if the data is between the scope
- //
- try {
- Long intTemp = new Long(strNumber);
- if ((intTemp.longValue() < BeginNumber) || (intTemp.longValue() > EndNumber)) {
- return false;
- }
- }
- catch (Exception e) {
- throw e;
- }
-
- return true;
- }
- /**
- Check if the input data is int and it is in the valid scope
- The scope is provided by String
-
- @param strNumber The input string which needs validation
- @param strBeginNumber The left boundary of the scope
- @param strEndNumber The right boundary of the scope
-
- @retval true - The input is Int and in the scope;
- @retval false - The input is not Int or not in the scope
-
- **/
- public static boolean isInt(String strNumber, String strBeginNumber, String strEndNumber) {
- //
- //Check if all input data are int
- //
- if (!isInt(strNumber)) {
- return false;
- }
- if (!isInt(strBeginNumber)) {
- return false;
- }
- if (!isInt(strEndNumber)) {
- return false;
- }
- //
- //And then check if the data is between the scope
- //
- Integer intI = new Integer(strNumber);
- Integer intJ = new Integer(strBeginNumber);
- Integer intK = new Integer(strEndNumber);
- if ((intI.intValue() < intJ.intValue()) || (intI.intValue() > intK.intValue())) {
- return false;
- }
- return true;
- }
-
- /**
- Use regex to check if the input data is in valid format
-
- @param strPattern The input regex
- @param strMatcher The input data need be checked
-
- @retval true - The data matches the regex
- @retval false - The data doesn't match the regex
-
- **/
- public static boolean isMatch(String strPattern, String strMatcher) {
- Pattern pattern = Pattern.compile(strPattern);
- Matcher matcher = pattern.matcher(strMatcher);
-
- return matcher.find();
- }
-
- //
- // The below is used to check common customized data types
- //
-
- /**
- Check if the input data is UiNameType
-
- @param arg0 The input string need be checked
-
- @retval true - The input is UiNameType
- @retval false - The input is not UiNameType
-
- **/
- public static boolean isUiNameType(String arg0) {
- if (arg0.length() < 1) {
- return false;
- }
- return isMatch("[^ ].*", arg0);
- }
-
- /**
- Check if the input data is GuidType2
-
- @param arg0 The input string need be checked
-
- @retval true - The input is GuidType2
- @retval false - The input is not GuidType2
-
- **/
- public static boolean isGuidType2(String arg0) {
- return isMatch("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", arg0);
- }
-
- /**
- Check if the input data is Guid
-
- @param strGuid The input string need be checked
-
- @retval true - The input is Guid
- @retval false - The input is not Guid
-
- **/
- public static boolean isGuid(String arg0) {
- return isGuidType2(arg0);
- }
-
- /**
- Check if the input data is Version
-
- @param arg0 The input string need be checked
-
- @retval true - The input is Version
- @retval false - The input is not Version
-
- **/
- public static boolean isVersionDataType(String arg0) {
- return isMatch("\\d+(\\.\\d+)*", arg0);
- }
-
- /**
- Check if the input data is Sentence
-
- @param strSentence The input string need be checked
-
- @retval true - The input is Sentence
- @retval false - The input is not Sentence
-
- **/
- public static boolean isSentence(String arg0) {
- return isMatch("(\\w+\\W*)+( )+(\\W*\\w*\\W*\\s*)*", arg0);
- }
-
- /**
- Check if the input data is FileNameConventio
-
- @param strSentence The input string need be checked
-
- @retval true - The input is FileNameConventio
- @retval false - The input is not FileNameConventio
-
- **/
- public static boolean isFileNameConvention(String arg0) {
- return isMatch("[a-zA-Z](\\.?[-_a-zA-Z0-9]+)*", arg0);
- }
-
- /**
- Check if the input data is KeywordType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is KeywordType
- @retval false - The input is not KeywordType
-
- **/
- public static boolean isKeywordType(String arg0) {
- return isMatch("[a-zA-Z]+(_*[a-zA-Z0-9]*)*", arg0);
- }
-
- /**
- Check if the input data is FeatureFlagExpressionType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is FeatureFlagExpressionType
- @retval false - The input is not FeatureFlagExpressionType
-
- **/
- public static boolean isFeatureFlagExpressionType(String arg0) {
- return (arg0.length() >= 1);
- }
-
- /**
- Check if the input data is FeatureFlag
-
- @param strSentence The input string need be checked
-
- @retval true - The input is FeatureFlag
- @retval false - The input is not FeatureFlag
-
- **/
- public static boolean isFeatureFlag(String arg0) {
- return isFeatureFlagExpressionType(arg0);
- }
-
- /**
- Check if the input data is PathAndFilename
-
- @param strSentence The input string need be checked
-
- @retval true - The input is PathAndFilename
- @retval false - The input is not PathAndFilename
-
- **/
- public static boolean isPathAndFilename(String arg0) {
- return !arg0.equals("");
- }
-
- /**
- Check if the input data is ToolsNameConvention
-
- @param strSentence The input string need be checked
-
- @retval true - The input is ToolsNameConvention
- @retval false - The input is not ToolsNameConvention
-
- **/
- public static boolean isToolsNameConvention(String arg0) {
- return isMatch("[a-zA-Z][a-zA-Z0-9]*", arg0);
- }
-
- /**
- Check if the input data is C_NameType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is C_NameType
- @retval false - The input is not C_NameType
-
- **/
- public static boolean isC_NameType(String arg0) {
- return isMatch("(_)*[a-zA-Z]+((_)*[a-zA-Z0-9]*)*", arg0);
- }
-
- /**
- Check if the input data is HexWordArrayType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is HexWordArrayType
- @retval false - The input is not HexWordArrayType
-
- **/
- public static boolean isHexWordArrayType(String arg0) {
- return arg0.length() >=6 && isMatch("((\\s)*0x([a-fA-F0-9]){4}(,)?(\\s)*)+", arg0);
- }
-
- /**
- Check if the input data is Hex64BitDataType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is Hex64BitDataType
- @retval false - The input is not Hex64BitDataType
-
- **/
- public static boolean isHex64BitDataType(String arg0) {
- return isMatch("(0x)?[a-fA-F0-9]{1,16}", arg0);
- }
-
- /**
- Check if the input data is UnicodeString
-
- @param strSentence The input string need be checked
-
- @retval true - The input is UnicodeString
- @retval false - The input is not UnicodeString
-
- **/
- public static boolean isUnicodeString(String arg0) {
- return arg0.length() >= 3 && isMatch("(\\s)*L(\\:)?\"[^\"]*\"(\\s)*", arg0);
- }
-
- /**
- Check if the input data is HexByteArrayType
-
- @param strSentence The input string need be checked
-
- @retval true - The input is HexByteArrayType
- @retval false - The input is not HexByteArrayType
-
- **/
- public static boolean isHexByteArrayType(String arg0) {
- return arg0.length() >= 4 && isMatch("((\\s)*0x([a-fA-F0-9]){2}(,)?(\\s)*)+", arg0);
- }
-
-
- /**
- Check if the input data is DateType
-
- @param strDateType The input string need be checked
-
- @retval true - The input is DateType
- @retval false - The input is not DateType
-
- **/
- public static boolean isDateType(String strDateType) {
- return isMatch("[1-9][0-9][0-9][0-9]-[0-1][0-9]-[0-3][0-9] [0-2][0-9]:[0-5][0-9]", strDateType);
- }
-
- /**
- Check if the input data is DosPath
-
- @param strDosPath The input string need be checked
-
- @retval true - The input is DosPath
- @retval false - The input is not DosPath
-
- **/
- public static boolean isDosPath(String strDosPath) {
- return isMatch("([a-zA-Z]:\\\\)?(((\\\\?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*", strDosPath);
- }
-
- /**
- Check if the input data is UnixPath
-
- @param strUnixPath The input string need be checked
-
- @retval true - The input is UnixPath
- @retval false - The input is not UnixPath
-
- **/
- public static boolean isUnixPath(String strUnixPath) {
- return isMatch("(\\/)?(((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*", strUnixPath);
- }
-
- /**
- Check if the input data is DirectoryNamingConvention
-
- @param strDirectoryNamingConvention The input string need be checked
-
- @retval true - The input is DirectoryNamingConvention
- @retval false - The input is not DirectoryNamingConvention
-
- **/
- public static boolean isDirectoryNamingConvention(String strDirectoryNamingConvention) {
- return (isDosPath(strDirectoryNamingConvention) || isUnixPath(strDirectoryNamingConvention));
- }
-
- /**
- Check if the input data is HexDoubleWordDataType
-
- @param strHexDoubleWordDataType The input string need be checked
-
- @retval true - The input is HexDoubleWordDataType
- @retval false - The input is not HexDoubleWordDataType
-
- **/
- public static boolean isHexDoubleWordDataType(String strHexDoubleWordDataType) {
- return isMatch("0x[a-fA-F0-9]{1,8}", strHexDoubleWordDataType);
- }
-
- /**
- Check if the input data is V1
-
- @param strV1 The input string need be checked
-
- @retval true - The input is V1
- @retval false - The input is not V1
-
- **/
- public static boolean isV1(String strV1) {
- return isMatch("((%[A-Z](_*[A-Z0-9]*)*%)+((((\\\\)?_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\\\)?)*)", strV1);
- }
-
- /**
- Check if the input data is V2
-
- @param strV2 The input string need be checked
-
- @retval true - The input is V2
- @retval false - The input is not V2
-
- **/
- public static boolean isV2(String strV2) {
- return isMatch(
- "(($[A-Z](_*[A-Z0-9]*)*)+||($\\([A-Z](_*[A-Z0-9]*)*\\))+||($\\{[A-Z](_*[A-Z0-9]*)*\\})+)+(\\/)?(((((_*-*.*[a-zA-Z0-9]*)*(_*-*.*[a-zA-Z0-9])*)+(\\/)?)*)*)",
- strV2);
- }
-
- /**
- Check if the input data is VariableConvention
-
- @param strVariableConvention The input string need be checked
-
- @retval true - The input is VariableConvention
- @retval false - The input is not VariableConvention
-
- **/
- public static boolean isVariableConvention(String strVariableConvention) {
- return (isV1(strVariableConvention) || isV2(strVariableConvention));
- }
-
- /**
- Check if the input data is UCName
-
- @param strUCName The input string need be checked
-
- @retval true - The input is UCName
- @retval false - The input is not UCName
-
- **/
- public static boolean isUCName(String strUCName) {
- return isMatch("[A-Z]+(_*[A-Z0-9]*( )*)*", strUCName);
- }
-
- /**
- Check if the input data is HexByteDataType
-
- @param strHex64BitDataType The input string need be checked
-
- @retval true - The input is HexByteDataType
- @retval false - The input is not HexByteDataType
-
- **/
- public static boolean isHexByteDataType(String strHex64BitDataType) {
- return isMatch("(0x)?[a-fA-F0-9]{1,2}", strHex64BitDataType);
- }
-
- /**
- Check if the input data is HexWordDataType
-
- @param strHexWordDataType The input string need be checked
-
- @retval true - The input is HexWordDataType
- @retval false - The input is not HexWordDataType
-
- **/
- public static boolean isHexWordDataType(String strHexWordDataType) {
- return isMatch("0x[a-fA-F0-9]{1,4}", strHexWordDataType);
- }
-
- /**
- Check if the input data is OverrideID
-
- @param strOverrideID The input string need be checked
-
- @retval true - The input is OverrideID
- @retval false - The input is not OverrideID
-
- **/
- public static boolean isOverrideID(String strOverrideID) {
- return isInt(strOverrideID);
- }
-
- /**
- Check if the input data is Supported Architectures
-
- @param strSupportedArchitectures
- @retval true - The input is Supported Architectures
- @retval false - The input isn't Supported Architectures
-
- */
- public static boolean isSupportedArchitectures(String strSupportedArchitectures) {
- return isMatch("(ALL){1}|(((IA32)|((X64)|(IPF)|(EBC)){1}((,((IA32)|(X64)|(IPF)|(EBC)){1} ){0,2}))){1}",
- strSupportedArchitectures);
- }
-
- //
- //The below is used to check msaheader data type
- //
-
- /**
- Check if the input data is BaseName
-
- @param strBaseName The input string need be checked
-
- @retval true - The input is BaseName
- @retval false - The input is not BaseName
-
- **/
- public static boolean isBaseName(String arg0) {
- return isUiNameType(arg0);
- }
-
- /**
- Check if the input data is Version
-
- @param arg0 The input string need be checked
-
- @retval true - The input is Version
- @retval false - The input is not Version
-
- **/
- public static boolean isVersion(String arg0) {
- return isVersionDataType(arg0);
- }
-
- /**
- Check if the input data is Abstract
-
- @param strAbstract The input string need be checked
-
- @retval true - The input is Abstract
- @retval false - The input is not Abstract
-
- **/
- public static boolean isAbstract(String arg0) {
- return isSentence(arg0);
- }
-
- /**
- Check if the input data is Copyright
-
- @param strCopyright The input string need be checked
-
- @retval true - The input is Copyright
- @retval false - The input is not Copyright
-
- **/
- public static boolean isCopyright(String arg0) {
- return !arg0.equals("");
- }
-
- /**
- Check if the input data is Specification
-
- @param strCopyright The input string need be checked
-
- @retval true - The input is Specification
- @retval false - The input is not Specification
-
- **/
- public static boolean isSpecification(String arg0) {
- return isSentence(arg0);
- }
-
- //
- // The below is used to check ModuleDefinitions data types
- //
- /**
- Check if the input data is OutputFileBasename
-
- @param strCopyright The input string need be checked
-
- @retval true - The input is OutputFileBasename
- @retval false - The input is not OutputFileBasename
-
- **/
- public static boolean isOutputFileBasename(String arg0) {
- return isFileNameConvention(arg0);
- }
-
- //
- // The below is used to check LibraryClass data types
- //
- /**
- Check if the input data is LibraryClass
-
- @param strCopyright The input string need be checked
-
- @retval true - The input is LibraryClass
- @retval false - The input is not LibraryClass
-
- **/
- public static boolean isLibraryClass(String arg0) {
- return isKeywordType(arg0);
- }
-
- /**
- Check if the input data is RecommendedInstanceVersion
-
- @param strCopyright The input string need be checked
-
- @retval true - The input is RecommendedInstanceVersion
- @retval false - The input is not RecommendedInstanceVersion
-
- **/
- public static boolean isRecommendedInstanceVersion(String arg0) {
- return isVersionDataType(arg0);
- }
-
- //
- // The below is used to check sourcefiles data types
- //
-
- /**
- Check if the input data is Filename
-
- @param strPath The input string need be checked
-
- @retval true - The input is Filename
- @retval false - The input is not Filename
-
- **/
- public static boolean isFilename(String arg0) {
- return isPathAndFilename(arg0);
- }
-
- /**
- Check if the input data is TagName
-
- @param strPath The input string need be checked
-
- @retval true - The input is TagName
- @retval false - The input is not TagName
-
- **/
- public static boolean isTagName(String arg0) {
- return isToolsNameConvention(arg0);
- }
-
- /**
- Check if the input data is ToolCode
-
- @param strPath The input string need be checked
-
- @retval true - The input is ToolCode
- @retval false - The input is not ToolCode
-
- **/
- public static boolean isToolCode(String arg0) {
- return isToolsNameConvention(arg0);
- }
-
- /**
- Check if the input data is ToolChainFamily
-
- @param strPath The input string need be checked
-
- @retval true - The input is ToolChainFamily
- @retval false - The input is not ToolChainFamily
-
- **/
- public static boolean isToolChainFamily(String arg0) {
- return isToolsNameConvention(arg0);
- }
-
- //
- // The below is used to check pcdcoded data types
- //
- /**
- Check if the input data is DefaultValueType
-
- @param strPath The input string need be checked
-
- @retval true - The input is DefaultValueType
- @retval false - The input is not DefaultValueType
-
- **/
- public static boolean isDefaultValueType(String arg0) {
- return isHex64BitDataType(arg0) || isUnicodeString(arg0) || isHexByteArrayType(arg0);
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
deleted file mode 100644
index 7eae384c7d..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/EnumerationData.java
+++ /dev/null
@@ -1,1123 +0,0 @@
-/** @file
-
- The file is used to init all JComboBox items
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-import java.util.Vector;
-
-public class EnumerationData {
- //
- // Static data for externs definitions
- //
- public final static String EXTERNS_PCD_IS_DRIVER = "Pcd Is Driver";
-
- public final static String EXTERNS_SPECIFICATION = "Specification";
-
- public final static String EXTERNS_IMAGE = "Image";
-
- public final static String EXTERNS_MODULE_ENTRY_POINT = "ModuleEntryPoint";
-
- public final static String EXTERNS_MODULE_UNLOAD_IMAGE = "ModuleUnloadImage";
-
- public final static String EXTERNS_LIBRARY = "Library";
-
- public final static String EXTERNS_CONSTRUCTOR = "Constructor";
-
- public final static String EXTERNS_DESTRUCTOR = "Destructor";
-
- public final static String EXTERNS_DRIVER = "Driver";
-
- public final static String EXTERNS_DRIVER_BINDING = "DriverBinding";
-
- public final static String EXTERNS_COMPONENT_NAME = "ComponentName";
-
- public final static String EXTERNS_DRIVER_CONFIG = "DriverConfig";
-
- public final static String EXTERNS_DRIVER_DIAG = "DriverDiag";
-
- public final static String EXTERNS_CALL_BACK = "Call Back";
-
- public final static String EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK = "VirtualAddressMap";
-
- public final static String EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK = "ExitBootServices";
-
- //
- // Static data for guid type
- //
- public final static String GUID_TYPE_DATA_HUB_RECORD = "DATA_HUB_RECORD";
-
- public final static String GUID_TYPE_EFI_EVENT = "EFI_EVENT";
-
- public final static String GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE = "EFI_SYSTEM_CONFIGURATION_TABLE";
-
- public final static String GUID_TYPE_EFI_VARIABLE = "EFI_VARIABLE";
-
- public final static String GUID_TYPE_GUID = "GUID";
-
- public final static String GUID_TYPE_HII_PACKAGE_LIST = "HII_PACKAGE_LIST";
-
- public final static String GUID_TYPE_HOB = "HOB";
-
- public final static String GUID_TYPE_TOKEN_SPACE_GUID = "TOKEN_SPACE_GUID";
-
- //
- // Static data for build targets
- //
- public final static String BUILD_TARGET_DEBUG = "DEBUG";
-
- public final static String BUILD_TARGET_RELEASE = "RELEASE";
-
- //
- // Common data
- //
- public Vector<String> vSupportedArchitectures = new Vector<String>();
-
- public Vector<String> vEnabled = new Vector<String>();
-
- public Vector<String> vBoolean = new Vector<String>();
-
- //
- // Used by Msa Header
- //
- public Vector<String> vModuleType = new Vector<String>();
-
- public Vector<String> vCompontentType = new Vector<String>();
-
- //
- // Used by Library Class Definitions
- //
- public Vector<String> vLibraryUsage = new Vector<String>();
-
- public Vector<String> vFrameworkModuleTypes = new Vector<String>();
-
- public Vector<String> vLibClassDef = new Vector<String>();
-
- public Vector<String> vLibClassDefBase = new Vector<String>();
-
- public Vector<String> vLibClassDefPei = new Vector<String>();
-
- public Vector<String> vLibClassDefPeim = new Vector<String>();
-
- public Vector<String> vLibClassDefDxeCore = new Vector<String>();
-
- public Vector<String> vLibClassDefDxeDriver = new Vector<String>();
-
- public Vector<String> vLibClassDefDxeSmmDriver = new Vector<String>();
-
- public Vector<String> vLibClassDefUefiDriver = new Vector<String>();
-
- //
- // Used by Source Files
- //
- public Vector<String> vSourceFilesToolChainFamily = new Vector<String>();
-
- public Vector<String> vSourceFilesFileType = new Vector<String>();
-
- public Vector<String> vToolCode = new Vector<String>();
-
- //
- // Used by Package Dependencies
- //
- public Vector<String> vPackageUsage = new Vector<String>();
-
- //
- // Used by Protocols
- //
- public Vector<String> vProtocolUsage = new Vector<String>();
-
- public Vector<String> vProtocolNotifyUsage = new Vector<String>();
-
- public Vector<String> vProtocolType = new Vector<String>();
-
- //
- // Used by Events
- //
- public Vector<String> vEventType = new Vector<String>();
-
- public Vector<String> vEventUsage = new Vector<String>();
-
- public Vector<String> vEventGroup = new Vector<String>();
-
- //
- // Used by Hobs
- //
- public Vector<String> vHobType = new Vector<String>();
-
- public Vector<String> vHobUsage = new Vector<String>();
-
- //
- // Used by Ppis
- //
- public Vector<String> vPpiType = new Vector<String>();
-
- public Vector<String> vPpiUsage = new Vector<String>();
-
- public Vector<String> vPpiNotifyUsage = new Vector<String>();
-
- //
- // Used by Variable
- //
- public Vector<String> vVariableUsage = new Vector<String>();
-
- //
- // Used by Boot Mode
- //
- public Vector<String> vBootModeNames = new Vector<String>();
-
- public Vector<String> vBootModeUsage = new Vector<String>();
-
- //
- // Used by System Tables
- //
- public Vector<String> vSystemTableUsage = new Vector<String>();
-
- //
- // Used by Data Hubs
- //
- public Vector<String> vDataHubUsage = new Vector<String>();
-
- //
- // Used by Hii Packages
- //
- public Vector<String> vHiiPackageUsage = new Vector<String>();
-
- //
- // Used by Guid
- //
- public Vector<String> vGuidUsage = new Vector<String>();
-
- //
- // Used by Externs
- //
- public Vector<String> vExternTypes = new Vector<String>();
-
- public Vector<String> vPcdDriverTypes = new Vector<String>();
-
- //
- // Used by Pcd
- //
- public Vector<String> vPcdItemTypes = new Vector<String>();
-
- public Vector<String> vPcdUsage = new Vector<String>();
-
- //
- // Used by Build Options
- //
- public Vector<String> vBuildTargets = new Vector<String>();
-
- public EnumerationData() {
- init();
- }
-
- private void init() {
- //
- // Init common data first
- //
- initSupportedArchitectures();
- initEnabled();
- initBoolean();
-
- //
- // Used by Msa header
- //
- initModuleType();
-
- //
- // Used by Library Class Definitions
- //
- initLibraryUsage();
- initFrameworkModuleTypes();
- initLibClassDefBase();
- initLibClassDefPei();
- initLibClassDefPeim();
- initLibClassDefDxeCore();
- initLibClassDefDxeDriver();
- initLibClassDefDxeSmmDriver();
- initLibClassDefUefiDriver();
- initLibClassDef();
-
- //
- // Used by Library Class Definitions
- //
- initSourceFilesToolChainFamily();
- initSourceFilesFileType();
- initToolCode();
-
- //
- // Used by Package Dependencies
- //
- initPackageUsage();
-
- //
- // Used by Protocols
- //
- initProtocolType();
- initProtocolUsage();
- initProtocolNotifyUsage();
-
- //
- // Used by Events
- //
- initEventType();
- initEventUsage();
- initEventGroup();
-
- //
- // Used by Hobs
- //
- initHobType();
- initHobUsage();
-
- //
- // Used by Ppis
- //
- initPpiType();
- initPpiUsage();
- initPpiNotifyUsage();
-
- //
- // Used by Variable
- //
- initVariableUsage();
-
- //
- // Used by Boot Mode
- //
- initBootModeNames();
- initBootModeUsage();
-
- //
- // Used by System Tables
- //
- initSystemTableUsage();
-
- //
- // Used by Data Hubs
- //
- initDataHubUsage();
-
- //
- // Used by Hii Packages
- //
- initHiiPackages();
-
- //
- // Used by Guid
- //
- initGuidUsage();
-
- //
- // Used by Externs
- //
- initExternTypes();
- initPcdDriverTypes();
-
- //
- // Used by Pcd
- //
- initPcdItemTypes();
- initPcdUsage();
-
- //
- // Used by Build Option
- //
- initBuildTargets();
- }
-
- private void initEnabled() {
- vEnabled.removeAllElements();
- vEnabled.addElement("Disabled");
- vEnabled.addElement("Enabled");
- }
-
- private void initBoolean() {
- vBoolean.removeAllElements();
- vBoolean.addElement(DataType.FALSE);
- vBoolean.addElement(DataType.TRUE);
- }
-
- private void initModuleType() {
- vModuleType.removeAllElements();
- vModuleType.addElement("BASE");
- vModuleType.addElement("SEC");
- vModuleType.addElement("PEI_CORE");
- vModuleType.addElement("PEIM");
- vModuleType.addElement("DXE_CORE");
- vModuleType.addElement("DXE_DRIVER");
- vModuleType.addElement("DXE_RUNTIME_DRIVER");
- vModuleType.addElement("DXE_SAL_DRIVER");
- vModuleType.addElement("DXE_SMM_DRIVER");
- vModuleType.addElement("TOOL");
- vModuleType.addElement("UEFI_DRIVER");
- vModuleType.addElement("UEFI_APPLICATION");
- vModuleType.addElement("USER_DEFINED");
- Sort.sortVectorString(vModuleType, DataType.SORT_TYPE_ASCENDING);
- }
-
- // private void initComponentType() {
- // vCompontentType.removeAllElements();
- // vCompontentType.addElement("APRIORI");
- // vCompontentType.addElement("LIBRARY");
- // vCompontentType.addElement("FV_IMAGE_FILE");
- // vCompontentType.addElement("BS_DRIVER");
- // vCompontentType.addElement("RT_DRIVER");
- // vCompontentType.addElement("SAL_RT_DRIVER");
- // vCompontentType.addElement("PE32_PEIM");
- // vCompontentType.addElement("PIC_PEIM");
- // vCompontentType.addElement("COMBINED_PEIM_DRIVER");
- // vCompontentType.addElement("PEI_CORE");
- // vCompontentType.addElement("DXE_CORE");
- // vCompontentType.addElement("APPLICATION");
- // vCompontentType.addElement("BS_DRIVER_EFI");
- // vCompontentType.addElement("SHELLAPP");
- // }
-
- private void initSupportedArchitectures() {
- vSupportedArchitectures.removeAllElements();
- vSupportedArchitectures.addElement("EBC");
- vSupportedArchitectures.addElement("IA32");
- vSupportedArchitectures.addElement("X64");
- vSupportedArchitectures.addElement("IPF");
- vSupportedArchitectures.addElement("ARM");
- vSupportedArchitectures.addElement("PPC");
- }
-
- private void initLibraryUsage() {
- vLibraryUsage.removeAllElements();
- vLibraryUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vLibraryUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vLibraryUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vLibraryUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vLibraryUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initFrameworkModuleTypes() {
- vFrameworkModuleTypes.removeAllElements();
- vFrameworkModuleTypes.addElement("BASE");
- vFrameworkModuleTypes.addElement("SEC");
- vFrameworkModuleTypes.addElement("PEI_CORE");
- vFrameworkModuleTypes.addElement("PEIM");
- vFrameworkModuleTypes.addElement("DXE_CORE");
- vFrameworkModuleTypes.addElement("DXE_DRIVER");
- vFrameworkModuleTypes.addElement("DXE_RUNTIME_DRIVER");
- vFrameworkModuleTypes.addElement("DXE_SAL_DRIVER");
- vFrameworkModuleTypes.addElement("DXE_SMM_DRIVER");
- vFrameworkModuleTypes.addElement("UEFI_DRIVER");
- vFrameworkModuleTypes.addElement("UEFI_APPLICATION");
- vFrameworkModuleTypes.addElement("USER_DEFINED");
- Sort.sortVectorString(vFrameworkModuleTypes, DataType.SORT_TYPE_ASCENDING);
- }
-
- private void initLibClassDef() {
- vLibClassDef.removeAllElements();
- for (int index = 0; index < vLibClassDefBase.size(); index++) {
- vLibClassDef.addElement(vLibClassDefBase.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefPei.size(); index++) {
- vLibClassDef.addElement(vLibClassDefPei.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefPeim.size(); index++) {
- vLibClassDef.addElement(vLibClassDefPeim.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefDxeCore.size(); index++) {
- vLibClassDef.addElement(vLibClassDefDxeCore.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefDxeDriver.size(); index++) {
- vLibClassDef.addElement(vLibClassDefDxeDriver.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefDxeSmmDriver.size(); index++) {
- vLibClassDef.addElement(vLibClassDefDxeSmmDriver.elementAt(index));
- }
- for (int index = 0; index < vLibClassDefUefiDriver.size(); index++) {
- vLibClassDef.addElement(vLibClassDefUefiDriver.elementAt(index));
- }
- }
-
- private void initLibClassDefBase() {
- vLibClassDefBase.removeAllElements();
- vLibClassDefBase.addElement("BaseLib");
- vLibClassDefBase.addElement("BaseMemoryLib");
- vLibClassDefBase.addElement("CacheMaintenanceLib");
- vLibClassDefBase.addElement("DebugLib");
- vLibClassDefBase.addElement("IoLib");
- vLibClassDefBase.addElement("PcdLib");
- vLibClassDefBase.addElement("PciCf8Lib");
- vLibClassDefBase.addElement("PciExpressLib");
- vLibClassDefBase.addElement("PciLib");
- vLibClassDefBase.addElement("PeCoffGetEntryPointLib");
- vLibClassDefBase.addElement("PeCoffLib");
- vLibClassDefBase.addElement("PerformanceLib");
- vLibClassDefBase.addElement("PrintLib");
- vLibClassDefBase.addElement("SmbusLib");
- vLibClassDefBase.addElement("TimerLib");
- }
-
- private void initLibClassDefPei() {
- vLibClassDefPei.removeAllElements();
- vLibClassDefPei.addElement("PeiCoreEntryPoint");
- }
-
- private void initLibClassDefPeim() {
- vLibClassDefPeim.removeAllElements();
- vLibClassDefPeim.addElement("BaseMemoryLib");
- vLibClassDefPeim.addElement("DebugLib");
- vLibClassDefPeim.addElement("HobLib");
- vLibClassDefPeim.addElement("IoLib");
- vLibClassDefPeim.addElement("MemoryAllocationLib");
- vLibClassDefPeim.addElement("PcdLib");
- vLibClassDefPeim.addElement("PeiCoreLib");
- vLibClassDefPeim.addElement("PeiServicesTablePointerLib");
- vLibClassDefPeim.addElement("PeimEntryPoint");
- vLibClassDefPeim.addElement("ReportStatusCodeLib");
- vLibClassDefPeim.addElement("ResourcePublicationLib");
- vLibClassDefPeim.addElement("SmbusLib");
- }
-
- private void initLibClassDefDxeCore() {
- vLibClassDefDxeCore.removeAllElements();
- vLibClassDefDxeCore.addElement("DxeCoreEntryPoint");
- vLibClassDefDxeCore.addElement("HobLib");
- }
-
- private void initLibClassDefDxeDriver() {
- vLibClassDefDxeDriver.removeAllElements();
- vLibClassDefDxeDriver.addElement("DxeServicesTableLib");
- vLibClassDefDxeDriver.addElement("HiiLib");
- vLibClassDefDxeDriver.addElement("HobLib");
- vLibClassDefDxeDriver.addElement("IoLib");
- vLibClassDefDxeDriver.addElement("MemoryAllocationLib");
- vLibClassDefDxeDriver.addElement("PcdLib");
- vLibClassDefDxeDriver.addElement("ReportStatusCodeLib");
- vLibClassDefDxeDriver.addElement("SmbusLib");
- vLibClassDefDxeDriver.addElement("UefiBootServicesTableLib");
- vLibClassDefDxeDriver.addElement("UefiDecompressLib");
- vLibClassDefDxeDriver.addElement("UefiRuntimeServicesTableLib");
- }
-
- private void initLibClassDefDxeSmmDriver() {
- vLibClassDefDxeSmmDriver.removeAllElements();
- vLibClassDefDxeSmmDriver.addElement("DxeSmmDriverEntryPoint");
- }
-
- private void initLibClassDefUefiDriver() {
- vLibClassDefUefiDriver.removeAllElements();
- vLibClassDefUefiDriver.addElement("BaseMemoryLib");
- vLibClassDefUefiDriver.addElement("DebugLib");
- vLibClassDefUefiDriver.addElement("DevicePathLib");
- vLibClassDefUefiDriver.addElement("UefiDriverEntryPoint");
- vLibClassDefUefiDriver.addElement("UefiDriverModelLib");
- vLibClassDefUefiDriver.addElement("UefiLib");
- }
-
- private void initSourceFilesToolChainFamily() {
- vSourceFilesToolChainFamily.removeAllElements();
- vSourceFilesToolChainFamily.addElement("MSFT");
- vSourceFilesToolChainFamily.addElement("INTC");
- vSourceFilesToolChainFamily.addElement("GCC");
- }
-
- private void initSourceFilesFileType() {
- vSourceFilesFileType.removeAllElements();
- vSourceFilesFileType.addElement("CCODE");
- vSourceFilesFileType.addElement("CHEADER");
- vSourceFilesFileType.addElement("ASMHEADER");
- vSourceFilesFileType.addElement("ASM");
- vSourceFilesFileType.addElement("UNI");
- vSourceFilesFileType.addElement("TXT");
- vSourceFilesFileType.addElement("DXS");
- vSourceFilesFileType.addElement("BMP");
- vSourceFilesFileType.addElement("VFR");
- vSourceFilesFileType.addElement("BINARY");
- vSourceFilesFileType.addElement("FV");
- vSourceFilesFileType.addElement("FFS");
- vSourceFilesFileType.addElement("EFI");
- }
-
- private void initToolCode() {
- vToolCode.removeAllElements();
- vToolCode.addElement(DataType.EMPTY_SELECT_ITEM);
- // vToolCode.addElement("Build_CCode");
- // vToolCode.addElement("Build_AUTOGEN");
- // vToolCode.addElement("Build_DPX");
- // vToolCode.addElement("Build_ASM");
- // vToolCode.addElement("Build_Assembly");
- // vToolCode.addElement("Build_Gcc_Assembly");
- // vToolCode.addElement("Build_IPF_Assembly_Code");
- // vToolCode.addElement("Build_IPF_PP_Code");
- // vToolCode.addElement("Build_Library");
- // vToolCode.addElement("Build_UNI");
- // vToolCode.addElement("Build_Unicode_Database");
- // vToolCode.addElement("Build_VFR");
- // vToolCode.addElement("Build_DUMMY");
- vToolCode.addElement("CC");
- vToolCode.addElement("DLINK");
- vToolCode.addElement("SLINK");
- vToolCode.addElement("PP");
- vToolCode.addElement("ASM");
- vToolCode.addElement("ASMLINK");
- vToolCode.addElement("ASL");
- }
-
- private void initPackageUsage() {
- vPackageUsage.removeAllElements();
- vPackageUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vPackageUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- }
-
- private void initProtocolUsage() {
- vProtocolUsage.removeAllElements();
- vProtocolUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_TO_START);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_BY_START);
- vProtocolUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initProtocolType() {
- vProtocolType.removeAllElements();
- vProtocolType.addElement(DataType.PROTOCOL_TYPE_PROTOCOL);
- vProtocolType.addElement(DataType.PROTOCOL_TYPE_PROTOCOL_NOTIFY);
- }
-
- private void initEventType() {
- vEventType.removeAllElements();
- vEventType.addElement("CreateEvents");
- vEventType.addElement("SignalEvents");
- }
-
- private void initEventUsage() {
- vEventUsage.removeAllElements();
- vEventUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vEventUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vEventUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vEventUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vEventUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initEventGroup() {
- vEventGroup.removeAllElements();
- vEventGroup.addElement("EVENT_GROUP_GUID");
- vEventGroup.addElement("EVENT_TYPE_PERIODIC_TIMER");
- vEventGroup.addElement("EVENT_TYPE_RELATIVE_TIMER");
- }
-
- private void initHobType() {
- vHobType.removeAllElements();
- vHobType.addElement("PHIT");
- vHobType.addElement("MEMORY_ALLOCATION");
- vHobType.addElement("RESOURCE_DESCRIPTOR");
- vHobType.addElement("GUID_EXTENSION");
- vHobType.addElement("FIRMWARE_VOLUME");
- vHobType.addElement("CPU");
- vHobType.addElement("POOL");
- vHobType.addElement("CAPSULE_VOLUME");
- }
-
- private void initHobUsage() {
- vHobUsage.removeAllElements();
- vHobUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vHobUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vHobUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vHobUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vHobUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initPpiType() {
- vPpiType.removeAllElements();
- vPpiType.addElement(DataType.PPI_TYPE_PPI);
- vPpiType.addElement(DataType.PPI_TYPE_PPI_NOTIFY);
- }
-
- private void initPpiUsage() {
- vPpiUsage.removeAllElements();
- vPpiUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vPpiUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vPpiUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vPpiUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vPpiUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initPpiNotifyUsage() {
- vPpiNotifyUsage.removeAllElements();
- vPpiNotifyUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- }
-
- private void initProtocolNotifyUsage() {
- vProtocolNotifyUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- }
-
- private void initVariableUsage() {
- vVariableUsage.removeAllElements();
- vVariableUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vVariableUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vVariableUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vVariableUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vVariableUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initBootModeNames() {
- vBootModeNames.removeAllElements();
- vBootModeNames.addElement("FULL");
- vBootModeNames.addElement("MINIMAL");
- vBootModeNames.addElement("NO_CHANGE");
- vBootModeNames.addElement("DIAGNOSTICS");
- vBootModeNames.addElement("DEFAULT");
- vBootModeNames.addElement("S2_RESUME");
- vBootModeNames.addElement("S3_RESUME");
- vBootModeNames.addElement("S4_RESUME");
- vBootModeNames.addElement("S5_RESUME");
- vBootModeNames.addElement("FLASH_UPDATE");
- vBootModeNames.addElement("RECOVERY_FULL");
- vBootModeNames.addElement("RECOVERY_MINIMAL");
- vBootModeNames.addElement("RECOVERY_NO_CHANGE");
- vBootModeNames.addElement("RECOVERY_DIAGNOSTICS");
- vBootModeNames.addElement("RECOVERY_DEFAULT");
- vBootModeNames.addElement("RECOVERY_S2_RESUME");
- vBootModeNames.addElement("RECOVERY_S3_RESUME");
- vBootModeNames.addElement("RECOVERY_S4_RESUME");
- vBootModeNames.addElement("RECOVERY_S5_RESUME");
- vBootModeNames.addElement("RECOVERY_FLASH_UPDATE");
- }
-
- private void initBootModeUsage() {
- vBootModeUsage.removeAllElements();
- vBootModeUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vBootModeUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vBootModeUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vBootModeUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- }
-
- private void initSystemTableUsage() {
- vSystemTableUsage.removeAllElements();
- vSystemTableUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vSystemTableUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vSystemTableUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vSystemTableUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vSystemTableUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initDataHubUsage() {
- vDataHubUsage.removeAllElements();
- vDataHubUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vDataHubUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vDataHubUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vDataHubUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vDataHubUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initHiiPackages() {
- vHiiPackageUsage.removeAllElements();
- vHiiPackageUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vHiiPackageUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vHiiPackageUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initGuidUsage() {
- vGuidUsage.removeAllElements();
- vGuidUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vGuidUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vGuidUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vGuidUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- vGuidUsage.addElement(DataType.USAGE_TYPE_PRIVATE);
- }
-
- private void initExternTypes() {
- vExternTypes.removeAllElements();
-
- vExternTypes.addElement(EnumerationData.EXTERNS_SPECIFICATION);
- vExternTypes.addElement(EnumerationData.EXTERNS_IMAGE);
- vExternTypes.addElement(EnumerationData.EXTERNS_DRIVER);
- vExternTypes.addElement(EnumerationData.EXTERNS_LIBRARY);
- vExternTypes.addElement(EnumerationData.EXTERNS_CALL_BACK);
- }
-
- private void initPcdDriverTypes() {
- vPcdDriverTypes.removeAllElements();
- vPcdDriverTypes.addElement("PEI_PCD_DRIVER");
- vPcdDriverTypes.addElement("DXE_PCD_DRIVER");
- }
-
- private void initPcdItemTypes() {
- vPcdItemTypes.removeAllElements();
- vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG);
- vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_FIXED_AT_BUILD);
- vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_PATCHABLE_IN_MODULE);
- vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC);
- vPcdItemTypes.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC_EX);
- }
-
- private void initPcdUsage() {
- vPcdUsage.removeAllElements();
- vPcdUsage.addElement(DataType.USAGE_TYPE_ALWAYS_CONSUMED);
- vPcdUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_CONSUMED);
- vPcdUsage.addElement(DataType.USAGE_TYPE_ALWAYS_PRODUCED);
- vPcdUsage.addElement(DataType.USAGE_TYPE_SOMETIMES_PRODUCED);
- }
-
- private void initBuildTargets() {
- vBuildTargets.removeAllElements();
- vBuildTargets.addElement(EnumerationData.BUILD_TARGET_DEBUG);
- vBuildTargets.addElement(EnumerationData.BUILD_TARGET_RELEASE);
- }
-
- public Vector<String> getvCompontentType() {
- return vCompontentType;
- }
-
- public void setvCompontentType(Vector<String> componentType) {
- vCompontentType = componentType;
- }
-
- public Vector<String> getVModuleType() {
- return vModuleType;
- }
-
- public void setVModuleType(Vector<String> moduleType) {
- vModuleType = moduleType;
- }
-
- public Vector<String> getVLibraryUsage() {
- return vLibraryUsage;
- }
-
- public void setVLibClassDefUsage(Vector<String> libClassDefUsage) {
- vLibraryUsage = libClassDefUsage;
- }
-
- public Vector<String> getVLibClassDef() {
- return vLibClassDef;
- }
-
- public void setVLibClassDef(Vector<String> libClassDef) {
- vLibClassDef = libClassDef;
- }
-
- public Vector<String> getVCompontentType() {
- return vCompontentType;
- }
-
- public void setVCompontentType(Vector<String> compontentType) {
- vCompontentType = compontentType;
- }
-
- public Vector<String> getVLibClassDefBase() {
- return vLibClassDefBase;
- }
-
- public void setVLibClassDefBase(Vector<String> libClassDefBase) {
- vLibClassDefBase = libClassDefBase;
- }
-
- public Vector<String> getVLibClassDefDxeCore() {
- return vLibClassDefDxeCore;
- }
-
- public void setVLibClassDefDxeCore(Vector<String> libClassDefDxeCore) {
- vLibClassDefDxeCore = libClassDefDxeCore;
- }
-
- public Vector<String> getVLibClassDefDxeDriver() {
- return vLibClassDefDxeDriver;
- }
-
- public void setVLibClassDefDxeDriver(Vector<String> libClassDefDxeDriver) {
- vLibClassDefDxeDriver = libClassDefDxeDriver;
- }
-
- public Vector<String> getVLibClassDefDxeSmmDriver() {
- return vLibClassDefDxeSmmDriver;
- }
-
- public void setVLibClassDefDxeSmmDriver(Vector<String> libClassDefDxeSmmDriver) {
- vLibClassDefDxeSmmDriver = libClassDefDxeSmmDriver;
- }
-
- public Vector<String> getVLibClassDefPei() {
- return vLibClassDefPei;
- }
-
- public void setVLibClassDefPei(Vector<String> libClassDefPei) {
- vLibClassDefPei = libClassDefPei;
- }
-
- public Vector<String> getVLibClassDefPeim() {
- return vLibClassDefPeim;
- }
-
- public void setVLibClassDefPeim(Vector<String> libClassDefPeim) {
- vLibClassDefPeim = libClassDefPeim;
- }
-
- public Vector<String> getVLibClassDefUefiDriver() {
- return vLibClassDefUefiDriver;
- }
-
- public void setVLibClassDefUefiDriver(Vector<String> libClassDefUefiDriver) {
- vLibClassDefUefiDriver = libClassDefUefiDriver;
- }
-
- public Vector<String> getVSourceFilesFileType() {
- return vSourceFilesFileType;
- }
-
- public void setVSourceFilesFileType(Vector<String> sourceFilesFileType) {
- vSourceFilesFileType = sourceFilesFileType;
- }
-
- public Vector<String> getVSourceFilesToolChainFamily() {
- return vSourceFilesToolChainFamily;
- }
-
- public void setVSourceFilesToolChainFamily(Vector<String> sourceFilesToolChainFamily) {
- vSourceFilesToolChainFamily = sourceFilesToolChainFamily;
- }
-
- public void setVLibraryUsage(Vector<String> libraryUsage) {
- vLibraryUsage = libraryUsage;
- }
-
- public Vector<String> getVProtocolNotifyUsage() {
- return vProtocolNotifyUsage;
- }
-
- public void setVProtocolNotifyUsage(Vector<String> protocolNotifyUsage) {
- vProtocolNotifyUsage = protocolNotifyUsage;
- }
-
- public Vector<String> getVProtocolUsage() {
- return vProtocolUsage;
- }
-
- public void setVProtocolUsage(Vector<String> protocolUsage) {
- vProtocolUsage = protocolUsage;
- }
-
- public Vector<String> getVSupportedArchitectures() {
- return vSupportedArchitectures;
- }
-
- public void setVSupportedArchitectures(Vector<String> supportedArchitectures) {
- vSupportedArchitectures = supportedArchitectures;
- }
-
- public Vector<String> getVProtocolType() {
- return vProtocolType;
- }
-
- public void setVProtocolType(Vector<String> protocolType) {
- vProtocolType = protocolType;
- }
-
- public Vector<String> getVEventGroup() {
- return vEventGroup;
- }
-
- public void setVEventGroup(Vector<String> eventGroup) {
- vEventGroup = eventGroup;
- }
-
- public Vector<String> getVEventType() {
- return vEventType;
- }
-
- public void setVEventType(Vector<String> eventType) {
- vEventType = eventType;
- }
-
- public Vector<String> getVEventUsage() {
- return vEventUsage;
- }
-
- public void setVEventUsage(Vector<String> eventUsage) {
- vEventUsage = eventUsage;
- }
-
- public Vector<String> getVEnabled() {
- return vEnabled;
- }
-
- public void setVEnabled(Vector<String> enabled) {
- vEnabled = enabled;
- }
-
- public Vector<String> getVHobType() {
- return vHobType;
- }
-
- public void setVHobType(Vector<String> hobType) {
- vHobType = hobType;
- }
-
- public Vector<String> getVHobUsage() {
- return vHobUsage;
- }
-
- public void setVHobUsage(Vector<String> hobUsage) {
- vHobUsage = hobUsage;
- }
-
- public Vector<String> getVPpiNotifyUsage() {
- return vPpiNotifyUsage;
- }
-
- public void setVPpiNotifyUsage(Vector<String> ppiNotifyUsage) {
- vPpiNotifyUsage = ppiNotifyUsage;
- }
-
- public Vector<String> getVPpiType() {
- return vPpiType;
- }
-
- public void setVPpiType(Vector<String> ppiType) {
- vPpiType = ppiType;
- }
-
- public Vector<String> getVPpiUsage() {
- return vPpiUsage;
- }
-
- public void setVPpiUsage(Vector<String> ppiUsage) {
- vPpiUsage = ppiUsage;
- }
-
- public Vector<String> getVVariableUsage() {
- return vVariableUsage;
- }
-
- public void setVVariableUsage(Vector<String> variableUsage) {
- vVariableUsage = variableUsage;
- }
-
- public Vector<String> getVBootModeNames() {
- return vBootModeNames;
- }
-
- public void setVBootModeNames(Vector<String> bootModeNames) {
- vBootModeNames = bootModeNames;
- }
-
- public Vector<String> getVBootModeUsage() {
- return vBootModeUsage;
- }
-
- public void setVBootModeUsage(Vector<String> bootModeUsage) {
- vBootModeUsage = bootModeUsage;
- }
-
- public Vector<String> getVSystemTableUsage() {
- return vSystemTableUsage;
- }
-
- public void setVSystemTableUsage(Vector<String> systemTableUsage) {
- vSystemTableUsage = systemTableUsage;
- }
-
- public Vector<String> getVDataHubUsage() {
- return vDataHubUsage;
- }
-
- public void setVDataHubUsage(Vector<String> dataHubUsage) {
- vDataHubUsage = dataHubUsage;
- }
-
- public Vector<String> getVGuidUsage() {
- return vGuidUsage;
- }
-
- public void setVGuidUsage(Vector<String> guidUsage) {
- vGuidUsage = guidUsage;
- }
-
- public Vector<String> getVHiiPackageUsage() {
- return vHiiPackageUsage;
- }
-
- public void setVHiiPackageUsage(Vector<String> hiiPackageUsage) {
- vHiiPackageUsage = hiiPackageUsage;
- }
-
- public Vector<String> getVPcdItemTypes() {
- return vPcdItemTypes;
- }
-
- public void setVPcdItemTypes(Vector<String> pcdItemTypes) {
- vPcdItemTypes = pcdItemTypes;
- }
-
- public Vector<String> getVExternTypes() {
- return vExternTypes;
- }
-
- public void setVExternTypes(Vector<String> externTypes) {
- vExternTypes = externTypes;
- }
-
- public Vector<String> getVPcdDriverTypes() {
- return vPcdDriverTypes;
- }
-
- public void setVPcdDriverTypes(Vector<String> pcdDriverTypes) {
- vPcdDriverTypes = pcdDriverTypes;
- }
-
- public Vector<String> getVBoolean() {
- return vBoolean;
- }
-
- public void setVBoolean(Vector<String> boolean1) {
- vBoolean = boolean1;
- }
-
- public Vector<String> getVFrameworkModuleTypes() {
- return vFrameworkModuleTypes;
- }
-
- public void setVFrameworkModuleTypes(Vector<String> frameworkModuleTypes) {
- vFrameworkModuleTypes = frameworkModuleTypes;
- }
-
- public Vector<String> getVPackageUsage() {
- return vPackageUsage;
- }
-
- public void setVPackageUsage(Vector<String> packageUsage) {
- vPackageUsage = packageUsage;
- }
-
- public Vector<String> getVToolCode() {
- return vToolCode;
- }
-
- public void setVToolCode(Vector<String> toolCode) {
- vToolCode = toolCode;
- }
-
- public Vector<String> getVPcdUsage() {
- return vPcdUsage;
- }
-
- public void setVPcdUsage(Vector<String> pcdUsage) {
- vPcdUsage = pcdUsage;
- }
-
- public Vector<String> getVBuildTargets() {
- return vBuildTargets;
- }
-
- public void setVBuildTargets(Vector<String> buildTargets) {
- vBuildTargets = buildTargets;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java
deleted file mode 100644
index 7f15de8f89..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/FileOperation.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/** @file
-
- The file is used to provides interfaces for file operations
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-
-public class FileOperation {
-
- /**
-
- @param args
- * @throws Exception
-
- **/
- public static void main(String[] args) throws Exception {
- FileOperation.newFolder("C:\\aaa\\aaa\\aaa\\aaa\\aaa");
- }
-
- /**
- To new a folder
-
- @param folderPath The folder path to be created
- @throws Exception
-
- **/
- public static void newFolder(String folderPath) throws Exception {
- folderPath = Tools.convertPathToCurrentOsType(folderPath);
- File f = new File(folderPath);
- f.mkdirs();
- }
-
- /**
- Delete a file
-
- @param filePath The file path to be deleted
- @throws Exception
-
- **/
- public static void delFile(String filePath) throws Exception {
- File f = new File(filePath);
- if (f.exists()) {
- f.delete();
- }
- }
-
- /**
- Delete a folder and all its files
-
- @param filePath The name of the folder which need be deleted
- @throws Exception
-
- **/
- public static void delFolder(String filePath) throws Exception {
- File f = new File(filePath);
- if (!f.exists()) {
- return;
- }
- if (!f.isDirectory()) {
- return;
- }
- delFolder(f);
- }
-
- /**
- Delete a folder and all its files
-
- @param fleFolderName The name of the folder which need be deleted
-
- @retval true - Delete successfully
- @retval false - Delete successfully
-
- **/
- private static boolean delFolder(File fileName) throws Exception {
- boolean blnIsDeleted = true;
-
- File[] aryAllFiles = fileName.listFiles();
-
- for (int indexI = 0; indexI < aryAllFiles.length; indexI++) {
- if (blnIsDeleted) {
- if (aryAllFiles[indexI].isDirectory()) {
- //
- //If is a directory, recursively call this function to delete sub folders
- //
- blnIsDeleted = delFolder(aryAllFiles[indexI]);
- } else if (aryAllFiles[indexI].isFile()) {
- //
- //If is a file, delete it
- //
- if (!aryAllFiles[indexI].delete()) {
- blnIsDeleted = false;
- }
- }
- }
- }
- if (blnIsDeleted) {
- fileName.delete();
- }
- return blnIsDeleted;
- }
-
- /**
- Copy a file
-
- @param oldPath
- @param newPath
- @throws Exception
-
- **/
- public static void copyFile(String oldPath, String newPath) throws Exception {
- oldPath = Tools.convertPathToCurrentOsType(oldPath);
- newPath = Tools.convertPathToCurrentOsType(newPath);
-
- int byteCount = 0;
- File oldFile = new File(oldPath);
-
- File newFile = new File(Tools.getFilePathOnly(newPath));
- if (!newFile.exists()) {
- newFolder(Tools.getFilePathOnly(newPath));
- }
-
- if (oldFile.exists()) {
- InputStream is = new FileInputStream(oldPath);
- FileOutputStream fos = new FileOutputStream(newPath);
- byte[] buffer = new byte[1024];
-
- while ((byteCount = is.read(buffer)) != -1) {
- fos.write(buffer, 0, byteCount);
- }
-
- is.close();
- }
- }
-
- /**
- Copy a folder
-
- @param oldPath
- @param newPath
- @throws Exception
-
- **/
- public static void copyFolder(String oldPath, String newPath) throws Exception {
- File oldFile = new File(oldPath);
-
- //
- // Create new file path first
- //
- newFolder(newPath);
-
- String[] files = oldFile.list();
- File temp = null;
- for (int index = 0; index < files.length; index++) {
- if (oldPath.endsWith(DataType.FILE_SEPARATOR)) {
- temp = new File(oldPath + files[index]);
- } else {
- temp = new File(oldPath + DataType.FILE_SEPARATOR + files[index]);
- }
-
- if (temp.isFile()) {
- FileInputStream fis = new FileInputStream(temp);
- FileOutputStream fos = new FileOutputStream(newPath + DataType.FILE_SEPARATOR
- + (temp.getName()).toString());
- byte[] b = new byte[1024 * 5];
- int len;
- while ((len = fis.read(b)) != -1) {
- fos.write(b, 0, len);
- }
- fos.flush();
- fos.close();
- fis.close();
- }
- if (temp.isDirectory()) {
- copyFolder(oldPath + DataType.FILE_SEPARATOR + files[index], newPath + DataType.FILE_SEPARATOR
- + files[index]);
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
deleted file mode 100644
index ed175e5343..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/GlobalData.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/** @file
- The file is used to provide initializing global data.
-
- 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.
- **/
-package org.tianocore.frameworkwizard.common;
-
-import java.io.IOException;
-import java.util.Vector;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.MsaFilesDocument.MsaFiles;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleList;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageList;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformList;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class GlobalData {
-
- public static FrameworkDatabase fdb = null;
-
- public static OpeningModuleList openingModuleList = new OpeningModuleList();
-
- public static OpeningPackageList openingPackageList = new OpeningPackageList();
-
- public static OpeningPlatformList openingPlatformList = new OpeningPlatformList();
-
- public static Vector<ModuleIdentification> vModuleList = new Vector<ModuleIdentification>();
-
- public static Vector<PackageIdentification> vPackageList = new Vector<PackageIdentification>();
-
- public static Vector<PlatformIdentification> vPlatformList = new Vector<PlatformIdentification>();
-
- public static void init() {
- initDatabase();
- initPackage();
- initPlatform();
- initModule();
- }
-
- public static void initDatabase() {
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
- try {
- fdb = OpenFile.openFrameworkDb(strFrameworkDbFilePath);
- } catch (XmlException e) {
- Log.err("Open Framework Database " + strFrameworkDbFilePath, e.getMessage());
- return;
- } catch (Exception e) {
- Log.err("Open Framework Database " + strFrameworkDbFilePath, "Invalid file type");
- return;
- }
- }
-
- public static void initModule() {
- vModuleList = new Vector<ModuleIdentification>();
- openingModuleList = new OpeningModuleList();
-
- ModuleSurfaceArea msa = null;
- Vector<String> modulePaths = new Vector<String>();
- Identification id = null;
- ModuleIdentification mid = null;
- String packagePath = null;
- String modulePath = null;
-
- //
- // For each package, get all modules list
- //
- if (vPackageList.size() > 0) {
- for (int indexI = 0; indexI < vPackageList.size(); indexI++) {
- packagePath = vPackageList.elementAt(indexI).getPath();
- modulePaths = getAllModulesOfPackage(packagePath);
-
- for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
- try {
- modulePath = modulePaths.get(indexJ);
- msa = OpenFile.openMsaFile(modulePath);
-
- } catch (IOException e) {
- Log.err("Open Module Surface Area " + modulePath, e.getMessage());
- continue;
- } catch (XmlException e) {
- Log.err("Open Module Surface Area " + modulePath, e.getMessage());
- continue;
- } catch (Exception e) {
- Log.err("Open Module Surface Area " + modulePath, "Invalid file type");
- continue;
- }
- id = Tools.getId(modulePath, msa);
- mid = new ModuleIdentification(id, vPackageList.elementAt(indexI));
- vModuleList.addElement(mid);
- openingModuleList.insertToOpeningModuleList(mid, msa);
- }
- }
- Sort.sortModules(vModuleList, DataType.SORT_TYPE_ASCENDING);
- }
- }
-
- public static void initPackage() {
- vPackageList = new Vector<PackageIdentification>();
- openingPackageList = new OpeningPackageList();
- if (fdb != null) {
- for (int index = 0; index < fdb.getPackageList().getFilenameList().size(); index++) {
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + fdb.getPackageList().getFilenameArray(index).getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
- PackageSurfaceArea spd = null;
- PackageIdentification id = null;
- try {
- spd = OpenFile.openSpdFile(path);
- } catch (IOException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- continue;
- } catch (XmlException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- continue;
- } catch (Exception e) {
- Log.err("Open Package Surface Area " + path, "Invalid file type");
- continue;
- }
- id = Tools.getId(path, spd);
- vPackageList.addElement(id);
- openingPackageList.insertToOpeningPackageList(id, spd);
- }
- Sort.sortPackages(vPackageList, DataType.SORT_TYPE_ASCENDING);
- }
- }
-
- public static void initPlatform() {
- vPlatformList = new Vector<PlatformIdentification>();
- openingPlatformList = new OpeningPlatformList();
-
- if (fdb != null) {
- for (int index = 0; index < fdb.getPlatformList().getFilenameList().size(); index++) {
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR
- + fdb.getPlatformList().getFilenameArray(index).getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
- PlatformSurfaceArea fpd = null;
- PlatformIdentification id = null;
- try {
- fpd = OpenFile.openFpdFile(path);
- } catch (IOException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- continue;
- } catch (XmlException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- continue;
- } catch (Exception e) {
- Log.err("Open Platform Surface Area " + path, "Invalid file type");
- continue;
- }
- id = Tools.getId(path, fpd);
- vPlatformList.addElement(new PlatformIdentification(id));
- openingPlatformList.insertToOpeningPlatformList(id, fpd);
- }
- Sort.sortPlatforms(vPlatformList, DataType.SORT_TYPE_ASCENDING);
- }
- }
-
- /**
- Get all modules' paths from one package
-
- @return a Vector with all modules' path
-
- **/
- public static Vector<String> getAllModulesOfPackage(String path) {
- Vector<String> modulePath = new Vector<String>();
- try {
- MsaFiles files = OpenFile.openSpdFile(path).getMsaFiles();
- if (files != null) {
- for (int index = 0; index < files.getFilenameList().size(); index++) {
- String msaPath = files.getFilenameList().get(index);
- msaPath = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + msaPath;
- msaPath = Tools.convertPathToCurrentOsType(msaPath);
- modulePath.addElement(msaPath);
- }
- }
- } catch (IOException e) {
- Log.err("Get all modules from a package " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Get all modules from a package " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Get all modules from a package " + path, e.getMessage());
- }
- return modulePath;
- }
-
- /**
- Get a module id
-
- @param moduleGuid
- @param moduleVersion
- @param packageGuid
- @param packageVersion
- @return
-
- **/
- public static ModuleIdentification findModuleId(String moduleGuid, String moduleVersion, String packageGuid,
- String packageVersion) {
- ModuleIdentification mid = null;
- for (int index = 0; index < vModuleList.size(); index++) {
- if (vModuleList.elementAt(index).equals(moduleGuid, moduleVersion, packageGuid, packageVersion)) {
- mid = vModuleList.elementAt(index);
- break;
- }
- }
- return mid;
- }
-
- /**
- Get a package id
-
- @param packageGuid
- @param packageVersion
- @return
-
- **/
- public static PackageIdentification findPackageId(String packageGuid, String packageVersion) {
- PackageIdentification pid = null;
- for (int index = 0; index < vPackageList.size(); index++) {
- if (vPackageList.elementAt(index).equals(packageGuid, packageVersion)) {
- pid = vPackageList.elementAt(index);
- break;
- }
- }
- return pid;
- }
-
- /**
- Get a platform id
-
- @param platformGuid
- @param platformVersion
- @return
-
- **/
- public static PlatformIdentification findPlatformId(String platformGuid, String platformVersion) {
- PlatformIdentification pid = null;
- for (int index = 0; index < vPlatformList.size(); index++) {
- if (vPlatformList.elementAt(index).equals(platformGuid, platformVersion)) {
- pid = vPlatformList.elementAt(index);
- break;
- }
- }
- return pid;
- }
-
- /**
-
- @param relativePath
- @param mode
- @return
-
- **/
- public static boolean isDuplicateRelativePath(String relativePath, int mode) {
- if (mode == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- for (int index = 0; index < vModuleList.size(); index++) {
- String path = vModuleList.elementAt(index).getPath();
- if (Tools.getFilePathOnly(path).equals(relativePath)) {
- return true;
- }
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- for (int index = 0; index < vPackageList.size(); index++) {
- String path = vPackageList.elementAt(index).getPath();
- if (Tools.getFilePathOnly(path).equals(relativePath)) {
- return true;
- }
- }
- }
-
- if (mode == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- for (int index = 0; index < vPlatformList.size(); index++) {
- String path = vPlatformList.elementAt(index).getPath();
- if (Tools.getFilePathOnly(path).equals(relativePath)) {
- return true;
- }
- }
- }
-
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IDefaultTableModel.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IDefaultTableModel.java
deleted file mode 100644
index 57ba11b9af..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IDefaultTableModel.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/** @file
-
- The file is used to override DefaultTableModel to provides customized interfaces
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-import javax.swing.table.DefaultTableModel;
-
-public class IDefaultTableModel extends DefaultTableModel {
-
- ///
- ///
- ///
- private static final long serialVersionUID = -1782544418084080185L;
-
- public IDefaultTableModel() {
- super();
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableModel#isCellEditable(int, int)
- *
- */
- public boolean isCellEditable(int rowIndex, int columnIndex) {
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
deleted file mode 100644
index 8194a316c6..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/IFileFilter.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/** @file
-
- The file is used to override FileFilter to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import java.io.File;
-
-import javax.swing.filechooser.FileFilter;
-
-/**
- The class is used to override FileFilter to provides customized interfaces
-
- **/
-public class IFileFilter extends FileFilter {
-
- private String strExt;
-
- /**
- Reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- This is the default constructor
-
- @param ext
-
- **/
- public IFileFilter(String ext) {
- this.strExt = ext;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
- *
- * Override method "accept"
- *
- */
- public boolean accept(File file) {
- if (file.isDirectory()) {
- return true;
- }
- String strFileName = file.getName();
- int intIndex = strFileName.lastIndexOf('.');
- if (intIndex > 0 && intIndex < strFileName.length() - 1) {
- String strExtension = strFileName.substring(intIndex + 1).toLowerCase();
- if (strExtension.equals(strExt))
- return true;
- }
- return false;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.filechooser.FileFilter#getDescription()
- *
- * Override method "getDescription" to config description via different file type
- *
- */
- public String getDescription() {
- if (strExt.equals(DataType.MODULE_SURFACE_AREA_EXT))
- return DataType.MODULE_SURFACE_AREA_EXT_DESCRIPTION;
- if (strExt.equals(DataType.PACKAGE_SURFACE_AREA_EXT))
- return DataType.PACKAGE_SURFACE_AREA_EXT_DESCRIPTION;
- if (strExt.equals(DataType.PLATFORM_SURFACE_AREA_EXT))
- return DataType.PLATFORM_SURFACE_AREA_EXT_DESCRIPTION;
- if (strExt.equals(DataType.TEXT_FILE_EXT))
- return DataType.TEXT_FILE_EXT_DESCRIPTION;
- if (strExt.equals(DataType.FAR_SURFACE_AREA_EXT))
- return DataType.FAR_SURFACE_AREA_EXT_DESCRIPTION;
- return "";
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
deleted file mode 100644
index 03717b560b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/Identification.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/** @file
-
- The file is used to save basic information
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.Identifications;
-
-public class Identification {
-
- ///
- /// Define class members
- ///
- private String name;
-
- private String guid;
-
- private String version;
-
- private String path;
-
- public Identification(String name, String guid, String version) {
- this.name = name;
- this.guid = guid;
- this.version = version;
- }
-
- public Identification() {
-
- }
-
- public Identification(String name, String guid, String version, String path) {
- this.name = name;
- this.guid = guid;
- this.version = version;
- this.path = path;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof Identification) {
- Identification id = (Identification) obj;
- if (path.equals(id.path)) {
- return true;
- }
- return false;
- } else {
- return super.equals(obj);
- }
- }
-
- public boolean equalsWithGuid(Object obj) {
- if (obj instanceof Identification) {
- Identification id = (Identification) obj;
- if (guid.equalsIgnoreCase(id.guid)) {
- if (version == null || id.version == null) {
- return true;
- } else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")) {
- return true;
- } else if (version.equalsIgnoreCase(id.version)) {
- return true;
- }
- }
- return false;
- } else {
- return super.equals(obj);
- }
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public String getName() {
- return name;
- }
-
- public String getVersion() {
- return version;
- }
-
- public String getPath() {
- return path;
- }
-
- public int hashCode() {
- return guid.toLowerCase().hashCode();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java
deleted file mode 100644
index 9811c19868..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningFileType.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file
-
- The file is used to define common opening file type
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-import javax.swing.tree.TreePath;
-
-
-public class OpeningFileType {
- //
- // Define class members
- //
- private boolean isSaved = true;
-
- private boolean isNew = false;
-
- private boolean isOpen = false;
-
- private Set<TreePath> treePath = new LinkedHashSet<TreePath>();
-
- public OpeningFileType() {
-
- }
-
- public boolean isNew() {
- return isNew;
- }
-
- public void setNew(boolean isNew) {
- this.isNew = isNew;
- }
-
- public boolean isSaved() {
- return isSaved;
- }
-
- public void setSaved(boolean isSaved) {
- this.isSaved = isSaved;
- }
-
- public boolean isOpen() {
- return isOpen;
- }
-
- public void setOpen(boolean isOpen) {
- this.isOpen = isOpen;
- }
-
- public Set<TreePath> getTreePath() {
- return treePath;
- }
-
- public void setTreePath(Set<TreePath> treePath) {
- this.treePath = treePath;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
deleted file mode 100644
index c98d6f95b5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleList.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
-
- The file is used to define opening module list
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.tree.TreePath;
-
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-
-public class OpeningModuleList {
- private Vector<OpeningModuleType> vOpeningModuleList = new Vector<OpeningModuleType>();
-
- public OpeningModuleList() {
-
- }
-
- public Vector<OpeningModuleType> getVOpeningModuleList() {
- return vOpeningModuleList;
- }
-
- public void setVOpeningModuleList(Vector<OpeningModuleType> openingModuleList) {
- vOpeningModuleList = openingModuleList;
- }
-
- public void insertToOpeningModuleList(ModuleIdentification id, ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa) {
- vOpeningModuleList.addElement(new OpeningModuleType(id, xmlMsa));
- }
-
- public OpeningModuleType getOpeningModuleByIndex(int index) {
- if (index > -1 && index < vOpeningModuleList.size()) {
- return vOpeningModuleList.elementAt(index);
- }
- return null;
- }
-
- public OpeningModuleType getOpeningModuleById(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningModuleList.elementAt(index);
- }
- return null;
- }
-
- public int findIndexOfListById(ModuleIdentification id) {
- for (int index = 0; index < vOpeningModuleList.size(); index++) {
- if (vOpeningModuleList.elementAt(index).getId().equals(id)) {
- return index;
- }
- }
- return -1;
- }
-
- public void removeFromOpeningModuleListByIndex(int index) {
- if (index > -1 && index < vOpeningModuleList.size()) {
- vOpeningModuleList.removeElementAt(index);
- }
- }
-
- public void removeFromOpeningModuleListById(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningModuleList.removeElementAt(findIndexOfListById(id));
- }
- }
-
- public void removeAllFromOpeningModuleList() {
- vOpeningModuleList.removeAllElements();
- }
-
- public ModuleSurfaceAreaDocument.ModuleSurfaceArea getModuleSurfaceAreaFromId(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).getXmlMsa();
- }
- return null;
- }
-
- public boolean existsModule(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return true;
- }
- return false;
- }
-
- public void setModuleSaved(ModuleIdentification id, boolean isSaved) {
- setModuleSaved(findIndexOfListById(id), isSaved);
- }
-
- public void setModuleSaved(int index, boolean isSaved) {
- if (index > -1) {
- vOpeningModuleList.elementAt(index).setSaved(isSaved);
- }
- }
-
- public boolean getModuleSaved(ModuleIdentification id) {
- return getModuleSaved(findIndexOfListById(id));
- }
-
- public boolean getModuleSaved(int index) {
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).isSaved();
- }
- return true;
- }
-
- public void setModuleOpen(ModuleIdentification id, boolean isOpen) {
- setModuleOpen(findIndexOfListById(id), isOpen);
- }
-
- public void setModuleOpen(int index, boolean isOpen) {
- if (index > -1) {
- vOpeningModuleList.elementAt(index).setOpen(isOpen);
- }
- }
-
- public boolean getModuleOpen(ModuleIdentification id) {
- return getModuleOpen(findIndexOfListById(id));
- }
-
- public boolean getModuleOpen(int index) {
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).isOpen();
- }
- return false;
- }
-
- public void setTreePathById(ModuleIdentification id, Set<TreePath> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningModuleList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(ModuleIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> getTreePathByIndex(int index) {
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public ModuleIdentification getIdByPath(String path) {
- ModuleIdentification id = new ModuleIdentification(null, null, null, path);
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningModuleList.elementAt(index).getId();
- }
- return null;
- }
-
- public ModuleIdentification getIdByGuidVersion(String guid, String version) {
- for (int index = 0; index < vOpeningModuleList.size(); index++) {
- ModuleIdentification id = vOpeningModuleList.elementAt(index).getId();
- if (version != null) {
- if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {
- return id;
- }
- } else {
- if (id.getGuid().equals(guid)) {
- return id;
- }
- }
- }
- return null;
- }
-
- public void setNew(ModuleIdentification id, boolean isNew) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningModuleList.elementAt(index).setNew(isNew);
- }
- }
-
- public void closeAll() {
- for (int index = 0; index < this.size(); index++) {
- this.setModuleOpen(index, false);
- this.setModuleSaved(index, true);
- }
- }
-
- public int size() {
- return vOpeningModuleList.size();
- }
-
- public boolean isSaved() {
- for (int index = 0; index < this.size(); index++) {
- if (!this.getModuleSaved(index)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isOpen() {
- for (int index = 0; index < this.size(); index++) {
- if (this.getModuleOpen(index)) {
- return true;
- }
- }
- return false;
- }
-
- public void reload(int index) {
- if (index > -1) {
- vOpeningModuleList.elementAt(index).reload();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java
deleted file mode 100644
index 3ff29a94d3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningModuleType.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/** @file
-
- The file is used to define opening module type
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-
-public class OpeningModuleType extends OpeningFileType{
- //
- // Define class members
- //
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa = null;
-
- private ModuleIdentification id = null;
-
- public OpeningModuleType() {
-
- }
-
- public OpeningModuleType(ModuleIdentification identification, ModuleSurfaceAreaDocument.ModuleSurfaceArea msa) {
- this.id = identification;
- this.xmlMsa = msa;
- }
-
- public ModuleSurfaceAreaDocument.ModuleSurfaceArea getXmlMsa() {
- return xmlMsa;
- }
-
- public void setXmlMsa(ModuleSurfaceAreaDocument.ModuleSurfaceArea xmlMsa) {
- this.xmlMsa = xmlMsa;
- }
-
- public ModuleIdentification getId() {
- return id;
- }
-
- public void setId(ModuleIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlMsa = OpenFile.openMsaFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Module Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Module Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
deleted file mode 100644
index 0db75176ba..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageList.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
-
- The file is used to define opening package list
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.tree.TreePath;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class OpeningPackageList {
- private Vector<OpeningPackageType> vOpeningPackageList = new Vector<OpeningPackageType>();
-
- public OpeningPackageList() {
-
- }
-
- public Vector<OpeningPackageType> getVOpeningPackageList() {
- return vOpeningPackageList;
- }
-
- public void setVOpeningPackageList(Vector<OpeningPackageType> openingPackageList) {
- vOpeningPackageList = openingPackageList;
- }
-
- public void insertToOpeningPackageList(PackageIdentification id, PackageSurfaceAreaDocument.PackageSurfaceArea xmlMsa) {
- vOpeningPackageList.addElement(new OpeningPackageType(id, xmlMsa));
- }
-
- public OpeningPackageType getOpeningPackageByIndex(int index) {
- if (index > -1 && index < vOpeningPackageList.size()) {
- return vOpeningPackageList.elementAt(index);
- }
- return null;
- }
-
- public OpeningPackageType getOpeningPackageById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index);
- }
- return null;
- }
-
- public int findIndexOfListById(PackageIdentification id) {
- for (int index = 0; index < vOpeningPackageList.size(); index++) {
- if (vOpeningPackageList.elementAt(index).getId().equals(id)) {
- return index;
- }
- }
- return -1;
- }
-
- public void removeFromOpeningPackageListByIndex(int index) {
- if (index > -1 && index < vOpeningPackageList.size()) {
- vOpeningPackageList.removeElementAt(index);
- }
- }
-
- public void removeFromOpeningPackageListById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.removeElementAt(findIndexOfListById(id));
- }
- }
-
- public void removeAllFromOpeningPackageList() {
- vOpeningPackageList.removeAllElements();
- }
-
- public PackageSurfaceAreaDocument.PackageSurfaceArea getPackageSurfaceAreaFromId(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getXmlSpd();
- }
- return null;
- }
-
- public boolean existsPackage(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return true;
- }
- return false;
- }
-
- public void setPackageSaved(PackageIdentification id, boolean isSaved) {
- setPackageSaved(findIndexOfListById(id), isSaved);
- }
-
- public void setPackageSaved(int index, boolean isSaved) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setSaved(isSaved);
- }
- }
-
- public boolean getPackageSaved(PackageIdentification id) {
- return getPackageSaved(findIndexOfListById(id));
- }
-
- public boolean getPackageSaved(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).isSaved();
- }
- return true;
- }
-
- public void setPackageOpen(PackageIdentification id, boolean isOpem) {
- setPackageOpen(findIndexOfListById(id), isOpem);
- }
-
- public void setPackageOpen(int index, boolean isOpem) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setOpen(isOpem);
- }
- }
-
- public boolean getPackageOpen(PackageIdentification id) {
- return getPackageOpen(findIndexOfListById(id));
- }
-
- public boolean getPackageOpen(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).isOpen();
- }
- return false;
- }
-
- public void setTreePathById(PackageIdentification id, Set<TreePath> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(PackageIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> getTreePathByIndex(int index) {
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public PackageIdentification getIdByPath(String path) {
- PackageIdentification id = new PackageIdentification(null, null, null, path);
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPackageList.elementAt(index).getId();
- }
- return null;
- }
-
- public PackageIdentification getIdByGuidVersion(String guid, String version) {
- for (int index = 0; index < vOpeningPackageList.size(); index++) {
- PackageIdentification id = vOpeningPackageList.elementAt(index).getId();
- if (version != null) {
- if (id.getGuid().equals(guid) && id.getVersion().equals(version)) {
- return id;
- }
- } else {
- if (id.getGuid().equals(guid)) {
- return id;
- }
- }
- }
- return null;
- }
-
- public void setNew(PackageIdentification id, boolean isNew) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPackageList.elementAt(index).setNew(isNew);
- }
- }
-
- public void closeAll() {
- for (int index = 0; index < this.size(); index++) {
- this.setPackageOpen(index, false);
- this.setPackageSaved(index, true);
- }
- }
-
- public int size() {
- return vOpeningPackageList.size();
- }
-
- public boolean isSaved() {
- for (int index = 0; index < this.size(); index++) {
- if (!this.getPackageSaved(index)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isOpen() {
- for (int index = 0; index < this.size(); index++) {
- if (this.getPackageOpen(index)) {
- return true;
- }
- }
- return false;
- }
-
- public void reload(int index) {
- if (index > -1) {
- vOpeningPackageList.elementAt(index).reload();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java
deleted file mode 100644
index 22f3ce311d..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPackageType.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
-
- The file is used to define opening package type
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class OpeningPackageType extends OpeningFileType {
- //
- // Define class members
- //
- private PackageSurfaceAreaDocument.PackageSurfaceArea xmlSpd = null;
-
- private PackageIdentification id = null;
-
- public OpeningPackageType() {
-
- }
-
- public OpeningPackageType(PackageIdentification identification, PackageSurfaceAreaDocument.PackageSurfaceArea spd) {
- this.id = identification;
- this.xmlSpd = spd;
- }
-
- public PackageSurfaceAreaDocument.PackageSurfaceArea getXmlSpd() {
- return xmlSpd;
- }
-
- public void setXmlSpd(PackageSurfaceAreaDocument.PackageSurfaceArea xmlSpd) {
- this.xmlSpd = xmlSpd;
- }
-
- public PackageIdentification getId() {
- return id;
- }
-
- public void setId(PackageIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlSpd = OpenFile.openSpdFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Package Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
deleted file mode 100644
index a2ce431c0b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformList.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/** @file
-
- The file is used to define opening package list
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.tree.TreePath;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class OpeningPlatformList {
-
- private Vector<OpeningPlatformType> vOpeningPlatformList = new Vector<OpeningPlatformType>();
-
- public OpeningPlatformList() {
-
- }
-
- public Vector<OpeningPlatformType> getVOpeningPlatformList() {
- return vOpeningPlatformList;
- }
-
- public void setVOpeningPlatformList(Vector<OpeningPlatformType> openingPlatformList) {
- vOpeningPlatformList = openingPlatformList;
- }
-
- public void insertToOpeningPlatformList(PlatformIdentification id, PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {
- vOpeningPlatformList.addElement(new OpeningPlatformType(id, xmlFpd));
- }
-
- public OpeningPlatformType getOpeningPlatformByIndex(int index) {
- if (index > -1 && index < vOpeningPlatformList.size()) {
- return vOpeningPlatformList.elementAt(index);
- }
- return null;
- }
-
- public OpeningPlatformType getOpeningPlatformById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index);
- }
- return null;
- }
-
- public int findIndexOfListById(PlatformIdentification id) {
- for (int index = 0; index < vOpeningPlatformList.size(); index++) {
- if (vOpeningPlatformList.elementAt(index).getId().equals(id)) {
- return index;
- }
- }
- return -1;
- }
-
- public void removeFromOpeningPlatformListByIndex(int index) {
- if (index > -1 && index < vOpeningPlatformList.size()) {
- vOpeningPlatformList.removeElementAt(index);
- }
- }
-
- public void removeFromOpeningPlatformListById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.removeElementAt(findIndexOfListById(id));
- }
- }
-
- public void removeAllFromOpeningPlatformList() {
- vOpeningPlatformList.removeAllElements();
- }
-
- public PlatformSurfaceAreaDocument.PlatformSurfaceArea getPlatformSurfaceAreaFromId(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getXmlFpd();
- }
- return null;
- }
-
- public boolean existsPlatform(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return true;
- }
- return false;
- }
-
-
- public void setPlatformSaved(PlatformIdentification id, boolean isSaved) {
- setPlatformSaved(findIndexOfListById(id), isSaved);
- }
-
- public void setPlatformSaved(int index, boolean isSaved) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setSaved(isSaved);
- }
- }
-
- public boolean getPlatformSaved(PlatformIdentification id) {
- return getPlatformSaved(findIndexOfListById(id));
- }
-
- public boolean getPlatformSaved(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).isSaved();
- }
- return true;
- }
-
- public void setPlatformOpen(PlatformIdentification id, boolean isOpen) {
- setPlatformOpen(findIndexOfListById(id), isOpen);
- }
-
- public void setPlatformOpen(int index, boolean isOpen) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setOpen(isOpen);
- }
- }
-
- public boolean getPlatformOpen(PlatformIdentification id) {
- return getPlatformOpen(findIndexOfListById(id));
- }
-
- public boolean getPlatformOpen(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).isOpen();
- }
- return false;
- }
-
- public void setTreePathById(PlatformIdentification id, Set<TreePath> treePath) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setTreePath(treePath);
- }
- }
-
- public Set<TreePath> getTreePathById(PlatformIdentification id) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public Set<TreePath> getTreePathByIndex(int index) {
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getTreePath();
- }
- return null;
- }
-
- public PlatformIdentification getIdByPath(String path) {
- PlatformIdentification id = new PlatformIdentification(null, null, null, path);
- int index = findIndexOfListById(id);
- if (index > -1) {
- return vOpeningPlatformList.elementAt(index).getId();
- }
- return null;
- }
-
- public void setNew(PlatformIdentification id, boolean isNew) {
- int index = findIndexOfListById(id);
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).setNew(isNew);
- }
- }
-
- public void closeAll() {
- for (int index = 0; index < this.size(); index++) {
- this.setPlatformOpen(index, false);
- this.setPlatformSaved(index, true);
- }
- }
-
- public int size() {
- return vOpeningPlatformList.size();
- }
-
- public boolean isSaved() {
- for (int index = 0; index < this.size(); index++) {
- if (!this.getPlatformSaved(index)) {
- return false;
- }
- }
- return true;
- }
-
- public boolean isOpen() {
- for (int index = 0; index < this.size(); index++) {
- if (this.getPlatformOpen(index)) {
- return true;
- }
- }
- return false;
- }
-
- public void reload(int index) {
- if (index > -1) {
- vOpeningPlatformList.elementAt(index).reload();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java
deleted file mode 100644
index 7a822c91c8..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/OpeningPlatformType.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
-
- The file is used to define opening platform type
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class OpeningPlatformType extends OpeningFileType {
- //
- // Define class members
- //
- private PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd = null;
-
- private PlatformIdentification id = null;
-
- public OpeningPlatformType() {
-
- }
-
- public OpeningPlatformType(PlatformIdentification identification, PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this.id = identification;
- this.xmlFpd = fpd;
- }
-
- public PlatformSurfaceAreaDocument.PlatformSurfaceArea getXmlFpd() {
- return xmlFpd;
- }
-
- public void setXmlFpd(PlatformSurfaceAreaDocument.PlatformSurfaceArea xmlFpd) {
- this.xmlFpd = xmlFpd;
- }
-
- public PlatformIdentification getId() {
- return id;
- }
-
- public void setId(PlatformIdentification id) {
- this.id = id;
- }
-
- public void reload() {
- if (this.id != null) {
- String path = id.getPath();
- if (path.length() > 0) {
- try {
- this.xmlFpd = OpenFile.openFpdFile(id.getPath());
- } catch (IOException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Platform Surface Area " + path, "Invalid file type");
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java
deleted file mode 100644
index f446693004..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigId.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/** @file
-
- The file is used to define Tool Chain Configuration Identification
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-public class ToolChainConfigId {
-
- public static final String COMMENTS = "#";
-
- public static final String EQUALS = "=";
-
- private String name = "";
-
- private String value = "";
-
- public ToolChainConfigId(String strName, String strValue) {
- this.name = strName;
- this.value = strValue;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public boolean equals(ToolChainConfigId id) {
- if (this.name.equals(id.name)) {
- return true;
- } else {
- return false;
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java
deleted file mode 100644
index 49aac3d074..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Identifications/ToolChainConfigVector.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/** @file
-
- The file is used to define Tool Chain Configuration Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.Identifications;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.FileNotFoundException;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Vector;
-
-public class ToolChainConfigVector {
-
- private Vector<ToolChainConfigId> vToolChainConfigs = new Vector<ToolChainConfigId>();
-
- public int findToolChainConfigs(ToolChainConfigId sfi) {
- for (int index = 0; index < vToolChainConfigs.size(); index++) {
- if (vToolChainConfigs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findToolChainConfigs(String name) {
- for (int index = 0; index < vToolChainConfigs.size(); index++) {
- if (vToolChainConfigs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public ToolChainConfigId getToolChainConfigs(int index) {
- if (index > -1) {
- return vToolChainConfigs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getToolChainConfigs(index).getName());
- v.addElement(getToolChainConfigs(index).getValue());
- return v;
- }
-
- public void addToolChainConfigs(ToolChainConfigId arg0) {
- vToolChainConfigs.addElement(arg0);
- }
-
- public void updateToolChainConfigs(ToolChainConfigId arg0, int arg1) {
- vToolChainConfigs.setElementAt(arg0, arg1);
- }
-
- public void removeToolChainConfigs(ToolChainConfigId arg0) {
- int index = findToolChainConfigs(arg0);
- if (index > -1) {
- vToolChainConfigs.removeElementAt(index);
- }
- }
-
- public void removeToolChainConfigs(int index) {
- if (index > -1 && index < this.size()) {
- vToolChainConfigs.removeElementAt(index);
- }
- }
-
- public void removeAll() {
- vToolChainConfigs = new Vector<ToolChainConfigId>();
- }
-
- public Vector<String> getToolChainConfigsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vToolChainConfigs.size(); index++) {
- v.addElement(vToolChainConfigs.get(index).getName());
- }
- return v;
- }
-
- public Vector<String> getToolChainConfigsValue() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vToolChainConfigs.size(); index++) {
- v.addElement(vToolChainConfigs.get(index).getValue());
- }
- return v;
- }
-
- public int size() {
- return this.vToolChainConfigs.size();
- }
-
- public void saveFile(String file) throws IOException {
- if (size() > 0) {
- FileWriter fw = new FileWriter(file);
- BufferedWriter bw = new BufferedWriter(fw);
- for (int index = 0; index < size(); index++) {
- String line = this.getToolChainConfigs(index).getName() + " " + ToolChainConfigId.EQUALS + " "
- + this.getToolChainConfigs(index).getValue();
- bw.write(line);
- bw.newLine();
- }
- bw.flush();
- bw.close();
- fw.close();
- }
- }
-
- /**
-
- @param file
- @throws IOException
- @throws FileNotFoundException
-
- **/
- public void parseFile(String file) throws IOException {
- FileReader fr = new FileReader(file);
- BufferedReader br = new BufferedReader(fr);
- String line = br.readLine();
- while (line != null) {
- parseLine(line);
- line = br.readLine();
- }
- }
-
- /**
- Parse the input string and add name, value to vector
-
- @param line
-
- **/
- private void parseLine(String line) {
- String name = "";
- String value = "";
- if (line.indexOf(ToolChainConfigId.COMMENTS) != 0 && line.indexOf(ToolChainConfigId.EQUALS) > -1) {
- name = line.substring(0, line.indexOf(ToolChainConfigId.EQUALS)).trim();
- value = line.substring(line.indexOf(ToolChainConfigId.EQUALS) + 1).trim();
- this.addToolChainConfigs(new ToolChainConfigId(name, value));
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java
deleted file mode 100644
index 49a7a3615b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Log.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/** @file
-
- The file is used to provides static interfaces to save log and error information
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import javax.swing.JOptionPane;
-
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-/**
- The class is used to provides static interfaces to save log and error information
-
- **/
-public class Log {
- //
- //Log file directory path
- //
- private static String strLogDir = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + "Tools"
- + DataType.FILE_SEPARATOR + "Logs";
-
- //
- //Log file
- //
- private static File fleLogFile = null;
-
- //
- //Wrn file
- //
- private static File fleWrnFile = null;
-
- //
- //Err file
- //
- private static File fleErrFile = null;
-
- //
- //Log file name
- //
- private static String strLogFileName = strLogDir + DataType.FILE_SEPARATOR + "frameworkwizard.log";
-
- //
- //Wrn file name
- //
- private static String strWrnFileName = strLogDir + DataType.FILE_SEPARATOR + "frameworkwizard.wrn";
-
- //
- //Err file name
- //
- private static String strErrFileName = strLogDir + DataType.FILE_SEPARATOR + "frameworkwizard.err";
-
- //
- //Flag for create log or not
- //
- private static boolean isSaveLog = false;
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- try {
- //Log.log("Test", "test");
- //Log.err("Test1", "test1");
- Log
- .wrn("aaa bbbbbb cccccccccccc ddddddddddd eeeeeeeeee fffffffffff gggggggggggggggggg hhhhhhhhhhhhhhhhhhhhhhhhhhhhh iiiii jjjj kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk lll mmm nn poooooooooooooooooooooooooooooooooooooooooooop");
- Log.wrn("Incorrect data type for ModuleEntryPoint");
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToLogFile to save log item and log information to log file
-
- @param strItem The log item
- @param strLog The log information
-
- **/
- public static void log(String strItem, String strLog) {
- try {
- writeToLogFile(strItem + ":" + strLog);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToLogFile to save log information to log file
-
- @param strLog The log information
-
- **/
- public static void log(String strLog) {
- try {
- writeToLogFile(strLog);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToWrnFile to save wrn item and wrn information to wrn file
-
- @param strItem The wrn item
- @param strLog The wrn information
-
- **/
- public static void wrn(String strItem, String strWrn) {
- try {
- writeToWrnFile("Warning when " + strItem + "::" + strWrn);
- showWrnMessage(strWrn);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToWrnFile to save wrn information to wrn file
-
- @param strLog The wrn information
-
- **/
- public static void wrn(String strWrn) {
- try {
- writeToWrnFile("Warning::" + strWrn);
- showWrnMessage("Warning::" + strWrn);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToErrFile to save err item and err information to err file
-
- @param strItem The err item
- @param strLog The err information
-
- **/
- public static void err(String strItem, String strErr) {
- try {
- writeToErrFile("Error when " + strItem + "::" + strErr);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Call writeToErrFile to save err information to err file
-
- @param strLog The err information
-
- **/
- public static void err(String strErr) {
- try {
- writeToErrFile("Error::" + strErr);
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- Brings up a dialog to show err message
- When the message's length > defined max length, wrap the text to the next line.
-
- @param strErr The input data of err message
-
- **/
- private static void showWrnMessage(String strErr) {
- String strReturn = Tools.wrapStringByWord(strErr);
- JOptionPane.showConfirmDialog(FrameworkWizardUI.getInstance(), strReturn, "Warning",
- JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE);
- }
-
- /**
- Open log file and write log information
-
- @param strLog The log information
- @throws IOException
-
- **/
- private static void writeToLogFile(String strLog) throws Exception {
- if (isSaveLog) {
- try {
- createLogDir();
- if (fleLogFile == null) {
- fleLogFile = new File(strLogFileName);
- fleLogFile.delete();
- fleLogFile.createNewFile();
- }
- FileOutputStream fos = new FileOutputStream(fleLogFile, true);
- fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- Open wrn file and write wrn information
-
- @param strLog The log information
- * @throws Exception
-
- **/
- private static void writeToWrnFile(String strLog) throws Exception {
- if (isSaveLog) {
- try {
- createLogDir();
- if (fleWrnFile == null) {
- fleWrnFile = new File(strWrnFileName);
- fleWrnFile.delete();
- fleWrnFile.createNewFile();
- }
- FileOutputStream fos = new FileOutputStream(fleWrnFile, true);
- fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- Open err file and write err information
-
- @param strLog The log information
- @throws IOException
-
- **/
- private static void writeToErrFile(String strLog) throws Exception {
- if (isSaveLog) {
- try {
- createLogDir();
- if (fleErrFile == null) {
- fleErrFile = new File(strErrFileName);
- fleErrFile.delete();
- fleErrFile.createNewFile();
- }
- FileOutputStream fos = new FileOutputStream(fleErrFile, true);
- fos.write((Tools.getCurrentDateTime() + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.write((strLog + DataType.DOS_LINE_SEPARATOR).getBytes());
- fos.flush();
- fos.close();
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- } catch (IOException e) {
- e.printStackTrace();
- }
- }
- }
-
- /**
- Check if directory for Logs exists or not
- Create the directory if it doesn't exist
- * @throws Exception
-
- **/
- private static void createLogDir() throws Exception {
- File f = new File(strLogDir);
- if (!f.exists()) {
- FileOperation.newFolder(strLogDir);
- }
- }
-
- public static boolean isSaveLog() {
- return isSaveLog;
- }
-
- public static void setSaveLog(boolean isSaveLog) {
- Log.isSaveLog = isSaveLog;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
deleted file mode 100644
index 32eec68258..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/OpenFile.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
-
- The file provides interface to open xml file.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.FrameworkDatabaseDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-
-public class OpenFile {
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Open specificed Msa file and read its content
-
- @param strMsaFilePath The input data of Msa File Path
-
- **/
- public static ModuleSurfaceArea openMsaFile(String strMsaFilePath) throws IOException, XmlException, Exception {
- Log.log("Open Msa", strMsaFilePath);
- File msaFile = new File(strMsaFilePath);
- ModuleSurfaceAreaDocument xmlMsaDoc = (ModuleSurfaceAreaDocument) XmlObject.Factory.parse(msaFile);
- return xmlMsaDoc.getModuleSurfaceArea();
- }
-
- /**
- Open specificed Spd file and read its content
-
- @param strSpdFilePath The input data of Spd File Path
-
- **/
- public static PackageSurfaceArea openSpdFile(String strSpdFilePath) throws IOException, XmlException, Exception {
- Log.log("Open Spd", strSpdFilePath);
- File spdFile = new File(strSpdFilePath);
- PackageSurfaceAreaDocument xmlSpdDoc = (PackageSurfaceAreaDocument) XmlObject.Factory.parse(spdFile);
- return xmlSpdDoc.getPackageSurfaceArea();
- }
-
- /**
- Open specificed Fpd file and read its content
-
- @param strFpdFilePath The input data of Fpd File Path
-
- **/
- public static PlatformSurfaceArea openFpdFile(String strFpdFilePath) throws IOException, XmlException,
- Exception {
- Log.log("Open Fpd", strFpdFilePath);
- File fpdFile = new File(strFpdFilePath);
- PlatformSurfaceAreaDocument xmlFpdDoc = null;
- xmlFpdDoc = (PlatformSurfaceAreaDocument) XmlObject.Factory.parse(fpdFile);
- return xmlFpdDoc.getPlatformSurfaceArea();
- }
-
- /**
-
- Open specificed Framework Database file and read its content
-
- */
- public static FrameworkDatabase openFrameworkDb(String strDbFilePath) throws IOException, XmlException, Exception {
- Log.log("Open Framework Database", strDbFilePath);
- File db = new File(strDbFilePath);
- FrameworkDatabaseDocument xmlDb = null;
- xmlDb = (FrameworkDatabaseDocument) XmlObject.Factory.parse(db);
- return xmlDb.getFrameworkDatabase();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java
deleted file mode 100644
index 13e6786ca7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/SaveFile.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/** @file
-
- The file provides interface to save xml file.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common;
-
-import java.io.File;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.tianocore.FrameworkDatabaseDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-
-public class SaveFile {
-
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
-
- }
-
- private static void createDirectory(String path) throws Exception {
- File f = new File(path);
- path = f.getParent();
- FileOperation.newFolder(path);
- }
-
- /**
- Save file as msa
-
- **/
- public static void saveMsaFile(String path, ModuleSurfaceArea msa) throws Exception {
- //
- // Create the file's directory first
- //
- createDirectory(path);
-
- //
- // Remove all empty top level elements
- //
- XmlObject o = msa.getLibraryClassDefinitions();
- if (o != null) {
- if (msa.getLibraryClassDefinitions().getLibraryClassList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getSourceFiles();
- if (o != null) {
- if (msa.getSourceFiles().getFilenameList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getPackageDependencies();
- if (o != null) {
- if (msa.getPackageDependencies().getPackageList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getProtocols();
- if (o != null) {
- if (msa.getProtocols().getProtocolList().size() <= 0
- && msa.getProtocols().getProtocolNotifyList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getEvents();
- if (o != null) {
- if (msa.getEvents().getCreateEvents() != null || msa.getEvents().getSignalEvents() != null) {
- if (msa.getEvents().getCreateEvents() != null && msa.getEvents().getCreateEvents().getEventTypesList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- if (msa.getEvents().getSignalEvents() != null && msa.getEvents().getSignalEvents().getEventTypesList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- } else {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getHobs();
- if (o != null) {
- if (msa.getHobs().getHobTypesList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getPPIs();
- if (o != null) {
- if (msa.getPPIs().getPpiList().size() <= 0 && msa.getPPIs().getPpiNotifyList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getVariables();
- if (o != null) {
- if (msa.getVariables().getVariableList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getBootModes();
- if (o != null) {
- if (msa.getBootModes().getBootModeList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getSystemTables();
- if (o != null) {
- if (msa.getSystemTables().getSystemTableCNamesList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getDataHubs();
- if (o != null) {
- if (msa.getDataHubs().getDataHubRecordList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getHiiPackages();
- if (o != null) {
- if (msa.getHiiPackages().getHiiPackageList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getGuids();
- if (o != null) {
- if (msa.getGuids().getGuidCNamesList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getExterns();
- if (o != null) {
- if (msa.getExterns().getExternList().size() <= 0 && msa.getExterns().getSpecificationList().size() <= 0
- && msa.getExterns().getPcdIsDriver() == null) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- o = msa.getPcdCoded();
- if (o != null) {
- if (msa.getPcdCoded().getPcdEntryList().size() <= 0) {
- XmlCursor xmlCursor = o.newCursor();
- xmlCursor.removeXml();
- xmlCursor.dispose();
- }
- }
-
- ModuleSurfaceAreaDocument msaDoc = ModuleSurfaceAreaDocument.Factory.newInstance();
- File f = new File(path);
-
- //
- //Init namespace
- //
- XmlCursor cursor = XmlConfig.setupXmlCursor(msa.newCursor());
-
- //
- //Config file format
- //
- XmlOptions options = XmlConfig.setupXmlOptions();
-
- //
- //Create finial doc
- //
- msaDoc.addNewModuleSurfaceArea();
- msaDoc.setModuleSurfaceArea((ModuleSurfaceArea) cursor.getObject());
- //
- //Save the file
- //
- msaDoc.save(f, options);
- cursor.dispose();
- }
-
- /**
- Save file as spd
-
- **/
- public static void saveSpdFile(String path, PackageSurfaceArea spd) throws Exception {
- //
- // Create the file's directory first
- //
- createDirectory(path);
-
- PackageSurfaceAreaDocument spdDoc = PackageSurfaceAreaDocument.Factory.newInstance();
- File f = new File(path);
-
- //
- //Init namespace
- //
- XmlCursor cursor = XmlConfig.setupXmlCursor(spd.newCursor());
-
- //
- //Config file format
- //
- XmlOptions options = XmlConfig.setupXmlOptions();
-
- //
- //Create finial doc
- //
- spdDoc.addNewPackageSurfaceArea();
- spdDoc.setPackageSurfaceArea((PackageSurfaceArea) cursor.getObject());
- //
- //Save the file
- //
- spdDoc.save(f, options);
- cursor.dispose();
- }
-
- /**
- Save file as fpd
-
- **/
- public static void saveFpdFile(String path, PlatformSurfaceArea fpd) throws Exception {
- //
- // Create the file's directory first
- //
- createDirectory(path);
-
- PlatformSurfaceAreaDocument fpdDoc = PlatformSurfaceAreaDocument.Factory.newInstance();
- File f = new File(path);
-
- //
- //Init namespace
- //
- XmlCursor cursor = XmlConfig.setupXmlCursor(fpd.newCursor());
-
- //
- //Config file format
- //
- XmlOptions options = XmlConfig.setupXmlOptions();
-
- //
- //Create finial doc
- //
- fpdDoc.addNewPlatformSurfaceArea();
- fpdDoc.setPlatformSurfaceArea((PlatformSurfaceArea) cursor.getObject());
- //
- //Save the file
- //
- fpdDoc.save(f, options);
- cursor.dispose();
- }
-
- /**
- Save file as framework db
-
- **/
- public static void saveDbFile(String path, FrameworkDatabase db) throws Exception {
- FrameworkDatabaseDocument dbDoc = FrameworkDatabaseDocument.Factory.newInstance();
- File f = new File(path);
-
- //
- //Init namespace
- //
- XmlCursor cursor = XmlConfig.setupXmlCursor(db.newCursor());
-
- //
- //Config file format
- //
- XmlOptions options = XmlConfig.setupXmlOptions();
-
- //
- //Create finial doc
- //
- dbDoc.addNewFrameworkDatabase();
- dbDoc.setFrameworkDatabase((FrameworkDatabase) cursor.getObject());
-
- //
- //Save the file
- //
- dbDoc.save(f, options);
- cursor.dispose();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java
deleted file mode 100644
index 65a345ab5b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Sort.java
+++ /dev/null
@@ -1,378 +0,0 @@
-/** @file
-
- The file is used to provide all kinds of sorting method
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class Sort {
-
- /**
- Sort all elements in the vector as the specific sort type
-
- @param v The vector need to be sorted
- @param mode Sort type DataType.Sort_Type_Ascendin and DataType.Sort_Type_Descending
-
- **/
- public static void sortVectorString(Vector<String> v, int mode) {
- if (v != null) {
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).compareTo(v.get(indexI)) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).compareTo(v.get(indexJ)) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- String temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all elements of vector and return sorted sequence
-
- @param v The vector need to be sorted
- @param mode Sort type DataType.Sort_Type_Ascendin and DataType.Sort_Type_Descending
- @return Vector<Integer> The sorted sequence
-
- **/
- public static Vector<Integer> getVectorSortSequence(Vector<String> v, int mode) {
- Vector<Integer> vSequence = new Vector<Integer>();
- //
- // Init sequence
- //
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- vSequence.addElement(index);
- }
- }
-
- //
- // sort and get new sequence
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).compareTo(v.get(indexI)) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).compareTo(v.get(indexJ)) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- //
- // Swap strings
- //
- String tempStr = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(tempStr, indexJ);
-
- //
- // Swap sequences
- //
- int tempInt = vSequence.get(indexI);
- vSequence.setElementAt(vSequence.get(indexJ), indexI);
- vSequence.setElementAt(tempInt, indexJ);
- }
- }
- }
-
- return vSequence;
- }
-
- /**
- Sort all elements of vector as input sequence
-
- @param v The vector need to be sorted
- @param vSequence The sort sequence should be followed
-
- **/
- public static void sortVectorString(Vector<String> v, Vector<Integer> vSequence) {
- if (v != null && vSequence != null && v.size() == vSequence.size()) {
- Vector<String> tempV = new Vector<String>();
- for (int index = 0; index < v.size(); index++) {
- tempV.addElement(v.get(index));
- }
- for (int index = 0; index < v.size(); index++) {
- v.setElementAt(tempV.get(vSequence.get(index)), index);
- }
- }
- }
-
- /**
- Sort all modules
-
- @param v
- @param mode
-
- **/
- public static void sortModules(Vector<ModuleIdentification> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- ModuleIdentification temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all packages
-
- @param v
- @param mode
-
- **/
- public static void sortPackages(Vector<PackageIdentification> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PackageIdentification temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all platforms
-
- @param v
- @param mode
-
- **/
- public static void sortPlatforms(Vector<PlatformIdentification> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).getName().compareTo(v.get(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).getName().compareTo(v.get(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PlatformIdentification temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all pcd entries
-
- @param v
- @param mode
-
- **/
- public static void sortPcds(PcdVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getPcd(indexJ).getName().compareTo(v.getPcd(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getPcd(indexI).getName().compareTo(v.getPcd(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PcdIdentification temp = v.getPcd(indexI);
- v.setPcd(v.getPcd(indexJ), indexI);
- v.setPcd(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all ppi entries
-
- @param v
- @param mode
-
- **/
- public static void sortPpis(PpisVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getPpis(indexJ).getName().compareTo(v.getPpis(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getPpis(indexI).getName().compareTo(v.getPpis(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PpisIdentification temp = v.getPpis(indexI);
- v.setPpis(v.getPpis(indexJ), indexI);
- v.setPpis(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all protocol entries
-
- @param v
- @param mode
-
- **/
- public static void sortProtocols(ProtocolsVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getProtocols(indexJ).getName().compareTo(v.getProtocols(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getProtocols(indexI).getName().compareTo(v.getProtocols(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- ProtocolsIdentification temp = v.getProtocols(indexI);
- v.setProtocols(v.getProtocols(indexJ), indexI);
- v.setProtocols(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all guid entries
-
- @param v
- @param mode
-
- **/
- public static void sortGuids(GuidsVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getGuids(indexJ).getName().compareTo(v.getGuids(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getGuids(indexI).getName().compareTo(v.getGuids(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- GuidsIdentification temp = v.getGuids(indexI);
- v.setGuids(v.getGuids(indexJ), indexI);
- v.setGuids(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all pcd coded entries
-
- @param v
- @param mode
-
- **/
- public static void sortPcdCodeds(PcdCodedVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getPcdCoded(indexJ).getName().compareTo(v.getPcdCoded(indexI).getName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getPcdCoded(indexI).getName().compareTo(v.getPcdCoded(indexJ).getName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- PcdCodedIdentification temp = v.getPcdCoded(indexI);
- v.setPcdCoded(v.getPcdCoded(indexJ), indexI);
- v.setPcdCoded(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all pcd coded entries
-
- @param v
- @param mode
-
- **/
- public static void sortLibraryClass(LibraryClassVector v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.getLibraryClass(indexJ).getLibraryClassName().compareTo(
- v.getLibraryClass(indexI)
- .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.getLibraryClass(indexI).getLibraryClassName().compareTo(
- v.getLibraryClass(indexJ)
- .getLibraryClassName()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- LibraryClassIdentification temp = v.getLibraryClass(indexI);
- v.setLibraryClass(v.getLibraryClass(indexJ), indexI);
- v.setLibraryClass(temp, indexJ);
- }
- }
- }
- }
- }
-
- /**
- Sort all objects of a vector based on the object's "toString"
-
- @param v
- @param mode
-
- **/
- public static void sortObjectVector(Vector<Object> v, int mode) {
- if (v != null) {
- //
- // sort by name
- //
- for (int indexI = 0; indexI < v.size(); indexI++) {
- for (int indexJ = indexI + 1; indexJ < v.size(); indexJ++) {
- if ((v.get(indexJ).toString().compareTo(v.get(indexI).toString()) < 0 && mode == DataType.SORT_TYPE_ASCENDING)
- || (v.get(indexI).toString().compareTo(v.get(indexJ).toString()) < 0 && mode == DataType.SORT_TYPE_DESCENDING)) {
- Object temp = v.get(indexI);
- v.setElementAt(v.get(indexJ), indexI);
- v.setElementAt(temp, indexJ);
- }
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
deleted file mode 100644
index 3eb9b85455..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/Tools.java
+++ /dev/null
@@ -1,715 +0,0 @@
-/** @file
-
- The file is used to provides some useful interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import java.awt.Component;
-import java.io.File;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-import java.util.UUID;
-import java.util.Vector;
-
-import javax.swing.DefaultListModel;
-import javax.swing.JComboBox;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JTable;
-
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.MsaHeaderDocument.MsaHeader;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformHeaderDocument.PlatformHeader;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.SpdHeaderDocument.SpdHeader;
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-/**
- The class is used to provides some useful interfaces
-
- **/
-public class Tools {
-
- //
- // The dir user selected to create new package in
- //
- public static String dirForNewSpd = null;
-
- /**
- Get current date and time and format it as "yyyy-MM-dd HH:mm"
-
- @return formatted current date and time
-
- **/
- public static String getCurrentDateTime() {
- Date now = new Date(System.currentTimeMillis());
- SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
- return sdf.format(now);
- }
-
- /**
- Generate a UUID
-
- @return the created UUID
-
- **/
- public static String generateUuidString() {
- return UUID.randomUUID().toString();
- }
-
- /**
- Use current file separator in the path
-
- @param strPath
- @return
-
- **/
- public static String convertPathToCurrentOsType(String strPath) {
- strPath = strPath.replace(DataType.DOS_FILE_SEPARATOR, DataType.FILE_SEPARATOR);
- strPath = strPath.replace(DataType.UNIX_FILE_SEPARATOR, DataType.FILE_SEPARATOR);
- return strPath;
- }
-
- /**
- Use Unix file separator in the path
-
- @param strPath
- @return
-
- **/
- public static String convertPathToUnixType(String strPath) {
- strPath = strPath.replace(DataType.DOS_FILE_SEPARATOR, DataType.UNIX_FILE_SEPARATOR);
- return strPath;
- }
-
- /**
- Use Dos file separator in the path
-
- @param strPath
- @return
-
- **/
- public static String convertPathToDosType(String strPath) {
- strPath = strPath.replace(DataType.UNIX_FILE_SEPARATOR, DataType.DOS_FILE_SEPARATOR);
- return strPath;
- }
-
- /**
- Get all system properties and output to the console
-
- **/
- public static void getSystemProperties() {
- System.out.println(System.getProperty("java.class.version"));
- System.out.println(System.getProperty("java.class.path"));
- System.out.println(System.getProperty("java.ext.dirs"));
- System.out.println(System.getProperty("os.name"));
- System.out.println(System.getProperty("os.arch"));
- System.out.println(System.getProperty("os.version"));
- System.out.println(System.getProperty("file.separator"));
- System.out.println(System.getProperty("path.separator"));
- System.out.println(System.getProperty("line.separator"));
- System.out.println(System.getProperty("user.name"));
- System.out.println(System.getProperty("user.home"));
- System.out.println(System.getProperty("user.dir"));
- System.out.println(System.getProperty("PATH"));
-
- System.out.println(System.getenv("PROCESSOR_REVISION"));
- }
-
- /**
- Generate selection items for JComboBox by input vector
-
- **/
- public static void generateComboBoxByVector(JComboBox jcb, Vector<String> vector) {
- if (jcb != null) {
- jcb.removeAllItems();
- }
- if (vector != null) {
- for (int index = 0; index < vector.size(); index++) {
- jcb.addItem(vector.elementAt(index));
- }
- }
- }
-
- /**
- Generate selection items for JList by input vector
-
- **/
- public static void generateListByVector(JList jl, Vector<String> vector) {
- if (jl != null) {
- DefaultListModel listModel = (DefaultListModel) jl.getModel();
- listModel.removeAllElements();
-
- if (vector != null) {
- for (int index = 0; index < vector.size(); index++) {
- listModel.addElement(vector.get(index));
- }
- }
-
- if (listModel.size() > 0) {
- jl.setSelectedIndex(0);
- }
- }
- }
-
- /**
- Get path only from a path
-
- @param filePath
- @return
-
- **/
- public static String getFilePathOnly(String filePath) {
- String path = filePath.substring(0, filePath.length() - getFileNameOnly(filePath).length());
- if (path.endsWith(DataType.FILE_SEPARATOR)) {
- path = path.substring(0, path.length() - DataType.FILE_SEPARATOR.length());
- }
-
- return path;
- }
-
- /**
- Get file name from a path
-
- @param filePath
- @return
-
- **/
- public static String getFileNameOnly(String filePath) {
- File f = new File(filePath);
- return f.getAbsoluteFile().getName();
- }
-
- public static String getFileNameWithoutExt(String filePath) {
- filePath = getFileNameOnly(filePath);
- filePath = filePath.substring(0, filePath.lastIndexOf(DataType.FILE_EXT_SEPARATOR));
- return filePath;
- }
-
- /**
- Get relative path
-
- @param wholePath
- @param commonPath
- @return wholePath - commonPath
-
- **/
- public static String getRelativePath(String wholePath, String commonPath) {
- String path = "";
- int i = 0;
- i = wholePath.indexOf(commonPath);
- if (i > -1) {
- i = i + commonPath.length();
- } else {
- return "";
- }
- path = wholePath.substring(i);
- //
- // remove file separator of head
- //
- if (path.indexOf(DataType.DOS_FILE_SEPARATOR) == 0) {
- path = path.substring(0 + DataType.DOS_FILE_SEPARATOR.length());
- }
- if (path.indexOf(DataType.UNIX_FILE_SEPARATOR) == 0) {
- path = path.substring(0 + DataType.DOS_FILE_SEPARATOR.length());
- }
- //
- // remove file separator of rear
- //
- if (path.length() > 0
- && path.indexOf(DataType.DOS_FILE_SEPARATOR) == path.length() - DataType.DOS_FILE_SEPARATOR.length()) {
- path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
- }
- if (path.length() > 0
- && path.indexOf(DataType.UNIX_FILE_SEPARATOR) == path.length() - DataType.UNIX_FILE_SEPARATOR.length()) {
- path = path.substring(0, path.length() - DataType.DOS_FILE_SEPARATOR.length());
- }
- //
- // convert to UNIX format
- //
- path = Tools.convertPathToUnixType(path);
- return path;
- }
-
- /**
- Convert List ot Vector
-
- @param list
- @return
-
- **/
- public static Vector<String> convertListToVector(List list) {
- Vector<String> v = new Vector<String>();
- if (list != null && list.size() > 0) {
- for (int index = 0; index < list.size(); index++) {
- v.addElement(list.get(index).toString());
- }
- }
- return v;
- }
-
- /**
- Convert a Vector to a String, separator with ", "
-
- @param v
- @return
-
- **/
- public static String convertVectorToString(Vector<String> v) {
- String s = "";
- for (int index = 0; index < v.size(); index++) {
- s = s + v.elementAt(index).toString() + ", ";
- }
- if (s.length() > 0) {
- s = s.substring(0, s.length() - ", ".length());
- }
- return s;
- }
-
- /**
- Convert a List to a String
-
- @param list
- @return
-
- **/
- public static String convertListToString(List list) {
- return Tools.convertVectorToString(Tools.convertListToVector(list));
- }
-
- /**
- If the input path missing ext, append the ext to the path
-
- @param path
- @param type
- @return
-
- **/
- public static String addPathExt(String path, int type) {
- String match = "";
- if (type == DataType.RETURN_TYPE_MODULE_SURFACE_AREA) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.MODULE_SURFACE_AREA_EXT;
- }
- if (type == DataType.RETURN_TYPE_PACKAGE_SURFACE_AREA) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.PACKAGE_SURFACE_AREA_EXT;
- }
- if (type == DataType.RETURN_TYPE_PLATFORM_SURFACE_AREA) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.PLATFORM_SURFACE_AREA_EXT;
- }
- if (type == DataType.RETURN_TYPE_TEXT) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.TEXT_FILE_EXT;
- }
- if (type == DataType.RETURN_TYPE_FAR_SURFACE_AREA) {
- match = DataType.FILE_EXT_SEPARATOR + DataType.FAR_SURFACE_AREA_EXT;
- }
- if (path.length() <= match.length()) {
- path = path + match;
- return path;
- }
- if (!(path.substring(path.length() - match.length())).equals(match)) {
- path = path + match;
- }
- return path;
- }
-
- /**
- Show a message box
-
- @param arg0
-
- **/
- public static void showInformationMessage(String arg0) {
- JOptionPane.showConfirmDialog(FrameworkWizardUI.getInstance(), arg0, "Info", JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE);
- }
-
- /**
- if the string doesn't end with a file separator, append it to the string
-
- @param arg0
- @return
-
- **/
- public static String addFileSeparator(String arg0) {
- if (!arg0.endsWith(DataType.FILE_SEPARATOR)) {
- arg0 = arg0 + DataType.FILE_SEPARATOR;
- }
- return arg0;
- }
-
- /**
- Wrap single line long input string to multiple short line string by word
-
- @param arg0 input string
- @return wraped string
-
- **/
- public static String wrapStringByWord(String arg0) {
- int intMaxLength = 40;
- String strReturn = "";
- String strTemp = "";
- boolean isCopied = true;
-
- if (arg0 == null) {
- return "";
- }
- if (arg0.length() <= 0) {
- return "";
- }
-
- //
- // Convert string to array by " "
- //
- String s[] = arg0.split(" ");
- if (arg0.indexOf(" ") == -1) {
- s[0] = arg0;
- }
-
- //
- // Add each string of array one by one
- //
- for (int index = 0; index < s.length; index++) {
- String ss = s[index];
- isCopied = false;
- //
- // The word length > defined line length
- //
- if (ss.length() > intMaxLength) {
- //
- // Finish previous line
- //
- if (!isCopied) {
- strReturn = strReturn + strTemp + DataType.LINE_SEPARATOR;
- strTemp = "";
- }
- //
- // Separater to short lines
- //
- while (ss.length() > 0) {
- if (ss.length() > intMaxLength) {
- strReturn = strReturn + s[index].substring(0, intMaxLength - 1) + DataType.UNIX_LINE_SEPARATOR;
- ss = ss.substring(intMaxLength);
- isCopied = true;
- } else {
- strTemp = ss;
- ss = "";
- isCopied = false;
- }
- }
- } else {
- if ((strTemp + " " + ss).length() <= intMaxLength) {
- strTemp = strTemp + " " + ss;
- continue;
- } else {
- strReturn = strReturn + strTemp + DataType.LINE_SEPARATOR;
- if ((index == s.length - 1) && (!ss.equals(""))) {
- strReturn = strReturn + ss;
- } else {
- strTemp = ss + " ";
- }
- isCopied = true;
- }
- }
- }
-
- if (!isCopied) {
- strReturn = strReturn + strTemp;
- }
-
- return strReturn;
- }
-
- public static String convertUnicodeHexStringToString(String str) {
- //
- // Handle if str is null or empty
- //
- if (str == null) {
- return "";
- }
- if (str.equals("")) {
- return "";
- }
-
- String returnString = "";
- String[] strArray = str.split(" ");
- for (int index = 0; index < strArray.length; index++) {
- String s = strArray[index];
- if (s.length() == 6 && s.indexOf(DataType.HEX_STRING_HEADER) == 0) {
- s = s.substring(DataType.HEX_STRING_HEADER.length());
- } else {
- Log.err("convertUnicodeHexStringToString", "Incorrect input string: " + str);
- continue;
- }
- //
- // Change hex to dec
- //
- int dec = Integer.parseInt(s, 16);
-
- returnString = returnString + (char) (dec);
- }
- return returnString;
- }
-
- /**
- Convert input string to unicode hex string
-
- @param str input string
- @return unicode hex string
-
- **/
- public static String convertStringToUnicodeHexString(String str) {
- //
- // Handle if str is null or empty
- //
- if (str == null) {
- return "";
- }
- if (str.equals("")) {
- return "";
- }
-
- //
- // convert string to hex string
- //
- String hexString = "";
- for (int index = 0; index < str.length(); index++) {
- int codePoint = str.codePointAt(index);
- String s = Integer.toHexString(codePoint);
- //
- // Make the string to four length
- //
- if (s.length() == 3) {
- s = "0" + s;
- } else if (s.length() == 2) {
- s = "00" + s;
- } else if (s.length() == 1) {
- s = "000" + s;
- }
-
- //
- // Add the string to return hex string
- //
- hexString = hexString + DataType.HEX_STRING_HEADER + s + " ";
- }
-
- //
- // return hex string
- //
- return hexString.trim();
- }
-
- public static ModuleIdentification getId(String path, ModuleSurfaceArea msa) {
- MsaHeader head = msa.getMsaHeader();
- String name = head.getModuleName();
- String guid = head.getGuidValue();
- String version = head.getVersion();
- ModuleIdentification id = new ModuleIdentification(name, guid, version, path);
- return id;
- }
-
- public static PackageIdentification getId(String path, PackageSurfaceArea spd) {
- SpdHeader head = spd.getSpdHeader();
- String name = head.getPackageName();
- String guid = head.getGuidValue();
- String version = head.getVersion();
- PackageIdentification id = new PackageIdentification(name, guid, version, path);
- return id;
- }
-
- public static PlatformIdentification getId(String path, PlatformSurfaceArea fpd) {
- PlatformHeader head = fpd.getPlatformHeader();
- String name = head.getPlatformName();
- String guid = head.getGuidValue();
- String version = head.getVersion();
- PlatformIdentification id = new PlatformIdentification(name, guid, version, path);
- return id;
- }
-
- /**
- * To reset the width of input component via container width
- *
- * @param c
- * @param containerWidth
- *
- */
- public static void resizeComponentWidth(Component c, int containerWidth, int preferredWidth) {
- int newWidth = c.getPreferredSize().width + (containerWidth - preferredWidth);
- if (newWidth < c.getPreferredSize().width) {
- newWidth = c.getPreferredSize().width;
- }
- c.setSize(new java.awt.Dimension(newWidth, c.getHeight()));
- c.validate();
- }
-
- /**
- * To reset the height of input component via container height
- *
- * @param c
- * @param containerHeight
- *
- */
- public static void resizeComponentHeight(Component c, int containerHeight, int preferredHeight) {
- int newHeight = c.getPreferredSize().height + (containerHeight - preferredHeight);
- if (newHeight < c.getPreferredSize().height) {
- newHeight = c.getPreferredSize().height;
- }
- c.setSize(new java.awt.Dimension(c.getWidth(), newHeight));
- c.validate();
- }
-
- /**
- * To reset the size of input component via container size
- *
- * @param c
- * @param containerWidth
- * @param containerHeight
- *
- */
- public static void resizeComponent(Component c, int containerWidth, int containerHeight, int preferredWidth,
- int preferredHeight) {
- resizeComponentWidth(c, containerWidth, preferredWidth);
- resizeComponentHeight(c, containerHeight, preferredHeight);
- }
-
- /**
- To adjust each column's width to meet the table's size
-
- @param t the table need to be adjusted
- @param width the new width of the table
-
- **/
- public static void resizeTableColumn(JTable t, int width) {
- if (t != null) {
- int columnCount = t.getColumnCount();
- for (int index = 0; index < columnCount; index++) {
- t.getColumn(t.getColumnName(index)).setPreferredWidth(width / columnCount);
- }
- }
- }
-
- /**
- * To relocate the input component
- *
- * @param c
- * @param containerWidth
- * @param spaceToRight
- *
- */
- public static void relocateComponentX(Component c, int containerWidth, int preferredWidth, int spaceToRight) {
- int intGapToRight = spaceToRight + c.getPreferredSize().width;
- int newLocationX = containerWidth - intGapToRight;
- if (newLocationX < preferredWidth - intGapToRight) {
- newLocationX = preferredWidth - intGapToRight;
- }
- c.setLocation(newLocationX, c.getLocation().y);
- c.validate();
- }
-
- /**
- * To relocate the input component
- *
- * @param c
- * @param containerHeight
- * @param spaceToBottom
- *
- */
- public static void relocateComponentY(Component c, int containerHeight, int preferredHeight, int spaceToBottom) {
- int intGapToBottom = spaceToBottom + c.getPreferredSize().height;
- int newLocationY = containerHeight - intGapToBottom;
- if (newLocationY < preferredHeight - spaceToBottom) {
- newLocationY = preferredHeight - spaceToBottom;
- }
- c.setLocation(c.getLocation().x, newLocationY);
- c.validate();
- }
-
- /**
- * To relocate the input component
- *
- * @param c
- * @param containerWidth
- * @param containerHeight
- * @param spaceToBottom
- * @param spaceToRight
- *
- */
- public static void relocateComponent(Component c, int containerWidth, int containerHeight, int preferredWidht,
- int preferredHeight, int spaceToRight, int spaceToBottom) {
- relocateComponentX(c, containerWidth, preferredWidht, spaceToRight);
- relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);
- }
-
- /**
- Move the component to the center of screen
-
- @param c
- @param width
-
- **/
- public static void centerComponent(Component c, int width) {
- c.setLocation(width / 2 - c.getWidth() / 2, c.getLocation().y);
- c.validate();
- }
-
- /**
- Move the component to the center of screen and adjust the y location
-
- @param c
- @param width
-
- **/
- public static void centerComponent(Component c, int width, int containerHeight, int preferredHeight,
- int spaceToBottom) {
- relocateComponentY(c, containerHeight, preferredHeight, spaceToBottom);
- centerComponent(c, width);
- }
-
- /**
- Find the count of searchString in wholeString
-
- @param wholeString
- @param searchString
- @return
-
- **/
- public static int getSpecificStringCount(String wholeString, String searchString) {
- int count = 0;
- count = wholeString.split(searchString).length;
- return count;
- }
-
- /**
- * Check the input data is empty or not
- *
- * @param strValue
- * The input data which need be checked
- *
- * @retval true - The input data is empty
- * @retval fals - The input data is not empty
- *
- */
- public static boolean isEmpty(String strValue) {
- if (strValue == null) {
- return true;
- }
- if (strValue.length() > 0) {
- return false;
- }
- return true;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java
deleted file mode 100644
index db7b58d1d9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/XmlConfig.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
-
- The file is used to config XML file format
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlOptions;
-
-public class XmlConfig {
- public static XmlCursor setupXmlCursor(XmlCursor cursor) {
- String uri = "http://www.TianoCore.org/2006/Edk2.0";
- cursor.push();
- cursor.toNextToken();
- cursor.insertNamespace("", uri);
- cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
- cursor.pop();
- return cursor;
- }
-
- public static XmlOptions setupXmlOptions() {
- XmlOptions options = new XmlOptions();
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- return options;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java
deleted file mode 100644
index de67728dfc..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/Find.java
+++ /dev/null
@@ -1,1050 +0,0 @@
-/** @file
-
- The file is used to provide Find funtions in workspace
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-import java.util.Vector;
-
-import org.tianocore.GuidDeclarationsDocument.GuidDeclarations;
-import org.tianocore.LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PcdDeclarationsDocument.PcdDeclarations.PcdEntry;
-import org.tianocore.PpiDeclarationsDocument.PpiDeclarations;
-import org.tianocore.ProtocolDeclarationsDocument.ProtocolDeclarations;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Sort;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class Find {
-
- private final static String SEPERATOR = ".";
-
- /**
- Get all ppi entries from workspace
-
- @return
-
- **/
- public static PpisVector getAllPpisVector() {
- PpisVector pv = new PpisVector();
- ModuleSurfaceArea msa = null;
- ModuleIdentification mid = null;
- PpisIdentification pid = null;
-
- //
- // Go through each module one by one
- //
- if (GlobalData.openingModuleList.size() > 0) {
- for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
- msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
- mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
-
- if (msa.getPPIs() != null) {
- if (msa.getPPIs().getPpiList().size() > 0) {
- for (int index = 0; index < msa.getPPIs().getPpiList().size(); index++) {
- String arg0 = msa.getPPIs().getPpiList().get(index).getPpiCName();
- String arg1 = DataType.PPI_TYPE_PPI;
- String arg2 = null;
- if (msa.getPPIs().getPpiList().get(index).getUsage() != null) {
- arg2 = msa.getPPIs().getPpiList().get(index).getUsage().toString();
- }
-
- String arg3 = msa.getPPIs().getPpiList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiList().get(index)
- .getSupArchList());
- String arg5 = msa.getPPIs().getPpiList().get(index).getHelpText();
-
- pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getPpiDeclarations() != null) {
- for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()
- .size(); indexOfPpis++) {
- if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()
- .equals(arg0)) {
- pid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (pid.getDeclaredBy() == null) {
- pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- pv.addPpis(pid);
- }
- }
- if (msa.getPPIs().getPpiNotifyList().size() > 0) {
- for (int index = 0; index < msa.getPPIs().getPpiNotifyList().size(); index++) {
- String arg0 = msa.getPPIs().getPpiNotifyList().get(index).getPpiNotifyCName();
- String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;
- String arg2 = null;
- if (msa.getPPIs().getPpiNotifyList().get(index).getUsage() != null) {
- arg2 = msa.getPPIs().getPpiNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = msa.getPPIs().getPpiNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(msa.getPPIs().getPpiNotifyList().get(index)
- .getSupArchList());
- String arg5 = msa.getPPIs().getPpiNotifyList().get(index).getHelpText();
-
- pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getPpiDeclarations() != null) {
- for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList()
- .size(); indexOfPpis++) {
- if (spd.getPpiDeclarations().getEntryList().get(indexOfPpis).getCName()
- .equals(arg0)) {
- pid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (pid.getDeclaredBy() == null) {
- pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- pv.addPpis(pid);
- }
- }
- }
- }
- }
- //
- // Go through all defined ppi to find which is not added yet.
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage).getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage)
- .getId();
- if (spd.getPpiDeclarations() != null) {
- for (int indexOfPpis = 0; indexOfPpis < spd.getPpiDeclarations().getEntryList().size(); indexOfPpis++) {
- boolean isFound = false;
- PpiDeclarations.Entry e = spd.getPpiDeclarations().getEntryList().get(indexOfPpis);
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- if (e.getCName().equals(pv.getPpis(indexOfPv).getName())) {
- isFound = true;
- break;
- }
- }
- if (!isFound) {
- String arg0 = e.getCName();
- String arg1 = "";
- String arg2 = "";
- String arg3 = "";
- Vector<String> arg4 = Tools.convertListToVector(e.getSupArchList());
- String arg5 = e.getHelpText();
-
- pid = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(null);
- pid.setDeclaredBy(packageId);
- pv.addPpis(pid);
- }
- }
- }
- }
- Sort.sortPpis(pv, DataType.SORT_TYPE_ASCENDING);
- return pv;
- }
-
- /**
- Re-org all ppi entries for find table
-
- @return
-
- **/
- public static Vector<PpiId> getAllPpisForFind() {
- Vector<PpiId> ppi = new Vector<PpiId>();
- PpisVector pv = Find.getAllPpisVector();
- boolean isAdded = false;
- boolean isProduced = false;
-
- //
- // Go through pv to add item as new format to ppi one by one
- //
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- isAdded = false;
- PpisIdentification pvId = pv.getPpis(indexOfPv);
-
- //
- // First check if produced or not
- //
- if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isProduced = true;
- } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- isProduced = false;
- }
-
- //
- // Get the sting "PackageName.ModuleName"
- //
- String tmp = "";
- if (pvId.getBelongModule() != null) {
- tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();
- }
-
- //
- // Check if the item has been added in
- // If added, append package name and new module name
- // If not added, add a new one first
- //
- for (int indexOfPpi = 0; indexOfPpi < ppi.size(); indexOfPpi++) {
- PpiId ppiId = ppi.get(indexOfPpi);
-
- if (pvId.getName().equals(ppiId.getName())) {
- if (isProduced) {
- ppi.get(indexOfPpi).setProducedModules(ppiId.getProducedModules() + "<br>" + tmp);
- } else if (!isProduced) {
- ppi.get(indexOfPpi).setConsumedModules(ppiId.getConsumedModules() + "<br>" + tmp);
- }
- isAdded = true;
- continue;
- }
- }
-
- //
- // Add a new one
- //
- if (!isAdded) {
- if (isProduced) {
- ppi
- .addElement(new PpiId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy().getName()));
- } else if (!isProduced) {
- ppi
- .addElement(new PpiId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy().getName()));
- }
- }
- }
-
- return ppi;
- }
-
- /**
- Get all protocol entries from workspace
-
- @return
-
- **/
- public static ProtocolsVector getAllProtocolsVector() {
- ProtocolsVector pv = new ProtocolsVector();
- ModuleSurfaceArea msa = null;
- ModuleIdentification mid = null;
- ProtocolsIdentification pid = null;
-
- //
- // Go through each module one by one
- //
- if (GlobalData.openingModuleList.size() > 0) {
- for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
- msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
- mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
-
- if (msa.getProtocols() != null) {
- if (msa.getProtocols().getProtocolList().size() > 0) {
- for (int index = 0; index < msa.getProtocols().getProtocolList().size(); index++) {
- String arg0 = msa.getProtocols().getProtocolList().get(index).getProtocolCName();
- String arg1 = DataType.PROTOCOL_TYPE_PROTOCOL;
- String arg2 = null;
- if (msa.getProtocols().getProtocolList().get(index).getUsage() != null) {
- arg2 = msa.getProtocols().getProtocolList().get(index).getUsage().toString();
- }
-
- String arg3 = msa.getProtocols().getProtocolList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolList()
- .get(index).getSupArchList());
- String arg5 = msa.getProtocols().getProtocolList().get(index).getHelpText();
-
- pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getProtocolDeclarations() != null) {
- for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()
- .getEntryList().size(); indexOfProtocols++) {
- if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)
- .getCName().equals(arg0)) {
- pid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (pid.getDeclaredBy() == null) {
- pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
- pv.addProtocols(pid);
- }
- }
- if (msa.getProtocols().getProtocolNotifyList().size() > 0) {
- for (int index = 0; index < msa.getProtocols().getProtocolNotifyList().size(); index++) {
- String arg0 = msa.getProtocols().getProtocolNotifyList().get(index)
- .getProtocolNotifyCName();
- String arg1 = DataType.PPI_TYPE_PPI_NOTIFY;
- String arg2 = null;
- if (msa.getProtocols().getProtocolNotifyList().get(index).getUsage() != null) {
- arg2 = msa.getProtocols().getProtocolNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = msa.getProtocols().getProtocolNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(msa.getProtocols().getProtocolNotifyList()
- .get(index).getSupArchList());
- String arg5 = msa.getProtocols().getProtocolNotifyList().get(index).getHelpText();
-
- pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getProtocolDeclarations() != null) {
- for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations()
- .getEntryList().size(); indexOfProtocols++) {
- if (spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols)
- .getCName().equals(arg0)) {
- pid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (pid.getDeclaredBy() == null) {
- pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- pv.addProtocols(pid);
- }
- }
- }
- }
- }
- //
- // Go through all defined protocols to find which is not added yet.
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage).getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage)
- .getId();
- if (spd.getProtocolDeclarations() != null) {
- for (int indexOfProtocols = 0; indexOfProtocols < spd.getProtocolDeclarations().getEntryList().size(); indexOfProtocols++) {
- boolean isFound = false;
- ProtocolDeclarations.Entry e = spd.getProtocolDeclarations().getEntryList().get(indexOfProtocols);
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- if (e.getCName().equals(pv.getProtocols(indexOfPv).getName())) {
- isFound = true;
- break;
- }
- }
- if (!isFound) {
- String arg0 = e.getCName();
- String arg1 = "";
- String arg2 = "";
- String arg3 = "";
- Vector<String> arg4 = Tools.convertListToVector(e.getSupArchList());
- String arg5 = e.getHelpText();
-
- pid = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- pid.setBelongModule(null);
- pid.setDeclaredBy(packageId);
- pv.addProtocols(pid);
- }
- }
- }
- }
- Sort.sortProtocols(pv, DataType.SORT_TYPE_ASCENDING);
- return pv;
- }
-
- /**
- Re-org all protocol entries for find table
-
- @return
-
- **/
- public static Vector<ProtocolId> getAllProtocolsForFind() {
- Vector<ProtocolId> protocol = new Vector<ProtocolId>();
- ProtocolsVector pv = Find.getAllProtocolsVector();
- boolean isAdded = false;
- boolean isProduced = false;
-
- //
- // Go through pv to add item as new format to ppi one by one
- //
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- isAdded = false;
- ProtocolsIdentification pvId = pv.getProtocols(indexOfPv);
-
- //
- // First check if produced or not
- //
- if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isProduced = true;
- } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- isProduced = false;
- }
-
- //
- // Get the sting "PackageName.ModuleName"
- //
- String tmp = "";
- if (pvId.getBelongModule() != null) {
- tmp = pvId.getBelongModule().getPackageId().getName() + SEPERATOR + pvId.getBelongModule().getName();
- }
-
- //
- // Check if the item has been added in
- // If added, append package name and new module name
- // If not added, add a new one first
- //
- for (int indexOfProtocol = 0; indexOfProtocol < protocol.size(); indexOfProtocol++) {
- ProtocolId protocolId = protocol.get(indexOfProtocol);
-
- if (pvId.getName().equals(protocolId.getName())) {
- if (isProduced) {
- protocol.get(indexOfProtocol)
- .setProducedModules(protocolId.getProducedModules() + "<br>" + tmp);
- } else if (!isProduced) {
- protocol.get(indexOfProtocol)
- .setConsumedModules(protocolId.getConsumedModules() + "<br>" + tmp);
- }
- isAdded = true;
- continue;
- }
- }
-
- //
- // Add a new one
- //
- if (!isAdded) {
- if (isProduced) {
- protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), tmp, null, pvId.getDeclaredBy()
- .getName()));
- } else if (!isProduced) {
- protocol.addElement(new ProtocolId(pvId.getName(), pvId.getType(), null, tmp, pvId.getDeclaredBy()
- .getName()));
- }
- }
- }
-
- return protocol;
- }
-
- /**
- Get all protocol entries from workspace
-
- @return
-
- **/
- public static GuidsVector getAllGuidsVector() {
- GuidsVector gv = new GuidsVector();
- ModuleSurfaceArea msa = null;
- ModuleIdentification mid = null;
- GuidsIdentification gid = null;
-
- //
- // Go through each module one by one
- //
- if (GlobalData.openingModuleList.size() > 0) {
- for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
- msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
- mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
-
- if (msa.getGuids() != null) {
- if (msa.getGuids().getGuidCNamesList().size() > 0) {
- for (int index = 0; index < msa.getGuids().getGuidCNamesList().size(); index++) {
- String arg0 = msa.getGuids().getGuidCNamesList().get(index).getGuidCName();
- String arg1 = null;
- if (msa.getGuids().getGuidCNamesList().get(index).getUsage() != null) {
- arg1 = msa.getGuids().getGuidCNamesList().get(index).getUsage().toString();
- }
-
- String arg2 = msa.getGuids().getGuidCNamesList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(msa.getGuids().getGuidCNamesList()
- .get(index).getSupArchList());
- String arg4 = msa.getGuids().getGuidCNamesList().get(index).getHelpText();
-
- gid = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- gid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getGuidDeclarations() != null) {
- for (int indexOfGuids = 0; indexOfGuids < spd.getGuidDeclarations().getEntryList()
- .size(); indexOfGuids++) {
- if (spd.getGuidDeclarations().getEntryList().get(indexOfGuids).getCName()
- .equals(arg0)) {
- gid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (gid.getDeclaredBy() == null) {
- gid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- gv.addGuids(gid);
- }
- }
- }
- }
- }
- //
- // Go through all defined guids to find which is not added yet.
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage).getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage)
- .getId();
- if (spd.getGuidDeclarations() != null) {
- for (int indexOfGuids = 0; indexOfGuids < spd.getGuidDeclarations().getEntryList().size(); indexOfGuids++) {
- boolean isFound = false;
- GuidDeclarations.Entry e = spd.getGuidDeclarations().getEntryList().get(indexOfGuids);
- for (int indexOfGv = 0; indexOfGv < gv.size(); indexOfGv++) {
- if (e.getCName().equals(gv.getGuids(indexOfGv).getName())) {
- isFound = true;
- break;
- }
- }
- if (!isFound) {
- String arg0 = e.getCName();
- String arg1 = "";
- String arg2 = "";
- Vector<String> arg3 = Tools.convertListToVector(e.getSupArchList());
- String arg4 = e.getHelpText();
-
- gid = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- gid.setBelongModule(null);
- gid.setDeclaredBy(packageId);
- gv.addGuids(gid);
- }
- }
- }
- }
- Sort.sortGuids(gv, DataType.SORT_TYPE_ASCENDING);
- return gv;
- }
-
- /**
- Re-org all guid entries for find table
-
- @return
-
- **/
- public static Vector<GuidId> getAllGuidsForFind() {
- Vector<GuidId> guid = new Vector<GuidId>();
- GuidsVector gv = Find.getAllGuidsVector();
- boolean isAdded = false;
- boolean isProduced = false;
-
- //
- // Go through pv to add item as new format to ppi one by one
- //
- for (int indexOfGv = 0; indexOfGv < gv.size(); indexOfGv++) {
- isAdded = false;
- GuidsIdentification gvId = gv.getGuids(indexOfGv);
-
- //
- // First check if produced or not
- //
- if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isProduced = true;
- } else if (gvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
- || gvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- isProduced = false;
- }
-
- //
- // Get the sting "PackageName.ModuleName"
- //
- String tmp = "";
- if (gvId.getBelongModule() != null) {
- tmp = gvId.getBelongModule().getPackageId().getName() + SEPERATOR + gvId.getBelongModule().getName();
- }
-
- //
- // Check if the item has been added in
- // If added, append package name and new module name
- // If not added, add a new one first
- //
- for (int indexOfGuid = 0; indexOfGuid < guid.size(); indexOfGuid++) {
- GuidId guidId = guid.get(indexOfGuid);
-
- if (gvId.getName().equals(guidId.getName())) {
- if (isProduced) {
- guid.get(indexOfGuid).setProducedModules(guidId.getProducedModules() + "<br>" + tmp);
- } else if (!isProduced) {
- guid.get(indexOfGuid).setConsumedModules(guidId.getConsumedModules() + "<br>" + tmp);
- }
- isAdded = true;
- continue;
- }
- }
-
- //
- // Add a new one
- //
- if (!isAdded) {
- if (isProduced) {
- guid.addElement(new GuidId(gvId.getName(), "GUID", tmp, null, gvId.getDeclaredBy().getName()));
- } else if (!isProduced) {
- guid.addElement(new GuidId(gvId.getName(), "GUID", null, tmp, gvId.getDeclaredBy().getName()));
- }
- }
- }
-
- return guid;
- }
-
- /**
- Get all pcd coded entries from workspace
-
- @return
-
- **/
- public static PcdCodedVector getAllPcdCodedVector() {
- PcdCodedVector pv = new PcdCodedVector();
- ModuleSurfaceArea msa = null;
- ModuleIdentification mid = null;
- PcdCodedIdentification pid = null;
-
- //
- // Go through each module one by one
- //
- if (GlobalData.openingModuleList.size() > 0) {
- for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
- msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
- mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
-
- if (msa.getPcdCoded() != null) {
- if (msa.getPcdCoded().getPcdEntryList().size() > 0) {
- for (int index = 0; index < msa.getPcdCoded().getPcdEntryList().size(); index++) {
-
- String arg0 = msa.getPcdCoded().getPcdEntryList().get(index).getCName();
- String arg1 = msa.getPcdCoded().getPcdEntryList().get(index).getTokenSpaceGuidCName();
-
- String arg2 = msa.getPcdCoded().getPcdEntryList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(msa.getPcdCoded().getPcdEntryList()
- .get(index).getSupArchList());
-
- String arg4 = msa.getPcdCoded().getPcdEntryList().get(index).getDefaultValue();
- String arg5 = msa.getPcdCoded().getPcdEntryList().get(index).getHelpText();
- String arg6 = null;
- if (msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType() != null) {
- arg6 = msa.getPcdCoded().getPcdEntryList().get(index).getPcdItemType().toString();
- }
- String arg7 = null;
- if (msa.getPcdCoded().getPcdEntryList().get(index).getUsage() != null) {
- arg7 = msa.getPcdCoded().getPcdEntryList().get(index).getUsage().toString();
- }
- pid = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- pid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getPcdDeclarations() != null) {
- for (int indexOfPcds = 0; indexOfPcds < spd.getPcdDeclarations().getPcdEntryList()
- .size(); indexOfPcds++) {
- PcdEntry pcdEntry = spd.getPcdDeclarations().getPcdEntryList().get(indexOfPcds);
- if (pcdEntry.getCName().equals(arg0)) {
- pid.setTokenSpaceGuidCName(pcdEntry.getTokenSpaceGuidCName());
- pid.setToken(pcdEntry.getToken().toString());
- pid.setDatumType(pcdEntry.getDatumType().toString());
- pid.setValue(pcdEntry.getDefaultValue());
- pid.setUsage(Tools.convertListToString(pcdEntry.getValidUsage()));
- pid.setHelp(pcdEntry.getHelpText());
- pid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (pid.getDeclaredBy() == null) {
- pid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- pv.addPcdCoded(pid);
- }
- }
- }
- }
- }
- //
- // Go through all defined pcds to find which is not added yet.
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage).getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage)
- .getId();
- if (spd.getPcdDeclarations() != null) {
- for (int indexOfPcds = 0; indexOfPcds < spd.getPcdDeclarations().getPcdEntryList().size(); indexOfPcds++) {
- boolean isFound = false;
- PcdEntry e = spd.getPcdDeclarations().getPcdEntryList().get(indexOfPcds);
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- if (e.getCName().equals(pv.getPcdCoded(indexOfPv).getName())) {
- isFound = true;
- break;
- }
- }
- if (!isFound) {
- pid = new PcdCodedIdentification("", "", "", null, "", "", null, null);
- pid.setName(e.getCName());
- pid.setTokenSpaceGuidCName(e.getTokenSpaceGuidCName());
- pid.setToken(e.getToken().toString());
- pid.setDatumType(e.getDatumType().toString());
- pid.setValue(e.getDefaultValue());
- pid.setUsage(Tools.convertListToString(e.getValidUsage()));
- pid.setHelp(e.getHelpText());
- pid.setDeclaredBy(packageId);
-
- pid.setBelongModule(null);
- pv.addPcdCoded(pid);
- }
- }
- }
- }
- Sort.sortPcdCodeds(pv, DataType.SORT_TYPE_ASCENDING);
- return pv;
- }
-
- /**
-
- @param pv
- @return
-
- **/
- public static Vector<PcdFindResultId> getAllPcdCodedForFind(PcdCodedVector pv) {
- Vector<PcdFindResultId> pcd = new Vector<PcdFindResultId>();
- boolean isAdded = false;
- boolean isProduced = false;
-
- //
- // Go through pv to add item as new format to ppi one by one
- //
- for (int indexOfPv = 0; indexOfPv < pv.size(); indexOfPv++) {
- isAdded = false;
- PcdCodedIdentification pvId = pv.getPcdCoded(indexOfPv);
-
- //
- // First check if produced or not
- //
- if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isProduced = true;
- } else if (pvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
- || pvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- isProduced = false;
- }
-
- //
- // Check if the item has been added in
- // If added, append package name and new module name
- // If not added, add a new one first
- //
- for (int indexOfGuid = 0; indexOfGuid < pcd.size(); indexOfGuid++) {
- PcdFindResultId pcdId = pcd.get(indexOfGuid);
-
- if (pvId.getName().equals(pcdId.getName())) {
- if (isProduced) {
- pcd.get(indexOfGuid).addProducedModules(pvId.getBelongModule());
- } else if (!isProduced) {
- pcd.get(indexOfGuid).addConsumedModules(pvId.getBelongModule());
- }
- isAdded = true;
- continue;
- }
- }
-
- //
- // Add a new one
- //
- if (!isAdded) {
- PcdFindResultId pcdId = new PcdFindResultId(pvId.getName(), "PCD", pvId.getSupArchList(),
- pvId.getHelp(), null, pvId.getDeclaredBy());
- pcdId.setTokenSpaceGuidCName(pvId.getTokenSpaceGuidCName());
- pcdId.setToken(pvId.getToken());
- pcdId.setDatumType(pvId.getDatumType());
- pcdId.setValue(pvId.getValue());
- pcdId.setUsage(pvId.getUsage());
-
- pcd.addElement(pcdId);
- }
- }
-
- return pcd;
- }
-
- /**
- Get all library class entries from workspace
-
- @return
-
- **/
- public static LibraryClassVector getAllLibraryClassVector() {
- LibraryClassVector lcv = new LibraryClassVector();
- ModuleSurfaceArea msa = null;
- ModuleIdentification mid = null;
- LibraryClassIdentification lcid = null;
-
- //
- // Go through each module one by one
- //
- if (GlobalData.openingModuleList.size() > 0) {
- for (int indexOfModule = 0; indexOfModule < GlobalData.openingModuleList.size(); indexOfModule++) {
- msa = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getXmlMsa();
- mid = GlobalData.openingModuleList.getOpeningModuleByIndex(indexOfModule).getId();
-
- if (msa.getLibraryClassDefinitions() != null) {
- LibraryClassDefinitions lcd = msa.getLibraryClassDefinitions();
- if (lcd.getLibraryClassList().size() > 0) {
- for (int index = 0; index < lcd.getLibraryClassList().size(); index++) {
- String name = lcd.getLibraryClassList().get(index).getKeyword();
- String usage = null;
- if (lcd.getLibraryClassList().get(index).getUsage() != null) {
- usage = lcd.getLibraryClassList().get(index).getUsage().toString();
- }
- String version = lcd.getLibraryClassList().get(index).getRecommendedInstanceVersion();
- String guid = lcd.getLibraryClassList().get(index).getRecommendedInstanceGuid();
- String featureFlag = lcd.getLibraryClassList().get(index).getFeatureFlag();
- Vector<String> arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupArchList());
- Vector<String> module = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupModuleList());
- String help = lcd.getLibraryClassList().get(index).getHelpText();
- lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag,
- module, help);
- lcid.setBelongModule(mid);
-
- //
- // Find which package declares it
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList
- .getOpeningPackageByIndex(
- indexOfPackage)
- .getId();
- if (spd.getLibraryClassDeclarations() != null) {
- for (int indexOfLibraryClass = 0; indexOfLibraryClass < spd
- .getLibraryClassDeclarations()
- .getLibraryClassList()
- .size(); indexOfLibraryClass++) {
- LibraryClass lc = spd.getLibraryClassDeclarations().getLibraryClassList()
- .get(indexOfLibraryClass);
- if (lc.getName().equals(name)) {
- lcid.setSupArchList(Tools.convertListToVector(lc.getSupArchList()));
- lcid.setSupModuleList(Tools.convertListToVector(lc.getSupModuleList()));
- lcid.setHelp(lc.getHelpText());
- lcid.setDeclaredBy(packageId);
- break;
- }
- }
- }
- }
- if (lcid.getDeclaredBy() == null) {
- lcid.setDeclaredBy(new PackageIdentification("", "", "", ""));
- }
-
- lcv.addLibraryClass(lcid);
- }
- }
- }
- }
- }
- //
- // Go through all defined pcds to find which is not added yet.
- //
- for (int indexOfPackage = 0; indexOfPackage < GlobalData.openingPackageList.size(); indexOfPackage++) {
- PackageSurfaceArea spd = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage).getXmlSpd();
- PackageIdentification packageId = GlobalData.openingPackageList.getOpeningPackageByIndex(indexOfPackage)
- .getId();
- if (spd.getLibraryClassDeclarations() != null) {
- for (int indexOfLibraryClass = 0; indexOfLibraryClass < spd.getLibraryClassDeclarations()
- .getLibraryClassList().size(); indexOfLibraryClass++) {
- boolean isFound = false;
- LibraryClass lc = spd.getLibraryClassDeclarations().getLibraryClassList().get(indexOfLibraryClass);
- for (int indexOfLcv = 0; indexOfLcv < lcv.size(); indexOfLcv++) {
- if (lc.getName().equals(lcv.getLibraryClass(indexOfLcv).getLibraryClassName())) {
- isFound = true;
- break;
- }
- }
- if (!isFound) {
- lcid = new LibraryClassIdentification("", null, "", "", null, "", null, "");
- lcid.setLibraryClassName(lc.getName());
- lcid.setSupArchList(Tools.convertListToVector(lc.getSupArchList()));
- lcid.setSupModuleList(Tools.convertListToVector(lc.getSupModuleList()));
- lcid.setHelp(lc.getHelpText());
- lcid.setDeclaredBy(packageId);
-
- lcid.setBelongModule(null);
- lcv.addLibraryClass(lcid);
- }
- }
- }
- }
- Sort.sortLibraryClass(lcv, DataType.SORT_TYPE_ASCENDING);
- return lcv;
- }
-
- /**
- Re-org all guid entries for find table
-
- @return
-
- **/
- public static Vector<FindResultId> getAllLibraryClassForFind(LibraryClassVector lcv) {
- Vector<FindResultId> libraryClass = new Vector<FindResultId>();
- boolean isAdded = false;
- boolean isProduced = false;
-
- //
- // Go through pv to add item as new format to ppi one by one
- //
- for (int indexOfLcv = 0; indexOfLcv < lcv.size(); indexOfLcv++) {
- isAdded = false;
- LibraryClassIdentification lcvId = lcv.getLibraryClass(indexOfLcv);
-
- //
- // First check if produced or not
- //
- if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isProduced = true;
- } else if (lcvId.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED)
- || lcvId.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- isProduced = false;
- }
-
- //
- // Check if the item has been added in
- // If added, append package name and new module name
- // If not added, add a new one first
- //
- for (int indexOfGuid = 0; indexOfGuid < libraryClass.size(); indexOfGuid++) {
- FindResultId frId = libraryClass.get(indexOfGuid);
-
- if (lcvId.getLibraryClassName().equals(frId.getName())) {
- if (isProduced) {
- libraryClass.get(indexOfGuid).addProducedModules(lcvId.getBelongModule());
- } else if (!isProduced) {
- libraryClass.get(indexOfGuid).addConsumedModules(lcvId.getBelongModule());
- }
- isAdded = true;
- continue;
- }
- }
-
- //
- // Add a new one
- //
- if (!isAdded) {
- libraryClass.addElement(new FindResultId(lcvId.getLibraryClassName(), "Library Class",
- lcvId.getSupArchList(), lcvId.getHelp(),
- lcvId.getSupModuleList(), lcvId.getDeclaredBy()));
- }
- }
-
- return libraryClass;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java
deleted file mode 100644
index de6526b10c..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResult.java
+++ /dev/null
@@ -1,651 +0,0 @@
-/** @file
-
- The file is used to show a table with all defined PPIs
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.awt.event.WindowEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingConstants;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableCellRenderer;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
-
-public class FindResult extends IFrame implements TableModelListener, ListSelectionListener, MouseListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -2448484533878401714L;
-
- //
- // Define class members
- //
- private JTable jTable = null;
-
- private JPanel jContentPane = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JButton jButtonClose = null;
-
- //
- // Not used by UI
- //
- private IDefaultTableModel model = null;
-
- private String method = "";
-
- private static FindResult findPpisResult = null;
-
- private static FindResult findProtocolsResult = null;
-
- private static FindResult findGuidsResult = null;
-
- private static FindResult findPcdsResult = null;
-
- private static FindResult findLibraryClassResult = null;
-
- private int selectedRow = -1;
-
- private LibraryClassVector lcv = null;
-
- private Vector<FindResultId> vLibraryClassFindResult = null;
-
- private PcdCodedVector pv = null;
-
- private Vector<PcdFindResultId> vPcdFindResult = null;
-
- private JButton jButtonReload = null;
-
- private JPanel jPanelOperation = null;
-
- /**
- * This is the default constructor
- */
- public FindResult(String method) {
- super();
- init(method);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void init(String method) {
- this.setSize(600, 500);
- this.setContentPane(getJScrollPane());
- this.setTitle("Find Result");
- this.setResizable(true);
- this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
- this.centerWindow();
-
- //
- // max the window
- //
- //this.setExtendedState(JFrame.MAXIMIZED_BOTH);
- this.method = method;
- this.showTable();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJScrollPaneTable(), null);
- jContentPane.add(getJPanelOperation(), null);
- jContentPane.setPreferredSize(new java.awt.Dimension(585, 445));
- }
- return jContentPane;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(0, 0, 585, 395));
- jScrollPaneTable.setPreferredSize(new Dimension(585, 395));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
-
- model.addColumn("Name");
- model.addColumn("Type");
- model.addColumn("Produced by");
- model.addColumn("Consumed by");
- model.addColumn("Declared by");
-
- jTable.getColumn("Name").setCellRenderer(new MyTableCellRenderer());
- jTable.getColumn("Type").setCellRenderer(new MyTableCellRenderer());
- jTable.getColumn("Produced by").setCellRenderer(new MyTableCellRenderer());
- jTable.getColumn("Consumed by").setCellRenderer(new MyTableCellRenderer());
- jTable.getColumn("Declared by").setCellRenderer(new MyTableCellRenderer());
-
- int columnWidth = (this.getSize().width - 28) / 5;
- jTable.getColumn("Name").setPreferredWidth(columnWidth);
- jTable.getColumn("Type").setPreferredWidth(columnWidth);
- jTable.getColumn("Produced by").setPreferredWidth(columnWidth);
- jTable.getColumn("Consumed by").setPreferredWidth(columnWidth);
- jTable.getColumn("Declared by").setPreferredWidth(columnWidth);
- }
- return jTable;
- }
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonClose() {
- if (jButtonClose == null) {
- jButtonClose = new JButton();
- jButtonClose.setText("Close");
- jButtonClose.addActionListener(this);
- jButtonClose.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonClose.setBounds(new java.awt.Rectangle(90, 0, 80, 20));
- }
- return jButtonClose;
- }
-
- public static FindResult getInstance(String method) {
- if (method.equals("PPI")) {
- if (findPpisResult == null) {
- findPpisResult = new FindResult(method);
- }
- findPpisResult.init(method);
- return findPpisResult;
- }
-
- if (method.equals("PROTOCOL")) {
- if (findProtocolsResult == null) {
- findProtocolsResult = new FindResult(method);
- }
- findProtocolsResult.init(method);
- return findProtocolsResult;
- }
-
- if (method.equals("GUID")) {
- if (findGuidsResult == null) {
- findGuidsResult = new FindResult(method);
- }
- findGuidsResult.init(method);
- return findGuidsResult;
- }
-
- if (method.equals("PCD")) {
- if (findPcdsResult == null) {
- findPcdsResult = new FindResult(method);
- }
- findPcdsResult.init(method);
- return findPcdsResult;
- }
-
- if (method.equals("LIBRARY_CLASS")) {
- if (findLibraryClassResult == null) {
- findLibraryClassResult = new FindResult(method);
- }
- findLibraryClassResult.init(method);
- return findLibraryClassResult;
- }
-
- return null;
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
- this.jTable.repaint();
- this.jTable.updateUI();
-
- if (this.method.equals("PPI")) {
- Vector<PpiId> vPpi = Find.getAllPpisForFind();
-
- if (vPpi.size() > 0) {
-
- for (int index = 0; index < vPpi.size(); index++) {
- Vector<String> v = new Vector<String>();
- v.addElement(vPpi.elementAt(index).getName());
- v.addElement(vPpi.elementAt(index).getType());
- String strProducedModules = vPpi.elementAt(index).getProducedModules();
- if (strProducedModules.indexOf("<br>") == 0) {
- strProducedModules = strProducedModules.substring("<br>".length());
- }
- int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
- v.addElement("<html>" + strProducedModules + "</html>");
-
- String strConsumedModules = vPpi.elementAt(index).getConsumedModules();
- if (strConsumedModules.indexOf("<br>") == 0) {
- strConsumedModules = strConsumedModules.substring("<br>".length());
- }
- int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
- v.addElement("<html>" + strConsumedModules + "</html>");
-
- v.addElement(vPpi.elementAt(index).getDeclaredBy());
-
- model.addRow(v);
- jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
- }
- } else {
- Log.wrn("Find PPIs", "No PPI found!!!");
- }
- }
-
- if (this.method.equals("PROTOCOL")) {
- Vector<ProtocolId> vProtocol = Find.getAllProtocolsForFind();
-
- if (vProtocol.size() > 0) {
-
- for (int index = 0; index < vProtocol.size(); index++) {
- Vector<String> v = new Vector<String>();
- v.addElement(vProtocol.elementAt(index).getName());
- v.addElement(vProtocol.elementAt(index).getType());
- String strProducedModules = vProtocol.elementAt(index).getProducedModules();
- if (strProducedModules.indexOf("<br>") == 0) {
- strProducedModules = strProducedModules.substring("<br>".length());
- }
- int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
- v.addElement("<html>" + strProducedModules + "</html>");
-
- String strConsumedModules = vProtocol.elementAt(index).getConsumedModules();
- if (strConsumedModules.indexOf("<br>") == 0) {
- strConsumedModules = strConsumedModules.substring("<br>".length());
- }
- int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
- v.addElement("<html>" + strConsumedModules + "</html>");
-
- v.addElement(vProtocol.elementAt(index).getDeclaredBy());
-
- model.addRow(v);
- jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
- }
- } else {
- Log.wrn("Find PROTOCOLs", "No PROTOCOL found!!!");
- }
- }
-
- if (this.method.equals("GUID")) {
- Vector<GuidId> vGuid = Find.getAllGuidsForFind();
-
- if (vGuid.size() > 0) {
-
- for (int index = 0; index < vGuid.size(); index++) {
- Vector<String> v = new Vector<String>();
- v.addElement(vGuid.elementAt(index).getName());
- v.addElement("GUID");
- String strProducedModules = vGuid.elementAt(index).getProducedModules();
- if (strProducedModules.indexOf("<br>") == 0) {
- strProducedModules = strProducedModules.substring("<br>".length());
- }
- int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
- v.addElement("<html>" + strProducedModules + "</html>");
-
- String strConsumedModules = vGuid.elementAt(index).getConsumedModules();
- if (strConsumedModules.indexOf("<br>") == 0) {
- strConsumedModules = strConsumedModules.substring("<br>".length());
- }
- int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
- v.addElement("<html>" + strConsumedModules + "</html>");
-
- v.addElement(vGuid.elementAt(index).getDeclaredBy());
-
- model.addRow(v);
- jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
- }
- } else {
- Log.wrn("Find GUIDs", "No GUID found!!!");
- }
- }
-
- if (this.method.equals("PCD")) {
- pv = Find.getAllPcdCodedVector();
- vPcdFindResult = Find.getAllPcdCodedForFind(pv);
-
- if (vPcdFindResult.size() > 0) {
-
- for (int index = 0; index < vPcdFindResult.size(); index++) {
- Vector<String> v = new Vector<String>();
- v.addElement(vPcdFindResult.elementAt(index).getName());
- v.addElement(vPcdFindResult.elementAt(index).getType());
-
- //
- // Generate Produced Modules List
- //
- String strProducedModules = "";
- Vector<ModuleIdentification> vModule = vPcdFindResult.elementAt(index).getProducedModules();
- for (int indexOfPM = 0; indexOfPM < vModule.size(); indexOfPM++) {
- strProducedModules = strProducedModules + "<br>"
- + vModule.get(indexOfPM).getPackageId().getName() + "."
- + vModule.get(indexOfPM).getName();
- }
- if (strProducedModules.indexOf("<br>") == 0) {
- strProducedModules = strProducedModules.substring("<br>".length());
- }
- int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
- v.addElement("<html>" + strProducedModules + "</html>");
-
- //
- // Generate Consumed Modules List
- //
- String strConsumedModules = "";
- vModule = vPcdFindResult.elementAt(index).getConsumedModules();
- for (int indexOfCM = 0; indexOfCM < vModule.size(); indexOfCM++) {
- strConsumedModules = strConsumedModules + "<br>"
- + vModule.get(indexOfCM).getPackageId().getName() + "."
- + vModule.get(indexOfCM).getName();
- }
- if (strConsumedModules.indexOf("<br>") == 0) {
- strConsumedModules = strConsumedModules.substring("<br>".length());
- }
- int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
- v.addElement("<html>" + strConsumedModules + "</html>");
-
- //
- // Add declare package name
- //
- v.addElement(vPcdFindResult.elementAt(index).getDeclaredBy().getName());
-
- model.addRow(v);
- jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
- }
- } else {
- Log.wrn("Find PCDs", "No PCD found!!!");
- }
- }
-
- if (this.method.equals("LIBRARY_CLASS")) {
- lcv = Find.getAllLibraryClassVector();
- vLibraryClassFindResult = Find.getAllLibraryClassForFind(lcv);
-
- if (vLibraryClassFindResult.size() > 0) {
- for (int index = 0; index < vLibraryClassFindResult.size(); index++) {
- Vector<String> v = new Vector<String>();
- v.addElement(vLibraryClassFindResult.elementAt(index).getName());
- v.addElement(vLibraryClassFindResult.elementAt(index).getType());
-
- //
- // Generate Produced Modules List
- //
- String strProducedModules = "";
- Vector<ModuleIdentification> vModule = vLibraryClassFindResult.elementAt(index)
- .getProducedModules();
- for (int indexOfPM = 0; indexOfPM < vModule.size(); indexOfPM++) {
- strProducedModules = strProducedModules + "<br>"
- + vModule.get(indexOfPM).getPackageId().getName() + "."
- + vModule.get(indexOfPM).getName();
- }
- if (strProducedModules.indexOf("<br>") == 0) {
- strProducedModules = strProducedModules.substring("<br>".length());
- }
- int line1 = Tools.getSpecificStringCount(strProducedModules, "<br>");
- v.addElement("<html>" + strProducedModules + "</html>");
-
- //
- // Generate Consumed Modules List
- //
- String strConsumedModules = "";
- vModule = vLibraryClassFindResult.elementAt(index).getConsumedModules();
- for (int indexOfCM = 0; indexOfCM < vModule.size(); indexOfCM++) {
- strConsumedModules = strConsumedModules + "<br>"
- + vModule.get(indexOfCM).getPackageId().getName() + "."
- + vModule.get(indexOfCM).getName();
- }
- if (strConsumedModules.indexOf("<br>") == 0) {
- strConsumedModules = strConsumedModules.substring("<br>".length());
- }
- int line2 = Tools.getSpecificStringCount(strConsumedModules, "<br>");
- v.addElement("<html>" + strConsumedModules + "</html>");
-
- v.addElement(vLibraryClassFindResult.elementAt(index).getDeclaredBy().getName());
-
- model.addRow(v);
- jTable.setRowHeight(index, (Math.max(line1, line2) > 1 ? Math.max(line1, line2) : 1) * 18);
- }
- } else {
- Log.wrn("Find Library Classes", "No Library Class found!!!");
- }
- }
-
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == this.jButtonClose) {
- this.dispose();
- }
-
- if (arg0.getSource() == this.jButtonReload) {
- this.showTable();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.centerComponent(this.jPanelOperation, intCurrentWidth, intCurrentHeight, intPreferredHeight,
- DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);
- Tools.resizeTableColumn(this.jTable, this.getSize().width - 28);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- if (this.method.equals("LIBRARY_CLASS")) {
- FindResultDetailInfo frdi = new FindResultDetailInfo(vLibraryClassFindResult.elementAt(selectedRow));
- frdi.setVisible(true);
- }
- if (this.method.equals("PCD")) {
- FindResultDetailInfo frdi = new FindResultDetailInfo(vPcdFindResult.elementAt(selectedRow));
- frdi.setVisible(true);
- }
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to popup warning message to confirm quit
- *
- */
- public void windowClosing(WindowEvent arg0) {
- this.dispose();
- }
-
- class MyTableCellRenderer extends DefaultTableCellRenderer {
- ///
- /// Define Class Serial Version UID
- ///
- private static final long serialVersionUID = -2082787479305255946L;
-
- public void setValue(Object value) {
- this.setVerticalAlignment(SwingConstants.TOP);
- super.setValue(value);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * This method initializes jButtonReload
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonReload() {
- if (jButtonReload == null) {
- jButtonReload = new JButton();
- jButtonReload.setText("Reload");
- jButtonReload.addActionListener(this);
- jButtonReload.setBounds(new java.awt.Rectangle(0, 0, 80, 20));
- jButtonReload.setPreferredSize(new java.awt.Dimension(80, 20));
- }
- return jButtonReload;
- }
-
- /**
- * This method initializes jPanelOperation
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelOperation() {
- if (jPanelOperation == null) {
- jPanelOperation = new JPanel();
- jPanelOperation.setLayout(null);
- jPanelOperation.setBounds(new java.awt.Rectangle(300, 415, 170, 20));
- jPanelOperation.setPreferredSize(new java.awt.Dimension(170, 20));
- jPanelOperation.add(getJButtonClose(), null);
- jPanelOperation.add(getJButtonReload(), null);
- }
- return jPanelOperation;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java
deleted file mode 100644
index 278ac1d964..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultDetailInfo.java
+++ /dev/null
@@ -1,657 +0,0 @@
-/** @file
-
- The file is used to show detailed information of one of find results
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.WindowEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo;
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData;
-import org.tianocore.FrameworkModulesDocument.FrameworkModules;
-import org.tianocore.LibrariesDocument.Libraries;
-import org.tianocore.LibrariesDocument.Libraries.Instance;
-import org.tianocore.LibraryClassDocument.LibraryClass;
-import org.tianocore.ModuleSADocument.ModuleSA;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;
-import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData;
-import org.tianocore.PcdCodedDocument.PcdCoded;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class FindResultDetailInfo extends IFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4888295869041881282L;
-
- private JPanel jContentPane = null;
-
- private JScrollPane jScrollPane = null;
-
- private JTextArea jTextArea = null;
-
- private JButton jButtonClose = null;
-
- //
- // Not for UI
- //
- private static String TAB = " ";
-
- private String reportContent = "";
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(5, 5, 535, 280));
- jScrollPane.setPreferredSize(new java.awt.Dimension(535, 280));
- jScrollPane.setViewportView(getJTextArea());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonClose
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonClose() {
- if (jButtonClose == null) {
- jButtonClose = new JButton();
- jButtonClose.setBounds(new java.awt.Rectangle(240, 290, 80, 20));
- jButtonClose.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonClose.addActionListener(this);
- jButtonClose.setText("Close");
- }
- return jButtonClose;
- }
-
- /**
-
- @param lci
-
- **/
- public FindResultDetailInfo(FindResultId frid) {
- super();
- init();
- this.setTitle(frid.getName());
- this.jTextArea.setText(createReport(frid));
- this.jTextArea.setSelectionStart(0);
- this.jTextArea.setSelectionEnd(0);
- }
-
- /**
-
- @param lci
-
- **/
- public FindResultDetailInfo(PcdFindResultId frid) {
- super();
- init();
- this.setTitle(frid.getName());
- this.jTextArea.setText(createReport(frid));
- this.jTextArea.setSelectionStart(0);
- this.jTextArea.setSelectionEnd(0);
- }
-
- /**
- Create detailed information report for pcd
-
- @param frid
- @return
-
- **/
- private String createReport(PcdFindResultId frid) {
- String name = frid.getName();
-
- //
- // Write Pcd Name
- //
- writeReportLn("PCD C Name: " + name);
-
- //
- // Wrtie Declared package
- //
- writeReportLn("Declared in Package: " + frid.getDeclaredBy().getName() + " ("
- + Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace()) + ")");
-
- //
- // Write Token Space
- //
- writeReportLn("Token Space: " + frid.getTokenSpaceGuidCName());
-
- //
- // Write Token
- //
- writeReportLn("Token: " + frid.getToken());
-
- //
- // Write Datum Type
- //
- writeReportLn("Datum Type: " + frid.getDatumType());
-
- //
- // Write Default Value
- //
- writeReportLn("Default Value: " + frid.getValue());
-
- //
- // Write Usages
- //
- writeReportLn("Valid Usages: " + frid.getUsage());
-
- //
- // Write Help Text
- //
- writeReportLn("Help Text: ");
- writeReportLn(TAB + frid.getHelp());
-
- //
- // Write an Empty Line
- //
- writeReportLn("");
-
- //
- // Wriet all modules which use this PCD:
- //
- writeReportLn("Modules Coded to Use This PCD: ");
-
- Vector<ModuleIdentification> vModules = frid.getConsumedModules();
- if (vModules != null) {
- for (int index = 0; index < vModules.size(); index++) {
- //
- // Write Module Name and Path
- //
- writeReportLn(TAB + vModules.get(index).getName() + " ("
- + Tools.getRelativePath(vModules.get(index).getPath(), Workspace.getCurrentWorkspace())
- + ")");
-
- //
- // Write Module Pcd Info
- //
- ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(vModules.get(index));
- if (msa != null) {
- PcdCoded pcdCoded = msa.getPcdCoded();
- if (pcdCoded != null) {
- for (int indexOfPcd = 0; indexOfPcd < pcdCoded.getPcdEntryList().size(); indexOfPcd++) {
- if (pcdCoded.getPcdEntryList().get(indexOfPcd).getCName().equals(name)) {
- //
- // Write Pcd Item Type
- //
- writeReportLn(TAB + TAB + "PcdItemType: "
- + pcdCoded.getPcdEntryList().get(indexOfPcd).getPcdItemType().toString());
-
- //
- // Write Help Text
- //
- writeReportLn(TAB + TAB + "Help Text: ");
- writeReportLn(TAB + TAB + TAB
- + pcdCoded.getPcdEntryList().get(indexOfPcd).getHelpText());
- }
- }
- }
- }
-
- //
- // Write an Empty Line
- //
- writeReportLn("");
- }
- }
-
- //
- // Write an Empty Line
- //
- writeReportLn("");
-
- //
- // Write All Platforms Specifing this PCD
- //
- writeReportLn("Platforms Specifing this PCD: ");
-
- for (int index = 0; index < GlobalData.openingPlatformList.size(); index++) {
- PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index).getXmlFpd();
- PlatformIdentification pid = GlobalData.openingPlatformList.getOpeningPlatformByIndex(index).getId();
-
- String tmp = "";
- //
- // Get Non-Dynamic Pcd
- //
- FrameworkModules fm = fpd.getFrameworkModules();
- if (fm != null) {
- for (int indexOfModuleSa = 0; indexOfModuleSa < fm.getModuleSAList().size(); indexOfModuleSa++) {
- ModuleSA msa = fm.getModuleSAList().get(indexOfModuleSa);
- if (msa != null) {
- PcdBuildDefinition p = msa.getPcdBuildDefinition();
- if (p != null) {
- if (p.getPcdDataList() != null) {
-
- for (int indexOfPcd = 0; indexOfPcd < p.getPcdDataList().size(); indexOfPcd++) {
- PcdData pd = p.getPcdDataList().get(indexOfPcd);
- //
- // Find this PCD
- //
- if (pd.getCName().equals(name)) {
- //
- // Write Module Sa Info
- //
- ModuleIdentification moduleSaId = GlobalData
- .findModuleId(
- msa.getModuleGuid(),
- msa
- .getModuleVersion(),
- msa.getPackageGuid(),
- msa
- .getPackageVersion());
- tmp = tmp
- + TAB
- + TAB
- + "Module: "
- + moduleSaId.getName()
- + " ("
- + Tools.getRelativePath(moduleSaId.getPath(),
- Workspace.getCurrentWorkspace()) + ")"
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Implementation: " + pd.getItemType().toString()
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Specified / Implementation Value: "
- + pd.getValue() + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + DataType.UNIX_LINE_SEPARATOR;
- }
- }
- }
- }
- }
- }
- }
-
- //
- // Get Dynamic Pcd
- //
- DynamicPcdBuildDefinitions dpbd = fpd.getDynamicPcdBuildDefinitions();
- if (dpbd != null) {
- for (int indexOfDpbd = 0; indexOfDpbd < dpbd.getPcdBuildDataList().size(); indexOfDpbd++) {
- PcdBuildData pbd = dpbd.getPcdBuildDataList().get(indexOfDpbd);
- if (pbd != null) {
- if (pbd.getCName().equals(name)) {
- //
- // Write Dynamic Pcd Build Definition
- //
- tmp = tmp + TAB + TAB + "Dynamic Pcd Build Definition: " + DataType.UNIX_LINE_SEPARATOR;
- if (pbd.getSkuInfoList() != null) {
- for (int indexOfPcd = 0; indexOfPcd < pbd.getSkuInfoList().size(); indexOfPcd++) {
- SkuInfo si = pbd.getSkuInfoList().get(indexOfPcd);
- if (si != null) {
- tmp = tmp + TAB + TAB + TAB + "Sku Id: " + si.getSkuId().toString()
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Variable Name: " + si.getVariableName()
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Variable GUID: " + si.getVariableGuid()
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Variable Offset: " + si.getVariableOffset()
- + DataType.UNIX_LINE_SEPARATOR;
- tmp = tmp + TAB + TAB + TAB + "Hii Default Value: " + si.getHiiDefaultValue()
- + DataType.UNIX_LINE_SEPARATOR;
- }
- }
- }
- }
- }
- }
- }
-
- //
- // If not empty, write this platform info
- //
- if (!Tools.isEmpty(tmp)) {
- tmp = TAB + "Platform: " + pid.getName() + " ("
- + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")"
- + DataType.UNIX_LINE_SEPARATOR + tmp;
- this.writeReportLn(tmp);
- }
- }
-
- return reportContent;
- }
-
- //
- // Create detailed information report for library
- //
- /**
-
- @param frid
- @return
-
- **/
- private String createReport(FindResultId frid) {
- String tmp = "";
- String name = frid.getName();
-
- //
- // Write Class Name
- //
- writeReportLn(name);
-
- //
- // Write Provided Package
- //
- writeReportLn(TAB + "Provided by: " + frid.getDeclaredBy().getName() + " ("
- + Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace()) + ")");
-
- //
- // Write Header File
- //
- PackageSurfaceArea spd = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(frid.getDeclaredBy());
- tmp = Tools.getRelativePath(frid.getDeclaredBy().getPath(), Workspace.getCurrentWorkspace());
- writeReportLn(TAB + "Header File: " + Tools.getFilePathOnly(tmp)
- + wt.getHeaderFileFromPackageByLibraryClassName(spd, name));
-
- //
- // Write Supported Module Types
- //
- writeReportLn(TAB + "Supported Module Types: " + Tools.convertVectorToString(frid.getModuleType()));
-
- //
- // Write Supported Arch
- //
- writeReportLn(TAB + "Supported Architectures: " + Tools.convertVectorToString(frid.getArch()));
-
- //
- // Write Help Text
- //
- writeReportLn(TAB + "Help Text: ");
- writeReportLn(TAB + TAB + frid.getHelp());
-
- //
- // Write an empty line
- //
- writeReportLn("");
-
- //
- // Write Instances
- //
- writeReportLn("Library Instances:");
-
- //
- // Write Instances One by One
- //
- for (int index = 0; index < frid.getProducedModules().size(); index++) {
- ModuleIdentification mid = frid.getProducedModules().get(index);
- ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);
- if (msa != null) {
- //
- // Write Instance Name
- //
- if (msa.getMsaHeader() != null) {
- writeReportLn(TAB + msa.getMsaHeader().getModuleName());
- }
-
- //
- // Write Msa File Name
- //
- writeReportLn(TAB + TAB + "Provided by: "
- + Tools.getRelativePath(mid.getPath(), Workspace.getCurrentWorkspace()));
-
- //
- // Find the produced library class
- //
- if (msa.getLibraryClassDefinitions() != null) {
- for (int indexL = 0; indexL < msa.getLibraryClassDefinitions().getLibraryClassList().size(); indexL++) {
- LibraryClass lc = msa.getLibraryClassDefinitions().getLibraryClassList().get(indexL);
- if (lc.getKeyword().equals(name)) {
- //
- // Write Supported Module Types
- //
- writeReportLn(TAB + TAB + "Supported Module Types: "
- + Tools.convertListToString(lc.getSupModuleList()));
-
- //
- // Write Supported Arch
- //
- writeReportLn(TAB + TAB + "Supported Architectures: "
- + Tools.convertListToString(lc.getSupArchList()));
-
- //
- // Write Help Text
- //
- writeReportLn(TAB + TAB + "Help Text: ");
- writeReportLn(TAB + TAB + (lc.getHelpText() == null ? "" : lc.getHelpText()));
- }
- }
- }
-
- }
- }
-
- //
- // Write an empty line
- //
- writeReportLn("");
-
- //
- // Write all modules which consumed this library
- //
- writeReportLn("Modules Requiring " + name + ":");
- for (int index = 0; index < frid.getConsumedModules().size(); index++) {
- //
- // Write
- //
- writeReportLn(TAB
- + frid.getConsumedModules().get(index).getName()
- + " ("
- + Tools.getRelativePath(frid.getConsumedModules().get(index).getPath(),
- Workspace.getCurrentWorkspace()) + ")");
- }
-
- //
- // Write an empty line
- //
- writeReportLn("");
-
- //
- // Write platforms using the library class instances
- //
- writeReportLn("Platforms Using " + name + ":");
-
- //
- // Write Instances One by One as Using Platforms
- //
- for (int index = 0; index < frid.getProducedModules().size(); index++) {
- ModuleIdentification mid = frid.getProducedModules().get(index);
-
- //
- // Write Instance Name
- //
- writeReportLn(TAB + mid.getName());
-
- //
- // Go through each platform one by one
- //
- for (int indexOfPlatform = 0; indexOfPlatform < GlobalData.openingPlatformList.size(); indexOfPlatform++) {
- PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)
- .getXmlFpd();
- PlatformIdentification pid = GlobalData.openingPlatformList.getOpeningPlatformByIndex(indexOfPlatform)
- .getId();
- Vector<ModuleIdentification> vModuleSa = new Vector<ModuleIdentification>();
- if (fpd != null) {
- FrameworkModules fm = fpd.getFrameworkModules();
- if (fm != null) {
- for (int indexOfModule = 0; indexOfModule < fm.getModuleSAList().size(); indexOfModule++) {
- ModuleSA msa = fm.getModuleSAList().get(indexOfModule);
- if (msa != null) {
- Libraries l = msa.getLibraries();
- if (l != null) {
- if (l.getInstanceList() != null) {
- for (int indexOfInstance = 0; indexOfInstance < l.getInstanceList().size(); indexOfInstance++) {
- Instance i = l.getInstanceList().get(indexOfInstance);
- if (mid.equals(i.getModuleGuid(), i.getModuleVersion(), i.getPackageGuid(),
- i.getPackageVersion())) {
- ModuleIdentification moduleSaId = GlobalData
- .findModuleId(
- msa
- .getModuleGuid(),
- msa
- .getModuleVersion(),
- msa
- .getPackageGuid(),
- msa
- .getPackageVersion());
- if (moduleSaId != null) {
- vModuleSa.addElement(moduleSaId);
- }
- }
- }
- }
- }
- }
- }
-
- //
- // Get finded moduleSa in this spd
- //
- if (vModuleSa.size() > 0) {
- writeReportLn(TAB + TAB + pid.getName() + " ("
- + Tools.getRelativePath(pid.getPath(), Workspace.getCurrentWorkspace()) + ")");
- for (int indexOfModuleSa = 0; indexOfModuleSa < vModuleSa.size(); indexOfModuleSa++) {
- writeReportLn(TAB
- + TAB
- + TAB
- + vModuleSa.elementAt(indexOfModuleSa).getName()
- + " ("
- + Tools.getRelativePath(vModuleSa.elementAt(indexOfModuleSa).getPath(),
- Workspace.getCurrentWorkspace()) + ")");
- }
- }
- }
- }
- }
- writeReportLn("");
- }
-
- return this.reportContent;
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void init() {
- this.setSize(550, 380);
- this.setContentPane(getJContentPane());
- this.setTitle("JFrame");
- this.setResizable(true);
- this.setDefaultCloseOperation(JFrame.HIDE_ON_CLOSE);
- this.centerWindow();
-
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setSize(new java.awt.Dimension(550, 350));
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(getJButtonClose(), null);
-
- jContentPane.setPreferredSize(new java.awt.Dimension(550, 340));
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to popup warning message to confirm quit
- *
- */
- public void windowClosing(WindowEvent arg0) {
- this.dispose();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPane, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.centerComponent(this.jButtonClose, intCurrentWidth, intCurrentHeight, intPreferredHeight,
- DataType.SPACE_TO_BOTTOM_FOR_CLOSE_BUTTON);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == this.jButtonClose) {
- this.dispose();
- }
- }
-
- private void writeReportLn(String line) {
- this.reportContent = this.reportContent + line + DataType.LINE_SEPARATOR;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultId.java
deleted file mode 100644
index 3784fb3839..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/FindResultId.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/** @file
-
- The file is used to define GUID Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class FindResultId {
-
- private String name = "";
-
- private String type = "";
-
- private Vector<String> arch = new Vector<String>();
-
- private Vector<String> moduleType = new Vector<String>();
-
- private String help = "";
-
- private Vector<ModuleIdentification> producedModules = new Vector<ModuleIdentification>();
-
- private Vector<ModuleIdentification> consumedModules = new Vector<ModuleIdentification>();
-
- private PackageIdentification declaredBy = null;
-
- public FindResultId(String strName, String strType, Vector<String> vArch, String strHelp, Vector<String> vModuleType, PackageIdentification pDeclaredBy) {
- this.name = (strName == null ? "" : strName);
- this.type = (strType == null ? "" : strType);
- this.arch = (vArch == null ? this.arch : vArch);
- this.help = (strHelp == null ? "" : strHelp);
- this.moduleType = (vModuleType == null ? this.moduleType : vModuleType);
- this.declaredBy = pDeclaredBy;
- }
-
- public Vector<String> getArch() {
- return arch;
- }
-
- public void setArch(Vector<String> arch) {
- this.arch = arch;
- }
-
- public Vector<ModuleIdentification> getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(Vector<ModuleIdentification> consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public void addConsumedModules(ModuleIdentification consumedModule) {
- if (consumedModule != null) {
- this.consumedModules.addElement(consumedModule);
- }
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<ModuleIdentification> getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(Vector<ModuleIdentification> producedModules) {
- this.producedModules = producedModules;
- }
-
- public void addProducedModules(ModuleIdentification producedModule) {
- if (producedModule != null) {
- this.producedModules.addElement(producedModule);
- }
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public Vector<String> getModuleType() {
- return moduleType;
- }
-
- public void setModuleType(Vector<String> moduleType) {
- this.moduleType = moduleType;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java
deleted file mode 100644
index 2533108e4a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/GuidId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define GUID Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-public class GuidId {
-
- private String name = null;
-
- private String type = null;
-
- private String producedModules = null;
-
- private String consumedModules = null;
-
- private String declaredBy = null;
-
- public GuidId(String arg0, String arg1, String arg2, String arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.producedModules = (arg2 == null ? "" : arg2);
- this.consumedModules = (arg3 == null ? "" : arg3);
- this.declaredBy = (arg4 == null ? "" : arg4);
- }
-
- public String getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(String consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(String producedModules) {
- this.producedModules = producedModules;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(String declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java
deleted file mode 100644
index a31cb38ade..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/LibraryClassId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define Library Class Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-public class LibraryClassId {
-
- private String name = null;
-
- private String type = null;
-
- private String producedModules = null;
-
- private String consumedModules = null;
-
- private String declaredBy = null;
-
- public LibraryClassId(String arg0, String arg1, String arg2, String arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.producedModules = (arg2 == null ? "" : arg2);
- this.consumedModules = (arg3 == null ? "" : arg3);
- this.declaredBy = (arg4 == null ? "" : arg4);
- }
-
- public String getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(String consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(String producedModules) {
- this.producedModules = producedModules;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(String declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdFindResultId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdFindResultId.java
deleted file mode 100644
index 88e46c48cf..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdFindResultId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define Pcd Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class PcdFindResultId extends FindResultId {
-
- private String tokenSpaceGuidCName = null;
-
- private String token = null;
-
- private String datumType = null;
-
- private String value = null;
-
- private String usage = null;
-
- public PcdFindResultId(String strName, String strType, Vector<String> vArch, String strHelp, Vector<String> vModuleType, PackageIdentification pDeclaredBy) {
- super(strName, strType, vArch, strHelp, vModuleType, pDeclaredBy);
- }
-
- public String getDatumType() {
- return datumType;
- }
-
- public void setDatumType(String datumType) {
- this.datumType = datumType;
- }
-
- public String getToken() {
- return token;
- }
-
- public void setToken(String token) {
- this.token = token;
- }
-
- public String getTokenSpaceGuidCName() {
- return tokenSpaceGuidCName;
- }
-
- public void setTokenSpaceGuidCName(String tokenSpaceGuidCName) {
- this.tokenSpaceGuidCName = tokenSpaceGuidCName;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java
deleted file mode 100644
index 4982109068..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PcdId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define GUID Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-public class PcdId {
-
- private String name = null;
-
- private String type = null;
-
- private String producedModules = null;
-
- private String consumedModules = null;
-
- private String declaredBy = null;
-
- public PcdId(String arg0, String arg1, String arg2, String arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.producedModules = (arg2 == null ? "" : arg2);
- this.consumedModules = (arg3 == null ? "" : arg3);
- this.declaredBy = (arg4 == null ? "" : arg4);
- }
-
- public String getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(String consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(String producedModules) {
- this.producedModules = producedModules;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(String declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java
deleted file mode 100644
index d4782c4012..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/PpiId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define PPI Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-public class PpiId {
-
- private String name = null;
-
- private String type = null;
-
- private String producedModules = null;
-
- private String consumedModules = null;
-
- private String declaredBy = null;
-
- public PpiId(String arg0, String arg1, String arg2, String arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.producedModules = (arg2 == null ? "" : arg2);
- this.consumedModules = (arg3 == null ? "" : arg3);
- this.declaredBy = (arg4 == null ? "" : arg4);
- }
-
- public String getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(String consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(String producedModules) {
- this.producedModules = producedModules;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(String declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java
deleted file mode 100644
index 69bcbec984..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/find/ProtocolId.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to define PROTOCOL Identification used by find function
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.find;
-
-public class ProtocolId {
-
- private String name = null;
-
- private String type = null;
-
- private String producedModules = null;
-
- private String consumedModules = null;
-
- private String declaredBy = null;
-
- public ProtocolId(String arg0, String arg1, String arg2, String arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.producedModules = (arg2 == null ? "" : arg2);
- this.consumedModules = (arg3 == null ? "" : arg3);
- this.declaredBy = (arg4 == null ? "" : arg4);
- }
-
- public String getConsumedModules() {
- return consumedModules;
- }
-
- public void setConsumedModules(String consumedModules) {
- this.consumedModules = consumedModules;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public String getProducedModules() {
- return producedModules;
- }
-
- public void setProducedModules(String producedModules) {
- this.producedModules = producedModules;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(String declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
deleted file mode 100644
index d02c121433..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ArchCheckBox.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/** @file
-
- The file is used to provid 6 kinds of arch in one jpanel
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.util.Vector;
-
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class ArchCheckBox extends JPanel {
-
- ///
- /// Define class members
- ///
- private static final long serialVersionUID = 4792669775676953990L;
-
- private JCheckBox jCheckBoxIa32 = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JCheckBox jCheckBoxEbc = null;
-
- private JCheckBox jCheckBoxArm = null;
-
- private JCheckBox jCheckBoxPpc = null;
-
- /**
- * This method initializes jCheckBoxIa32
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIa32() {
- if (jCheckBoxIa32 == null) {
- jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 55, 20));
- jCheckBoxIa32.setText("IA32");
- jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIa32;
- }
-
- /**
- * This method initializes jCheckBoxX64
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20));
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBoxIpf
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20));
- jCheckBoxIpf.setText("IPF");
- jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBoxEbc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEbc() {
- if (jCheckBoxEbc == null) {
- jCheckBoxEbc = new JCheckBox();
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(160, 0, 53, 20));
- jCheckBoxEbc.setText("EBC");
- jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxEbc;
- }
-
- /**
- * This method initializes jCheckBoxArm
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxArm() {
- if (jCheckBoxArm == null) {
- jCheckBoxArm = new JCheckBox();
- jCheckBoxArm.setBounds(new java.awt.Rectangle(213, 0, 54, 20));
- jCheckBoxArm.setText("ARM");
- jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxArm;
- }
-
- /**
- * This method initializes jCheckBoxPpc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPpc() {
- if (jCheckBoxPpc == null) {
- jCheckBoxPpc = new JCheckBox();
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(267, 0, 53, 20));
- jCheckBoxPpc.setText("PPC");
- jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxPpc;
- }
-
- /**
- * This is the default constructor
- */
- public ArchCheckBox() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(320, 20);
- this.setLayout(null);
- this.add(getJCheckBoxIa32(), null);
- this.add(getJCheckBoxX64(), null);
- this.add(getJCheckBoxIpf(), null);
- this.add(getJCheckBoxEbc(), null);
- this.add(getJCheckBoxArm(), null);
- this.add(getJCheckBoxPpc(), null);
- this.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
-
- public Vector<String> getSelectedItemsVector() {
- Vector<String> v = new Vector<String>();
- if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
- v.addElement(jCheckBoxIa32.getText());
- }
- if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
- v.addElement(jCheckBoxX64.getText());
- }
- if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
- v.addElement(jCheckBoxIpf.getText());
- }
- if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
- v.addElement(jCheckBoxEbc.getText());
- }
- if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
- v.addElement(jCheckBoxArm.getText());
- }
- if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
- v.addElement(jCheckBoxPpc.getText());
- }
- return v;
- }
-
- public String getSelectedItemsString() {
- String s = "";
- if (this.jCheckBoxIa32.isSelected() && this.jCheckBoxIa32.isEnabled()) {
- s = s + jCheckBoxIa32.getText() + " ";
- }
- if (this.jCheckBoxX64.isSelected() && this.jCheckBoxX64.isEnabled()) {
- s = s + jCheckBoxX64.getText() + " ";
- }
- if (this.jCheckBoxIpf.isSelected() && this.jCheckBoxIpf.isEnabled()) {
- s = s + jCheckBoxIpf.getText() + " ";
- }
- if (this.jCheckBoxEbc.isSelected() && this.jCheckBoxEbc.isEnabled()) {
- s = s + jCheckBoxEbc.getText() + " ";
- }
- if (this.jCheckBoxArm.isSelected() && this.jCheckBoxArm.isEnabled()) {
- s = s + jCheckBoxArm.getText() + " ";
- }
- if (this.jCheckBoxPpc.isSelected() && this.jCheckBoxPpc.isEnabled()) {
- s = s + jCheckBoxPpc.getText() + " ";
- }
- return s.trim();
- }
-
- public void setAllItemsSelected(boolean isSelected) {
- this.jCheckBoxIa32.setSelected(isSelected);
- this.jCheckBoxX64.setSelected(isSelected);
- this.jCheckBoxIpf.setSelected(isSelected);
- this.jCheckBoxEbc.setSelected(isSelected);
- this.jCheckBoxArm.setSelected(isSelected);
- this.jCheckBoxPpc.setSelected(isSelected);
- }
-
- public void setSelectedItems(Vector<String> v) {
- setAllItemsSelected(false);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setSelected(true);
- continue;
- }
- }
- }
- }
-
- public void setAllItemsEnabled(boolean isEnabled) {
- this.jCheckBoxIa32.setEnabled(isEnabled);
- this.jCheckBoxX64.setEnabled(isEnabled);
- this.jCheckBoxIpf.setEnabled(isEnabled);
- this.jCheckBoxEbc.setEnabled(isEnabled);
- this.jCheckBoxArm.setEnabled(isEnabled);
- this.jCheckBoxPpc.setEnabled(isEnabled);
- }
-
- public void setEnabledItems(Vector<String> v) {
- setAllItemsEnabled(false);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setEnabled(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setEnabled(true);
- continue;
- }
- }
- }
- }
-
- public void setDisabledItems(Vector<String> v) {
- setAllItemsEnabled(true);
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setEnabled(false);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setEnabled(false);
- continue;
- }
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java
deleted file mode 100644
index 836ed7b386..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ExitConfirm.java
+++ /dev/null
@@ -1,263 +0,0 @@
-/** @file
-
- The file is used to popup a exit confirmation window when program exists
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.JButton;
-import javax.swing.JDialog;
-import javax.swing.JFrame;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-/**
- The class is used to popup a exit confirmation window when program exists
- It extends JDialog and implements ActionListener and WindowListener
-
- **/
-public class ExitConfirm extends JDialog implements ActionListener, WindowListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -5875921789385911029L;
-
- private JPanel jContentPane = null;
-
- private JLabel jLabelMessage = null;
-
- private JLabel jLabelResume = null;
-
- private JLabel jLabelExit = null;
-
- private JButton jButtonResume = null;
-
- private JButton jButtonExit = null;
-
- public boolean isCancel = false;
-
- /**
- This method initializes jButtonResume
-
- @return javax.swing.JButton jButtonResume
-
- **/
- private JButton getJButtonResume() {
- if (jButtonResume == null) {
- jButtonResume = new JButton();
- jButtonResume.setText("Resume");
- jButtonResume.setSize(new java.awt.Dimension(90, 20));
- jButtonResume.setLocation(new java.awt.Point(150, 105));
- jButtonResume.setMnemonic('R');
- jButtonResume.addActionListener(this);
- }
- return jButtonResume;
- }
-
- /**
- This method initializes jButtonExit
-
- @return javax.swing.JButton jButtonExit
-
- **/
- private JButton getJButtonExit() {
- if (jButtonExit == null) {
- jButtonExit = new JButton();
- jButtonExit.setText("Exit");
- jButtonExit.setSize(new java.awt.Dimension(90, 20));
- jButtonExit.setLocation(new java.awt.Point(260, 105));
- jButtonExit.setMnemonic('x');
- jButtonExit.addActionListener(this);
- }
- return jButtonExit;
- }
-
- /**
- Main clasee, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ExitConfirm(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This method initializes this
-
- @return void
-
- **/
- private void initialize() {
- this.setSize(500, 170);
- this.setTitle("Exit");
- this.setResizable(false);
- this.setContentPane(getJContentPane());
- this.addWindowListener(this);
- //
- //Set DO_NOTHING_ON_CLOSE when click Close button on title bar
- //
- this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- centerWindow();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelExit = new JLabel();
- jLabelExit.setSize(new java.awt.Dimension(450, 20));
- jLabelExit.setLocation(new java.awt.Point(25, 70));
- jLabelResume = new JLabel();
- jLabelResume.setSize(new java.awt.Dimension(450, 20));
- jLabelResume.setLocation(new java.awt.Point(25, 40));
- jLabelMessage = new JLabel();
- jLabelMessage.setSize(new java.awt.Dimension(450, 20));
- jLabelMessage.setLocation(new java.awt.Point(25, 10));
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(jLabelMessage, null);
- jContentPane.add(jLabelResume, null);
- jContentPane.add(jLabelExit, null);
- jContentPane.add(getJButtonResume(), null);
- jContentPane.add(getJButtonExit(), null);
- }
- return jContentPane;
- }
-
- /**
- Call setWarningMessage to set messages of frame when it is used for Setup
-
- **/
- public void setSetupMessage() {
- String strTitle = "Exit Setup";
- String strMessage = "Setup is not complete. If you quit now, the program will not be installed.";
- String strResume = "You may run the setup program at a later time to complete the installation.";
- String strExit = "To continue installing, click Resume. To quit the Setup program, click Exit.";
- setWarningMessage(strTitle, strMessage, strResume, strExit);
- }
-
- /**
- Call setWarningMessage to set messages of frame when it is used for Module Main GUI
-
- **/
- public void setModuleMessage() {
- String strTitle = "Exit";
- String strMessage = "Do you really want to quit now?";
- String strResume = "All unsaved module information will be lost.";
- String strExit = "To continue editing the module, click Resume. To quit the program, click Exit.";
- setWarningMessage(strTitle, strMessage, strResume, strExit);
- }
-
- /**
- Set message information via input data
-
- @param strTitle The title value
- @param strMessage The main message value
- @param strResume The resume message value
- @param strExit The exit message value
-
- **/
- private void setWarningMessage(String strTitle, String strMessage, String strResume, String strExit) {
- this.setTitle(strTitle);
- jLabelMessage.setText(strMessage);
- jLabelResume.setText(strResume);
- jLabelExit.setText(strExit);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listern all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- //
- //Set isCancel true when click button "Exit"
- //
- Object obj = arg0.getSource();
- if (obj == jButtonResume) {
- isCancel = false;
- }
- if (obj == jButtonExit) {
- isCancel = true;
- }
- this.setVisible(false);
- }
-
- /**
- Make the window in the center of the screen
-
- **/
- private void centerWindow() {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosed(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosing(WindowEvent arg0) {
- isCancel = false;
- this.setVisible(false);
- }
-
- public void windowDeactivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeiconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowIconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowOpened(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java
deleted file mode 100644
index c5a51fd3e6..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IComboBox.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/** @file
-
- The file is used to override JComboBox to provides customized interfaces
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JComboBox;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-
-/**
- The class is used to override JComboBox to provides customized interfaces
- It extends JComboBox implements KeyListener, MouseListener and FocusListener
-
-
-
- **/
-public class IComboBox extends JComboBox implements KeyListener, MouseListener, FocusListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1940262568168458911L;
-
- public void focusGained(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
- *
- * Override focusLost to exit edit mode
- *
- */
- public void focusLost(FocusEvent arg0) {
- this.closeEdit();
- }
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- JFrame jf = new JFrame();
- jf.setSize(500, 200);
- JPanel jp = new JPanel();
- jp.setLayout(null);
- IComboBox icb = new IComboBox();
- jp.add(icb, null);
- jf.setContentPane(jp);
- jf.setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public IComboBox() {
- super();
- init();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(320, 20);
- this.setEditable(false);
- this.editor.addActionListener(this);
- this.addMouseListener(this);
- this.addKeyListener(this);
- this.getEditor().getEditorComponent().addKeyListener(this);
- this.getEditor().getEditorComponent().addFocusListener(this);
- this.setToolTipText("<html>Double Click to add an entry, then finish by press ENTER.<br>"
- + "Selecting DELETE will remove selected entry.</html>");
- }
-
- public void keyPressed(KeyEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- *
- * Override keyReleased to listen key action
- *
- */
- public void keyReleased(KeyEvent arg0) {
- //
- //Add new item to list when press ENTER
- //
- if (arg0.getSource() == this.getEditor().getEditorComponent()) {
- if (arg0.getKeyCode() == KeyEvent.VK_ENTER) {
- String strCurrentText = this.getEditor().getItem().toString().trim();
- if (strCurrentText.length() == 0) {
- if (this.getItemCount() > 0) {
- this.setSelectedIndex(0);
- }
- } else {
- this.addItem(strCurrentText);
- this.setSelectedItem(strCurrentText);
- }
- this.setEditable(false);
- }
-
- if (arg0.getKeyCode() == KeyEvent.VK_ESCAPE) {
- closeEdit();
- }
- }
-
- if (arg0.getSource() == this) {
- //
- //Remove item from the list when press DEL
- //
- if (arg0.getKeyCode() == KeyEvent.VK_DELETE) {
- int intSelected = this.getSelectedIndex();
- if (intSelected > -1) {
- this.removeItemAt(this.getSelectedIndex());
- if (this.getItemCount() > 0) {
- this.setSelectedIndex(0);
- } else {
- this.removeAllItems();
- }
- }
- }
- }
- }
-
- public void keyTyped(KeyEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- * Override mouseClicked to enter edit mode when double click mouse
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- this.setEditable(true);
- this.getEditor().setItem("");
- }
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Exit edit mode
-
- **/
- private void closeEdit() {
- this.setEditable(false);
- this.getEditor().setItem("");
- }
-
- /**
- Set the input item as selected
-
- @param item the item which is needed to be set selected
-
- **/
- public void setSelectedItem(Object item) {
- boolean isFind = false;
- //
- // If the input value is not in the default list, add it to the list
- //
- if (item != null) {
- for (int index = 0; index < this.getItemCount(); index++) {
- if (this.getItemAt(index).equals(item)) {
- isFind = true;
- break;
- }
- }
- //
- // Add this item to IComboBox if not found
- //
- if (!isFind && !item.toString().equals("")) {
- super.addItem(item);
- }
- }
-
- //
- // Call super function to set the item selected.
- //
- super.setSelectedItem(item);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java
deleted file mode 100644
index 4708191ac9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDefaultMutableTreeNode.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/** @file
-
-
- The file is used to override DefaultMutableTreeNode to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.tree.DefaultMutableTreeNode;
-
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-
-/**
- The class is used to override DefaultMutableTreeNode to provides customized interfaces
- It extends DefaultMutableTreeNode
-
-
-
- **/
-public class IDefaultMutableTreeNode extends DefaultMutableTreeNode {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1947340717458069548L;
-
- //
- // Static final definitions for all kinds of node
- //
- public static final int MSA_HEADER = 100;
-
- public static final int MSA_LIBRARYCLASSDEFINITIONS = 101;
-
- public static final int MSA_PACKAGEDEPENDENCIES = 102;
-
- public static final int MSA_SOURCEFILES = 103;
-
- public static final int MSA_PROTOCOLS = 104;
-
- public static final int MSA_EVENTS = 105;
-
- public static final int MSA_HOBS = 106;
-
- public static final int MSA_PPIS = 107;
-
- public static final int MSA_VARIABLES = 108;
-
- public static final int MSA_BOOTMODES = 109;
-
- public static final int MSA_SYSTEMTABLES = 110;
-
- public static final int MSA_DATAHUBS = 111;
-
- public static final int MSA_HIIPACKAGES = 112;
-
- public static final int MSA_GUIDS = 113;
-
- public static final int MSA_EXTERNS = 114;
-
- public static final int MSA_PCDS = 115;
-
- public static final int MSA_BUILDOPTIONS = 117;
-
- public static final int MSA_USEREXTENSIONS = 118;
-
- public static final int MSA_MODULEDEFINITIONS = 119;
-
- public static final int SPD_HEADER = 200;
-
- public static final int SPD_LIBRARYCLASSDECLARATIONS = 201;
-
- public static final int SPD_MSAFILES = 202;
-
- public static final int SPD_PACKAGEHEADERS = 203;
-
- public static final int SPD_GUIDDECLARATIONS = 204;
-
- public static final int SPD_PROTOCOLDECLARATIONS = 205;
-
- public static final int SPD_PPIDECLARATIONS = 206;
-
- public static final int SPD_PCDDECLARATIONS = 207;
-
- public static final int SPD_PACKAGEDEFINITIONS = 208;
-
- public static final int SPD_INDUSTRYSTDINCLUDES = 209;
-
- public static final int FPD_PLATFORMHEADER = 300;
-
- public static final int FPD_FLASH = 301;
-
- public static final int FPD_FRAMEWORKMODULES = 302;
-
- public static final int FPD_PCDDYNAMICBUILDDECLARATIONS = 303;
-
- public static final int FPD_BUILDOPTIONS = 304;
-
- public static final int FPD_PLATFORMDEFINITIONS = 305;
-
- public static final int WORKSPACE = 0;
-
- public static final int MODULE_DESCRIPTION = 1;
-
- public static final int PACKAGE_DESCRIPTION = 2;
-
- public static final int PLATFORM_DESCRIPTION = 3;
-
- public static final int MODULE = 4;
-
- public static final int PACKAGE = 5;
-
- public static final int PLATFORM = 6;
-
- public static final int MODULE_PACKAGE = 7;
-
- public static final int MODULE_PACKAGE_LIBRARY = 8;
-
- public static final int MODULE_PACKAGE_MODULE = 9;
-
- //
- //Static final definitions for operation
- //
- public static final int OPERATION_NULL = 0;
-
- public static final int OPERATION_ADD = 1;
-
- public static final int OPERATION_UPDATE = 2;
-
- public static final int OPERATION_DELETE = 4;
-
- public static final int OPERATION_ADD_UPDATE = 3;
-
- public static final int OPERATION_ADD_DELETE = 5;
-
- public static final int OPERATION_UPDATE_DELETE = 6;
-
- public static final int OPERATION_ADD_UPDATE_DELETE = 7;
-
- //
- //Define 4 node attributes
- //
- private int category = 0;
-
- private String nodeName = "";
-
- private boolean isOpening = false;
-
- private Identification id = null;
-
- private IDefaultMutableTreeNode belongNode = null;
-
- /**
- This is the default constructor
-
- **/
- public IDefaultMutableTreeNode() {
- super();
- }
-
- /**
- This is the overrided constructor
- Init clase members with input data
-
- @param strNodeName The name of node
- @param intCategory The category of node
- @param bolIsOpened to identify if the node is opening or not
- @param identification The Identification of node
-
- **/
- public IDefaultMutableTreeNode(String strNodeName, int intCategory, boolean bolIsOpening,
- Identification identification, IDefaultMutableTreeNode idmtBelongNode) {
- super(strNodeName);
- this.nodeName = strNodeName;
- this.category = intCategory;
- this.isOpening = bolIsOpening;
- this.id = identification;
- this.belongNode = idmtBelongNode;
- }
-
- /**
- Get category of node
-
- @return The category of node
-
- **/
- public int getCategory() {
- return category;
- }
-
- /**
- Set category of node
-
- @param category The input data of node category
-
- **/
- public void setCategory(int category) {
- this.category = category;
- }
-
- /**
- Get name of node
-
- @return The name of node
-
- **/
- public String getNodeName() {
- return nodeName;
- }
-
- /**
- Set name of node
-
- @param nodeName The input data of node name
-
- **/
- public void setNodeName(String nodeName) {
- this.nodeName = nodeName;
- }
-
- /**
- Get identification of node
-
- @return
-
- **/
- public Identification getId() {
- return id;
- }
-
- /**
- Set identification of node
-
- @param id
-
- **/
- public void setId(Identification id) {
- this.id = id;
- }
-
- /**
- get isOpening of node
-
- @return
-
- **/
- public boolean isOpening() {
- return isOpening;
- }
-
- /**
- Set isOpening of node
-
- @param isOpening
-
- **/
- public void setOpening(boolean isOpening) {
- this.isOpening = isOpening;
- }
-
- public String toString() {
- return this.nodeName;
- }
-
- public IDefaultMutableTreeNode getBelongNode() {
- return belongNode;
- }
-
- public void setBelongNode(IDefaultMutableTreeNode belongNode) {
- this.belongNode = belongNode;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java
deleted file mode 100644
index dc668e7ed3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDesktopManager.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to override DefaultDesktopManager to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.DefaultDesktopManager;
-import javax.swing.JComponent;
-
-/**
- The class is used to override DefaultDesktopManager to provides customized interfaces
- It extends DefaultDesktopManager
-
-
-
- **/
-public class IDesktopManager extends DefaultDesktopManager {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4596986878722011062L;
-
- /**
- Main class, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#dragFrame(javax.swing.JComponent, int, int)
- *
- * Override dragFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void dragFrame(JComponent f, int newX, int newY) {
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#endDraggingFrame(javax.swing.JComponent)
- *
- * Override endDraggingFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void endDraggingFrame(JComponent f) {
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.DesktopManager#beginResizingFrame(javax.swing.JComponent, int)
- *
- * Override beginResizingFrame to do nothing to forbid internalframe to be draged
- *
- */
- public void beginResizingFrame(JComponent f, int direction) {
-
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java
deleted file mode 100644
index 1fc7c4c156..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IDialog.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/** @file
-
- The file is used to override Dialog to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.JDialog;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- The class is used to override Dialog to provides customized interfaces
- It extends JDialog implements ActionListener
-
-
-
- **/
-public class IDialog extends JDialog implements ActionListener {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7692623863358631984L;
- //
- //Define class members
- //
- private boolean isEdited = false;
-
- public int returnType = DataType.RETURN_TYPE_CANCEL;
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- IDialog id = new IDialog();
- id.setVisible(true);
- }
-
- /**
- This is the default constructor
- **/
- public IDialog() {
- super();
- initialize();
- }
-
- /**
- This is the override constructor
-
- @param parentFrame The parent frame which open the dialog
- @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog
- **/
- public IDialog(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This is the override constructor
-
- @param parentFrame The parent frame which open the dialog
- @param modal true means the dialog is modal dialog; false means the dialog is not modal dialog
- **/
- public IDialog(IDialog parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
- this.setResizable(false);
- }
-
- /**
- Start the dialog at the center of screen
-
- @param intWidth The width of the dialog
- @param intHeight The height of the dialog
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the dialog at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
- /**
- Get if the dialog has been edited
-
- @retval true - The dialog has been edited
- @retval false - The dialog hasn't been edited
-
- **/
- public boolean isEdited() {
- return isEdited;
- }
-
- /**
- Set if the dialog has been edited
-
- @param isEdited The input data which identify if the dialog has been edited
-
- **/
- public void setEdited(boolean isEdited) {
- this.isEdited = isEdited;
- }
-
- /**
- Check the input data is empty or not
-
- @param strValue The input data which need be checked
-
- @retval true - The input data is empty
- @retval fals - The input data is not empty
-
- **/
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- /**
- Display the dialog
-
- **/
- public int showDialog() {
- this.setVisible(true);
- return returnType;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java
deleted file mode 100644
index 5f3341f696..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IFrame.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/** @file
-
- The file is used to override Frame to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- The class is used to override Frame to provides customized interfaces
- It extends JFrame implements ActionListener and WindowListener
-
- **/
-public class IFrame extends JFrame implements ActionListener, WindowListener, ComponentListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3324138961029300427L;
-
- //
- //Define class members
- //
- private ExitConfirm ec = null;
-
- //
- // To indicate the status while quit
- // 0 - When setup (Default)
- // 1 - Whne editing module
- //
- private int intExitType = 0;
-
- /**
- Main class, used for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- IFrame i = new IFrame();
- i.setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public IFrame() {
- super();
- initialize();
- }
-
- /**
- This method initializes this
-
- **/
- public void initialize() {
- this.setResizable(false);
- this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
- this.addWindowListener(this);
- this.addComponentListener(this);
- }
-
- /**
- Start the dialog at the center of screen
-
- @param intWidth The width of the dialog
- @param intHeight The height of the dialog
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window full of the screen
-
- **/
- protected void maxWindow() {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation(0, 0);
- this.setSize(d);
- }
-
- /**
- Start the dialog at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
- /**
- Set the exit window type
-
- @param ExitType The input data of ExitType
-
- **/
- protected void setExitType(int ExitType) {
- this.intExitType = ExitType;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.WindowListener#windowClosing(java.awt.event.WindowEvent)
- *
- * Override windowClosing to call this.onDisvisible()
- *
- */
- public void windowClosing(WindowEvent arg0) {
- //this.onDisvisible();
- }
-
- public void windowOpened(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowClosed(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowIconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeiconified(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void windowDeactivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Define the actions when exit
-
- **/
- public void onExit() {
- ec = new ExitConfirm(this, true);
- //
- //Show different warning message via different ExitType
- //
- switch (intExitType) {
- case 0:
- ec.setSetupMessage();
- break;
- case 1:
- ec.setModuleMessage();
- break;
- }
- ec.setVisible(true);
- if (ec.isCancel) {
- this.dispose();
- System.exit(0);
- }
- }
-
- /**
- Define the actions when disvisible
-
- **/
- public void onDisvisible() {
- ec = new ExitConfirm(this, true);
- //
- //Show different warning message via different ExitType
- //
- switch (intExitType) {
- case 0:
- ec.setSetupMessage();
- break;
- case 1:
- ec.setModuleMessage();
- break;
- }
- ec.setVisible(true);
- if (ec.isCancel) {
- this.dispose();
- }
- }
-
- public int showSaveDialog() {
- return JOptionPane.showConfirmDialog(this, "Save all changed files?", "Save", JOptionPane.YES_NO_CANCEL_OPTION,
- JOptionPane.WARNING_MESSAGE);
- }
-
- /**
- Check the input data is empty or not
-
- @param strValue The input data which need be checked
-
- @retval true - The input data is empty
- @retval fals - The input data is not empty
-
- **/
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- /**
- Display the dialog
-
- **/
- public void showDialog() {
- this.setVisible(true);
- }
-
- public void componentResized(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentMoved(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentShown(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentHidden(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java
deleted file mode 100644
index f0d018605d..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/IInternalFrame.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/** @file
-
- The file is used to override JInternalFrame to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ComponentListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JDesktopPane;
-import javax.swing.JFrame;
-import javax.swing.JInternalFrame;
-import javax.swing.JPanel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-
-import org.tianocore.frameworkwizard.common.Tools;
-
-/**
- * The class is used to override JInternalFrame to provides customized
- * interfaces It extends JInternalFrame implements ActionListener
- *
- *
- *
- */
-public class IInternalFrame extends JInternalFrame implements ActionListener, ComponentListener, ItemListener,
- FocusListener, ListSelectionListener, TableModelListener, MouseListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -609841772384875886L;
-
- //
- // Define class members
- //
- private boolean isEdited = false;
-
- /**
- * Main class, used for test
- *
- * @param args
- *
- */
- public static void main(String[] args) {
- JFrame jf = new JFrame();
- JPanel jp = new JPanel();
- JDesktopPane jdp = new JDesktopPane();
- IInternalFrame itf = new IInternalFrame();
- jdp.add(itf, 1);
- jf.setContentPane(jp);
- jf.setVisible(true);
- }
-
- /**
- * This is the default constructor
- *
- */
- public IInternalFrame() {
- super();
- initialize();
- }
-
- /**
- * This method initializes this
- *
- */
- private void initialize() {
- this.setBounds(new java.awt.Rectangle(0, 0, 520, 545));
- this.setMinimumSize(new java.awt.Dimension(520, 545));
- this.addComponentListener(this);
- }
-
- /**
- * Get if the InternalFrame has been edited
- *
- * @retval true - The InternalFrame has been edited
- * @retval false - The InternalFrame hasn't been edited
- *
- */
- public boolean isEdited() {
- return isEdited;
- }
-
- /**
- * Set if the InternalFrame has been edited
- *
- * @param isEdited
- * The input data which identify if the InternalFrame has been
- * edited
- *
- */
- public void setEdited(boolean isEdited) {
- this.isEdited = isEdited;
- }
-
- /**
- * Check the input data is empty or not
- *
- * @param strValue
- * The input data which need be checked
- *
- * @retval true - The input data is empty
- * @retval fals - The input data is not empty
- *
- */
- public boolean isEmpty(String strValue) {
- return Tools.isEmpty(strValue);
- }
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void componentHidden(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentMoved(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void componentResized(ComponentEvent arg0) {
- // TODO Auto-generated method stub
- }
-
- public void componentShown(ComponentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void showStandard() {
-
- }
-
- public void showAdvanced() {
-
- }
-
- public void showXML() {
-
- }
-
- public void itemStateChanged(ItemEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void focusGained(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void focusLost(FocusEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void valueChanged(ListSelectionEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseClicked(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java
deleted file mode 100644
index 252c34ff72..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/ITree.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/** @file
-
- The file is used to override JTree to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.JTree;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreeNode;
-import javax.swing.tree.TreePath;
-
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-
-/**
- The class is used to override JTree to provides customized interfaces
- It extends JTree
-
- **/
-public class ITree extends JTree {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7907086164518295327L;
-
- //
- // Define class members
- //
- DefaultTreeModel treeModel = null;
-
- /**
- This is the default constructor
-
- **/
- public ITree() {
- super();
- }
-
- /**
- This is the overrided constructor
- Init class members with input data
-
- @param iDmtRoot The root node of the tree
-
- **/
- public ITree(IDefaultMutableTreeNode iDmtRoot) {
- super(iDmtRoot);
- treeModel = (DefaultTreeModel) this.getModel();
- }
-
- /**
- Get category of selected node
-
- @return The category of selected node
-
- **/
- public int getSelectCategory() {
- int intCategory = 0;
- TreePath path = this.getSelectionPath();
- IDefaultMutableTreeNode node = (IDefaultMutableTreeNode) path.getLastPathComponent();
- intCategory = node.getCategory();
- return intCategory;
- }
-
- /**
- Add input node as child node for current selected node
-
- @param strNewNode The name of the node which need be added
-
- **/
- public void addNode(String strNewNode) {
- DefaultMutableTreeNode parentNode = null;
- DefaultMutableTreeNode newNode = new DefaultMutableTreeNode(strNewNode);
- newNode.setAllowsChildren(true);
- TreePath parentPath = this.getSelectionPath();
-
- /**
- * Get parent node of new node
- */
- parentNode = (DefaultMutableTreeNode) (parentPath.getLastPathComponent());
-
- /**
- * Insert new node
- */
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Add input node as child node for current selected node
-
- @param newNode The node need be added
-
- **/
- public void addNode(IDefaultMutableTreeNode newNode) {
- IDefaultMutableTreeNode parentNode = null;
- newNode.setAllowsChildren(true);
- TreePath parentPath = this.getSelectionPath();
- parentNode = (IDefaultMutableTreeNode) (parentPath.getLastPathComponent());
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Add input node as child node for current selected node
-
- @param newNode The node need be added
-
- **/
- public void addNode(IDefaultMutableTreeNode parentNode, IDefaultMutableTreeNode newNode) {
- treeModel.insertNodeInto(newNode, parentNode, parentNode.getChildCount());
- this.scrollPathToVisible(new TreePath(newNode.getPath()));
- }
-
- /**
- Remove the selected node
-
- @param strRemovedNode
-
- **/
- public void removeSelectedNode() {
- TreePath treePath = this.getSelectionPath();
- removeNodeByPath(treePath);
- }
-
- /**
- Remove the node by tree path
-
- @param strRemovedNode
-
- **/
- public void removeNodeByPath(TreePath treePath) {
- if (treePath != null) {
- DefaultMutableTreeNode selectionNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
- TreeNode parent = (TreeNode) selectionNode.getParent();
- if (parent != null) {
- treeModel.removeNodeFromParent(selectionNode);
- }
- }
- }
-
- /**
- Return a node by input tree path
-
- @param treePath
- @return
-
- **/
- public IDefaultMutableTreeNode getNodeByPath(TreePath treePath) {
- if (treePath != null) {
- IDefaultMutableTreeNode selectionNode = (IDefaultMutableTreeNode) treePath.getLastPathComponent();
- return selectionNode;
- }
- return null;
- }
-
- /**
- Remove all child nodes under current node
-
- **/
- public void removeNodeChildrenByPath(TreePath treePath) {
- if (treePath != null) {
- DefaultMutableTreeNode currentNode = (DefaultMutableTreeNode) treePath.getLastPathComponent();
- for (int index = currentNode.getChildCount() - 1; index > -1; index--) {
- treeModel.removeNodeFromParent((DefaultMutableTreeNode) currentNode.getChildAt(index));
- }
- }
- }
-
- /**
- Remove all nodes of the tree
-
- **/
- public void removeAllNode() {
- DefaultMutableTreeNode rootNode = (DefaultMutableTreeNode) treeModel.getRoot();
- rootNode.removeAllChildren();
- treeModel.reload();
- }
-
- public IDefaultMutableTreeNode getSelectNode() {
- TreePath treepath = this.getSelectionPath();
- IDefaultMutableTreeNode selectionNode = null;
- if (treepath != null) {
- selectionNode = (IDefaultMutableTreeNode) treepath.getLastPathComponent();
- }
- return selectionNode;
- }
-
- public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id) {
- for (int index = 0; index < node.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
- if (iNode.getId().equals(id)) {
- return iNode;
- }
- }
- return null;
- }
-
- public IDefaultMutableTreeNode getNodeById(IDefaultMutableTreeNode node, Identification id, int category) {
- for (int index = 0; index < node.getChildCount(); index++) {
- IDefaultMutableTreeNode iNode = (IDefaultMutableTreeNode) node.getChildAt(index);
- if (iNode.getId().equals(id) && iNode.getCategory() == category) {
- return iNode;
- }
- IDefaultMutableTreeNode childNode = getNodeById(iNode, id, category);
- if (childNode != null) {
- return childNode;
- }
- }
- return null;
- }
-
- public TreePath getPathOfNode(IDefaultMutableTreeNode node) {
- if (node != null) {
- TreePath treePath = new TreePath(treeModel.getPathToRoot(node));
- return treePath;
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java
deleted file mode 100644
index 3641df0373..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/StarLabel.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
-
- The file is used to override JLabel to provides customized interfaces
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.common.ui;
-
-import javax.swing.JLabel;
-
-/**
- The class is used to override JLabel to provides customized interfaces
-
-
-
- **/
-public class StarLabel extends JLabel {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6702981027831543919L;
-
- /**
- Main class, reserved for test
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- This is the default constructor
-
- **/
- public StarLabel() {
- super();
- init();
- }
-
- /**
- To create a RED, BOLD and 14 size "*"
-
- **/
- private void init() {
- this.setText("*");
- this.setSize(new java.awt.Dimension(10, 20));
- this.setForeground(java.awt.Color.red);
- this.setFont(new java.awt.Font("DialogInput", java.awt.Font.BOLD, 14));
- this.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
deleted file mode 100644
index 6fbdf03ddd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxList.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/** @file
-
- The file is used to override JList to create a List with CheckBox item
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.util.Vector;
-
-import javax.swing.JList;
-
-public class ICheckBoxList extends JList {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -2843059688070447632L;
-
- protected ICheckBoxListCellRenderer cellrenderer = new ICheckBoxListCellRenderer();
-
- protected ICheckBoxListener listener = new ICheckBoxListener(this);
-
- protected ICheckBoxListModel model = new ICheckBoxListModel();
-
- /**
- This the default Constructor
-
- **/
- public ICheckBoxList() {
- this(null);
- }
-
- /**
- This the override constructor to create checkbox item with input vector
-
- @param options
-
- **/
- public ICheckBoxList(Vector<ICheckBoxListItem> items) {
- if (items != null) {
- for (int index = 0; index < items.size(); index++) {
- model.addElement(items.elementAt(index));
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
- this.setCellRenderer(cellrenderer);
- this.setModel(model);
- this.addMouseListener(listener);
- this.addKeyListener(listener);
- }
-
- /**
- Set all items of the CheckBoxList component.
-
- @param items
-
- **/
- public void setAllItems(Vector<String> items) {
- if (items != null) {
- model.removeAllElements();
- for (int index = 0; index < items.size(); index++) {
- model.addElement(new ICheckBoxListItem(items.elementAt(index)));
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
- }
-
- /**
- Get All Checked Items of the CheckBoxList component.
-
- @return All Checked Items
- **/
- public Vector<ICheckBoxListItem> getAllCheckedItems() {
- Vector<ICheckBoxListItem> result = new Vector<ICheckBoxListItem>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement((ICheckBoxListItem) this.getModel().getElementAt(i));
- }
- }
- return result;
- }
-
- /**
- Get All Checked Items index of the CheckBoxList component.
-
- @return All Checked Items index
- **/
- public Vector<Integer> getAllCheckedItemsIndex() {
- Vector<Integer> result = new Vector<Integer>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement(i);
- }
- }
- return result;
- }
-
- /**
- Get All Checked Items String of the CheckBoxList component.
-
- @return Vector
- **/
- public Vector<String> getAllCheckedItemsString() {
- Vector<String> result = new Vector<String>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- if (((ICheckBoxListItem) this.getModel().getElementAt(i)).isChecked()) {
- result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
- }
- }
- return result;
- }
-
- /**
- Get All Items String of the CheckBoxList component.
-
- @return Vector
- **/
- public Vector<String> getAllItemsString() {
- Vector<String> result = new Vector<String>();
-
- for (int i = 0; i < this.getModel().getSize(); i++) {
- result.addElement(((ICheckBoxListItem) this.getModel().getElementAt(i)).text);
- }
- return result;
- }
-
- /**
- Set Checked status for all input items.
-
- **/
- public void initCheckedItem(boolean bool, Vector<String> items) {
- if (items != null && items.size() != 0) {
- for (int indexI = 0; indexI < items.size(); indexI++) {
- for (int indexJ = 0; indexJ < model.size(); indexJ++) {
- if (items.elementAt(indexI).equals(model.getAllElements().elementAt(indexJ).getText())) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(indexJ);
- listItem.setChecked(bool);
- break;
- }
- }
- }
- }
-
- //
- // If there exists at least one item, set first item selected.
- //
- if (model.size() > 0) {
- ICheckBoxListItem listItem = (ICheckBoxListItem) model.get(0);
- listItem.setSelected(true);
- }
-
- this.validate();
- }
-
- /**
- Set all items of the compontent checked
-
- **/
- public void setAllItemsChecked() {
- initCheckedItem(true, this.getAllItemsString());
- }
-
- /**
- Set all items of the compontent unchecked
-
- **/
- public void setAllItemsUnchecked() {
- initCheckedItem(false, this.getAllItemsString());
- }
-
- /**
- Remove all items of list
-
- **/
- public void removeAllItem() {
- model.removeAllElements();
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java
deleted file mode 100644
index 1b022fc908..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListCellRenderer.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/** @file
-
- The file is used to create cell renderer for CheckBoxList Item
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.awt.*;
-import javax.swing.*;
-import javax.swing.border.*;
-
-class ICheckBoxListCellRenderer extends JCheckBox implements ListCellRenderer {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1718072217181674870L;
-
- protected static Border noFocusBorder = new EmptyBorder(1, 1, 1, 1);
-
- /**
- This is the default Constructor
-
- **/
- public ICheckBoxListCellRenderer() {
- super();
- setOpaque(true);
- setBorder(noFocusBorder);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.ListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
- * Override to get attribute of the ICheckListCellRenderer
- *
- */
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected,
- boolean cellHasFocus) {
- ICheckBoxListItem item = (ICheckBoxListItem) value;
-
- setComponentOrientation(list.getComponentOrientation());
-
- if (item.isChecked()) {
- setBackground(list.getSelectionBackground());
- setForeground(list.getSelectionForeground());
- } else {
- if (isSelected) {
- setBackground(Color.LIGHT_GRAY);
- setForeground(list.getForeground());
- } else {
- setBackground(list.getBackground());
- setForeground(list.getForeground());
- }
- }
-
- if (value instanceof ICheckBoxListItem) {
- setText(item.getText());
- setSelected(item.isChecked());
- } else {
- setIcon(null);
- setText((value == null) ? "" : value.toString());
- }
-
- setEnabled(list.isEnabled());
- setFont(list.getFont());
-
- return this;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java
deleted file mode 100644
index a087887e2f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListItem.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/** @file
-
- The file is used to create list item for CheckBox list
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-public class ICheckBoxListItem {
-
- //
- // Define Class Members
- //
- protected String text;
-
- protected boolean checked;
-
- protected boolean selected;
-
- /**
- This is the default constructor to set check box item string
-
- @param text
-
- **/
- public ICheckBoxListItem(String text) {
- this.text = text;
- }
-
- /**
- This is the override constructor to set check box item string and checked status
-
- @param text
- @param checked
-
- **/
- public ICheckBoxListItem(String text, boolean checked) {
- this.text = text;
- this.checked = checked;
- }
-
- /**
- set the checked status
- if true, set false
- if false, set true
-
- **/
- public void invertChecked() {
- checked = !checked;
- }
-
- public boolean isChecked() {
- return checked;
- }
-
- public void setChecked(boolean checked) {
- this.checked = checked;
- }
-
- public String getText() {
- return text;
- }
-
- public void setText(String text) {
- this.text = text;
- }
-
- public boolean isSelected() {
- return selected;
- }
-
- public void setSelected(boolean selected) {
- this.selected = selected;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java
deleted file mode 100644
index f3bbe8a3a0..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListModel.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/** @file
-
- The file is used to override DefaultListModel to create ICheckBoxListModel
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import javax.swing.*;
-import java.util.Vector;
-
-public class ICheckBoxListModel extends DefaultListModel {
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8617800969723991017L;
-
- /**
- This is the default Constructor for the CheckBoxListModel object
-
- **/
- public ICheckBoxListModel() {
- }
-
- /**
- override DefaultListModel's add method
-
- @param index
- @param item
-
- **/
- public void add(int index, ICheckBoxListItem item) {
- super.add(index, item);
- }
-
- /**
- Add one item at tail
-
- @param item
-
- **/
- public void addElement(ICheckBoxListItem item) {
- super.addElement(item);
- }
-
- /**
- Get all elements of the list
-
- **/
- public Vector<ICheckBoxListItem> getAllElements() {
- Vector<ICheckBoxListItem> items = new Vector<ICheckBoxListItem>();
- ICheckBoxListItem[] objs = new ICheckBoxListItem[this.size()];
- this.copyInto(objs);
- for (int i = 0; i < size(); i++) {
- items.addElement(objs[i]);
- }
- return items;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java
deleted file mode 100644
index e95d279e59..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/common/ui/iCheckBoxList/ICheckBoxListener.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/** @file
-
- The file is used to create listener for Checkbox List
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.common.ui.iCheckBoxList;
-
-import java.awt.event.*;
-
-class ICheckBoxListener implements MouseListener, KeyListener {
-
- protected ICheckBoxList iCheckboxlist;
-
- /**
- This is the default constructor
-
- @param parent
-
- **/
- public ICheckBoxListener(ICheckBoxList parent) {
- iCheckboxlist = parent;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
- * Override to deal with keyReleased event
- *
- *
- */
- public void keyReleased(KeyEvent e) {
- Object[] selectedValues = iCheckboxlist.getSelectedValues();
- int[] selectedIndices = iCheckboxlist.getSelectedIndices();
-
- for (int index = 0; index < selectedValues.length; index++) {
- ICheckBoxListItem item = (ICheckBoxListItem) selectedValues[index];
-
- if (iCheckboxlist.isEnabled()) {
- if (e.getKeyCode() == KeyEvent.VK_SPACE) {
- //
- //if press space key, then reverse all selected item.
- //
- item.invertChecked();
- }
- ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, selectedIndices[index]);
- }
- }
- }
-
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- * Override to deal with mouse clicked event
- *
- */
- public void mouseClicked(MouseEvent e) {
- int index = iCheckboxlist.locationToIndex(e.getPoint());
- ICheckBoxListItem item = null;
- item = (ICheckBoxListItem) iCheckboxlist.getModel().getElementAt(index);
-
- if (item != null && iCheckboxlist.isEnabled()) {
- item.invertChecked();
- ((ICheckBoxListModel) iCheckboxlist.getModel()).setElementAt(item, index);
- }
- }
-
- public void mousePressed(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyPressed(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- public void keyTyped(KeyEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/AggregationOperation.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/AggregationOperation.java
deleted file mode 100644
index b8a6d40b0e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/AggregationOperation.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class AggregationOperation {
-
- public static synchronized List<PackageIdentification> union(List<PackageIdentification> list1,
- List<PackageIdentification> list2) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- result.addAll(list1);
- Iterator<PackageIdentification> iter = list2.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (!belongs(item, result)) {
- result.add(item);
- }
- }
- return result;
- }
-
- public static synchronized List<PackageIdentification> intersection(List<PackageIdentification> list1,
- List<PackageIdentification> list2) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- Iterator<PackageIdentification> iter = list1.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (belongs(item, list2)) {
- result.add(item);
- }
- }
- return result;
- }
-
- public static synchronized List<PackageIdentification> minus(List<PackageIdentification> list1,
- List<PackageIdentification> list2) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- Iterator<PackageIdentification> iter = list1.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (!belongs(item, list2)) {
- result.add(item);
- }
- }
- return result;
- }
-
- public static synchronized boolean belongs(PackageIdentification o, List<PackageIdentification> list) {
- Iterator<PackageIdentification> iter = list.iterator();
- while (iter.hasNext()) {
- if (iter.next().equalsWithGuid(o)) {
- return true;
- }
- }
- return false;
- }
-
- public static synchronized List<PackageIdentification> getExistedItems(PackageIdentification o,
- List<PackageIdentification> list) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- Iterator<PackageIdentification> iter = list.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (item.equalsWithGuid(o)) {
- result.add(item);
- }
- }
- return result;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/DistributeRule.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/DistributeRule.java
deleted file mode 100644
index 730e385c74..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/DistributeRule.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to distribute Far
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class DistributeRule {
- static PackageQuery pkgQ = new PackageQuery();
-
- static WorkspaceTools wsTools = new WorkspaceTools();
-
- static List<PackageIdentification> farPkgList = new ArrayList<PackageIdentification>();
-
- public static List<PackageIdentification> installFarCheck(Far far) {
-
- Far myFar = far;
- List<PackageIdentification> pkgDepList = new ArrayList<PackageIdentification>();
- List<PackageIdentification> dbPkgList = new ArrayList<PackageIdentification>();
- List<PackageIdentification> depResultList = new ArrayList<PackageIdentification>();
- //
- // Get Far packages list;
- //
- try {
- farPkgList = myFar.manifest.getPackageList();
- Iterator pkgItems = farPkgList.iterator();
- while (pkgItems.hasNext()) {
- PackageIdentification id = (PackageIdentification) pkgItems.next();
- pkgDepList = myFar.getPackageDependencies(id);
- depResultList = AggregationOperation.union(depResultList, pkgDepList);
- }
- dbPkgList = vectorToList(wsTools.getAllPackages());
-
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
-
- //
- // Check does the dependence meet the requirement.
- //
- List<PackageIdentification> resultList = AggregationOperation.minus(depResultList,
- AggregationOperation.union(farPkgList,
- dbPkgList));
-
- return resultList;
-
- }
-
- // public void installPackgCheck (PackageIdentification pkgId, String pkgPath){
- // List<PackageIdentification> dbPkgList = new ArrayList<PackageIdentification>();
- // dbPkgList = vectorToList(wsTools.getAllPackages());
- // //
- // // Install far's package one by one.
- // //
- // if ((AggregationOperation.getExistItems(pkgId, dbPkgList))){
- //
- // }
- // }
-
- public void UpdatCheck(String orgFar, String destFar) {
-
- }
-
- public static List<PackageIdentification> vectorToList(Vector vec) {
- List<PackageIdentification> set = new ArrayList<PackageIdentification>();
- Iterator vecItem = vec.iterator();
- while (vecItem.hasNext()) {
- set.add((PackageIdentification) vecItem.next());
- }
- return set;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Far.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Far.java
deleted file mode 100644
index ad04dc7fcd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Far.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/** @file
-
- The file is used to create far file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.jar.JarEntry;
-import java.util.jar.JarFile;
-import java.util.jar.JarOutputStream;
-
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class Far {
- //
- // Class member Manifest
- //
- public Manifest manifest = null;
-
- //
- // Jar file
- //
- private JarFile jf = null;
-
- private File jarFile = null;
-
- //
- // Jar outputStream.
- //
- static public JarOutputStream jos = null;
-
- public Far(File jarFile) {
- this.jarFile = jarFile;
- }
-
- //
- // For install/updat jar
- //
- public Far(JarFile farFile) throws Exception {
- jf = farFile;
- this.manifest = new Manifest(getManifestFile());
- }
-
- public void creatFar(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,
- Set<String> fileFilter, FarHeader fHeader) throws Exception {
- jos = new JarOutputStream(new FileOutputStream(jarFile));
-
- //
- // Generate Manifest and get file lists
- //
- this.manifest = new Manifest();
- this.manifest.setFarHeader(fHeader);
- this.manifest.createManifest(pkgList, plfList, fileFilter);
-
- this.manifest.hibernateToFile();
-
- //
- // Write Mainifest file to JAR.
- //
- if (this.manifest.mfFile != null) {
- writeToJar(this.manifest.mfFile, jos);
- }
-
- //
- // Write all files to JAR
- //
- Set<File> files = this.manifest.files;
- Iterator<File> iter = files.iterator();
- while (iter.hasNext()) {
- writeToJar(iter.next(), jos);
- }
- jos.close();
- }
-
- private void writeToJar(File file, JarOutputStream jos) throws Exception {
- byte[] buffer = new byte[(int) file.length()];
- FileInputStream fInput = new FileInputStream(file);
- JarEntry entry = new JarEntry(
- Tools
- .convertPathToUnixType(Tools
- .getRelativePath(file.getPath(),
- Workspace.getCurrentWorkspace())));
- jos.putNextEntry(entry);
- fInput.read(buffer);
- jos.write(buffer);
- fInput.close();
- }
-
- public void InstallFar(String dir) throws Exception {
- List<FarFileItem> allFile = manifest.getAllFileItem();
- extract(allFile, dir);
- }
-
- public void InstallFar(Map<PlatformIdentification, File> plfMap, Map<PackageIdentification, File> pkgMap)
- throws Exception {
- Set<PlatformIdentification> plfKeys = plfMap.keySet();
- Iterator<PlatformIdentification> plfIter = plfKeys.iterator();
- while (plfIter.hasNext()) {
- PlatformIdentification item = plfIter.next();
- extract(this.manifest.getPlatformContents(item), plfMap.get(item).getPath());
- }
-
- Set<PackageIdentification> pkgKeys = pkgMap.keySet();
- Iterator<PackageIdentification> pkgIter = pkgKeys.iterator();
- while (pkgIter.hasNext()) {
- PackageIdentification item = pkgIter.next();
- installPackage(item, pkgMap.get(item));
- }
- jf.close();
- }
-
- public void installPackage(PackageIdentification packageId, File installPath) throws Exception {
- List<FarFileItem> contents = this.manifest.getPackageContents(packageId);
- extract(contents, installPath.getPath());
- }
-
- public InputStream getManifestFile() throws Exception {
- JarEntry je = null;
- for (Enumeration e = jf.entries(); e.hasMoreElements();) {
- je = (JarEntry) e.nextElement();
- if (je.getName().equalsIgnoreCase(Manifest.mfFileName))
- return jf.getInputStream(je);
- }
- return null;
- }
-
- public void createFar() {
-
- }
-
- public boolean hibernateToFile() {
- return true;
- }
-
- public void extract(List<FarFileItem> allFile, String dir) throws Exception {
-
- Iterator filesItem = allFile.iterator();
- FarFileItem ffItem;
- JarEntry je;
- new File(dir).mkdirs();
- dir += File.separatorChar;
- while (filesItem.hasNext()) {
- try {
- ffItem = (FarFileItem) filesItem.next();
- je = jf.getJarEntry(Tools.convertPathToUnixType(ffItem.getDefaultPath()));
- InputStream entryStream = jf.getInputStream(je);
- File file = new File(dir + ffItem.getRelativeFilename());
- file.getParentFile().mkdirs();
- try {
- //
- // Create the output file (clobbering the file if it
- // exists).
- //
- FileOutputStream outputStream = new FileOutputStream(file);
-
- try {
- //
- // Read the entry data and write it to the output
- // file.
- //
- int fileLen = (int)je.getSize();
- byte[] buffer = new byte[fileLen];
- int len = entryStream.read(buffer);
- if (len < fileLen){
- File tempFile = new File("tempFile");
- FileOutputStream fos = new FileOutputStream(tempFile);
- fos.write(buffer, 0, len);
- while (len < fileLen){
- int tempLen = entryStream.read(buffer);
- len = len + tempLen;
- fos.write(buffer, 0, tempLen);
- }
- fos.close();
- FileInputStream fin = new FileInputStream(tempFile);
- fin.read(buffer);
- tempFile.delete();
- }
- //
- // Check Md5
- //
- if (!ffItem.getMd5Value().equalsIgnoreCase(FarMd5.md5(buffer))){
- throw new Exception (ffItem.getRelativeFilename() + " MD5 Checksum is invaild!");
- }
- outputStream.write(buffer);
- } finally {
- outputStream.close();
- }
- } finally {
- entryStream.close();
- }
-
- } finally {
- }
- }
-
- }
-
- public void addFileToFar(File file, JarOutputStream farOuputStream, String workDir) {
-
- }
-
- /**
- *
- * @param pkgId
- * @return
- */
- public List<PackageIdentification> getPackageDependencies(PackageIdentification pkgId) {
- String[] entry = new String[2];
- PackageQuery pkgQ = new PackageQuery();
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
-
- entry = this.manifest.getPackgeSpd(pkgId);
- if (entry == null) {
- return result;
- }
- if (entry[0] != null) {
- try {
- JarEntry je;
- je = jf.getJarEntry(Tools.convertPathToUnixType(entry[1] + File.separatorChar + entry[0]));
- List<String> masList = pkgQ.getPackageMsaList(jf.getInputStream(je));
- Iterator item = masList.iterator();
- while (item.hasNext()) {
- je = jf.getJarEntry(Tools.convertPathToUnixType(entry[1] + File.separatorChar + item.next()));
- List<PackageIdentification> pkgIdList = pkgQ.getModuleDependencies(jf.getInputStream(je));
- Iterator pkgItem = pkgIdList.iterator();
- while (pkgItem.hasNext()) {
- PackageIdentification id = (PackageIdentification) pkgItem.next();
- if (!AggregationOperation.belongs(id, result)) {
- result.add(id);
- }
- }
- }
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
- return result;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarFileItem.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarFileItem.java
deleted file mode 100644
index 0e6cc4a679..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarFileItem.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
-
- The file is used to save information of <FarFile> item.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-public class FarFileItem {
-
- private String relativeFilename;
-
- private String md5Value;
-
- private String defaultPath;
-
- public FarFileItem(String relativeFilename, String md5Value) {
- this.relativeFilename = relativeFilename;
- this.md5Value = md5Value;
- }
-
- public String getMd5Value() {
- return md5Value;
- }
-
- public String getRelativeFilename() {
- return relativeFilename;
- }
-
- public void setMd5Value(String md5Value) {
- this.md5Value = md5Value;
- }
-
- public void setRelativeFilename(String relativeFilename) {
- this.relativeFilename = relativeFilename;
- }
-
- public String getDefaultPath() {
- return defaultPath;
- }
-
- public void setDefaultPath(String defaultPath) {
- this.defaultPath = defaultPath;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarHeader.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarHeader.java
deleted file mode 100644
index dd4f22690e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarHeader.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to save <farPackage> information.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-public class FarHeader {
- //
- // class member
- //
- private String farName;
-
- private String guidValue;
-
- private String version;
-
- private String abstractStr;
-
- private String description;
-
- private String copyright;
-
- private String license;
-
- private String specification;
-
- public String getAbstractStr() {
- return abstractStr;
- }
-
- public void setAbstractStr(String abstractStr) {
- this.abstractStr = abstractStr;
- }
-
- public String getCopyright() {
- return copyright;
- }
-
- public void setCopyright(String copyright) {
- this.copyright = copyright;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getFarName() {
- return farName;
- }
-
- public void setFarName(String farName) {
- this.farName = farName;
- }
-
- public String getGuidValue() {
- return guidValue;
- }
-
- public void setGuidValue(String guidValue) {
- this.guidValue = guidValue;
- }
-
- public String getLicense() {
- return license;
- }
-
- public void setLicense(String license) {
- this.license = license;
- }
-
- public String getSpecification() {
- return specification;
- }
-
- public void setSpecification(String specification) {
- this.specification = specification;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarIdentification.java
deleted file mode 100644
index babc9e3d92..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarIdentification.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/** @file
-
- The file is used to save information of Far item.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-public class FarIdentification {
-
- private String guid;
-
- private String md5Value;
-
- private String path;
-
- public FarIdentification(String guid, String md5Value, String path) {
- this.guid = guid;
- this.md5Value = md5Value;
- this.path = path;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getMd5Value() {
- return md5Value;
- }
-
- public void setMd5Value(String md5Value) {
- this.md5Value = md5Value;
- }
-
- public String getPath() {
- return path;
- }
-
- public void setPath(String path) {
- this.path = path;
- }
-
- public String toString() {
- return path + " [" + guid + "]";
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarInterface.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarInterface.java
deleted file mode 100644
index 04a2fb0a35..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarInterface.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.tianocore.frameworkwizard.far;
-
-import java.io.Reader;
-import java.util.Map;
-import java.util.Set;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public interface FarInterface {
-
- public Reader getManifestFile();
-
- public void hibernateToFile();
-
- public boolean extract(Map<PackageIdentification, String> packagePathes,
- Map<PlatformIdentification, String> platformPathes);
-
- public Set<PackageIdentification> getPackageDependencies(PackageIdentification packageId);
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarMd5.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarMd5.java
deleted file mode 100644
index 0269fcf6cd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarMd5.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
-
- The file is used to caculate file MD5 value.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.security.MessageDigest;
-
-public class FarMd5 {
-
- static public String md5(File file) throws Exception {
- byte[] buffer = new byte[(int) file.length()];
- FileInputStream fInput = new FileInputStream(file);
- fInput.read(buffer);
- fInput.close();
- return md5(buffer);
-
- }
-
- static public String md5(byte[] buffer) throws Exception {
- MessageDigest md = MessageDigest.getInstance("MD5");
- byte[] md5 = md.digest(buffer);
- return new String(String.format("%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", md5[0], md5[1], md5[2], md5[3], md5[4],
- md5[5], md5[6], md5[7], md5[8], md5[9], md5[10], md5[11], md5[12], md5[13],
- md5[14], md5[15]));
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPackage.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPackage.java
deleted file mode 100644
index aca9041c78..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPackage.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file
-
- The file is used to save <farPackage> information.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import java.util.List;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class FarPackage {
- //
- // Class member
- //
- private FarFileItem farFile;
-
- private String guidValue;
-
- private String version;
-
- private String defaultPath;
-
- private List<FarPlatformItem> farPlatformList;
-
- private List<FarFileItem> contentList;
-
- public String getDefaultPath() {
- return defaultPath;
- }
-
- public void setDefaultPath(String defaultPath) {
- this.defaultPath = defaultPath;
- }
-
- public FarFileItem getFarFile() {
- return farFile;
- }
-
- public void setFarFile(FarFileItem farFile) {
- this.farFile = farFile;
- }
-
- public List<FarPlatformItem> getFarPlatformList() {
- return farPlatformList;
- }
-
- public void setFarPlatformList(List<FarPlatformItem> farPlatformList) {
- this.farPlatformList = farPlatformList;
- }
-
- public String getGuidValue() {
- return guidValue;
- }
-
- public void setGuidValue(String guidValue) {
- this.guidValue = guidValue;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public List<FarFileItem> getContentList() {
- return this.contentList;
- }
-
- public void setContentList(List<FarFileItem> contentList) {
- this.contentList = contentList;
- }
-
- public boolean isIdentityPkg(PackageIdentification pkgId) {
- //File file = new File(farFile.getRelativeFilename());
- if (pkgId.getGuid().equalsIgnoreCase(guidValue) && pkgId.getVersion().equalsIgnoreCase(version)) {
- return true;
- }
- return false;
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPlatformItem.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPlatformItem.java
deleted file mode 100644
index e3c2f1c733..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarPlatformItem.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/** @file
-
- The file is used to save <farPlatform> information.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class FarPlatformItem {
- //
- // class member
- //
- private FarFileItem farFile;
-
- private String guidValue;
-
- private String version;
-
- public FarFileItem getFarFile() {
- return farFile;
- }
-
- public void setFarFile(FarFileItem farFile) {
- this.farFile = farFile;
- }
-
- public String getGuidValue() {
- return guidValue;
- }
-
- public void setGuidValue(String guidValue) {
- this.guidValue = guidValue;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public boolean isIdentityPlf(PlatformIdentification plfId) {
- if (plfId.getGuid() == guidValue && plfId.getVersion() == version) {
- return true;
- }
- return false;
-
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java
deleted file mode 100644
index bd1b7942f3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/FarStringDefinition.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.tianocore.frameworkwizard.far;
-
-public class FarStringDefinition {
-
- ///
- /// Definition for all step's title string
- ///
- public static final String CREATE_STEP_ONE_TITLE =
- "Create Framework Archive(FAR) - Step 1: Set FAR's basic information";
- public static final String CREATE_STEP_TWO_TITLE =
- "Create Framework Archive(FAR) - Step 2: Choose Packages and/or Platforms";
- public static final String CREATE_STEP_THREE_TITLE =
- "Create Framework Archive(FAR) - Step 3: Set file filter";
- public static final String CREATE_STEP_FOUR_TITLE =
- "Create Framework Archive(FAR) - Step 4: Choose target file and finish";
-
- public static final String DELETE_STEP_ONE_TITLE =
- "Delete Framework Archive(FAR) - Step 1: Choose FAR from current WORKSPACE";
- public static final String DELETE_STEP_TWO_TITLE =
- "Delete Framework Archive(FAR) - Step 2: Choose delete mode and finish";
-
- public static final String UPDATE_STEP_ONE_TITLE =
- "Update Framework Archive(FAR) - Step 1: Browse FAR file";
- public static final String UPDATE_STEP_TWO_TITLE =
- "Update Framework Archive(FAR) - Step 2: Summary";
-
- public static final String INSTALL_STEP_ONE_TITLE =
- "Install Framework Archive(FAR) - Step 1: Select FAR file";
- public static final String INSTALL_STEP_TWO_TITLE =
- "Install Framework Archive(FAR) - Step 2: Set path for packages and/or platforms";
-
- ///
- ///
- ///
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Manifest.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Manifest.java
deleted file mode 100644
index 89fb5b6d42..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/Manifest.java
+++ /dev/null
@@ -1,960 +0,0 @@
-/** @file
-
- The file is used to create Far's manifest file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class Manifest implements ManifestInterface {
- // /
- // / manifest document
- // /
- Document manifestDoc = null;
-
- // /
- // / Manfiest file element name
- // /
- final static String mfFileName = "FrameworkArchiveManifest.xml";
-
- //
- // Header
- //
- final static String farHeader = "FarHeader";
-
- final static String farHeader_FarName = "FarName";
-
- final static String farHeader_Abstract = "Abstract";
-
- final static String farHeader_Description = "Description";
-
- final static String farHeader_CopyRight = "Copyright";
-
- final static String farHeader_License = "License";
-
- final static String farHeader_Specification = "Specification";
-
- //
- // Package list
- //
- final static String farPackageList = "FarPackageList";
-
- final static String farPlatformList = "FarPlatformList";
-
- final static String contents = "Contents";
-
- final static String userExtensions = "UserExtensions";
-
- //
- // Common node name
- //
-
- final static String guidValue = "GuidValue";
-
- final static String version = "Version";
-
- //
- // FarPackage node name
- //
- final static String farPackageList_FarPackage = "FarPackage";
-
- final static String farPackage_FarfileName = "FarFilename";
-
- final static String farPackage_DefaultPath = "DefaultPath";
-
- final static String farPlatformList_FarPlatform = "FarPlatform";
-
- final static String farFileName_FarGuid = "FarGuid";
-
- final static String farFileName_Md5sum = "Md5sum";
-
- //
- // manifest header information.
- //
- FarHeader fhInfo = new FarHeader();
-
- //
- // FarPackage list
- //
- List<FarPackage> fPkgList = new ArrayList<FarPackage>();
-
- //
- // FarPlatform list
- //
- List<FarPlatformItem> fPlfList = new ArrayList<FarPlatformItem>();
-
- Set<File> files = new LinkedHashSet<File>();
-
- //
- // Manifest file
- //
- public File mfFile = null;
-
- public FarHeader getHeader() {
- return fhInfo;
- }
-
- public Manifest() throws Exception {
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- Document document = dombuilder.newDocument();
- this.manifestDoc = document;
-
- }
-
- public Manifest(InputStream manifestInputStream) throws Exception {
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- try {
- if (manifestInputStream != null) {
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- this.manifestDoc = dombuilder.parse(manifestInputStream);
- parseManifest();
- }
-
- } catch (Exception e) {
- //
- // Will change to throw Wizader exception.
- //
- throw new Exception(e.getMessage());
- }
- }
-
- public void setFarHeader(FarHeader fHeader) {
- this.fhInfo = fHeader;
- }
-
- public void createManifest(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,
- Set<String> fileFilter) throws Exception {
-
- //
- // Add Package and it's contents to FarPackageList.
- //
- Iterator<PackageIdentification> pkgItem = pkgList.iterator();
- while (pkgItem.hasNext()) {
- PackageIdentification pkgId = pkgItem.next();
-
- //
- // Add package and it's contents to <FarPackageList>.
- //
- addPkgToPkgList(pkgId, fileFilter);
- }
-
- //
- // Add FarPlatform to this.farPlatformList.
- //
- Iterator<PlatformIdentification> plfItem = plfList.iterator();
- while (plfItem.hasNext()) {
- PlatformIdentification plfId = plfItem.next();
-
- //
- // Add platform to Mainifest.
- //
- addPlatformIdToFarPlatformItemList(plfId);
- }
- }
-
- public void setManifestFile(File manifestFile) throws Exception {
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- InputStream is = new FileInputStream(manifestFile);
- this.manifestDoc = dombuilder.parse(is);
- }
-
- public void addPkgToPkgList(PackageIdentification packageId, Set<String> fileFilter) throws Exception {
- files.add(packageId.getSpdFile());
-
- FarPackage farPackage = new FarPackage();
- //
- // Add SPD file to FarPackage
- //
- File spdFile = new File(packageId.getPath());
-
- FarFileItem ffItem = new FarFileItem(spdFile.getName(), FarMd5.md5(spdFile));
- farPackage.setFarFile(ffItem);
-
- //
- // Add package guid value.
- //
- farPackage.setGuidValue(packageId.getGuid());
-
- //
- // Add package version
- //
- farPackage.setVersion(packageId.getVersion());
-
- //
- // Add DefaultPat: Package absoulte path - Workspace absolut
- // path.
- //
- String pkgDir = Tools.getFilePathOnly(packageId.getPath());
- File rootDir = new File(pkgDir);
- farPackage.setDefaultPath(Tools.getRelativePath(rootDir.getPath(), Workspace.getCurrentWorkspace()));
-
- //
- // Get package root dir contains.
- //
- Set<File> fileSet = new LinkedHashSet<File>();
- Set<File> fpdFileSet = new LinkedHashSet<File>();
-
- //
- // Get all files and fpd files
- //
- recursiveDirectory(fileSet, fpdFileSet, rootDir, fileFilter);
-
- //
- // Remove current package's SPD file
- //
- fileSet.remove(packageId.getSpdFile());
-
- files.addAll(fileSet);
-
- Iterator<File> iter = fileSet.iterator();
- List<FarFileItem> contents = new ArrayList<FarFileItem>();
- while (iter.hasNext()) {
- File normalFile = iter.next();
- String fileRelativePath = Tools.getRelativePath(normalFile.getPath(), pkgDir);
- ffItem = new FarFileItem(fileRelativePath, FarMd5.md5(normalFile));
- contents.add(ffItem);
- }
-
- farPackage.setContentList(contents);
-
- // List<FarPlatformItem> fpfList = new ArrayList<FarPlatformItem>();
- //
- // iter = fpdFileSet.iterator();
- //
- // while (iter.hasNext()) {
- // File fpdFile = iter.next();
- // PlatformIdentification platformId = new PlatformIdentification(wsTool
- // .getId(fpdFile.getPath(), OpenFile.openFpdFile(fpdFile
- // .getPath())));
- // addPlatformIdToFarPlatformItemList(fpfList, platformId);
- // }
- // farPackage.setFarPlatformList(fpfList);
- fPkgList.add(farPackage);
- }
-
- private void recursiveDirectory(Set<File> files, Set<File> fpds, File dir, Set<String> fileFilter) {
- if (isFilter(dir, fileFilter)) {
- return;
- }
- File[] allFilesInDir = dir.listFiles();
- for (int i = 0; i < allFilesInDir.length; i++) {
- if (allFilesInDir[i].isFile()) {
- if (isFilter(allFilesInDir[i], fileFilter)) {
- continue;
- }
- // if (allFilesInDir[i].getPath().toLowerCase().endsWith(".fpd")) {
- // fpds.add(allFilesInDir[i]);
- // } else {
- files.add(allFilesInDir[i]);
- // }
- } else {
- recursiveDirectory(files, fpds, allFilesInDir[i], fileFilter);
- }
- }
- }
-
- public void addPlatformIdToFarPlatformItemList(PlatformIdentification platformId) throws Exception {
- files.add(platformId.getFpdFile());
-
- FarPlatformItem fpfItem = new FarPlatformItem();
- FarFileItem ffItem;
- String fpfPath = platformId.getPath();
- File fpfFile = new File(fpfPath);
- //
- // Add farFileName
- //
- ffItem = new FarFileItem(Tools.getRelativePath(fpfFile.getPath(), Workspace.getCurrentWorkspace()),
- FarMd5.md5(fpfFile));
- fpfItem.setFarFile(ffItem);
-
- //
- // Add guid value
- //
- fpfItem.setGuidValue(platformId.getGuid());
-
- //
- // Add version
- //
- fpfItem.setVersion(platformId.getVersion());
-
- fPlfList.add(fpfItem);
- }
-
- /**
- *
- * @param
- * @return Set<PackageIdentification> list of PackageIdentification.
- */
- public List<PackageIdentification> getPackageList() throws Exception {
- //
- // PackageIdentification set.
- //
- List<PackageIdentification> pkgList = new ArrayList<PackageIdentification>();
- //
- //
- //
- Iterator pkgItem = this.fPkgList.iterator();
- while (pkgItem.hasNext()) {
- FarPackage fPkg = (FarPackage) pkgItem.next();
- //
- // Get package information from SPD file and create a package
- // identification.
- //
-
- PackageIdentification pkgId = new PackageIdentification(fPkg.getFarFile().getRelativeFilename(),
- fPkg.getGuidValue(), fPkg.getVersion());
- pkgId.setPath(Workspace.getCurrentWorkspace() + File.separatorChar + fPkg.getDefaultPath()
- + File.separatorChar + fPkg.getFarFile().getRelativeFilename());
- // wsTool.getId(
- // Workspace.getCurrentWorkspace() + File.separatorChar
- // + fPkg.getDefaultPath(), OpenFile
- // .openFpdFile(Workspace.getCurrentWorkspace()
- // + File.separatorChar
- // + fPkg.getDefaultPath()
- // + File.separatorChar
- // + fPkg.getFarFile().getRelativeFilename()));
- pkgList.add(pkgId);
- }
- return pkgList;
- }
-
- /**
- *
- */
- public List<PlatformIdentification> getPlatformList() throws Exception, IOException, XmlException {
- //
- // PlatformIdentification set.
- //
- List<PlatformIdentification> plfList = new ArrayList<PlatformIdentification>();
- Iterator plfItem = this.fPlfList.iterator();
- while (plfItem.hasNext()) {
- FarPlatformItem fpfItem = (FarPlatformItem) plfItem.next();
- File file = new File(Workspace.getCurrentWorkspace() + File.separatorChar
- + fpfItem.getFarFile().getRelativeFilename());
- //
- // Set platformIdentificaiton's path as absolutly path (include
- // workspace and FPD relatively path)
- //
- PlatformIdentification plfId = new PlatformIdentification(fpfItem.getFarFile().getRelativeFilename(),
- fpfItem.getGuidValue(), fpfItem.getVersion(),
- file.getPath());
-
- // (PlatformIdentification) wsTool
- // .getId(file.getParent(), OpenFile.openFpdFile(Workspace
- // .getCurrentWorkspace()
- // + File.separatorChar
- // + fpfItem.getFarFile().getRelativeFilename()));
- plfList.add(plfId);
- }
- return plfList;
- }
-
- public List<FarFileItem> getPlatformContents(PlatformIdentification platformId) {
- List<FarFileItem> result = new ArrayList<FarFileItem>();
- Iterator<FarPlatformItem> iter = this.fPlfList.iterator();
-
- while (iter.hasNext()) {
- FarPlatformItem item = iter.next();
- if (item.isIdentityPlf(platformId)) {
- FarFileItem farFileItem = item.getFarFile();
- farFileItem.setDefaultPath(farFileItem.getRelativeFilename());
- farFileItem.setRelativeFilename(Tools.getFileNameOnly(farFileItem.getRelativeFilename()));
- result.add(farFileItem);
- break;
- }
- }
- return result;
- }
-
- public List<FarFileItem> getPackageContents(PackageIdentification packageId) {
- List<FarFileItem> farFileList = new ArrayList<FarFileItem>();
- Iterator pkgItem = this.fPkgList.iterator();
- while (pkgItem.hasNext()) {
- FarPackage pkg = (FarPackage) pkgItem.next();
- if (pkg.isIdentityPkg(packageId)) {
- //
- // Add spd far file to list.
- //
- farFileList.add(pkg.getFarFile());
- //
- // Add all files in contents to list.
- //
- farFileList.addAll(pkg.getContentList());
- //
- // Add all farfiles in <FarPlatformList> to list.
- //
- // List<FarPlatformItem> plfList = pkg.getFarPlatformList();
- // Iterator plfItem = plfList.iterator();
- // while (plfItem.hasNext()) {
- // farFileList.add(((FarPlatformItem) plfItem.next())
- // .getFarFile());
- // }
-
- Iterator<FarFileItem> ffIter = farFileList.iterator();
- while (ffIter.hasNext()) {
- FarFileItem ffItem = ffIter.next();
- ffItem.setDefaultPath(pkg.getDefaultPath() + File.separatorChar + ffItem.getRelativeFilename());
- }
- break;
- }
- }
-
- return farFileList;
- }
-
- /**
- *
- * @param pkgId
- * @return String: return string represent jar file entry;
- */
- public String[] getPackgeSpd(PackageIdentification pkgId) {
- Iterator pkgItem = this.fPkgList.iterator();
- String[] entryStr = new String[2];
- while (pkgItem.hasNext()) {
- FarPackage pkg = (FarPackage) pkgItem.next();
- if (pkg.isIdentityPkg(pkgId)) {
- entryStr[0] = pkg.getFarFile().getRelativeFilename();
- entryStr[1] = pkg.getDefaultPath();
- return entryStr;
- }
- }
- return null;
- }
-
- public List<FarFileItem> getPackageContents() {
- //
- // In this farFilelist,all FarFileItem's relativeFileName should be
- // set as absolutely path.
- //
- List<FarFileItem> farFileList = new ArrayList<FarFileItem>();
- Iterator pkgItem = this.fPkgList.iterator();
- FarFileItem ffItem = null;
-
- while (pkgItem.hasNext()) {
- FarPackage pkg = (FarPackage) pkgItem.next();
-
- //
- // Add spd far file to list.
- //
- ffItem = pkg.getFarFile();
- //
- // Set farFileItem relativeFileName = absolutePath + file Name.
- //
- farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separatorChar + ffItem.getRelativeFilename(),
- ffItem.getMd5Value()));
- //
- // Add all files in contents to list.
- //
- Iterator contentsItem = pkg.getContentList().iterator();
- while (contentsItem.hasNext()) {
- ffItem = (FarFileItem) contentsItem.next();
- farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),
- ffItem.getMd5Value()));
- }
- //
- // Add all farfiles in <FarPlatformList> to list.
- //
- List<FarPlatformItem> plfList = pkg.getFarPlatformList();
- Iterator plfItem = plfList.iterator();
- while (plfItem.hasNext()) {
- ffItem = ((FarPlatformItem) plfItem.next()).getFarFile();
- farFileList.add(new FarFileItem(pkg.getDefaultPath() + File.separator + ffItem.getRelativeFilename(),
- ffItem.getMd5Value()));
- }
- }
- return farFileList;
- }
-
- public String getPackageDefaultPath(PackageIdentification packageId) {
- Iterator pkgItr = this.fPkgList.iterator();
- while (pkgItr.hasNext()) {
- FarPackage farPackage = (FarPackage) pkgItr.next();
- if (farPackage.isIdentityPkg(packageId)) {
- return farPackage.getDefaultPath();
- }
- }
- return null;
- }
-
- // public void setPackageInstallPath(PackageIdentification packageId, String path) {
- // Iterator<FarPackage> pkgItr = this.fPkgList.iterator();
- // while (pkgItr.hasNext()) {
- // FarPackage farPackage = pkgItr.next();
- // if (farPackage.isIdentityPkg(packageId)) {
- // farPackage.setDefaultPath(path);
- // return ;
- // }
- // }
- // }
- //
- // public void setPlatformInstallPath(PlatformIdentification platformId, String path) {
- // Iterator<FarPlatformItem> plfItr = this.fPlfList.iterator();
- // while (plfItr.hasNext()) {
- // FarPlatformItem farPlatform = plfItr.next();
- // if (farPlatform.i.isIdentity(platformId)) {
- // farPackage.setDefaultPath(path);
- // return ;
- // }
- // }
- // }
-
- public List<FarFileItem> getAllFileItem() {
- //
- // The farFileName in this list are all abosulte path.
- //
- List<FarFileItem> ffiList = new ArrayList<FarFileItem>();
- //
- // Add far files in <FarPackageList> to list.
- //
- ffiList = this.getPackageContents();
-
- //
- // Add far files in <FarPlatformList> to list
- //
- NodeList elementList = this.manifestDoc.getElementsByTagName(farPlatformList);
- for (int i = 0; i < elementList.getLength(); i++) {
- //
- // Get <farPlatform> node list.
- //
- Node item = elementList.item(i);
- NodeList plfElements = item.getChildNodes();
- for (int j = 0; j < plfElements.getLength(); j++) {
- //
- // Get each <FarPlatform> content.
- //
- NodeList plfChildNode = plfElements.item(i).getChildNodes();
- Node tempNode = null;
- for (int t = 0; t < plfChildNode.getLength(); t++) {
- tempNode = plfChildNode.item(t);
- //
- // Get child node value and set to platformIdentification.
- //
- if (tempNode.getNodeName().equalsIgnoreCase(farPackage_FarfileName)) {
- NamedNodeMap farAttr = tempNode.getAttributes();
- //
- // Change relative path to absolute one
- //
- FarFileItem farFile = new FarFileItem(tempNode.getTextContent(),
- farAttr.getNamedItem(farFileName_Md5sum).getTextContent());
- ffiList.add(farFile);
- }
- }
- }
- }
- return ffiList;
- }
-
- public void hibernateToFile() throws Exception {
- //
- // create manifest root node
- //
- Element rootNode = this.manifestDoc.createElement("FrameworkArchiveManifest");
- this.manifestDoc.appendChild(rootNode);
-
- //
- // create manifest header node
- //
- Element headerNode = this.manifestDoc.createElement(farHeader);
- rootNode.appendChild(headerNode);
- //
- // Add FarHeader to headerNode.
- //
- Element farName = this.manifestDoc.createElement(farHeader_FarName);
- farName.setTextContent(this.fhInfo.getFarName());
- headerNode.appendChild(farName);
-
- Element gv = this.manifestDoc.createElement(guidValue);
- gv.setTextContent(this.fhInfo.getGuidValue());
- headerNode.appendChild(gv);
-
- Element ver = this.manifestDoc.createElement(version);
- ver.setTextContent(this.fhInfo.getVersion());
- headerNode.appendChild(ver);
-
- Element abstra = this.manifestDoc.createElement(farHeader_Abstract);
- abstra.setTextContent(this.fhInfo.getAbstractStr());
- headerNode.appendChild(abstra);
-
- Element descr = this.manifestDoc.createElement(farHeader_Description);
- descr.setTextContent(this.fhInfo.getDescription());
- headerNode.appendChild(descr);
-
- Element copyright = this.manifestDoc.createElement(farHeader_CopyRight);
- copyright.setTextContent(this.fhInfo.getCopyright());
- headerNode.appendChild(copyright);
-
- Element license = this.manifestDoc.createElement(farHeader_License);
- license.setTextContent(this.fhInfo.getLicense());
- headerNode.appendChild(license);
-
- Element spec = this.manifestDoc.createElement(farHeader_Specification);
- spec.setTextContent(this.fhInfo.getSpecification());
- System.out.println(this.fhInfo.getSpecification());
- headerNode.appendChild(spec);
-
- //
- // create manifest FarPackageList node
- //
- Element pkgListNode = this.manifestDoc.createElement(farPackageList);
- rootNode.appendChild(pkgListNode);
-
- //
- // Save each item in farPackage list to <FarPackage>.
- //
- Iterator pkgItem = this.fPkgList.iterator();
- while (pkgItem.hasNext()) {
- pkgToFarPkgNode(pkgListNode, (FarPackage) pkgItem.next());
-
- }
-
- //
- // create manifest FarPlatformList node
- //
- Element plfListNode = this.manifestDoc.createElement(farPlatformList);
- rootNode.appendChild(plfListNode);
-
- //
- // Save farPakcage list info to <FarPackageList> node
- //
- Iterator plfItem = this.fPlfList.iterator();
- while (plfItem.hasNext()) {
- FarPlatformItem plfIterator = (FarPlatformItem) plfItem.next();
- PlfToPlatformNode(plfListNode, plfIterator);
- }
-
- //
- // Write the DOM document to the file
- //
- Transformer xformer = TransformerFactory.newInstance().newTransformer();
- xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- xformer.setOutputProperty(OutputKeys.INDENT, "yes");
-
- //
- // Prepare the DOM document for writing
- //
- Source source = new DOMSource(this.manifestDoc);
- //
- // Prepare the output file, get the Mainifest file name from <FarHeader>
- // <FarName>.
- //
- this.mfFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar + mfFileName);
- //
- // generate all directory path
- //
- Result result = new StreamResult(this.mfFile);
- xformer.transform(source, result);
- //
- // Close result. Flush file by manual for Jdk1.5.0_04.
- //
- ((StreamResult) result).getOutputStream().close();
- }
-
- public void pkgToFarPkgNode(Element parentNode, FarPackage pkgItem) {
- Element pkgNode = this.manifestDoc.createElement(farPackageList_FarPackage);
- //
- // Add <FarFileName>
- //
- ffiToFfNode(pkgNode, pkgItem.getFarFile());
- //
- // Add <GuidValue>
- //
- setStrItemToNode(pkgNode, pkgItem.getGuidValue(), guidValue);
- //
- // Add <Version>
- //
- setStrItemToNode(pkgNode, pkgItem.getVersion(), version);
- //
- // Add <DefaultPath>
- //
- setStrItemToNode(pkgNode, pkgItem.getDefaultPath(), farPackage_DefaultPath);
-
- //
- // Add <Contents>
- //
- Element contentNode = this.manifestDoc.createElement(contents);
- Iterator iterator = pkgItem.getContentList().iterator();
- while (iterator.hasNext()) {
- ffiToFfNode(contentNode, (FarFileItem) iterator.next());
- }
- pkgNode.appendChild(contentNode);
- parentNode.appendChild(pkgNode);
- }
-
- public void PlfToPlatformNode(Element parentNode, FarPlatformItem fplItem) {
- Element fplNode = this.manifestDoc.createElement(farPlatformList_FarPlatform);
- //
- // Add <FarFileName>
- //
- ffiToFfNode(fplNode, fplItem.getFarFile());
- //
- // Add <GuidValue>
- //
- setStrItemToNode(fplNode, fplItem.getGuidValue(), guidValue);
- //
- // Add <Version>
- //
- setStrItemToNode(fplNode, fplItem.getVersion(), version);
- //
- // Add to <PlatformList>
- //
- parentNode.appendChild(fplNode);
-
- }
-
- public void ffiToFfNode(Element parentNode, FarFileItem ffi) {
- Element farFileName = this.manifestDoc.createElement(farPackage_FarfileName);
- farFileName.setTextContent(ffi.getRelativeFilename());
- System.out.println(farFileName.getTextContent());
- System.out.println(ffi.getRelativeFilename());
- farFileName.setAttribute(farFileName_Md5sum, ffi.getMd5Value());
- parentNode.appendChild(farFileName);
- }
-
- public void setStrItemToNode(Element parentNode, String strValue, String strName) {
- Element node = this.manifestDoc.createElement(strName);
- node.setTextContent(strValue);
- parentNode.appendChild(node);
- }
-
- private void parseManifest() {
-
- //
- // Parse header
- //
- parseMfHeader();
- //
- // parse <farPackageList>
- //
- parseHeaderFarPackageList();
-
- //
- // parse <farPlatformList>
- //
- NodeList ele = this.manifestDoc.getElementsByTagName(farPlatformList);
- Node plfNode;
- if (ele.getLength() > 0) {
- //
- // Only have one <FarPlatformList> node under manifest root node.
- //
- plfNode = ele.item(0);
- parseFarPlatformList(plfNode, this.fPlfList);
- }
- }
-
- private void parseMfHeader() {
- Node headerNode;
- NodeList ele = this.manifestDoc.getElementsByTagName(farHeader);
- if (ele.getLength() > 0) {
- //
- // For manifest file only have one <FarHeader>
- //
- headerNode = ele.item(0);
- } else {
- return;
- }
- NodeList childList = headerNode.getChildNodes();
- Node node = null;
- String nodeName = null;
- for (int i = 0; i < childList.getLength(); i++) {
- node = childList.item(i);
- nodeName = node.getNodeName();
- if (nodeName.equalsIgnoreCase(farHeader_FarName)) {
- String nodeValue = node.getTextContent();
- this.fhInfo.setFarName(nodeValue);
- } else if (nodeName.equalsIgnoreCase(guidValue)) {
- this.fhInfo.setGuidValue(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(version)) {
- this.fhInfo.setVersion(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(farHeader_Abstract)) {
- this.fhInfo.setAbstractStr(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(farHeader_Description)) {
- this.fhInfo.setDescription(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(farHeader_CopyRight)) {
- this.fhInfo.setCopyright(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(farHeader_License)) {
- this.fhInfo.setLicense(node.getTextContent());
- } else if (nodeName.equalsIgnoreCase(farHeader_Specification)) {
- this.fhInfo.setSpecification(node.getTextContent());
- }
- }
- }
-
- public void parseHeaderFarPackageList() {
- Node farPkgNode;
- NodeList ele = this.manifestDoc.getElementsByTagName(farPackageList);
- if (ele.getLength() > 0) {
- //
- // For manifest file only have one <FarHeader>
- //
- farPkgNode = ele.item(0);
- } else {
- return;
- }
- NodeList fpnList = farPkgNode.getChildNodes();
- for (int i = 0; i < fpnList.getLength(); i++) {
- if (fpnList.item(i).getNodeType() == Node.TEXT_NODE) {
- continue;
- }
- FarPackage fpItem = new FarPackage();
- parseFarPackage(fpnList.item(i), fpItem);
- this.fPkgList.add(fpItem);
- }
- }
-
- public void parseFarPackage(Node farPkgNode, FarPackage fpItem) {
- NodeList childList = farPkgNode.getChildNodes();
- Node childNode;
- String childName;
- for (int i = 0; i < childList.getLength(); i++) {
- childNode = childList.item(i);
- childName = childNode.getNodeName();
- if (childName.equalsIgnoreCase(farPackage_FarfileName)) {
- fpItem.setFarFile(parseFarFile(childNode));
- } else if (childName.equalsIgnoreCase(guidValue)) {
- fpItem.setGuidValue(childNode.getTextContent());
- } else if (childName.equalsIgnoreCase(version)) {
- fpItem.setVersion(childNode.getTextContent());
- } else if (childName.equalsIgnoreCase(farPackage_DefaultPath)) {
- fpItem.setDefaultPath(childNode.getTextContent());
- } else if (childName.equalsIgnoreCase(farPlatformList)) {
- List<FarPlatformItem> plfList = new ArrayList<FarPlatformItem>();
- parseFarPlatformList(childNode, plfList);
- fpItem.setFarPlatformList(plfList);
- } else if (childName.equalsIgnoreCase(contents)) {
- List<FarFileItem> ffList = new ArrayList<FarFileItem>();
- parseContents(childNode, ffList);
- fpItem.setContentList(ffList);
- }
- }
- }
-
- /**
- *
- * @param fpfListNode
- * @param plfList
- */
- public void parseFarPlatformList(Node fpfListNode, List<FarPlatformItem> plfList) {
- //
- // Get <FarPlatform> list.
- //
- NodeList child = fpfListNode.getChildNodes();
- Node farPlfNode;
- for (int i = 0; i < child.getLength(); i++) {
- if (child.item(i).getNodeType() == Node.TEXT_NODE) {
- continue;
- }
- farPlfNode = child.item(i);
- plfList.add(parseFarPlatform(farPlfNode));
- }
- }
-
- /**
- *
- * @param fpfNode
- * @return
- */
- public FarPlatformItem parseFarPlatform(Node fpfNode) {
- //
- // New FarPlatformItem.
- //
- FarPlatformItem fplItem = new FarPlatformItem();
- //
- // Get <FarPlatform> elements;
- //
- NodeList childList = fpfNode.getChildNodes();
- Node child;
- String nodeName;
- for (int i = 0; i < childList.getLength(); i++) {
- child = childList.item(i);
- nodeName = child.getNodeName();
- if (nodeName.equalsIgnoreCase(farPackage_FarfileName)) {
- fplItem.setFarFile(parseFarFile(child));
- } else if (nodeName.equalsIgnoreCase(guidValue)) {
- fplItem.setGuidValue(child.getTextContent());
- } else if (nodeName.equalsIgnoreCase(version)) {
- fplItem.setVersion(child.getTextContent());
- }
- }
-
- return fplItem;
- }
-
- public void parseContents(Node contentsNode, List<FarFileItem> ffList) {
- NodeList contentList = contentsNode.getChildNodes();
- Node contentNode;
- for (int i = 0; i < contentList.getLength(); i++) {
- if (contentList.item(i).getNodeType() == Node.TEXT_NODE) {
- continue;
- }
- contentNode = contentList.item(i);
- //
- // Parse each <FarFileName>.
- //
- ffList.add(parseFarFile(contentNode));
- }
- }
-
- public FarFileItem parseFarFile(Node farFileNode) {
- String ffName = farFileNode.getTextContent();
- NamedNodeMap attr = farFileNode.getAttributes();
- FarFileItem ffItem = new FarFileItem(ffName, attr.getNamedItem(farFileName_Md5sum).getTextContent());
- return ffItem;
- }
-
- public boolean isFilter(File file, Set<String> fileter) {
- Iterator<String> iter = fileter.iterator();
- while (iter.hasNext()) {
- Pattern pattern = Pattern.compile(iter.next());
- Matcher matcher = pattern.matcher(file.getName());
-
- if (matcher.find()) {
- return true;
- }
- }
- return false;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/ManifestInterface.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/ManifestInterface.java
deleted file mode 100644
index 28af114a5b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/ManifestInterface.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public interface ManifestInterface {
-
- public void createManifest(List<PackageIdentification> pkgList, List<PlatformIdentification> plfList,
- Set<String> fileFilter) throws Exception;
-
- public void setManifestFile(File manifestFile) throws Exception;
-
- public List<PackageIdentification> getPackageList() throws Exception;
-
- public List<PlatformIdentification> getPlatformList() throws Exception, IOException, XmlException;
-
- public List<FarFileItem> getPackageContents(PackageIdentification packageId);
-
- public String getPackageDefaultPath(PackageIdentification packageId);
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQuery.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQuery.java
deleted file mode 100644
index f76af054ba..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQuery.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.PackageDependenciesDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class PackageQuery implements PackageQueryInterface {
-
- public PackageIdentification getPackageIdentification(File spdFile) {
- PackageIdentification packageId = null;
- try {
- String path = spdFile.getPath();
- packageId = Tools.getId(path, OpenFile.openSpdFile(path));
- } catch (Exception e) {
- e.printStackTrace();
- }
- return packageId;
- }
-
- public List<String> getPackageMsaList(InputStream spdInput) {
- List<String> result = new ArrayList<String>();
- try {
- PackageSurfaceAreaDocument spd = (PackageSurfaceAreaDocument) XmlObject.Factory.parse(spdInput);
- result = spd.getPackageSurfaceArea().getMsaFiles().getFilenameList();
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
- public List<PackageIdentification> getModuleDependencies(InputStream msaInput) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- try {
- ModuleSurfaceAreaDocument msa = (ModuleSurfaceAreaDocument) XmlObject.Factory.parse(msaInput);
- ModuleSurfaceAreaDocument.ModuleSurfaceArea sa = msa.getModuleSurfaceArea();
- if (sa == null) {
- return result;
- }
- PackageDependenciesDocument.PackageDependencies pkgDep = sa.getPackageDependencies();
- if (pkgDep == null) {
- return result;
- }
- List<PackageDependenciesDocument.PackageDependencies.Package> list = pkgDep.getPackageList();
- Iterator<PackageDependenciesDocument.PackageDependencies.Package> iter = list.iterator();
- while (iter.hasNext()) {
- PackageDependenciesDocument.PackageDependencies.Package item = iter.next();
- PackageIdentification packageId = new PackageIdentification(null, item.getPackageGuid(),
- item.getPackageVersion());
- result.add(packageId);
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- return result;
- }
-
- public List<File> getPackageMsaList(File spdFile) {
- List<File> result = new Vector<File>();
- WorkspaceTools wt = new WorkspaceTools();
- List<String> v = wt.getAllModulesOfPackage(spdFile.getPath());
- Iterator<String> iter = v.iterator();
- while (iter.hasNext()) {
- result.add(new File(iter.next()));
- }
- return result;
- }
-
- public List<PackageIdentification> getPackageDependencies(File spdFile) {
- List<File> msaFiles = getPackageMsaList(spdFile);
- return getPackageDependencies(msaFiles);
- }
-
- public List<PackageIdentification> getPackageDependencies(List<File> msaFiles) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- Iterator<File> iter = msaFiles.iterator();
- while (iter.hasNext()) {
- result = AggregationOperation.union(result, getModuleDependencies(iter.next()));
- }
- return result;
- }
-
- public List<PackageIdentification> getModuleDependencies(File msaFile) {
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- try {
- ModuleSurfaceArea msa = OpenFile.openMsaFile(msaFile.getPath());
- List<PackageDependenciesDocument.PackageDependencies.Package> p = msa.getPackageDependencies()
- .getPackageList();
- Iterator<PackageDependenciesDocument.PackageDependencies.Package> iter = p.iterator();
- while (iter.hasNext()) {
- PackageDependenciesDocument.PackageDependencies.Package item = iter.next();
- PackageIdentification packageId = new PackageIdentification(null, item.getPackageGuid(),
- item.getPackageVersion());
- if (!AggregationOperation.belongs(packageId, result)) {
- result.add(packageId);
- }
- }
- } catch (Exception e) {
- }
- return result;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQueryInterface.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQueryInterface.java
deleted file mode 100644
index e8644ebbf7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/PackageQueryInterface.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.List;
-
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public interface PackageQueryInterface {
-
- public PackageIdentification getPackageIdentification(File spdFile);
-
- public List<File> getPackageMsaList(File spdFile);
-
- public List<String> getPackageMsaList(InputStream spdInput);
-
- public List<PackageIdentification> getPackageDependencies(File spdFile);
-
- public List<PackageIdentification> getPackageDependencies(List<File> msaFiles);
-
- public List<PackageIdentification> getModuleDependencies(InputStream msaInput);
-
- public List<PackageIdentification> getModuleDependencies(File msaFile);
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java
deleted file mode 100644
index ab2ffd07ee..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepFour.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.far.AggregationOperation;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.far.PackageQuery;
-import org.tianocore.frameworkwizard.far.PackageQueryInterface;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class CreateStepFour extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -7397213364965470902L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextAreaInstruction = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel2 = null;
-
- private JTextField jTextFieldSaveToFile = null;
-
- private JButton jButtonBrowser = null;
-
- // private JScrollPane jScrollPane = null;
- private JButton jButtonCancel = null;
-
- private JButton jButtonFinish = null;
-
- private JButton jButtonPrevious = null;
-
- private IDefaultTableModel model = null;
-
- private CreateStepThree stepThree = null;
-
- // private JTable jTable = null;
- public CreateStepFour(IDialog iDialog, boolean modal, CreateStepThree stepThree) {
- this(iDialog, modal);
- this.stepThree = stepThree;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextAreaInstruction == null) {
- jTextAreaInstruction = new JTextArea();
- jTextAreaInstruction.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextAreaInstruction.setText("Step 4: Choose a file \n");
- jTextAreaInstruction.setEditable(false);
- }
- return jTextAreaInstruction;
- }
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextField1() {
- if (jTextFieldSaveToFile == null) {
- jTextFieldSaveToFile = new JTextField();
- jTextFieldSaveToFile.setBounds(new java.awt.Rectangle(147,70,412,20));
- }
- return jTextFieldSaveToFile;
- }
-
- /**
- * This method initializes jButtonBrowser
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrower() {
- if (jButtonBrowser == null) {
- jButtonBrowser = new JButton();
- jButtonBrowser.setBounds(new java.awt.Rectangle(570, 70, 100, 20));
- jButtonBrowser.setText("Browser...");
- jButtonBrowser.addMouseListener(this);
- }
- return jButtonBrowser;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- // private JScrollPane getJScrollPane() {
- // if (jScrollPane == null) {
- // jScrollPane = new JScrollPane();
- // jScrollPane.setBounds(new java.awt.Rectangle(139,85,500,100));
- // jScrollPane.setViewportView(getJTable());
- // }
- // return jScrollPane;
- // }
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFinish() {
- if (jButtonFinish == null) {
- jButtonFinish = new JButton();
- jButtonFinish.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonFinish.setText("Finish");
- jButtonFinish.addMouseListener(this);
- }
- return jButtonFinish;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- jButtonPrevious.setVisible(true);
- }
- return jButtonPrevious;
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepFour(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_FOUR_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel2 = new JLabel();
- jLabel2.setBounds(new java.awt.Rectangle(30,70,111,18));
- jLabel2.setText("File to Save: ");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(29,108,320,20));
- jLabel.setText("This FAR will depend on the following packages: ");
- jLabel.setVisible(false);
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- // jContentPane.add(getJScrollPane(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonFinish(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(jLabel2, null);
- jContentPane.add(getJTextField1(), null);
- jContentPane.add(getJButtonBrower(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonFinish) {
- //
- // Add some logic process here
- // Guid Check, File Check etc.
- //
- if (this.jTextFieldSaveToFile.getText() == null) {
- Log.wrn("Create far", "Please input the Far name!");
- }
- try {
- //
- // Create an output stream for JAR
- //
-
- Far far = new Far(new File(this.jTextFieldSaveToFile.getText()));
-
- far.creatFar(this.getPreviousStep().getPreviousStep().getSelectedPackages(),
- this.getPreviousStep().getPreviousStep().getSelectedPlatforms(), this.getPreviousStep()
- .getFileFilter(),
- this.getPreviousStep().getPreviousStep().getPreviousStep().getFarHeader());
- } catch (Exception exp) {
- Log.wrn("Create far", exp.getMessage());
- Log.err("Create far", exp.getMessage());
- return;
- }
- getPreviousStep().getPreviousStep().getPreviousStep().returnType = DataType.RETURN_TYPE_OK;
- getPreviousStep().getPreviousStep().dispose();
- getPreviousStep().dispose();
- this.setVisible(false);
- this.dispose();
- } else if (e.getSource() == jButtonBrowser) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
-
- int result = fc.showSaveDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldSaveToFile.setText(Tools.addPathExt(fc.getSelectedFile().getPath(),
- DataType.RETURN_TYPE_FAR_SURFACE_AREA));
- }
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepThree.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public CreateStepThree getPreviousStep() {
- return stepThree;
- }
-
- public void prepareTable() {
- model.setRowCount(0);
-
- List<PackageIdentification> packageList = new ArrayList<PackageIdentification>();
- //
- // Change here to get packages and platforms from FAR
- //
- List<PackageIdentification> selectedPackages = getPreviousStep().getPreviousStep().getSelectedPackages();
- PackageQueryInterface pq = new PackageQuery();
-
- Iterator<PackageIdentification> iter = selectedPackages.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- List<PackageIdentification> list = pq.getPackageDependencies(item.getSpdFile());
- packageList = AggregationOperation.union(list, packageList);
- }
-
- packageList = AggregationOperation.minus(packageList, selectedPackages);
-
- iter = packageList.iterator();
- while (iter.hasNext()) {
- String[] str = new String[3];
- PackageIdentification item = iter.next();
- str[2] = item.getName();
- str[1] = item.getVersion();
- str[0] = item.getGuid();
- model.addRow(str);
- }
- }
-}
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java
deleted file mode 100644
index 0126b96f38..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepOne.java
+++ /dev/null
@@ -1,641 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.far.FarHeader;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-
-public class CreateStepOne extends IDialog implements MouseListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -8152099582923006900L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelLicense = null;
-
- private JTextArea jTextAreaLicense = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jLabelDescription = null;
-
- private JTextArea jTextAreaDescription = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JButton jButtonOk = null;
-
- private JScrollPane jScrollPaneLicense = null;
-
- private JScrollPane jScrollPaneDescription = null;
-
- private JLabel jLabelAbstract = null;
-
- private JTextField jTextFieldAbstract = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel6 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private StarLabel jStarLabel10 = null;
-
- private StarLabel jStarLabel12 = null;
-
- private JLabel jLabelURL = null;
-
- private JTextField jTextFieldURL = null;
-
- private JScrollPane jScrollPane = null;
-
- private CreateStepTwo stepTwo = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonNext = null;
-
- private FarHeader farHeader = new FarHeader();
-
- private JScrollPane jScrollPaneCopyright = null;
-
- private JTextArea jTextAreaCopyright = null;
-
- /**
- * This method initializes jTextFieldBaseName
- *
- * @return javax.swing.JTextField jTextFieldBaseName
- *
- */
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(160, 10, 520, 20));
- jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Drivers, of the Framework Archive.");
- }
- return jTextFieldBaseName;
- }
-
- /**
- * This method initializes jTextFieldGuid
- *
- * @return javax.swing.JTextField jTextFieldGuid
- *
- */
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(160, 35, 410, 20));
- jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number (8-4-4-4-12)");
- }
- return jTextFieldGuid;
- }
-
- /**
- * This method initializes jTextFieldVersion
- *
- * @return javax.swing.JTextField jTextFieldVersion
- *
- */
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(160, 60, 520, 20));
- jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01");
- }
- return jTextFieldVersion;
- }
-
- /**
- * This method initializes jButtonGenerateGuid
- *
- * @return javax.swing.JButton jButtonGenerateGuid
- *
- */
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(590, 35, 90, 20));
- jButtonGenerateGuid.setText("Generate");
- jButtonGenerateGuid.addMouseListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- * This method initializes jTextAreaLicense
- *
- * @return javax.swing.JTextArea jTextAreaLicense
- *
- */
- private JTextArea getJTextAreaLicense() {
- if (jTextAreaLicense == null) {
- jTextAreaLicense = new JTextArea();
- jTextAreaLicense.setText("");
- jTextAreaLicense.setLineWrap(true);
- jTextAreaLicense.setWrapStyleWord(true);
- jTextAreaLicense.setToolTipText("The License for this FAR file.");
- }
- return jTextAreaLicense;
- }
-
- /**
- * This method initializes jTextAreaDescription
- *
- * @return javax.swing.JTextArea jTextAreaDescription
- *
- */
- private JTextArea getJTextAreaDescription() {
- if (jTextAreaDescription == null) {
- jTextAreaDescription = new JTextArea();
- jTextAreaDescription.setLineWrap(true);
- jTextAreaDescription.setWrapStyleWord(true);
- jTextAreaDescription.setToolTipText("A verbose description of the FAR contents.");
- }
- return jTextAreaDescription;
- }
-
- /**
- * This method initializes jTextFieldSpecification
- *
- * @return javax.swing.JTextField jTextFieldSpecification
- *
- */
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
- jTextFieldSpecification.setBounds(new java.awt.Rectangle(160, 310, 520, 20));
- jTextFieldSpecification.setEditable(false);
- }
- return jTextFieldSpecification;
- }
-
- /**
- * This method initializes jScrollPaneLicense
- *
- * @return javax.swing.JScrollPane jScrollPaneLicense
- *
- */
- private JScrollPane getJScrollPaneLicense() {
- if (jScrollPaneLicense == null) {
- jScrollPaneLicense = new JScrollPane();
- jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setBounds(new java.awt.Rectangle(160, 220, 520, 60));
- jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- }
- return jScrollPaneLicense;
- }
-
- /**
- * This method initializes jScrollPaneDescription
- *
- * @return javax.swing.JScrollPane jScrollPaneDescription
- *
- */
- private JScrollPane getJScrollPaneDescription() {
- if (jScrollPaneDescription == null) {
- jScrollPaneDescription = new JScrollPane();
- jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setBounds(new java.awt.Rectangle(160, 110, 520, 60));
- jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- }
- return jScrollPaneDescription;
- }
-
- /**
- * This method initializes jTextFieldAbstract
- *
- * @return javax.swing.JTextField jTextFieldAbstract
- *
- */
- private JTextField getJTextFieldAbstract() {
- if (jTextFieldAbstract == null) {
- jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setBounds(new java.awt.Rectangle(160, 85, 520, 20));
- jTextFieldAbstract.setToolTipText("A one sentence description of this FAR package.");
- }
- return jTextFieldAbstract;
- }
-
- /**
- * This method initializes jTextFieldURL
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldURL() {
- if (jTextFieldURL == null) {
- jTextFieldURL = new JTextField();
- jTextFieldURL.setBounds(new java.awt.Rectangle(160, 285, 520, 20));
- jTextFieldURL.setToolTipText("A URL for the latest version of the license");
- }
- return jTextFieldURL;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jButtonCancel1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(590, 350, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(480, 350, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jScrollPaneCopyright
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneCopyright() {
- if (jScrollPaneCopyright == null) {
- jScrollPaneCopyright = new JScrollPane();
- jScrollPaneCopyright.setBounds(new java.awt.Rectangle(160, 175, 520, 40));
- jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());
- }
- return jScrollPaneCopyright;
- }
-
- /**
- * This method initializes jTextAreaCopyright
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaCopyright() {
- if (jTextAreaCopyright == null) {
- jTextAreaCopyright = new JTextArea();
- }
- return jTextAreaCopyright;
- }
-
- public static void main(String[] args) {
- CreateStepOne c = new CreateStepOne(new IFrame(), true);
- c.setVisible(true);
- }
-
- /**
- * This is the default constructor
- *
- */
- public CreateStepOne(IFrame iFrame, boolean modal) {
- super(iFrame, modal);
- initialize();
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldBaseName.setEnabled(!isView);
- this.jTextFieldGuid.setEnabled(!isView);
- this.jTextFieldVersion.setEnabled(!isView);
- this.jTextAreaLicense.setEnabled(!isView);
- this.jScrollPaneCopyright.setEnabled(!isView);
- this.jTextAreaCopyright.setEnabled(!isView);
- this.jTextAreaDescription.setEnabled(!isView);
- this.jTextFieldSpecification.setEnabled(!isView);
- this.jTextFieldAbstract.setEnabled(!isView);
- this.jButtonGenerateGuid.setEnabled(!isView);
- this.jButtonOk.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes this
- *
- */
- private void initialize() {
- this.setSize(700, 425);
- this.setContentPane(getJScrollPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_ONE_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jLabelURL = new JLabel();
- jLabelURL.setText("License URL");
- jLabelURL.setBounds(new java.awt.Rectangle(35, 285, 120, 20));
- jLabelBaseName = new JLabel();
- jLabelBaseName.setText("FAR Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(35, 10, 120, 20));
- jLabelGuid = new JLabel();
- jLabelGuid.setText("Guid Value");
- jLabelGuid.setBounds(new java.awt.Rectangle(35, 35, 120, 20));
- jLabelVersion = new JLabel();
- jLabelVersion.setText("Version");
- jLabelVersion.setBounds(new java.awt.Rectangle(35, 60, 120, 20));
- jLabelAbstract = new JLabel();
- jLabelAbstract.setText("Abstract");
- jLabelAbstract.setBounds(new java.awt.Rectangle(35, 85, 120, 20));
- jLabelDescription = new JLabel();
- jLabelDescription.setText("Description");
- jLabelDescription.setBounds(new java.awt.Rectangle(35, 110, 120, 20));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setBounds(new java.awt.Rectangle(35, 175, 120, 20));
- jLabelLicense = new JLabel();
- jLabelLicense.setText("License");
- jLabelLicense.setBounds(new java.awt.Rectangle(35, 220, 120, 20));
- jLabelSpecification = new JLabel();
- jLabelSpecification.setText("Specification");
- jLabelSpecification.setBounds(new java.awt.Rectangle(35, 310, 120, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
-
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelLicense, null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(jLabelDescription, null);
- jContentPane.add(jLabelSpecification, null);
- jContentPane.add(getJTextFieldSpecification(), null);
- jContentPane.add(getJScrollPaneLicense(), null);
- jContentPane.add(getJScrollPaneDescription(), null);
- jContentPane.add(jLabelAbstract, null);
- jContentPane.add(getJTextFieldAbstract(), null);
- jContentPane.add(jLabelURL, null);
- jContentPane.add(getJTextFieldURL(), null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(20, 10));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(20, 35));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(20, 60));
- jStarLabel6 = new StarLabel();
- jStarLabel6.setLocation(new java.awt.Point(20, 110));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(20, 175));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(20, 220));
- jStarLabel10 = new StarLabel();
- jStarLabel10.setLocation(new java.awt.Point(20, 85));
- jStarLabel12 = new StarLabel();
- jStarLabel12.setLocation(new java.awt.Point(20, 310));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel6, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(jStarLabel10, null);
- jContentPane.add(jStarLabel12, null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJScrollPaneCopyright(), null);
- }
- return jContentPane;
- }
-
- public boolean valid() {
- //
- // Check BaseName
- //
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Create far", "FAR Name must be entered.");
- return false;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Create far", "Incorrect data type for FAR Name");
- return false;
- }
- farHeader.setFarName(this.jTextFieldBaseName.getText());
-
- //
- // Check Guid
- //
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Create far", "A GUID must be entered.");
- return false;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Create far", "Incorrect data type for Guid");
- return false;
- }
- farHeader.setGuidValue(this.jTextFieldGuid.getText());
-
- //
- // Check Version
- //
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Create far", "A Version must be entered.");
- return false;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Create far", "Incorrect data type for Version");
- return false;
- }
- farHeader.setVersion(this.jTextFieldVersion.getText());
-
- //
- // Check Abstact
- //
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Create far", "An Abstract must be entered.");
- return false;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Create far", "Incorrect data type for Abstract");
- return false;
- }
- farHeader.setAbstractStr(this.jTextFieldAbstract.getText());
-
- //
- // Check Description
- //
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Create far", "A Description must be entered.");
- return false;
- }
- farHeader.setDescription(this.jTextAreaDescription.getText());
-
- //
- // Check Copyright
- //
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Create far", "The Copyright must be entered.");
- return false;
- }
- farHeader.setCopyright(this.jTextAreaCopyright.getText());
-
- //
- // Check License
- //
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Create far", "The License must be entered.");
- return false;
- }
- farHeader.setLicense(this.jTextAreaLicense.getText());
-
- farHeader.setSpecification(this.jTextFieldSpecification.getText());
- return true;
- }
-
- /**
- * Check the input data is empty or not
- *
- * @param strValue
- * The input data which need be checked
- *
- * @retval true - The input data is empty
- * @retval fals - The input data is not empty
- *
- */
- public boolean isEmpty(String strValue) {
- if (strValue.length() > 0) {
- return false;
- }
- return true;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
- if (!valid()) {
- return ;
- }
- if (stepTwo == null) {
- stepTwo = new CreateStepTwo(this, true, this);
- }
- this.setVisible(false);
- stepTwo.setVisible(true);
- } else if (e.getSource() == jButtonGenerateGuid) {
- this.jTextFieldGuid.setText(Tools.generateUuidString());
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public FarHeader getFarHeader() {
- return farHeader;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java
deleted file mode 100644
index 666082d3d4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepThree.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-public class CreateStepThree extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 7559888600474043337L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private JButton jButtonNext = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonPrevious = null;
-
- private JLabel jLabel = null;
-
- private ICheckBoxList jComboBoxFileFilter = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabel1 = null;
-
- private JTextField jTextField = null;
-
- Vector<String> v = new Vector<String>();
-
- private CreateStepTwo stepTwo = null;
-
- private CreateStepFour stepFour = null;
-
- public CreateStepThree(IDialog iDialog, boolean modal, CreateStepTwo stepTwo) {
- this(iDialog, modal);
- this.stepTwo = stepTwo;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Add additional file filter regular expressions in the text field, separated by space characters.\n");
- jTextArea.append("Note, for additional information about regular expressions, please reference PERL language regular expressions.");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxFileFilter() {
- if (jComboBoxFileFilter == null) {
- jComboBoxFileFilter = new ICheckBoxList();
- v.addElement(".svn");
- v.addElement("CVS");
- jComboBoxFileFilter.setAllItems(v);
- jComboBoxFileFilter.initCheckedItem(true, v);
- }
- return jComboBoxFileFilter;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 85, 640, 130));
- jScrollPane.setViewportView(getJComboBoxFileFilter());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextField() {
- if (jTextField == null) {
- jTextField = new JTextField();
- jTextField.setBounds(new java.awt.Rectangle(30, 250, 640, 20));
- }
- return jTextField;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepThree(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_THREE_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 220, 260, 20));
- jLabel1.setText("Input File Filter Pattern (regular expressions)");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 64, 160, 20));
- jLabel.setText("File Filter Pattern: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJTextField(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
-
- if (stepFour == null) {
- stepFour = new CreateStepFour(this, true, this);
- }
-
- this.setVisible(false);
- stepFour.setVisible(true);
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepTwo.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public Set<String> getFileFilter() {
- Set<String> result = new LinkedHashSet<String>();
- Vector<Integer> selected = jComboBoxFileFilter.getAllCheckedItemsIndex();
-
- Iterator<Integer> iter = selected.iterator();
-
- while (iter.hasNext()) {
- result.add(v.get(iter.next().intValue()));
- }
-
- String[] userdefined = jTextField.getText().split(" ");
-
- for (int i = 0; i < userdefined.length; i++) {
- if (!userdefined[i].trim().equalsIgnoreCase("")) {
- result.add(userdefined[i]);
- }
- }
-
- return result;
- }
-
- public CreateStepTwo getPreviousStep() {
- return stepTwo;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java
deleted file mode 100644
index a2e3500c3a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/createui/CreateStepTwo.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.createui;
-
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class CreateStepTwo extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 3003841865197005528L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel1 = null;
-
- private ICheckBoxList jComboBoxPackage = null;
-
- private ICheckBoxList jComboBoxPlatform = null;
-
- private JButton jButtonNext = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPanePackage = null;
-
- private JScrollPane jScrollPanePlatform = null;
-
- private CreateStepThree stepThree = null;
-
- private Vector<PlatformIdentification> platformVector = null;
-
- private Vector<PackageIdentification> packageVector = null;
-
- private CreateStepOne stepOne = null;
-
- private JButton jButtonPrevious = null;
-
- public CreateStepTwo(IDialog iDialog, boolean modal, CreateStepOne stepOne) {
- this(iDialog, modal);
- this.stepOne = stepOne;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Choose at least one package or platform. ");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxPackage() {
- if (jComboBoxPackage == null) {
- jComboBoxPackage = new ICheckBoxList();
- WorkspaceTools wt = new WorkspaceTools();
- Vector<String> v = new Vector<String>();
- packageVector = wt.getAllPackages();
- Iterator<PackageIdentification> iter = packageVector.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- String str = item.getName() + " " + item.getVersion() + " [" + item.getPath() + "]";
- v.addElement(str);
- }
- jComboBoxPackage.setAllItems(v);
- }
- return jComboBoxPackage;
- }
-
- /**
- * This method initializes jComboBox1
- *
- * @return javax.swing.JComboBox
- */
- private ICheckBoxList getJComboBoxPlatform() {
- if (jComboBoxPlatform == null) {
- jComboBoxPlatform = new ICheckBoxList();
- WorkspaceTools wt = new WorkspaceTools();
- Vector<String> v = new Vector<String>();
- platformVector = wt.getAllPlatforms();
- Iterator<PlatformIdentification> iter = platformVector.iterator();
- while (iter.hasNext()) {
- PlatformIdentification item = iter.next();
- String str = item.getName() + " " + item.getVersion() + " [" + item.getPath() + "]";
- v.addElement(str);
- }
- jComboBoxPlatform.setAllItems(v);
- }
- return jComboBoxPlatform;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePackage() {
- if (jScrollPanePackage == null) {
- jScrollPanePackage = new JScrollPane();
- jScrollPanePackage.setBounds(new java.awt.Rectangle(140,65,535,130));
- jScrollPanePackage.setViewportView(getJComboBoxPackage());
- }
- return jScrollPanePackage;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePlatform() {
- if (jScrollPanePlatform == null) {
- jScrollPanePlatform = new JScrollPane();
- jScrollPanePlatform.setBounds(new java.awt.Rectangle(140,200,535,110));
- jScrollPanePlatform.setViewportView(getJComboBoxPlatform());
- }
- return jScrollPanePlatform;
- }
-
- /**
- * This is the default constructor
- */
- public CreateStepTwo(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.CREATE_STEP_TWO_TITLE);
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 200, 100, 20));
- jLabel1.setText("Platforms: ");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 64, 100, 20));
- jLabel.setText("Packages:");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJScrollPanePackage(), null);
- jContentPane.add(getJScrollPanePlatform(), null);
- jContentPane.add(getJButtonPrevious(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepOne.setVisible(true);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
- if (jComboBoxPlatform.getAllCheckedItemsIndex().size() == 0
- && jComboBoxPackage.getAllCheckedItemsIndex().size() == 0) {
- Log.wrn("Create far", "Choose at least one package and/or platform.");
- return;
- }
-
- //
- // If some packages a Repackage=false, give a warning message
- //
- List<PackageIdentification> selectedPackages = getSelectedPackages();
- WorkspaceTools wt = new WorkspaceTools();
- List<PackageIdentification> allRepackablePackages = wt.getAllRepackagablePackages();
-
- List<PackageIdentification> unRepackablePackages = new Vector<PackageIdentification>();
- String msg = "Following selected packages: \n";
- Iterator<PackageIdentification> iter = selectedPackages.iterator();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (!allRepackablePackages.contains(item)) {
- unRepackablePackages.add(item);
- msg += item.getName() + "\n";
- }
- }
- msg += "is un-Repackagable. Do you want to continue? ";
-
- if (unRepackablePackages.size() > 0) {
- if(JOptionPane.showConfirmDialog(this, msg, "Warning", JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) {
- return ;
- }
- }
-
- if (stepThree == null) {
- stepThree = new CreateStepThree(this, true, this);
- }
- this.setVisible(false);
- stepThree.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- public List<PackageIdentification> getSelectedPackages() {
- Vector<Integer> v = jComboBoxPackage.getAllCheckedItemsIndex();
- List<PackageIdentification> result = new ArrayList<PackageIdentification>();
- for (int i = 0; i < v.size(); i++) {
- result.add(packageVector.get(v.get(i).intValue()));
- }
- return result;
- }
-
- public List<PlatformIdentification> getSelectedPlatforms() {
- Vector<Integer> v = jComboBoxPlatform.getAllCheckedItemsIndex();
- List<PlatformIdentification> result = new ArrayList<PlatformIdentification>();
- for (int i = 0; i < v.size(); i++) {
- result.add(platformVector.get(v.get(i).intValue()));
- }
- return result;
- }
-
- public CreateStepOne getPreviousStep() {
- return stepOne;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java
deleted file mode 100644
index f5b68f4eae..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepOne.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.deleteui;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.ActionEvent;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.ImageIcon;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.far.AggregationOperation;
-import org.tianocore.frameworkwizard.far.FarIdentification;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.far.PackageQuery;
-import org.tianocore.frameworkwizard.far.PackageQueryInterface;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class DeleteStepOne extends IDialog implements ListSelectionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 636773964435618476L;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonNext = null;
-
- private JTextArea jTextAreaInstruction = null;
-
- private JLabel jLabel = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabel2 = null;
-
- private JLabel jLabel3 = null;
-
- private JScrollPane jScrollPane1 = null;
-
- private JScrollPane jScrollPane2 = null;
-
- private JList jListPlatform = null;
-
- private JList jListPackage = null;
-
- private JLabel jLabel4 = null;
-
- private JButton jButtonDetail = null;
-
- private JList jListFar = null;
-
- private JLabel jLabelImage = null;
-
- private Vector<FarIdentification> farVector = null;
-
- Vector<PackageIdentification> removePackages = null;
-
- Vector<PlatformIdentification> removePlatforms = null;
-
- private DeleteStepTwo stepTwo = null;
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.setEnabled(false);
- jButtonNext.addActionListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jTextArea1
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea1() {
- if (jTextAreaInstruction == null) {
- jTextAreaInstruction = new JTextArea();
- jTextAreaInstruction.setBounds(new java.awt.Rectangle(30, 7, 662, 50));
- jTextAreaInstruction.setText("Step 1: Select FAR to remove.\n");
- jTextAreaInstruction.setCaretColor(Color.RED);
- jTextAreaInstruction
- .append("After choosing the FAR, the packages and/or platforms that belong to the FAR will displayed.\n");
- jTextAreaInstruction.append("Icon \"OK\" or \"NO\" indicates whether the FAR can be safely removed.");
- jTextAreaInstruction.setEditable(false);
- }
- return jTextAreaInstruction;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(140, 65, 530, 100));
- jScrollPane.setViewportView(getJListFar());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane1() {
- if (jScrollPane1 == null) {
- jScrollPane1 = new JScrollPane();
- jScrollPane1.setBounds(new java.awt.Rectangle(30, 195, 300, 115));
- jScrollPane1.setViewportView(getJListPackage());
- }
- return jScrollPane1;
- }
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane2() {
- if (jScrollPane2 == null) {
- jScrollPane2 = new JScrollPane();
- jScrollPane2.setBounds(new java.awt.Rectangle(360, 195, 310, 115));
- jScrollPane2.setViewportView(getJListPlatform());
- }
- return jScrollPane2;
- }
-
- /**
- * This method initializes jList
- *
- * @return javax.swing.JList
- */
- private JList getJListPlatform() {
- if (jListPlatform == null) {
- jListPlatform = new JList();
- jListPlatform.setEnabled(false);
- }
- return jListPlatform;
- }
-
- /**
- * This method initializes jList1
- *
- * @return javax.swing.JList
- */
- private JList getJListPackage() {
- if (jListPackage == null) {
- jListPackage = new JList();
- jListPackage.setEnabled(false);
- }
- return jListPackage;
- }
-
- /**
- * This method initializes jButtonDetail
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDetail() {
- if (jButtonDetail == null) {
- jButtonDetail = new JButton();
- jButtonDetail.setBounds(new java.awt.Rectangle(367, 325, 69, 20));
- jButtonDetail.setText("Detail");
- jButtonDetail.setVisible(false);
- }
- return jButtonDetail;
- }
-
- /**
- * This method initializes jListFar
- *
- * @return javax.swing.JList
- */
- private JList getJListFar() {
- if (jListFar == null) {
- jListFar = new JList();
- WorkspaceTools wt = new WorkspaceTools();
- farVector = wt.getAllFars();
- jListFar.setListData(farVector);
- jListFar.addListSelectionListener(this);
- }
- return jListFar;
- }
-
- /**
- * This is the default constructor
- */
- public DeleteStepOne(IFrame iFrame, boolean modal) {
- super(iFrame, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.DELETE_STEP_ONE_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelImage = new JLabel();
- jLabelImage.setBounds(new java.awt.Rectangle(30, 319, 36, 36));
- jLabel4 = new JLabel();
- jLabel4.setBounds(new java.awt.Rectangle(71, 325, 320, 20));
- jLabel3 = new JLabel();
- jLabel3.setBounds(new java.awt.Rectangle(360, 170, 113, 20));
- jLabel3.setText("FAR's Platforms");
- jLabel2 = new JLabel();
- jLabel2.setBounds(new java.awt.Rectangle(30, 170, 113, 20));
- jLabel2.setText("FAR's Packages");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 65, 100, 20));
- jLabel.setText("Select one FAR: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJTextArea1(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(jLabel2, null);
- jContentPane.add(jLabel3, null);
- jContentPane.add(getJScrollPane1(), null);
- jContentPane.add(getJScrollPane2(), null);
- jContentPane.add(jLabel4, null);
- jContentPane.add(getJButtonDetail(), null);
- jContentPane.add(jLabelImage, null);
- }
- return jContentPane;
- }
-
- public void valueChanged(ListSelectionEvent e) {
- //
- // Add logic for FAR list value changed
- //
- if (e.getSource() == jListFar) {
- boolean flag = true;
- FarIdentification far = (FarIdentification) jListFar.getSelectedValue();
- WorkspaceTools wt = new WorkspaceTools();
-
- removePackages = wt.getPackagesByFar(far);
- jListPackage.setListData(removePackages);
- removePlatforms = wt.getPlatformsByFar(far);
- jListPlatform.setListData(removePlatforms);
-
- //
- // Get Dependencies Info for current FAR
- //
- List<PackageIdentification> allPackages = wt.getAllPackages();
-
- //
- // Remain packages
- //
- allPackages.removeAll(removePackages);
-
- Iterator<PackageIdentification> iter = allPackages.iterator();
-
- PackageQueryInterface pq = new PackageQuery();
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- List<PackageIdentification> list = pq.getPackageDependencies(item.getSpdFile());
- List<PackageIdentification> result = AggregationOperation.minus(list, allPackages);
- if (result.size() > 0) {
- if (AggregationOperation.intersection(result, removePackages).size() > 0) {
- flag = false;
- break;
- }
- }
- }
-
- if (flag) {
- jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/Yes.JPG")));
- jLabel4.setText("None of the remaining packages depend on this FAR. ");
- jButtonDetail.setVisible(false);
- jButtonNext.setEnabled(true);
- } else {
- jLabelImage.setIcon(new ImageIcon(getClass().getResource("/resources/images/No.JPG")));
- jLabel4.setText("Some of the remaining packages still depend on this FAR. ");
- // jButtonDetail.setVisible(true);
- jButtonNext.setEnabled(false);
- }
- }
- }
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
-
- if (stepTwo == null) {
- stepTwo = new DeleteStepTwo(this, true, this);
- }
- this.setVisible(false);
- stepTwo.setVisible(true);
- }
-
- }
-
- public FarIdentification getSelecedFar() {
- return (FarIdentification) jListFar.getSelectedValue();
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java
deleted file mode 100644
index 8d7e4e6fed..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/deleteui/DeleteStepTwo.java
+++ /dev/null
@@ -1,351 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.deleteui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JPanel;
-import javax.swing.JButton;
-import javax.swing.JTextArea;
-import javax.swing.JLabel;
-import javax.swing.JRadioButton;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.far.FarIdentification;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class DeleteStepTwo extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -1333748185798962746L;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonFinish = null;
-
- private JButton jButtonPrevious = null;
-
- private JTextArea jTextArea = null;
-
- private JLabel jLabel = null;
-
- private JRadioButton jRadioButton = null;
-
- private JRadioButton jRadioButton1 = null;
-
- private DeleteStepOne stepOne = null;
-
- public DeleteStepTwo(IDialog iDialog, boolean modal, DeleteStepOne stepOne) {
- this(iDialog, modal);
- this.stepOne = stepOne;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFinish() {
- if (jButtonFinish == null) {
- jButtonFinish = new JButton();
- jButtonFinish.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonFinish.setText("Finish");
- jButtonFinish.addMouseListener(this);
- }
- return jButtonFinish;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Step 2: Choose Delete Mode. \n");
- jTextArea.append("Mode 1 Only remove registation information from the WORKSPACE. \n");
- jTextArea.append("Mode 2 Also delete all files and directories from file system. ");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jRadioButton
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButton() {
- if (jRadioButton == null) {
- jRadioButton = new JRadioButton();
- jRadioButton.setBounds(new java.awt.Rectangle(40,100,440,20));
- jRadioButton.setSelected(true);
- jRadioButton.setText("Mode 1: Only remove registration information from the WORKSPACE.");
- }
- return jRadioButton;
- }
-
- /**
- * This method initializes jRadioButton1
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButton1() {
- if (jRadioButton1 == null) {
- jRadioButton1 = new JRadioButton();
- jRadioButton1.setBounds(new java.awt.Rectangle(40,140,440,20));
- jRadioButton1.setText("Mode 2: Delete ALL related files and directories from the WORKSPACE.");
- }
- return jRadioButton1;
- }
-
- /**
- * This is the default constructor
- */
- public DeleteStepTwo(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.DELETE_STEP_TWO_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 70, 200, 20));
- jLabel.setText("Select delete mode: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonFinish(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- ButtonGroup group = new ButtonGroup();
- group.add(getJRadioButton());
- group.add(getJRadioButton1());
- jContentPane.add(getJRadioButton(), null);
- jContentPane.add(getJRadioButton1(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- this.dispose();
- } else if (e.getSource() == jButtonFinish) {
- FarIdentification far = stepOne.getSelecedFar();
- WorkspaceTools wt = new WorkspaceTools();
- //
- // If remove all source files
- //
- if (jRadioButton1.isSelected()) {
-
- Vector<PackageIdentification> removePackages = wt.getPackagesByFar(far);
- Vector<PlatformIdentification> removePlatforms = wt.getPlatformsByFar(far);
-
- Vector<PlatformIdentification> allPlatforms = wt.getAllPlatforms();
- Set<File> allPlatformFiles = new LinkedHashSet<File>();
-
- Iterator<PlatformIdentification> iter = allPlatforms.iterator();
- while (iter.hasNext()) {
- allPlatformFiles.add(iter.next().getFpdFile());
- }
-
- //
- // For all platforms, only remove its FPD file
- //
- Iterator<PlatformIdentification> platfomrIter = removePlatforms.iterator();
- while (platfomrIter.hasNext()) {
- PlatformIdentification item = platfomrIter.next();
- allPlatformFiles.remove(item.getFpdFile());
- File parentDir = item.getFpdFile().getParentFile();
- item.getFpdFile().delete();
- //
- // Remove all empty parent dir
- //
- while (parentDir.listFiles().length == 0) {
- File tempFile = parentDir;
- parentDir = parentDir.getParentFile();
- tempFile.delete();
- }
- }
-
- //
- // For all packages, remove all files.
- // Exception FPD file still in DB
- //
-
- Iterator<PackageIdentification> packageIter = removePackages.iterator();
- while (packageIter.hasNext()) {
- PackageIdentification item = packageIter.next();
- Set<File> deleteFiles = new LinkedHashSet<File>();
- recursiveDir(deleteFiles, item.getSpdFile().getParentFile(), allPlatformFiles);
- Iterator<File> iterDeleteFile = deleteFiles.iterator();
- while (iterDeleteFile.hasNext()) {
- deleteFiles(iterDeleteFile.next());
- }
- //
- // Remove all empty parent dir
- //
- File parentDir = item.getSpdFile().getParentFile();
- while (parentDir.listFiles().length == 0) {
- File tempFile = parentDir;
- parentDir = parentDir.getParentFile();
- tempFile.delete();
- }
- }
- }
-
- //
- // Update DB file
- //
- wt.removeFarFromDb(far);
-
- this.setVisible(false);
- this.stepOne.returnType = DataType.RETURN_TYPE_OK;
- this.dispose();
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepOne.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- private void recursiveDir(Set<File> files, File dir, Set<File> platformFiles) {
- File[] fileList = dir.listFiles();
- for (int i = 0; i < fileList.length; i++) {
- if (fileList[i].isFile()) {
- if (!platformFiles.contains(fileList[i])) {
- files.add(fileList[i]);
- }
- } else {
- if (isContain(fileList[i], platformFiles)) {
- recursiveDir(files, fileList[i], platformFiles);
- } else {
- files.add(fileList[i]);
- }
- }
- }
- }
-
- private void deleteFiles(File file) {
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- for (int i = 0; i < files.length; i++) {
- deleteFiles(files[i]);
- }
- }
- file.delete();
- }
-
- private boolean isContain(File dir, Set<File> platformFiles) {
- Iterator<File> iter = platformFiles.iterator();
- while (iter.hasNext()) {
- File file = iter.next();
- if (file.getPath().startsWith(dir.getPath())) {
- //
- // continue this FPD file
- //
- return true;
- }
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java
deleted file mode 100644
index 24cd1369ea..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepOne.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.installui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.List;
-import java.util.jar.JarFile;
-import java.util.Iterator;
-
-import javax.swing.JFileChooser;
-import javax.swing.JPanel;
-import javax.swing.JButton;
-import javax.swing.JTextArea;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import javax.swing.ListSelectionModel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.far.DistributeRule;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.table.DefaultTableModel;
-
-public class InstallStepOne extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -8821906198791949544L;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonNext = null;
-
- private JTextArea jTextArea = null;
-
- private JLabel jLabel = null;
-
- private JTextField jTextFieldFarFile = null;
-
- private JButton jButtonBrowser = null;
-
- private InstallStepTwo stepTwo = null;
-
- Far far = null;
-
- private JLabel jLabelWarning = null;
-
- private JScrollPane jScrollPane = null;
-
- private JTable jTable = null;
-
- private PartialTableModel model = null;
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Step 1: Choose a framework archive(FAR) file. \n");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFarFile() {
- if (jTextFieldFarFile == null) {
- jTextFieldFarFile = new JTextField();
- jTextFieldFarFile.setBounds(new java.awt.Rectangle(140, 80, 423, 20));
- }
- return jTextFieldFarFile;
- }
-
- /**
- * This method initializes jButtonBrowser
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrowser() {
- if (jButtonBrowser == null) {
- jButtonBrowser = new JButton();
- jButtonBrowser.setBounds(new java.awt.Rectangle(570, 80, 100, 20));
- jButtonBrowser.setText("Browser...");
- jButtonBrowser.addMouseListener(this);
- }
- return jButtonBrowser;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 165, 642, 140));
- jScrollPane.setViewportView(getJTable());
- }
- jScrollPane.setVisible(false);
- return jScrollPane;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new PartialTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- model.addColumn("Name");
- model.addColumn("Version");
- model.addColumn("GUID");
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- }
- jTable.setVisible(false);
- return jTable;
- }
-
- public void prepareTable(List<PackageIdentification> packageList) {
- model.setRowCount(0);
- //
- // Change here to get packages and platforms from FAR
- //
- Iterator<PackageIdentification> iter = packageList.iterator();
- while (iter.hasNext()) {
- String[] str = new String[3];
- PackageIdentification item = iter.next();
- str[0] = item.getName();
- str[1] = item.getVersion();
- str[2] = item.getGuid();
- model.addRow(str);
- }
- }
-
- /**
- * This is the default constructor
- */
- public InstallStepOne(IFrame iFrame, boolean modal) {
- super(iFrame, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.INSTALL_STEP_ONE_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelWarning = new JLabel();
- jLabelWarning.setBounds(new java.awt.Rectangle(30, 125, 510, 20));
- jLabelWarning.setText("Cannot install this FAR, the WORKSPACE is missing the following required packages.");
- jLabelWarning.setVisible(false);
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 80, 97, 20));
- jLabel.setText("Choose FAR file: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJTextFieldFarFile(), null);
- jContentPane.add(getJButtonBrowser(), null);
- jContentPane.add(jLabelWarning, null);
- jContentPane.add(getJScrollPane(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Add some logic process here
- //
- File farFile = new File(jTextFieldFarFile.getText());
- if (!farFile.exists() || !farFile.isFile()) {
- Log.wrn("Install far", "Please choose an existing FAR file.");
- return;
- }
-
- //
- // Verify Far
- //
- JarFile jarFar;
- try {
- jarFar = new JarFile(farFile);
- far = new Far(jarFar);
-
- //
- // Far dependency check
- //
- List<PackageIdentification> pkgIdList = DistributeRule.installFarCheck(far);
-
- if (pkgIdList.size() > 0) {
- prepareTable(pkgIdList);
- jLabelWarning.setVisible(true);
- jTable.setVisible(true);
- jScrollPane.setVisible(true);
- return;
- }
-
- } catch (Exception exp) {
- Log.wrn("Install far" + exp.getMessage());
- Log.err("Install far" + exp.getMessage());
- }
-
- if (stepTwo == null) {
- stepTwo = new InstallStepTwo(this, true, this);
- }
- this.setVisible(false);
-
- //
- // Refresh table
- //
- stepTwo.preparePackageTable();
- stepTwo.preparePlatformTable();
- stepTwo.setVisible(true);
- } else if (e.getSource() == jButtonBrowser) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
-
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- jLabelWarning.setVisible(false);
- jTable.setVisible(false);
- jScrollPane.setVisible(false);
- this.jTextFieldFarFile.setText(Tools.addPathExt(fc.getSelectedFile().getPath(),
- DataType.RETURN_TYPE_FAR_SURFACE_AREA));
- }
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public Far getFar() {
- return far;
- }
-
-}
-
-class PartialTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
- switch (col) {
- default:
- return false;
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java
deleted file mode 100644
index 68d286cdf5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/installui/InstallStepTwo.java
+++ /dev/null
@@ -1,483 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.installui;
-
-import java.awt.Color;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.ListSelectionModel;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.JTable;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class InstallStepTwo extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 4583090421587036969L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private PartialEditableTableModel packageModel = null;
-
- private PartialEditableTableModel platformModel = null;
-
- private InstallStepOne stepOne = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonFinish = null;
-
- private JButton jButtonPrevious = null;
-
- private JLabel jLabel = null;
-
- private JScrollPane jScrollPane = null;
-
- private JTable jTablePackage = null;
-
- private JLabel jLabel1 = null;
-
- private JScrollPane jScrollPane1 = null;
-
- private JTable jTablePlatform = null;
-
- List<PlatformIdentification> platformVector = null;
-
- List<PackageIdentification> packageVector = null;
-
- public InstallStepTwo(IDialog iDialog, boolean modal, InstallStepOne stepOne) {
- this(iDialog, modal);
- this.stepOne = stepOne;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Step 2: Set Install Path for Packages and/or Platforms.\n");
- jTextArea.setCaretColor(Color.RED);
- jTextArea.append("Note that the Install Path is Relative to WORKSPACE. ");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFinish() {
- if (jButtonFinish == null) {
- jButtonFinish = new JButton();
- jButtonFinish.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonFinish.setText("Finish");
- jButtonFinish.addMouseListener(this);
- }
- return jButtonFinish;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 80, 642, 110));
- jScrollPane.setViewportView(getJTablePackage());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTablePackage() {
- if (jTablePackage == null) {
- jTablePackage = new JTable();
- packageModel = new PartialEditableTableModel();
- jTablePackage = new JTable(packageModel);
- jTablePackage.setRowHeight(20);
- jTablePackage.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- packageModel.addColumn("Name");
- packageModel.addColumn("Version");
- packageModel.addColumn("Default Path");
- packageModel.addColumn("Install To");
-
- jTablePackage.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- }
- return jTablePackage;
- }
-
- public void preparePackageTable() {
- packageModel.setRowCount(0);
- //
- // Change here to get packages and platforms from FAR
- //
- try {
- Far far = stepOne.getFar();
-
- packageVector = far.manifest.getPackageList();
- Iterator<PackageIdentification> iter = packageVector.iterator();
- while (iter.hasNext()) {
- String[] str = new String[4];
- PackageIdentification item = iter.next();
- str[0] = item.getName();
- str[1] = item.getVersion();
- str[2] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
- str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
- packageModel.addRow(str);
- }
- } catch (Exception e) {
- }
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane1() {
- if (jScrollPane1 == null) {
- jScrollPane1 = new JScrollPane();
- jScrollPane1.setBounds(new java.awt.Rectangle(30, 215, 642, 110));
- jScrollPane1.setViewportView(getJTablePlatform());
- }
- return jScrollPane1;
- }
-
- /**
- * This method initializes jTablePlatform
- *
- * @return javax.swing.JTable
- */
- private JTable getJTablePlatform() {
- if (jTablePlatform == null) {
- jTablePlatform = new JTable();
- platformModel = new PartialEditableTableModel();
- jTablePlatform = new JTable(platformModel);
- jTablePlatform.setRowHeight(20);
- jTablePlatform.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- platformModel.addColumn("Name");
- platformModel.addColumn("Version");
- platformModel.addColumn("Default Path");
- platformModel.addColumn("Install To");
-
- jTablePlatform.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- preparePlatformTable();
- }
- return jTablePlatform;
- }
-
- public void preparePlatformTable() {
- platformModel.setRowCount(0);
- //
- // Change here to get packages and platforms from FAR
- //
- try {
- Far far = stepOne.getFar();
-
- platformVector = far.manifest.getPlatformList();
- Iterator<PlatformIdentification> iter = platformVector.iterator();
- while (iter.hasNext()) {
- String[] str = new String[4];
- PlatformIdentification item = iter.next();
- str[0] = item.getName();
- str[1] = item.getVersion();
- str[2] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
- str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
- platformModel.addRow(str);
- }
- } catch (Exception e) {
- }
- }
-
- /**
- * This is the default constructor
- */
- public InstallStepTwo(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.INSTALL_STEP_TWO_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 195, 348, 18));
- jLabel1.setText("Edit \"Install To\" paths for platforms: ");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(29, 60, 366, 20));
- jLabel.setText("Edit \"Install To\" paths for packages");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonFinish(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJScrollPane1(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- this.dispose();
- } else if (e.getSource() == jButtonFinish) {
-
- if (jTablePackage.isEditing()) {
- jTablePackage.getCellEditor().stopCellEditing();
- }
-
- if (jTablePlatform.isEditing()) {
- jTablePlatform.getCellEditor().stopCellEditing();
- }
-
- List<String> packageList = new ArrayList<String>();
- List<String> platformList = new ArrayList<String>();
- //
- // Add some logic process here
- // Guid Check, File Check etc.
- //
- Set<File> allNewPath = new LinkedHashSet<File>();
- Map<PackageIdentification, File> packageMap = new LinkedHashMap<PackageIdentification, File>();
- for (int i = 0; i < packageModel.getRowCount(); i++) {
- File toFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar
- + packageModel.getValueAt(i, 3));
- if (!isPackagePathValid(toFile)) {
- Log.wrn("Install far", packageVector.get(i) + " path already contains a package.");
- return;
- }
- if (allNewPath.contains(toFile)) {
- Log.wrn("Install far", "Path " + packageModel.getValueAt(i, 3) + " is specified twice.");
- return;
- }
- allNewPath.add(toFile);
- File spdFile = new File((String) packageModel.getValueAt(i, 3) + File.separatorChar
- + packageVector.get(i).getSpdFile().getName());
- packageList.add(spdFile.getPath());
- packageMap.put(packageVector.get(i), toFile);
- }
-
- Map<PlatformIdentification, File> platformMap = new LinkedHashMap<PlatformIdentification, File>();
- for (int i = 0; i < platformModel.getRowCount(); i++) {
- File toFile = new File(Workspace.getCurrentWorkspace() + File.separatorChar
- + platformModel.getValueAt(i, 3));
- if (!isPlatformPathValid(toFile)) {
- Log.wrn("Install far", platformVector.get(i) + " path already contains a platform.");
- return;
- }
- File fpdFile = new File((String) platformModel.getValueAt(i, 3) + File.separatorChar
- + platformVector.get(i).getFpdFile().getName());
- platformList.add(fpdFile.getPath());
- platformMap.put(platformVector.get(i), toFile);
- }
-
- //
- //
- //
- Far far = stepOne.getFar();
- try {
- far.InstallFar(platformMap, packageMap);
- //
- // Add to database
- //
- WorkspaceTools wt = new WorkspaceTools();
- wt.addFarToDb(packageList, platformList, far.manifest.getHeader());
- } catch (Exception ex) {
- Log.wrn("Install far", ex.getMessage());
- Log.err("Install far", ex.getMessage());
- return;
- }
-
- this.setVisible(false);
- this.stepOne.returnType = DataType.RETURN_TYPE_OK;
- this.dispose();
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepOne.setVisible(true);
- }
- }
-
- private boolean isPackagePathValid(File spdFile) {
- WorkspaceTools wt = new WorkspaceTools();
- List<PackageIdentification> allPackages = wt.getAllPackages();
- Iterator<PackageIdentification> iter = allPackages.iterator();
-
- while (iter.hasNext()) {
- PackageIdentification item = iter.next();
- if (isPathContainMutual(spdFile, item.getSpdFile())) {
- return false;
- }
- }
- return true;
- }
-
- private boolean isPlatformPathValid(File fpdFile) {
- WorkspaceTools wt = new WorkspaceTools();
- List<PlatformIdentification> allPlatforms = wt.getAllPlatforms();
- Iterator<PlatformIdentification> iter = allPlatforms.iterator();
-
- while (iter.hasNext()) {
- PlatformIdentification item = iter.next();
- if (isPathContainMutual(fpdFile, item.getFpdFile())) {
- return false;
- }
- }
- return true;
- }
-
- private boolean isPathContainMutual(File path1, File path2) {
- String s1 = Tools.addFileSeparator(path1.getPath());
- String s2 = Tools.addFileSeparator(path2.getParent());
-
- if (s1.length() > s2.length()) {
- if (s1.substring(0, s2.length()).equalsIgnoreCase(s2)) {
- return true;
- }
- } else {
- if (s2.substring(0, s1.length()).equalsIgnoreCase(s1)) {
- return true;
- }
- }
- return false;
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
-}
-
-class PartialEditableTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
- switch (col) {
- case 3:
- return true;
- default:
- return false;
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java
deleted file mode 100644
index 5ae496672a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepOne.java
+++ /dev/null
@@ -1,315 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.updateui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.Vector;
-import java.util.jar.JarFile;
-
-import javax.swing.JFileChooser;
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IFileFilter;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarIdentification;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-import javax.swing.JScrollPane;
-import javax.swing.JList;
-
-public class UpdateStepOne extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 735554907464539931L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonNext = null;
-
- private JLabel jLabel = null;
-
- private JTextField jTextFieldFarFile = null;
-
- private JButton jButtonBrowser = null;
-
- private UpdateStepTwo stepTwo = null;
-
- private Far far = null;
-
- private Vector<FarIdentification> farVector = null;
-
- private JLabel jLabel1 = null;
-
- private JScrollPane jScrollPane = null;
-
- private JList jListFarFromDb = null;
-
- private File farFile = null;
-
- public File getFarFile() {
- return farFile;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Step 1: Choose framework archive (FAR) file. \n");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonNext
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNext() {
- if (jButtonNext == null) {
- jButtonNext = new JButton();
- jButtonNext.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonNext.setText("Next");
- jButtonNext.addMouseListener(this);
- }
- return jButtonNext;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFarFile() {
- if (jTextFieldFarFile == null) {
- jTextFieldFarFile = new JTextField();
- jTextFieldFarFile.setBounds(new java.awt.Rectangle(130, 80, 436, 20));
- }
- return jTextFieldFarFile;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrowser() {
- if (jButtonBrowser == null) {
- jButtonBrowser = new JButton();
- jButtonBrowser.setBounds(new java.awt.Rectangle(570, 80, 100, 20));
- jButtonBrowser.setText("Browser...");
- jButtonBrowser.addMouseListener(this);
- }
- return jButtonBrowser;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 135, 642, 160));
- jScrollPane.setViewportView(getJListFarFromDb());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jListFarFromDb
- *
- * @return javax.swing.JList
- */
- private JList getJListFarFromDb() {
- if (jListFarFromDb == null) {
- jListFarFromDb = new JList();
- WorkspaceTools wt = new WorkspaceTools();
- farVector = wt.getAllFars();
- jListFarFromDb.setListData(farVector);
- jListFarFromDb.setSelectionMode(0);
- }
- return jListFarFromDb;
- }
-
- /**
- * This is the default constructor
- */
- public UpdateStepOne(IFrame iFrame, boolean modal) {
- super(iFrame, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.UPDATE_STEP_ONE_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(30, 110, 355, 18));
- jLabel1.setText("Choose FAR from current WORKSPACE.");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 80, 97, 20));
- jLabel.setText("Choose FAR file: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonNext(), null);
- jContentPane.add(jLabel, null);
- jContentPane.add(getJTextFieldFarFile(), null);
- jContentPane.add(getJButtonBrowser(), null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJScrollPane(), null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonNext) {
- //
- // Judge if FAR file is existed
- //
- farFile = new File(jTextFieldFarFile.getText());
- if (!farFile.exists() || !farFile.isFile()) {
- Log.wrn("Update far", "Please choose a FAR file that already exists.");
- return;
- }
-
- //
- // Judge FAR is valid
- //
- try {
- JarFile file = new JarFile(farFile);
- this.far = new Far(file);
- } catch (Exception ex) {
- Log.wrn("Update far", ex.getMessage());
- Log.err("Update far", ex.getMessage());
- }
-
- //
- // Add more logic process here
- //
- if (jListFarFromDb.getSelectedValue() == null) {
- Log.wrn("Update far", "Please choose a FAR from current WORKSPACE.");
- return;
- }
-
- if (stepTwo == null) {
- stepTwo = new UpdateStepTwo(this, true, this);
- }
- this.setVisible(false);
- stepTwo.prepareTable();
- stepTwo.setVisible(true);
- } else if (e.getSource() == jButtonBrowser) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- fc.addChoosableFileFilter(new IFileFilter(DataType.FAR_SURFACE_AREA_EXT));
- fc.setCurrentDirectory(new File(Workspace.getCurrentWorkspace()));
-
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldFarFile.setText(Tools.addPathExt(fc.getSelectedFile().getPath(),
- DataType.RETURN_TYPE_FAR_SURFACE_AREA));
- }
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public FarIdentification getSelecedDbFar() {
- return (FarIdentification) jListFarFromDb.getSelectedValue();
- }
-
- public Far getFar() {
- return far;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java
deleted file mode 100644
index 6785803453..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/far/updateui/UpdateStepTwo.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/** @file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.far.updateui;
-
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JPanel;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.JScrollPane;
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.table.DefaultTableModel;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.far.AggregationOperation;
-import org.tianocore.frameworkwizard.far.DistributeRule;
-import org.tianocore.frameworkwizard.far.Far;
-import org.tianocore.frameworkwizard.far.FarStringDefinition;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-public class UpdateStepTwo extends IDialog implements MouseListener {
-
- /**
- *
- */
- private static final long serialVersionUID = -4400145363721213110L;
-
- private JPanel jContentPane = null;
-
- private JTextArea jTextArea = null;
-
- private UpdateStepOne stepOne = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonFinish = null;
-
- private JButton jButtonPrevious = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabel = null;
-
- private JTable jTablePackage = null;
-
- private PartialTableModel model = null;
-
- List<PackageIdentification> updatPkgList = new ArrayList<PackageIdentification>();
-
- public UpdateStepTwo(IDialog iDialog, boolean modal, UpdateStepOne stepOne) {
- this(iDialog, modal);
- this.stepOne = stepOne;
- }
-
- /**
- * This method initializes jTextArea
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
- jTextArea.setBounds(new java.awt.Rectangle(30, 7, 642, 50));
- jTextArea.setText("Step 2: Summary. \n");
- jTextArea.setEditable(false);
- }
- return jTextArea;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(570, 330, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addMouseListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonFinish
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFinish() {
- if (jButtonFinish == null) {
- jButtonFinish = new JButton();
- jButtonFinish.setBounds(new java.awt.Rectangle(470, 330, 90, 20));
- jButtonFinish.setText("Finish");
- jButtonFinish.addMouseListener(this);
- }
- return jButtonFinish;
- }
-
- /**
- * This method initializes jButtonPrevious
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonPrevious() {
- if (jButtonPrevious == null) {
- jButtonPrevious = new JButton();
- jButtonPrevious.setBounds(new java.awt.Rectangle(370, 330, 90, 20));
- jButtonPrevious.setText("Previous");
- jButtonPrevious.addMouseListener(this);
- }
- return jButtonPrevious;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(30, 100, 642, 170));
- jScrollPane.setViewportView(getJTablePackage());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTablePackage
- *
- * @return javax.swing.JTable
- */
- private JTable getJTablePackage() {
- if (jTablePackage == null) {
- jTablePackage = new JTable();
- model = new PartialTableModel();
- jTablePackage = new JTable(model);
- jTablePackage.setRowHeight(20);
- jTablePackage.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- model.addColumn("Name");
- model.addColumn("Version");
- model.addColumn("Guid");
- model.addColumn("Path");
-
- jTablePackage.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- }
- return jTablePackage;
- }
-
- public void prepareTable() {
- model.setRowCount(0);
- try {
- Far far = stepOne.getFar();
- List<PackageIdentification> packagesInFar = far.manifest.getPackageList();
-
- WorkspaceTools wt = new WorkspaceTools();
- List<PackageIdentification> packagesInDb = wt.getAllPackages();
-
- updatPkgList = AggregationOperation.intersection(packagesInDb, packagesInFar);
- //
- // Change here to get packages and platforms from FAR
- //
- Iterator<PackageIdentification> iter = updatPkgList.iterator();//packageList.iterator();
- while (iter.hasNext()) {
- String[] str = new String[4];
- PackageIdentification item = iter.next();
- str[0] = item.getName();
- str[1] = item.getVersion();
- str[2] = item.getGuid();
- str[3] = Tools.getFilePathOnly(Tools.getRelativePath(item.getPath(), Workspace.getCurrentWorkspace()));
- model.addRow(str);
- }
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * This is the default constructor
- */
- public UpdateStepTwo(IDialog iDialog, boolean modal) {
- super(iDialog, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(700, 400);
- this.setContentPane(getJContentPane());
- this.setTitle(FarStringDefinition.UPDATE_STEP_TWO_TITLE);
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - this.getSize().width) / 2, (d.height - this.getSize().height) / 2);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(30, 70, 281, 20));
- jLabel.setText("Following packages will be updated: ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(getJTextArea(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonFinish(), null);
- jContentPane.add(getJButtonPrevious(), null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(jLabel, null);
- }
- return jContentPane;
- }
-
- public void mouseClicked(MouseEvent e) {
- if (e.getSource() == jButtonCancel) {
- this.setVisible(false);
- } else if (e.getSource() == jButtonFinish) {
- //
- // Check depedency ?
- //
- WorkspaceTools wsTools = new WorkspaceTools();
-
- Iterator<PackageIdentification> iter = updatPkgList.iterator();
- List<PackageIdentification> depResultList = new ArrayList<PackageIdentification>();
- while (iter.hasNext()) {
- List<PackageIdentification> depPkgList = stepOne.getFar().getPackageDependencies(iter.next());
- depResultList = AggregationOperation.union(depResultList, depPkgList);
- }
-
- List<PackageIdentification> dbPkgList = DistributeRule.vectorToList(wsTools.getAllPackages());
- List<PackageIdentification> resultList = AggregationOperation
- .minus(
- depResultList,
- AggregationOperation
- .union(
- this.updatPkgList,
- dbPkgList));
- Iterator resultIter = resultList.iterator();
- while (resultIter.hasNext()) {
- Log.wrn("Update far", "Missing dependency package " + ((PackageIdentification) resultIter.next()).toString()
- + " in workspace!");
- return;
- }
-
- //
- // Remove all update packages
- //
- //
- // For all packages, remove all files.
- // Exception FPD file still in DB
- //
- Vector<PlatformIdentification> allPlatforms = wsTools.getAllPlatforms();
- Set<File> allPlatformFiles = new LinkedHashSet<File>();
-
- Iterator<PlatformIdentification> allPlfIter = allPlatforms.iterator();
- while (iter.hasNext()) {
- allPlatformFiles.add(allPlfIter.next().getFpdFile());
- }
-
- Iterator<PackageIdentification> packageIter = this.updatPkgList.iterator();
- while (packageIter.hasNext()) {
- PackageIdentification item = packageIter.next();
- Set<File> deleteFiles = new LinkedHashSet<File>();
- recursiveDir(deleteFiles, item.getSpdFile().getParentFile(), allPlatformFiles);
- Iterator<File> iterDeleteFile = deleteFiles.iterator();
- while (iterDeleteFile.hasNext()) {
- deleteFiles(iterDeleteFile.next());
- }
- //
- // Remove all empty parent dir
- //
- File parentDir = item.getSpdFile().getParentFile();
- while (parentDir.listFiles().length == 0) {
- File tempFile = parentDir;
- parentDir = parentDir.getParentFile();
- tempFile.delete();
- }
- }
-
- //
- // Install all update packages
- //
- Iterator<PackageIdentification> updataIter = this.updatPkgList.iterator();
- while (updataIter.hasNext()) {
- PackageIdentification pkgId = updataIter.next();
- try {
- stepOne.getFar().installPackage(pkgId, new File(pkgId.getSpdFile().getParent()));
- } catch (Exception ex) {
- Log.wrn("Install " + pkgId.toString(), ex.getMessage());
- Log.err("Install " + pkgId.toString(), ex.getMessage());
- }
-
- }
- this.stepOne.returnType = DataType.RETURN_TYPE_OK;
-
- this.setVisible(false);
- this.dispose();
- } else if (e.getSource() == jButtonPrevious) {
- this.setVisible(false);
- stepOne.setVisible(true);
- }
- }
-
- public void mousePressed(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseReleased(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseEntered(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- public void mouseExited(MouseEvent e) {
- // TODO Auto-generated method stub
-
- }
-
- private void recursiveDir(Set<File> files, File dir, Set<File> platformFiles) {
- File[] fileList = dir.listFiles();
- for (int i = 0; i < fileList.length; i++) {
- if (fileList[i].isFile()) {
- if (!platformFiles.contains(fileList[i])) {
- files.add(fileList[i]);
- }
- } else {
- if (isContain(fileList[i], platformFiles)) {
- recursiveDir(files, fileList[i], platformFiles);
- } else {
- files.add(fileList[i]);
- }
- }
- }
- }
-
- private void deleteFiles(File file) {
- if (file.isDirectory()) {
- File[] files = file.listFiles();
- for (int i = 0; i < files.length; i++) {
- deleteFiles(files[i]);
- }
- }
- file.delete();
- }
-
- private boolean isContain(File dir, Set<File> platformFiles) {
- Iterator<File> iter = platformFiles.iterator();
- while (iter.hasNext()) {
- File file = iter.next();
- if (file.getPath().startsWith(dir.getPath())) {
- //
- // continue this FPD file
- //
- return true;
- }
- }
- return false;
- }
-}
-
-class PartialTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
- switch (col) {
- case 3:
- return false;
- default:
- return false;
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java
deleted file mode 100644
index 3a81248926..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Boot Modes Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.BootModes;
-
-import java.util.Vector;
-
-public class BootModesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public BootModesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(BootModesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java
deleted file mode 100644
index 4c0840370f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BootModes/BootModesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Boot Modes Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.BootModes;
-
-import java.util.Vector;
-
-public class BootModesVector {
-
- private Vector<BootModesIdentification> vBootModes = new Vector<BootModesIdentification>();
-
- public int findBootModes(BootModesIdentification sfi) {
- for (int index = 0; index < vBootModes.size(); index++) {
- if (vBootModes.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findBootModes(String name) {
- for (int index = 0; index < vBootModes.size(); index++) {
- if (vBootModes.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public BootModesIdentification getBootModes(int index) {
- if (index > -1) {
- return vBootModes.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addBootModes(BootModesIdentification arg0) {
- vBootModes.addElement(arg0);
- }
-
- public void setBootModes(BootModesIdentification arg0, int arg1) {
- vBootModes.setElementAt(arg0, arg1);
- }
-
- public void removeBootModes(BootModesIdentification arg0) {
- int index = findBootModes(arg0);
- if (index > -1) {
- vBootModes.removeElementAt(index);
- }
- }
-
- public void removeBootModes(int index) {
- if (index > -1 && index < this.size()) {
- vBootModes.removeElementAt(index);
- }
- }
-
- public Vector<BootModesIdentification> getvBootModes() {
- return vBootModes;
- }
-
- public void setvBootModes(Vector<BootModesIdentification> BootModes) {
- vBootModes = BootModes;
- }
-
- public Vector<String> getBootModesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vBootModes.size(); index++) {
- v.addElement(vBootModes.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vBootModes.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getBootModes(index).getName());
- v.addElement(getBootModes(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java
deleted file mode 100644
index 7074d3c7e0..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsIdentification.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file
-
- The file is used to define Build Options Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
-
-import java.util.Vector;
-
-public class BuildOptionsIdentification {
-
- //
- // Define class members
- //
- private String option = null;
-
- private Vector<String> buildTargets = null;
-
- private String toolChainFamily = null;
-
- private String tagName = null;
-
- private String toolCode = null;
-
- private Vector<String> supArchList = null;
-
- public BuildOptionsIdentification(String arg0, Vector<String> arg1, String arg2, String arg3, String arg4, Vector<String> arg5) {
- this.option = (arg0 == null ? "" : arg0);
- this.buildTargets = arg1;
- this.toolChainFamily = (arg2 == null ? "" : arg2);
- this.tagName = (arg3 == null ? "" : arg3);
- this.toolCode = (arg4 == null ? "" : arg4);
- this.supArchList = arg5;
- }
-
- public String getOption() {
- return option;
- }
-
- public void setOption(String option) {
- this.option = option;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getTagName() {
- return tagName;
- }
-
- public void setTagName(String tagName) {
- this.tagName = tagName;
- }
-
- public String getToolChainFamily() {
- return toolChainFamily;
- }
-
- public void setToolChainFamily(String toolChainFamily) {
- this.toolChainFamily = toolChainFamily;
- }
-
- public String getToolCode() {
- return toolCode;
- }
-
- public void setToolCode(String toolCode) {
- this.toolCode = toolCode;
- }
-
- public Vector<String> getBuildTargets() {
- return buildTargets;
- }
-
- public void setBuildTargets(Vector<String> buildTargets) {
- this.buildTargets = buildTargets;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java
deleted file mode 100644
index dcd1bff392..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/BuildOptions/BuildOptionsVector.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/** @file
-
- The file is used to define Build Options Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.BuildOptions;
-
-import java.util.Vector;
-
-public class BuildOptionsVector {
-
- private Vector<BuildOptionsIdentification> vBuildOptions = new Vector<BuildOptionsIdentification>();
-
- public int findBuildOptions(BuildOptionsIdentification sfi) {
- for (int index = 0; index < vBuildOptions.size(); index++) {
- if (vBuildOptions.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findBuildOptions(String name) {
- for (int index = 0; index < vBuildOptions.size(); index++) {
- if (vBuildOptions.elementAt(index).getOption().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public BuildOptionsIdentification getBuildOptions(int index) {
- if (index > -1) {
- return vBuildOptions.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addBuildOptions(BuildOptionsIdentification arg0) {
- vBuildOptions.addElement(arg0);
- }
-
- public void setBuildOptions(BuildOptionsIdentification arg0, int arg1) {
- vBuildOptions.setElementAt(arg0, arg1);
- }
-
- public void removeBuildOptions(BuildOptionsIdentification arg0) {
- int index = findBuildOptions(arg0);
- if (index > -1) {
- vBuildOptions.removeElementAt(index);
- }
- }
-
- public void removeBuildOptions(int index) {
- if (index > -1 && index < this.size()) {
- vBuildOptions.removeElementAt(index);
- }
- }
-
- public Vector<BuildOptionsIdentification> getvBuildOptions() {
- return vBuildOptions;
- }
-
- public void setvBuildOptions(Vector<BuildOptionsIdentification> BuildOptions) {
- vBuildOptions = BuildOptions;
- }
-
- public Vector<String> getBuildOptionsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vBuildOptions.size(); index++) {
- v.addElement(vBuildOptions.get(index).getOption());
- }
- return v;
- }
-
- public int size() {
- return this.vBuildOptions.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getBuildOptions(index).getOption());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java
deleted file mode 100644
index 2b5b362acb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.DataHubs;
-
-import java.util.Vector;
-
-public class DataHubsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public DataHubsIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(DataHubsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java
deleted file mode 100644
index 7405342c74..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/DataHubs/DataHubsVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.DataHubs;
-
-import java.util.Vector;
-
-public class DataHubsVector {
-
- private Vector<DataHubsIdentification> vDataHubs = new Vector<DataHubsIdentification>();
-
- public int findDataHubs(DataHubsIdentification sfi) {
- for (int index = 0; index < vDataHubs.size(); index++) {
- if (vDataHubs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findDataHubs(String name) {
- for (int index = 0; index < vDataHubs.size(); index++) {
- if (vDataHubs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public DataHubsIdentification getDataHubs(int index) {
- if (index > -1) {
- return vDataHubs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addDataHubs(DataHubsIdentification arg0) {
- vDataHubs.addElement(arg0);
- }
-
- public void setDataHubs(DataHubsIdentification arg0, int arg1) {
- vDataHubs.setElementAt(arg0, arg1);
- }
-
- public void removeDataHubs(DataHubsIdentification arg0) {
- int index = findDataHubs(arg0);
- if (index > -1) {
- vDataHubs.removeElementAt(index);
- }
- }
-
- public void removeDataHubs(int index) {
- if (index > -1 && index < this.size()) {
- vDataHubs.removeElementAt(index);
- }
- }
-
- public Vector<DataHubsIdentification> getvDataHubs() {
- return vDataHubs;
- }
-
- public void setvDataHubs(Vector<DataHubsIdentification> DataHubs) {
- vDataHubs = DataHubs;
- }
-
- public Vector<String> getDataHubsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vDataHubs.size(); index++) {
- v.addElement(vDataHubs.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vDataHubs.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getDataHubs(index).getName());
- v.addElement(getDataHubs(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
deleted file mode 100644
index bbb22e594a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsIdentification.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Events;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class EventsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private String group = null;
-
- public EventsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5, String arg6) {
- this.name = (arg0 == null ? "" : arg0);
- this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- this.group = (arg6 == null ? "" : arg6);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(EventsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getGroup() {
- return group;
- }
-
- public void setGroup(String group) {
- this.group = group;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java
deleted file mode 100644
index f64e184aa3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Events/EventsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Events;
-
-import java.util.Vector;
-
-public class EventsVector {
-
- private Vector<EventsIdentification> vEvents = new Vector<EventsIdentification>();
-
- public int findEvents(EventsIdentification sfi) {
- for (int index = 0; index < vEvents.size(); index++) {
- if (vEvents.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findEvents(String name) {
- for (int index = 0; index < vEvents.size(); index++) {
- if (vEvents.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public EventsIdentification getEvents(int index) {
- if (index > -1) {
- return vEvents.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addEvents(EventsIdentification arg0) {
- vEvents.addElement(arg0);
- }
-
- public void setEvents(EventsIdentification arg0, int arg1) {
- vEvents.setElementAt(arg0, arg1);
- }
-
- public void removeEvents(EventsIdentification arg0) {
- int index = findEvents(arg0);
- if (index > -1) {
- vEvents.removeElementAt(index);
- }
- }
-
- public void removeEvents(int index) {
- if (index > -1 && index < this.size()) {
- vEvents.removeElementAt(index);
- }
- }
-
- public Vector<EventsIdentification> getvEvents() {
- return vEvents;
- }
-
- public void setvEvents(Vector<EventsIdentification> Events) {
- vEvents = Events;
- }
-
- public Vector<String> getEventsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vEvents.size(); index++) {
- v.addElement(vEvents.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vEvents.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getEvents(index).getName());
- v.addElement(getEvents(index).getType());
- v.addElement(getEvents(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java
deleted file mode 100644
index 31979ceb88..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsIdentification.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Externs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.EnumerationData;
-
-public class ExternsIdentification {
-
- //
- // Define class members
- //
- private String name0 = null;
-
- private String name1 = null;
-
- private String name2 = null;
-
- private String name3 = null;
-
- private String type = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public ExternsIdentification(String arg0, String arg1) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- }
-
- public ExternsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.name1 = (arg1 == null ? "" : arg1);
- this.type = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- }
-
- public ExternsIdentification(String arg0, String arg1, String arg2, String arg3, String arg4, String arg5,
- Vector<String> arg6) {
- this.name0 = (arg0 == null ? "" : arg0);
- this.name1 = (arg1 == null ? "" : arg1);
- this.name2 = (arg2 == null ? "" : arg2);
- this.name3 = (arg3 == null ? "" : arg3);
- this.type = (arg4 == null ? "" : arg4);
- this.featureFlag = (arg5 == null ? "" : arg5);
- this.supArchList = arg6;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(ExternsIdentification pi) {
- if (this.type.equals(pi.type)) {
- if (this.type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (this.name0.equals(pi.name0)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_IMAGE)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1)) {
- return true;
- }
- }
- if (this.type.equals(EnumerationData.EXTERNS_DRIVER)) {
- if (this.name0.equals(pi.name0) && this.name1.equals(pi.name1) && this.name2.equals(pi.name2) && this.name3.equals(pi.name3)) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getName0() {
- return name0;
- }
-
- public void setName0(String name0) {
- this.name0 = name0;
- }
-
- public String getName1() {
- return name1;
- }
-
- public void setName1(String name1) {
- this.name1 = name1;
- }
-
- public String getName2() {
- return name2;
- }
-
- public void setName2(String name2) {
- this.name2 = name2;
- }
-
- public String getName3() {
- return name3;
- }
-
- public void setName3(String name3) {
- this.name3 = name3;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java
deleted file mode 100644
index dbc2035fa9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Externs/ExternsVector.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Externs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-
-public class ExternsVector {
-
- private Vector<ExternsIdentification> vExterns = new Vector<ExternsIdentification>();
-
- public int findExterns(ExternsIdentification sfi) {
- for (int index = 0; index < vExterns.size(); index++) {
- if (vExterns.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public ExternsIdentification getExterns(int index) {
- if (index > -1) {
- return vExterns.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addExterns(ExternsIdentification arg0) {
- vExterns.addElement(arg0);
- }
-
- public void setExterns(ExternsIdentification arg0, int arg1) {
- vExterns.setElementAt(arg0, arg1);
- }
-
- public void removeExterns(ExternsIdentification arg0) {
- int index = findExterns(arg0);
- if (index > -1) {
- vExterns.removeElementAt(index);
- }
- }
-
- public void removeExterns(int index) {
- if (index > -1 && index < this.size()) {
- vExterns.removeElementAt(index);
- }
- }
-
- public Vector<ExternsIdentification> getvExterns() {
- return vExterns;
- }
-
- public void setvExterns(Vector<ExternsIdentification> Externs) {
- vExterns = Externs;
- }
-
- public int size() {
- return this.vExterns.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
-
- //
- // For Specification
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- v.addElement(getExterns(index).getType());
- v.addElement(getExterns(index).getType() + " Name");
- v.addElement(getExterns(index).getName0());
- return v;
- }
-
- //
- // For Image
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_MODULE_ENTRY_POINT;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_MODULE_UNLOAD_IMAGE;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Library
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_CONSTRUCTOR;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DESTRUCTOR;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Driver
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_DRIVER_BINDING;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_COMPONENT_NAME;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DRIVER_CONFIG;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName2();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_DRIVER_DIAG;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName3()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // For Call Back
- //
- if (this.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- v.addElement(getExterns(index).getType());
- String name = "";
- String value = "";
-
- name = EnumerationData.EXTERNS_VIRTUAL_ADDRESS_MAP_CALL_BACK;
- value = this.getExterns(index).getName0();
- name = name + DataType.HTML_LINE_SEPARATOR + EnumerationData.EXTERNS_EXIT_BOOT_SERVICES_CALL_BACK;
- value = value + DataType.HTML_LINE_SEPARATOR + this.getExterns(index).getName1()
- + DataType.HTML_LINE_SEPARATOR;
-
- v.addElement("<html>" + name + "<html>");
- v.addElement("<html>" + value + "<html>");
- return v;
- }
-
- //
- // Return a empty v
- //
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java
deleted file mode 100644
index 4affae9797..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsIdentification.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Guids;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class GuidsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public GuidsIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(GuidsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java
deleted file mode 100644
index 6d415c3162..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Guids/GuidsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Guids;
-
-import java.util.Vector;
-
-public class GuidsVector {
-
- private Vector<GuidsIdentification> vGuids = new Vector<GuidsIdentification>();
-
- public int findGuids(GuidsIdentification sfi) {
- for (int index = 0; index < vGuids.size(); index++) {
- if (vGuids.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findGuids(String name) {
- for (int index = 0; index < vGuids.size(); index++) {
- if (vGuids.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public GuidsIdentification getGuids(int index) {
- if (index > -1) {
- return vGuids.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addGuids(GuidsIdentification arg0) {
- vGuids.addElement(arg0);
- }
-
- public void setGuids(GuidsIdentification arg0, int arg1) {
- vGuids.setElementAt(arg0, arg1);
- }
-
- public void removeGuids(GuidsIdentification arg0) {
- int index = findGuids(arg0);
- if (index > -1) {
- vGuids.removeElementAt(index);
- }
- }
-
- public void removeGuids(int index) {
- if (index > -1 && index < this.size()) {
- vGuids.removeElementAt(index);
- }
- }
-
- public Vector<GuidsIdentification> getvGuids() {
- return vGuids;
- }
-
- public void setvGuids(Vector<GuidsIdentification> Guids) {
- vGuids = Guids;
- }
-
- public Vector<String> getGuidsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vGuids.size(); index++) {
- v.addElement(vGuids.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vGuids.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getGuids(index).getName());
- v.addElement(getGuids(index).getUsage());
- return v;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java
deleted file mode 100644
index 4935d306b0..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.HiiPackages;
-
-import java.util.Vector;
-
-public class HiiPackagesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public HiiPackagesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(HiiPackagesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java
deleted file mode 100644
index f946c0c7e3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/HiiPackages/HiiPackagesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.HiiPackages;
-
-import java.util.Vector;
-
-public class HiiPackagesVector {
-
- private Vector<HiiPackagesIdentification> vHiiPackages = new Vector<HiiPackagesIdentification>();
-
- public int findHiiPackages(HiiPackagesIdentification sfi) {
- for (int index = 0; index < vHiiPackages.size(); index++) {
- if (vHiiPackages.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findHiiPackages(String name) {
- for (int index = 0; index < vHiiPackages.size(); index++) {
- if (vHiiPackages.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public HiiPackagesIdentification getHiiPackages(int index) {
- if (index > -1) {
- return vHiiPackages.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addHiiPackages(HiiPackagesIdentification arg0) {
- vHiiPackages.addElement(arg0);
- }
-
- public void setHiiPackages(HiiPackagesIdentification arg0, int arg1) {
- vHiiPackages.setElementAt(arg0, arg1);
- }
-
- public void removeHiiPackages(HiiPackagesIdentification arg0) {
- int index = findHiiPackages(arg0);
- if (index > -1) {
- vHiiPackages.removeElementAt(index);
- }
- }
-
- public void removeHiiPackages(int index) {
- if (index > -1 && index < this.size()) {
- vHiiPackages.removeElementAt(index);
- }
- }
-
- public Vector<HiiPackagesIdentification> getvHiiPackages() {
- return vHiiPackages;
- }
-
- public void setvHiiPackages(Vector<HiiPackagesIdentification> HiiPackages) {
- vHiiPackages = HiiPackages;
- }
-
- public Vector<String> getHiiPackagesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vHiiPackages.size(); index++) {
- v.addElement(vHiiPackages.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vHiiPackages.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getHiiPackages(index).getName());
- v.addElement(getHiiPackages(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java
deleted file mode 100644
index 7b9dadd15e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsIdentification.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Hobs;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class HobsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public HobsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.name = (this.name == DataType.EMPTY_SELECT_ITEM ? "" : this.name);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(HobsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java
deleted file mode 100644
index 550cb0aca1..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Hobs/HobsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Hobs;
-
-import java.util.Vector;
-
-public class HobsVector {
-
- private Vector<HobsIdentification> vHobs = new Vector<HobsIdentification>();
-
- public int findHobs(HobsIdentification sfi) {
- for (int index = 0; index < vHobs.size(); index++) {
- if (vHobs.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findHobs(String name) {
- for (int index = 0; index < vHobs.size(); index++) {
- if (vHobs.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public HobsIdentification getHobs(int index) {
- if (index > -1) {
- return vHobs.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addHobs(HobsIdentification arg0) {
- vHobs.addElement(arg0);
- }
-
- public void setHobs(HobsIdentification arg0, int arg1) {
- vHobs.setElementAt(arg0, arg1);
- }
-
- public void removeHobs(HobsIdentification arg0) {
- int index = findHobs(arg0);
- if (index > -1) {
- vHobs.removeElementAt(index);
- }
- }
-
- public void removeHobs(int index) {
- if (index > -1 && index < this.size()) {
- vHobs.removeElementAt(index);
- }
- }
-
- public Vector<HobsIdentification> getvHobs() {
- return vHobs;
- }
-
- public void setvHobs(Vector<HobsIdentification> Hobs) {
- vHobs = Hobs;
- }
-
- public Vector<String> getHobsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vHobs.size(); index++) {
- v.addElement(vHobs.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vHobs.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getHobs(index).getName());
- v.addElement(getHobs(index).getType());
- v.addElement(getHobs(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java
deleted file mode 100644
index d47fa74208..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassIdentification.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/** @file
-
- The file is used to define Library Class Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class LibraryClassIdentification {
- private String libraryClassName = null;
-
- private String usage = null;
-
- private String recommendedInstanceVersion = null;
-
- private String recommendedInstanceGuid = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private Vector<String> supModuleList = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public LibraryClassIdentification() {
-
- }
-
- public LibraryClassIdentification(String strName, String strUsage, String strRecommendedInstanceVersion,
- String strRecommendedInstanceGuid, Vector<String> vSupArchList,
- String strFeatureFlag, Vector<String> vSupModuleList, String strHelp) {
- this.libraryClassName = (strName == null ? "" : strName);
- this.usage = (strUsage == null ? "" : strUsage);
- this.recommendedInstanceVersion = (strRecommendedInstanceVersion == null ? "" : strRecommendedInstanceVersion);
- this.recommendedInstanceGuid = (strRecommendedInstanceGuid == null ? "" : strRecommendedInstanceGuid);
- this.supArchList = vSupArchList;
- this.featureFlag = (strFeatureFlag == null ? "" : strFeatureFlag);
- this.supModuleList = vSupModuleList;
- this.help = (strHelp == null ? "" : strHelp);
- }
-
- public String getLibraryClassName() {
- return libraryClassName;
- }
-
- public void setLibraryClassName(String libraryClassName) {
- this.libraryClassName = libraryClassName;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getRecommendedInstanceGuid() {
- return recommendedInstanceGuid;
- }
-
- public void setRecommendedInstanceGuid(String recommendedInstanceGuid) {
- this.recommendedInstanceGuid = recommendedInstanceGuid;
- }
-
- public String getRecommendedInstanceVersion() {
- return recommendedInstanceVersion;
- }
-
- public void setRecommendedInstanceVersion(String recommendedInstanceVersion) {
- this.recommendedInstanceVersion = recommendedInstanceVersion;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(LibraryClassIdentification lib) {
- if (this.libraryClassName.equals(lib.libraryClassName) && this.usage.equals(lib.getUsage())) {
- return true;
- }
- return false;
- }
-
- public Vector<String> getSupModuleList() {
- return supModuleList;
- }
-
- public void setSupModuleList(Vector<String> supModuleList) {
- this.supModuleList = supModuleList;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
deleted file mode 100644
index 3155cf6329..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/LibraryClass/LibraryClassVector.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
-
- The file is used to define Library Class Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.LibraryClass;
-
-import java.util.Vector;
-
-public class LibraryClassVector {
- private Vector<LibraryClassIdentification> vLibraryClass = new Vector<LibraryClassIdentification>();
-
- public int findLibraryClass(LibraryClassIdentification lib) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- if (vLibraryClass.elementAt(index).getLibraryClassName().equals(lib.getLibraryClassName())
- && vLibraryClass.elementAt(index).getUsage().equals(lib.getUsage())) {
- if (vLibraryClass.elementAt(index).getBelongModule() != null && lib.getBelongModule() != null) {
- if (vLibraryClass.elementAt(index).getBelongModule().equals(lib.getBelongModule())) {
- return index;
- }
- }
- if (vLibraryClass.elementAt(index).getBelongModule() == null && lib.getBelongModule() == null) {
- return index;
- }
- }
- }
- return -1;
- }
-
- public int findLibraryClass(String name) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- if (vLibraryClass.elementAt(index).getLibraryClassName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public LibraryClassIdentification getLibraryClass(int index) {
- if (index > -1) {
- return vLibraryClass.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addLibraryClass(LibraryClassIdentification lib) {
- if (findLibraryClass(lib) == -1) {
- vLibraryClass.addElement(lib);
- }
- }
-
- public void setLibraryClass(LibraryClassIdentification lib, int index) {
- vLibraryClass.setElementAt(lib, index);
- }
-
- public void removeLibraryClass(LibraryClassIdentification lib) {
- int index = findLibraryClass(lib);
- if (index > -1) {
- vLibraryClass.removeElementAt(index);
- }
- }
-
- public void removeLibraryClass(int index) {
- if (index > -1 && index < this.size()) {
- vLibraryClass.removeElementAt(index);
- }
- }
-
- public Vector<LibraryClassIdentification> getVLibraryClass() {
- return vLibraryClass;
- }
-
- public void setVLibraryClass(Vector<LibraryClassIdentification> libraryClass) {
- vLibraryClass = libraryClass;
- }
-
- public Vector<String> getLibraryClassName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vLibraryClass.size(); index++) {
- v.addElement(vLibraryClass.get(index).getLibraryClassName());
- }
- return v;
- }
-
- public int size() {
- return this.vLibraryClass.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getLibraryClass(index).getLibraryClassName());
- v.addElement(getLibraryClass(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java
deleted file mode 100644
index 1302f665f7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/ModuleIdentification.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/** @file
-
- The file is used to save basic information of module
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications;
-
-import java.io.IOException;
-
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.LibraryUsage;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class ModuleIdentification extends Identification {
-
- private PackageIdentification packageId;
-
- private String moduleType;
-
- private boolean isLibrary;
-
- public ModuleIdentification(String name, String guid, String version, String path) {
- super(name, guid, version, path);
- setModuleType();
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, boolean library) {
- super(name, guid, version, path);
- this.isLibrary = library;
- }
-
- public ModuleIdentification(Identification id) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- }
-
- public ModuleIdentification(Identification id, boolean library) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.isLibrary = library;
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId) {
- super(name, guid, version, path);
- this.packageId = packageId;
- setModuleType();
- }
-
- public ModuleIdentification(String name, String guid, String version, String path, PackageIdentification packageId,
- String type) {
- super(name, guid, version, path);
- this.packageId = packageId;
- this.moduleType = type;
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- setModuleType();
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId, boolean library) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- this.isLibrary = library;
- }
-
- public ModuleIdentification(Identification id, PackageIdentification packageId, String type) {
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- this.packageId = packageId;
- this.moduleType = type;
- }
-
- public String toString() {
- return "Module " + this.getName() + "[" + this.getGuid() + "] in package " + packageId;
- }
-
- public PackageIdentification getPackageId() {
- return packageId;
- }
-
- public void setPackageId(PackageIdentification packageId) {
- this.packageId = packageId;
- }
-
- public String getModuleType() {
- return moduleType;
- }
-
- public void setModuleType(String moduleType) {
- this.moduleType = moduleType;
- }
-
- private void setModuleType() {
- ModuleSurfaceArea msa = null;
- try {
- msa = OpenFile.openMsaFile(this.getPath());
- } catch (IOException e) {
- // TODO Auto-generated catch block
-
- } catch (XmlException e) {
- // TODO Auto-generated catch block
-
- } catch (Exception e) {
- // TODO Auto-generated catch block
-
- }
- setModuleType(DataType.MODULE_TYPE_MODULE);
- setLibrary(false);
- if (msa != null) {
- LibraryClassDefinitions lib = msa.getLibraryClassDefinitions();
- if (lib != null) {
- for (int index = 0; index < lib.getLibraryClassList().size(); index++) {
- if (lib.getLibraryClassList().get(index).getUsage().equals(LibraryUsage.ALWAYS_PRODUCED)) {
- setModuleType(DataType.MODULE_TYPE_LIBRARY);
- setLibrary(true);
- break;
- }
- }
- }
- }
- }
-
- public boolean equals(String moduleGuid, String moduleVersion, String packageGuid, String packageVersion) {
- boolean b = false;
- if (this.getGuid().equals(moduleGuid) && this.getPackageId().getGuid().equals(packageGuid)) {
- b = true;
- //
- // Check Version
- //
- if (moduleVersion != null) {
- if (!Tools.isEmpty(moduleVersion)) {
- if (!moduleVersion.equals(this.getVersion())) {
- b = false;
- }
- }
- }
- if (packageVersion != null) {
- if (!Tools.isEmpty(packageVersion)) {
- if (!packageVersion.equals(this.getPackageId().getVersion())) {
- b = false;
- }
- }
- }
- }
- return b;
- }
-
- public boolean isLibrary() {
- return isLibrary;
- }
-
- public void setLibrary(boolean isLibrary) {
- this.isLibrary = isLibrary;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java
deleted file mode 100644
index 170c417371..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PackageDependencies;
-
-import java.util.Vector;
-
-public class PackageDependenciesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String version = null;
-
- private String guid = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public PackageDependenciesIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.version = (arg1 == null ? "" : arg1);
- this.guid = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getVersion() {
- return version;
- }
-
- public void setVersion(String version) {
- this.version = version;
- }
-
- public boolean equals(PackageDependenciesIdentification pdi) {
- if (this.guid.equals(pdi.guid)) {
- return true;
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java
deleted file mode 100644
index 7661453c4f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PackageDependencies/PackageDependenciesVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PackageDependencies;
-
-import java.util.Vector;
-
-public class PackageDependenciesVector {
-
- private Vector<PackageDependenciesIdentification> vPackageDependencies = new Vector<PackageDependenciesIdentification>();
-
- public int findPackageDependencies(PackageDependenciesIdentification sfi) {
- for (int index = 0; index < vPackageDependencies.size(); index++) {
- if (vPackageDependencies.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPackageDependencies(String name) {
- for (int index = 0; index < vPackageDependencies.size(); index++) {
- if (vPackageDependencies.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PackageDependenciesIdentification getPackageDependencies(int index) {
- if (index > -1) {
- return vPackageDependencies.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPackageDependencies(PackageDependenciesIdentification arg0) {
- vPackageDependencies.addElement(arg0);
- }
-
- public void setPackageDependencies(PackageDependenciesIdentification arg0, int arg1) {
- vPackageDependencies.setElementAt(arg0, arg1);
- }
-
- public void removePackageDependencies(PackageDependenciesIdentification arg0) {
- int index = findPackageDependencies(arg0);
- if (index > -1) {
- vPackageDependencies.removeElementAt(index);
- }
- }
-
- public void removePackageDependencies(int index) {
- if (index > -1 && index < this.size()) {
- vPackageDependencies.removeElementAt(index);
- }
- }
-
- public Vector<PackageDependenciesIdentification> getvPackageDependencies() {
- return vPackageDependencies;
- }
-
- public void setvPackageDependencies(Vector<PackageDependenciesIdentification> PackageDependencies) {
- vPackageDependencies = PackageDependencies;
- }
-
- public Vector<String> getPackageDependenciesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPackageDependencies.size(); index++) {
- v.addElement(vPackageDependencies.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPackageDependencies.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPackageDependencies(index).getName());
- v.addElement(getPackageDependencies(index).getVersion());
- return v;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java
deleted file mode 100644
index 13ed398fa3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedIdentification.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class PcdCodedIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String guid = null;
-
- private String featureFlag = null;
-
- private Vector<String> supArchList = null;
-
- private String value = null;
-
- private String help = null;
-
- private String type = null;
-
- private String usage = null;
-
- private String tokenSpaceGuidCName = null;
-
- private String token = null;
-
- private String datumType = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public PcdCodedIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4, String arg5, String arg6, String arg7) {
- this.name = (arg0 == null ? "" : arg0);
- this.guid = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.value = (arg4 == null ? "" : arg4);
- this.help = (arg5 == null ? "" : arg5);
- this.type = (arg6 == null ? "" : arg6);
- this.usage = (arg7 == null ? "" : arg7);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(PcdCodedIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getValue() {
- return value;
- }
-
- public void setValue(String value) {
- this.value = value;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-
- public String getToken() {
- return token;
- }
-
- public void setToken(String token) {
- this.token = token;
- }
-
- public String getTokenSpaceGuidCName() {
- return tokenSpaceGuidCName;
- }
-
- public void setTokenSpaceGuidCName(String tokenSpaceGuidCName) {
- this.tokenSpaceGuidCName = tokenSpaceGuidCName;
- }
-
- public String getDatumType() {
- return datumType;
- }
-
- public void setDatumType(String datumType) {
- this.datumType = datumType;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
deleted file mode 100644
index 7b35f1a426..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdCodedVector.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/** @file
-
- The file is used to define PcdCoded Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdCodedVector {
-
- private Vector<PcdCodedIdentification> vPcdCoded = new Vector<PcdCodedIdentification>();
-
- public int findPcdCoded(PcdCodedIdentification sfi) {
- for (int index = 0; index < vPcdCoded.size(); index++) {
- if (vPcdCoded.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPcdCoded(String name) {
- for (int index = 0; index < vPcdCoded.size(); index++) {
- if (vPcdCoded.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PcdCodedIdentification getPcdCoded(int index) {
- if (index > -1) {
- return vPcdCoded.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPcdCoded(PcdCodedIdentification arg0) {
- vPcdCoded.addElement(arg0);
- }
-
- public void setPcdCoded(PcdCodedIdentification arg0, int arg1) {
- vPcdCoded.setElementAt(arg0, arg1);
- }
-
- public void removePcdCoded(PcdCodedIdentification arg0) {
- int index = findPcdCoded(arg0);
- if (index > -1) {
- vPcdCoded.removeElementAt(index);
- }
- }
-
- public void removePcdCoded(int index) {
- if (index > -1 && index < this.size()) {
- vPcdCoded.removeElementAt(index);
- }
- }
-
- public Vector<PcdCodedIdentification> getvPcdCoded() {
- return vPcdCoded;
- }
-
- public void setvPcdCoded(Vector<PcdCodedIdentification> PcdCoded) {
- vPcdCoded = PcdCoded;
- }
-
- public Vector<String> getPcdCodedName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPcdCoded.size(); index++) {
- v.addElement(vPcdCoded.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPcdCoded.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPcdCoded(index).getName());
- v.addElement(getPcdCoded(index).getType());
- v.addElement(getPcdCoded(index).getValue());
- v.addElement(getPcdCoded(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java
deleted file mode 100644
index 85a770662a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdIdentification.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/** @file
-
- The file is used to define Pcd Item Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdIdentification {
- //
- // Define class members
- //
- private String name = null;
-
- private String guidCName = null;
-
- private String help = null;
-
- private Vector<String> type = null;
-
- public PcdIdentification(String arg0, String arg1, String arg2, Vector<String> arg3) {
- this.name = (arg0 == null ? "" : arg0);
- this.guidCName = (arg1 == null ? "" : arg1);
- this.help = (arg2 == null ? "" : arg2);
- this.type = arg3;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public String getGuidCName() {
- return guidCName;
- }
-
- public void setGuidCName(String guidCName) {
- this.guidCName = guidCName;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getType() {
- return type;
- }
-
- public void setType(Vector<String> type) {
- this.type = type;
- }
-
- public String toString() {
- return name;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java
deleted file mode 100644
index dd2832e778..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/PcdCoded/PcdVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Pcd Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.PcdCoded;
-
-import java.util.Vector;
-
-public class PcdVector {
-
- private Vector<PcdIdentification> vPcd = new Vector<PcdIdentification>();
-
- public int findPcd(PcdIdentification sfi) {
- for (int index = 0; index < vPcd.size(); index++) {
- if (vPcd.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPcd(String name) {
- for (int index = 0; index < vPcd.size(); index++) {
- if (vPcd.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PcdIdentification getPcd(int index) {
- if (index > -1) {
- return vPcd.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPcd(PcdIdentification arg0) {
- vPcd.addElement(arg0);
- }
-
- public void setPcd(PcdIdentification arg0, int arg1) {
- vPcd.setElementAt(arg0, arg1);
- }
-
- public void removePcd(PcdIdentification arg0) {
- int index = findPcd(arg0);
- if (index > -1) {
- vPcd.removeElementAt(index);
- }
- }
-
- public void removePcd(int index) {
- if (index > -1 && index < this.size()) {
- vPcd.removeElementAt(index);
- }
- }
-
- public Vector<PcdIdentification> getvPcd() {
- return vPcd;
- }
-
- public void setvPcd(Vector<PcdIdentification> Pcd) {
- vPcd = Pcd;
- }
-
- public Vector<String> getPcdName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPcd.size(); index++) {
- v.addElement(vPcd.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPcd.size();
- }
-
- public void addAll(PcdVector v) {
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- vPcd.add(v.getPcd(index));
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java
deleted file mode 100644
index a871f628db..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisIdentification.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Ppis;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class PpisIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public PpisIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(PpisIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java
deleted file mode 100644
index 9c6f343ee7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Ppis/PpisVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Ppis;
-
-import java.util.Vector;
-
-public class PpisVector {
-
- private Vector<PpisIdentification> vPpis = new Vector<PpisIdentification>();
-
- public int findPpis(PpisIdentification sfi) {
- for (int index = 0; index < vPpis.size(); index++) {
- if (vPpis.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findPpis(String name) {
- for (int index = 0; index < vPpis.size(); index++) {
- if (vPpis.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public PpisIdentification getPpis(int index) {
- if (index > -1) {
- return vPpis.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addPpis(PpisIdentification arg0) {
- vPpis.addElement(arg0);
- }
-
- public void setPpis(PpisIdentification arg0, int arg1) {
- vPpis.setElementAt(arg0, arg1);
- }
-
- public void removePpis(PpisIdentification arg0) {
- int index = findPpis(arg0);
- if (index > -1) {
- vPpis.removeElementAt(index);
- }
- }
-
- public void removePpis(int index) {
- if (index > -1 && index < this.size()) {
- vPpis.removeElementAt(index);
- }
- }
-
- public Vector<PpisIdentification> getvPpis() {
- return vPpis;
- }
-
- public void setvPpis(Vector<PpisIdentification> Ppis) {
- vPpis = Ppis;
- }
-
- public Vector<String> getPpisName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vPpis.size(); index++) {
- v.addElement(vPpis.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vPpis.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getPpis(index).getName());
- v.addElement(getPpis(index).getType());
- v.addElement(getPpis(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java
deleted file mode 100644
index 685c6d1b6e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsIdentification.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Protocols;
-
-import java.util.Vector;
-
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-public class ProtocolsIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String type = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- private ModuleIdentification belongModule = null;
-
- private PackageIdentification declaredBy = null;
-
- public ProtocolsIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.type = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(ProtocolsIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-
- public ModuleIdentification getBelongModule() {
- return belongModule;
- }
-
- public void setBelongModule(ModuleIdentification belongModule) {
- this.belongModule = belongModule;
- }
-
- public PackageIdentification getDeclaredBy() {
- return declaredBy;
- }
-
- public void setDeclaredBy(PackageIdentification declaredBy) {
- this.declaredBy = declaredBy;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java
deleted file mode 100644
index 7f09670d5a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Protocols/ProtocolsVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Protocols;
-
-import java.util.Vector;
-
-public class ProtocolsVector {
-
- private Vector<ProtocolsIdentification> vProtocols = new Vector<ProtocolsIdentification>();
-
- public int findProtocols(ProtocolsIdentification sfi) {
- for (int index = 0; index < vProtocols.size(); index++) {
- if (vProtocols.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findProtocols(String name) {
- for (int index = 0; index < vProtocols.size(); index++) {
- if (vProtocols.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public ProtocolsIdentification getProtocols(int index) {
- if (index > -1) {
- return vProtocols.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addProtocols(ProtocolsIdentification arg0) {
- vProtocols.addElement(arg0);
- }
-
- public void setProtocols(ProtocolsIdentification arg0, int arg1) {
- vProtocols.setElementAt(arg0, arg1);
- }
-
- public void removeProtocols(ProtocolsIdentification arg0) {
- int index = findProtocols(arg0);
- if (index > -1) {
- vProtocols.removeElementAt(index);
- }
- }
-
- public void removeProtocols(int index) {
- if (index > -1 && index < this.size()) {
- vProtocols.removeElementAt(index);
- }
- }
-
- public Vector<ProtocolsIdentification> getvProtocols() {
- return vProtocols;
- }
-
- public void setvProtocols(Vector<ProtocolsIdentification> Protocols) {
- vProtocols = Protocols;
- }
-
- public Vector<String> getProtocolsName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vProtocols.size(); index++) {
- v.addElement(vProtocols.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vProtocols.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getProtocols(index).getName());
- v.addElement(getProtocols(index).getType());
- v.addElement(getProtocols(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java
deleted file mode 100644
index 02a9d7faf4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesIdentification.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Source Files Identification
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.SourceFiles;
-
-import java.util.Vector;
-
-public class SourceFilesIdentification {
-
- private String filename = null;
-
- private String tagName = null;
-
- private String toolCode = null;
-
- private String toolChainFamily = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- public SourceFilesIdentification(String strFilename, String strTagName, String strToolCode,
- String strToolChainFamily, String strFeatureFlag, Vector<String> arch) {
- this.filename = (strFilename == null ? "" : strFilename);
- this.tagName = (strTagName == null ? "" : strTagName);
- this.toolCode = (strToolCode == null ? "" : strToolCode);
- this.toolChainFamily = (strToolChainFamily == null ? "" : strToolChainFamily);
- this.featureFlag = (strFeatureFlag == null ? "" : strFeatureFlag);
- this.supArchList = arch;
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getFilename() {
- return filename;
- }
-
- public void setFilename(String filename) {
- this.filename = filename;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public String getTagName() {
- return tagName;
- }
-
- public void setTagName(String tagName) {
- this.tagName = tagName;
- }
-
- public String getToolChainFamily() {
- return toolChainFamily;
- }
-
- public void setToolChainFamily(String toolChainFamily) {
- this.toolChainFamily = toolChainFamily;
- }
-
- public String getToolCode() {
- return toolCode;
- }
-
- public void setToolCode(String toolCode) {
- this.toolCode = toolCode;
- }
-
- public boolean equals(SourceFilesIdentification sfid) {
- if (this.filename.equals(sfid.filename) && this.tagName.equals(sfid.tagName)
- && this.toolCode.equals(sfid.toolCode) && this.toolChainFamily.equals(sfid.toolChainFamily)
- && this.featureFlag.equals(sfid.featureFlag)
- && this.supArchList.toString().equals(sfid.supArchList.toString())) {
- return true;
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
deleted file mode 100644
index 0e5cdc97a5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SourceFiles/SourceFilesVector.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Source Files Vector
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.SourceFiles;
-
-import java.util.Vector;
-
-public class SourceFilesVector {
- private Vector<SourceFilesIdentification> vSourceFiles = new Vector<SourceFilesIdentification>();
-
- public int findSourceFiles(SourceFilesIdentification sfi) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- if (vSourceFiles.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findSourceFiles(String name) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- if (vSourceFiles.elementAt(index).getFilename().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public SourceFilesIdentification getSourceFiles(int index) {
- if (index > -1) {
- return vSourceFiles.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addSourceFiles(SourceFilesIdentification sfi) {
- if (findSourceFiles(sfi) == -1) {
- vSourceFiles.addElement(sfi);
- }
- }
-
- public void setSourceFiles(SourceFilesIdentification sfi, int index) {
- vSourceFiles.setElementAt(sfi, index);
- }
-
- public void removeSourceFiles(SourceFilesIdentification sfi) {
- int index = findSourceFiles(sfi);
- if (index > -1) {
- vSourceFiles.removeElementAt(index);
- }
- }
-
- public void removeSourceFiles(int index) {
- if (index > -1 && index < this.size()) {
- vSourceFiles.removeElementAt(index);
- }
- }
-
- public Vector<SourceFilesIdentification> getvSourceFiles() {
- return vSourceFiles;
- }
-
- public void setvSourceFiles(Vector<SourceFilesIdentification> SourceFiles) {
- vSourceFiles = SourceFiles;
- }
-
- public Vector<String> getSourceFilesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vSourceFiles.size(); index++) {
- v.addElement(vSourceFiles.get(index).getFilename());
- }
- return v;
- }
-
- public int size() {
- return this.vSourceFiles.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getSourceFiles(index).getFilename());
- v.addElement(getSourceFiles(index).getTagName());
- v.addElement(getSourceFiles(index).getToolCode());
- v.addElement(getSourceFiles(index).getToolChainFamily());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java
deleted file mode 100644
index d2952c0e7e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesIdentification.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.SystemTables;
-
-import java.util.Vector;
-
-public class SystemTablesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public SystemTablesIdentification(String arg0, String arg1, String arg2, Vector<String> arg3, String arg4) {
- this.name = (arg0 == null ? "" : arg0);
- this.usage = (arg1 == null ? "" : arg1);
- this.featureFlag = (arg2 == null ? "" : arg2);
- this.supArchList = arg3;
- this.help = (arg4 == null ? "" : arg4);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(SystemTablesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java
deleted file mode 100644
index fb875acfd5..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/SystemTables/SystemTablesVector.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.SystemTables;
-
-import java.util.Vector;
-
-public class SystemTablesVector {
-
- private Vector<SystemTablesIdentification> vSystemTables = new Vector<SystemTablesIdentification>();
-
- public int findSystemTables(SystemTablesIdentification sfi) {
- for (int index = 0; index < vSystemTables.size(); index++) {
- if (vSystemTables.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findSystemTables(String name) {
- for (int index = 0; index < vSystemTables.size(); index++) {
- if (vSystemTables.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public SystemTablesIdentification getSystemTables(int index) {
- if (index > -1) {
- return vSystemTables.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addSystemTables(SystemTablesIdentification arg0) {
- vSystemTables.addElement(arg0);
- }
-
- public void setSystemTables(SystemTablesIdentification arg0, int arg1) {
- vSystemTables.setElementAt(arg0, arg1);
- }
-
- public void removeSystemTables(SystemTablesIdentification arg0) {
- int index = findSystemTables(arg0);
- if (index > -1) {
- vSystemTables.removeElementAt(index);
- }
- }
-
- public void removeSystemTables(int index) {
- if (index > -1 && index < this.size()) {
- vSystemTables.removeElementAt(index);
- }
- }
-
- public Vector<SystemTablesIdentification> getvSystemTables() {
- return vSystemTables;
- }
-
- public void setvSystemTables(Vector<SystemTablesIdentification> SystemTables) {
- vSystemTables = SystemTables;
- }
-
- public Vector<String> getSystemTablesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vSystemTables.size(); index++) {
- v.addElement(vSystemTables.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vSystemTables.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getSystemTables(index).getName());
- v.addElement(getSystemTables(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java
deleted file mode 100644
index 24d81860a4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesIdentification.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Identification
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.Identifications.Variables;
-
-import java.util.Vector;
-
-public class VariablesIdentification {
-
- //
- // Define class members
- //
- private String name = null;
-
- private String guid = null;
-
- private String usage = null;
-
- private Vector<String> supArchList = null;
-
- private String featureFlag = null;
-
- private String help = null;
-
- public VariablesIdentification(String arg0, String arg1, String arg2, String arg3, Vector<String> arg4, String arg5) {
- this.name = (arg0 == null ? "" : arg0);
- this.guid = (arg1 == null ? "" : arg1);
- this.usage = (arg2 == null ? "" : arg2);
- this.featureFlag = (arg3 == null ? "" : arg3);
- this.supArchList = arg4;
- this.help = (arg5 == null ? "" : arg5);
- }
-
- public String getFeatureFlag() {
- return featureFlag;
- }
-
- public void setFeatureFlag(String featureFlag) {
- this.featureFlag = featureFlag;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public Vector<String> getSupArchList() {
- return supArchList;
- }
-
- public void setSupArchList(Vector<String> supArchList) {
- this.supArchList = supArchList;
- }
-
- public boolean equals(VariablesIdentification pi) {
- if (this.name.equals(pi.name)) {
- return true;
- }
- return false;
- }
-
- public String getUsage() {
- return usage;
- }
-
- public void setUsage(String usage) {
- this.usage = usage;
- }
-
- public String getGuid() {
- return guid;
- }
-
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- public String getHelp() {
- return help;
- }
-
- public void setHelp(String help) {
- this.help = help;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java
deleted file mode 100644
index 6949eff7c3..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/Identifications/Variables/VariablesVector.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/** @file
-
- The file is used to define Package Dependencies Vector
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.Identifications.Variables;
-
-import java.util.Vector;
-
-public class VariablesVector {
-
- private Vector<VariablesIdentification> vVariables = new Vector<VariablesIdentification>();
-
- public int findVariables(VariablesIdentification sfi) {
- for (int index = 0; index < vVariables.size(); index++) {
- if (vVariables.elementAt(index).equals(sfi)) {
- return index;
- }
- }
- return -1;
- }
-
- public int findVariables(String name) {
- for (int index = 0; index < vVariables.size(); index++) {
- if (vVariables.elementAt(index).getName().equals(name)) {
- return index;
- }
- }
- return -1;
- }
-
- public VariablesIdentification getVariables(int index) {
- if (index > -1) {
- return vVariables.elementAt(index);
- } else {
- return null;
- }
- }
-
- public void addVariables(VariablesIdentification arg0) {
- vVariables.addElement(arg0);
- }
-
- public void setVariables(VariablesIdentification arg0, int arg1) {
- vVariables.setElementAt(arg0, arg1);
- }
-
- public void removeVariables(VariablesIdentification arg0) {
- int index = findVariables(arg0);
- if (index > -1) {
- vVariables.removeElementAt(index);
- }
- }
-
- public void removeVariables(int index) {
- if (index > -1 && index < this.size()) {
- vVariables.removeElementAt(index);
- }
- }
-
- public Vector<VariablesIdentification> getvVariables() {
- return vVariables;
- }
-
- public void setvVariables(Vector<VariablesIdentification> Variables) {
- vVariables = Variables;
- }
-
- public Vector<String> getVariablesName() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < this.vVariables.size(); index++) {
- v.addElement(vVariables.get(index).getName());
- }
- return v;
- }
-
- public int size() {
- return this.vVariables.size();
- }
-
- public Vector<String> toStringVector(int index) {
- Vector<String> v = new Vector<String>();
- v.addElement(getVariables(index).getName());
- v.addElement(getVariables(index).getGuid());
- v.addElement(getVariables(index).getUsage());
- return v;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java
deleted file mode 100644
index aee620db50..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBootModes.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/** @file
-
- The file is used to create, update BootModes of MSA/MBD file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.BootModeNames;
-import org.tianocore.BootModeUsage;
-import org.tianocore.BootModesDocument;
-import org.tianocore.BootModesDocument.BootModes;
-import org.tianocore.BootModesDocument.BootModes.BootMode;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.BootModesDlg;
-
-/**
- The class is used to create, update BootModes of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleBootModes extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- private IFrame parentFrame = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private BootModesDocument.BootModes bootModes = null;
-
- private BootModesIdentification id = null;
-
- private BootModesVector vid = new BootModesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(210, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(390, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inBootModes
-
- **/
- private void init(BootModes inBootModes) {
- init();
- this.bootModes = inBootModes;
-
- if (this.bootModes != null) {
- if (this.bootModes.getBootModeList().size() > 0) {
- for (int index = 0; index < this.bootModes.getBootModeList().size(); index++) {
- String arg0 = null;
- if (bootModes.getBootModeList().get(index).getBootModeName() != null) {
- arg0 = bootModes.getBootModeList().get(index).getBootModeName().toString();
- }
- String arg1 = null;
- if (bootModes.getBootModeList().get(index).getUsage() != null) {
- arg1 = bootModes.getBootModeList().get(index).getUsage().toString();
- }
-
- String arg2 = bootModes.getBootModeList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(bootModes.getBootModeList().get(index)
- .getSupArchList());
- String arg4 = bootModes.getBootModeList().get(index).getHelpText();
-
- id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addBootModes(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleBootModes() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inBootModes The input BootModesDocument.BootModes
-
- **/
- public ModuleBootModes(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getBootModes());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- BootModesDlg dlg = new BootModesDlg(vid.getBootModes(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addBootModes(dlg.getId());
- } else {
- this.vid.setBootModes(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Boot Modes", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeBootModes(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Mbd Header
- if exists bootModes, set the value directly
- if not exists bootModes, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.bootModes = BootModes.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- BootMode p = BootMode.Factory.newInstance();
- if (!isEmpty(vid.getBootModes(index).getName())) {
- p.setBootModeName(BootModeNames.Enum.forString(vid.getBootModes(index).getName()));
- }
- if (!isEmpty(vid.getBootModes(index).getUsage())) {
- p.setUsage(BootModeUsage.Enum.forString(vid.getBootModes(index).getUsage()));
- }
- if (!isEmpty(vid.getBootModes(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getBootModes(index).getFeatureFlag());
- }
- if (vid.getBootModes(index).getSupArchList() != null
- && vid.getBootModes(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getBootModes(index).getSupArchList());
- }
- if (!isEmpty(vid.getBootModes(index).getHelp())) {
- p.setHelpText(vid.getBootModes(index).getHelp());
- }
- this.bootModes.addNewBootMode();
- this.bootModes.setBootModeArray(bootModes.getBootModeList().size() - 1, p);
- }
- }
-
- this.msa.setBootModes(bootModes);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Boot Modes", e.getMessage());
- Log.err("Update Boot Modes", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java
deleted file mode 100644
index 993d1b9dcb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleBuildOptions.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/** @file
-
- The file is used to create, update BuildOptions of MSA/MBD file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.List;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ModuleBuildOptionsDocument;
-import org.tianocore.UserExtensionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.OptionDocument.Option;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.BuildOptionsDlg;
-
-/**
- The class is used to create, update BuildOptions of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleBuildOptions extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ModuleBuildOptionsDocument.ModuleBuildOptions mbo = null;
-
- private List<UserExtensionsDocument.UserExtensions> ue = null;
-
- private BuildOptionsIdentification id = null;
-
- private BuildOptionsVector vid = new BuildOptionsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(210, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(390, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Option String Value");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inBuildOptions
-
- **/
- private void init(ModuleBuildOptionsDocument.ModuleBuildOptions inModuleBuildOptions) {
- init();
- this.mbo = inModuleBuildOptions;
-
- if (this.mbo != null) {
- //
- // Save User Extensitions
- //
- if (this.mbo.getUserExtensionsList() != null) {
- this.ue = this.mbo.getUserExtensionsList();
- }
-
- if (this.mbo.getOptions() != null) {
- if (this.mbo.getOptions().getOptionList() != null) {
- for (int index = 0; index < this.mbo.getOptions().getOptionList().size(); index++) {
- Option o = this.mbo.getOptions().getOptionList().get(index);
- if (o != null) {
- String arg0 = o.getStringValue();
- Vector<String> arg1 = Tools.convertListToVector(o.getBuildTargets());
- String arg2 = o.getToolChainFamily();
- String arg3 = o.getTagName();
- String arg4 = o.getToolCode();
- Vector<String> arg5 = Tools.convertListToVector(o.getSupArchList());
-
- id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addBuildOptions(id);
- }
- }
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleBuildOptions() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inBuildOptions The input BuildOptionsDocument.BuildOptions
-
- **/
- public ModuleBuildOptions(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getModuleBuildOptions());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- BuildOptionsDlg dlg = new BuildOptionsDlg(vid.getBuildOptions(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addBuildOptions(dlg.getId());
- } else {
- this.vid.setBuildOptions(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Boot Modes", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeBuildOptions(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Mbd Header
- if exists BuildOptions, set the value directly
- if not exists BuildOptions, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.mbo = ModuleBuildOptionsDocument.ModuleBuildOptions.Factory.newInstance();
- this.mbo.addNewOptions();
- //
- // Restore User Extensions Data
- //
- if (this.ue != null) {
- for (int index = 0; index < this.ue.size(); index++) {
- this.mbo.addNewUserExtensions();
- this.mbo.setUserExtensionsArray(index, ue.get(index));
- }
- }
-
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Option o = Option.Factory.newInstance();
- if (!isEmpty(vid.getBuildOptions(index).getOption())) {
- o.setStringValue(vid.getBuildOptions(index).getOption());
- }
- if (vid.getBuildOptions(index).getBuildTargets() != null
- && vid.getBuildOptions(index).getBuildTargets().size() > 0) {
- o.setBuildTargets(vid.getBuildOptions(index).getBuildTargets());
- }
- if (!isEmpty(vid.getBuildOptions(index).getToolChainFamily())) {
- o.setToolChainFamily(vid.getBuildOptions(index).getToolChainFamily());
- }
- if (!isEmpty(vid.getBuildOptions(index).getTagName())) {
- o.setTagName(vid.getBuildOptions(index).getTagName());
- }
- if (!isEmpty(vid.getBuildOptions(index).getToolCode())) {
- o.setToolCode(vid.getBuildOptions(index).getToolCode());
- }
- if (vid.getBuildOptions(index).getSupArchList() != null
- && vid.getBuildOptions(index).getSupArchList().size() > 0) {
- o.setSupArchList(vid.getBuildOptions(index).getSupArchList());
- }
-
- this.mbo.getOptions().addNewOption();
- this.mbo.getOptions().setOptionArray(this.mbo.getOptions().getOptionList().size() - 1, o);
- }
- }
-
- this.msa.setModuleBuildOptions(this.mbo);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Module Build Options", e.getMessage());
- Log.err("Update Module Build Options", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java
deleted file mode 100644
index b2217f15cd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleDataHubs.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update DataHub of MSA/MBD file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.DataHubUsage;
-import org.tianocore.DataHubsDocument;
-import org.tianocore.DataHubsDocument.DataHubs;
-import org.tianocore.DataHubsDocument.DataHubs.DataHubRecord;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.DataHubsDlg;
-
-/**
- The class is used to create, update DataHub of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleDataHubs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -3667906991966638892L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private DataHubsDocument.DataHubs dataHubs = null;
-
- private DataHubsIdentification id = null;
-
- private DataHubsVector vid = new DataHubsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Data Hub C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Data Hubs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(DataHubs inDataHubs) {
- init();
- this.dataHubs = inDataHubs;
-
- if (this.dataHubs != null) {
- if (this.dataHubs.getDataHubRecordList().size() > 0) {
- for (int index = 0; index < this.dataHubs.getDataHubRecordList().size(); index++) {
- String arg0 = dataHubs.getDataHubRecordList().get(index).getDataHubCName();
- String arg1 = null;
- if (dataHubs.getDataHubRecordList().get(index).getUsage() != null) {
- arg1 = dataHubs.getDataHubRecordList().get(index).getUsage().toString();
- }
-
- String arg2 = dataHubs.getDataHubRecordList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(dataHubs.getDataHubRecordList().get(index)
- .getSupArchList());
- String arg4 = dataHubs.getDataHubRecordList().get(index).getHelpText();
-
- id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addDataHubs(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleDataHubs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inDataHubs The input DataHubsDocument.DataHubs
-
- **/
- public ModuleDataHubs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getDataHubs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- DataHubsDlg dlg = new DataHubsDlg(vid.getDataHubs(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addDataHubs(dlg.getId());
- } else {
- this.vid.setDataHubs(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Data Hubs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeDataHubs(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of DataHubs
- if exists dataHubs, set the value directly
- if not exists dataHubs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.dataHubs = DataHubs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- DataHubRecord p = DataHubRecord.Factory.newInstance();
- if (!isEmpty(vid.getDataHubs(index).getName())) {
- p.setDataHubCName(vid.getDataHubs(index).getName());
- }
- if (!isEmpty(vid.getDataHubs(index).getUsage())) {
- p.setUsage(DataHubUsage.Enum.forString(vid.getDataHubs(index).getUsage()));
- }
- if (!isEmpty(vid.getDataHubs(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getDataHubs(index).getFeatureFlag());
- }
- if (vid.getDataHubs(index).getSupArchList() != null
- && vid.getDataHubs(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getDataHubs(index).getSupArchList());
- }
- if (!isEmpty(vid.getDataHubs(index).getHelp())) {
- p.setHelpText(vid.getDataHubs(index).getHelp());
- }
- this.dataHubs.addNewDataHubRecord();
- this.dataHubs.setDataHubRecordArray(dataHubs.getDataHubRecordList().size() - 1, p);
- }
- }
-
- this.msa.setDataHubs(dataHubs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Data Hubs", e.getMessage());
- Log.err("Update Data Hubs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
deleted file mode 100644
index 354be3ddae..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleEvents.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/** @file
-
- The file is used to create, update Event of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.EventTypes;
-import org.tianocore.EventsDocument;
-import org.tianocore.ProtocolNotifyUsage;
-import org.tianocore.ProtocolUsage;
-import org.tianocore.EventsDocument.Events;
-import org.tianocore.EventsDocument.Events.CreateEvents;
-import org.tianocore.EventsDocument.Events.SignalEvents;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.EventsDlg;
-
-/**
- The class is used to create, update Event of MSA/MBD file
- It extends IInternalFrame
-
- @since ModuleEditor 1.0
-
- **/
-public class ModuleEvents extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4396143706422842331L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private EventsDocument.Events events = null;
-
- private EventsIdentification id = null;
-
- private EventsVector vid = new EventsVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Events");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Events inEvents) {
- init();
- this.events = inEvents;
-
- if (this.events != null) {
- if (this.events.getCreateEvents() != null) {
- if (this.events.getCreateEvents().getEventTypesList().size() > 0) {
- for (int index = 0; index < this.events.getCreateEvents().getEventTypesList().size(); index++) {
- String arg0 = events.getCreateEvents().getEventTypesList().get(index).getEventGuidCName();
- String arg1 = ed.getVEventType().get(0);
- String arg2 = null;
- if (events.getCreateEvents().getEventTypesList().get(index).getUsage() != null) {
- arg2 = events.getCreateEvents().getEventTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = events.getCreateEvents().getEventTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(events.getCreateEvents().getEventTypesList()
- .get(index).getSupArchList());
- String arg5 = events.getCreateEvents().getEventTypesList().get(index).getHelpText();
- String arg6 = events.getCreateEvents().getEventTypesList().get(index).getEventType().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- vid.addEvents(id);
- }
- }
- }
- if (this.events.getSignalEvents() != null) {
- if (this.events.getSignalEvents().getEventTypesList().size() > 0) {
- for (int index = 0; index < this.events.getSignalEvents().getEventTypesList().size(); index++) {
- String arg0 = events.getSignalEvents().getEventTypesList().get(index).getEventGuidCName();
- String arg1 = ed.getVEventType().get(1);
- String arg2 = null;
- if (events.getSignalEvents().getEventTypesList().get(index).getUsage() != null) {
- arg2 = events.getSignalEvents().getEventTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = events.getSignalEvents().getEventTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(events.getSignalEvents().getEventTypesList()
- .get(index).getSupArchList());
- String arg5 = events.getSignalEvents().getEventTypesList().get(index).getHelpText();
- String arg6 = events.getSignalEvents().getEventTypesList().get(index).getEventType().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- vid.addEvents(id);
- }
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleEvents() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inEvents The input EventsDocument.Events
-
- **/
- public ModuleEvents(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getEvents());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- EventsDlg dlg = new EventsDlg(vid.getEvents(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addEvents(dlg.getId());
- } else {
- this.vid.setEvents(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Events", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeEvents(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Events
- if exists events, set the value directly
- if not exists events, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.events = Events.Factory.newInstance();
- CreateEvents ce = CreateEvents.Factory.newInstance();
- SignalEvents se = SignalEvents.Factory.newInstance();
-
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getEvents(index).getType().equals(ed.getVEventType().get(0))) {
- CreateEvents.EventTypes e = CreateEvents.EventTypes.Factory.newInstance();
- if (!isEmpty(vid.getEvents(index).getName())) {
- e.setEventGuidCName(vid.getEvents(index).getName());
- }
- if (!isEmpty(vid.getEvents(index).getUsage())) {
- e.setUsage(ProtocolUsage.Enum.forString(vid.getEvents(index).getUsage()));
- }
- if (!isEmpty(vid.getEvents(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getEvents(index).getFeatureFlag());
- }
- if (vid.getEvents(index).getSupArchList() != null
- && vid.getEvents(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getEvents(index).getSupArchList());
- }
- if (!isEmpty(vid.getEvents(index).getHelp())) {
- e.setHelpText(vid.getEvents(index).getHelp());
- }
- if (!isEmpty(vid.getEvents(index).getGroup())) {
- e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
- }
- ce.addNewEventTypes();
- ce.setEventTypesArray(ce.getEventTypesList().size() - 1, e);
- }
- if (vid.getEvents(index).getType().equals(ed.getVEventType().get(1))) {
- SignalEvents.EventTypes e = SignalEvents.EventTypes.Factory.newInstance();
- if (!isEmpty(vid.getEvents(index).getName())) {
- e.setEventGuidCName(vid.getEvents(index).getName());
- }
- if (!isEmpty(vid.getEvents(index).getUsage())) {
- e.setUsage(ProtocolNotifyUsage.Enum.forString(vid.getEvents(index).getUsage()));
- }
- if (!isEmpty(vid.getEvents(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getEvents(index).getFeatureFlag());
- }
- if (vid.getEvents(index).getSupArchList() != null
- && vid.getEvents(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getEvents(index).getSupArchList());
- }
- if (!isEmpty(vid.getEvents(index).getHelp())) {
- e.setHelpText(vid.getEvents(index).getHelp());
- }
- if (!isEmpty(vid.getEvents(index).getGroup())) {
- e.setEventType(EventTypes.Enum.forString(vid.getEvents(index).getGroup()));
- }
- se.addNewEventTypes();
- se.setEventTypesArray(se.getEventTypesList().size() - 1, e);
- }
- }
- }
- if (ce.getEventTypesList().size() > 0) {
- events.addNewCreateEvents();
- events.setCreateEvents(ce);
- }
- if (se.getEventTypesList().size() > 0) {
- events.addNewSignalEvents();
- events.setSignalEvents(se);
- }
- this.msa.setEvents(events);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Events", e.getMessage());
- Log.err("Update Events", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
deleted file mode 100644
index b1917dd033..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleExterns.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/** @file
-
- The file is used to create, update DataHub of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ExternsDocument;
-import org.tianocore.ExternsDocument.Externs;
-import org.tianocore.ExternsDocument.Externs.Extern;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.ExternsDlg;
-
-/**
- The class is used to create, update DataHub of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleExterns extends IInternalFrame implements ItemListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7382008402932047191L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ExternsDocument.Externs externs = null;
-
- private ExternsIdentification id = null;
-
- private ExternsVector vid = new ExternsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Type");
- model.addColumn("Name");
- model.addColumn("Value");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Externs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Externs inExterns) {
- init();
- this.externs = inExterns;
-
- if (this.externs != null) {
- //
- // Get specification
- //
- if (this.externs.getSpecificationList().size() > 0) {
- for (int index = 0; index < this.externs.getSpecificationList().size(); index++) {
- String arg0 = externs.getSpecificationList().get(index);
- String arg1 = EnumerationData.EXTERNS_SPECIFICATION;
-
- id = new ExternsIdentification(arg0, arg1);
- vid.addExterns(id);
- }
- }
-
- //
- // Get Externs list
- //
- if (this.externs.getExternList().size() > 0) {
- for (int index = 0; index < this.externs.getExternList().size(); index++) {
- //
- // Get common data
- //
- String featureFlag = externs.getExternList().get(index).getFeatureFlag();
- Vector<String> arch = Tools
- .convertListToVector(externs.getExternList().get(index).getSupArchList());
-
- //
- // Get Image data
- //
- if (this.externs.getExternList().get(index).getModuleEntryPoint() != null
- || this.externs.getExternList().get(index).getModuleUnloadImage() != null) {
- String moduleEntryPoint = this.externs.getExternList().get(index).getModuleEntryPoint();
- String moduleUnloadImage = this.externs.getExternList().get(index).getModuleUnloadImage();
- String type = EnumerationData.EXTERNS_IMAGE;
- id = new ExternsIdentification(moduleEntryPoint, moduleUnloadImage, type, featureFlag, arch);
- }
-
- //
- // Get Library Data
- //
- if (this.externs.getExternList().get(index).getConstructor() != null
- || this.externs.getExternList().get(index).getDestructor() != null) {
- String constructor = this.externs.getExternList().get(index).getConstructor();
- String destructor = this.externs.getExternList().get(index).getDestructor();
- String type = EnumerationData.EXTERNS_LIBRARY;
- id = new ExternsIdentification(constructor, destructor, type, featureFlag, arch);
- }
-
- //
- // Get Driver Data
- //
- if (this.externs.getExternList().get(index).getDriverBinding() != null) {
- String driverBinding = this.externs.getExternList().get(index).getDriverBinding();
- String componentName = this.externs.getExternList().get(index).getComponentName();
- String driverConfig = this.externs.getExternList().get(index).getDriverConfig();
- String driverDiag = this.externs.getExternList().get(index).getDriverDiag();
- String type = EnumerationData.EXTERNS_DRIVER;
- id = new ExternsIdentification(driverBinding, componentName, driverConfig, driverDiag, type,
- featureFlag, arch);
- }
-
- //
- // Get Call Back Data
- //
- if (this.externs.getExternList().get(index).getSetVirtualAddressMapCallBack() != null
- || this.externs.getExternList().get(index).getExitBootServicesCallBack() != null) {
- String virtualAddressMap = this.externs.getExternList().get(index)
- .getSetVirtualAddressMapCallBack();
- String exitBootServices = this.externs.getExternList().get(index).getExitBootServicesCallBack();
- String type = EnumerationData.EXTERNS_CALL_BACK;
- id = new ExternsIdentification(virtualAddressMap, exitBootServices, type, featureFlag, arch);
- }
-
- //
- // Add id to vector
- //
- vid.addExterns(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleExterns() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inExterns The input data of ExternsDocument.Externs
-
- **/
- public ModuleExterns(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getExterns());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- ExternsDlg dlg = new ExternsDlg(vid.getExterns(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addExterns(dlg.getId());
- } else {
- this.vid.setExterns(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- int line = 1;
-
- //
- // For Specification
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- line = 1;
- }
-
- //
- // For Image
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- line = 2;
- }
-
- //
- // For Library
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- line = 2;
- }
-
- //
- // For Driver
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- line = 4;
- }
-
- //
- // For Call Back
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- line = 2;
- }
-
- model.addRow(vid.toStringVector(index));
- jTable.setRowHeight(index, line * 18);
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Externs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeExterns(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Externs
- if exists externs, set the value directly
- if not exists externs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- //
- // Save pcd and flash map information first
- //
- Externs ex = Externs.Factory.newInstance();
- if (this.externs != null) {
- if (this.externs.getPcdIsDriver() != null) {
- ex.setPcdIsDriver(this.externs.getPcdIsDriver());
- }
- if (this.externs.getTianoR8FlashMapH()) {
- ex.setTianoR8FlashMapH(this.externs.getTianoR8FlashMapH());
- }
- }
- this.externs = ex;
-
- //
- // Save externs
- //
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- //
- // Save specfication
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (!isEmpty(vid.getExterns(index).getName0())) {
- this.externs.addNewSpecification();
- this.externs.setSpecificationArray(externs.getSpecificationList().size() - 1,
- vid.getExterns(index).getName0());
- continue;
- }
- }
-
- Extern e = Extern.Factory.newInstance();
- //
- // Save image
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_IMAGE)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setModuleEntryPoint(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setModuleUnloadImage(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save library
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setConstructor(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setDestructor(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save call back
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setSetVirtualAddressMapCallBack(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setExitBootServicesCallBack(vid.getExterns(index).getName1());
- }
- }
- }
-
- //
- // Save driver
- //
- if (vid.getExterns(index).getType().equals(EnumerationData.EXTERNS_DRIVER)) {
- if (!isEmpty(vid.getExterns(index).getName0()) || !isEmpty(vid.getExterns(index).getName1())
- || !isEmpty(vid.getExterns(index).getName2()) || !isEmpty(vid.getExterns(index).getName3())) {
- e = Extern.Factory.newInstance();
- if (!isEmpty(vid.getExterns(index).getName0())) {
- e.setDriverBinding(vid.getExterns(index).getName0());
- }
- if (!isEmpty(vid.getExterns(index).getName1())) {
- e.setComponentName(vid.getExterns(index).getName1());
- }
- if (!isEmpty(vid.getExterns(index).getName2())) {
- e.setDriverConfig(vid.getExterns(index).getName2());
- }
- if (!isEmpty(vid.getExterns(index).getName3())) {
- e.setDriverDiag(vid.getExterns(index).getName3());
- }
- }
- }
-
- //
- // Save common data
- //
- if (!isEmpty(vid.getExterns(index).getFeatureFlag())) {
- e.setFeatureFlag(vid.getExterns(index).getFeatureFlag());
- }
- if (vid.getExterns(index).getSupArchList() != null
- && vid.getExterns(index).getSupArchList().size() > 0) {
- e.setSupArchList(vid.getExterns(index).getSupArchList());
- }
-
- this.externs.addNewExtern();
- this.externs.setExternArray(this.externs.getExternList().size() - 1, e);
- }
- }
-
- this.msa.setExterns(externs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Externs", e.getMessage());
- Log.err("Update Externs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
deleted file mode 100644
index 5c9d329a55..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleGuids.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/** @file
-
- The file is used to create, update Guids of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.GuidUsage;
-import org.tianocore.GuidsDocument;
-import org.tianocore.GuidsDocument.Guids;
-import org.tianocore.GuidsDocument.Guids.GuidCNames;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.GuidsDlg;
-
-/**
- The class is used to create, update Guids of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleGuids extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 6710858997766979803L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private GuidsDocument.Guids guids = null;
-
- private GuidsIdentification id = null;
-
- private GuidsVector vid = new GuidsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Guids");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Guids inGuids) {
- init();
- this.guids = inGuids;
-
- if (this.guids != null) {
- if (this.guids.getGuidCNamesList().size() > 0) {
- for (int index = 0; index < this.guids.getGuidCNamesList().size(); index++) {
- String arg0 = guids.getGuidCNamesList().get(index).getGuidCName();
- String arg1 = null;
- if (guids.getGuidCNamesList().get(index).getUsage() != null) {
- arg1 = guids.getGuidCNamesList().get(index).getUsage().toString();
- }
-
- String arg2 = guids.getGuidCNamesList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(guids.getGuidCNamesList().get(index)
- .getSupArchList());
- String arg4 = guids.getGuidCNamesList().get(index).getHelpText();
-
- id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addGuids(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleGuids() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inGuids The input data of GuidsDocument.Guids
-
- **/
- public ModuleGuids(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getGuids());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- GuidsDlg dlg = new GuidsDlg(vid.getGuids(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addGuids(dlg.getId());
- } else {
- this.vid.setGuids(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Guids", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeGuids(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Guids
- if exists guids, set the value directly
- if not exists guids, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.guids = Guids.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- GuidCNames p = GuidCNames.Factory.newInstance();
- if (!isEmpty(vid.getGuids(index).getName())) {
- p.setGuidCName(vid.getGuids(index).getName());
- }
- if (!isEmpty(vid.getGuids(index).getUsage())) {
- p.setUsage(GuidUsage.Enum.forString(vid.getGuids(index).getUsage()));
- }
- if (!isEmpty(vid.getGuids(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getGuids(index).getFeatureFlag());
- }
- if (vid.getGuids(index).getSupArchList() != null && vid.getGuids(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getGuids(index).getSupArchList());
- }
- if (!isEmpty(vid.getGuids(index).getHelp())) {
- p.setHelpText(vid.getGuids(index).getHelp());
- }
- this.guids.addNewGuidCNames();
- this.guids.setGuidCNamesArray(guids.getGuidCNamesList().size() - 1, p);
- }
- }
-
- this.msa.setGuids(guids);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Guids", e.getMessage());
- Log.err("Update Guids", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java
deleted file mode 100644
index 5914b6a69a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHiiPackages.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update Formset of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.HiiPackageUsage;
-import org.tianocore.HiiPackagesDocument;
-import org.tianocore.HiiPackagesDocument.HiiPackages;
-import org.tianocore.HiiPackagesDocument.HiiPackages.HiiPackage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.HiiPackagesDlg;
-
-/**
- The class is used to create, update Formset of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleHiiPackages extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6851574146786158116L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private HiiPackagesDocument.HiiPackages hiiPackages = null;
-
- private HiiPackagesIdentification id = null;
-
- private HiiPackagesVector vid = new HiiPackagesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Hii Package C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hii Packages");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(HiiPackages inHiiPackages) {
- init();
- this.hiiPackages = inHiiPackages;
-
- if (this.hiiPackages != null) {
- if (this.hiiPackages.getHiiPackageList().size() > 0) {
- for (int index = 0; index < this.hiiPackages.getHiiPackageList().size(); index++) {
- String arg0 = hiiPackages.getHiiPackageList().get(index).getHiiCName();
- String arg1 = null;
- if (hiiPackages.getHiiPackageList().get(index).getUsage() != null) {
- arg1 = hiiPackages.getHiiPackageList().get(index).getUsage().toString();
- }
-
- String arg2 = hiiPackages.getHiiPackageList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(hiiPackages.getHiiPackageList().get(index)
- .getSupArchList());
- String arg4 = hiiPackages.getHiiPackageList().get(index).getHelpText();
-
- id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addHiiPackages(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleHiiPackages() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- *
- */
- /**
- This is the override edit constructor
-
- @param inFormsets The input data of HiiPackagesDocument.HiiPackages
-
- **/
- public ModuleHiiPackages(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getHiiPackages());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- HiiPackagesDlg dlg = new HiiPackagesDlg(vid.getHiiPackages(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addHiiPackages(dlg.getId());
- } else {
- this.vid.setHiiPackages(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Hii Packages", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeHiiPackages(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of hiiPackages
- if exists formset, set the value directly
- if not exists formset, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.hiiPackages = HiiPackages.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- HiiPackage p = HiiPackage.Factory.newInstance();
- if (!isEmpty(vid.getHiiPackages(index).getName())) {
- p.setHiiCName(vid.getHiiPackages(index).getName());
- }
- if (!isEmpty(vid.getHiiPackages(index).getUsage())) {
- p.setUsage(HiiPackageUsage.Enum.forString(vid.getHiiPackages(index).getUsage()));
- }
- if (!isEmpty(vid.getHiiPackages(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getHiiPackages(index).getFeatureFlag());
- }
- if (vid.getHiiPackages(index).getSupArchList() != null
- && vid.getHiiPackages(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getHiiPackages(index).getSupArchList());
- }
- if (!isEmpty(vid.getHiiPackages(index).getHelp())) {
- p.setHelpText(vid.getHiiPackages(index).getHelp());
- }
- this.hiiPackages.addNewHiiPackage();
- this.hiiPackages.setHiiPackageArray(hiiPackages.getHiiPackageList().size() - 1, p);
- }
- }
-
- this.msa.setHiiPackages(hiiPackages);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update hiiPackages", e.getMessage());
- Log.err("Update hiiPackages", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java
deleted file mode 100644
index 465ebee104..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleHobs.java
+++ /dev/null
@@ -1,471 +0,0 @@
-/** @file
-
- The file is used to create, update Hob of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.HobTypes;
-import org.tianocore.HobUsage;
-import org.tianocore.HobsDocument;
-import org.tianocore.HobsDocument.Hobs;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.HobsDlg;
-
-/**
- The class is used to create, update Hob of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleHobs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -553473437579358325L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private HobsDocument.Hobs hobs = null;
-
- private HobsIdentification id = null;
-
- private HobsVector vid = new HobsVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hobs");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Hobs inHobs) {
- init();
- this.hobs = inHobs;
-
- if (this.hobs != null) {
- if (this.hobs.getHobTypesList().size() > 0) {
- for (int index = 0; index < this.hobs.getHobTypesList().size(); index++) {
- String arg0 = hobs.getHobTypesList().get(index).getHobGuidCName();
- String arg1 = null;
- if (hobs.getHobTypesList().get(index).getHobType() != null) {
- arg1 = hobs.getHobTypesList().get(index).getHobType().toString();
- }
- String arg2 = null;
- if (hobs.getHobTypesList().get(index).getUsage() != null) {
- arg2 = hobs.getHobTypesList().get(index).getUsage().toString();
- }
-
- String arg3 = hobs.getHobTypesList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(hobs.getHobTypesList().get(index).getSupArchList());
- String arg5 = hobs.getHobTypesList().get(index).getHelpText();
- id = new HobsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addHobs(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleHobs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inHobs The input data of HobsDocument.Hobs
-
- **/
- public ModuleHobs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getHobs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- public JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- HobsDlg dlg = new HobsDlg(vid.getHobs(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addHobs(dlg.getId());
- } else {
- this.vid.setHobs(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Hobs", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeHobs(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Hobs
- if exists hobs, set the value directly
- if not exists hobs, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.hobs = Hobs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- HobsDocument.Hobs.HobTypes p = HobsDocument.Hobs.HobTypes.Factory.newInstance();
- if (!isEmpty(vid.getHobs(index).getName())) {
- p.setHobGuidCName(vid.getHobs(index).getName());
- }
- if (!isEmpty(vid.getHobs(index).getUsage())) {
- p.setUsage(HobUsage.Enum.forString(vid.getHobs(index).getUsage()));
- }
- if (!isEmpty(vid.getHobs(index).getType())) {
- p.setHobType(HobTypes.Enum.forString(vid.getHobs(index).getType()));
- }
- if (!isEmpty(vid.getHobs(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getHobs(index).getFeatureFlag());
- }
- if (vid.getHobs(index).getSupArchList() != null && vid.getHobs(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getHobs(index).getSupArchList());
- }
- this.hobs.addNewHobTypes();
- this.hobs.setHobTypesArray(hobs.getHobTypesList().size() - 1, p);
- }
- }
-
- this.msa.setHobs(hobs);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Hobs", e.getMessage());
- Log.err("Update Hobs", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
deleted file mode 100644
index 09685719fe..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleLibraryClassDefinitions.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/** @file
-
- The file is used to create, update Library Class Definition of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.LibraryClassDefinitionsDocument;
-import org.tianocore.LibraryUsage;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.LibraryClassDocument.LibraryClass;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.LibraryClassDefsDlg;
-
-/**
- The class is used to create, update Library Class Definition of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleLibraryClassDefinitions extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1743248695411382857L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not for UI
- //
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
-
- private LibraryClassDefinitions lcd = null;
-
- private LibraryClassVector vLibraryClass = new LibraryClassVector();
-
- private OpeningModuleType omt = null;
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 330, 90, 20));
- jButtonAdd.setPreferredSize(new Dimension(90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 330, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.setPreferredSize(new Dimension(90, 20));
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 330, 90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.setPreferredSize(new Dimension(90, 20));
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Library Class Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleLibraryClassDefinitions() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModuleLibraryClassDefinitions(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getLibraryClassDefinitions());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inLibraryClassDefinitions The input data of LibraryClassDefinitionsDocument.LibraryClassDefinitions
-
- **/
- private void init(LibraryClassDefinitionsDocument.LibraryClassDefinitions inLibraryClassDefinitions) {
- init();
- this.lcd = inLibraryClassDefinitions;
- if (this.lcd != null) {
- if (this.lcd.getLibraryClassList().size() > 0) {
- for (int index = 0; index < this.lcd.getLibraryClassList().size(); index++) {
- String name = lcd.getLibraryClassList().get(index).getKeyword();
- String usage = null;
- if (lcd.getLibraryClassList().get(index).getUsage() != null) {
- usage = lcd.getLibraryClassList().get(index).getUsage().toString();
- }
- String version = lcd.getLibraryClassList().get(index).getRecommendedInstanceVersion();
- String guid = lcd.getLibraryClassList().get(index).getRecommendedInstanceGuid();
- String featureFlag = lcd.getLibraryClassList().get(index).getFeatureFlag();
- Vector<String> arch = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupArchList());
- Vector<String> module = Tools.convertListToVector(lcd.getLibraryClassList().get(index)
- .getSupModuleList());
- String help = lcd.getLibraryClassList().get(index).getHelpText();
- LibraryClassIdentification lcid = new LibraryClassIdentification(name, usage, version, guid, arch,
- featureFlag, module, help);
- vLibraryClass.addLibraryClass(lcid);
- }
- }
- }
- //
- // Update the list
- //
- showTable();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setContentPane(getJScrollPane());
- this.setTitle("Library Class Definitions");
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 515));
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- /**
- Save all components of Mbd Header
- if exists mbdHeader, set the value directly
- if not exists mbdHeader, new an instance first
-
- **/
- public void save() {
- try {
- int intLibraryCount = this.vLibraryClass.size();
-
- lcd = LibraryClassDefinitions.Factory.newInstance();
- if (intLibraryCount > 0) {
- for (int index = 0; index < intLibraryCount; index++) {
- LibraryClass mLibraryClass = LibraryClass.Factory.newInstance();
-
- mLibraryClass.setKeyword(vLibraryClass.getLibraryClass(index).getLibraryClassName());
- mLibraryClass
- .setUsage(LibraryUsage.Enum.forString(vLibraryClass.getLibraryClass(index).getUsage()));
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getRecommendedInstanceVersion())) {
- mLibraryClass.setRecommendedInstanceVersion(vLibraryClass.getLibraryClass(index)
- .getRecommendedInstanceVersion());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getRecommendedInstanceGuid())) {
- mLibraryClass.setRecommendedInstanceGuid(vLibraryClass.getLibraryClass(index)
- .getRecommendedInstanceGuid());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getFeatureFlag())) {
- mLibraryClass.setFeatureFlag(vLibraryClass.getLibraryClass(index).getFeatureFlag());
- }
- if (vLibraryClass.getLibraryClass(index).getSupArchList() != null
- && vLibraryClass.getLibraryClass(index).getSupArchList().size() > 0) {
- mLibraryClass.setSupArchList(vLibraryClass.getLibraryClass(index).getSupArchList());
- }
- if (vLibraryClass.getLibraryClass(index).getSupModuleList() != null
- && vLibraryClass.getLibraryClass(index).getSupModuleList().size() > 0) {
- mLibraryClass.setSupModuleList(vLibraryClass.getLibraryClass(index).getSupModuleList());
- }
- if (!isEmpty(vLibraryClass.getLibraryClass(index).getHelp())) {
- mLibraryClass.setHelpText(vLibraryClass.getLibraryClass(index).getHelp());
- }
-
- this.lcd.addNewLibraryClass();
- this.lcd.setLibraryClassArray(index, mLibraryClass);
- }
- }
-
- if (msa.getLibraryClassDefinitions() == null) {
- this.msa.addNewLibraryClassDefinitions();
- }
- this.msa.setLibraryClassDefinitions(this.lcd);
-
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Library Class Definitions", e.getMessage());
- Log.err("Update Library Class Definitions", e.getMessage());
- }
- }
-
- private void showEdit(int index) {
- LibraryClassDefsDlg mcdd = new LibraryClassDefsDlg(vLibraryClass.getLibraryClass(index), this.parentFrame, omt.getId());
- int result = mcdd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vLibraryClass.addLibraryClass(mcdd.getLcid());
- } else {
- this.vLibraryClass.setLibraryClass(mcdd.getLcid(), index);
- }
- this.showTable();
- this.save();
- mcdd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- mcdd.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Library Class Definitions", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vLibraryClass.removeLibraryClass(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vLibraryClass.size() > 0) {
- for (int index = 0; index < vLibraryClass.size(); index++) {
- model.addRow(vLibraryClass.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
deleted file mode 100644
index a50475527b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePCDs.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/** @file
-
- The file is used to create, update PCD of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.PcdCodedDocument;
-import org.tianocore.PcdItemTypes;
-import org.tianocore.PcdUsage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PcdCodedDocument.PcdCoded;
-import org.tianocore.PcdCodedDocument.PcdCoded.PcdEntry;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PCDsDlg;
-
-/**
- The class is used to create, update PCD of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModulePCDs extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 2227717658188438696L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PcdCodedDocument.PcdCoded pcds = null;
-
- private PcdCodedIdentification id = null;
-
- private PcdCodedVector vid = new PcdCodedVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 245, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 245, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 245, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Type");
- model.addColumn("Value");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Pcd Coded");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PcdCoded inPcdCodeds) {
- init();
- this.pcds = inPcdCodeds;
-
- if (this.pcds != null) {
- if (this.pcds.getPcdEntryList().size() > 0) {
- for (int index = 0; index < this.pcds.getPcdEntryList().size(); index++) {
- String arg0 = pcds.getPcdEntryList().get(index).getCName();
- String arg1 = pcds.getPcdEntryList().get(index).getTokenSpaceGuidCName();
-
- String arg2 = pcds.getPcdEntryList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(pcds.getPcdEntryList().get(index).getSupArchList());
-
- String arg4 = pcds.getPcdEntryList().get(index).getDefaultValue();
- String arg5 = pcds.getPcdEntryList().get(index).getHelpText();
- String arg6 = null;
- if (pcds.getPcdEntryList().get(index).getPcdItemType() != null) {
- arg6 = pcds.getPcdEntryList().get(index).getPcdItemType().toString();
- }
- String arg7 = null;
- if (pcds.getPcdEntryList().get(index).getUsage() != null) {
- arg7 = pcds.getPcdEntryList().get(index).getUsage().toString();
- }
- id = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- vid.addPcdCoded(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePCDs() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inPcds The input data of PCDsDocument.PCDs
-
- **/
- public ModulePCDs(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPcdCoded());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PCDsDlg dlg = new PCDsDlg(vid.getPcdCoded(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPcdCoded(dlg.getId());
- } else {
- this.vid.setPcdCoded(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update PcdCoded", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePcdCoded(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of PCDs
- if exists pcds, set the value directly
- if not exists pcds, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.pcds = PcdCoded.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- PcdEntry p = PcdEntry.Factory.newInstance();
- if (!isEmpty(vid.getPcdCoded(index).getName())) {
- p.setCName(vid.getPcdCoded(index).getName());
- }
- if (!isEmpty(vid.getPcdCoded(index).getGuid())) {
- p.setTokenSpaceGuidCName(vid.getPcdCoded(index).getGuid());
- }
- if (!isEmpty(vid.getPcdCoded(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPcdCoded(index).getFeatureFlag());
- }
- if (vid.getPcdCoded(index).getSupArchList() != null
- && vid.getPcdCoded(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPcdCoded(index).getSupArchList());
- }
- if (!isEmpty(vid.getPcdCoded(index).getValue())) {
- p.setDefaultValue(vid.getPcdCoded(index).getValue());
- }
- if (!isEmpty(vid.getPcdCoded(index).getHelp())) {
- p.setHelpText(vid.getPcdCoded(index).getHelp());
- }
- if (!isEmpty(vid.getPcdCoded(index).getType())) {
- p.setPcdItemType(PcdItemTypes.Enum.forString(vid.getPcdCoded(index).getType()));
- }
- if (!isEmpty(vid.getPcdCoded(index).getUsage())) {
- p.setUsage(PcdUsage.Enum.forString(vid.getPcdCoded(index).getUsage()));
- }
- this.pcds.addNewPcdEntry();
- this.pcds.setPcdEntryArray(pcds.getPcdEntryList().size() - 1, p);
- }
- }
-
- this.msa.setPcdCoded(pcds);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update PcdCoded", e.getMessage());
- Log.err("Update PcdCoded", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java
deleted file mode 100644
index 3077f3d251..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePackageDependencies.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/** @file
-
- The file is used to create, update Include of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PackageDependenciesDocument.PackageDependencies;
-import org.tianocore.PackageDependenciesDocument.PackageDependencies.Package;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PackageDepDlg;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- The class is used to create, update Include of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModulePackageDependencies extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 3465193035145152131L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PackageDependencies pd = null;
-
- private PackageDependenciesIdentification pdid = null;
-
- private PackageDependenciesVector vid = new PackageDependenciesVector();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<PackageIdentification> vPackage = wt.getAllPackages();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 445, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 445, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 445, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Package Name");
- model.addColumn("Package Version");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePackageDependencies() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModulePackageDependencies(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPackageDependencies());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Package Dependencies");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PackageDependencies inPackageDependencies) {
- init();
- this.pd = inPackageDependencies;
-
- if (this.pd != null) {
- if (this.pd.getPackageList().size() > 0) {
- for (int index = 0; index < this.pd.getPackageList().size(); index++) {
- String arg0 = "";
- String arg1 = pd.getPackageList().get(index).getPackageVersion();
- String arg2 = pd.getPackageList().get(index).getPackageGuid();
- //
- // If no guid, skip current item
- //
- if (arg2 == null) {
- continue;
- }
- for (int indexJ = 0; indexJ < this.vPackage.size(); indexJ++) {
- if (vPackage.get(indexJ).getGuid().equals(arg2)) {
- arg0 = vPackage.get(indexJ).getName();
- }
- }
- String arg3 = pd.getPackageList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(pd.getPackageList().get(index).getSupArchList());
- pdid = new PackageDependenciesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addPackageDependencies(pdid);
- }
- }
- }
- showTable();
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PackageDepDlg pdd = new PackageDepDlg(vid.getPackageDependencies(index), this.parentFrame, omt.getId());
- int result = pdd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPackageDependencies(pdd.getPdid());
- } else {
- this.vid.setPackageDependencies(pdd.getPdid(), index);
- }
- this.showTable();
- this.save();
- pdd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- pdd.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Package Dependencies", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePackageDependencies(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Includes
- if exists includes, set the value directly
- if not exists includes, new an instance first
-
- **/
- public void save() {
- try {
- //
- //Save as file name
- //
- int count = this.vid.size();
-
- this.pd = PackageDependencies.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Package p = Package.Factory.newInstance();
-
- if (!isEmpty(vid.getPackageDependencies(index).getVersion())) {
- p.setPackageVersion(vid.getPackageDependencies(index).getVersion());
- }
- if (!isEmpty(vid.getPackageDependencies(index).getGuid())) {
- p.setPackageGuid(vid.getPackageDependencies(index).getGuid());
- }
- if (!isEmpty(vid.getPackageDependencies(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPackageDependencies(index).getFeatureFlag());
- }
- if (vid.getPackageDependencies(index).getSupArchList() != null
- && vid.getPackageDependencies(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPackageDependencies(index).getSupArchList());
- }
-
- this.pd.addNewPackage();
- this.pd.setPackageArray(index, p);
- }
- }
- this.msa.setPackageDependencies(pd);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Package Dependencies", e.getMessage());
- Log.err("Update Package Dependencies", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
deleted file mode 100644
index c7a3e424e9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModulePpis.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/** @file
-
- The file is used to create, update Ppi of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.PPIsDocument;
-import org.tianocore.PpiNotifyUsage;
-import org.tianocore.PpiUsage;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.PPIsDocument.PPIs;
-import org.tianocore.PPIsDocument.PPIs.Ppi;
-import org.tianocore.PPIsDocument.PPIs.PpiNotify;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.PpisDlg;
-
-/**
- The class is used to create, update Ppi of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModulePpis extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -4284901202357037724L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
-
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private PPIsDocument.PPIs ppis = null;
-
- private PpisIdentification id = null;
-
- private PpisVector vid = new PpisVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Ppis");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(PPIs inPpis) {
- init();
- this.ppis = inPpis;
-
- if (this.ppis != null) {
- if (this.ppis.getPpiList().size() > 0) {
- for (int index = 0; index < this.ppis.getPpiList().size(); index++) {
- String arg0 = ppis.getPpiList().get(index).getPpiCName();
- String arg1 = ed.getVPpiType().get(0);
- String arg2 = null;
- if (ppis.getPpiList().get(index).getUsage() != null) {
- arg2 = ppis.getPpiList().get(index).getUsage().toString();
- }
-
- String arg3 = ppis.getPpiList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(ppis.getPpiList().get(index).getSupArchList());
- String arg5 = ppis.getPpiList().get(index).getHelpText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addPpis(id);
- }
- }
- if (this.ppis.getPpiNotifyList().size() > 0) {
- for (int index = 0; index < this.ppis.getPpiNotifyList().size(); index++) {
- String arg0 = ppis.getPpiNotifyList().get(index).getPpiNotifyCName();
- String arg1 = ed.getVPpiType().get(1);
- String arg2 = null;
- if (ppis.getPpiNotifyList().get(index).getUsage() != null) {
- arg2 = ppis.getPpiNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = ppis.getPpiNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools
- .convertListToVector(ppis.getPpiNotifyList().get(index).getSupArchList());
- String arg5 = ppis.getPpiNotifyList().get(index).getHelpText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addPpis(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModulePpis() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inPpis The input data of PPIsDocument.PPIs
-
- **/
- public ModulePpis(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getPPIs());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- PpisDlg dlg = new PpisDlg(vid.getPpis(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addPpis(dlg.getId());
- } else {
- this.vid.setPpis(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Ppis", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removePpis(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of PPIs
- if exists ppis, set the value directly
- if not exists ppis, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.ppis = PPIs.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getPpis(index).getType().equals(ed.getVPpiType().get(0))) {
- Ppi p = Ppi.Factory.newInstance();
- if (!isEmpty(vid.getPpis(index).getName())) {
- p.setPpiCName(vid.getPpis(index).getName());
- }
- if (!isEmpty(vid.getPpis(index).getUsage())) {
- p.setUsage(PpiUsage.Enum.forString(vid.getPpis(index).getUsage()));
- }
- if (!isEmpty(vid.getPpis(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPpis(index).getFeatureFlag());
- }
- if (vid.getPpis(index).getSupArchList() != null
- && vid.getPpis(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPpis(index).getSupArchList());
- }
- if (!isEmpty(vid.getPpis(index).getHelp())) {
- p.setHelpText(vid.getPpis(index).getHelp());
- }
- this.ppis.addNewPpi();
- this.ppis.setPpiArray(ppis.getPpiList().size() - 1, p);
- }
- if (vid.getPpis(index).getType().equals(ed.getVPpiType().get(1))) {
- PpiNotify p = PpiNotify.Factory.newInstance();
- if (!isEmpty(vid.getPpis(index).getName())) {
- p.setPpiNotifyCName(vid.getPpis(index).getName());
- }
- if (!isEmpty(vid.getPpis(index).getUsage())) {
- p.setUsage(PpiNotifyUsage.Enum.forString(vid.getPpis(index).getUsage()));
- }
- if (!isEmpty(vid.getPpis(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getPpis(index).getFeatureFlag());
- }
- if (vid.getPpis(index).getSupArchList() != null
- && vid.getPpis(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getPpis(index).getSupArchList());
- }
- if (!isEmpty(vid.getPpis(index).getHelp())) {
- p.setHelpText(vid.getPpis(index).getHelp());
- }
- this.ppis.addNewPpiNotify();
- this.ppis.setPpiNotifyArray(ppis.getPpiNotifyList().size() - 1, p);
- }
- }
- }
-
- this.msa.setPPIs(ppis);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Ppis", e.getMessage());
- Log.err("Update Ppis", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
deleted file mode 100644
index 61c5dd80ae..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleProtocols.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/** @file
-
- The file is used to create, update Protocol of MSA/MBD file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.ProtocolNotifyUsage;
-import org.tianocore.ProtocolUsage;
-import org.tianocore.ProtocolsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.ProtocolsDocument.Protocols;
-import org.tianocore.ProtocolsDocument.Protocols.Protocol;
-import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.ProtocolsDlg;
-
-/**
- The class is used to create, update Protocol of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleProtocols extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -9084913640747858848L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private ProtocolsDocument.Protocols protocols = null;
-
- private ProtocolsIdentification id = null;
-
- private ProtocolsVector vid = new ProtocolsVector();
-
- private EnumerationData ed = new EnumerationData();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Type");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Protocols");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Protocols inProtocols) {
- init();
- this.protocols = inProtocols;
-
- if (this.protocols != null) {
- if (this.protocols.getProtocolList().size() > 0) {
- for (int index = 0; index < this.protocols.getProtocolList().size(); index++) {
- String arg0 = protocols.getProtocolList().get(index).getProtocolCName();
- String arg1 = ed.getVProtocolType().get(0);
- String arg2 = null;
- if (protocols.getProtocolList().get(index).getUsage() != null) {
- arg2 = protocols.getProtocolList().get(index).getUsage().toString();
- }
-
- String arg3 = protocols.getProtocolList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(protocols.getProtocolList().get(index)
- .getSupArchList());
- String arg5 = protocols.getProtocolList().get(index).getHelpText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addProtocols(id);
- }
- }
- if (this.protocols.getProtocolNotifyList().size() > 0) {
- for (int index = 0; index < this.protocols.getProtocolNotifyList().size(); index++) {
- String arg0 = protocols.getProtocolNotifyList().get(index).getProtocolNotifyCName();
- String arg1 = ed.getVProtocolType().get(1);
- String arg2 = null;
- if (protocols.getProtocolNotifyList().get(index).getUsage() != null) {
- arg2 = protocols.getProtocolNotifyList().get(index).getUsage().toString();
- }
-
- String arg3 = protocols.getProtocolNotifyList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(protocols.getProtocolNotifyList().get(index)
- .getSupArchList());
- String arg5 = protocols.getProtocolNotifyList().get(index).getHelpText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addProtocols(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleProtocols() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inProtocol The input data of ProtocolsDocument.Protocols
-
- **/
- public ModuleProtocols(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getProtocols());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- ProtocolsDlg dlg = new ProtocolsDlg(vid.getProtocols(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addProtocols(dlg.getId());
- } else {
- this.vid.setProtocols(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Protocols", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeProtocols(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Protocols
- if exists protocols, set the value directly
- if not exists protocols, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.protocols = Protocols.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- if (vid.getProtocols(index).getType().equals(ed.getVProtocolType().get(0))) {
- Protocol p = Protocol.Factory.newInstance();
- if (!isEmpty(vid.getProtocols(index).getName())) {
- p.setProtocolCName(vid.getProtocols(index).getName());
- }
- if (!isEmpty(vid.getProtocols(index).getUsage())) {
- p.setUsage(ProtocolUsage.Enum.forString(vid.getProtocols(index).getUsage()));
- }
- if (!isEmpty(vid.getProtocols(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getProtocols(index).getFeatureFlag());
- }
- if (vid.getProtocols(index).getSupArchList() != null
- && vid.getProtocols(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getProtocols(index).getSupArchList());
- }
- if (!isEmpty(vid.getProtocols(index).getHelp())) {
- p.setHelpText(vid.getProtocols(index).getHelp());
- }
- this.protocols.addNewProtocol();
- this.protocols.setProtocolArray(protocols.getProtocolList().size() - 1, p);
- }
- if (vid.getProtocols(index).getType().equals(ed.getVProtocolType().get(1))) {
- ProtocolNotify p = ProtocolNotify.Factory.newInstance();
- if (!isEmpty(vid.getProtocols(index).getName())) {
- p.setProtocolNotifyCName(vid.getProtocols(index).getName());
- }
- if (!isEmpty(vid.getProtocols(index).getUsage())) {
- p.setUsage(ProtocolNotifyUsage.Enum.forString(vid.getProtocols(index).getUsage()));
- }
- if (!isEmpty(vid.getProtocols(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getProtocols(index).getFeatureFlag());
- }
- if (vid.getProtocols(index).getSupArchList() != null
- && vid.getProtocols(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getProtocols(index).getSupArchList());
- }
- if (!isEmpty(vid.getProtocols(index).getHelp())) {
- p.setHelpText(vid.getProtocols(index).getHelp());
- }
- this.protocols.addNewProtocolNotify();
- this.protocols.setProtocolNotifyArray(protocols.getProtocolNotifyList().size() - 1, p);
- }
- }
- }
-
- this.msa.setProtocols(protocols);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Protocols", e.getMessage());
- Log.err("Update Protocols", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
deleted file mode 100644
index 0d31e10525..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSourceFiles.java
+++ /dev/null
@@ -1,491 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFile of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.SourceFilesDocument;
-import org.tianocore.FilenameDocument.Filename;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.SourceFilesDocument.SourceFiles;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.SourceFilesDlg;
-
-/**
- The class is used to create, update SourceFile of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleSourceFiles extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private SourceFilesDocument.SourceFiles sourceFiles = null;
-
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JCheckBox jCheckBoxArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private SourceFilesVector vSourceFiles = new SourceFilesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jScrollPaneTable
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("File Name");
- model.addColumn("Tag Name");
- model.addColumn("Tool Code");
- model.addColumn("Tool Chain Family");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleSourceFiles() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param
-
- **/
- public ModuleSourceFiles(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getSourceFiles());
- this.setVisible(true);
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(SourceFilesDocument.SourceFiles inSourceFiles) {
- init();
- this.sourceFiles = inSourceFiles;
-
- if (this.sourceFiles != null) {
- if (this.sourceFiles.getFilenameList().size() > 0) {
- for (int index = 0; index < this.sourceFiles.getFilenameList().size(); index++) {
- String name = sourceFiles.getFilenameList().get(index).getStringValue();
- String tagName = sourceFiles.getFilenameList().get(index).getTagName();
- String toolCode = sourceFiles.getFilenameList().get(index).getToolCode();
- String tcf = sourceFiles.getFilenameList().get(index).getToolChainFamily();
- String featureFlag = sourceFiles.getFilenameList().get(index).getFeatureFlag();
- Vector<String> arch = Tools.convertListToVector(sourceFiles.getFilenameList().get(index)
- .getSupArchList());
- SourceFilesIdentification sfid = new SourceFilesIdentification(name, tagName, toolCode, tcf,
- featureFlag, arch);
- vSourceFiles.addSourceFiles(sfid);
- }
- }
- }
- showTable();
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jButtonAdd.setEnabled(!isView);
- this.jButtonRemove.setEnabled(!isView);
- this.jButtonUpdate.setEnabled(!isView);
- this.jCheckBoxArch.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- /**
- Save all components of SourceFiles
- if exists sourceFiles, set the value directly
- if not exists sourceFiles, new an instance first
-
- **/
- public void save() {
- try {
- //
- //Save as file name
- //
- int count = this.vSourceFiles.size();
-
- this.sourceFiles = SourceFiles.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Filename mFilename = Filename.Factory.newInstance();
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getFilename())) {
- mFilename.setStringValue(vSourceFiles.getSourceFiles(index).getFilename());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getTagName())) {
- mFilename.setTagName(vSourceFiles.getSourceFiles(index).getTagName());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getToolCode())) {
- mFilename.setToolCode(vSourceFiles.getSourceFiles(index).getToolCode());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getToolChainFamily())) {
- mFilename.setToolChainFamily(vSourceFiles.getSourceFiles(index).getToolChainFamily());
- }
- if (!isEmpty(vSourceFiles.getSourceFiles(index).getFeatureFlag())) {
- mFilename.setFeatureFlag(vSourceFiles.getSourceFiles(index).getFeatureFlag());
- }
- if (vSourceFiles.getSourceFiles(index).getSupArchList() != null
- && vSourceFiles.getSourceFiles(index).getSupArchList().size() > 0) {
- mFilename.setSupArchList(vSourceFiles.getSourceFiles(index).getSupArchList());
- }
-
- this.sourceFiles.addNewFilename();
- this.sourceFiles.setFilenameArray(index, mFilename);
- }
- }
- this.msa.setSourceFiles(sourceFiles);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Source Files", e.getMessage());
- Log.err("Update Source Files", e.getMessage());
- }
- }
-
- private void showEdit(int index) {
- SourceFilesDlg sfd = new SourceFilesDlg(this.vSourceFiles.getSourceFiles(index), this.parentFrame, omt.getId());
- int result = sfd.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- for (int indexI = 0; indexI < sfd.getSfid().length; indexI++) {
- this.vSourceFiles.addSourceFiles(sfd.getSfid()[indexI]);
- }
- } else {
- this.vSourceFiles.setSourceFiles(sfd.getSfid()[0], index);
- }
- this.showTable();
- this.save();
- sfd.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- sfd.dispose();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Source Files", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vSourceFiles.removeSourceFiles(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vSourceFiles.size() > 0) {
- for (int index = 0; index < vSourceFiles.size(); index++) {
- model.addRow(vSourceFiles.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- //this.jScrollPane.setViewportView(this.jTable);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java
deleted file mode 100644
index 8bcb18c1de..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleSystemTables.java
+++ /dev/null
@@ -1,469 +0,0 @@
-/** @file
-
- The file is used to create, update SystemTable of MSA/MBD file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.SystemTableUsage;
-import org.tianocore.SystemTablesDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.SystemTablesDocument.SystemTables;
-import org.tianocore.SystemTablesDocument.SystemTables.SystemTableCNames;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.SystemTablesDlg;
-
-/**
- The class is used to create, update SystemTable of MSA/MBD file
- It extends IInternalFrame
-
-
-
- **/
-public class ModuleSystemTables extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 7488769180379442276L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private SystemTablesDocument.SystemTables systemTables = null;
-
- private SystemTablesIdentification id = null;
-
- private SystemTablesVector vid = new SystemTablesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 195, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 195, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 195, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("System Tables");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inSystemTables
-
- **/
- private void init(SystemTables inSystemTables) {
- init();
- this.systemTables = inSystemTables;
-
- if (this.systemTables != null) {
- if (this.systemTables.getSystemTableCNamesList().size() > 0) {
- for (int index = 0; index < this.systemTables.getSystemTableCNamesList().size(); index++) {
- String arg0 = systemTables.getSystemTableCNamesList().get(index).getSystemTableCName();
- String arg1 = null;
- if (systemTables.getSystemTableCNamesList().get(index).getUsage() != null) {
- arg1 = systemTables.getSystemTableCNamesList().get(index).getUsage().toString();
- }
-
- String arg2 = systemTables.getSystemTableCNamesList().get(index).getFeatureFlag();
- Vector<String> arg3 = Tools.convertListToVector(systemTables.getSystemTableCNamesList().get(index)
- .getSupArchList());
- String arg4 = systemTables.getSystemTableCNamesList().get(index).getHelpText();
-
- id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4);
- vid.addSystemTables(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleSystemTables() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inSystemTables The input data of SystemTablesDocument.SystemTables
-
- **/
- public ModuleSystemTables(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getSystemTables());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- SystemTablesDlg dlg = new SystemTablesDlg(vid.getSystemTables(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addSystemTables(dlg.getId());
- } else {
- this.vid.setSystemTables(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update System Tables", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeSystemTables(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of SystemTables
- if exists systemTables, set the value directly
- if not exists systemTables, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.systemTables = SystemTables.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- SystemTableCNames p = SystemTableCNames.Factory.newInstance();
- if (!isEmpty(vid.getSystemTables(index).getName())) {
- p.setSystemTableCName(vid.getSystemTables(index).getName());
- }
- if (!isEmpty(vid.getSystemTables(index).getUsage())) {
- p.setUsage(SystemTableUsage.Enum.forString(vid.getSystemTables(index).getUsage()));
- }
- if (!isEmpty(vid.getSystemTables(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getSystemTables(index).getFeatureFlag());
- }
- if (vid.getSystemTables(index).getSupArchList() != null
- && vid.getSystemTables(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getSystemTables(index).getSupArchList());
- }
- if (!isEmpty(vid.getSystemTables(index).getHelp())) {
- p.setHelpText(vid.getSystemTables(index).getHelp());
- }
- this.systemTables.addNewSystemTableCNames();
- this.systemTables.setSystemTableCNamesArray(systemTables.getSystemTableCNamesList().size() - 1, p);
- }
- }
-
- this.msa.setSystemTables(systemTables);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update System Tables", e.getMessage());
- Log.err("Update System Tables", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java
deleted file mode 100644
index 29eb4ff852..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/ModuleVariables.java
+++ /dev/null
@@ -1,472 +0,0 @@
-/** @file
-
- The file is used to create, update Variable of MSA/MBD file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.MouseEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-
-import org.tianocore.VariableUsage;
-import org.tianocore.VariablesDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.VariablesDocument.Variables;
-import org.tianocore.VariablesDocument.Variables.Variable;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesVector;
-import org.tianocore.frameworkwizard.module.ui.dialog.VariablesDlg;
-
-/**
- The class is used to create, update Variable of MSA/MBD file
- It extends IInternalFrame
-
- **/
-public class ModuleVariables extends IInternalFrame {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6998982978030439446L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonUpdate = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JTable jTable = null;
-
- //
- // Not used by UI
- //
- private OpeningModuleType omt = null;
-
- private ModuleSurfaceArea msa = null;
-
- private VariablesDocument.Variables variables = null;
-
- private VariablesIdentification id = null;
-
- private VariablesVector vid = new VariablesVector();
-
- private IDefaultTableModel model = null;
-
- private int selectedRow = -1;
-
- private IFrame parentFrame = null;
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton jButtonAdd
-
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(230, 220, 90, 20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- jButtonAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton jButtonRemove
-
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(400, 220, 90, 20));
- jButtonRemove.setText("Remove");
- jButtonRemove.addActionListener(this);
- jButtonRemove.setPreferredSize(new java.awt.Dimension(90, 20));
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonUpdate
-
- @return javax.swing.JButton jButtonUpdate
-
- **/
- private JButton getJButtonUpdate() {
- if (jButtonUpdate == null) {
- jButtonUpdate = new JButton();
- jButtonUpdate.setBounds(new java.awt.Rectangle(315, 220, 90, 20));
- jButtonUpdate.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonUpdate.setText("Edit");
- jButtonUpdate.addActionListener(this);
- }
- return jButtonUpdate;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(15, 10, 470, 420));
- jScrollPaneTable.setPreferredSize(new Dimension(470, 420));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- jTable = new JTable();
- model = new IDefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
-
- model.addColumn("Name");
- model.addColumn("Guid C_Name");
- model.addColumn("Usage");
-
- jTable.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(this);
- jTable.getModel().addTableModelListener(this);
- jTable.addMouseListener(this);
- }
- return jTable;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(500, 515);
- this.setContentPane(getJScrollPane());
- this.setTitle("Variables");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inPackageDependencies
-
- **/
- private void init(Variables inVariables) {
- init();
- this.variables = inVariables;
-
- if (this.variables != null) {
- if (this.variables.getVariableList().size() > 0) {
- for (int index = 0; index < this.variables.getVariableList().size(); index++) {
- String arg0 = Tools.convertUnicodeHexStringToString(variables.getVariableList().get(index)
- .getVariableName());
- String arg1 = variables.getVariableList().get(index).getGuidCName();
- String arg2 = null;
- if (variables.getVariableList().get(index).getUsage() != null) {
- arg2 = variables.getVariableList().get(index).getUsage().toString();
- }
-
- String arg3 = variables.getVariableList().get(index).getFeatureFlag();
- Vector<String> arg4 = Tools.convertListToVector(variables.getVariableList().get(index)
- .getSupArchList());
- String arg5 = variables.getVariableList().get(index).getHelpText();
- id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- vid.addVariables(id);
- }
- }
- }
- showTable();
- }
-
- /**
- This is the default constructor
-
- **/
- public ModuleVariables() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inVariables The input data of VariablesDocument.Variables
-
- **/
- public ModuleVariables(OpeningModuleType inOmt, IFrame iFrame) {
- super();
- this.omt = inOmt;
- this.msa = omt.getXmlMsa();
- this.parentFrame = iFrame;
- init(msa.getVariables());
- this.setVisible(true);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(490, 490));
-
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonUpdate(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- }
- return jContentPane;
- }
-
- private void showEdit(int index) {
- VariablesDlg dlg = new VariablesDlg(vid.getVariables(index), this.parentFrame, omt.getId());
- int result = dlg.showDialog();
- if (result == DataType.RETURN_TYPE_OK) {
- if (index == -1) {
- this.vid.addVariables(dlg.getId());
- } else {
- this.vid.setVariables(dlg.getId(), index);
- }
- this.showTable();
- this.save();
- dlg.dispose();
- }
- if (result == DataType.RETURN_TYPE_CANCEL) {
- dlg.dispose();
- }
- }
-
- /**
- Clear all table rows
-
- **/
- private void clearAll() {
- if (model != null) {
- for (int index = model.getRowCount() - 1; index >= 0; index--) {
- model.removeRow(index);
- }
- }
- }
-
- /**
- Read content of vector and put then into table
-
- **/
- private void showTable() {
- clearAll();
-
- if (vid.size() > 0) {
- for (int index = 0; index < vid.size(); index++) {
- model.addRow(vid.toStringVector(index));
- }
- }
- this.jTable.repaint();
- this.jTable.updateUI();
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonAdd) {
- showEdit(-1);
- }
- if (arg0.getSource() == jButtonUpdate) {
- if (this.selectedRow < 0) {
- Log.wrn("Update Variables", "Please select one record first.");
- return;
- }
- showEdit(selectedRow);
- }
-
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
-
- int selectedRows[] = this.jTable.getSelectedRows();
-
- if (selectedRows != null) {
- for (int index = selectedRows.length - 1; index > -1; index--) {
- this.model.removeRow(selectedRows[index]);
- this.vid.removeVariables(selectedRows[index]);
- }
- selectedRow = -1;
- this.save();
- }
- }
- }
-
- /**
- Save all components of Variables
- if exists variables, set the value directly
- if not exists variables, new an instance first
-
- **/
- public void save() {
- try {
- int count = this.vid.size();
-
- this.variables = Variables.Factory.newInstance();
- if (count > 0) {
- for (int index = 0; index < count; index++) {
- Variable p = Variable.Factory.newInstance();
- if (!isEmpty(vid.getVariables(index).getName())) {
- p.setVariableName(Tools.convertStringToUnicodeHexString(vid.getVariables(index).getName()));
- }
- if (!isEmpty(vid.getVariables(index).getGuid())) {
- p.setGuidCName(vid.getVariables(index).getGuid());
- }
- if (!isEmpty(vid.getVariables(index).getUsage())) {
- p.setUsage(VariableUsage.Enum.forString(vid.getVariables(index).getUsage()));
- }
- if (!isEmpty(vid.getVariables(index).getFeatureFlag())) {
- p.setFeatureFlag(vid.getVariables(index).getFeatureFlag());
- }
- if (vid.getVariables(index).getSupArchList() != null
- && vid.getVariables(index).getSupArchList().size() > 0) {
- p.setSupArchList(vid.getVariables(index).getSupArchList());
- }
- if (!isEmpty(vid.getVariables(index).getHelp())) {
- p.setHelpText(vid.getVariables(index).getHelp());
- }
- this.variables.addNewVariable();
- this.variables.setVariableArray(variables.getVariableList().size() - 1, p);
- }
- }
-
- this.msa.setVariables(variables);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Update Variables", e.getMessage());
- Log.err("Update Variables", e.getMessage());
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
- *
- */
- public void valueChanged(ListSelectionEvent arg0) {
- if (arg0.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) arg0.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
- *
- */
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getClickCount() == 2) {
- if (this.selectedRow < 0) {
- return;
- } else {
- showEdit(selectedRow);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intCurrentHeight = this.getJContentPane().getHeight();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
- int intPreferredHeight = this.getJContentPane().getPreferredSize().height;
-
- Tools.resizeComponent(this.jScrollPaneTable, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight);
- Tools.relocateComponent(this.jButtonAdd, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_ADD_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_ADD_BUTTON);
- Tools.relocateComponent(this.jButtonRemove, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_REMOVE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_REMOVE_BUTTON);
- Tools.relocateComponent(this.jButtonUpdate, intCurrentWidth, intCurrentHeight, intPreferredWidth,
- intPreferredHeight, DataType.SPACE_TO_RIGHT_FOR_UPDATE_BUTTON,
- DataType.SPACE_TO_BOTTOM_FOR_UPDATE_BUTTON);
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
deleted file mode 100644
index 4284af2b10..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/MsaHeader.java
+++ /dev/null
@@ -1,1696 +0,0 @@
-/** @file
-
- The file is used to create, update MsaHeader of MSA file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.FocusEvent;
-import java.awt.event.ItemEvent;
-import java.util.Vector;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.ExternsDocument;
-import org.tianocore.ModuleDefinitionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.PcdDriverTypes;
-import org.tianocore.LicenseDocument.License;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningModuleType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import javax.swing.JRadioButton;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-/**
- The class is used to create, update MsaHeader of MSA file
- It extends IInternalFrame
-
-
-
- **/
-public class MsaHeader extends IInternalFrame implements DocumentListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8152099582923006900L;
-
- private int dialogWidth = 500;
-
- private int dialogHeight = 630;
-
- private final int labelWidth = 155;
-
- private int valueWidth = 320;
-
- private final int labelCol = 12;
-
- private final int valueCol = 168;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelLicense = null;
-
- private JTextArea jTextAreaLicense = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jLabelDescription = null;
-
- private JTextArea jTextAreaDescription = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneLicense = null;
-
- private JScrollPane jScrollPaneDescription = null;
-
- private JLabel jLabelAbstract = null;
-
- private JTextField jTextFieldAbstract = null;
-
- private JLabel jLabelModuleType = null;
-
- private JComboBox jComboBoxModuleType = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelBinaryModule = null;
-
- private JLabel jLabelOutputFileBasename = null;
-
- private JTextField jTextFieldOutputFileBasename = null;
-
- private JScrollPane jScrollPaneCopyright = null;
-
- private JTextArea jTextAreaCopyright = null;
-
- private JLabel jLabelURL = null;
-
- private JTextField jTextFieldURL = null;
-
- private JScrollPane jScrollPane = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel6 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private StarLabel jStarLabel10 = null;
-
- private StarLabel jStarLabel12 = null;
-
- private StarLabel jStarLabel13 = null;
-
- private StarLabel jStarLabel14 = null;
-
- private JCheckBox jCheckBoxIa32 = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JCheckBox jCheckBoxEbc = null;
-
- private JCheckBox jCheckBoxArm = null;
-
- private JCheckBox jCheckBoxPpc = null;
-
- private JTextField jComboBoxPcdIsDriver = null;
-
- private JCheckBox jCheckBoxPcd = null;
-
- private JCheckBox jCheckBoxFlashMap = null;
-
- //
- // Not used for UI
- //
- private MsaHeaderDocument.MsaHeader msaHeader = null;
-
- private ModuleDefinitionsDocument.ModuleDefinitions md = null;
-
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
-
- private ExternsDocument.Externs ex = null;
-
- private OpeningModuleType omt = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private JRadioButton jRadioButtonBinaryModuleTrue = null;
-
- private JRadioButton jRadioButtonBinaryModuleFalse = null;
-
- /**
- * This method initializes jCheckBoxIa32
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIa32() {
- if (jCheckBoxIa32 == null) {
- jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(valueCol, 505, 55, 20));
- jCheckBoxIa32.setText("IA32");
- jCheckBoxIa32.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIa32;
- }
-
- /**
- * This method initializes jCheckBoxX64
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setBounds(new java.awt.Rectangle(valueCol + 55, 505, 53, 20));
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBoxIpf
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(valueCol + 110, 505, 52, 20));
- jCheckBoxIpf.setText("IPF");
- jCheckBoxIpf.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBoxEbc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEbc() {
- if (jCheckBoxEbc == null) {
- jCheckBoxEbc = new JCheckBox();
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(valueCol + 165, 505, 53, 20));
- jCheckBoxEbc.setText("EBC");
- jCheckBoxEbc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxEbc;
- }
-
- /**
- * This method initializes jCheckBoxArm
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxArm() {
- if (jCheckBoxArm == null) {
- jCheckBoxArm = new JCheckBox();
- jCheckBoxArm.setBounds(new java.awt.Rectangle(valueCol + 220, 505, 54, 20));
- jCheckBoxArm.setText("ARM");
- jCheckBoxArm.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxArm;
- }
-
- /**
- * This method initializes jCheckBoxPpc
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPpc() {
- if (jCheckBoxPpc == null) {
- jCheckBoxPpc = new JCheckBox();
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(valueCol + 285, 505, 53, 20));
- jCheckBoxPpc.setText("PPC");
- jCheckBoxPpc.setToolTipText(DataType.SUP_ARCH_LIST_HELP_TEXT);
- }
- return jCheckBoxPpc;
- }
-
- /**
- This method initializes jTextFieldBaseName
-
- @return javax.swing.JTextField jTextFieldBaseName
-
- **/
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueCol, 10, valueWidth, 20));
- jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldBaseName.addFocusListener(this);
- jTextFieldBaseName.setToolTipText("A brief Identifier, such as USB I/O Library, of the module");
- }
- return jTextFieldBaseName;
- }
-
- /**
- This method initializes jTextFieldGuid
-
- @return javax.swing.JTextField jTextFieldGuid
-
- **/
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setPreferredSize(new java.awt.Dimension(250, 20));
- jTextFieldGuid.setLocation(new java.awt.Point(valueCol, 60));
- jTextFieldGuid.setSize(new java.awt.Dimension(250, 20));
- jTextFieldGuid.addFocusListener(this);
- jTextFieldGuid.setToolTipText("Guaranteed Unique Identification Number, Registry Format (8-4-4-4-12)");
- }
- return jTextFieldGuid;
- }
-
- /**
- This method initializes jTextFieldVersion
-
- @return javax.swing.JTextField jTextFieldVersion
-
- **/
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldVersion.setLocation(new java.awt.Point(valueCol, 85));
- jTextFieldVersion.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldVersion.addFocusListener(this);
- jTextFieldVersion.setToolTipText("A Version Number, 1.0, 1, 1.01, 1.0.1");
- }
- return jTextFieldVersion;
- }
-
- /**
- This method initializes jButtonGenerateGuid
-
- @return javax.swing.JButton jButtonGenerateGuid
-
- **/
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- int genGuidCol = valueCol + 285;
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setLocation(new java.awt.Point(genGuidCol, 60));
- jButtonGenerateGuid.setText("GEN");
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- This method initializes jTextAreaLicense
-
- @return javax.swing.JTextArea jTextAreaLicense
-
- **/
- private JTextArea getJTextAreaLicense() {
- if (jTextAreaLicense == null) {
- jTextAreaLicense = new JTextArea();
- jTextAreaLicense.setText("");
- jTextAreaLicense.setLineWrap(true);
- jTextAreaLicense.addFocusListener(this);
- jTextAreaLicense.setWrapStyleWord(true);
- jTextAreaLicense.setSelectionStart(0);
- jTextAreaLicense.setSelectionEnd(0);
- jTextAreaLicense.setToolTipText("The License for this Module.");
- }
- return jTextAreaLicense;
- }
-
- /**
- This method initializes jTextAreaDescription
-
- @return javax.swing.JTextArea jTextAreaDescription
-
- **/
- private JTextArea getJTextAreaDescription() {
- if (jTextAreaDescription == null) {
- jTextAreaDescription = new JTextArea();
- jTextAreaDescription.setLineWrap(true);
- jTextAreaDescription.addFocusListener(this);
- jTextAreaDescription.setToolTipText("A verbose description of the module.");
- jTextAreaDescription.setWrapStyleWord(true);
- jTextAreaDescription.setSelectionStart(0);
- jTextAreaDescription.setSelectionEnd(0);
- }
- return jTextAreaDescription;
- }
-
- /**
- This method initializes jTextFieldSpecification
-
- @return javax.swing.JTextField jTextFieldSpecification
-
- **/
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- int specWidth = valueWidth + 50;
- jTextFieldSpecification = new JTextField();
-
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth, 20));
- jTextFieldSpecification.setText("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
- jTextFieldSpecification.setBorder(null);
-
- jTextFieldSpecification.setSize(new java.awt.Dimension(specWidth, 20));
- jTextFieldSpecification.setLocation(new java.awt.Point(labelCol, dialogHeight - 30));
- jTextFieldSpecification.setEditable(false);
- jTextFieldSpecification.addFocusListener(this);
- }
- return jTextFieldSpecification;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton jButtonOk
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setText("OK");
- jButtonOk.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonOk.setBounds(new java.awt.Rectangle(390, 455, 90, 20));
- jButtonOk.addActionListener(this);
- jButtonOk.setVisible(false);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton jButtonCancel
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setText("Cancel");
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 445, 90, 20));
- jButtonCancel.addActionListener(this);
- jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setVisible(false);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jScrollPaneLicense
-
- @return javax.swing.JScrollPane jScrollPaneLicense
-
- **/
- private JScrollPane getJScrollPaneLicense() {
- if (jScrollPaneLicense == null) {
- jScrollPaneLicense = new JScrollPane();
- jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setSize(new java.awt.Dimension(valueWidth, 120));
- jScrollPaneLicense.setLocation(new java.awt.Point(valueCol, 305));
- jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
- }
- return jScrollPaneLicense;
- }
-
- /**
- This method initializes jScrollPaneDescription
-
- @return javax.swing.JScrollPane jScrollPaneDescription
-
- **/
- private JScrollPane getJScrollPaneDescription() {
- if (jScrollPaneDescription == null) {
- jScrollPaneDescription = new JScrollPane();
- jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setSize(new java.awt.Dimension(valueWidth, 120));
- jScrollPaneDescription.setLocation(new java.awt.Point(valueCol, 135));
- jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, 120));
- }
- return jScrollPaneDescription;
- }
-
- /**
- This method initializes jTextFieldAbstract
-
- @return javax.swing.JTextField jTextFieldAbstract
-
- **/
- private JTextField getJTextFieldAbstract() {
- if (jTextFieldAbstract == null) {
- jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldAbstract.setLocation(new java.awt.Point(valueCol, 110));
- jTextFieldAbstract.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldAbstract.addFocusListener(this);
- jTextFieldAbstract.setToolTipText("A one sentence description of this module.");
- }
- return jTextFieldAbstract;
- }
-
- /**
- This method initializes jComboBoxModuleType
-
- @return javax.swing.JComboBox jComboBoxModuleType
-
- **/
- private JComboBox getJComboBoxModuleType() {
- if (jComboBoxModuleType == null) {
- jComboBoxModuleType = new JComboBox();
- jComboBoxModuleType.setBounds(new java.awt.Rectangle(valueCol, 35, valueWidth, 20));
- jComboBoxModuleType.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- }
- return jComboBoxModuleType;
- }
-
- /**
- This method initializes jTextFieldURL
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldURL() {
- if (jTextFieldURL == null) {
- jTextFieldURL = new JTextField();
- jTextFieldURL.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldURL.setLocation(new java.awt.Point(valueCol, 430));
- jTextFieldURL.setSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldURL.addFocusListener(this);
- jTextFieldURL.setToolTipText("A URL for the latest version of the license.");
- }
- return jTextFieldURL;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jScrollPaneCopyright
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneCopyright() {
- if (jScrollPaneCopyright == null) {
- jScrollPaneCopyright = new JScrollPane();
- jScrollPaneCopyright.setBounds(new java.awt.Rectangle(valueCol, 260, valueWidth, 40));
- jScrollPaneCopyright.setPreferredSize(new java.awt.Dimension(valueWidth, 40));
- jScrollPaneCopyright.setViewportView(getJTextAreaCopyright());
- jScrollPaneCopyright.setSize(new java.awt.Dimension(valueWidth, 40));
- }
- return jScrollPaneCopyright;
- }
-
- /**
- This method initializes jTextAreaCopyright
-
- @return javax.swing.JTextArea
-
- **/
- private JTextArea getJTextAreaCopyright() {
- if (jTextAreaCopyright == null) {
- jTextAreaCopyright = new JTextArea();
- jTextAreaCopyright.setLineWrap(true);
- jTextAreaCopyright.addFocusListener(this);
- jTextAreaCopyright.setWrapStyleWord(true);
- jTextAreaCopyright.setSelectionStart(0);
- jTextAreaCopyright.setSelectionEnd(0);
- jTextAreaCopyright.setBounds(new java.awt.Rectangle(0, 0, valueWidth, 40));
- jTextAreaCopyright.setToolTipText("One or more copyright lines.");
- }
- return jTextAreaCopyright;
- }
-
- /**
- * This method initializes jTextFieldOutputFileBasename
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldOutputFileBasename() {
- if (jTextFieldOutputFileBasename == null) {
- jTextFieldOutputFileBasename = new JTextField();
- jTextFieldOutputFileBasename.setBounds(new java.awt.Rectangle(valueCol, 455, valueWidth, 20));
- jTextFieldOutputFileBasename.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jTextFieldOutputFileBasename.addFocusListener(this);
- jTextFieldOutputFileBasename.setToolTipText("Enter a single word for generated output file names.");
- }
- return jTextFieldOutputFileBasename;
- }
-
- /**
- * This method initializes jComboBoxPcdIsDriver
- *
- * @return javax.swing.JComboBox
- */
- private JTextField getJComboBoxPcdIsDriver() {
- if (jComboBoxPcdIsDriver == null) {
- jComboBoxPcdIsDriver = new JTextField();
- jComboBoxPcdIsDriver.setPreferredSize(new java.awt.Dimension(valueWidth, 20));
- jComboBoxPcdIsDriver.setBounds(new java.awt.Rectangle(valueCol, 530, valueWidth, 20));
- jComboBoxPcdIsDriver.setEnabled(false);
- jComboBoxPcdIsDriver.setVisible(false);
- }
- return jComboBoxPcdIsDriver;
- }
-
- /**
- This is the default constructor
-
- **/
- public MsaHeader() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- public MsaHeader(OpeningModuleType inMsa) {
- super();
- this.omt = inMsa;
- this.msa = omt.getXmlMsa();
-
- //
- // Set module definitions default value
- //
- if (msa.getModuleDefinitions() == null) {
- ModuleDefinitionsDocument.ModuleDefinitions md = ModuleDefinitionsDocument.ModuleDefinitions.Factory
- .newInstance();
- md.setOutputFileBasename(msa.getMsaHeader().getModuleName());
- md.setBinaryModule(false);
- md.setSupportedArchitectures(ed.getVSupportedArchitectures());
- msa.setModuleDefinitions(md);
- }
-
- //
- // Init items of Header, Definitions and Externs
- //
- init(msa.getMsaHeader());
- init(msa.getModuleDefinitions());
- init(msa.getExterns());
- this.addListeners();
-
- this.setVisible(true);
- this.setViewMode(false);
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldBaseName.setEnabled(!isView);
- this.jTextFieldGuid.setEnabled(!isView);
- this.jTextFieldVersion.setEnabled(!isView);
- this.jTextAreaLicense.setEnabled(!isView);
- this.jTextAreaCopyright.setEnabled(!isView);
- this.jTextAreaDescription.setEnabled(!isView);
- this.jTextFieldSpecification.setEnabled(!isView);
- this.jTextFieldAbstract.setEnabled(!isView);
- this.jComboBoxModuleType.setEnabled(!isView);
- this.jButtonCancel.setEnabled(!isView);
- this.jButtonGenerateGuid.setEnabled(!isView);
- this.jButtonOk.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(dialogWidth, dialogHeight);
- this.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
- this.setContentPane(getJScrollPane());
- this.setTitle("Module Surface Area Header");
- initFrame();
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- private void init(MsaHeaderDocument.MsaHeader inMsaHeader) {
- init();
- if (inMsaHeader != null) {
- setMsaHeader(inMsaHeader);
- if (this.msaHeader.getModuleName() != null) {
- this.jTextFieldBaseName.setText(this.msaHeader.getModuleName());
- }
- if (this.msaHeader.getModuleType() != null) {
- this.jComboBoxModuleType.setSelectedItem(this.msaHeader.getModuleType().toString());
- }
- if (this.msaHeader.getGuidValue() != null) {
- this.jTextFieldGuid.setText(this.msaHeader.getGuidValue());
- }
- if (this.msaHeader.getVersion() != null) {
- this.jTextFieldVersion.setText(this.msaHeader.getVersion());
- }
- if (this.msaHeader.getAbstract() != null) {
- this.jTextFieldAbstract.setText(this.msaHeader.getAbstract());
- }
- if (this.msaHeader.getDescription() != null) {
- this.jTextAreaDescription.setText(this.msaHeader.getDescription());
- jTextAreaDescription.setSelectionStart(0);
- jTextAreaDescription.setSelectionEnd(0);
- }
- if (this.msaHeader.getCopyright() != null) {
- this.jTextAreaCopyright.setText(this.msaHeader.getCopyright());
- }
- if (this.msaHeader.getLicense() != null) {
- this.jTextAreaLicense.setText(this.msaHeader.getLicense().getStringValue());
- jTextAreaLicense.setSelectionStart(0);
- jTextAreaLicense.setSelectionEnd(0);
- }
- if (this.msaHeader.getLicense() != null && this.msaHeader.getLicense().getURL() != null) {
- this.jTextFieldURL.setText(this.msaHeader.getLicense().getURL());
- }
- if (this.msaHeader.getSpecification() != null) {
- this.jTextFieldSpecification.setText(this.msaHeader.getSpecification());
- }
- }
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inMsaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- private void init(ModuleDefinitionsDocument.ModuleDefinitions inMd) {
- if (inMd != null) {
- this.md = inMd;
- if (md.getSupportedArchitectures() != null) {
- this.setSelectedItems(Tools.convertListToVector(md.getSupportedArchitectures()));
- }
- if (md.getBinaryModule()) {
- this.jRadioButtonBinaryModuleTrue.setSelected(true);
- } else {
- this.jRadioButtonBinaryModuleFalse.setSelected(true);
- }
- if (md.getOutputFileBasename() != null) {
- this.jTextFieldOutputFileBasename.setText(md.getOutputFileBasename());
- }
- }
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inEx The input data of ExternsDocument.Externs
-
- **/
- private void init(ExternsDocument.Externs inEx) {
- if (inEx != null) {
- this.ex = inEx;
- if (ex.getPcdIsDriver() != null) {
- this.jCheckBoxPcd.setSelected(true);
- this.jCheckBoxPcd.setEnabled(true);
- }
- this.jCheckBoxFlashMap.setSelected(ex.getTianoR8FlashMapH());
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
-
- jLabelURL = new JLabel();
- jLabelURL.setText("License URL");
- jLabelURL.setLocation(new java.awt.Point(labelCol, 430));
- jLabelURL.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelBaseName = new JLabel();
- jLabelBaseName.setText("Module Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(labelCol, 10, labelWidth, 20));
- jLabelModuleType = new JLabel();
- jLabelModuleType.setBounds(new java.awt.Rectangle(labelCol, 35, labelWidth, 20));
- jLabelModuleType.setText("Module Type");
- jLabelGuid = new JLabel();
- jLabelGuid.setText("Guid Value");
- jLabelGuid.setLocation(new java.awt.Point(labelCol, 60));
- jLabelGuid.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelVersion = new JLabel();
- jLabelVersion.setText("Version");
- jLabelVersion.setLocation(new java.awt.Point(labelCol, 85));
- jLabelVersion.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelAbstract = new JLabel();
- jLabelAbstract.setText("Abstract");
- jLabelAbstract.setLocation(new java.awt.Point(labelCol, 110));
- jLabelAbstract.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelDescription = new JLabel();
- jLabelDescription.setText("Description");
- jLabelDescription.setLocation(new java.awt.Point(labelCol, 135));
- jLabelDescription.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setLocation(new java.awt.Point(labelCol, 260));
- jLabelCopyright.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelLicense = new JLabel();
- jLabelLicense.setText("License");
- jLabelLicense.setLocation(new java.awt.Point(labelCol, 305));
- jLabelLicense.setSize(new java.awt.Dimension(labelWidth, 20));
- jLabelOutputFileBasename = new JLabel();
- jLabelOutputFileBasename.setBounds(new java.awt.Rectangle(labelCol, 455, labelWidth, 20));
- jLabelOutputFileBasename.setText("Output File Basename");
- jLabelBinaryModule = new JLabel();
- jLabelBinaryModule.setBounds(new java.awt.Rectangle(labelCol, 480, labelWidth, 20));
- jLabelBinaryModule.setText("Binary Module");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(labelCol, 505, labelWidth, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelSpecification = new JLabel();
- jLabelSpecification.setText("Specification");
- jLabelSpecification.setLocation(new java.awt.Point(labelCol, 530));
- jLabelSpecification.setSize(new java.awt.Dimension(labelWidth, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 10, dialogHeight - 10));
-
- jContentPane.addFocusListener(this);
-
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelLicense, null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(jLabelDescription, null);
- jContentPane.add(getJTextFieldSpecification(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJScrollPaneLicense(), null);
- jContentPane.add(getJScrollPaneDescription(), null);
- jContentPane.add(jLabelAbstract, null);
- jContentPane.add(getJTextFieldAbstract(), null);
- jContentPane.add(jLabelModuleType, null);
- jContentPane.add(getJComboBoxModuleType(), null);
- jContentPane.add(jLabelURL, null);
- jContentPane.add(getJTextFieldURL(), null);
- jContentPane.add(jLabelOutputFileBasename, null);
- jContentPane.add(getJTextFieldOutputFileBasename(), null);
- jContentPane.add(jLabelBinaryModule, null);
- jContentPane.add(jLabelArch, null);
-
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0, 35));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(0, 60));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(0, 85));
- jStarLabel6 = new StarLabel();
- jStarLabel6.setLocation(new java.awt.Point(0, 135));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(0, 260));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(0, 305));
- jStarLabel10 = new StarLabel();
- jStarLabel10.setLocation(new java.awt.Point(0, 110));
- jStarLabel12 = new StarLabel();
- jStarLabel12.setLocation(new java.awt.Point(0, 455));
- jStarLabel13 = new StarLabel();
- jStarLabel13.setLocation(new java.awt.Point(0, 480));
- jStarLabel14 = new StarLabel();
- jStarLabel14.setLocation(new java.awt.Point(0, 505));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel6, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(jStarLabel10, null);
- jContentPane.add(jStarLabel12, null);
- jContentPane.add(jStarLabel13, null);
- jContentPane.add(jStarLabel14, null);
- jContentPane.add(getJScrollPaneCopyright(), null);
-
- jContentPane.add(getJCheckBoxIa32(), null);
- jContentPane.add(getJCheckBoxX64(), null);
- jContentPane.add(getJCheckBoxIpf(), null);
- jContentPane.add(getJCheckBoxEbc(), null);
- jContentPane.add(getJCheckBoxArm(), null);
- jContentPane.add(getJCheckBoxPpc(), null);
-
- jContentPane.add(getJCheckBoxPcd(), null);
- jContentPane.add(getJComboBoxPcdIsDriver(), null);
- jContentPane.add(getJCheckBoxFlashMap(), null);
-
- ButtonGroup bg = new ButtonGroup();
- jContentPane.add(getJRadioButtonBinaryModuleTrue(), null);
- jContentPane.add(getJRadioButtonBinaryModuleFalse(), null);
- bg.add(getJRadioButtonBinaryModuleTrue());
- bg.add(getJRadioButtonBinaryModuleFalse());
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonGenerateGuid) {
- jTextFieldGuid.setText(Tools.generateUuidString());
- jTextFieldGuid.requestFocus();
- jButtonGenerateGuid.requestFocus();
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean check() {
- //
- // Check if all required fields are not empty
- // and check if all data fields values are valid
- //
-
- //
- // Check Base Name
- //
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Name must be entered!");
- //this.jTextFieldBaseName.requestFocus();
- return false;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Name, it must start with an alpha character!");
- //this.jTextFieldBaseName.requestFocus();
- return false;
- }
-
- //
- // Check Guid
- //
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "The Guid Value must be entered!");
- //this.jTextFieldGuid.requestFocus();
- return false;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format, 8-4-4-4-12");
- //this.jTextFieldGuid.requestFocus();
- return false;
- }
-
- //
- // Check Version
- //
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version must be entered!");
- //this.jTextFieldVersion.requestFocus();
- return false;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
- //this.jTextFieldVersion.requestFocus();
- return false;
- }
-
- //
- // Check Abstact
- //
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract must be entered!");
- //this.jTextFieldAbstract.requestFocus();
- return false;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header",
- "Incorrect data type for Abstract, is should be a sentence describing the module.");
- //this.jTextFieldAbstract.requestFocus();
- return false;
- }
-
- //
- // Check Description
- //
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description must be entered!");
- //this.jTextAreaDescription.requestFocus();
- return false;
- }
-
- //
- // Check Copyright
- //
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright must be entered!");
- //this.jTextFieldCopyright.requestFocus();
- return false;
- }
-
- //
- // Check License
- //
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License must be entered!");
- //this.jTextAreaLicense.requestFocus();
- return false;
- }
-
- //
- // Check Specification
- //
- if (isEmpty(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Msa Header", "Specification must exist.");
- //this.jTextFieldSpecification.requestFocus();
- return false;
- }
- if (!DataValidation.isSpecification(this.jTextFieldSpecification.getText())) {
- // TODO Add code to check the specification number.
- // Future releases of Schema may require that we process these files
- // differently.
- Log.wrn("Update Msa Header", "Incorrect data type for Specification");
- //this.jTextFieldSpecification.requestFocus();
- return false;
- }
-
- return true;
- }
-
- /**
- Save all components of Msa Header
- if exists msaHeader, set the value directly
- if not exists msaHeader, new an instance first
-
- **/
- public void save() {
- try {
- msaHeader.setSpecification(this.jTextFieldSpecification.getText());
- msa.setMsaHeader(msaHeader);
- msa.setModuleDefinitions(md);
- this.omt.setSaved(false);
- } catch (Exception e) {
- Log.wrn("Save Module", e.getMessage());
- Log.err("Save Module", e.getMessage());
- }
- }
-
- /**
- This method initializes Module type and Compontent type
-
- **/
- private void initFrame() {
- EnumerationData ed = new EnumerationData();
- Tools.generateComboBoxByVector(jComboBoxModuleType, ed.getVModuleType());
- this.setSelectedItems(ed.getVSupportedArchitectures());
- }
-
- /**
- Get MsaHeaderDocument.MsaHeader
-
- @return MsaHeaderDocument.MsaHeader
-
- **/
- public MsaHeaderDocument.MsaHeader getMsaHeader() {
- return msaHeader;
- }
-
- /**
- Set MsaHeaderDocument.MsaHeader
-
- @param msaHeader The input data of MsaHeaderDocument.MsaHeader
-
- **/
- public void setMsaHeader(MsaHeaderDocument.MsaHeader msaHeader) {
- this.msaHeader = msaHeader;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intCurrentWidth = this.getJContentPane().getWidth();
- int intPreferredWidth = this.getJContentPane().getPreferredSize().width;
-
- Tools.resizeComponentWidth(this.jTextFieldBaseName, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldGuid, intCurrentWidth, intPreferredWidth + 7);
- Tools.resizeComponentWidth(this.jTextFieldVersion, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldURL, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneCopyright, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldSpecification, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxModuleType, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldOutputFileBasename, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxPcdIsDriver, intCurrentWidth, intPreferredWidth);
-
- Tools.relocateComponentX(this.jButtonGenerateGuid, intCurrentWidth, intPreferredWidth,
- DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
- }
-
- public void focusLost(FocusEvent arg0) {
- if (this.msaHeader == null) {
- msaHeader = MsaHeaderDocument.MsaHeader.Factory.newInstance();
- }
-
- //
- // Check BaseName
- //
- if (arg0.getSource() == this.jTextFieldBaseName) {
- if (isEmpty(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "The Name must be entered!");
- //this.jTextFieldBaseName.requestFocus();
- return;
- }
- if (!DataValidation.isBaseName(this.jTextFieldBaseName.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Name, it must begin with an alpha character.");
- //this.jTextFieldBaseName.requestFocus();
- return;
- }
- if (!this.jTextFieldBaseName.getText().equals(msaHeader.getModuleName())) {
- this.msaHeader.setModuleName(this.jTextFieldBaseName.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Guid
- //
- if (arg0.getSource() == this.jTextFieldGuid) {
- if (isEmpty(this.jTextFieldGuid.getText())) {
- Log.wrn("Update Msa Header", "Guid must be entered!");
- //this.jTextFieldGuid.requestFocus();
- return;
- }
- if (!DataValidation.isGuid((this.jTextFieldGuid).getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Guid, it must be registry format. (8-4-4-4-12)");
- //this.jTextFieldGuid.requestFocus();
- return;
- }
- if (!this.jTextFieldGuid.getText().equals(msaHeader.getGuidValue())) {
- this.msaHeader.setGuidValue(this.jTextFieldGuid.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Version
- //
- if (arg0.getSource() == this.jTextFieldVersion) {
- if (isEmpty(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Version must be entered!");
- //this.jTextFieldVersion.requestFocus();
- return;
- }
- if (!DataValidation.isVersion(this.jTextFieldVersion.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Version, it must start with a digit.");
- //this.jTextFieldVersion.requestFocus();
- return;
- }
- if (!this.jTextFieldVersion.getText().equals(msaHeader.getVersion())) {
- this.msaHeader.setVersion(this.jTextFieldVersion.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Abstact
- //
- if (arg0.getSource() == this.jTextFieldAbstract) {
- if (isEmpty(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Abstract must be entered!");
- //this.jTextFieldAbstract.requestFocus();
- return;
- }
- if (!DataValidation.isAbstract(this.jTextFieldAbstract.getText())) {
- Log.wrn("Update Msa Header", "Incorrect data type for Abstract, it must be sentence.");
- //this.jTextFieldAbstract.requestFocus();
- return;
- }
- if (!this.jTextFieldAbstract.getText().equals(msaHeader.getAbstract())) {
- this.msaHeader.setAbstract(this.jTextFieldAbstract.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Description
- //
- if (arg0.getSource() == this.jTextAreaDescription) {
- if (isEmpty(this.jTextAreaDescription.getText())) {
- Log.wrn("Update Msa Header", "Description must be entered!");
- //this.jTextAreaDescription.requestFocus();
- return;
- }
- if (!this.jTextAreaDescription.getText().equals(msaHeader.getDescription())) {
- this.msaHeader.setDescription(this.jTextAreaDescription.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Copyright
- //
- if (arg0.getSource() == this.jTextAreaCopyright) {
- if (isEmpty(this.jTextAreaCopyright.getText())) {
- Log.wrn("Update Msa Header", "Copyright must be entered!");
- //this.jTextFieldCopyright.requestFocus();
- return;
- }
- if (!this.jTextAreaCopyright.getText().equals(msaHeader.getCopyright())) {
- this.msaHeader.setCopyright(this.jTextAreaCopyright.getText());
- } else {
- return;
- }
- }
-
- //
- // Check License
- //
- if (arg0.getSource() == this.jTextAreaLicense) {
- if (isEmpty(this.jTextAreaLicense.getText())) {
- Log.wrn("Update Msa Header", "License must be entered!");
- //this.jTextAreaLicense.requestFocus();
- return;
- }
- if (this.msaHeader.getLicense() != null) {
- if (!this.jTextAreaLicense.getText().equals(msaHeader.getLicense().getStringValue())) {
- this.msaHeader.getLicense().setStringValue(this.jTextAreaLicense.getText());
- } else {
- return;
- }
- } else {
- License mLicense = License.Factory.newInstance();
- mLicense.setStringValue(this.jTextAreaLicense.getText());
- this.msaHeader.setLicense(mLicense);
- }
- }
-
- //
- // Check License URL
- //
- if (arg0.getSource() == this.jTextFieldURL) {
- if (!isEmpty(this.jTextFieldURL.getText())) {
- if (this.msaHeader.getLicense() == null) {
- License mLicense = License.Factory.newInstance();
- mLicense.setURL(this.jTextFieldURL.getText());
- this.msaHeader.setLicense(mLicense);
- } else {
- if (!this.jTextFieldURL.getText().equals(msaHeader.getLicense().getURL())) {
- this.msaHeader.getLicense().setURL(this.jTextFieldURL.getText());
- } else {
- return;
- }
- }
- }
- }
-
- //
- // Check Output File Basename
- //
- if (arg0.getSource() == this.jTextFieldOutputFileBasename) {
- if (isEmpty(this.jTextFieldOutputFileBasename.getText())) {
- Log.wrn("Update Msa Header", "Output File Basename must be entered!");
- // jTextFieldOutputFileBasename.removeFocusListener(this);
- // jTextFieldOutputFileBasename.requestFocus();
- // jTextFieldOutputFileBasename.addFocusListener(this);
- return;
- }
-
- if (!DataValidation.isOutputFileBasename(this.jTextFieldOutputFileBasename.getText())) {
- Log.wrn("Update Msa Header",
- "Incorrect data type for Output File Basename, it must be a valid file name");
- return;
- }
-
- if (!this.jTextFieldOutputFileBasename.getText().equals(md.getOutputFileBasename())) {
- this.md.setOutputFileBasename(this.jTextFieldOutputFileBasename.getText());
- } else {
- return;
- }
- }
-
- //
- // Check Binary Module Type
- //
- if (arg0.getSource() == this.jRadioButtonBinaryModuleTrue) {
- if (jRadioButtonBinaryModuleTrue.isSelected()) {
- if (md.getBinaryModule()) {
- return;
- } else {
- md.setBinaryModule(true);
- }
- }
- }
-
- //
- // Check Binary Module Type
- //
- if (arg0.getSource() == this.jRadioButtonBinaryModuleFalse) {
- if (jRadioButtonBinaryModuleFalse.isSelected()) {
- if (md.getBinaryModule()) {
- md.setBinaryModule(false);
- } else {
- return;
- }
- }
- }
-
- this.save();
- }
-
- private Vector<String> getSelectedItemsVector() {
- Vector<String> v = new Vector<String>();
- if (this.jCheckBoxIa32.isSelected()) {
- v.addElement(jCheckBoxIa32.getText());
- }
- if (this.jCheckBoxX64.isSelected()) {
- v.addElement(jCheckBoxX64.getText());
- }
- if (this.jCheckBoxIpf.isSelected()) {
- v.addElement(jCheckBoxIpf.getText());
- }
- if (this.jCheckBoxEbc.isSelected()) {
- v.addElement(jCheckBoxEbc.getText());
- }
- if (this.jCheckBoxArm.isSelected()) {
- v.addElement(jCheckBoxArm.getText());
- }
- if (this.jCheckBoxPpc.isSelected()) {
- v.addElement(jCheckBoxPpc.getText());
- }
- return v;
- }
-
- private String getSelectedItemsString() {
- String s = "";
- if (this.jCheckBoxIa32.isSelected()) {
- s = s + jCheckBoxIa32.getText() + " ";
- }
- if (this.jCheckBoxX64.isSelected()) {
- s = s + jCheckBoxX64.getText() + " ";
- }
- if (this.jCheckBoxIpf.isSelected()) {
- s = s + jCheckBoxIpf.getText() + " ";
- }
- if (this.jCheckBoxEbc.isSelected()) {
- s = s + jCheckBoxEbc.getText() + " ";
- }
- if (this.jCheckBoxArm.isSelected()) {
- s = s + jCheckBoxArm.getText() + " ";
- }
- if (this.jCheckBoxPpc.isSelected()) {
- s = s + jCheckBoxPpc.getText() + " ";
- }
- return s.trim();
- }
-
- private void setAllItemsSelected(boolean isSelected) {
- this.jCheckBoxIa32.setSelected(true);
- this.jCheckBoxX64.setSelected(isSelected);
- this.jCheckBoxIpf.setSelected(isSelected);
- this.jCheckBoxEbc.setSelected(isSelected);
- this.jCheckBoxArm.setSelected(isSelected);
- this.jCheckBoxPpc.setSelected(isSelected);
- }
-
- private void setSelectedItems(Vector<String> v) {
- setAllItemsSelected(false);
- boolean isIA32Selected = false;
- if (v != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.get(index).equals(this.jCheckBoxIa32.getText())) {
- this.jCheckBoxIa32.setSelected(true);
- isIA32Selected = true;
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxIpf.getText())) {
- this.jCheckBoxIpf.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxX64.getText())) {
- this.jCheckBoxX64.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxEbc.getText())) {
- this.jCheckBoxEbc.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxArm.getText())) {
- this.jCheckBoxArm.setSelected(true);
- continue;
- }
- if (v.get(index).equals(this.jCheckBoxPpc.getText())) {
- this.jCheckBoxPpc.setSelected(true);
- continue;
- }
- }
- if (!isIA32Selected) {
- this.jCheckBoxIa32.setSelected(false);
- }
- }
- }
-
- /**
- * This method initializes jCheckBoxPcd
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPcd() {
- if (jCheckBoxPcd == null) {
- jCheckBoxPcd = new JCheckBox();
- jCheckBoxPcd.setBounds(new java.awt.Rectangle(labelCol, 530, labelWidth, 20));
- jCheckBoxPcd.setText("Is this a PCD Driver?");
- jCheckBoxPcd.addFocusListener(this);
- jCheckBoxPcd.addActionListener(this);
- jCheckBoxPcd.setEnabled(false);
- }
- return jCheckBoxPcd;
- }
-
- /**
- * This method initializes jCheckBoxFlashMap
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFlashMap() {
- if (jCheckBoxFlashMap == null) {
- jCheckBoxFlashMap = new JCheckBox();
- jCheckBoxFlashMap.setBounds(new java.awt.Rectangle(labelCol, 555, 480, 20));
- jCheckBoxFlashMap.setText("Does this module require a legacy FlashMap header file?");
- }
- return jCheckBoxFlashMap;
- }
-
- /**
- * This method initializes jRadioButtonBinaryModuleTrue
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonBinaryModuleTrue() {
- if (jRadioButtonBinaryModuleTrue == null) {
- jRadioButtonBinaryModuleTrue = new JRadioButton();
- jRadioButtonBinaryModuleTrue.setBounds(new java.awt.Rectangle(valueCol, 480, 140, 20));
- jRadioButtonBinaryModuleTrue.setText("True");
- jRadioButtonBinaryModuleTrue.setSelected(true);
- jRadioButtonBinaryModuleTrue.addFocusListener(this);
- jRadioButtonBinaryModuleTrue
- .setToolTipText("<html>Modules are either source modules which can be compiled or binary <br>"
- + "modules which are linked. A module cannot contain both. <br>"
- + "The GUID numbers should be identical for a binary and source MSA, <br>"
- + "however the BINARY MSA should have a higher version number.</html>");
- }
- return jRadioButtonBinaryModuleTrue;
- }
-
- /**
- * This method initializes jRadioButtonBinaryModuleFalse
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonBinaryModuleFalse() {
- if (jRadioButtonBinaryModuleFalse == null) {
- jRadioButtonBinaryModuleFalse = new JRadioButton();
- jRadioButtonBinaryModuleFalse.setBounds(new java.awt.Rectangle(valueCol + 140, 480, 140, 20));
- jRadioButtonBinaryModuleFalse.setText("False");
- jRadioButtonBinaryModuleFalse.addFocusListener(this);
- jRadioButtonBinaryModuleFalse
- .setToolTipText("<html>Modules are either source modules which can be compiled or binary <br>"
- + "modules which are linked. A module cannot contain both. <br>"
- + "The GUID numbers should be identical for a binary and source MSA, <br>"
- + "however the BINARY MSA should have a higher version number.</html>");
- }
- return jRadioButtonBinaryModuleFalse;
- }
-
- public void itemStateChanged(ItemEvent arg0) {
- //
- // Check Supported Arch
- //
- if (arg0.getSource() == this.jCheckBoxIa32 || arg0.getSource() == this.jCheckBoxIpf
- || arg0.getSource() == this.jCheckBoxX64 || arg0.getSource() == this.jCheckBoxEbc
- || arg0.getSource() == this.jCheckBoxArm || arg0.getSource() == this.jCheckBoxPpc) {
- if (!this.jCheckBoxIa32.isSelected() && !this.jCheckBoxX64.isSelected() && !this.jCheckBoxIpf.isSelected()
- && !this.jCheckBoxEbc.isSelected() && !this.jCheckBoxPpc.isSelected()
- && !this.jCheckBoxArm.isSelected()) {
- Log
- .wrn("At lease one Supportted Architecture should be selected! IA32 is selected as default value!");
- this.jCheckBoxIa32.setSelected(true);
- }
-
- if (!this.getSelectedItemsString().equals(md.getSupportedArchitectures().toString())) {
- md.setSupportedArchitectures(this.getSelectedItemsVector());
- this.save();
- }
- }
-
- if (arg0.getSource() == this.jComboBoxModuleType) {
- if (this.jComboBoxModuleType.getSelectedItem().equals("PEIM")
- || this.jComboBoxModuleType.getSelectedItem().equals("DXE_DRIVER")) {
- this.jCheckBoxPcd.setEnabled(true);
- if (this.jCheckBoxPcd.isSelected()) {
- this.jCheckBoxPcd.setSelected(false);
- this.jCheckBoxPcd.setSelected(true);
- }
- } else {
- this.jCheckBoxPcd.setEnabled(false);
- this.jCheckBoxPcd.setSelected(false);
- }
- if (!jComboBoxModuleType.getSelectedItem().toString().equals(msaHeader.getModuleType().toString())) {
- msaHeader.setModuleType(ModuleTypeDef.Enum.forString(jComboBoxModuleType.getSelectedItem().toString()));
- this.save();
- }
- }
-
- //
- // Check Pcd is Driver
- //
- if (arg0.getSource() == this.jCheckBoxPcd) {
- if (this.jCheckBoxPcd.isSelected()) {
- if (this.jComboBoxModuleType.getSelectedItem().toString().equals("DXE_DRIVER")) {
- this.jComboBoxPcdIsDriver.setText("DXE_PCD_DRIVER");
- this.jComboBoxPcdIsDriver.setEnabled(true);
- } else if (this.jComboBoxModuleType.getSelectedItem().toString().equals("PEIM")) {
- this.jComboBoxPcdIsDriver.setText("PEI_PCD_DRIVER");
- this.jComboBoxPcdIsDriver.setEnabled(true);
- }
- }
-
- if ((this.ex == null) && this.jCheckBoxPcd.isSelected()) {
- this.ex = ExternsDocument.Externs.Factory.newInstance();
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && (this.ex.getPcdIsDriver() == null) && this.jCheckBoxPcd.isSelected()) {
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && (this.ex.getPcdIsDriver() != null)) {
- if (this.jCheckBoxPcd.isSelected()
- && !this.jComboBoxPcdIsDriver.getText().toString().equals(this.ex.getPcdIsDriver().toString())) {
- this.ex.setPcdIsDriver(PcdDriverTypes.Enum.forString(this.jComboBoxPcdIsDriver.getText()));
- this.msa.setExterns(this.ex);
- }
- if (!this.jCheckBoxPcd.isSelected()) {
- ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
- if (this.ex.getExternList() != null) {
- for (int index = 0; index < this.ex.getExternList().size(); index++) {
- newEx.addNewExtern();
- newEx.setExternArray(index, this.ex.getExternArray(index));
- }
- }
- if (this.ex.getSpecificationList() != null) {
- for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
- newEx.addNewSpecification();
- newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
- }
- }
- if (this.ex.getTianoR8FlashMapH()) {
- newEx.setTianoR8FlashMapH(this.ex.getTianoR8FlashMapH());
- }
- this.ex = newEx;
- this.msa.setExterns(this.ex);
- }
- }
- this.save();
- }
- //
- // Check Flash Map
- //
- if (arg0.getSource() == this.jCheckBoxFlashMap) {
- if ((this.ex == null) && this.jCheckBoxFlashMap.isSelected()) {
- this.ex = ExternsDocument.Externs.Factory.newInstance();
- this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && this.jCheckBoxFlashMap.isSelected()) {
- this.ex.setTianoR8FlashMapH(this.jCheckBoxFlashMap.isSelected());
- this.msa.setExterns(this.ex);
- } else if ((this.ex != null) && !this.jCheckBoxFlashMap.isSelected()) {
- ExternsDocument.Externs newEx = ExternsDocument.Externs.Factory.newInstance();
- if (this.ex.getExternList() != null) {
- for (int index = 0; index < this.ex.getExternList().size(); index++) {
- newEx.addNewExtern();
- newEx.setExternArray(index, this.ex.getExternArray(index));
- }
- }
- if (this.ex.getSpecificationList() != null) {
- for (int index = 0; index < this.ex.getSpecificationList().size(); index++) {
- newEx.addNewSpecification();
- newEx.setSpecificationArray(index, this.ex.getSpecificationArray(index));
- }
- }
- if (this.ex.getPcdIsDriver() != null) {
- newEx.setPcdIsDriver(this.ex.getPcdIsDriver());
- }
- this.ex = newEx;
- this.msa.setExterns(this.ex);
- }
- this.save();
- }
- }
-
- private void addListeners() {
- this.jTextFieldBaseName.getDocument().addDocumentListener(this);
- this.jTextFieldGuid.getDocument().addDocumentListener(this);
- this.jTextFieldAbstract.getDocument().addDocumentListener(this);
- this.jTextAreaCopyright.getDocument().addDocumentListener(this);
- this.jTextAreaDescription.getDocument().addDocumentListener(this);
- this.jTextAreaLicense.getDocument().addDocumentListener(this);
- this.jTextFieldOutputFileBasename.getDocument().addDocumentListener(this);
- this.jTextFieldSpecification.getDocument().addDocumentListener(this);
- this.jTextFieldURL.getDocument().addDocumentListener(this);
- this.jTextFieldVersion.getDocument().addDocumentListener(this);
-
- this.jComboBoxModuleType.addItemListener(this);
-
- this.jCheckBoxIa32.addItemListener(this);
- this.jCheckBoxX64.addItemListener(this);
- this.jCheckBoxIpf.addItemListener(this);
- this.jCheckBoxEbc.addItemListener(this);
- this.jCheckBoxArm.addItemListener(this);
- this.jCheckBoxPpc.addItemListener(this);
-
- this.jCheckBoxPcd.addItemListener(this);
-
- this.jCheckBoxFlashMap.addItemListener(this);
- }
-
- public void insertUpdate(DocumentEvent e) {
- this.omt.setSaved(false);
- }
-
- public void removeUpdate(DocumentEvent e) {
- this.omt.setSaved(false);
- }
-
- public void changedUpdate(DocumentEvent e) {
- // Do nothing
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java
deleted file mode 100644
index 5b5f49dc59..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BootModesDlg.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/** @file
- <<The file is used to create, update BootModes of MSA file>>
-
- <<The BootModesDlg is called to add or edit a Module's Boot Modes definitions.>>
-
- 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.
-
- Package Name: Tools
- Module Name: FrameworkWizard
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BootModes.BootModesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update BootModes of MSA/MBD file
- *
- * It extends IDialog
- *
- */
-public class BootModesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -3888558623432442561L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelBootModeName = null;
-
- private JComboBox jComboBoxBootModeName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private BootModesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jComboBoxBootModeName
- *
- * @return javax.swing.JComboBox jComboBoxBootModeName
- *
- */
- private JComboBox getJComboBoxBootModeName() {
- if (jComboBoxBootModeName == null) {
- jComboBoxBootModeName = new JComboBox();
- jComboBoxBootModeName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxBootModeName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxBootModeName
- .setToolTipText("<html><table>"
- + "<tr><td>FULL</td><td>Boot with full configuration</td></tr>"
- + "<tr><td>MINIMAL</td><td>Boot with minimal configuration</td></tr>"
- + "<tr><td>NO_CHANGE</td><td>Boot assuming no configuration changes</td></tr>"
- + "<tr><td>DIAGNOSTICS</td><td>Boot with full configuration plus diagnostics</td></tr>"
- + "<tr><td>DEFAULT</td><td>Boot with default settings</td></tr>"
- + "<tr><td>BOOT_ON_S#_RESUME</td><td>where # is 2, 3, 4 or 5</td></tr>"
- + "<tr><td>FLASH_UPDATE</td><td>Boot on flash update</td></tr>"
- + "<tr><td>RECOVERY</td><td>Boot in recovery mode</td></tr>"
- + "</table></html>");
- }
- return jComboBoxBootModeName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Indicates Supports the specified boot mode</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Indicates Supports the specified boot mode on some execution paths</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Always changes the boot mode</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Change the boot mode sometimes</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Boot Modes");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inBootModesId
- *
- */
- private void init(BootModesIdentification inBootModesId, ModuleIdentification mid) {
- init();
- this.id = inBootModesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jComboBoxBootModeName.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inBootModesIdentification
- * @param iFrame
- *
- */
- public BootModesDlg(BootModesIdentification inBootModesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inBootModesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxBootModeName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelBootModeName = new JLabel();
- jLabelBootModeName.setText("Boot Mode Name");
- jLabelBootModeName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Archectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelBootModeName, null);
- jContentPane.add(getJComboBoxBootModeName(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes BootModeName groups and Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxBootModeName, ed.getVBootModeNames());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVBootModeUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentBootModes();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Boot Modes", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private BootModesIdentification getCurrentBootModes() {
- String arg0 = this.jComboBoxBootModeName.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
- id = new BootModesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public BootModesIdentification getId() {
- return id;
- }
-
- public void setId(BootModesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java
deleted file mode 100644
index a4bad7e40a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/BuildOptionsDlg.java
+++ /dev/null
@@ -1,495 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFiles section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.BuildOptions.BuildOptionsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SourceFiles section of the MSA file
- *
- * It extends IDialog
- *
- **/
-public class BuildOptionsDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelFileName = null;
-
- private JTextField jTextFieldFileOption = null;
-
- private JLabel jLabelToolChainFamily = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTagName = null;
-
- private JTextField jTextFieldTagName = null;
-
- private JLabel jLabelToolCode = null;
-
- private JTextField jTextFieldToolCode = null;
-
- private IComboBox iComboBoxToolCode = null;
-
- private JTextField jTextFieldToolChainFamily = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneBuildTargets = null;
-
- private ICheckBoxList iCheckBoxListBuildTargets = null;
-
- //
- // Not used by UI
- //
- private BuildOptionsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private JLabel jLabelBuildTargets = null;
-
- /**
- This method initializes jTextFieldFileOption
-
- @return javax.swing.JTextField jTextFieldFileOption
-
- **/
- private JTextField getJTextFieldSourceFilesDirectory() {
- if (jTextFieldFileOption == null) {
- jTextFieldFileOption = new JTextField();
- jTextFieldFileOption.setBounds(new java.awt.Rectangle(168, 12, 340, 20));
- jTextFieldFileOption.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldFileOption.setToolTipText("Path is relative to the MSA file and must include the file name");
- }
- return jTextFieldFileOption;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTagName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
- }
- return jTextFieldTagName;
- }
-
- private IComboBox getIComboBoxToolCode() {
- if (iComboBoxToolCode == null) {
- iComboBoxToolCode = new IComboBox();
- iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
- + "or you can DOUBLE-CLICK this field to enter your customized<br>"
- + "tool command.<br>"
- + "Press ENTER to save your input or press ESCAPE to quit</html>");
- }
- return iComboBoxToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolCode
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolCode() {
- if (jTextFieldToolCode == null) {
- jTextFieldToolCode = new JTextField();
- jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM");
- jTextFieldToolCode.setVisible(false);
- }
- return jTextFieldToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolChainFamily
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(317, 202, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(412, 202, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes iCheckBoxListArch
-
- @return ICheckBoxList
- **/
- private ICheckBoxList getICheckBoxListSupModuleList() {
- if (iCheckBoxListBuildTargets == null) {
- iCheckBoxListBuildTargets = new ICheckBoxList();
- }
- return iCheckBoxListBuildTargets;
- }
-
- /**
- This method initializes jScrollPaneBuildTargets
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneBuildTargets() {
- if (jScrollPaneBuildTargets == null) {
- jScrollPaneBuildTargets = new JScrollPane();
- jScrollPaneBuildTargets.setBounds(new java.awt.Rectangle(168, 137, 340, 40));
- jScrollPaneBuildTargets.setPreferredSize(new java.awt.Dimension(340, 40));
- jScrollPaneBuildTargets.setViewportView(getICheckBoxListSupModuleList());
- }
- return jScrollPaneBuildTargets;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public BuildOptionsDlg(BuildOptionsIdentification inBuildOptionsIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inBuildOptionsIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(525, 270);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- this.centerWindow();
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- this.iCheckBoxListBuildTargets.setAllItems(ed.getVBuildTargets());
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(BuildOptionsIdentification inBuildOptionsIdentification, ModuleIdentification mid) {
- init();
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (inBuildOptionsIdentification != null) {
- this.jTextFieldFileOption.setText(inBuildOptionsIdentification.getOption());
- this.jTextFieldTagName.setText(inBuildOptionsIdentification.getTagName());
-
- //
- // Generate Tool Code selection list
- //
- Vector<String> v = ed.getVToolCode();
- boolean isFind = false;
- String strToolCode = inBuildOptionsIdentification.getToolCode();
-
- //
- // If the input value is not in the default list, add it to the list
- //
- if (strToolCode != null) {
- for (int index = 0; index < v.size(); index++) {
- if (v.elementAt(index).equals(strToolCode)) {
- isFind = true;
- break;
- }
- }
- if (!isFind && !isEmpty(strToolCode)) {
- v.addElement(strToolCode);
- }
- }
-
- Tools.generateComboBoxByVector(iComboBoxToolCode, v);
- this.iComboBoxToolCode.setSelectedItem(strToolCode);
-
- this.jTextFieldToolChainFamily.setText(inBuildOptionsIdentification.getToolChainFamily());
-
- this.jArchCheckBox.setSelectedItems(inBuildOptionsIdentification.getSupArchList());
-
- this.iCheckBoxListBuildTargets.setAllItemsUnchecked();
- this.iCheckBoxListBuildTargets.initCheckedItem(true, inBuildOptionsIdentification.getBuildTargets());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldFileOption.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelBuildTargets = new JLabel();
- jLabelBuildTargets.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
- jLabelBuildTargets.setText("Build Targets");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
- jLabelToolCode = new JLabel();
- jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelToolCode.setText("Tool Code");
- jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelTagName.setText("Tag Name");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelToolChainFamily.setText("Tool Chain Family");
- jLabelFileName = new JLabel();
- jLabelFileName.setText("Option String");
- jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 222));
-
- jContentPane.add(jLabelFileName, null);
- jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
- jContentPane.add(jLabelToolChainFamily, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelTagName, null);
- jContentPane.add(getJTextFieldTagName(), null);
- jContentPane.add(jLabelToolCode, null);
- jContentPane.add(getJTextFieldToolCode(), null);
- jContentPane.add(getIComboBoxToolCode(), null);
- jContentPane.add(getJTextFieldToolChainFamily(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(jLabelBuildTargets, null);
- jContentPane.add(getJScrollPaneBuildTargets(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentId();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- private BuildOptionsIdentification getCurrentId() {
- String arg0 = this.jTextFieldFileOption.getText();
- Vector<String> arg1 = this.iCheckBoxListBuildTargets.getAllCheckedItemsString();
- String arg2 = this.jTextFieldToolChainFamily.getText();
- String arg3 = this.jTextFieldTagName.getText();
- String arg4 = this.iComboBoxToolCode.getSelectedItem().toString();
- if (arg4.equals(DataType.EMPTY_SELECT_ITEM)) {
- arg4 = "";
- }
- Vector<String> arg5 = this.jArchCheckBox.getSelectedItemsVector();
-
- id = new BuildOptionsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check Option
- //
- if (isEmpty(this.jTextFieldFileOption.getText())) {
- Log.wrn("Update Build Options", "Option String must be entered!");
- return false;
- }
-
- //
- // Check TagName
- //
- if (!isEmpty(this.jTextFieldTagName.getText())) {
- if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tag Name");
- return false;
- }
- }
-
- //
- // Check ToolCode
- //
- if (!isEmpty(this.jTextFieldToolCode.getText())) {
- if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tool Code");
- return false;
- }
- }
-
- //
- // Check ToolChainFamily
- //
- if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
- if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
- Log.wrn("Update Build Options", "Incorrect data type for Tool Chain Family");
- return false;
- }
- }
-
- return true;
- }
-
- public BuildOptionsIdentification getId() {
- return id;
- }
-
- public void setId(BuildOptionsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java
deleted file mode 100644
index a3c6c63838..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/DataHubsDlg.java
+++ /dev/null
@@ -1,452 +0,0 @@
-/** @file
- <<The file is used to create, update Data Hub Record entries in a MSA file.>>
-
- <<The DataHbsDlg is a dialog called to add or edit a Data Hub Record within a MSA file.>>
-
- 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.
-
- Package Name: Tools
- Module Name: FrameworkWizard
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.DataHubs.DataHubsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update DataHub of the MSA file
- *
- * It extends IDialog
- *
- */
-public class DataHubsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -3667906991966638892L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelDataHubRecord = null;
-
- private JTextField jTextFieldDataHubRecord = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private DataHubsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldDataHubRecord
- *
- * @return javax.swing.JTextField jTextFieldDataHubRecord
- *
- */
- private JTextField getJTextFieldDataHubRecord() {
- if (jTextFieldDataHubRecord == null) {
- jTextFieldDataHubRecord = new JTextField();
- jTextFieldDataHubRecord.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jTextFieldDataHubRecord.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldDataHubRecord.setToolTipText("Enter the C Name of the Data Hub Record");
- }
- return jTextFieldDataHubRecord;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes a Data Hub Entry<br>via registering a filter driver.</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will use a Data Hub Entry if it exists<br>via registering a filter driver</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Always logs data into the Data Hub</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Log data into the Data Hub under<br>certain circumstances</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Data Hubs");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inDataHubsId
- *
- */
- private void init(DataHubsIdentification inDataHubsId, ModuleIdentification mid) {
- init();
- this.id = inDataHubsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jTextFieldDataHubRecord.setText(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inDataHubsIdentification
- * @param iFrame
- *
- */
- public DataHubsDlg(DataHubsIdentification inDataHubsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inDataHubsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldDataHubRecord.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelDataHubRecord = new JLabel();
- jLabelDataHubRecord.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelDataHubRecord.setText("Data Hub Record");
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelDataHubRecord, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(jLabelArch, null);
-
- jContentPane.add(getJTextFieldDataHubRecord(), null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVDataHubUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentDataHubs();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check DataHubRecord
- //
- if (isEmpty(this.jTextFieldDataHubRecord.getText())) {
- Log.wrn("Update Hubs", "Data Hub Record must be entered!");
- return false;
- }
-
- if (!isEmpty(this.jTextFieldDataHubRecord.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDataHubRecord.getText())) {
- Log.wrn("Update Hubs", "Incorrect data type for Data Hub Record");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hubs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private DataHubsIdentification getCurrentDataHubs() {
- String arg0 = this.jTextFieldDataHubRecord.getText();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new DataHubsIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public DataHubsIdentification getId() {
- return id;
- }
-
- public void setId(DataHubsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
deleted file mode 100644
index 10e3a174ca..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/EventsDlg.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/** @file
-
- The file is used to create, update Events section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Events.EventsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Events section of the MSA file
- * It extends IDialog
- *
- * @since ModuleEditor 1.0
- *
- */
-public class EventsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -4396143706422842331L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelEventType = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelUsage = null;
-
- private JLabel jLabelGroup = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JComboBox jComboBoxEventGroup = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private JComboBox jComboBoxEventsType = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private EventsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jComboBoxType
- *
- * @return javax.swing.JComboBox jComboBoxType
- *
- */
- private JComboBox getJComboBoxEventsType() {
- if (jComboBoxEventsType == null) {
- jComboBoxEventsType = new JComboBox();
- jComboBoxEventsType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxEventsType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxEventsType
- .setToolTipText("<html>Select CreateEvents if the Module has an event that is waiting to be signaled.<br>"
- + "Select SignalEvents if the Module will signal all events in an event group.<br>"
- + "NOTE: Signal events are named by GUID.</html>");
- }
- return jComboBoxEventsType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Event");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxEventsType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxEventGroup() {
- if (jComboBoxEventGroup == null) {
- jComboBoxEventGroup = new JComboBox();
- jComboBoxEventGroup.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxEventGroup.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxEventGroup.setToolTipText("Select Type of Event: Guid or Timer.");
-
- }
- return jComboBoxEventGroup;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td colspan=2 align=center><b>Create Events</b></td></tr>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module registers a notification function and REQUIRES that it be<br>"
- + "executed for the module to fully function.</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module registers a notification function and calls the function<br>"
- + "when it is signaled</td></tr><tr><td colspan=2 align=center><b>Signal Events</b></td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module will Always signal the event</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes signal the event</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 182, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 112));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 212, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 212, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 280);
- this.setContentPane(getJScrollPane());
- this.setTitle("Events");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inEventsId
- *
- */
- private void init(EventsIdentification inEventsId, ModuleIdentification mid) {
- init();
- this.id = inEventsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for event");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_EVENT));
-
- this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
- this.iComboBoxGuidC_Name.setSelectedIndex(0);
-
- if (this.id != null) {
- String tmpName = id.getName();
- if (isEmpty(tmpName)) {
- tmpName = DataType.EMPTY_SELECT_ITEM;
- }
-
- this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
- this.jComboBoxEventsType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
-
- jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- this.jComboBoxEventGroup.setSelectedItem(id.getGroup());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inEventsIdentification
- * @param iFrame
- *
- */
- public EventsDlg(EventsIdentification inEventsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inEventsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxGuidC_Name.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelEventType = new JLabel();
- jLabelEventType.setText("Select Event Type");
- jLabelEventType.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelGroup = new JLabel();
- jLabelGroup.setText("Event Group Type");
- jLabelGroup.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(2, 87));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 182, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 235));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelEventType, null);
- jContentPane.add(getJComboBoxEventsType(), null);
- //jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelGroup, null);
- jContentPane.add(getJComboBoxEventGroup(), null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
-
- }
- return jContentPane;
- }
-
- /**
- * This method initializes events groups and usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxEventsType, ed.getVEventType());
- Tools.generateComboBoxByVector(jComboBoxEventGroup, ed.getVEventGroup());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVEventUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentEvents();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
- if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
- Log.wrn("Update Events", "Incorrect data type for Event Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Events", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private EventsIdentification getCurrentEvents() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxEventsType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- String arg6 = this.jComboBoxEventGroup.getSelectedItem().toString();
- id = new EventsIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
- return id;
- }
-
- public EventsIdentification getId() {
- return id;
- }
-
- public void setId(EventsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
deleted file mode 100644
index 3aa9b4a297..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ExternsDlg.java
+++ /dev/null
@@ -1,948 +0,0 @@
-/** @file
-
- The file is used to create, update Externs section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Externs.ExternsIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Externs section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class ExternsDlg extends IDialog implements ItemListener {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -7382008402932047191L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelName = null;
-
- private JComboBox jComboBoxType = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelSpecification = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JPanel jPanelSpecification = null;
-
- private JPanel jPanelImage = null;
-
- private JPanel jPanelDriver = null;
-
- private JPanel jPanelLibrary = null;
-
- private JPanel jPanelCallBack = null;
-
- private JLabel jLabelModuleEntryPoint = null;
-
- private JTextField jTextFieldModuleEntryPoint = null;
-
- private JLabel jLabelModuleUnloadImage = null;
-
- private JTextField jTextFieldModuleUnloadImage = null;
-
- private JLabel jLabelDriverBinding = null;
-
- private JTextField jTextFieldDriverBinding = null;
-
- private JLabel jLabelComponentName = null;
-
- private JTextField jTextFieldComponentName = null;
-
- private JLabel jLabelDriverConfig = null;
-
- private JTextField jTextFieldDriverConfig = null;
-
- private JLabel jLabelDriverDiagnostic = null;
-
- private JTextField jTextFieldDriverDiagnostic = null;
-
- private JLabel jLabelConstructor = null;
-
- private JTextField jTextFieldConstructor = null;
-
- private JLabel jLabelDestructor = null;
-
- private JTextField jTextFieldDestructor = null;
-
- private JLabel jLabelVirtualAddressMap = null;
-
- private JTextField jTextFieldVirtualAddressMap = null;
-
- private JLabel jLabelExitBootServices = null;
-
- private JTextField jTextFieldExitBootServices = null;
-
- //
- // Not used by UI
- //
- private ExternsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<String> vArchList = new Vector<String>();
-
- /**
- This method initializes jComboBoxType
-
- @return javax.swing.JComboBox jComboBoxType
-
- **/
- private JComboBox getJComboBoxType() {
- if (jComboBoxType == null) {
- jComboBoxType = new JComboBox();
- jComboBoxType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxType.addItemListener(this);
- }
- return jComboBoxType;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jTextFieldC_Name
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldSpecification.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldSpecification;
- }
-
- /**
- This method initializes jTextFieldFeatureFlag
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(300, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(400, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jPanelSpecification
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSpecification() {
- if (jPanelSpecification == null) {
- jPanelSpecification = new JPanel();
- jPanelSpecification.setBounds(new java.awt.Rectangle(0, 37, 505, 20));
- jPanelSpecification.setLayout(null);
-
- jLabelSpecification = new JLabel();
- jLabelSpecification.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelSpecification.setText("Specification Name");
-
- jPanelSpecification.add(jLabelSpecification, null);
- jPanelSpecification.add(getJTextFieldSpecification(), null);
- }
- return jPanelSpecification;
- }
-
- /**
- * This method initializes jPanelImage
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelImage() {
- if (jPanelImage == null) {
- jLabelModuleUnloadImage = new JLabel();
- jLabelModuleUnloadImage.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelModuleUnloadImage.setText("Module Unload Image");
- jLabelModuleEntryPoint = new JLabel();
- jLabelModuleEntryPoint.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelModuleEntryPoint.setText("Module Entry Point");
- jPanelImage = new JPanel();
- jPanelImage.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelImage.setLayout(null);
- jPanelImage.add(jLabelModuleEntryPoint, null);
- jPanelImage.add(getJTextFieldModuleEntryPoint(), null);
- jPanelImage.add(jLabelModuleUnloadImage, null);
- jPanelImage.add(getJTextFieldModuleUnloadImage(), null);
- }
- return jPanelImage;
- }
-
- /**
- * This method initializes jPanelDriver
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelDriver() {
- if (jPanelDriver == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 0));
- jLabelDriverDiagnostic = new JLabel();
- jLabelDriverDiagnostic.setBounds(new java.awt.Rectangle(12, 75, 140, 20));
- jLabelDriverDiagnostic.setText("Driver Diagnostic");
- jLabelDriverConfig = new JLabel();
- jLabelDriverConfig.setBounds(new java.awt.Rectangle(12, 50, 140, 20));
- jLabelDriverConfig.setText("Driver Config");
- jLabelComponentName = new JLabel();
- jLabelComponentName.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelComponentName.setText("Component Name");
- jLabelDriverBinding = new JLabel();
- jLabelDriverBinding.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelDriverBinding.setText("Driver Binding");
- jPanelDriver = new JPanel();
- jPanelDriver.setBounds(new java.awt.Rectangle(0, 37, 505, 95));
- jPanelDriver.setLayout(null);
- jPanelDriver.add(jStarLabel1, null);
- jPanelDriver.add(jLabelDriverBinding, null);
- jPanelDriver.add(getJTextFieldDriverBinding(), null);
- jPanelDriver.add(jLabelComponentName, null);
- jPanelDriver.add(getJTextFieldComponentName(), null);
- jPanelDriver.add(jLabelDriverConfig, null);
- jPanelDriver.add(getJTextFieldDriverConfig(), null);
- jPanelDriver.add(jLabelDriverDiagnostic, null);
- jPanelDriver.add(getJTextFieldDriverDiagnostic(), null);
- }
- return jPanelDriver;
- }
-
- /**
- * This method initializes jPanelLibrary
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibrary() {
- if (jPanelLibrary == null) {
- jLabelDestructor = new JLabel();
- jLabelDestructor.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelDestructor.setText("Destructor");
- jLabelConstructor = new JLabel();
- jLabelConstructor.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelConstructor.setText("Constructor");
- jPanelLibrary = new JPanel();
- jPanelLibrary.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelLibrary.setLayout(null);
- jPanelLibrary.add(jLabelConstructor, null);
- jPanelLibrary.add(getJTextFieldConstructor(), null);
- jPanelLibrary.add(jLabelDestructor, null);
- jPanelLibrary.add(getJTextFieldDestructor(), null);
- }
- return jPanelLibrary;
- }
-
- /**
- * This method initializes jPanelCallBack
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelCallBack() {
- if (jPanelCallBack == null) {
- jLabelExitBootServices = new JLabel();
- jLabelExitBootServices.setBounds(new java.awt.Rectangle(12, 25, 140, 20));
- jLabelExitBootServices.setText("Exit Boot Services");
- jLabelVirtualAddressMap = new JLabel();
- jLabelVirtualAddressMap.setBounds(new java.awt.Rectangle(12, 0, 140, 20));
- jLabelVirtualAddressMap.setText("Virtual Address Map");
- jPanelCallBack = new JPanel();
- jPanelCallBack.setBounds(new java.awt.Rectangle(0, 37, 505, 45));
- jPanelCallBack.setLayout(null);
- jPanelCallBack.add(jLabelVirtualAddressMap, null);
- jPanelCallBack.add(getJTextFieldVirtualAddressMap(), null);
- jPanelCallBack.add(jLabelExitBootServices, null);
- jPanelCallBack.add(getJTextFieldExitBootServices(), null);
- }
- return jPanelCallBack;
- }
-
- /**
- * This method initializes jTextFieldModuleEntryPoint
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldModuleEntryPoint() {
- if (jTextFieldModuleEntryPoint == null) {
- jTextFieldModuleEntryPoint = new JTextField();
- jTextFieldModuleEntryPoint.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldModuleEntryPoint;
- }
-
- /**
- * This method initializes jTextFieldModuleUnloadImage
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldModuleUnloadImage() {
- if (jTextFieldModuleUnloadImage == null) {
- jTextFieldModuleUnloadImage = new JTextField();
- jTextFieldModuleUnloadImage.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldModuleUnloadImage;
- }
-
- /**
- * This method initializes jTextFieldDriverBinding
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverBinding() {
- if (jTextFieldDriverBinding == null) {
- jTextFieldDriverBinding = new JTextField();
- jTextFieldDriverBinding.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldDriverBinding;
- }
-
- /**
- * This method initializes jTextFieldComponentName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldComponentName() {
- if (jTextFieldComponentName == null) {
- jTextFieldComponentName = new JTextField();
- jTextFieldComponentName.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldComponentName;
- }
-
- /**
- * This method initializes jTextFieldDriverConfig
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverConfig() {
- if (jTextFieldDriverConfig == null) {
- jTextFieldDriverConfig = new JTextField();
- jTextFieldDriverConfig.setBounds(new java.awt.Rectangle(168, 50, 320, 20));
- }
- return jTextFieldDriverConfig;
- }
-
- /**
- * This method initializes jTextFieldDriverDiagnostic
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDriverDiagnostic() {
- if (jTextFieldDriverDiagnostic == null) {
- jTextFieldDriverDiagnostic = new JTextField();
- jTextFieldDriverDiagnostic.setBounds(new java.awt.Rectangle(168, 75, 320, 20));
- }
- return jTextFieldDriverDiagnostic;
- }
-
- /**
- * This method initializes jTextFieldConstructor
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldConstructor() {
- if (jTextFieldConstructor == null) {
- jTextFieldConstructor = new JTextField();
- jTextFieldConstructor.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldConstructor;
- }
-
- /**
- * This method initializes jTextFieldDestructor
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDestructor() {
- if (jTextFieldDestructor == null) {
- jTextFieldDestructor = new JTextField();
- jTextFieldDestructor.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldDestructor;
- }
-
- /**
- * This method initializes jTextFieldVirtualAddressMap
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVirtualAddressMap() {
- if (jTextFieldVirtualAddressMap == null) {
- jTextFieldVirtualAddressMap = new JTextField();
- jTextFieldVirtualAddressMap.setBounds(new java.awt.Rectangle(168, 0, 320, 20));
- }
- return jTextFieldVirtualAddressMap;
- }
-
- /**
- * This method initializes jTextFieldExitBootServices
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldExitBootServices() {
- if (jTextFieldExitBootServices == null) {
- jTextFieldExitBootServices = new JTextField();
- jTextFieldExitBootServices.setBounds(new java.awt.Rectangle(168, 25, 320, 20));
- }
- return jTextFieldExitBootServices;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(515, 250);
- this.setContentPane(getJScrollPane());
- this.setTitle("Externs");
- initFrame();
- this.centerWindow();
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inExternsId
-
- **/
- private void init(ExternsIdentification inExternsId, ModuleIdentification mid) {
- init();
- this.id = inExternsId;
-
- //
- // Init arch with module's arch
- //
- this.vArchList = wt.getModuleArch(mid);
-
- if (this.id != null) {
- String type = id.getType();
- //
- // Filter the type to lock down the type
- //
- this.jComboBoxType.removeAllItems();
- this.jComboBoxType.addItem(type);
-
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
-
- //
- // Init specification
- //
- if (type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- this.jTextFieldSpecification.setText(id.getName0());
- }
-
- //
- // Init image
- //
- if (type.equals(EnumerationData.EXTERNS_IMAGE)) {
- this.jTextFieldModuleEntryPoint.setText(id.getName0());
- this.jTextFieldModuleUnloadImage.setText(id.getName1());
- }
-
- //
- // Init library
- //
- if (type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- this.jTextFieldConstructor.setText(id.getName0());
- this.jTextFieldDestructor.setText(id.getName1());
- }
-
- //
- // Init driver
- //
- if (type.equals(EnumerationData.EXTERNS_DRIVER)) {
- this.jTextFieldDriverBinding.setText(id.getName0());
- this.jTextFieldComponentName.setText(id.getName1());
- this.jTextFieldDriverConfig.setText(id.getName2());
- this.jTextFieldDriverDiagnostic.setText(id.getName3());
- }
-
- //
- // Init library
- //
- if (type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- this.jTextFieldVirtualAddressMap.setText(id.getName0());
- this.jTextFieldExitBootServices.setText(id.getName1());
- }
- }
- }
-
- /**
- This is the override edit constructor
-
- @param inBootModesIdentification
- @param iFrame
-
- **/
- public ExternsDlg(ExternsIdentification inExternsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inExternsIdentification, mid);
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jLabelName = new JLabel();
- jLabelName.setText("Choose Extern Type");
- jLabelName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 200));
-
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJComboBoxType(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
-
- jContentPane.add(getJPanelSpecification(), null);
- jContentPane.add(getJPanelImage(), null);
- jContentPane.add(getJPanelDriver(), null);
- jContentPane.add(getJPanelLibrary(), null);
- jContentPane.add(getJPanelCallBack(), null);
- }
- return jContentPane;
- }
-
- /**
- This method initializes Usage type and Externs type
-
- **/
- private void initFrame() {
- Tools.generateComboBoxByVector(this.jComboBoxType, ed.getVExternTypes());
- this.jPanelSpecification.setVisible(true);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- this.getCurrentExterns();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check specification
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- if (isEmpty(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Externs", "Please type specification's name");
- return false;
- }
- if (!DataValidation.isSentence(this.jTextFieldSpecification.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Specification");
- return false;
- }
-
- //
- // No need to check feature flag, return true directly here.
- //
- return true;
- }
-
- //
- // Check image
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_IMAGE)) {
- if (isEmpty(this.jTextFieldModuleEntryPoint.getText())
- && isEmpty(this.jTextFieldModuleUnloadImage.getText())) {
- Log.wrn("Update Externs", "At least one of ModuleEntryPoint or ModuleUnloadImage should have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldModuleEntryPoint.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldModuleEntryPoint.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Module Entry Point");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldModuleUnloadImage.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldModuleUnloadImage.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Module Unload Image");
- return false;
- }
- }
- }
-
- //
- // Check library
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_LIBRARY)) {
- if (isEmpty(this.jTextFieldConstructor.getText()) && isEmpty(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "At least one of Constructor or Destructor should have a value");
- return false;
- }
- if (isEmpty(this.jTextFieldConstructor.getText()) && !isEmpty(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "You must define a Constructor at the same time when you declare a Destructor");
- return false;
- }
- if (!isEmpty(this.jTextFieldConstructor.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldConstructor.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Constructor");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDestructor.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDestructor.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Destructor");
- return false;
- }
- }
- }
-
- //
- // Check driver
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_DRIVER)) {
- if (isEmpty(this.jTextFieldDriverBinding.getText())) {
- Log.wrn("Update Externs", "DriverBinding must have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldDriverBinding.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverBinding.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverBinding");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldComponentName.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldComponentName.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for ComponentName");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDriverConfig.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverConfig.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverConfig");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldDriverDiagnostic.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldDriverDiagnostic.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for DriverDiagnostic");
- return false;
- }
- }
- }
-
- //
- // Check call back
- //
- if (this.jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- if (isEmpty(this.jTextFieldVirtualAddressMap.getText())
- && isEmpty(this.jTextFieldExitBootServices.getText())) {
- Log.wrn("Update Externs", "At least one of VirtualAddressMap or ExitBootServices should have a value");
- return false;
- }
- if (!isEmpty(this.jTextFieldVirtualAddressMap.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldVirtualAddressMap.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Virtual Address Map");
- return false;
- }
- }
- if (!isEmpty(this.jTextFieldExitBootServices.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldExitBootServices.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Exit Boot Services");
- return false;
- }
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Externs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private ExternsIdentification getCurrentExterns() {
- String arg0 = "";
- String arg1 = "";
- String arg2 = "";
- String arg3 = "";
-
- String type = this.jComboBoxType.getSelectedItem().toString();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
-
- if (type.equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- arg0 = this.jTextFieldSpecification.getText();
- id = new ExternsIdentification(arg0, type);
- }
-
- if (type.equals(EnumerationData.EXTERNS_IMAGE)) {
- arg0 = this.jTextFieldModuleEntryPoint.getText();
- arg1 = this.jTextFieldModuleUnloadImage.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_LIBRARY)) {
- arg0 = this.jTextFieldConstructor.getText();
- arg1 = this.jTextFieldDestructor.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_DRIVER)) {
- arg0 = this.jTextFieldDriverBinding.getText();
- arg1 = this.jTextFieldComponentName.getText();
- arg2 = this.jTextFieldDriverConfig.getText();
- arg3 = this.jTextFieldDriverDiagnostic.getText();
- id = new ExternsIdentification(arg0, arg1, arg2, arg3, type, featureFlag, arch);
- }
-
- if (type.equals(EnumerationData.EXTERNS_CALL_BACK)) {
- arg0 = this.jTextFieldVirtualAddressMap.getText();
- arg1 = this.jTextFieldExitBootServices.getText();
- id = new ExternsIdentification(arg0, arg1, type, featureFlag, arch);
- }
-
- return id;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == jComboBoxType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_SPECIFICATION)) {
- this.jPanelSpecification.setVisible(true);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(false);
- this.jArchCheckBox.setAllItemsEnabled(false);
- this.jLabelArch.setLocation(12, 62);
- this.jArchCheckBox.setLocation(168, 62);
- this.jLabelFeatureFlag.setLocation(12, 87);
- this.jTextFieldFeatureFlag.setLocation(168, 87);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_IMAGE)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(true);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_LIBRARY)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(true);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_DRIVER)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(true);
- this.jPanelCallBack.setVisible(false);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 137);
- this.jArchCheckBox.setLocation(168, 137);
- this.jLabelFeatureFlag.setLocation(12, 162);
- this.jTextFieldFeatureFlag.setLocation(168, 162);
- } else if (jComboBoxType.getSelectedItem().toString().equals(EnumerationData.EXTERNS_CALL_BACK)) {
- this.jPanelSpecification.setVisible(false);
- this.jPanelImage.setVisible(false);
- this.jPanelLibrary.setVisible(false);
- this.jPanelDriver.setVisible(false);
- this.jPanelCallBack.setVisible(true);
- this.jLabelArch.setEnabled(true);
- this.jArchCheckBox.setEnabledItems(this.vArchList);
- this.jLabelArch.setLocation(12, 87);
- this.jArchCheckBox.setLocation(168, 87);
- this.jLabelFeatureFlag.setLocation(12, 112);
- this.jTextFieldFeatureFlag.setLocation(168, 112);
- }
- }
- }
-
- public ExternsIdentification getId() {
- return id;
- }
-
- public void setId(ExternsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
deleted file mode 100644
index cf22e2c102..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/GuidsDlg.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/** @file
- <<The file is used to create, update Guids of the MSA file>>
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Guids.GuidsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Guids of the MSA file
- *
- * It extends IDialog
- *
- */
-public class GuidsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 6710858997766979803L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private GuidsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select the C Name of the GUID");
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the GUID</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will use the GUID only if it is present</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module always produces the GUID</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module will sometimes produce the GUID</td></tr>"
- + "<tr><td>DEFAULT</td><td>Default is the the GUID that specified the<br>instance of the package</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- *
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane jScrollPaneHelpText
- *
- **/
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- *
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Guids");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- *
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inGuidsId
- *
- */
- private void init(GuidsIdentification inGuidsId, ModuleIdentification mid) {
- init();
- this.id = inGuidsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Guid", "This module hasn't defined any package dependency, so there is no guid can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllGuidDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid),
- EnumerationData.GUID_TYPE_GUID));
-
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inGuidsIdentification
- * @param iFrame
- *
- */
- public GuidsDlg(GuidsIdentification inGuidsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inGuidsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Select GUID's C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVGuidUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentGuids();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one Guid Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Guids", "Incorrect data type for Guid Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Guids", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private GuidsIdentification getCurrentGuids() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new GuidsIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public GuidsIdentification getId() {
- return id;
- }
-
- public void setId(GuidsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java
deleted file mode 100644
index 906be0b9ff..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HiiPackagesDlg.java
+++ /dev/null
@@ -1,461 +0,0 @@
-/** @file
-
- The file is used to create, update Hii Packages section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.HiiPackages.HiiPackagesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Hii Packages of the MSA file
- *
- * It extends IDialog
- *
- */
-public class HiiPackagesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -6851574146786158116L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelName = null;
-
- private JTextField jTextFieldName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private HiiPackagesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- *
- * This method initializes jTextFieldName
- *
- * @return javax.swing.JTextField jTextFieldName
- *
- */
- private JTextField getJTextFieldName() {
- if (jTextFieldName == null) {
- jTextFieldName = new JTextField();
- jTextFieldName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jTextFieldName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldName.setToolTipText("Enter the C Name of the HII Package");
- }
- return jTextFieldName;
- }
-
- /**
- *
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Hii is always registered</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Some executions paths will require the Hii to be registered</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- *
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- *
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- *
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea jTextAreaHelpText
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- *
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- *
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- *
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- *
- * This method initializes this
- *
- **/
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hii Packages");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inHiiPackagesId
- *
- **/
- private void init(HiiPackagesIdentification inHiiPackagesId, ModuleIdentification mid) {
- init();
- this.id = inHiiPackagesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (this.id != null) {
- this.jTextFieldName.setText(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inHiiPackagesIdentification
- * @param iFrame
- *
- **/
- public HiiPackagesDlg(HiiPackagesIdentification inHiiPackagesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inHiiPackagesIdentification, mid);
- }
-
- /**
- *
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- *
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelName = new JLabel();
- jLabelName.setText("Hii Package C Name");
- jLabelName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJTextFieldName(), null);
-
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
-
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
-
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
-
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- *
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHiiPackageUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentHiiPackages();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- *
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Hii Package Name
- //
- if (isEmpty(this.jTextFieldName.getText())) {
- Log.wrn("Update Hii Packages", "Hii Package Name Record must be entered!");
- return false;
- }
-
- if (!isEmpty(this.jTextFieldName.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldName.getText())) {
- Log.wrn("Update Hii Packages", "Incorrect data type for Hii Package Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hii Packages", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private HiiPackagesIdentification getCurrentHiiPackages() {
- String arg0 = this.jTextFieldName.getText();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new HiiPackagesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public HiiPackagesIdentification getId() {
- return id;
- }
-
- public void setId(HiiPackagesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
deleted file mode 100644
index caf1649984..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/HobsDlg.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/** @file
-
- The file is used to create, update Hob section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Hobs.HobsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Hob of the MSA file
- *
- * It extends IDialog
- *
- */
-public class HobsDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -553473437579358325L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelUsage = null;
-
- private JLabel jLabelHobType = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JComboBox jComboBoxHobType = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private HobsIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Hob");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxHobType
- *
- * @return javax.swing.JComboBox jComboBoxHobType
- *
- */
- private JComboBox getJComboBoxHobType() {
- if (jComboBoxHobType == null) {
- jComboBoxHobType = new JComboBox();
- jComboBoxHobType.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxHobType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxHobType
- .setToolTipText("<html><table>"
- + "<tr><td>PHIT</td><td>EFI_HOB_TYPE_HANDOFF</td></tr>"
- + "<tr><td>MEMORY_ALLOCATION</td><td>EFI_HOB_TYPE_MEMORY_ALLOCATION and $BaseName</td></tr>"
- + "<tr><td>RESOURCE_DESCRIPTOR</td><td>EFI_HOB_TYPE_RESOURCE_DESCRIPTOR</td></tr>"
- + "<tr><td>GUID_EXTENTION</td><td>EFI_HOB_TYPE_GUID_EXTENSION and BaseName of GUID</td></tr>"
- + "<tr><td>FIRMWARE_VOLUME</td><td>EFI_HOB_TYPE_FV</td></tr>"
- + "<tr><td>CPU</td><td>EFI_HOB_TYPE_CPU</td></tr>"
- + "<tr><td>POOL</td><td>EFI_HOB_TYPE_PEI_MEMORY_POOL</td></tr>"
- + "<tr><td>CAPSULE_VOLUME</td><td>EFI_HOB_TYPE_CV</td></tr>"
- + "</table></html>");
- }
- return jComboBoxHobType;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>HOB must be present in the system</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>HOB will be used if it's present</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>HOB is always produced</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>HOB will sometimes be produced by the module</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextFieldHelpText
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Hobs");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inHobsId
- *
- */
- private void init(HobsIdentification inHobsId, ModuleIdentification mid) {
- init();
- this.id = inHobsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for hob");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_HOB));
- this.iComboBoxGuidC_Name.insertItemAt(DataType.EMPTY_SELECT_ITEM, 0);
- this.iComboBoxGuidC_Name.setSelectedIndex(0);
-
-
- if (this.id != null) {
- String tmpName = id.getName();
- if (isEmpty(tmpName)) {
- tmpName = DataType.EMPTY_SELECT_ITEM;
- }
- this.iComboBoxGuidC_Name.setSelectedItem(tmpName);
- this.jComboBoxHobType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inHobsIdentification
- * @param iFrame
- *
- */
- public HobsDlg(HobsIdentification inHobsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inHobsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxGuidC_Name.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- this.jComboBoxHobType.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- public JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Hob's Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelHobType = new JLabel();
- jLabelHobType.setText("Hob Type");
- jLabelHobType.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelHobType, null);
- jContentPane.add(getJComboBoxHobType(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type and Hob type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVHobUsage());
- Tools.generateComboBoxByVector(jComboBoxHobType, ed.getVHobType());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentHobs();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- String tmpName = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- if (!tmpName.equals(DataType.EMPTY_SELECT_ITEM) && isEmpty(tmpName)) {
- if (!DataValidation.isC_NameType(this.iComboBoxGuidC_Name.getSelectedItem().toString())) {
- Log.wrn("Update Hobs", "Incorrect data type for Hob Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Hobs", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private HobsIdentification getCurrentHobs() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxHobType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- id = new HobsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- public HobsIdentification getId() {
- return id;
- }
-
- public void setId(HobsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
deleted file mode 100644
index 5c48303a26..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/LibraryClassDefsDlg.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/** @file
-
- The file is used to create, update Library Class Definition section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.find.Find;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.LibraryClass.LibraryClassVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Library Class Definition section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class LibraryClassDefsDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -1743248695411382857L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null;
-
- private IComboBox iComboBoxLibraryClassName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelLibraryClassName = null;
-
- private JScrollPane jScrollPane = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JLabel jLabelRecommendedInstanceVersion = null;
-
- private JTextField jTextFieldRecommendedInstanceVersion = null;
-
- private JLabel jLabelRecommendedInstanceGuid = null;
-
- private JTextField jTextFieldRecommendedInstanceGuid = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelModuleList = null;
-
- private JScrollPane jScrollPaneModuleList = null;
-
- private ICheckBoxList iCheckBoxListModule = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextField jTextFieldHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not for UI
- //
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private LibraryClassIdentification lcid = null;
-
- /**
- This method initializes jComboBoxSelect
-
- @return javax.swing.JComboBox jComboBoxSelect
-
- **/
- private IComboBox getIComboBoxLibraryClassName() {
- if (iComboBoxLibraryClassName == null) {
- iComboBoxLibraryClassName = new IComboBox();
- iComboBoxLibraryClassName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxLibraryClassName.setPreferredSize(new Dimension(320, 20));
- iComboBoxLibraryClassName.setEnabled(true);
- }
- return iComboBoxLibraryClassName;
- }
-
- /**
- This method initializes jComboBoxUsage
-
- @return javax.swing.JComboBox jComboBoxUsage
-
- **/
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new Dimension(320, 20));
- }
- return jComboBoxUsage;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldRecommendedInstanceVersion
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldRecommendedInstanceVersion() {
- if (jTextFieldRecommendedInstanceVersion == null) {
- jTextFieldRecommendedInstanceVersion = new JTextField();
- jTextFieldRecommendedInstanceVersion.setPreferredSize(new java.awt.Dimension(260, 20));
- jTextFieldRecommendedInstanceVersion.setSize(new java.awt.Dimension(260, 20));
- jTextFieldRecommendedInstanceVersion.setLocation(new java.awt.Point(220, 85));
- jTextFieldRecommendedInstanceVersion.setVisible(false);
- }
- return jTextFieldRecommendedInstanceVersion;
- }
-
- /**
- * This method initializes jTextFieldRecommendedInstanceGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldRecommendedInstanceGuid() {
- if (jTextFieldRecommendedInstanceGuid == null) {
- jTextFieldRecommendedInstanceGuid = new JTextField();
- jTextFieldRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(220, 110, 190, 20));
- jTextFieldRecommendedInstanceGuid.setPreferredSize(new java.awt.Dimension(190, 20));
- jTextFieldRecommendedInstanceGuid.setVisible(false);
- }
- return jTextFieldRecommendedInstanceGuid;
- }
-
- /**
- * This method initializes jButtonGenerateGuid
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(415, 112, 65, 20));
- jButtonGenerateGuid.setPreferredSize(new java.awt.Dimension(65, 20));
- jButtonGenerateGuid.setText("GEN");
- jButtonGenerateGuid.setVisible(false);
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 197, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes iCheckBoxListArch
-
- @return ICheckBoxList
- **/
- private ICheckBoxList getICheckBoxListSupModuleList() {
- if (iCheckBoxListModule == null) {
- iCheckBoxListModule = new ICheckBoxList();
- }
- return iCheckBoxListModule;
- }
-
- /**
- This method initializes jScrollPaneModuleList
-
- @return javax.swing.JScrollPane
-
- **/
- private JScrollPane getJScrollPaneModuleList() {
- if (jScrollPaneModuleList == null) {
- jScrollPaneModuleList = new JScrollPane();
- jScrollPaneModuleList.setBounds(new java.awt.Rectangle(168, 112, 320, 80));
- jScrollPaneModuleList.setPreferredSize(new java.awt.Dimension(320, 80));
- jScrollPaneModuleList.setViewportView(getICheckBoxListSupModuleList());
- }
- return jScrollPaneModuleList;
- }
-
- /**
- This method initializes jTextFieldHelpText
-
- @return javax.swing.JTextField
-
- **/
- private JTextField getJTextFieldHelpText() {
- if (jTextFieldHelpText == null) {
- jTextFieldHelpText = new JTextField();
- jTextFieldHelpText.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldHelpText.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jTextFieldHelpText;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(300, 232, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(400, 232, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public LibraryClassDefsDlg(LibraryClassIdentification inLibraryClassIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inLibraryClassIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setContentPane(getJScrollPane());
- this.setTitle("Library Class Definitions");
- this.setBounds(new java.awt.Rectangle(0, 0, 505, 305));
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- This method initializes this
-
- **/
- private void init(LibraryClassIdentification inLibraryClassIdentification, ModuleIdentification mid) {
- init();
- this.lcid = inLibraryClassIdentification;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined library classes from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Library Class",
- "This module hasn't defined any package dependency, so there is no library class can be added");
- }
-
- Tools
- .generateComboBoxByVector(
- this.iComboBoxLibraryClassName,
- wt
- .getAllLibraryClassDefinitionsFromPackages(wt
- .getPackageDependenciesOfModule(mid)));
-
- if (lcid != null) {
- this.iComboBoxLibraryClassName.setSelectedItem(lcid.getLibraryClassName());
- this.jComboBoxUsage.setSelectedItem(lcid.getUsage());
- this.jTextFieldRecommendedInstanceVersion.setText(lcid.getRecommendedInstanceVersion());
- this.jTextFieldRecommendedInstanceGuid.setText(lcid.getRecommendedInstanceGuid());
- this.jTextFieldFeatureFlag.setText(lcid.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(lcid.getSupArchList());
- this.iCheckBoxListModule.setAllItemsUnchecked();
- this.iCheckBoxListModule.initCheckedItem(true, lcid.getSupModuleList());
- this.jTextFieldHelpText.setText(lcid.getHelp());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.iComboBoxLibraryClassName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
- jLabelHelpText.setText("Help Text");
- jLabelModuleList = new JLabel();
- jLabelModuleList.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
- jLabelModuleList.setText("Supported Module Types");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 197, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelRecommendedInstanceGuid = new JLabel();
- jLabelRecommendedInstanceGuid.setBounds(new java.awt.Rectangle(12, 87, 200, 20));
- jLabelRecommendedInstanceGuid.setText("Recommended Instance Guid");
- jLabelRecommendedInstanceGuid.setVisible(false);
- jLabelRecommendedInstanceVersion = new JLabel();
- jLabelRecommendedInstanceVersion.setBounds(new java.awt.Rectangle(12, 87, 200, 20));
- jLabelRecommendedInstanceVersion.setText("Recommended Instance Version");
- jLabelRecommendedInstanceVersion.setVisible(false);
- jLabelLibraryClassName = new JLabel();
- jLabelLibraryClassName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelLibraryClassName.setText("Library Class Name");
- jLabelUsage = new JLabel();
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelUsage.setText("Usage");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(495, 255));
-
- jContentPane.add(getIComboBoxLibraryClassName(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelLibraryClassName, null);
- jContentPane.add(jLabelRecommendedInstanceVersion, null);
- jContentPane.add(getJTextFieldRecommendedInstanceVersion(), null);
- jContentPane.add(jLabelRecommendedInstanceGuid, null);
- jContentPane.add(getJTextFieldRecommendedInstanceGuid(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 10));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 35));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelModuleList, null);
- jContentPane.add(getJScrollPaneModuleList(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJTextFieldHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- This method initializes all existing libraries and usage types
-
- **/
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVLibraryUsage());
- this.iCheckBoxListModule.setAllItems(ed.getVFrameworkModuleTypes());
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonGenerateGuid) {
- this.jTextFieldRecommendedInstanceGuid.setText(Tools.generateUuidString());
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentLibraryClass();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check LibraryClass
- //
- if (this.iComboBoxLibraryClassName.getSelectedItem() == null) {
- Log.wrn("Update Library Class Definitions", "Please select one Library Class");
- return false;
- }
- if (!DataValidation.isLibraryClass(this.iComboBoxLibraryClassName.getSelectedItem().toString())) {
- Log.wrn("Update Library Class Definitions", "Incorrect data type for Library Class");
- return false;
- }
-
- //
- // Check RecommendedInstanceVersion
- //
- // if (!isEmpty(this.jTextFieldRecommendedInstanceVersion.getText())) {
- // if (!DataValidation.isRecommendedInstanceVersion(this.jTextFieldRecommendedInstanceVersion.getText())) {
- // Log.err("Incorrect data type for Recommended Instance Version");
- // return false;
- // }
- // }
-
- //
- // Check RecommendedInstanceGuid
- //
- // if (!isEmpty(this.jTextFieldRecommendedInstanceGuid.getText())) {
- // if (!DataValidation.isGuid(this.jTextFieldRecommendedInstanceGuid.getText())) {
- // Log.err("Incorrect data type for Recommended Instance Guid");
- // return false;
- // }
- // }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Library Class Definitions", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- //
- // Check if the library is produced
- //
- String strUsage = this.jComboBoxUsage.getSelectedItem().toString();
- //
- // Check only when the library class is consumed
- //
- if (strUsage.equals(DataType.USAGE_TYPE_ALWAYS_CONSUMED) || strUsage.equals(DataType.USAGE_TYPE_SOMETIMES_CONSUMED)) {
- LibraryClassVector v = Find.getAllLibraryClassVector();
- boolean isFind = false;
- for (int index = 0; index < v.size(); index++) {
- LibraryClassIdentification lid = v.getLibraryClass(index);
- if (lid.getLibraryClassName().equals(this.iComboBoxLibraryClassName.getSelectedItem().toString())) {
- if (lid.getUsage().equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || lid.getUsage().equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- isFind = true;
- break;
- }
- }
- }
- if (!isFind) {
- Log.wrn("Update Library Class Definitions", "This Library Class has no instance yet. It may have some errors in build time.");
- //return false;
- }
- }
-
- return true;
- }
-
- private LibraryClassIdentification getCurrentLibraryClass() {
- String name = this.iComboBoxLibraryClassName.getSelectedItem().toString();
- String usage = this.jComboBoxUsage.getSelectedItem().toString();
- String version = this.jTextFieldRecommendedInstanceVersion.getText();
- String guid = this.jTextFieldRecommendedInstanceGuid.getText();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
- Vector<String> module = this.iCheckBoxListModule.getAllCheckedItemsString();
- String help = this.jTextFieldHelpText.getText();
- lcid = new LibraryClassIdentification(name, usage, version, guid, arch, featureFlag, module, help);
- return lcid;
- }
-
- public LibraryClassIdentification getLcid() {
- return lcid;
- }
-
- public void setLcid(LibraryClassIdentification lcid) {
- this.lcid = lcid;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
deleted file mode 100644
index fa3d4a4f33..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PCDsDlg.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/** @file
-
- The file is used to create, update PcdCode section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdCodedIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update PcdCoded section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PCDsDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 2227717658188438696L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelItemType = null;
-
- private JLabel jLabelC_Name = null;
-
- private JComboBox jComboBoxItemType = null;
-
- private JComboBox jComboBoxCName = null;
-
- private JLabel jLabelDefaultValue = null;
-
- private JTextField jTextFieldDefaultValue = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTokenSpaceGuid = null;
-
- private JTextField jTextFieldTokenSpaceGuid = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- //
- // Not used by UI
- //
- private PcdCodedIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private PcdVector pcd = wt.getAllPcdDeclarationsFromWorkspace();
-
- /**
- * This method initializes jComboBoxItemType
- *
- * @return javax.swing.JComboBox jComboBoxItemType
- *
- */
- private JComboBox getJComboBoxItemType() {
- if (jComboBoxItemType == null) {
- jComboBoxItemType = new JComboBox();
- jComboBoxItemType.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxItemType.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jComboBoxItemType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private JComboBox getJComboBoxCName() {
- if (jComboBoxCName == null) {
- jComboBoxCName = new JComboBox();
- jComboBoxCName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxCName.addItemListener(this);
- }
- return jComboBoxCName;
- }
-
- /**
- * This method initializes jTextFieldDefaultValue
- *
- * @return javax.swing.JTextField jTextFieldDefaultValue
- *
- */
- private JTextField getJTextFieldDefaultValue() {
- if (jTextFieldDefaultValue == null) {
- jTextFieldDefaultValue = new JTextField();
- jTextFieldDefaultValue.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jTextFieldDefaultValue;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 112));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTokenSpaceGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTokenSpaceGuid() {
- if (jTextFieldTokenSpaceGuid == null) {
- jTextFieldTokenSpaceGuid = new JTextField();
- jTextFieldTokenSpaceGuid.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jTextFieldTokenSpaceGuid.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldTokenSpaceGuid.setVisible(false);
- }
- return jTextFieldTokenSpaceGuid;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 182, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 212, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 212, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- }
- return jComboBoxUsage;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 280);
- this.setContentPane(getJScrollPane());
- this.setTitle("Pcd Coded");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inPcdCodedId
- *
- */
- private void init(PcdCodedIdentification inPcdCodedId, ModuleIdentification mid) {
- init();
- this.id = inPcdCodedId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined pcds from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Pcd", "This module hasn't defined any package dependency, so there is no pcd can be added");
- }
-
- pcd = wt.getAllPcdDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid));
- for (int index = 0; index < pcd.size(); index++) {
- jComboBoxCName.addItem(pcd.getPcd(index));
- }
-
- if (this.id != null) {
- for (int index = 0; index < this.jComboBoxCName.getItemCount(); index++) {
- if (this.jComboBoxCName.getItemAt(index).toString().equals(id.getName())) {
- this.jComboBoxCName.setSelectedIndex(index);
- break;
- }
- }
- this.jTextFieldTokenSpaceGuid.setText(id.getGuid());
- this.jTextFieldDefaultValue.setText(id.getValue());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jComboBoxItemType.setSelectedItem(id.getType());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inPcdCodedId
- * @param iFrame
- *
- */
- public PCDsDlg(PcdCodedIdentification inPcdCodedId, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPcdCodedId, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldDefaultValue.setEnabled(!isView);
- this.jComboBoxItemType.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelUsage = new JLabel();
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelUsage.setText("Usge");
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("PCD C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelItemType = new JLabel();
- jLabelItemType.setText("PCD Item Type");
- jLabelItemType.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jLabelDefaultValue = new JLabel();
- jLabelDefaultValue.setText("Default Value");
- jLabelDefaultValue.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 112));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setText("Help Text");
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 112, 168, 20));
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 182, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelTokenSpaceGuid = new JLabel();
- jLabelTokenSpaceGuid.setText("Token Space C Name");
- jLabelTokenSpaceGuid.setVisible(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setText("Supported Architectures");
- jLabelArch.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
-
- // Hidden field
- jLabelTokenSpaceGuid.setBounds(new java.awt.Rectangle(12, 62, 140, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 235));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getJComboBoxCName(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelItemType, null);
- jContentPane.add(getJComboBoxItemType(), null);
- jContentPane.add(jLabelDefaultValue, null);
- jContentPane.add(getJTextFieldDefaultValue(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- // Hidden
- jContentPane.add(getJTextFieldTokenSpaceGuid(), null);
- jContentPane.add(jLabelTokenSpaceGuid, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type, Item type and Datum type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPcdUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPcdCoded();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check C_Name
- //
- if (this.jComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Pcd", "Please select one Pcd Name");
- return false;
- }
-
- if (!isEmpty(this.jComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.jComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for C Name");
- return false;
- }
- }
-
- //
- // Check TokenSpaceGuid
- //
- if (!isEmpty(this.jTextFieldTokenSpaceGuid.getText())) {
- if (!DataValidation.isC_NameType(this.jTextFieldTokenSpaceGuid.getText())) {
- Log.wrn("Update PcdCoded",
- "Incorrect data type for the selected pcd entry, please check the datatype specified in the spd file");
- return false;
- }
- }
-
- //
- // Check DefaultValue
- //
- if (!isEmpty(this.jTextFieldDefaultValue.getText())) {
- if (!DataValidation.isDefaultValueType(this.jTextFieldDefaultValue.getText())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for Default Value");
- return false;
- }
- }
-
- //
- // Check HelpText
- //
- if (isEmpty(this.jTextAreaHelpText.getText())) {
- Log.wrn("Update PcdCoded", "Help Text should not be empty");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update PcdCoded", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PcdCodedIdentification getCurrentPcdCoded() {
- String arg0 = this.jComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jTextFieldTokenSpaceGuid.getText();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
-
- String arg4 = this.jTextFieldDefaultValue.getText();
- String arg5 = this.jTextAreaHelpText.getText();
- String arg6 = this.jComboBoxItemType.getSelectedItem().toString();
- String arg7 = this.jComboBoxUsage.getSelectedItem().toString();
- if (arg7.equals(DataType.EMPTY_SELECT_ITEM)) {
- arg7 = "";
- }
-
- id = new PcdCodedIdentification(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7);
- return id;
- }
-
- public PcdCodedIdentification getId() {
- return id;
- }
-
- public void setId(PcdCodedIdentification id) {
- this.id = id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- int index = this.jComboBoxCName.getSelectedIndex();
- if (arg0.getSource() == this.jComboBoxCName && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (pcd.getPcd(index).getGuidCName() == null || isEmpty(pcd.getPcd(index).getGuidCName())
- || pcd.getPcd(index).getType() == null || pcd.getPcd(index).getHelp() == null
- || isEmpty(pcd.getPcd(index).getHelp())) {
- Log.wrn("select pcd entry when editing msa",
- "The selected value is defined incorrectly.\r\nPlease check it in the spd file");
- } else {
- this.jTextFieldTokenSpaceGuid.setText(pcd.getPcd(index).getGuidCName());
- Tools.generateComboBoxByVector(this.jComboBoxItemType, pcd.getPcd(index).getType());
- this.jTextAreaHelpText.setText(pcd.getPcd(index).getHelp());
- this.jTextAreaHelpText.setSelectionStart(0);
- this.jTextAreaHelpText.setSelectionEnd(0);
- }
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java
deleted file mode 100644
index 00161b5ecb..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PackageDepDlg.java
+++ /dev/null
@@ -1,441 +0,0 @@
-/** @file
-
- The file is used to create, update Package Dependencies section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PackageDependencies.PackageDependenciesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Package Dependencies section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PackageDepDlg extends IDialog implements ItemListener {
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 3465193035145152131L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelPackageName = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JComboBox jComboBoxPackageName = null;
-
- private JLabel jLabelPackageGuid = null;
-
- private JTextField jTextFieldPackageGuid = null;
-
- private JLabel jLabelPackageVersion = null;
-
- private JTextField jTextFieldPackageVersion = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelArch = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private PackageDependenciesIdentification pdid = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private Vector<PackageIdentification> vPackage = wt.getAllPackages();
-
- /**
- * This method initializes jComboBoxPackageName
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxPackageName() {
- if (jComboBoxPackageName == null) {
- jComboBoxPackageName = new JComboBox();
- jComboBoxPackageName.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxPackageName.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxPackageName.setToolTipText("If your Module requires a package, list that here.");
- jComboBoxPackageName.addItemListener(this);
- }
- return jComboBoxPackageName;
- }
-
- /**
- * This method initializes jTextFieldPackageGuid
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldPackageGuid() {
- if (jTextFieldPackageGuid == null) {
- jTextFieldPackageGuid = new JTextField();
- jTextFieldPackageGuid.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jTextFieldPackageGuid.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldPackageGuid.setEditable(false);
- jTextFieldPackageGuid.setVisible(false);
- }
- return jTextFieldPackageGuid;
- }
-
- /**
- * This method initializes jTextFieldPackageVersion
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldPackageVersion() {
- if (jTextFieldPackageVersion == null) {
- jTextFieldPackageVersion = new JTextField();
- jTextFieldPackageVersion.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jTextFieldPackageVersion.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldPackageVersion
- .setToolTipText("<html>If this module depends on a specific version of a package, <br>"
- + "enter the package version here. <br>"
- + "If the module can use the latest version <br>"
- + "that does not break backward compatibility, <br>"
- + "leave this field blank</html>");
- }
- return jTextFieldPackageVersion;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 87, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 122, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 122, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 216);
- this.setContentPane(getJScrollPane());
- this.setTitle("Package Dependencies");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this
- *
- */
- private void init(PackageDependenciesIdentification inPackageDependenciesIdentification, ModuleIdentification mid) {
- init();
- this.pdid = inPackageDependenciesIdentification;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (pdid != null) {
- this.jComboBoxPackageName.setSelectedItem(pdid.getName());
- this.jTextFieldPackageVersion.setText(pdid.getVersion());
- this.jTextFieldPackageGuid.setText(pdid.getGuid());
- jTextFieldFeatureFlag.setText(pdid.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(pdid.getSupArchList());
- }
- }
-
- /**
- * This is the default constructor
- *
- */
- public PackageDepDlg(PackageDependenciesIdentification inPackageDependenciesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPackageDependenciesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxPackageName.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelPackageName = new JLabel();
- jLabelPackageName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelPackageName.setText("Package Name");
-
- jLabelPackageVersion = new JLabel();
- jLabelPackageVersion.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelPackageVersion.setText("Package Version");
-
- jLabelPackageGuid = new JLabel();
- jLabelPackageGuid.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelPackageGuid.setText("Package Guid");
- jLabelPackageGuid.setVisible(false);
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 170));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelPackageName, null);
- jContentPane.add(getJComboBoxPackageName(), null);
- jContentPane.add(jLabelPackageGuid, null);
- jContentPane.add(getJTextFieldPackageGuid(), null);
- jContentPane.add(jLabelPackageVersion, null);
- jContentPane.add(getJTextFieldPackageVersion(), null);
- // LAH Not Used here
- // jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPackageDependencies();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * This method initializes Usage type, Package type and Arch type
- *
- */
- private void initFrame() {
- for (int index = 0; index < vPackage.size(); index++) {
- jComboBoxPackageName.addItem(vPackage.elementAt(index).getName());
- }
- }
-
- /**
- * Data validation for all fields before add current item to Vector
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check PackageGuid
- //
- // if (!isEmpty(this.jTextFieldPackageGuid.getText())) {
- // if (!DataValidation.isGuid(this.jTextFieldPackageGuid.getText())) {
- // Log.err("Incorrect data type for Package Guid");
- // return false;
- // }
- // }
-
- //
- // Check PackageVersion
- //
- if (!isEmpty(this.jTextFieldPackageVersion.getText())) {
- if (!DataValidation.isVersion(this.jTextFieldPackageVersion.getText())) {
- Log.wrn("Update Package Dependencies", "Incorrect data type for Package Version");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Package Dependencies", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PackageDependenciesIdentification getCurrentPackageDependencies() {
- String arg0 = this.jComboBoxPackageName.getSelectedItem().toString();
- String arg1 = this.jTextFieldPackageVersion.getText();
- String arg2 = this.jTextFieldPackageGuid.getText();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- pdid = new PackageDependenciesIdentification(arg0, arg1, arg2, arg3, arg4);
- return pdid;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxPackageName && arg0.getStateChange() == ItemEvent.SELECTED) {
- for (int index = 0; index < vPackage.size(); index++) {
- if (this.jComboBoxPackageName.getSelectedItem().toString().equals(vPackage.get(index).getName())) {
- this.jTextFieldPackageGuid.setText(vPackage.get(index).getGuid());
- }
- }
- }
- }
-
- public PackageDependenciesIdentification getPdid() {
- return pdid;
- }
-
- public void setPdid(PackageDependenciesIdentification pdid) {
- this.pdid = pdid;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java
deleted file mode 100644
index c649d13508..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/PpisDlg.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/** @file
-
- The file is used to create, update Ppi section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Ppis.PpisIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Ppi section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class PpisDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -4284901202357037724L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private JLabel jLabelPpiType = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JComboBox jComboBoxPpiType = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private PpisIdentification id = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private EnumerationData ed = new EnumerationData();
-
- /**
- * This method initializes jComboBoxPpiType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxPpiType() {
- if (jComboBoxPpiType == null) {
- jComboBoxPpiType = new JComboBox();
- jComboBoxPpiType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxPpiType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxPpiType.addItemListener(this);
- jComboBoxPpiType
- .setToolTipText("<html>PPIs are named by GUID.<br>PPI Notify is consumed via a register PPI Notify mechanism</html>");
- }
- return jComboBoxPpiType;
- }
-
- /**
- * This method initializes jTextFieldC_Name
- *
- * @return javax.swing.JTextField jTextFieldC_Name
- *
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select Guid C Name of PPI");
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table><tr><td colspan=2 align=center><b>PPI</b></td></tr><tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the PPI</td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module sometimes consumes the PPI</td></tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces the PPI</td></tr><tr><td>SOMETIMES_PRODUCED</td><td>Module sometimes produces the PPI</td></tr><tr><td colspan=2 align=center><b>PPI Notify</b></td></tr><tr><td>SOMETIMES_CONSUMED</td><td>Module will consume the PPI if it is produced. Consumption<br>is defined by executing the PPI notify function</td></tr></table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("PPI Definitions");
- initFrame();
- this.centerWindow();
- }
-
- /**
- This method initializes this Fill values to all fields if these values are
- not empty
-
- @param inPpisId
- @param mid
-
- **/
- private void init(PpisIdentification inPpisId, ModuleIdentification mid) {
- init();
- this.id = inPpisId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined ppis from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Ppi", "This module hasn't defined any package dependency, so there is no ppi can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllPpiDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxPpiType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inProtocolsIdentification
- * @param iFrame
- *
- */
- public PpisDlg(PpisIdentification inPpisIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inPpisIdentification, mid);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelPpiType = new JLabel();
- jLabelPpiType.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
- jLabelPpiType.setText("Select Ppi Type");
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("PPI GUID C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(14, 87, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelPpiType, null);
- jContentPane.add(getJComboBoxPpiType(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxPpiType, ed.getVPpiType());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentPpis();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update Ppis", "Please select one Ppi/PpiNotify Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Ppis", "Incorrect data type for Ppi/PpiNotify Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Ppis", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private PpisIdentification getCurrentPpis() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxPpiType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
-
- id = new PpisIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- } /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
-
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxPpiType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (this.jComboBoxPpiType.getSelectedItem().toString().equals(ed.getVPpiType().get(0))) {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVPpiUsage());
- } else {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVPpiNotifyUsage());
- }
- }
- }
-
- public PpisIdentification getId() {
- return id;
- }
-
- public void setId(PpisIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java
deleted file mode 100644
index aa7c453290..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/ProtocolsDlg.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/** @file
-
- The file is used to create, update Protocol of section of the MSA file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Protocols.ProtocolsIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Protocol of MSA file
- *
- * It extends IDialog
- *
- */
-public class ProtocolsDlg extends IDialog implements ItemListener {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -9084913640747858848L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelC_Name = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JLabel jLabelProtocolType = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JComboBox jComboBoxProtocolType = null;
-
- private IComboBox iComboBoxCName = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private ProtocolsIdentification id = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private EnumerationData ed = new EnumerationData();
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxProtocolUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table><tr><td colspan=2 align=center><b>Protocol</b></td></tr>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module always consumes the protocol</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMES</td><td>Module sometimes consumes the protocol</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>Module always produces the protocol</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module sometimes produces the protocol</td></tr>"
- + "<tr><td>TO_START</td><td>The protocol is consumed by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"
- + "<tr><td>BY_START</td><td>Protocol is produced by a Driver Binding protocol <b>Start</b><br>function. The protocol is used in EFI 1.10 driver model</td></tr>"
- + "<tr><td colspan=2 align=center><b>Protocol Notify</b></td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module will consume the protocol if it is produced.<br>Consumption is defined by executing the protocol notify<br>function.</td></tr></table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jComboBoxProtocolType
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxProtocolType() {
- if (jComboBoxProtocolType == null) {
- jComboBoxProtocolType = new JComboBox();
- jComboBoxProtocolType.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- jComboBoxProtocolType.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxProtocolType.addItemListener(this);
- jComboBoxProtocolType
- .setToolTipText("<html>Select Protocol Type<br>Protocol Notify is a register protocol notify mechanism.");
- }
- return jComboBoxProtocolType;
- }
-
- /**
- * This method initializes iComboBoxCName
- *
- * @return javax.swing.JComboBox
- */
- private IComboBox getIComboBoxCName() {
- if (iComboBoxCName == null) {
- iComboBoxCName = new IComboBox();
- iComboBoxCName.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxCName.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxCName.setToolTipText("Select Guid C Name of the Protocol");
-
- }
- return iComboBoxCName;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @return javax.swing.JScrollPane
- *
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- // Width must be 20 larger than Content Pane PreferredSize width for MSFT
- // Height must be 45 larger than ContentPane PreferredSize height for MSFT
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Protocols");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inProtocolsId
- *
- */
- private void init(ProtocolsIdentification inProtocolsId, ModuleIdentification mid) {
- init();
- this.id = inProtocolsId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined protocols from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log.wrn("Init Protocol", "This module hasn't defined any package dependency, so there is no protocol can be added");
- }
-
- Tools.generateComboBoxByVector(this.iComboBoxCName,
- wt.getAllProtocolDeclarationsFromPackages(wt.getPackageDependenciesOfModule(mid)));
-
- if (this.id != null) {
- this.iComboBoxCName.setSelectedItem(id.getName());
- this.jComboBoxProtocolType.setSelectedItem(id.getType());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inProtocolsIdentification
- * @param iFrame
- *
- */
- public ProtocolsDlg(ProtocolsIdentification inProtocolsIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inProtocolsIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- this.jTextFieldFeatureFlag.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelProtocolType = new JLabel();
- jLabelProtocolType.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jLabelProtocolType.setText("Select Protocol Type");
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("Protocol Guid C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 155, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelProtocolType, null);
- jContentPane.add(getJComboBoxProtocolType(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(getIComboBoxCName(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxProtocolUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxProtocolType, ed.getVProtocolType());
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVProtocolUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentProtocols();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxCName.getSelectedItem() == null) {
- Log.wrn("Update protocols", "Please select one Protocol/ProtocolNotify Name");
- return false;
- }
-
- if (!isEmpty(this.iComboBoxCName.getSelectedItem().toString())) {
- if (!DataValidation.isC_NameType(this.iComboBoxCName.getSelectedItem().toString())) {
- Log.wrn("Update Protocols", "Incorrect data type for Protocol/ProtocolNotify Name");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Protocols", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private ProtocolsIdentification getCurrentProtocols() {
- String arg0 = this.iComboBoxCName.getSelectedItem().toString();
- String arg1 = this.jComboBoxProtocolType.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
- id = new ProtocolsIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ItemListener#itemStateChanged(java.awt.event.ItemEvent)
- *
- * Reflesh the frame when selected item changed
- *
- */
-
- public void itemStateChanged(ItemEvent arg0) {
- if (arg0.getSource() == this.jComboBoxProtocolType && arg0.getStateChange() == ItemEvent.SELECTED) {
- if (this.jComboBoxProtocolType.getSelectedItem().toString().equals(ed.getVProtocolType().get(0))) {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolUsage());
- } else {
- Tools.generateComboBoxByVector(this.jComboBoxUsage, ed.getVProtocolNotifyUsage());
- }
- }
- }
-
- public ProtocolsIdentification getId() {
- return id;
- }
-
- public void setId(ProtocolsIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
deleted file mode 100644
index 238c000cde..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SourceFilesDlg.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/** @file
-
- The file is used to create, update SourceFiles section of the MSA file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.io.File;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SourceFiles.SourceFilesIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SourceFiles section of the MSA file
- *
- * It extends IDialog
- *
- **/
-public class SourceFilesDlg extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -6765742852142775378L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelFileName = null;
-
- private JTextField jTextFieldFileName = null;
-
- private JButton jButtonOpenFile = null;
-
- private JLabel jLabelToolChainFamily = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelTagName = null;
-
- private JTextField jTextFieldTagName = null;
-
- private JLabel jLabelToolCode = null;
-
- private JTextField jTextFieldToolCode = null;
-
- private IComboBox iComboBoxToolCode = null;
-
- private JTextField jTextFieldToolChainFamily = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private SourceFilesIdentification sfid[] = null;
-
- private String msaFileName = "";
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- This method initializes jTextFieldFileName
-
- @return javax.swing.JTextField jTextFieldFileName
-
- **/
- private JTextField getJTextFieldSourceFilesDirectory() {
- if (jTextFieldFileName == null) {
- jTextFieldFileName = new JTextField();
- jTextFieldFileName.setBounds(new java.awt.Rectangle(168, 12, 250, 20));
- jTextFieldFileName.setPreferredSize(new java.awt.Dimension(250, 20));
- jTextFieldFileName.setToolTipText("Path is relative to the MSA file and must include the file name");
- }
- return jTextFieldFileName;
- }
-
- /**
- This method initializes jButtonOpenFile
-
- @return javax.swing.JButton jButtonOpenFile
-
- **/
- private JButton getJButtonOpenFile() {
- if (jButtonOpenFile == null) {
- jButtonOpenFile = new JButton();
- jButtonOpenFile.setText("Browse");
- jButtonOpenFile.setBounds(new java.awt.Rectangle(422, 12, 85, 20));
- jButtonOpenFile.setPreferredSize(new java.awt.Dimension(85, 20));
- jButtonOpenFile.addActionListener(this);
- }
- return jButtonOpenFile;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldTagName
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(168, 37, 340, 20));
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldTagName.setToolTipText("You may specify a specific tool chain tag name, such as BILL1");
- }
- return jTextFieldTagName;
- }
-
- private IComboBox getIComboBoxToolCode() {
- if (iComboBoxToolCode == null) {
- iComboBoxToolCode = new IComboBox();
- iComboBoxToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- iComboBoxToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- iComboBoxToolCode.setToolTipText("<html>You may select a specific tool command from drop down list,<br>"
- + "or you can DOUBLE-CLICK this field to enter your customized<br>"
- + "tool command.<br>"
- + "Press ENTER to save your input or press ESCAPE to quit</html>");
- }
- return iComboBoxToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolCode
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolCode() {
- if (jTextFieldToolCode == null) {
- jTextFieldToolCode = new JTextField();
- jTextFieldToolCode.setBounds(new java.awt.Rectangle(168, 62, 340, 20));
- jTextFieldToolCode.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolCode.setToolTipText("You may specify a specific tool command, such as ASM");
- jTextFieldToolCode.setVisible(false);
- }
- return jTextFieldToolCode;
- }
-
- /**
- * This method initializes jTextFieldToolChainFamily
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(168, 87, 340, 20));
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldToolChainFamily.setToolTipText("You may specify a specific tool chain family, such as GCC");
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 137, 340, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(340, 20));
- jTextFieldFeatureFlag.setToolTipText("RESERVED FOR FUTURE USE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(317, 172, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(412, 172, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- This is the default constructor
-
- **/
- public SourceFilesDlg(SourceFilesIdentification inSourceFilesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inSourceFilesIdentification, mid);
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setSize(525, 240);
- this.setContentPane(getJScrollPane());
- this.setTitle("Source Files");
- this.setViewMode(false);
- this.centerWindow();
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
-
- @param inSourceFiles The input data of SourceFilesDocument.SourceFiles
-
- **/
- private void init(SourceFilesIdentification inSourceFilesIdentifications, ModuleIdentification mid) {
- init();
- this.msaFileName = mid.getPath();
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- if (inSourceFilesIdentifications != null) {
- this.jTextFieldFileName.setText(inSourceFilesIdentifications.getFilename());
- this.jTextFieldTagName.setText(inSourceFilesIdentifications.getTagName());
-
-// //
-// // Generate Tool Code selection list
-// //
-// Vector<String> v = ed.getVToolCode();
-// boolean isFind = false;
-// String strToolCode = inSourceFilesIdentifications.getToolCode();
-//
-// //
-// // If the input value is not in the default list, add it to the list
-// //
-// if (strToolCode != null) {
-// for (int index = 0; index < v.size(); index++) {
-// if (v.elementAt(index).equals(strToolCode)) {
-// isFind = true;
-// break;
-// }
-// }
-// if (!isFind && !isEmpty(strToolCode)) {
-// v.addElement(strToolCode);
-// }
-// }
-
- Tools.generateComboBoxByVector(iComboBoxToolCode, ed.getVToolCode());
- this.iComboBoxToolCode.setSelectedItem(inSourceFilesIdentifications.getToolCode());
-
- this.jTextFieldToolChainFamily.setText(inSourceFilesIdentifications.getToolChainFamily());
- jTextFieldFeatureFlag.setText(inSourceFilesIdentifications.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(inSourceFilesIdentifications.getSupArchList());
- }
- }
-
- /**
- Disable all components when the mode is view
-
- @param isView true - The view mode; false - The non-view mode
-
- **/
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldFileName.setEnabled(!isView);
- this.jButtonOpenFile.setEnabled(!isView);
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 112, 340, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(340, 20));
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 137, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelToolCode = new JLabel();
- jLabelToolCode.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelToolCode.setText("Tool Code");
- jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelTagName.setText("Tag Name");
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 112, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(12, 87, 155, 20));
- jLabelToolChainFamily.setText("Tool Chain Family");
- jLabelFileName = new JLabel();
- jLabelFileName.setText("File Name");
- jLabelFileName.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(505, 192));
-
- jContentPane.add(jLabelFileName, null);
- jContentPane.add(getJTextFieldSourceFilesDirectory(), null);
- jContentPane.add(getJButtonOpenFile(), null);
- jContentPane.add(jLabelToolChainFamily, null);
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelTagName, null);
- jContentPane.add(getJTextFieldTagName(), null);
- jContentPane.add(jLabelToolCode, null);
- jContentPane.add(getJTextFieldToolCode(), null);
- jContentPane.add(getIComboBoxToolCode(), null);
- jContentPane.add(getJTextFieldToolChainFamily(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOpenFile) {
- selectFile();
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentSourceFiles();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- private SourceFilesIdentification[] getCurrentSourceFiles() {
- String name = this.jTextFieldFileName.getText();
- String s[] = name.split(";");
- String tagName = this.jTextFieldTagName.getText();
- String toolCode = this.iComboBoxToolCode.getSelectedItem().toString();
- if (toolCode.equals(DataType.EMPTY_SELECT_ITEM)) {
- toolCode = "";
- }
- String tcf = this.jTextFieldToolChainFamily.getText();
- String featureFlag = this.jTextFieldFeatureFlag.getText();
- Vector<String> arch = this.jArchCheckBox.getSelectedItemsVector();
- sfid = new SourceFilesIdentification[s.length];
- for (int index = 0; index < s.length; index++) {
- sfid[index] = new SourceFilesIdentification(s[index], tagName, toolCode, tcf, featureFlag, arch);
- }
- return sfid;
- }
-
- /**
- Data validation for all fields
-
- @retval true - All datas are valid
- @retval false - At least one data is invalid
-
- **/
- public boolean checkAdd() {
- //
- // Check Filename
- //
- if (isEmpty(this.jTextFieldFileName.getText())) {
- Log.wrn("Update Source Files", "File Name must be entered!");
- return false;
- }
- if (!DataValidation.isFilename(this.jTextFieldFileName.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for File Name");
- return false;
- }
-
- //
- // Check TagName
- //
- if (!isEmpty(this.jTextFieldTagName.getText())) {
- if (!DataValidation.isTagName(this.jTextFieldTagName.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tag Name");
- return false;
- }
- }
-
- //
- // Check ToolCode
- //
- if (!isEmpty(this.jTextFieldToolCode.getText())) {
- if (!DataValidation.isToolCode(this.jTextFieldToolCode.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tool Code");
- return false;
- }
- }
-
- //
- // Check ToolChainFamily
- //
- if (!isEmpty(this.jTextFieldToolChainFamily.getText())) {
- if (!DataValidation.isToolChainFamily(this.jTextFieldToolChainFamily.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Tool Chain Family");
- return false;
- }
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Source Files", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- /**
- Display a file open browser to let user select file
-
- **/
- private void selectFile() {
- JFileChooser fc = new JFileChooser();
- fc.setCurrentDirectory(new File(Tools.getFilePathOnly(msaFileName)));
- fc.setMultiSelectionEnabled(true);
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- File f[] = fc.getSelectedFiles();
- String s = "";
- for (int index = 0; index < f.length; index++) {
- String relativePath = "";
- relativePath = Tools.getRelativePath(Tools.getFilePathOnly(f[index].getPath()), Tools.getFilePathOnly(msaFileName));
- if (!Tools.isEmpty(relativePath)) {
- relativePath = relativePath + DataType.UNIX_FILE_SEPARATOR;
- }
- s = s + relativePath + f[index].getName() + ";";
- }
- this.jTextFieldFileName.setText(s);
- }
- }
-
- public SourceFilesIdentification[] getSfid() {
- return sfid;
- }
-
- public void setSfid(SourceFilesIdentification[] sfid) {
- this.sfid = sfid;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java
deleted file mode 100644
index 83d29cec2c..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/SystemTablesDlg.java
+++ /dev/null
@@ -1,458 +0,0 @@
-/** @file
- <<The file is used to create, update SystemTable in the MSA file>>
-
- <<This dialog is used to add or edit a System Table entry in the MSA file.>>
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.SystemTables.SystemTablesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update SystemTables section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class SystemTablesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = 7488769180379442276L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelEntry = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private SystemTablesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes iComboBoxGuidC_Name
- *
- * @return javax.swing.JComboBox iComboBoxGuidC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 12, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the System Table");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>Module requires a GUIDed entry in the system table</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>Module consumes a GUIDed entry in the system<br>table if it is present</td>"
- + "</tr><tr><td>ALWAYS_PRODUCED</td><td>Module always produces a GUIDed entry in the system table</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>Module produces a GUIDed entry in the system table<br>for some of its execution flows.</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelpText
- *
- * @return javax.swing.JTextArea
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- }
- return jTextAreaHelpText;
- }
-
- /**
- * This method initializes jScrollPaneHelpText
- *
- * @returns javax.swing.JScrollPane jScrollPaneHelpText
- */
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 62));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 162, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 162, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 235);
- this.setContentPane(getJScrollPane());
- this.setTitle("System Tables");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inSystemTablesId
- *
- */
- private void init(SystemTablesIdentification inSystemTablesId, ModuleIdentification mid) {
- init();
- this.id = inSystemTablesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for system table");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_SYSTEM_CONFIGURATION_TABLE));
-
-
- if (this.id != null) {
- this.iComboBoxGuidC_Name.setSelectedItem(id.getName());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inBootModesIdentification
- * @param iFrame
- *
- */
- public SystemTablesDlg(SystemTablesIdentification inSystemTablesIdentification, IFrame iFrame,
- ModuleIdentification mid) {
- super(iFrame, true);
- init(inSystemTablesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelEntry = new JLabel();
- jLabelEntry.setText("Table's GUID C Name");
- jLabelEntry.setBounds(new java.awt.Rectangle(12, 12, 155, 20));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 37, 155, 20));
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 62, 155, 20));
- jLabelHelpText.setText("Help Text");
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 132, 155, 20));
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setEnabled(false);
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 107, 155, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 107, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(480, 180));
-
- jContentPane.add(jLabelEntry, null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
-
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVSystemTableUsage());
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentSystemTables();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check Name
- //
- if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one System Table Name");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update System Tables", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private SystemTablesIdentification getCurrentSystemTables() {
- String arg0 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg1 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg2 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg3 = this.jArchCheckBox.getSelectedItemsVector();
- String arg4 = this.jTextAreaHelpText.getText();
-
- id = new SystemTablesIdentification(arg0, arg1, arg2, arg3, arg4);
- return id;
- }
-
- public SystemTablesIdentification getId() {
- return id;
- }
-
- public void setId(SystemTablesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
deleted file mode 100644
index b906e9adff..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/module/ui/dialog/VariablesDlg.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/** @file
-
- The file is used to create, update Variables section of the MSA file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.module.ui.dialog;
-
-import java.awt.event.ActionEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.EnumerationData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.IComboBox;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.Variables.VariablesIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-
-/**
- * The class is used to create, update Variables section of the MSA file
- *
- * It extends IDialog
- *
- */
-public class VariablesDlg extends IDialog {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -6998982978030439446L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabelVariableName = null;
-
- private JTextField jTextFieldVariableName = null;
-
- private JLabel jLabelUsage = null;
-
- private JComboBox jComboBoxUsage = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private JScrollPane jScrollPane = null;
-
- private JLabel jLabelGuidCName = null;
-
- private IComboBox iComboBoxGuidC_Name = null;
-
- private JTextField jTextFieldFeatureFlag = null;
-
- private JLabel jLabelFeatureFlag = null;
-
- private JLabel jLabelArch = null;
-
- private JLabel jLabelHelpText = null;
-
- private JTextArea jTextAreaHelpText = null;
-
- private JScrollPane jScrollPaneHelpText = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- //
- // Not used by UI
- //
- private VariablesIdentification id = null;
-
- private EnumerationData ed = new EnumerationData();
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- /**
- * This method initializes jTextFieldString
- *
- * @return javax.swing.JTextField jTextFieldString
- *
- */
- private JTextField getJTextFieldString() {
- if (jTextFieldVariableName == null) {
- jTextFieldVariableName = new JTextField();
- jTextFieldVariableName.setSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldVariableName.setLocation(new java.awt.Point(168, 12));
- jTextFieldVariableName.setToolTipText("Enter a string; the tool will convert to Unicode hex");
- }
- return jTextFieldVariableName;
- }
-
- /**
- * This method initializes jComboBoxUsage
- *
- * @return javax.swing.JComboBox jComboBoxUsage
- *
- */
- private JComboBox getJComboBoxUsage() {
- if (jComboBoxUsage == null) {
- jComboBoxUsage = new JComboBox();
- jComboBoxUsage.setBounds(new java.awt.Rectangle(168, 62, 320, 20));
- jComboBoxUsage.setPreferredSize(new java.awt.Dimension(320, 20));
- jComboBoxUsage
- .setToolTipText("<html><table>"
- + "<tr><td>ALWAYS_CONSUMED</td><td>The module requires the variable entry to be set</td></tr>"
- + "<tr><td>SOMETIMES_CONSUMED</td><td>The module will use the variable entry if it is set.</td></tr>"
- + "<tr><td>ALWAYS_PRODUCED</td><td>The module will always write the variable.</td></tr>"
- + "<tr><td>SOMETIMES_PRODUCED</td><td>The module will sometimes write the variable.</td></tr>"
- + "</table></html>");
- }
- return jComboBoxUsage;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTextFieldFeatureFlag
- *
- * @return javax.swing.JTextField jTextFieldFeatureFlag
- *
- */
- private JTextField getJTextFieldFeatureFlag() {
- if (jTextFieldFeatureFlag == null) {
- jTextFieldFeatureFlag = new JTextField();
- jTextFieldFeatureFlag.setBounds(new java.awt.Rectangle(168, 157, 320, 20));
- jTextFieldFeatureFlag.setPreferredSize(new java.awt.Dimension(320, 20));
- jTextFieldFeatureFlag.setToolTipText("Postfix expression that must evaluate to TRUE or FALSE");
- jTextFieldFeatureFlag.setEnabled(false);
- }
- return jTextFieldFeatureFlag;
- }
-
- /**
- * This method initializes jTextFieldHelpText
- *
- * @return javax.swing.JTextField
- *
- */
- private JTextArea getJTextAreaHelpText() {
- if (jTextAreaHelpText == null) {
- jTextAreaHelpText = new JTextArea();
- jTextAreaHelpText.setLineWrap(true);
- jTextAreaHelpText.setWrapStyleWord(true);
- jTextAreaHelpText.setToolTipText("Enter information on how to use this Variable.");
- }
- return jTextAreaHelpText;
- }
-
- private JScrollPane getJScrollPaneHelpText() {
- if (jScrollPaneHelpText == null) {
- jScrollPaneHelpText = new JScrollPane();
- jScrollPaneHelpText.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneHelpText.setSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setPreferredSize(new java.awt.Dimension(320, 40));
- jScrollPaneHelpText.setLocation(new java.awt.Point(168, 87));
- jScrollPaneHelpText.setViewportView(getJTextAreaHelpText());
- }
- return jScrollPaneHelpText;
- }
-
- /**
- * This method initializes iComboBoxGuidC_Name
- *
- * @return javax.swing.JComboBox iComboBoxGuidC_Name
- *
- */
- private IComboBox getIComboBoxGuidC_Name() {
- if (iComboBoxGuidC_Name == null) {
- iComboBoxGuidC_Name = new IComboBox();
- iComboBoxGuidC_Name.setBounds(new java.awt.Rectangle(168, 37, 320, 20));
- iComboBoxGuidC_Name.setPreferredSize(new java.awt.Dimension(320, 20));
- iComboBoxGuidC_Name.setToolTipText("Select the GUID C Name of the Variable.");
- }
- return iComboBoxGuidC_Name;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 187, 90, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(390, 187, 90, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
-
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- this.setSize(505, 260);
- this.setContentPane(getJScrollPane());
- this.setTitle("Variables");
- initFrame();
- this.setViewMode(false);
- this.centerWindow();
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param inVariablesId
- *
- */
- private void init(VariablesIdentification inVariablesId, ModuleIdentification mid) {
- init();
- this.id = inVariablesId;
-
- //
- // Init arch with module's arch
- //
- this.jArchCheckBox.setEnabledItems(wt.getModuleArch(mid));
-
- //
- // Get defined guids from dependent packages
- //
- Vector<PackageIdentification> vpid = wt.getPackageDependenciesOfModule(mid);
- if (vpid.size() <= 0) {
- Log
- .wrn("Init Guid",
- "This module hasn't defined any package dependency, so there is no guid value can be added for variable");
- }
- //
- // Init guids drop down list
- //
- Tools
- .generateComboBoxByVector(iComboBoxGuidC_Name,
- wt.getAllGuidDeclarationsFromPackages(vpid, EnumerationData.GUID_TYPE_EFI_VARIABLE));
-
- if (this.id != null) {
- this.jTextFieldVariableName.setText(id.getName());
- this.iComboBoxGuidC_Name.setSelectedItem(id.getGuid());
- this.jComboBoxUsage.setSelectedItem(id.getUsage());
- this.jTextAreaHelpText.setText(id.getHelp());
- this.jTextFieldFeatureFlag.setText(id.getFeatureFlag());
- this.jArchCheckBox.setSelectedItems(id.getSupArchList());
- }
- }
-
- /**
- * This is the override edit constructor
- *
- * @param inVariablesIdentification
- * @param iFrame
- *
- */
- public VariablesDlg(VariablesIdentification inVariablesIdentification, IFrame iFrame, ModuleIdentification mid) {
- super(iFrame, true);
- init(inVariablesIdentification, mid);
- }
-
- /**
- * Disable all components when the mode is view
- *
- * @param isView
- * true - The view mode; false - The non-view mode
- *
- */
- public void setViewMode(boolean isView) {
- if (isView) {
- this.jTextFieldVariableName.setEnabled(!isView);
- this.jComboBoxUsage.setEnabled(!isView);
- }
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, 12));
- jLabelVariableName = new JLabel();
- jLabelVariableName.setText("Variable Name");
- jLabelVariableName.setBounds(new java.awt.Rectangle(12, 12, 168, 20));
-
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, 37));
- jLabelGuidCName = new JLabel();
- jLabelGuidCName.setBounds(new java.awt.Rectangle(12, 37, 168, 20));
- jLabelGuidCName.setText("Variable Guid C Name");
-
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, 62));
- jLabelUsage = new JLabel();
- jLabelUsage.setText("Usage");
- jLabelUsage.setBounds(new java.awt.Rectangle(12, 62, 168, 20));
-
- jLabelHelpText = new JLabel();
- jLabelHelpText.setBounds(new java.awt.Rectangle(12, 87, 168, 20));
- jLabelHelpText.setText("Help Text");
-
- jLabelFeatureFlag = new JLabel();
- jLabelFeatureFlag.setText("Feature Flag Expression");
- jLabelFeatureFlag.setBounds(new java.awt.Rectangle(12, 157, 168, 20));
- jLabelFeatureFlag.setEnabled(false);
-
- jLabelArch = new JLabel();
- jLabelArch.setBounds(new java.awt.Rectangle(12, 132, 168, 20));
- jLabelArch.setText("Supported Architectures");
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(168, 132, 320, 20));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(320, 20));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(485, 215));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jLabelVariableName, null);
- jContentPane.add(getJTextFieldString(), null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jLabelGuidCName, null);
- jContentPane.add(getIComboBoxGuidC_Name(), null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jLabelUsage, null);
- jContentPane.add(getJComboBoxUsage(), null);
- jContentPane.add(jLabelHelpText, null);
- jContentPane.add(getJScrollPaneHelpText(), null);
- jContentPane.add(jLabelFeatureFlag, null);
- jContentPane.add(getJTextFieldFeatureFlag(), null);
- jContentPane.add(jLabelArch, null);
- jContentPane.add(jArchCheckBox, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- if (checkAdd()) {
- getCurrentVariables();
- this.returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.returnType = DataType.RETURN_TYPE_CANCEL;
- this.setVisible(false);
- }
- }
-
- /**
- * This method initializes Usage type
- *
- */
- private void initFrame() {
- Tools.generateComboBoxByVector(jComboBoxUsage, ed.getVPpiUsage());
- }
-
- /**
- * Data validation for all fields
- *
- * @retval true - All datas are valid
- * @retval false - At least one data is invalid
- *
- */
- public boolean checkAdd() {
- //
- // Check if all fields have correct data types
- //
-
- //
- // Check VariableName
- //
- if (isEmpty(this.jTextFieldVariableName.getText())) {
- Log.wrn("Update Variables", "Variable Name must be entered!");
- return false;
- }
-
- //
- // Check Guid Value
- //
- if (this.iComboBoxGuidC_Name.getSelectedItem() == null) {
- Log.wrn("Update Guids", "Please select one Varibale Guid value");
- return false;
- }
-
- //
- // Check FeatureFlag
- //
- if (!isEmpty(this.jTextFieldFeatureFlag.getText())) {
- if (!DataValidation.isFeatureFlag(this.jTextFieldFeatureFlag.getText())) {
- Log.wrn("Update Variables", "Incorrect data type for Feature Flag");
- return false;
- }
- }
-
- return true;
- }
-
- private VariablesIdentification getCurrentVariables() {
- String arg0 = this.jTextFieldVariableName.getText();
- String arg1 = this.iComboBoxGuidC_Name.getSelectedItem().toString();
- String arg2 = this.jComboBoxUsage.getSelectedItem().toString();
-
- String arg3 = this.jTextFieldFeatureFlag.getText();
- Vector<String> arg4 = this.jArchCheckBox.getSelectedItemsVector();
- String arg5 = this.jTextAreaHelpText.getText();
-
- id = new VariablesIdentification(arg0, arg1, arg2, arg3, arg4, arg5);
- return id;
- }
-
- public VariablesIdentification getId() {
- return id;
- }
-
- public void setId(VariablesIdentification id) {
- this.id = id;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/PackageIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/PackageIdentification.java
deleted file mode 100644
index e986f55baf..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/PackageIdentification.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
-
- The file is used to save basic information of package
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.packaging;
-
-import java.io.File;
-
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class PackageIdentification extends Identification{
-
- public PackageIdentification(String name, String guid, String version){
- super(name, guid, version);
- }
-
- public PackageIdentification(String name, String guid, String version, String path){
- super(name, guid, version, path);
- }
-
- public PackageIdentification(Identification id){
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- }
-
- public File getSpdFile(){
- File spdFile = new File(this.getPath());
- return spdFile;
- }
-
- public String toString() {
- return getName() + " " + getVersion() + " [" + Tools.getRelativePath(getSpdFile().getPath(), Workspace.getCurrentWorkspace()) + "]";
- }
-
- public boolean equals(String packageGuid, String packageVersion) {
- boolean b = false;
- if (this.getGuid().equals(packageGuid)) {
- b = true;
- //
- // Check Version
- //
- if (packageVersion != null) {
- if (!Tools.isEmpty(packageVersion)) {
- if (!packageVersion.equals(this.getVersion())) {
- b = false;
- }
- }
- }
- }
- return b;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GenGuidDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GenGuidDialog.java
deleted file mode 100644
index b219c9ed70..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GenGuidDialog.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/** @file
- Java class GenGuidDialog.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-
-import javax.swing.JPanel;
-import javax.swing.JDialog;
-import java.awt.GridLayout;
-
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JTextField;
-import javax.swing.JLabel;
-import javax.swing.JRadioButton;
-import javax.swing.ButtonGroup;
-import javax.swing.JButton;
-import javax.swing.KeyStroke;
-
-import org.tianocore.frameworkwizard.common.Tools;
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-
-/**
- Dialog for GUID generation.
- @since PackageEditor 1.0
-**/
-public class GenGuidDialog extends JDialog implements ActionListener{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public static final String guidArrayPat = "0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\\})?";
-
- public static final String guidRegistryPat = "[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}";
-
- static private JFrame frame;
- private JPanel jContentPane = null;
- private JPanel jPanelEast = null;
- private JPanel jPanelCenter = null;
- private JTextField jTextField = null;
- private JLabel jLabel = null;
- private JRadioButton jRadioButton = null;
- private JRadioButton jRadioButtonReg = null;
- private JButton jButtonCancel = null;
- private JButton jButtonNew = null;
- private JButton jButtonOk = null;
- private ActionListener outerListener = null;
-
-// private String guid = null;
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (arg0.getSource() == jButtonNew){
- String uuid = Tools.generateUuidString();
- if (jRadioButtonReg.isSelected()) {
- jTextField.setText(uuid);
- }
- else {
- //ToDo: transform to comma-sep guid
- String s = GenGuidDialog.formatGuidString(uuid);
- if (s.equals("0")) {
- JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");
- return;
- }
- jTextField.setText(s);
- }
- }
-
- if (arg0.getSource() == jRadioButtonReg){
-
- //ToDo: check text field value against RegExp and transform if needed
- if (jTextField.getText().matches(GenGuidDialog.guidRegistryPat)){
- return;
- }
- if (jTextField.getText().matches(GenGuidDialog.guidArrayPat)) {
- jTextField.setText(GenGuidDialog.formatGuidString(jTextField.getText()));
- return;
- }
- if (jTextField.getText().length()>0)
- JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");
-
- }
-
- if (arg0.getSource() == jRadioButton){
-
- //ToDo: check text field value against RegExp and transform if needed
- if (jTextField.getText().matches(GenGuidDialog.guidArrayPat)){
- return;
- }
- if (jTextField.getText().matches(GenGuidDialog.guidRegistryPat)) {
- jTextField.setText(GenGuidDialog.formatGuidString(jTextField.getText()));
- return;
- }
- if (jTextField.getText().length()>0)
- JOptionPane.showMessageDialog(frame, "Check GUID Value, it don't conform to the schema.");
-
- }
-
- if (arg0.getSource() == jButtonOk){
-// if (jTextField.getText().matches(Tools.guidArrayPat)
-// || jTextField.getText().matches(Tools.guidRegistryPat)){
-// this.setVisible(false);
-// }
-// else {
-// JOptionPane.showMessageDialog(frame, "Incorrect GUID Value Format.");
-// }
-// this.dispose();
- }
-
- if (arg0.getSource() == jButtonCancel){
- this.dispose();
- }
- }
-
- /**
- * This method initializes jPanel
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelEast() {
- if (jPanelEast == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setVgap(10);
- jPanelEast = new JPanel();
- jPanelEast.setLayout(flowLayout);
- jPanelEast.setPreferredSize(new java.awt.Dimension(100,30));
- jPanelEast.add(getJButtonNew(), null);
- jPanelEast.add(getJButtonOk(), null);
- jPanelEast.add(getJButtonCancel(), null);
- }
- return jPanelEast;
- }
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelCenter() {
- if (jPanelCenter == null) {
- jLabel = new JLabel();
- jLabel.setText("GUID Value");
- GridLayout gridLayout = new GridLayout();
- gridLayout.setRows(4);
- jPanelCenter = new JPanel();
- jPanelCenter.setLayout(gridLayout);
- jPanelCenter.add(getJRadioButtonReg(), null);
- jPanelCenter.add(getJRadioButton(), null);
- jPanelCenter.add(jLabel, null);
- jPanelCenter.add(getJTextField(), null);
- ButtonGroup bg = new ButtonGroup();
- bg.add(jRadioButtonReg);
- bg.add(jRadioButton);
- }
- return jPanelCenter;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextField() {
- if (jTextField == null) {
- jTextField = new JTextField();
- jTextField.setHorizontalAlignment(JTextField.LEADING);
- jTextField.setPreferredSize(new java.awt.Dimension(100,20));
- }
- return jTextField;
- }
-
- /**
- * This method initializes jRadioButton
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButton() {
- if (jRadioButton == null) {
- jRadioButton = new JRadioButton();
- jRadioButton.setText("Comma-Seperated Format");
- jRadioButton.setEnabled(false);
- jRadioButton.addActionListener(this);
- }
- return jRadioButton;
- }
-
- /**
- * This method initializes jRadioButton1
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonReg() {
- if (jRadioButtonReg == null) {
- jRadioButtonReg = new JRadioButton();
- jRadioButtonReg.setText("Registry Format");
- jRadioButtonReg.setSelected(true);
- jRadioButtonReg.addActionListener(this);
- }
- return jRadioButtonReg;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- jButtonCancel.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNew() {
- if (jButtonNew == null) {
- jButtonNew = new JButton();
- jButtonNew.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonNew.setHorizontalTextPosition(javax.swing.SwingConstants.LEADING);
- jButtonNew.setText("New");
- jButtonNew.addActionListener(this);
- jButtonNew.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
- return jButtonNew;
- }
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonOk.setText("Ok");
- jButtonOk.setActionCommand("GenGuidValue");
-// jButtonOk.addActionListener(this);
- jButtonOk.registerKeyboardAction(outerListener, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
-
- }
- return jButtonOk;
- }
-
- public String getGuid(){
- return jTextField.getText();
- }
-
- public void setGuid(String s){
- jTextField.setText(s);
- }
- /**
- * This is the default constructor
- */
- public GenGuidDialog() {
- super();
- initialize();
- }
-
- public GenGuidDialog(ActionListener i, JFrame frame){
- super(frame);
- outerListener = i;
- initialize();
- jButtonOk.addActionListener(i);
- this.addWindowListener(new WindowAdapter(){
-
- @Override
- public void windowActivated(WindowEvent arg0) {
- // TODO Auto-generated method stub
- super.windowActivated(arg0);
- if ((jRadioButtonReg.isSelected() && jTextField.getText().matches(GenGuidDialog.guidArrayPat))
- || (jRadioButton.isSelected() && jTextField.getText().matches(GenGuidDialog.guidRegistryPat))) {
- jTextField.setText(GenGuidDialog.formatGuidString(jTextField.getText()));
- }
-
-// if (!jTextField.getText().matches(Tools.guidArrayPat) || !jTextField.getText().matches(Tools.guidRegistryPat)) {
-// JOptionPane.showMessageDialog(frame, "InitVal: Incorrect GUID Value Format.");
-// return;
-// }
- }
-
- });
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(466, 157);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setModal(true);
- this.setTitle("Editing GUID Value");
- this.setContentPane(getJContentPane());
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelEast(), java.awt.BorderLayout.EAST);
- jContentPane.add(getJPanelCenter(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
- public static String formatGuidString (String guidNameConv) {
- String[] strList;
- String guid = "";
- int index = 0;
- if (guidNameConv
- .matches(GenGuidDialog.guidRegistryPat)) {
- strList = guidNameConv.split("-");
- guid = "0x" + strList[0] + ", ";
- guid = guid + "0x" + strList[1] + ", ";
- guid = guid + "0x" + strList[2] + ", ";
-
- guid = guid + "0x" + strList[3].substring(0, 2) + ", ";
- guid = guid + "0x" + strList[3].substring(2, 4);
-
- while (index < strList[4].length()) {
- guid = guid + ", ";
- guid = guid + "0x" + strList[4].substring(index, index + 2);
- index = index + 2;
- }
-
- return guid;
- }
- else if (guidNameConv
- .matches(GenGuidDialog.guidArrayPat)) {
- strList = guidNameConv.split(",");
-
- //
- // chang ANSI c form to registry form
- //
- for (int i = 0; i < strList.length; i++){
- strList[i] = strList[i].substring(strList[i].lastIndexOf("x") + 1);
- }
- if (strList[strList.length - 1].endsWith("}")) {
- strList[strList.length -1] = strList[strList.length-1].substring(0, strList[strList.length-1].length()-1);
- }
- //
- //inserting necessary leading zeros
- //
-
- int segLen = strList[0].length();
- if (segLen < 8){
- for (int i = 0; i < 8 - segLen; ++i){
- strList[0] = "0" + strList[0];
- }
- }
-
- segLen = strList[1].length();
- if (segLen < 4){
- for (int i = 0; i < 4 - segLen; ++i){
- strList[1] = "0" + strList[1];
- }
- }
- segLen = strList[2].length();
- if (segLen < 4){
- for (int i = 0; i < 4 - segLen; ++i){
- strList[2] = "0" + strList[2];
- }
- }
- for (int i = 3; i < 11; ++i) {
- segLen = strList[i].length();
- if (segLen < 2){
- strList[i] = "0" + strList[i];
- }
- }
-
- for (int i = 0; i < 3; i++){
- guid += strList[i] + "-";
- }
-
- guid += strList[3];
- guid += strList[4] + "-";
-
- for (int i = 5; i < strList.length; ++i){
- guid += strList[i];
- }
-
-
- return guid;
- } else {
-
- return "0";
-
- }
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GuidEditor.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GuidEditor.java
deleted file mode 100644
index 0d00f4a014..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/GuidEditor.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/** @file
- Java class GuidEditor.
-
-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.
-
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-//import java.awt.event.KeyEvent;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-//import javax.swing.JComponent;
-import javax.swing.JTable;
-//import javax.swing.KeyStroke;
-import javax.swing.table.TableCellEditor;
-
-
-/**
- Editor for table cell with GUID value.
- @since PackageEditor 1.0
- **/
-public class GuidEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- String currentGuid;
- JButton button;
- GenGuidDialog dialog;
- protected static final String EDIT = "edit";
-
- public GuidEditor(JFrame frame) {
-
- button = new JButton();
- button.setActionCommand(EDIT);
- button.addActionListener(this);
-// button.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0, false), JComponent.WHEN_FOCUSED);
- button.setBorderPainted(false);
-
-
- dialog = new GenGuidDialog(this, frame);
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)
- */
- public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {
- // TODO Auto-generated method stub
- currentGuid = (String)arg1;
- return button;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.CellEditor#getCellEditorValue()
- */
- public Object getCellEditorValue() {
- // TODO Auto-generated method stub
- return currentGuid;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (EDIT.equals(arg0.getActionCommand())) {
- //The user has clicked the cell, so
- //bring up the dialog.
- button.setText(currentGuid);
- dialog.setGuid(currentGuid);
- dialog.setVisible(true);
-
- //Make the renderer reappear.
- fireEditingStopped();
- }
- else { //User pressed dialog's "OK" button.
- currentGuid = dialog.getGuid();
-// button.setText(currentGuid);
- dialog.dispose();
- }
-
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java
deleted file mode 100644
index 922d1355e8..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdFileContents.java
+++ /dev/null
@@ -1,1885 +0,0 @@
-/** @file
- Java class SpdFileContents is used to parse spd xml file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlCursor;
-
-import org.tianocore.GuidDeclarationsDocument;
-
-import org.tianocore.LibraryClassDeclarationsDocument;
-
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaFilesDocument;
-import org.tianocore.PackageDefinitionsDocument;
-import org.tianocore.PackageHeadersDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.PcdDataTypes;
-import org.tianocore.PcdDeclarationsDocument;
-import org.tianocore.PpiDeclarationsDocument;
-import org.tianocore.ProtocolDeclarationsDocument;
-import org.tianocore.SpdHeaderDocument;
-import org.tianocore.GuidDeclarationsDocument.GuidDeclarations;
-
-/**
- This class processes spd file contents such as add remove xml elements.
-
- @since PackageEditor 1.0
-**/
-
-public class SpdFileContents {
-
- private File file = null;
-
- private PackageSurfaceAreaDocument psad = null;
-
- private PackageSurfaceAreaDocument.PackageSurfaceArea psaRoot = null;
-
- private SpdHeaderDocument.SpdHeader spdHdr = null;
-
- private PackageDefinitionsDocument.PackageDefinitions spdPkgDefs = null;
-
- private LibraryClassDeclarationsDocument.LibraryClassDeclarations spdLibClassDeclarations = null;
-
- private MsaFilesDocument.MsaFiles spdMsaFiles = null;
-
- private PackageHeadersDocument.PackageHeaders spdModHdrs = null;
-
- private GuidDeclarationsDocument.GuidDeclarations spdGuidDeclarations = null;
-
- private ProtocolDeclarationsDocument.ProtocolDeclarations spdProtocolDeclarations = null;
-
- private PpiDeclarationsDocument.PpiDeclarations spdPpiDeclarations = null;
-
- private PcdDeclarationsDocument.PcdDeclarations spdPcdDefinitions = null;
-
- /**
- Constructor to create a new spd file
- **/
- public SpdFileContents() {
-
- psad = PackageSurfaceAreaDocument.Factory.newInstance();
- psaRoot = psad.addNewPackageSurfaceArea();
-
- }
-
- /**
- Constructor for existing document object
- @param psa
- **/
- public SpdFileContents(PackageSurfaceAreaDocument.PackageSurfaceArea psa) {
- psaRoot = psa;
- spdHdr = psaRoot.getSpdHeader();
- spdPkgDefs = psaRoot.getPackageDefinitions();
- }
- /**
- Constructor based on an existing spd file
-
- @param f Existing spd file
- **/
- public SpdFileContents(File f) {
- try {
- psad = PackageSurfaceAreaDocument.Factory.parse(f);
- psaRoot = psad.getPackageSurfaceArea();
- file = f;
- } catch (Exception e) {
- System.out.println(e.toString());
- }
- }
-
- /**
- Remove existing pcd definitions elements using XmlCursor
- **/
- public void removeSpdPcdDefinition() {
- XmlObject o = psaRoot.getPcdDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdPcdDefinitions = null;
- cursor.dispose();
- }
-
- public void removeSpdPcdDefinition(int i){
- XmlObject o = psaRoot.getPcdDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdPcdDefinitionCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- /**
- Remove existing ppi declarations using XmlCursor
- **/
- public void removeSpdPpiDeclaration() {
- XmlObject o = psaRoot.getPpiDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdPpiDeclarations = null;
- cursor.dispose();
- }
-
- public void removeSpdPpiDeclaration(int i){
- XmlObject o = psaRoot.getPpiDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdPpiDeclarationCount() == 0){
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
- /**
- Remove existing protocols declarations using XmlCursor
- **/
- public void removeSpdProtocolDeclaration() {
- XmlObject o = psaRoot.getProtocolDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdProtocolDeclarations = null;
- cursor.dispose();
- }
-
- public void removeSpdProtocolDeclaration(int i) {
- XmlObject o = psaRoot.getProtocolDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdProtocolDeclarationCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
- /**
- Remove existing GUID declarations using XmlCursor
- **/
- public void removeSpdGuidDeclaration() {
- XmlObject o = psaRoot.getGuidDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdGuidDeclarations = null;
- cursor.dispose();
- }
-
- public void removeSpdGuidDeclaration(int i) {
- XmlObject o = psaRoot.getGuidDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdGuidDeclarationCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- /**
- Remove existing spd package include files using XmlCursor
- **/
- public void removeSpdPkgHeader() {
- XmlObject o = psaRoot.getPackageHeaders();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdModHdrs = null;
- cursor.dispose();
- }
-
- public void removeSpdPkgHeader(int i){
- XmlObject o = psaRoot.getPackageHeaders();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdPackageHeaderCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- /**
- Remove existing msa files using XmlCursor
- **/
- public void removeSpdMsaFile() {
- XmlObject o = psaRoot.getMsaFiles();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdMsaFiles = null;
- cursor.dispose();
- }
-
- public void removeSpdMsaFile(int i){
- XmlObject o = psaRoot.getMsaFiles();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdMsaFileCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- /**
- Remove existing library class declarations using XmlCursor
- **/
- public void removeSpdLibClass() {
- XmlObject o = psaRoot.getLibraryClassDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- spdLibClassDeclarations = null;
- cursor.dispose();
- }
-
- public void removeSpdLibClass(int i) {
- XmlObject o = psaRoot.getLibraryClassDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getSpdLibClassDeclarationCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- public void updateSpdLibClass(int i, String lib, String hdr, String hlp, String clsUsage, String instanceVer, String hdrAttribArch, String hdrAttribModType) {
- XmlObject o = psaRoot.getLibraryClassDeclarations();
- if (o == null)
- return;
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass lc = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass)cursor.getObject();
- lc.setName(lib);
- lc.setIncludeHeader(hdr);
- lc.setHelpText(hlp);
- if (clsUsage != null) {
- lc.setRecommendedInstanceGuid(clsUsage);
- if (instanceVer != null){
- lc.setRecommendedInstanceVersion(instanceVer);
- } else {
- if (lc.isSetRecommendedInstanceVersion()) {
- lc.unsetRecommendedInstanceVersion();
- }
- }
- } else {
- if (lc.isSetRecommendedInstanceGuid()) {
- lc.unsetRecommendedInstanceGuid();
- }
- if (lc.isSetRecommendedInstanceVersion()) {
- lc.unsetRecommendedInstanceVersion();
- }
- }
-
- if (stringToList(hdrAttribArch) != null){
- lc.setSupArchList(stringToList(hdrAttribArch));
- } else {
- if (lc.isSetSupArchList()) {
- lc.unsetSupArchList();
- }
- }
- if (stringToList(hdrAttribModType) != null){
- lc.setSupModuleList(stringToList(hdrAttribModType));
- } else {
- if (lc.isSetSupModuleList()) {
- lc.unsetSupModuleList();
- }
- }
- }
-
- cursor.dispose();
- }
-
- public void updateSpdMsaFile(int i, String msaFile, String mName, String v, String g){
- XmlObject o = psaRoot.getMsaFiles();
- if (o == null)
- return;
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.setTextValue(msaFile);
-
- }
-
- cursor.dispose();
- }
-
- public void updateSpdGuidDecl(int i, String name, String cName, String guid, String hlp, String archList,
- String modTypeList, String guidTypeList){
- XmlObject o = psaRoot.getGuidDeclarations();
- if (o == null){
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- GuidDeclarationsDocument.GuidDeclarations.Entry e = (GuidDeclarationsDocument.GuidDeclarations.Entry)cursor.getObject();
- e.setName(name);
- e.setCName(cName);
- e.setGuidValue(guid);
- e.setHelpText(hlp);
- if (stringToList(guidTypeList) != null) {
- e.setGuidTypeList(stringToList(guidTypeList));
- }
- else{
- if (e.isSetGuidTypeList()) {
- e.unsetGuidTypeList();
- }
- }
- if (stringToList(archList) != null){
- e.setSupArchList(stringToList(archList));
- }
- else{
- if (e.isSetSupArchList()) {
- e.unsetSupArchList();
- }
- }
- if (stringToList(modTypeList) != null) {
- e.setSupModuleList(stringToList(modTypeList));
- }
- else{
- if (e.isSetSupModuleList()) {
- e.unsetSupModuleList();
- }
- }
-
- }
- cursor.dispose();
- }
-
- public void updateSpdPpiDecl(int i, String name, String cName, String guid, String hlp, String archList,
- String modTypeList, String guidTypeList){
- XmlObject o = psaRoot.getPpiDeclarations();
- if (o == null){
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- PpiDeclarationsDocument.PpiDeclarations.Entry e = (PpiDeclarationsDocument.PpiDeclarations.Entry)cursor.getObject();
- e.setName(name);
- e.setCName(cName);
- e.setGuidValue(guid);
- e.setHelpText(hlp);
- if (stringToList(guidTypeList) != null) {
- e.setGuidTypeList(stringToList(guidTypeList));
- }
- else{
- if (e.isSetGuidTypeList()) {
- e.unsetGuidTypeList();
- }
- }
- if (stringToList(archList) != null){
- e.setSupArchList(stringToList(archList));
- }
- else{
- if (e.isSetSupArchList()) {
- e.unsetSupArchList();
- }
- }
- if (stringToList(modTypeList) != null) {
- e.setSupModuleList(stringToList(modTypeList));
- }
- else{
- if (e.isSetSupModuleList()) {
- e.unsetSupModuleList();
- }
- }
- }
- cursor.dispose();
- }
-
- public void updateSpdProtocolDecl(int i, String name, String cName, String guid, String hlp, String archList,
- String modTypeList, String guidTypeList){
- XmlObject o = psaRoot.getProtocolDeclarations();
- if (o == null){
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- ProtocolDeclarationsDocument.ProtocolDeclarations.Entry e = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry)cursor.getObject();
- e.setName(name);
- e.setCName(cName);
- e.setGuidValue(guid);
- e.setHelpText(hlp);
- if (stringToList(guidTypeList) != null) {
- e.setGuidTypeList(stringToList(guidTypeList));
- }
- else{
- if (e.isSetGuidTypeList()) {
- e.unsetGuidTypeList();
- }
- }
- if (stringToList(archList) != null){
- e.setSupArchList(stringToList(archList));
- }
- else{
- if (e.isSetSupArchList()) {
- e.unsetSupArchList();
- }
- }
- if (stringToList(modTypeList) != null) {
- e.setSupModuleList(stringToList(modTypeList));
- }
- else{
- if (e.isSetSupModuleList()) {
- e.unsetSupModuleList();
- }
- }
- }
- cursor.dispose();
- }
-
- public void updateSpdPkgHdr(int i, String pkgName, String hdrName){
- XmlObject o = psaRoot.getPackageHeaders();
- if (o == null){
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
-
- PackageHeadersDocument.PackageHeaders.IncludePkgHeader iph = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader)cursor.getObject();
- iph.setModuleType(ModuleTypeDef.Enum.forString(pkgName));
- iph.setStringValue(hdrName);
- }
- cursor.dispose();
- }
-
- public void updateSpdPcdDefinition(int i, String cName, String token, String dataType, String pcdItemTypes,
- String spaceGuid, String defaultString, String help, String archList, String modTypeList){
- XmlObject o = psaRoot.getPcdDeclarations();
- if (o == null)
- return;
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry e = (PcdDeclarationsDocument.PcdDeclarations.PcdEntry)cursor.getObject();
- e.setCName(cName);
- e.setToken(token);
- e.setDatumType(PcdDataTypes.Enum.forString(dataType));
- if (pcdItemTypes != null && pcdItemTypes.length() > 0) {
- String usage[] = pcdItemTypes.split("( )+");
- List<String> l = new ArrayList<String>();
- for (int k = 0; k < usage.length; ++k) {
- l.add(usage[k]);
- }
- e.setValidUsage(l);
- }
-
- e.setTokenSpaceGuidCName(spaceGuid);
- e.setDefaultValue(defaultString);
- e.setHelpText(help);
- if (stringToList(archList) != null){
- e.setSupArchList(stringToList(archList));
- }
- else{
- if (e.isSetSupArchList()) {
- e.unsetSupArchList();
- }
- }
- if (stringToList(modTypeList) != null) {
- e.setSupModuleList(stringToList(modTypeList));
- }
- else{
- if (e.isSetSupModuleList()) {
- e.unsetSupModuleList();
- }
- }
-
- }
- cursor.dispose();
- }
- /**
- Get spd file header contents into String array
-
- @param s Caller allocated String array
- **/
- public void getSpdHdrDetails(String[] s) {
- if (getSpdHdr() == null) {
- spdHdr = psaRoot.addNewSpdHeader();
- }
- s[0] = getSpdHdrPkgName();
- s[1] = getSpdHdr().getGuidValue();
- s[2] = getSpdHdrVer();
-// s[3] = getSpdHdr().getAbstract();
- s[4] = getSpdHdr().getDescription();
- s[5] = getSpdHdr().getCopyright();
- s[6] = getSpdHdrLicense();
-
- }
-
- /**
- Get the number of library class declarations from the size of List
-
- @return int
- **/
- public int getSpdLibClassDeclarationCount() {
- if (psaRoot.getLibraryClassDeclarations() == null
- || psaRoot.getLibraryClassDeclarations().getLibraryClassList() == null) {
- return 0;
- }
- return psaRoot.getLibraryClassDeclarations().getLibraryClassList().size();
- }
-
- /**
- Get available library class declaration into String array
- @param libClass Caller allocated two-dimentional String array
- **/
- public void getSpdLibClassDeclarations(String[][] libClass) {
- if (psaRoot.getLibraryClassDeclarations() == null){
- return;
- }
-
- List<LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass> l = psaRoot.getLibraryClassDeclarations().getLibraryClassList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass lc = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass) li.next();
- if (lc != null) {
- libClass[i][0] = lc.getName();
- libClass[i][1] = lc.getIncludeHeader();
- libClass[i][2] = lc.getHelpText();
-// LAH added logic so you cannot set the version unless the GUID is defined.
-
-// if (lc.getRecommendedInstanceGuid() != null) {
- libClass[i][3] = lc.getRecommendedInstanceGuid();
-// if (lc.getRecommendedInstanceVersion() != null) {
- libClass[i][4] = lc.getRecommendedInstanceVersion();
-// }
-// }
-
- if (lc.getSupArchList() != null) {
- libClass[i][5] = listToString(lc.getSupArchList());
- }
- if (lc.getSupModuleList() != null) {
- libClass[i][6] = listToString(lc.getSupModuleList());
- }
-
- }
-
- i++;
- }
-
- }
-
- /**
- Get the number of Msa files from the size of List
-
- @return int
- **/
- public int getSpdMsaFileCount() {
- if (psaRoot.getMsaFiles() == null || psaRoot.getMsaFiles().getFilenameList() == null) {
- return 0;
- }
- return psaRoot.getMsaFiles().getFilenameList().size();
- }
-
- /**
- Get available Msa file into String array
-
- @param msaFile Caller allocated two-dimentional String array
- **/
- public void getSpdMsaFiles(String[][] msaFile) {
- if (psaRoot.getMsaFiles() == null) {
- return;
- }
- List<String> l = psaRoot.getMsaFiles().getFilenameList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- msaFile[i][0] = (String)li.next();
-
- i++;
- }
- }
-
- /**
- Get the number of include header files in PackageHeaders from the size of List
-
- @return int
- **/
- public int getSpdPackageHeaderCount() {
- if (psaRoot.getPackageHeaders() == null || psaRoot.getPackageHeaders().getIncludePkgHeaderList() == null) {
- return 0;
- }
- return psaRoot.getPackageHeaders().getIncludePkgHeaderList().size();
- }
-
- /**
- Get available package header contents into String array
-
- @param pkgHeader Caller allocated two-dimentional String array
- **/
- public void getSpdPackageHeaders(String[][] pkgHeader) {
- if (psaRoot.getPackageHeaders() == null) {
- return;
- }
-
- List<PackageHeadersDocument.PackageHeaders.IncludePkgHeader> l = psaRoot.getPackageHeaders().getIncludePkgHeaderList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- PackageHeadersDocument.PackageHeaders.IncludePkgHeader ih = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader) li.next();
- if (ih.getModuleType() != null) {
- pkgHeader[i][0] = ih.getModuleType().toString();
- }
-
- pkgHeader[i][1] = ih.getStringValue();
- i++;
- }
- }
-
- public void getSpdGuidDeclWithType (Vector<String> vGuidCName, String type) {
- if (psaRoot.getGuidDeclarations() == null) {
- return;
- }
- List<GuidDeclarationsDocument.GuidDeclarations.Entry> l = psaRoot.getGuidDeclarations().getEntryList();
- for (int i = 0; i < l.size(); ++i) {
- if (l.get(i).getGuidTypeList() == null || l.get(i).getGuidTypeList().contains(type)) {
- vGuidCName.add(l.get(i).getCName());
- }
- }
- }
- /**
- Get the number of GUID declarations from the size of List
-
- @return int
- **/
- public int getSpdGuidDeclarationCount() {
- if (psaRoot.getGuidDeclarations() == null || psaRoot.getGuidDeclarations().getEntryList() == null) {
- return 0;
- }
- return psaRoot.getGuidDeclarations().getEntryList().size();
- }
-
- /**
- Get available Guid declaration contents into String array
-
- @param guid Caller allocated two-dimentional String array
- **/
- public void getSpdGuidDeclarations(String[][] guid) {
- if (psaRoot.getGuidDeclarations() == null) {
- return;
- }
-
- List<GuidDeclarationsDocument.GuidDeclarations.Entry> l = psaRoot.getGuidDeclarations().getEntryList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- GuidDeclarationsDocument.GuidDeclarations.Entry e = (GuidDeclarationsDocument.GuidDeclarations.Entry) li
- .next();
- guid[i][0] = e.getName();
- guid[i][1] = e.getCName();
- if (e.getGuidValue() != null) {
- guid[i][2] = e.getGuidValue();
- }
- guid[i][3] = e.getHelpText();
- guid[i][4] = listToString(e.getSupArchList());
- guid[i][5] = listToString(e.getSupModuleList());
- guid[i][6] = listToString(e.getGuidTypeList());
- i++;
- }
- }
-
- /**
- Get the number of protocol declarations from the size of List
-
- @return int
- **/
- public int getSpdProtocolDeclarationCount() {
- if (psaRoot.getProtocolDeclarations() == null || psaRoot.getProtocolDeclarations().getEntryList() == null) {
- return 0;
- }
- return psaRoot.getProtocolDeclarations().getEntryList().size();
- }
-
- /**
- Get available protocol declaration contents into String array
-
- @param protocol Caller allocated two-dimentional String array
- **/
- public void getSpdProtocolDeclarations(String[][] protocol) {
- if (psaRoot.getProtocolDeclarations() == null) {
- return;
- }
-
- List<ProtocolDeclarationsDocument.ProtocolDeclarations.Entry> l = psaRoot.getProtocolDeclarations()
- .getEntryList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- ProtocolDeclarationsDocument.ProtocolDeclarations.Entry e = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry) li
- .next();
- protocol[i][0] = e.getName();
- protocol[i][1] = e.getCName();
- if (e.getGuidValue() != null) {
- protocol[i][2] = e.getGuidValue();
- }
- protocol[i][3] = e.getHelpText();
- protocol[i][4] = listToString(e.getSupArchList());
- protocol[i][5] = listToString(e.getSupModuleList());
- protocol[i][6] = listToString(e.getGuidTypeList());
- i++;
- }
- }
-
- /**
- Get the number of Ppi declarations from the size of List
-
- @return int
- **/
- public int getSpdPpiDeclarationCount() {
- if (psaRoot.getPpiDeclarations() == null || psaRoot.getPpiDeclarations().getEntryList() == null) {
- return 0;
- }
- return psaRoot.getPpiDeclarations().getEntryList().size();
- }
-
- /**
- Get available Ppi declaration contents into String array
-
- @param ppi Caller allocated two-dimentional String array
- **/
- public void getSpdPpiDeclarations(String[][] ppi) {
- if (psaRoot.getPpiDeclarations() == null) {
- return;
- }
-
- List<PpiDeclarationsDocument.PpiDeclarations.Entry> l = psaRoot.getPpiDeclarations().getEntryList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- PpiDeclarationsDocument.PpiDeclarations.Entry e = (PpiDeclarationsDocument.PpiDeclarations.Entry) li.next();
- ppi[i][0] = e.getName();
- ppi[i][1] = e.getCName();
- if (e.getGuidValue() != null) {
- ppi[i][2] = e.getGuidValue();
- }
- ppi[i][3] = e.getHelpText();
- ppi[i][4] = listToString(e.getSupArchList());
- ppi[i][5] = listToString(e.getSupModuleList());
- ppi[i][6] = listToString(e.getGuidTypeList());
- i++;
- }
- }
-
- /**
- Get the number of Pcd definitions from the size of List
-
- @return int
- **/
- public int getSpdPcdDefinitionCount() {
- if (psaRoot.getPcdDeclarations() == null || psaRoot.getPcdDeclarations().getPcdEntryList() == null) {
- return 0;
- }
- return psaRoot.getPcdDeclarations().getPcdEntryList().size();
- }
-
- /**
- Get available Pcd definition contents into String array
-
- @param pcd Caller allocated two-dimentional String array
- **/
- public void getSpdPcdDefinitions(String[][] pcd, String pcdUsage[][]) {
- if (psaRoot.getPcdDeclarations() == null) {
- return;
- }
-
- List<PcdDeclarationsDocument.PcdDeclarations.PcdEntry> l = psaRoot.getPcdDeclarations().getPcdEntryList();
- int i = 0;
- while (i < l.size()) {
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry e = (PcdDeclarationsDocument.PcdDeclarations.PcdEntry)l.get(i);
- pcd[i][0] = e.getCName();
- pcd[i][1] = e.getToken() + "";
- pcd[i][2] = e.getTokenSpaceGuidCName();
- if (e.getDatumType() != null) {
- pcd[i][3] = e.getDatumType().toString();
- }
- pcd[i][4] = e.getDefaultValue()+"";
- pcd[i][5] = e.getHelpText();
- String archList = listToString(e.getSupArchList());
- if (archList != null) {
- pcd[i][6] = archList;
- }
- String modTypeList = listToString(e.getSupModuleList());
- if (modTypeList != null) {
- pcd[i][7] = modTypeList;
- }
-
- int j = 0;
- while (j < e.getValidUsage().size() && j < 5) {
- pcdUsage[i][j] = (String)e.getValidUsage().get(j);
- ++j;
- }
- i++;
- }
- }
-
- /**
- Save the processed xml contents to file
-
- @param spdFile The file to save xml contents
- @throws IOException Exceptions during file operation
- **/
- public void saveAs(File spdFile) throws IOException {
-
- XmlOptions options = new XmlOptions();
-
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- try {
- psad.save(spdFile, options);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- /**
- Generate SpdHeader contents using parameters passed in.
-
- @param pkgName PackageName
- @param pkgGuid Guid
- @param pkgVer Version
- @param pkgAbs Abstract
- @param pkgDes Description
- @param pkgCpRight Copyright
- @param pkgLicense License
- @param pkgCreateDate Created
- @param pkgUpdateDate Updated
- @param pkgURL URL
- @param pkgType PackageType
- @param pkgRdOnly ReadOnly
- @param pkgRePkg RePackage
- @param pkgSpec Reserved
- @param pkgOutDir Reserved
- **/
- public void genSpdHeader(String pkgName, String pkgGuid, String pkgVer, String pkgAbs, String pkgDes,
- String pkgCpRight, String pkgLicense, String pkgCreateDate, String pkgUpdateDate,
- String pkgURL, String pkgType, String pkgRdOnly, String pkgRePkg, String pkgSpec,
- String pkgOutDir) {
- if (getSpdHdr() == null) {
- spdHdr = psaRoot.addNewSpdHeader();
- }
-
- setSpdHdrPkgName(pkgName);
- setSpdHdrGuidValue(pkgGuid);
- setSpdHdrVer(pkgVer);
- setSpdHdrAbs(pkgAbs);
- setSpdHdrDescription(pkgDes);
- setSpdHdrCopyright(pkgCpRight);
- setSpdHdrLicense(pkgLicense);
-
-
- setSpdHdrSpec(pkgSpec);
- }
-
- /**
- Generate library class declaration element using parameters passed in
-
- @param libClassBaseName LibraryClass element value
- @param libClassUsage Reserved
- @param incHdrFileName IncludeHeader element value
- @param incHdrAttribGuid Reserved
- @param incHdrAttribArch Reserved
- @param incHdrAttribPath Reserved
- @param incHdrAttribClass Reserved
- @param incHdrAttribVer Reserved
- @param incHdrAttribOverrideID Reserved
- @param incHdrAttribModuleType Reserved
- **/
- public void genSpdLibClassDeclarations(String libClassBaseName, String instanceUsage, String incHdrFileName,
- String help, String incHdrAttribArch, String incHdrAttribPath,
- String incHdrAttribClass, String incHdrAttribVer,
- String incHdrAttribOverrideID, String incHdrAttribModuleType) {
- if (getSpdLibClassDeclarations() == null) {
- spdLibClassDeclarations = psaRoot.addNewLibraryClassDeclarations();
- }
- //
- // add contents under LibraryClassDeclarations tag
- //
- setSpdLibClassDeclaration(libClassBaseName, instanceUsage, incHdrFileName, help, incHdrAttribArch,
- incHdrAttribPath, incHdrAttribClass, incHdrAttribVer, incHdrAttribOverrideID,
- incHdrAttribModuleType, spdLibClassDeclarations);
- }
-
- public void getSpdLibClassDeclaration(String[] sa, int i) {
- if (getSpdLibClassDeclarations() == null) {
- return;
- }
- XmlCursor cursor = getSpdLibClassDeclarations().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass lc = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass)cursor.getObject();
- sa[0] = lc.getName();
- sa[1] = lc.getIncludeHeader();
- sa[2] = lc.getHelpText();
- sa[3] = lc.getRecommendedInstanceGuid();
- sa[4] = lc.getRecommendedInstanceVersion();
- sa[5] = listToString(lc.getSupArchList());
- sa[6] = listToString(lc.getSupModuleList());
- }
- cursor.dispose();
- }
-
- /**
- Set library class declaration contents under parent tag
-
- @param clsName LibraryClass element value
- @param clsUsage Reserved
- @param hdrFile IncludeHeader element value
- @param hdrAttribGuid Reserved
- @param hdrAttribArch Reserved
- @param hdrAttribPath Reserved
- @param hdrAttribClass Reserved
- @param hdrAttribVer Reserved
- @param hdrAttribOverID Reserved
- @param hdrAttribModType Reserved
- @param parent The tag under which library class declaration goes to
- **/
- public void setSpdLibClassDeclaration(String clsName, String clsUsage, String hdrFile, String help,
- String hdrAttribArch, String hdrAttribPath, String hdrAttribClass,
- String instanceVer, String hdrAttribOverID, String hdrAttribModType,
- XmlObject parent) {
-
- setSpdLibraryClass(clsName, hdrFile, help, clsUsage, instanceVer, hdrAttribArch, hdrAttribModType, parent);
-
- }
-
- /**
- Set the contents of LibraryClass under parent element
-
- @param clsName LibraryClass element value
- @param clsUsage Reserved
- @param parent The tag under which library class declaration goes to
- **/
- public void setSpdLibraryClass(String clsName, String clsIncludeFile, String help, String clsUsage, String instanceVer, String hdrAttribArch, String hdrAttribModType, XmlObject parent) {
- LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass lc = ((LibraryClassDeclarationsDocument.LibraryClassDeclarations) parent).addNewLibraryClass();
- lc.setName(clsName);
- lc.setIncludeHeader(clsIncludeFile);
- lc.setHelpText(help);
-// LAH added logic so you cannot set the version unless the GUID is defined.
-
- if (clsUsage != null) {
- lc.setRecommendedInstanceGuid(clsUsage);
- if (instanceVer != null) {
- lc.setRecommendedInstanceVersion(instanceVer);
- }
- }
- else {
- if (lc.isSetRecommendedInstanceGuid()) {
- lc.unsetRecommendedInstanceGuid();
- }
- if (lc.isSetRecommendedInstanceVersion()) {
- lc.unsetRecommendedInstanceVersion();
- }
- }
-
- if (hdrAttribArch != null) {
- lc.setSupArchList(stringToList(hdrAttribArch));
- } else {
- if (lc.isSetSupArchList()) {
- lc.unsetSupArchList();
- }
- }
-
- if (hdrAttribModType != null) {
- lc.setSupModuleList(stringToList(hdrAttribModType));
- } else {
- if (lc.isSetSupModuleList()) {
- lc.unsetSupModuleList();
- }
- }
-
- }
-
- /**
- Set contents of IncludeHeader under parent element
-
- @param modType Reserved
- @param hdrFile IncludeHeader element value
- @param hdrAttribGuid Reserved
- @param hdrAttribArch Reserved
- @param hdrAttribPath Reserved
- @param hdrAttribClass Reserved
- @param hdrAttribVer Reserved
- @param hdrAttribOverID Reserved
- @param parent The tag under which library class declaration goes to
- **/
- public void setSpdIncludeHeader(String modType, String hdrFile, String hdrAttribGuid, String hdrAttribArch,
- String hdrAttribPath, String hdrAttribClass, String hdrAttribVer,
- String hdrAttribOverID, XmlObject parent) {
-
- if (parent instanceof LibraryClassDeclarationsDocument.LibraryClassDeclarations) {
- } else if (parent instanceof PackageHeadersDocument.PackageHeaders) {
- PackageHeadersDocument.PackageHeaders.IncludePkgHeader ih = null;
- ih = ((PackageHeadersDocument.PackageHeaders) parent).addNewIncludePkgHeader();
- ih.setStringValue(hdrFile);
- ih.setModuleType(ModuleTypeDef.Enum.forString(modType));
- } else {
- return;
- }
-
- if (hdrAttribGuid != null) {
- }
- if (hdrAttribPath != null) {
- }
- if (hdrAttribClass != null) {
- }
- if (hdrAttribVer != null) {
- }
- if (hdrAttribOverID != null) {
- }
-
- }
-
- /**
- Generate MsaFile element.
-
- @param msaFileName MsaFile element value
- @param archType Reserved
- **/
- public void genSpdMsaFiles(String msaFileName, String moduleName, String ver, String guid) {
- if (getSpdMsaFiles() == null) {
- spdMsaFiles = psaRoot.addNewMsaFiles();
- }
- setSpdMsaFile(msaFileName, moduleName, ver, guid, spdMsaFiles);
-
- }
-
- public void getSpdMsaFile (String[] sa, int i) {
- if (getSpdMsaFiles() == null) {
- return;
- }
- XmlCursor cursor = getSpdMsaFiles().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- sa[0] = cursor.getTextValue();
- }
- cursor.dispose();
- }
-
- /**
- Set MsaFile contents under parent element.
-
- @param msaFileName MsaFile element value
- @param parent Element under which MsaFile goes to
- **/
- public void setSpdMsaFile(String msaFileName, String moduleName, String ver, String guid, XmlObject parent) {
- MsaFilesDocument.MsaFiles f = (MsaFilesDocument.MsaFiles)parent;
- f.addNewFilename().setStringValue(msaFileName);
-// f.setFilename(msaFileName);
-// f.setModuleName(moduleName);
-// f.setModuleVersion(ver);
-// f.setModuleGuid(guid);
- }
-
- /**
- Generate PackageHeader element using parameters passed in.
-
- @param ModHdrModType ModuleType attribute of IncludeHeader element
- @param hdrFile IncludeHeader element value
- @param hdrAttribGuid Reserved
- @param hdrAttribArch Reserved
- @param hdrAttribPath Reserved
- @param hdrAttribClass Reserved
- @param hdrAttribVer Reserved
- @param hdrAttribOverID Reserved
- **/
- public void genSpdModuleHeaders(String ModHdrModType, String hdrFile, String hdrAttribGuid, String hdrAttribArch,
- String hdrAttribPath, String hdrAttribClass, String hdrAttribVer,
- String hdrAttribOverID) {
- if (getSpdModHdrs() == null) {
- spdModHdrs = psaRoot.addNewPackageHeaders();
- }
-
- //
- // add IncludeHeader under PackageHeaders element
- //
- setSpdIncludeHeader(ModHdrModType, hdrFile, hdrAttribGuid, hdrAttribArch, hdrAttribPath, hdrAttribClass,
- hdrAttribVer, hdrAttribOverID, spdModHdrs);
- }
-
- public void getSpdModuleHeader(String[] sa, int i) {
- if (getSpdModHdrs() == null) {
- return;
- }
- XmlCursor cursor = getSpdModHdrs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- PackageHeadersDocument.PackageHeaders.IncludePkgHeader ih = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader)cursor.getObject();
- sa[0] = ih.getModuleType()+"";
- sa[1] = ih.getStringValue();
- }
- cursor.dispose();
- }
-
- /**
- Generate GUID declaration element using parameters passed in.
-
- @param guidDeclEntryName Name attribute of Entry element
- @param guidDeclCName CName element value
- @param guidDeclGuid Guid element value
- @param guidDeclFeatureFlag Reserved
- **/
- public void genSpdGuidDeclarations(String guidDeclEntryName, String guidDeclCName, String guidDeclGuid,
- String guidDeclHelp, Vector<String> archList, Vector<String> modTypeList,
- Vector<String> guidTypeList) {
- if (getSpdGuidDeclarations() == null) {
- spdGuidDeclarations = psaRoot.addNewGuidDeclarations();
- }
-
- setSpdEntry(guidDeclEntryName, guidDeclCName, guidDeclGuid, guidDeclHelp, archList, modTypeList, guidTypeList, spdGuidDeclarations);
- }
-
- /**
- Generate protocol declaration element using parameters passed in.
-
- @param protocolDeclEntryName Name attribute of Entry element
- @param protocolDeclCName CName element value
- @param protocolDeclGuid Guid element value
- @param protocolDeclFeatureFlag Reserved
- **/
- public void genSpdProtocolDeclarations(String protocolDeclEntryName, String protocolDeclCName,
- String protocolDeclGuid, String protocolDeclFeatureFlag,
- Vector<String> archList, Vector<String> modTypeList, Vector<String> guidTypeList) {
- if (getSpdProtocolDeclarations() == null) {
- spdProtocolDeclarations = psaRoot.addNewProtocolDeclarations();
- }
-
- setSpdEntry(protocolDeclEntryName, protocolDeclCName, protocolDeclGuid, protocolDeclFeatureFlag,
- archList, modTypeList, guidTypeList, spdProtocolDeclarations);
- }
-
- /**
- Generate PPI declaration element using parameters passed in.
-
- @param ppiDeclEntryName Name attribute of Entry element
- @param ppiDeclCName CName element value
- @param ppiDeclGuid Guid element value
- @param ppiDeclFeatureFlag Reserved
- **/
- public void genSpdPpiDeclarations(String ppiDeclEntryName, String ppiDeclCName, String ppiDeclGuid,
- String ppiDeclFeatureFlag, Vector<String> archList, Vector<String> modTypeList, Vector<String> guidTypeList) {
- if (getSpdPpiDeclarations() == null) {
- spdPpiDeclarations = psaRoot.addNewPpiDeclarations();
- }
-
- setSpdEntry(ppiDeclEntryName, ppiDeclCName, ppiDeclGuid, ppiDeclFeatureFlag, archList, modTypeList, guidTypeList, spdPpiDeclarations);
- }
-
- public void getSpdGuidDeclaration(String[] sa, int i) {
- if (getSpdGuidDeclarations() == null) {
- return;
- }
- getSpdEntry(sa, i, getSpdGuidDeclarations());
- }
-
- public void getSpdProtocolDeclaration(String[] sa, int i) {
- if (getSpdProtocolDeclarations() == null) {
- return;
- }
- getSpdEntry(sa, i, getSpdProtocolDeclarations());
- }
-
- public void getSpdPpiDeclaration(String[] sa, int i) {
- if (getSpdPpiDeclarations() == null) {
- return;
- }
- getSpdEntry(sa, i, getSpdPpiDeclarations());
- }
-
- public void getSpdEntry(String[] sa, int i, XmlObject parent) {
- XmlCursor cursor = parent.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- if (parent instanceof GuidDeclarationsDocument.GuidDeclarations) {
- GuidDeclarationsDocument.GuidDeclarations.Entry e = (GuidDeclarationsDocument.GuidDeclarations.Entry)cursor.getObject();
- sa[0] = e.getName();
- sa[1] = e.getCName();
- sa[2] = e.getGuidValue();
- sa[3] = e.getHelpText();
- sa[4] = listToString(e.getSupArchList());
- sa[5] = listToString(e.getSupModuleList());
- sa[6] = listToString(e.getGuidTypeList());
- }
-
- if (parent instanceof ProtocolDeclarationsDocument.ProtocolDeclarations) {
- ProtocolDeclarationsDocument.ProtocolDeclarations.Entry e = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry)cursor.getObject();
- sa[0] = e.getName();
- sa[1] = e.getCName();
- sa[2] = e.getGuidValue();
- sa[3] = e.getHelpText();
- sa[4] = listToString(e.getSupArchList());
- sa[5] = listToString(e.getSupModuleList());
- sa[6] = listToString(e.getGuidTypeList());
- }
-
- if (parent instanceof PpiDeclarationsDocument.PpiDeclarations) {
- PpiDeclarationsDocument.PpiDeclarations.Entry e = (PpiDeclarationsDocument.PpiDeclarations.Entry)cursor.getObject();
- sa[0] = e.getName();
- sa[1] = e.getCName();
- sa[2] = e.getGuidValue();
- sa[3] = e.getHelpText();
- sa[4] = listToString(e.getSupArchList());
- sa[5] = listToString(e.getSupModuleList());
- sa[6] = listToString(e.getGuidTypeList());
- }
-
- }
- cursor.dispose();
- }
- /**
- Set Entry contents using parameters passed in
-
- @param entryName Name attribute of Entry element
- @param cName CName element value
- @param guid Guid element value
- @param featureFlag Reserved
- @param parent The tag under which Entry element goes to
- **/
- public void setSpdEntry(String entryName, String cName, String guid, String help,
- Vector<String> archList, Vector<String> modTypeList,
- Vector<String> guidTypeList, XmlObject parent) {
-
- if (parent instanceof GuidDeclarationsDocument.GuidDeclarations) {
- GuidDeclarationsDocument.GuidDeclarations.Entry e = ((GuidDeclarations) parent).addNewEntry();
- e.setName(entryName);
- e.setCName(cName);
- e.setGuidValue(guid);
- e.setHelpText(help);
- if (guidTypeList != null) {
- e.setGuidTypeList(guidTypeList);
- }
- else{
- if (e.isSetGuidTypeList()) {
- e.unsetGuidTypeList();
- }
- }
- if (archList != null) {
- e.setSupArchList(archList);
- }
- else {
- if (e.isSetSupArchList()) {
- e.unsetSupArchList();
- }
- }
- if (modTypeList != null){
- e.setSupModuleList(modTypeList);
- }
- else {
- if (e.isSetSupModuleList()) {
- e.unsetSupModuleList();
- }
- }
-
- return;
- }
- if (parent instanceof ProtocolDeclarationsDocument.ProtocolDeclarations) {
- ProtocolDeclarationsDocument.ProtocolDeclarations.Entry pe = ((ProtocolDeclarationsDocument.ProtocolDeclarations) parent)
- .addNewEntry();
- pe.setName(entryName);
- pe.setCName(cName);
- pe.setGuidValue(guid);
- pe.setHelpText(help);
- if (guidTypeList != null) {
- pe.setGuidTypeList(guidTypeList);
- }
- else{
- if (pe.isSetGuidTypeList()) {
- pe.unsetGuidTypeList();
- }
- }
- if (archList != null) {
- pe.setSupArchList(archList);
- }
- else {
- if (pe.isSetSupArchList()) {
- pe.unsetSupArchList();
- }
- }
- if (modTypeList != null){
- pe.setSupModuleList(modTypeList);
- }
- else {
- if (pe.isSetSupModuleList()) {
- pe.unsetSupModuleList();
- }
- }
-
- return;
- }
- if (parent instanceof PpiDeclarationsDocument.PpiDeclarations) {
- PpiDeclarationsDocument.PpiDeclarations.Entry ppe = ((PpiDeclarationsDocument.PpiDeclarations) parent)
- .addNewEntry();
- ppe.setName(entryName);
- ppe.setCName(cName);
- ppe.setGuidValue(guid);
- ppe.setHelpText(help);
- if (guidTypeList != null) {
- ppe.setGuidTypeList(guidTypeList);
- }
- else{
- if (ppe.isSetGuidTypeList()) {
- ppe.unsetGuidTypeList();
- }
- }
- if (archList != null) {
- ppe.setSupArchList(archList);
- }
- else {
- if (ppe.isSetSupArchList()) {
- ppe.unsetSupArchList();
- }
- }
- if (modTypeList != null){
- ppe.setSupModuleList(modTypeList);
- }
- else {
- if (ppe.isSetSupModuleList()) {
- ppe.unsetSupModuleList();
- }
- }
-
- return;
- }
-
- return;
-
- }
-
- /**
- Generate Pcd definition using parameters passed in
-
- @param pcdItemTypes ItemType attribute of PcdEntry element
- @param cName C_Name element value
- @param token Token element value
- @param dataType DatumType element value
- @param skuEnable Reserved
- @param sku Reserved
- @param maxSku Reserved
- @param hiiEnable Reserved
- @param varGuid Reserved
- @param varName Reserved
- @param defaultString DefaultString element value
- **/
- public void genSpdPcdDefinitions(String cName, String token, String dataType, String pcdItemTypes,
- String spaceGuid, String defaultString, String help, String archList,
- String modTypeList) {
- if (getSpdPcdDefinitions() == null) {
- spdPcdDefinitions = psaRoot.addNewPcdDeclarations();
- }
-
- setSpdPcdEntry(pcdItemTypes, cName, token, dataType, spaceGuid, help,
- defaultString, archList, modTypeList, spdPcdDefinitions);
- }
-
- public void getSpdPcdDeclaration(String[] sa, int i) {
- if (getSpdPcdDefinitions() == null) {
- return;
- }
-
- XmlCursor cursor = getSpdPcdDefinitions().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry pe = (PcdDeclarationsDocument.PcdDeclarations.PcdEntry)cursor.getObject();
- sa[0] = pe.getCName();
- sa[1] = pe.getToken()+"";
- sa[2] = pe.getTokenSpaceGuidCName();
- sa[3] = pe.getDatumType()+"";
- sa[4] = pe.getDefaultValue();
- sa[5] = pe.getHelpText();
- sa[6] = listToString(pe.getValidUsage());
- sa[7] = listToString(pe.getSupArchList());
- sa[8] = listToString(pe.getSupModuleList());
- }
- cursor.dispose();
- }
-
- /**
- Set Pcd entry contents under parent tag
-
- @param pcdItemTypes ItemType attribute of PcdEntry element
- @param cName C_Name element value
- @param token Token element value
- @param dataType DatumType element value
- @param spaceGuid Reserved
- @param help Reserved
- @param defaultString DefaultString element value
- @param parent Tag under which PcdEntry goes to
- **/
- public void setSpdPcdEntry(String pcdItemTypes, String cName, String token, String dataType, String spaceGuid, String help,
- String defaultString, String archList, String modTypeList, XmlObject parent) {
-
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry pe = ((PcdDeclarationsDocument.PcdDeclarations) parent).addNewPcdEntry();
-
- //ToDo: maybe multiple types in, need parse pcdItemTypes.
- String usage[] = pcdItemTypes.split("( )+");
- List<String> l = new ArrayList<String>();
- for (int i = 0; i < usage.length; ++i) {
- l.add(usage[i]);
- }
- pe.setValidUsage(l);
- pe.setCName(cName);
- pe.setToken(token);
- pe.setDatumType(PcdDataTypes.Enum.forString(dataType));
- pe.setDefaultValue(defaultString);
- pe.setTokenSpaceGuidCName(spaceGuid);
- pe.setHelpText(help);
- if (archList != null){
- pe.setSupArchList(stringToList(archList));
- } else {
- if (pe.isSetSupArchList()) {
- pe.unsetSupArchList();
- }
- }
- if (modTypeList != null){
- pe.setSupModuleList(stringToList(modTypeList));
- } else {
- if (pe.isSetSupModuleList()) {
- pe.unsetSupModuleList();
- }
- }
- }
-
- /**
- Get PpiDeclarations element
-
- @return PpiDeclarationsDocument.PpiDeclarations
- **/
- public PpiDeclarationsDocument.PpiDeclarations getSpdPpiDeclarations() {
- if (spdPpiDeclarations == null) {
- spdPpiDeclarations = psaRoot.getPpiDeclarations();
- }
- return spdPpiDeclarations;
- }
-
- /**
- Get ProtocolDeclarations element
-
- @return ProtocolDeclarationsDocument.ProtocolDeclarations
- **/
- public ProtocolDeclarationsDocument.ProtocolDeclarations getSpdProtocolDeclarations() {
- if (spdProtocolDeclarations == null) {
- spdProtocolDeclarations = psaRoot.getProtocolDeclarations();
- }
- return spdProtocolDeclarations;
- }
-
- /**
- Get GuidDeclarations element
-
- @return GuidDeclarationsDocument.GuidDeclarations
- **/
- public GuidDeclarationsDocument.GuidDeclarations getSpdGuidDeclarations() {
- if (spdGuidDeclarations == null) {
- spdGuidDeclarations = psaRoot.getGuidDeclarations();
- }
- return spdGuidDeclarations;
- }
-
- /**
- Get PcdDefinitions element
-
- @return PcdDefinitionsDocument.PcdDefinitions
- **/
- public PcdDeclarationsDocument.PcdDeclarations getSpdPcdDefinitions() {
- if (spdPcdDefinitions == null) {
- spdPcdDefinitions = psaRoot.getPcdDeclarations();
- }
- return spdPcdDefinitions;
- }
-
- /**
- Get PackageHeaders element
-
- @return PackageHeadersDocument.PackageHeaders
- **/
- public PackageHeadersDocument.PackageHeaders getSpdModHdrs() {
- if (spdModHdrs == null) {
- spdModHdrs = psaRoot.getPackageHeaders();
- }
- return spdModHdrs;
- }
-
- /**
- Get MsaFiles element
-
- @return MsaFilesDocument.MsaFiles
- **/
- public MsaFilesDocument.MsaFiles getSpdMsaFiles() {
- if (spdMsaFiles == null) {
- spdMsaFiles = psaRoot.getMsaFiles();
- }
- return spdMsaFiles;
- }
-
- /**
- Get LibraryClassDeclarations element
-
- @return LibraryClassDeclarationsDocument.LibraryClassDeclarations
- **/
- public LibraryClassDeclarationsDocument.LibraryClassDeclarations getSpdLibClassDeclarations() {
- if (spdLibClassDeclarations == null) {
- spdLibClassDeclarations = psaRoot.getLibraryClassDeclarations();
- }
- return spdLibClassDeclarations;
- }
-
- public PackageDefinitionsDocument.PackageDefinitions getSpdPkgDefs() {
- if (spdPkgDefs == null) {
- spdPkgDefs = psaRoot.addNewPackageDefinitions();
- }
- return spdPkgDefs;
- }
- /**
- Get SpdHeader element
-
- @return SpdHeaderDocument.SpdHeader
- **/
- public SpdHeaderDocument.SpdHeader getSpdHdr() {
- if (spdHdr == null) {
- spdHdr = psaRoot.addNewSpdHeader();
- }
- return spdHdr;
- }
-
- /**
- Set value to Guid element
-
- @param guid The value set to Guid element
- **/
- public void setSpdHdrGuidValue(String guid) {
- getSpdHdr().setGuidValue(guid);
- }
-
- /**
- Get Version element under SpdHdr
-
- @return String
- **/
- public String getSpdHdrVer() {
- return getSpdHdr().getVersion();
- }
-
- /**
- Set value to Version element
-
- @param ver The value set to Version element
- **/
- public void setSpdHdrVer(String ver) {
- getSpdHdr().setVersion(ver);
- }
-
- public String getSpdHdrAbs(){
- return getSpdHdr().getAbstract();
-
- }
-
- /**
- Set value to Abstract element
-
- @param abs The value set to Abstract element
- **/
- public void setSpdHdrAbs(String abs) {
-
- getSpdHdr().setAbstract(abs);
- }
-
- public String getSpdHdrDescription(){
- return getSpdHdr().getDescription();
- }
- /**
- Set value to Description element
-
- @param des The value set to Description element
- **/
- public void setSpdHdrDescription(String des) {
- getSpdHdr().setDescription(des);
- }
-
- public String getSpdHdrCopyright(){
- return getSpdHdr().getCopyright();
- }
- /**
- Set value to Copyright element
-
- @param cpRit The value set to Copyright element
- **/
- public void setSpdHdrCopyright(String cpRit) {
-
- getSpdHdr().setCopyright(cpRit);
-
- }
- /**
- Get License element under SpdHdr
-
- @return String
- **/
- public String getSpdHdrLicense() {
- if (getSpdHdr().getLicense() != null) {
- return getSpdHdr().getLicense().getStringValue();
- }
- return null;
- }
-
- /**
- Set value to License element
-
- @param license The value set to License element
- **/
- public void setSpdHdrLicense(String license) {
- if (getSpdHdr().getLicense() == null){
- getSpdHdr().addNewLicense().setStringValue(license);
- }
- else {
- getSpdHdr().getLicense().setStringValue(license);
- }
- }
-
- public String getSpdHdrUrl(){
- if (getSpdHdr().getLicense() != null) {
- return getSpdHdr().getLicense().getURL();
- }
- return null;
- }
-
- public void setSpdHdrUrl(String url){
- getSpdHdr().getLicense().setURL(url);
- }
-
- /**
- Get PackageName element under SpdHdr
-
- @return String
- **/
- public String getSpdHdrPkgName() {
-
- return getSpdHdr().getPackageName();
- }
-
- /**
- Set value to PackageName element
-
- @param pkgName The value set to PackageName element
- **/
- public void setSpdHdrPkgName(String pkgName) {
- getSpdHdr().setPackageName(pkgName);
- }
-
- public String getSpdHdrGuidValue(){
- return getSpdHdr().getGuidValue();
- }
-
- /**
- Reserved method
-
- @return SpecificationDocument.Specification
- **/
- public String getSpdHdrSpec() {
- return "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
-// return getSpdHdr().getSpecification();
- }
-
- /**
- Reserved method
-
- @param spec
- **/
- public void setSpdHdrSpec(String spec) {
- spec = "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
- getSpdHdr().setSpecification(spec);
-
- }
-
- public String getSpdPkgDefsRdOnly(){
- return getSpdPkgDefs().getReadOnly() + "";
- }
- /**
- Set value to ReadOnly element
-
- @param rdOnly The value set to ReadOnly element
- **/
- public void setSpdPkgDefsRdOnly(String rdOnly) {
-
- getSpdPkgDefs().setReadOnly(new Boolean(rdOnly));
- }
-
- public String getSpdPkgDefsRePkg(){
- return getSpdPkgDefs().getRePackage() + "";
- }
- /**
- Set value to RePackage element
-
- @param rePkg The value set to RePackage element
- **/
- public void setSpdPkgDefsRePkg(String rePkg) {
-
- getSpdPkgDefs().setRePackage(new Boolean(rePkg));
- }
-
- /**
- Set value to URL element
-
- @param url The value set to URL element
- **/
-// public void setSpdHdrURL(String url) {
-// getSpdHdr().setURL(url);
-// }
-
- /**
- Get xml file
-
- @return File
- **/
- public File getFile() {
- return file;
- }
-
- /**
- Set file
-
- @param file File with xml format
- **/
- public void setFile(File file) {
- this.file = file;
- }
-
- private List<String> stringToList(String s){
- if (s == null || s.length() == 0) {
- return null;
- }
- Vector<String> al = new Vector<String>();
- String[] sArray = s.split(" ");
- for(int i = 0; i < sArray.length; ++i){
- al.add(sArray[i]);
- }
- return al;
- }
-
- private String listToString(List l) {
- if (l == null) {
- return null;
- }
- String s = " ";
- ListIterator li = l.listIterator();
- while(li.hasNext()) {
- s += li.next();
- s += " ";
- }
- return s.trim();
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
deleted file mode 100644
index 8f39783a8f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdGuidDecls.java
+++ /dev/null
@@ -1,941 +0,0 @@
-/** @file
- Java class SpdGuidDecls is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.util.Vector;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.platform.ui.ListEditor;
-import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;
-
-/**
- GUI for create library definition elements of spd file.
-
- @since PackageEditor 1.0
-**/
-public class SpdGuidDecls extends IInternalFrame implements TableModelListener{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JFrame topFrame = null;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private JTable jTable = null;
-
- private DefaultTableModel model = null;
-
- private JPanel jContentPane = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JScrollPane jScrollPane = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonClearAll = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonGen = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- protected int selectedRow = -1;
-
- private JLabel jLabelName = null;
-
- private JScrollPane jScrollPaneModule = null;
-
- private JTextField jTextFieldName = null;
-
- private JScrollPane jScrollPaneArch = null;
-
- private JScrollPane jScrollPaneGuid = null;
-
- private JLabel jLabelGuid = null;
-
- private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,213"
-
- private JLabel jLabelCName = null;
-
- private GenGuidDialog guidDialog = null;
-
- private JTextField jTextFieldCName = null;
-
- private JLabel jLabelHelp = null;
-
- private JTextField jTextFieldHelp = null;
-
- private JLabel jLabelSupMod = null;
-
- private JLabel jLabelSupArch = null;
-
- private ICheckBoxList iCheckBoxListArch = null;
-
- private ICheckBoxList iCheckBoxListGuid = null;
-
- private ICheckBoxList iCheckBoxListMod = null;
-
- private JLabel jLabelGuidType = null;
-
- protected String[][] saa = null;
-
- protected StarLabel starLabel = null;
-
- private final int guidNameMinWidth = 200;
- private final int guidCNameMinWidth = 200;
- private final int guidValueMinWidth = 300;
- private final int helpTextMinWidth = 300;
- private final int supArchMinWidth = 200;
- private final int supModMinWidth = 200;
- private final int guidTypeMinWidth = 200;
-
-
- /**
- This method initializes this
-
- **/
- protected void initialize() {
-
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- }
-
- /**
- This method initializes jTextFieldGuid
-
- @return javax.swing.JTextField
- **/
- protected JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(137,60,336,20));
- jTextFieldGuid.setPreferredSize(new java.awt.Dimension(200,20));
-
- }
- return jTextFieldGuid;
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- **/
- protected JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(5,256,472,292));
- jScrollPane.setViewportView(getJTable());
- }
- return jScrollPane;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- protected JTable getJTable() {
- if (jTable == null) {
- model = new DefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
- model.addColumn("Name");
- model.addColumn("The C Name");
- model.addColumn("GUID Value");
- model.addColumn("Help Text");
- model.addColumn("Supported Architectures");
- model.addColumn("Supported Module Types");
- model.addColumn("GuidTypes");
-
- TableColumn column = jTable.getColumnModel().getColumn(0);
- column.setMinWidth(this.guidNameMinWidth);
- column = jTable.getColumnModel().getColumn(1);
- column.setMinWidth(this.guidCNameMinWidth);
- column = jTable.getColumnModel().getColumn(2);
- column.setMinWidth(this.guidValueMinWidth);
- column = jTable.getColumnModel().getColumn(3);
- column.setMinWidth(this.helpTextMinWidth);
- column = jTable.getColumnModel().getColumn(4);
- column.setMinWidth(this.supArchMinWidth);
- column = jTable.getColumnModel().getColumn(5);
- column.setMinWidth(this.supModMinWidth);
- column = jTable.getColumnModel().getColumn(6);
- column.setMinWidth(this.guidTypeMinWidth);
-
- jTable.getColumnModel().getColumn(2).setCellEditor(new GuidEditor(topFrame));
- jTable.getColumnModel().getColumn(3).setCellEditor(new LongTextEditor(topFrame));
-
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTable.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch, topFrame));
-
- Vector<String> vModule = new Vector<String>();
- vModule.add("BASE");
- vModule.add("SEC");
- vModule.add("PEI_CORE");
- vModule.add("PEIM");
- vModule.add("DXE_CORE");
- vModule.add("DXE_DRIVER");
- vModule.add("DXE_RUNTIME_DRIVER");
- vModule.add("DXE_SAL_DRIVER");
- vModule.add("DXE_SMM_DRIVER");
- vModule.add("UEFI_DRIVER");
- vModule.add("UEFI_APPLICATION");
- vModule.add("USER_DEFINED");
- jTable.getColumnModel().getColumn(5).setCellEditor(new ListEditor(vModule, topFrame));
-
- Vector<String> vGuid = new Vector<String>();
- vGuid.add("DATA_HUB_RECORD");
- vGuid.add("EFI_EVENT");
- vGuid.add("EFI_SYSTEM_CONFIGURATION_TABLE");
- vGuid.add("EFI_VARIABLE");
- vGuid.add("GUID");
- vGuid.add("HII_PACKAGE_LIST");
- vGuid.add("HOB");
- vGuid.add("TOKEN_SPACE_GUID");
- ListEditor le = new ListEditor(vGuid, topFrame);
- le.setCanNotBeEmpty(true);
- jTable.getColumnModel().getColumn(6).setCellEditor(le);
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
-
- }
- }
- });
-
- jTable.getModel().addTableModelListener(this);
- }
- return jTable;
- }
-
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
-
- updateRow(row, column, m);
- }
- }
-
- protected void updateRow(int row, int column, TableModel m){
- String[] sa = new String[7];
- sfc.getSpdGuidDeclaration(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
-
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
-
- String name = m.getValueAt(row, 0) + "";
- String cName = m.getValueAt(row, 1) + "";
- String guid = m.getValueAt(row, 2) + "";
- String help = m.getValueAt(row, 3) + "";
- String archList = null;
- if (m.getValueAt(row, 4) != null){
- archList = m.getValueAt(row, 4).toString();
- }
- String modTypeList = null;
- if (m.getValueAt(row, 5) != null) {
- modTypeList = m.getValueAt(row, 5).toString();
- }
- String guidTypeList = null;
- if (m.getValueAt(row, 6) != null){
- guidTypeList = m.getValueAt(row, 6).toString();
- }
- String[] rowData = {name, cName, guid, help};
- if (!dataValidation(rowData)){
- return;
- }
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- sfc.updateSpdGuidDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
- }
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(167,227,90,20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(270,227,90,20));
- jButtonRemove.setText("Delete");
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonRemoveAll
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonClearAll() {
- if (jButtonClearAll == null) {
- jButtonClearAll = new JButton();
- jButtonClearAll.setBounds(new java.awt.Rectangle(380,227,90,20));
- jButtonClearAll.setText("Clear All");
- jButtonClearAll.addActionListener(this);
- }
- return jButtonClearAll;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setLocation(new java.awt.Point(390, 305));
- jButtonCancel.setText("Cancel");
- jButtonCancel.setSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setVisible(false);
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jButton
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setSize(new java.awt.Dimension(90, 20));
- jButtonOk.setText("OK");
- jButtonOk.setLocation(new java.awt.Point(290, 305));
- jButtonOk.setVisible(false);
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This is the default constructor
- **/
- public SpdGuidDecls(JFrame frame) {
- super();
- topFrame = frame;
- initialize();
- init();
-
- }
-
- public SpdGuidDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame){
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdGuidDecls(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(this, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
- }
- /**
- This method initializes this
-
- @return void
- **/
- protected void init() {
- this.setContentPane(getJContentPane());
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- }
- });
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setVisible(true);
- }
-
- protected void init(SpdFileContents sfc){
- if (sfc.getSpdGuidDeclarationCount() == 0) {
- return ;
- }
- //
- // initialize table using SpdFileContents object
- //
- saa = new String[sfc.getSpdGuidDeclarationCount()][7];
- sfc.getSpdGuidDeclarations(saa);
- int i = 0;
- while (i < saa.length) {
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- protected JScrollPane getJContentPane(){
- if (topScrollPane == null){
- topScrollPane = new JScrollPane();
- topScrollPane.setSize(new java.awt.Dimension(617,500));
- topScrollPane.setPreferredSize(new java.awt.Dimension(498,500));
- topScrollPane.setViewportView(getJContentPane1());
- }
- return topScrollPane;
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
- **/
- protected JPanel getJContentPane1() {
- if (jContentPane == null) {
-
- jLabelGuidType = new JLabel();
- jLabelGuidType.setBounds(new java.awt.Rectangle(420,122,103,16));
- jLabelGuidType.setText("GUID Type List");
- jLabelGuidType.setEnabled(true);
- starLabel = new StarLabel();
- starLabel.setLocation(new Point(jLabelGuidType.getX() - 10, jLabelGuidType.getY()));
- starLabel.setVisible(true);
- jLabelSupArch = new JLabel();
- jLabelSupArch.setBounds(new java.awt.Rectangle(197,122,108,16));
- jLabelSupArch.setText("Supported Architectures");
- jLabelSupArch.setEnabled(true);
- FontMetrics fm = jLabelSupArch.getFontMetrics(jLabelSupArch.getFont());
- jLabelSupArch.setSize(fm.stringWidth(jLabelSupArch.getText()) + 10, 20);
- jLabelSupMod = new JLabel();
- jLabelSupMod.setBounds(new java.awt.Rectangle(14,120,110,16));
- jLabelSupMod.setText("Supported Module Types");
- jLabelSupMod.setEnabled(true);
- fm = jLabelSupMod.getFontMetrics(jLabelSupMod.getFont());
- jLabelSupMod.setSize(fm.stringWidth(jLabelSupMod.getText()) + 10, 20);
- jLabelHelp = new JLabel();
- jLabelHelp.setText("HelpText");
- jLabelHelp.setSize(new java.awt.Dimension(109,20));
- jLabelHelp.setLocation(new java.awt.Point(14,85));
- jLabelCName = new JLabel();
- jLabelCName.setBounds(new java.awt.Rectangle(14,35,111,20));
- jLabelCName.setText("C Name");
- jLabelGuid = new JLabel();
- jLabelGuid.setBounds(new java.awt.Rectangle(15,60,112,20));
- jLabelGuid.setText("Guid Value");
- jLabelName = new JLabel();
- jLabelName.setBounds(new java.awt.Rectangle(15,10,113,20));
- jLabelName.setText("Name");
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, 10));
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(0, 35));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(0, 60));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0, 85));
- jStarLabel2.setVisible(true);
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new Dimension(480, 375));
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jLabelCName, null);
- jContentPane.add(getJTextFieldCName(), null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonClearAll(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonOk(), null);
-
- jContentPane.add(getJButtonGen(), null);
- jContentPane.add(jLabelName, null);
- jContentPane.add(getJTextFieldName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(jLabelHelp, null);
- jContentPane.add(getJTextFieldHelp(), null);
- jContentPane.add(jLabelSupMod, null);
- jContentPane.add(jLabelSupArch, null);
- jContentPane.add(getJScrollPaneArch(), null);
- jContentPane.add(getJScrollPaneGuid(), null);
- jContentPane.add(getJScrollPaneModule(), null);
- jContentPane.add(jLabelGuidType, null);
- jContentPane.add(starLabel, null);
- }
- return jContentPane;
- }
-
- /**
- fill ComboBoxes with pre-defined contents
- **/
- protected void initFrame() {
-
- this.setTitle("GUID Declarations");
-
- boolean editable = true;
- if (getSfc().getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
-
- jButtonAdd.setEnabled(editable);
- jButtonRemove.setEnabled(editable);
- jButtonClearAll.setEnabled(editable);
- jTable.setEnabled(editable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonOk) {
- this.save();
- this.dispose();
-
- }
- if (arg0.getSource() == jButtonCancel) {
- this.dispose();
- }
-
- if (arg0.getSource() == jButtonAdd) {
-
- //ToDo: check before add
- String[] row = {"", "", "", "", "", "", ""};
- row[3] = jTextFieldHelp.getText();
- row[2] = jTextFieldGuid.getText();
- row[1] = jTextFieldCName.getText();
- row[0] = jTextFieldName.getText();
- row[4] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());
- if (row[4].length() == 0) {
- row[4] = null;
- }
- row[5] = vectorToString(iCheckBoxListMod.getAllCheckedItemsString());
- if (row[5].length() == 0) {
- row[5] = null;
- }
- row[6] = vectorToString(iCheckBoxListGuid.getAllCheckedItemsString());
- if (row[6].length() == 0) {
- row[6] = null;
- }
-
- if (!dataValidation(row)) {
- return;
- }
-
- if (addRow(row) == -1) {
- return;
- }
- model.addRow(row);
- jTable.changeSelection(model.getRowCount()-1, 0, false, false);
-
- }
- //
- // remove selected line
- //
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()){
- jTable.getCellEditor().stopCellEditing();
- }
- int rowSelected = selectedRow;
- if (rowSelected >= 0) {
- model.removeRow(rowSelected);
- removeRow(rowSelected);
- }
- }
-
- if (arg0.getSource() == jButtonClearAll) {
- if (model.getRowCount() == 0) {
- return;
- }
- model.setRowCount(0);
- clearAllRow();
- }
-
- if (arg0.getSource() == jButtonGen) {
- jTextFieldGuid.setText(Tools.generateUuidString());
- }
-
- if (arg0.getActionCommand().equals("GenGuidValue")) {
- jTextFieldGuid.setText(guidDialog.getGuid());
- }
-
- }
-
- protected boolean dataValidation(String[] row){
- if (!DataValidation.isUiNameType(row[0])) {
- JOptionPane.showMessageDialog(this, "Name must start with an alpha character.");
- return false;
- }
- if (!DataValidation.isGuid(row[2])) {
- JOptionPane.showMessageDialog(this, "Guid Value must be in registry format, 8-4-4-4-12.");
- return false;
- }
- if (!DataValidation.isC_NameType(row[1])) {
- JOptionPane.showMessageDialog(this, "C Name does not match C Name datatype.");
- return false;
- }
- if (row[3].length() == 0) {
- JOptionPane.showMessageDialog(this, "Help Text must be entered!");
- return false;
- }
- return true;
- }
-
- protected int addRow(String[] row) {
- Vector<String> vArch = iCheckBoxListArch.getAllCheckedItemsString();
- if (vArch.size() == 0) {
- vArch = null;
- }
- Vector<String> vModType = iCheckBoxListMod.getAllCheckedItemsString();
- if (vModType.size() == 0) {
- vModType = null;
- }
- Vector<String> vguidType = iCheckBoxListGuid.getAllCheckedItemsString();
- if (vguidType.size() == 0) {
- vguidType = null;
- }
- if (vguidType == null) {
- JOptionPane.showMessageDialog(this, "You must select at least one GUID type.");
- return -1;
- }
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- sfc.genSpdGuidDeclarations(row[0], row[1], row[2], row[3], vArch, vModType, vguidType);
- return 0;
- }
-
- protected void removeRow(int i){
- sfc.removeSpdGuidDeclaration(i);
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- protected void clearAllRow(){
- sfc.removeSpdGuidDeclaration();
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- /**
- Add contents in list to sfc
- **/
- protected void save() {
-
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
- **/
- protected JButton getJButtonGen() {
- if (jButtonGen == null) {
- jButtonGen = new JButton();
- jButtonGen.setBounds(new java.awt.Rectangle(485,58,92,21));
- jButtonGen.setText("Gen");
- jButtonGen.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonGen.addActionListener(this);
- }
- return jButtonGen;
- }
-
- /**
- * This method initializes jTextFieldName
- *
- * @return javax.swing.JTextField
- */
- protected JTextField getJTextFieldName() {
- if (jTextFieldName == null) {
- jTextFieldName = new JTextField();
- jTextFieldName.setBounds(new java.awt.Rectangle(138,10,337,20));
- jTextFieldName.setPreferredSize(new java.awt.Dimension(335,20));
- }
- return jTextFieldName;
- }
-
- /**
- * This method initializes jTextFieldCName
- *
- * @return javax.swing.JTextField
- */
- protected JTextField getJTextFieldCName() {
- if (jTextFieldCName == null) {
- jTextFieldCName = new JTextField();
- jTextFieldCName.setBounds(new java.awt.Rectangle(137,35,337,20));
- jTextFieldCName.setPreferredSize(new java.awt.Dimension(335,20));
- }
- return jTextFieldCName;
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- Tools.resizeComponentWidth(this.jTextFieldName, this.getWidth(), intPreferredWidth);
-
- Tools.resizeComponentWidth(this.jTextFieldCName, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
- Tools.relocateComponentX(this.jButtonGen, this.getWidth(), this.getPreferredSize().width, 40);
-
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldHelp() {
- if (jTextFieldHelp == null) {
- jTextFieldHelp = new JTextField();
- jTextFieldHelp.setBounds(new java.awt.Rectangle(136,85,337,20));
- jTextFieldHelp.setPreferredSize(new Dimension(335, 20));
- }
- return jTextFieldHelp;
- }
-
- private JScrollPane getJScrollPaneArch() {
- if (jScrollPaneArch == null) {
- jScrollPaneArch = new JScrollPane();
- jScrollPaneArch.setBounds(new java.awt.Rectangle(197,142,188,74));
- jScrollPaneArch.setPreferredSize(new java.awt.Dimension(188, 74));
- jScrollPaneArch.setViewportView(getICheckBoxListArch());
- }
- return jScrollPaneArch;
- }
- /**
- * This method initializes iCheckBoxList
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListArch() {
- if (iCheckBoxListArch == null) {
- iCheckBoxListArch = new ICheckBoxList();
- iCheckBoxListArch.setBounds(new java.awt.Rectangle(197,142,188,74));
- Vector<String> v = new Vector<String>();
- v.add("IA32");
- v.add("X64");
- v.add("IPF");
- v.add("EBC");
- v.add("ARM");
- v.add("PPC");
- iCheckBoxListArch.setAllItems(v);
- }
- return iCheckBoxListArch;
- }
-
- protected JScrollPane getJScrollPaneGuid() {
- if (jScrollPaneGuid== null) {
- jScrollPaneGuid = new JScrollPane();
- jScrollPaneGuid.setPreferredSize(new java.awt.Dimension(190,74));
- jScrollPaneGuid.setLocation(new java.awt.Point(400,142));
- jScrollPaneGuid.setSize(new java.awt.Dimension(260,74));
- jScrollPaneGuid.setViewportView(getICheckBoxListGuid());
- }
- return jScrollPaneGuid;
- }
- /**
- * This method initializes iCheckBoxList1
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListGuid() {
- if (iCheckBoxListGuid == null) {
- iCheckBoxListGuid = new ICheckBoxList();
- iCheckBoxListGuid.setBounds(new java.awt.Rectangle(400,142,177,74));
- Vector<String> v = new Vector<String>();
- v.add("DATA_HUB_RECORD");
- v.add("EFI_EVENT");
- v.add("EFI_SYSTEM_CONFIGURATION_TABLE");
- v.add("EFI_VARIABLE");
- v.add("GUID");
- v.add("HII_PACKAGE_LIST");
- v.add("HOB");
- v.add("TOKEN_SPACE_GUID");
-
- iCheckBoxListGuid.setAllItems(v);
- }
- return iCheckBoxListGuid;
- }
-
- private JScrollPane getJScrollPaneModule() {
- if (jScrollPaneModule == null) {
- jScrollPaneModule = new JScrollPane();
- jScrollPaneModule.setBounds(new java.awt.Rectangle(14,142,170,74));
- jScrollPaneModule.setPreferredSize(new java.awt.Dimension(170, 74));
- jScrollPaneModule.setViewportView(getICheckBoxListMod());
- }
- return jScrollPaneModule;
- }
- /**
- * This method initializes iCheckBoxList2
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListMod() {
- if (iCheckBoxListMod == null) {
- iCheckBoxListMod = new ICheckBoxList();
- iCheckBoxListMod.setBounds(new java.awt.Rectangle(14,142,170,74));
- Vector<String> v = new Vector<String>();
- v.add("BASE");
- v.add("SEC");
- v.add("PEI_CORE");
- v.add("PEIM");
- v.add("DXE_CORE");
- v.add("DXE_DRIVER");
- v.add("DXE_RUNTIME_DRIVER");
- v.add("DXE_SAL_DRIVER");
- v.add("DXE_SMM_DRIVER");
- v.add("UEFI_DRIVER");
- v.add("UEFI_APPLICATION");
- v.add("USER_DEFINED");
- iCheckBoxListMod.setAllItems(v);
- }
- return iCheckBoxListMod;
- }
-
- protected DefaultTableModel getModel() {
- return model;
- }
-
- protected void setModel(DefaultTableModel model) {
- this.model = model;
- }
-
- protected String vectorToString(Vector<String> v) {
- String s = " ";
- for (int i = 0; i < v.size(); ++i) {
- s += v.get(i);
- s += " ";
- }
- return s.trim();
- }
-
- protected Vector<String> stringToVector(String s){
- if (s == null) {
- return null;
- }
- String[] sArray = s.split(" ");
- Vector<String> v = new Vector<String>();
- for (int i = 0; i < sArray.length; ++i) {
- v.add(sArray[i]);
- }
- return v;
- }
-
- protected JLabel getJLabelGuidType() {
- return jLabelGuidType;
- }
-
- /**
- * @return Returns the sfc.
- */
- protected SpdFileContents getSfc() {
- return sfc;
- }
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
deleted file mode 100644
index a8def0a86b..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdHeader.java
+++ /dev/null
@@ -1,816 +0,0 @@
-/** @file
-
- The file is used to create, update spdHeader of Spd file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import javax.swing.JCheckBox;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-/**
- The class is used to create, update spdHeader of Spd file
- It extends IInternalFrame
-
- @since PackageEditor 1.0
-
- **/
-public class SpdHeader extends IInternalFrame implements DocumentListener{
-
- private int dialogWidth = 560;
-
- private int labelColumn = 12;
-
- private int labelWidth = 155;
-
- private int buttonWidth = 60;
-
- private final int valueColumn = 168;
-
- private final int valueWidth = 320;
-
- private final int specWidth = 420;
-
- private int shortValueWidth = valueWidth - (buttonWidth + 5);
-
- private final int oneRowHeight = 20;
-
- private final int threeRowHeight = 60;
-
- private final int fourRowHeight = 80;
-
- private final int rowSep = 5;
-
- private final int rowOne = 12;
-
- private final int rowTwo = rowOne + oneRowHeight + rowSep;
-
- private final int rowThree = rowTwo + oneRowHeight + rowSep;
-
- private final int rowFour = rowThree + oneRowHeight + rowSep;
-
- private final int rowFive = rowFour + threeRowHeight + rowSep;
-
- private final int rowSix = rowFive + fourRowHeight + rowSep;
-
- private final int rowSeven = rowSix + oneRowHeight + rowSep;
-
- private final int rowEight = rowSeven + oneRowHeight + rowSep;
-
- private final int rowNine = rowEight + fourRowHeight + rowSep;
-
- private final int rowTen = rowNine + oneRowHeight + rowSep;
-
- private int dialogHeight = rowTen + threeRowHeight;
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8152099582923006900L;
-
- //
- //Define class members
- //
- private IInternalFrame topFrame;
-
- private JPanel jContentPane = null;
-
- private JLabel jPackageNameLabel = null;
-
- private JTextField jPackageNameTextField = null;
-
- private JLabel jGuidLabel = null;
-
- private JTextField jGuidTextField = null;
-
- private JLabel jVersionLabel = null;
-
- private JTextField jVersionTextField = null;
-
- private JButton jGenerateGuidButton = null;
-
- private JLabel jLicenseLabel = null;
-
- private JTextArea jLicenseTextArea = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jDescriptionLabel = null;
-
- private JTextArea jDescriptionTextArea = null;
-
- private JTextField jSpecificationTextField = null;
-
- private JScrollPane jLicenseScrollPane = null;
-
- private JScrollPane jDescriptionScrollPane = null;
-
- private JScrollPane jCopyrightScrollPane = null;
-
- private JLabel jAbstractLabel = null;
-
- private JTextField jAbstractTextField = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel6 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private StarLabel jStarLabel9 = null;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private JTextArea jCopyrightTextArea = null;
-
- private JScrollPane topScrollPane = null;
-
- private JLabel jUrlLabel = null;
-
- private JTextField jUrlTextField = null;
-
- private JCheckBox jCheckBoxRdOnly = null;
-
- private JCheckBox jCheckBoxRePkg = null;
-
- /**
- This method initializes jPackageNameTextField
-
- @return javax.swing.JTextField jPackageNameTextField
-
- **/
- private JTextField getJPackageNameTextField() {
- if (jPackageNameTextField == null) {
- jPackageNameTextField = new JTextField();
- jPackageNameTextField.setBounds(new java.awt.Rectangle(valueColumn, rowOne, valueWidth, oneRowHeight));
- jPackageNameTextField.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jPackageNameTextField.getDocument().addDocumentListener(this);
- jPackageNameTextField.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isUiNameType(jPackageNameTextField.getText())) {
- JOptionPane.showMessageDialog(topFrame, "Package Name must start with a letter.");
- return;
- }
- if (jPackageNameTextField.getText().equals(sfc.getSpdHdrPkgName())) {
- return;
- }
- sfc.setSpdHdrPkgName(jPackageNameTextField.getText());
- }
- });
- }
- return jPackageNameTextField;
- }
-
- /**
- This method initializes jGuidTextField
-
- @return javax.swing.JTextField jGuidTextField
-
- **/
- private JTextField getJGuidTextField() {
- if (jGuidTextField == null) {
- jGuidTextField = new JTextField();
- jGuidTextField.setBounds(new java.awt.Rectangle(valueColumn, rowTwo, shortValueWidth, oneRowHeight));
- jGuidTextField.setPreferredSize(new java.awt.Dimension(shortValueWidth, oneRowHeight));
- jGuidTextField.getDocument().addDocumentListener(this);
- jGuidTextField.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isGuid(jGuidTextField.getText())) {
- JOptionPane.showMessageDialog(topFrame, "Guid must be in registry (8-4-4-4-12) format.");
- return;
- }
- if (jGuidTextField.getText().equals(sfc.getSpdHdrGuidValue())) {
- return;
- }
- sfc.setSpdHdrGuidValue(jGuidTextField.getText());
- }
- });
- }
- return jGuidTextField;
- }
-
- /**
- This method initializes jVersionTextField
-
- @return javax.swing.JTextField jVersionTextField
-
- **/
- private JTextField getJVersionTextField() {
- if (jVersionTextField == null) {
- jVersionTextField = new JTextField();
- jVersionTextField.setBounds(new java.awt.Rectangle(valueColumn, rowThree, valueWidth, oneRowHeight));
- jVersionTextField.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jVersionTextField.getDocument().addDocumentListener(this);
- jVersionTextField.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isVersion(jVersionTextField.getText())) {
- JOptionPane.showMessageDialog(topFrame, "Version must start with a number.");
- return;
- }
- if (jVersionTextField.getText().equals(sfc.getSpdHdrVer())) {
- return;
- }
- sfc.setSpdHdrVer(jVersionTextField.getText());
- }
- });
- }
- return jVersionTextField;
- }
-
- /**
- This method initializes jGenerateGuidButton
-
- @return javax.swing.JButton jGenerateGuidButton
-
- **/
- private JButton getJGenerateGuidButton() {
- if (jGenerateGuidButton == null) {
- jGenerateGuidButton = new JButton();
- jGenerateGuidButton.setBounds(new java.awt.Rectangle(valueColumn + shortValueWidth + 5, rowTwo, buttonWidth, oneRowHeight));
- jGenerateGuidButton.setText("GEN");
- jGenerateGuidButton.addActionListener(this);
- }
- return jGenerateGuidButton;
- }
-
- /**
- This method initializes jLicenseTextArea
-
- @return javax.swing.JTextArea jLicenseTextArea
-
- **/
- private JTextArea getJLicenseTextArea() {
- if (jLicenseTextArea == null) {
- jLicenseTextArea = new JTextArea();
- jLicenseTextArea.setLineWrap(true);
- jLicenseTextArea.getDocument().addDocumentListener(this);
- jLicenseTextArea.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (jLicenseTextArea.getText().length() == 0) {
- JOptionPane.showMessageDialog(topFrame, "License is a required field.");
- return;
- }
- if (jLicenseTextArea.getText().equals(sfc.getSpdHdrLicense())) {
- return;
- }
- sfc.setSpdHdrLicense(jLicenseTextArea.getText());
- }
- });
- }
- return jLicenseTextArea;
- }
-
- /**
- This method initializes jDescriptionTextArea
-
- @return javax.swing.JTextArea jDescriptionTextArea
-
- **/
- private JTextArea getJDescriptionTextArea() {
- if (jDescriptionTextArea == null) {
- jDescriptionTextArea = new JTextArea();
- jDescriptionTextArea.setLineWrap(true);
- jDescriptionTextArea.getDocument().addDocumentListener(this);
- jDescriptionTextArea.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (jDescriptionTextArea.getText().length() == 0) {
- JOptionPane
- .showMessageDialog(topFrame,
- "Description is a required field, and should reflect the contents of the package.");
- return;
- }
- if (jDescriptionTextArea.getText().equals(sfc.getSpdHdrDescription())) {
- return;
- }
- sfc.setSpdHdrDescription(jDescriptionTextArea.getText());
- }
- });
- }
- return jDescriptionTextArea;
- }
-
- /**
- This method initializes jSpecificationTextField
-
- @return javax.swing.JTextField jSpecificationTextField
-
- **/
- private JTextField getJSpecificationTextField() {
- if (jSpecificationTextField == null) {
- jSpecificationTextField = new JTextField();
- jSpecificationTextField.setBounds(new java.awt.Rectangle(labelColumn, dialogHeight - 40, specWidth, oneRowHeight));
- jSpecificationTextField.setEditable(false);
- jSpecificationTextField.setPreferredSize(new java.awt.Dimension(specWidth, oneRowHeight));
- jSpecificationTextField.setLocation(new java.awt.Point(2, dialogHeight - oneRowHeight));
- jSpecificationTextField.setBorder(null);
-
- // jSpecificationTextField.addFocusListener(new FocusAdapter(){
- // public void focusLost(FocusEvent e){
- // sfc.setSpdHdrSpec(jSpecificationTextField.getText());
- // }
- // });
- }
- return jSpecificationTextField;
- }
-
- /**
- This method initializes jLicenseScrollPane
-
- @return javax.swing.JScrollPane jLicenseScrollPane
-
- **/
- private JScrollPane getJLicenseScrollPane() {
- if (jLicenseScrollPane == null) {
- jLicenseScrollPane = new JScrollPane();
- jLicenseScrollPane.setBounds(new java.awt.Rectangle(valueColumn, rowFive, valueWidth, fourRowHeight));
- jLicenseScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jLicenseScrollPane.setPreferredSize(new java.awt.Dimension(valueWidth, fourRowHeight));
- jLicenseScrollPane.setViewportView(getJLicenseTextArea());
- }
- return jLicenseScrollPane;
- }
-
- /**
- This method initializes jDescriptionScrollPane
-
- @return javax.swing.JScrollPane jDescriptionScrollPane
-
- **/
- private JScrollPane getJDescriptionScrollPane() {
- if (jDescriptionScrollPane == null) {
- jDescriptionScrollPane = new JScrollPane();
- jDescriptionScrollPane.setBounds(new java.awt.Rectangle(valueColumn, rowEight, valueWidth, fourRowHeight));
- jDescriptionScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jDescriptionScrollPane.setPreferredSize(new java.awt.Dimension(valueWidth, fourRowHeight));
- jDescriptionScrollPane.setViewportView(getJDescriptionTextArea());
- }
- return jDescriptionScrollPane;
- }
-
- /**
- This method initializes jAbstractTextField
-
- @return javax.swing.JTextField jAbstractTextField
-
- **/
- private JTextField getJAbstractTextField() {
- if (jAbstractTextField == null) {
- jAbstractTextField = new JTextField();
- jAbstractTextField.setBounds(new java.awt.Rectangle(valueColumn, rowSeven, valueWidth, oneRowHeight));
- jAbstractTextField.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jAbstractTextField.getDocument().addDocumentListener(this);
- jAbstractTextField.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isAbstract(jAbstractTextField.getText())) {
- JOptionPane.showMessageDialog(topFrame, "Abstract could NOT be empty.");
- return;
- }
- if (jAbstractTextField.getText().equals(sfc.getSpdHdrAbs())) {
- return;
- }
- sfc.setSpdHdrAbs(jAbstractTextField.getText());
- }
- });
- }
- return jAbstractTextField;
- }
-
- private JScrollPane getCopyrightScrollPane() {
- if (jCopyrightScrollPane == null) {
- jCopyrightScrollPane = new JScrollPane();
- jCopyrightScrollPane.setBounds(new java.awt.Rectangle(valueColumn, rowFour, valueWidth, threeRowHeight));
- jCopyrightScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jCopyrightScrollPane.setPreferredSize(new java.awt.Dimension(valueWidth, threeRowHeight));
- jCopyrightScrollPane.setViewportView(getJCopyrightTextArea());
- }
- return jCopyrightScrollPane;
- }
- /**
- This method initializes jTextFieldCopyright
-
- @return javax.swing.JTextField jTextFieldCopyright
-
- **/
- private JTextArea getJCopyrightTextArea() {
- if (jCopyrightTextArea == null) {
- jCopyrightTextArea = new JTextArea();
- jCopyrightTextArea.setWrapStyleWord(true);
- jCopyrightTextArea.setLineWrap(true);
- jCopyrightTextArea.getDocument().addDocumentListener(this);
- jCopyrightTextArea.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isCopyright(jCopyrightTextArea.getText())) {
- JOptionPane.showMessageDialog(topFrame, "Copyright must be entered.");
- return;
- }
- if (jCopyrightTextArea.getText().equals(sfc.getSpdHdrCopyright())) {
- return;
- }
- sfc.setSpdHdrCopyright(jCopyrightTextArea.getText());
- }
- });
- }
- return jCopyrightTextArea;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJUrlTextField() {
- if (jUrlTextField == null) {
- jUrlTextField = new JTextField();
- jUrlTextField.setBounds(new java.awt.Rectangle(valueColumn, rowSix, valueWidth, oneRowHeight));
- jUrlTextField.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jUrlTextField.getDocument().addDocumentListener(this);
- jUrlTextField.addFocusListener(new FocusAdapter() {
- public void focusLost(FocusEvent e) {
- if (jUrlTextField.getText().length() == 0 && sfc.getSpdHdrUrl() == null) {
- return;
- }
- if (jUrlTextField.getText().equals(sfc.getSpdHdrUrl())) {
- return;
- }
- sfc.setSpdHdrLicense(jLicenseTextArea.getText());
- sfc.setSpdHdrUrl(jUrlTextField.getText());
- }
- });
- }
- return jUrlTextField;
- }
-
- /**
- * This method initializes jCheckBoxRdOnly
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxRdOnly() {
- if (jCheckBoxRdOnly == null) {
- jCheckBoxRdOnly = new JCheckBox();
- jCheckBoxRdOnly.setText("Read Only");
- jCheckBoxRdOnly.setLocation(new java.awt.Point(labelColumn, rowNine));
- jCheckBoxRdOnly.setSize(new java.awt.Dimension(labelWidth, oneRowHeight));
- jCheckBoxRdOnly.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- sfc.setSpdPkgDefsRdOnly(jCheckBoxRdOnly.isSelected()+"");
- initFrame();
- }
- });
- }
- return jCheckBoxRdOnly;
- }
-
- /**
- * This method initializes jCheckBoxRePkg
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxRePkg() {
- if (jCheckBoxRePkg == null) {
- jCheckBoxRePkg = new JCheckBox();
- jCheckBoxRePkg.setLocation(new java.awt.Point(labelColumn, rowTen));
- jCheckBoxRePkg.setText("RePackagable");
- jCheckBoxRePkg.setSize(new java.awt.Dimension(labelWidth, oneRowHeight));
- jCheckBoxRePkg.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- sfc.setSpdPkgDefsRePkg(jCheckBoxRePkg.isSelected()+"");
- }
- });
- }
- return jCheckBoxRePkg;
- }
-
- public static void main(String[] args) {
- new SpdHeader().setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public SpdHeader() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inspdHeader The input data of spdHeaderDocument.spdHeader
-
- **/
- public SpdHeader(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa) {
- this();
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdHeader(OpeningPackageType opt) {
- this(opt.getXmlSpd());
- docConsole = opt;
- initFrame();
- topFrame = this;
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- this.setContentPane(getTopScrollPane());
- this.setTitle("Package Surface Area Header");
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inspdHeader The input data of spdHeaderDocument.spdHeader
-
- **/
- private void init(SpdFileContents sfc) {
- if (sfc.getSpdHdrPkgName() != null) {
- jPackageNameTextField.setText(sfc.getSpdHdrPkgName());
- }
- if (sfc.getSpdHdrGuidValue() != null) {
- jGuidTextField.setText(sfc.getSpdHdrGuidValue());
- }
- if (sfc.getSpdHdrVer() != null) {
- jVersionTextField.setText(sfc.getSpdHdrVer());
- }
- if (sfc.getSpdHdrLicense() != null) {
- jLicenseTextArea.setText(sfc.getSpdHdrLicense());
- }
- if (sfc.getSpdHdrUrl() != null) {
- jUrlTextField.setText(sfc.getSpdHdrUrl());
- }
- if (sfc.getSpdHdrCopyright() != null) {
- jCopyrightTextArea.setText(sfc.getSpdHdrCopyright());
- }
- if (sfc.getSpdHdrAbs() != null) {
- jAbstractTextField.setText(sfc.getSpdHdrAbs());
- }
- if (sfc.getSpdHdrDescription() != null) {
- jDescriptionTextArea.setText(sfc.getSpdHdrDescription());
- }
- if (sfc.getSpdHdrSpec() != null) {
- jSpecificationTextField.setText(sfc.getSpdHdrSpec());
- }
- sfc.setSpdHdrSpec(jSpecificationTextField.getText());
-
- if (!sfc.getSpdPkgDefsRdOnly().equals("true")) {
- sfc.setSpdPkgDefsRdOnly("false");
- jCheckBoxRdOnly.setSelected(false);
- } else {
- jCheckBoxRdOnly.setSelected(true);
- }
- if (!sfc.getSpdPkgDefsRePkg().equals("true")) {
- sfc.setSpdPkgDefsRePkg("false");
- jCheckBoxRePkg.setSelected(false);
- } else {
- jCheckBoxRePkg.setSelected(true);
- }
-
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(2, rowOne));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2, rowTwo));
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(2, rowThree));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(2, rowFour));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(2, rowFive));
- jStarLabel6 = new StarLabel();
- jStarLabel6.setLocation(new java.awt.Point(2, rowSeven));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(2, rowEight));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(2, rowNine));
- jStarLabel8.setVisible(false);
- jStarLabel9 = new StarLabel();
- jStarLabel9.setLocation(new java.awt.Point(2, rowTen));
-
- jStarLabel9.setVisible(false);
- jPackageNameLabel = new JLabel();
- jPackageNameLabel.setText("Package Name");
- jPackageNameLabel.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
- jGuidLabel = new JLabel();
- jGuidLabel.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
- jGuidLabel.setText("Guid");
- jVersionLabel = new JLabel();
- jVersionLabel.setText("Version");
- jVersionLabel.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setBounds(new java.awt.Rectangle(labelColumn, rowFour, labelWidth, oneRowHeight));
- jLicenseLabel = new JLabel();
- jLicenseLabel.setText("License");
- jLicenseLabel.setBounds(new java.awt.Rectangle(labelColumn, rowFive, labelWidth, oneRowHeight));
- jUrlLabel = new JLabel();
- jUrlLabel.setBounds(new java.awt.Rectangle(labelColumn, rowSix, labelWidth, oneRowHeight));
- jUrlLabel.setText("URL");
- jAbstractLabel = new JLabel();
- jAbstractLabel.setBounds(new java.awt.Rectangle(labelColumn, rowSeven, labelWidth, oneRowHeight));
- jAbstractLabel.setText("Abstract");
- jDescriptionLabel = new JLabel();
- jDescriptionLabel.setText("Description");
- jDescriptionLabel.setBounds(new java.awt.Rectangle(labelColumn, rowEight, labelWidth, oneRowHeight));
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setLocation(new java.awt.Point(0, 0));
- jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 20, dialogHeight - 20));
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel6, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(jStarLabel9, null);
-
- jContentPane.add(jPackageNameLabel, null);
- jContentPane.add(getJPackageNameTextField(), null);
- jContentPane.add(jGuidLabel, null);
- jContentPane.add(getJGuidTextField(), null);
- jContentPane.add(jVersionLabel, null);
- jContentPane.add(getJVersionTextField(), null);
- jContentPane.add(getJGenerateGuidButton(), null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(getCopyrightScrollPane(), null);
- jContentPane.add(jLicenseLabel, null);
- jContentPane.add(getJLicenseScrollPane(), null);
- jContentPane.add(jUrlLabel, null);
- jContentPane.add(getJUrlTextField(), null);
- jContentPane.add(jAbstractLabel, null);
- jContentPane.add(getJAbstractTextField(), null);
- jContentPane.add(jDescriptionLabel, null);
- jContentPane.add(getJDescriptionScrollPane(), null);
-
-// jContentPane.add(getJButtonOk(), null);
-// jContentPane.add(getJButtonCancel(), null);
-
- jContentPane.add(getJCheckBoxRdOnly(), null);
- jContentPane.add(getJCheckBoxRePkg(), null);
- jContentPane.add(getJSpecificationTextField(), null);
-
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jGenerateGuidButton) {
- //ToDo: invoke GuidValueEditor
- jGuidTextField.setText(Tools.generateUuidString());
- sfc.setSpdHdrGuidValue(jGuidTextField.getText());
- }
- }
-
- /**
- This method initializes Package type and Compontent type
-
- **/
- private void initFrame() {
- boolean editable = true;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
- jPackageNameTextField.setEditable(editable);
- jGuidTextField.setEditable(editable);
- jGenerateGuidButton.setEnabled(editable);
- jVersionTextField.setEditable(editable);
- jCopyrightTextArea.setEditable(editable);
- jLicenseTextArea.setEditable(editable);
- jUrlTextField.setEditable(editable);
- jAbstractTextField.setEditable(editable);
- jDescriptionTextArea.setEditable(editable);
- jCheckBoxRePkg.setEnabled(editable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = dialogWidth;
- int intCurrentWidth = this.getJContentPane().getWidth();
-
-// Tools.resizeComponentWidth(this.jPackageNameTextField, intCurrentWidth, intPreferredWidth);
-// Tools.resizeComponentWidth(this.jGuidTextField, intCurrentWidth, intPreferredWidth);
-// Tools.resizeComponentWidth(this.jVersionTextField, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jUrlTextField, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jLicenseScrollPane, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jCopyrightTextArea, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jDescriptionScrollPane, intCurrentWidth, intPreferredWidth);
- // Tools.resizeComponentWidth(this.jSpecificationTextField, intCurrentWidth,intPreferredWidth);
- Tools.resizeComponentWidth(this.jAbstractTextField, intCurrentWidth, intPreferredWidth);
-// Tools.relocateComponentX(this.jGenerateGuidButton, intCurrentWidth, jGenerateGuidButton.getWidth(), 30);
- }
-
- private JScrollPane getTopScrollPane() {
- if (topScrollPane == null) {
- topScrollPane = new JScrollPane();
- topScrollPane.setViewportView(getJContentPane());
- }
- return topScrollPane;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
- */
- public void changedUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
- */
- public void insertUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
- */
- public void removeUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
deleted file mode 100644
index 9aac2464c9..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdLibClassDecls.java
+++ /dev/null
@@ -1,931 +0,0 @@
-/** @file
- Java class SpdLibClassDecls is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.io.File;
-import java.util.HashMap;
-//import java.util.Iterator;
-//import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.AbstractAction;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JTextArea;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.DataValidation;
-//import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.platform.ui.ListEditor;
-import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;
-//import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
-//import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-
-
-/**
- GUI for create library definition elements of spd file.
-
- @since PackageEditor 1.0
-**/
-public class SpdLibClassDecls extends IInternalFrame implements TableModelListener{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JFrame topFrame;
-
- private JTable jTable = null;
-
- private DefaultTableModel model = null;
-
- private JPanel jContentPane = null;
-
- private JTextField jTextFieldAddClass = null;
-
- private JComboBox jComboBoxSelect = null;
-
- private JScrollPane jScrollPaneTable = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonRemoveAll = null;
-
- private JLabel jLabelHdr = null;
-
- private JTextField jTextFieldHdr = null;
-
- private JButton jButtonBrowse = null;
-
- private StarLabel starLabel1 = null;
-
- private StarLabel starLabel3 = null;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private JLabel jLabel1ClassName = null;
-
- private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="10,53"
-
- private int selectedRow = -1;
-
- private StarLabel starLabel2 = null;
-
- private JLabel jLabel2HelpText = null;
-
- private JTextArea jTextAreaHelp = null;
-
- private JScrollPane jHelpTextScrollPane = null;
-
- private JLabel jLabel5SupArchList = null;
-
- private JLabel jLabel6SupModList = null;
-
- private JScrollPane jScrollPaneModules = null;
-
- private JScrollPane jScrollPane1Arch = null;
-
- private ICheckBoxList iCheckBoxListModules = null;
-
- private ICheckBoxList iCheckBoxListArch = null;
-
- private int cnClassName = 0;
- private int cnHdrFile = 1;
- private int cnHelpText = 2;
-// private int cnRecInstName = 3;
-// private int cnRecInstVer = 4;
- private int cnSupArch = 5;
- private int cnSupMod = 6;
-
- private final int classNameMinWidth = 200;
- private final int hdrFileMinWidth = 300;
- private final int helpTextMinWidth = 300;
- private final int supArchMinWidth = 200;
- private final int supModMinWidth = 200;
-
- private final int shortLabel = 90;
- private final int longLabel = 220;
- private final int labelCol = 12;
- private final int shortValueCol = labelCol + shortLabel + 6;
- private final int longValueCol = labelCol + longLabel + 6;
- private final int longValueWidth = 347;
- private final int shortWidth = 140;
- private final int medWidth = 240;
-
- private final int buttonWidth = 99;
-
- private final int addButtonCol = shortValueCol + 10;
- private final int removeButtonCol = addButtonCol + buttonWidth + 10;
- private final int removeAllButtonCol = removeButtonCol + buttonWidth + 10;
-
- private final int rowOne = 12;
- private final int rowTwo = rowOne + 25;
- private final int rowThree = rowTwo + 60 + 25;
- private final int rowFour = rowThree + 25;
- private final int rowFive = rowFour + 40 + 25;
- private final int rowSix = rowFive + 40 + 25;
- private final int rowSeven = rowSix;
- private final int rowEight = rowSeven + 30;
-
- HashMap<String, String> libNameGuidMap = new HashMap<String, String>();
-
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
-
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- }
-
- /**
- This method initializes jTextFieldAddClass
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextFieldAddClass() {
- if (jTextFieldAddClass == null) {
- jTextFieldAddClass = new JTextField();
- jTextFieldAddClass.setBounds(new java.awt.Rectangle(shortValueCol,rowOne,longValueWidth,20));
- jTextFieldAddClass.setPreferredSize(new java.awt.Dimension(longValueWidth,20));
- jTextFieldAddClass.setEnabled(true);
- }
- return jTextFieldAddClass;
- }
-
- /**
- This method initializes jComboBoxSelect
-
- @return javax.swing.JComboBox
- **/
- private JComboBox getJComboBoxSelect() {
- if (jComboBoxSelect == null) {
- jComboBoxSelect = new JComboBox();
- jComboBoxSelect.setBounds(new java.awt.Rectangle(220, 10, 260, 20));
- jComboBoxSelect.setPreferredSize(new java.awt.Dimension(260,22));
- jComboBoxSelect.setEnabled(true);
- jComboBoxSelect.setVisible(false);
- }
- return jComboBoxSelect;
- }
-
- /**
- This method initializes jScrollPaneTable
-
- @return javax.swing.JScrollPane
-
- Used for the Table of Library Classes that are provided by this package
-
- **/
- private JScrollPane getJScrollPaneTable() {
- if (jScrollPaneTable == null) {
- jScrollPaneTable = new JScrollPane();
- jScrollPaneTable.setBounds(new java.awt.Rectangle(labelCol,rowEight,400,253));
- jScrollPaneTable.setViewportView(getJTable());
- }
- return jScrollPaneTable;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- model = new DefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- jTable.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
- jTable.setColumnSelectionAllowed(false);
- model.addColumn("Class Name");
- model.addColumn("Header");
- model.addColumn("Help Text");
- model.addColumn("Recommended Instance");
- model.addColumn("Version");
- model.addColumn("Supported Architectures");
- model.addColumn("Supported Module Types");
-
- jTable.getColumnModel().getColumn(cnHelpText).setCellEditor(new LongTextEditor(topFrame));
-
- jTable.removeColumn(jTable.getColumnModel().getColumn(3));
- jTable.removeColumn(jTable.getColumnModel().getColumn(3));
-
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTable.getColumnModel().getColumn(cnSupArch - 2).setCellEditor(new ListEditor(vArch, topFrame));
-
- Vector<String> vModule = new Vector<String>();
- vModule.add("BASE");
- vModule.add("SEC");
- vModule.add("PEI_CORE");
- vModule.add("PEIM");
- vModule.add("DXE_CORE");
- vModule.add("DXE_DRIVER");
- vModule.add("DXE_RUNTIME_DRIVER");
- vModule.add("DXE_SAL_DRIVER");
- vModule.add("DXE_SMM_DRIVER");
- vModule.add("UEFI_DRIVER");
- vModule.add("UEFI_APPLICATION");
- vModule.add("USER_DEFINED");
-
- jTable.getColumnModel().getColumn(cnSupMod - 2).setCellEditor(new ListEditor(vModule, topFrame));
-
- TableColumn column = jTable.getColumnModel().getColumn(this.cnClassName);
- column.setMinWidth(this.classNameMinWidth);
- column = jTable.getColumnModel().getColumn(this.cnHdrFile);
- column.setMinWidth(this.hdrFileMinWidth);
- column = jTable.getColumnModel().getColumn(this.cnHelpText);
- column.setMinWidth(this.helpTextMinWidth);
- column = jTable.getColumnModel().getColumn(this.cnSupArch - 2);
- column.setMinWidth(this.supArchMinWidth);
- column = jTable.getColumnModel().getColumn(this.cnSupMod - 2);
- column.setMinWidth(this.supModMinWidth);
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTable.getModel().addTableModelListener(this);
-
- }
- return jTable;
- }
-
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
-
- String lib = m.getValueAt(row, cnClassName) + "";
- String hdr = m.getValueAt(row, cnHdrFile) + "";
- String hlp = m.getValueAt(row, cnHelpText) + "";
- String name = null;
-// if (m.getValueAt(row, cnRecInstName) != null) {
-// name = m.getValueAt(row, cnRecInstName).toString();
-// }
-// String ver = null;
-// if (m.getValueAt(row, cnRecInstVer) != null){
-// ver = m.getValueAt(row, cnRecInstVer).toString();
-// }
- String arch = null;
- if (m.getValueAt(row, cnSupArch) != null) {
- arch = m.getValueAt(row, cnSupArch).toString();
- }
- String module = null;
- if (m.getValueAt(row, cnSupMod) != null) {
- module = m.getValueAt(row, cnSupMod).toString();
- }
- String[] rowData = {lib, hdr, hlp, name};
- if (!dataValidation(rowData)) {
- return;
- }
-
- String guid = null;
-// if (name != null && name.length() > 0) {
-// getLibInstances(lib);
-// guid = nameToGuid(name);
-// if (guid == null){
-// JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist.");
-// return;
-// }
-// }
-
- String[] sa = new String[7];
- sfc.getSpdLibClassDeclaration(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
-// if (column == cnRecInstName) {
-// if (guid == null) {
-// if (sa[cnRecInstName] == null) {
-// return;
-// }
-// }
-// else {
-// if (guid.equals(sa[cnRecInstName])) {
-// return;
-// }
-// }
-// }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdLibClass(row, lib, hdr, hlp, guid, null, arch, module);
- }
- }
-
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setText("Add");
- jButtonAdd.setSize(new java.awt.Dimension(buttonWidth,20));
- jButtonAdd.setBounds(new java.awt.Rectangle(addButtonCol,rowSeven,buttonWidth,20));
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setText("Delete");
- jButtonRemove.setSize(new java.awt.Dimension(buttonWidth,20));
- jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowSeven,buttonWidth,20));
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonRemoveAll
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonRemoveAll() {
- if (jButtonRemoveAll == null) {
- jButtonRemoveAll = new JButton();
- jButtonRemoveAll.setText("Clear All");
- jButtonRemoveAll.setLocation(removeAllButtonCol,rowSeven);
- FontMetrics fm = jButtonRemoveAll.getFontMetrics(jButtonRemoveAll.getFont());
- jButtonRemoveAll.setSize(fm.stringWidth(jButtonRemoveAll.getText()) + 50, 20);
- jButtonRemoveAll.addActionListener(this);
- }
- return jButtonRemoveAll;
- }
-
- /**
- This is the default constructor
- **/
- public SpdLibClassDecls(JFrame frame) {
- super();
- topFrame = frame;
- initialize();
- init();
-
- }
-
- public SpdLibClassDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame){
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdLibClassDecls(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- }
- /**
- This method initializes this
-
- @return void
- **/
- private void init() {
-
- this.setContentPane(getJContentPane());
- this.setTitle("Library Class Declarations");
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setVisible(true);
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- }
- });
- }
-
- private void init(SpdFileContents sfc) {
-
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(topFrame, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
-
- if (sfc.getSpdLibClassDeclarationCount() == 0) {
- return ;
- }
- //
- // initialize table using SpdFileContents object
- //
- String[][] saa = new String[sfc.getSpdLibClassDeclarationCount()][7];
- sfc.getSpdLibClassDeclarations(saa);
- int i = 0;
- while (i < saa.length) {
-// if (saa[i][3] != null && saa[i][3].length() > 0) {
-// getLibInstances(saa[i][0]);
-// saa[i][3] = guidToName(saa[i][3]);
-// }
-
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- private void initFrame() {
- boolean editable = true;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
-
- jButtonAdd.setEnabled(editable);
- jButtonRemove.setEnabled(editable);
- jButtonRemoveAll.setEnabled(editable);
- jTable.setEnabled(editable);
- }
-
- private JScrollPane getJContentPane(){
- if (topScrollPane == null){
- topScrollPane = new JScrollPane();
- topScrollPane.setViewportView(getJContentPane1());
- }
- return topScrollPane;
- }
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
- **/
- private JPanel getJContentPane1() {
- if (jContentPane == null) {
- // Library Class
- starLabel1 = new StarLabel();
- starLabel1.setLocation(new java.awt.Point(1,rowOne));
- jLabel1ClassName = new JLabel();
- jLabel1ClassName.setBounds(new java.awt.Rectangle(labelCol,rowOne,shortLabel,20));
- jLabel1ClassName.setText("Library Class");
-
- // Help Text
- starLabel2 = new StarLabel();
- starLabel2.setBounds(new java.awt.Rectangle(1,rowTwo,10,20));
- jLabel2HelpText = new JLabel();
- jLabel2HelpText.setBounds(new java.awt.Rectangle(labelCol,rowTwo,shortLabel,20));
- jLabel2HelpText.setText("Help Text");
-
- // Header File
- starLabel3 = new StarLabel();
- starLabel3.setLocation(new java.awt.Point(1,rowThree));
- jLabelHdr = new JLabel();
- jLabelHdr.setBounds(new java.awt.Rectangle(labelCol,rowThree,longLabel,20));
- jLabelHdr.setText("Include Header for Specified Class");
-
- jLabel6SupModList = new JLabel();
- jLabel6SupModList.setBounds(new java.awt.Rectangle(labelCol,rowFive,longLabel,20));
- jLabel6SupModList.setText("Supported Module Types");
- jLabel6SupModList.setEnabled(true);
-
- jLabel5SupArchList = new JLabel();
- jLabel5SupArchList.setBounds(new java.awt.Rectangle(labelCol,rowFour,longLabel,20));
- jLabel5SupArchList.setText("Supported Architectures");
- jLabel5SupArchList.setEnabled(true);
-
- jContentPane = new JPanel();
- jContentPane.setPreferredSize(new Dimension(680, 600));
- jContentPane.setLayout(null);
- jContentPane.add(jLabelHdr, null);
- jContentPane.add(starLabel1, null);
- jContentPane.add(starLabel3, null);
- jContentPane.add(getJTextFieldAddClass(), null);
- jContentPane.add(getJComboBoxSelect(), null);
- jContentPane.add(getJScrollPaneTable(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonRemoveAll(), null);
-
- jContentPane.add(getJTextFieldHdr(), null);
- jContentPane.add(getJButtonBrowse(), null);
- jContentPane.add(jLabel1ClassName, null);
- jContentPane.add(starLabel2, null);
- jContentPane.add(jLabel2HelpText, null);
- jContentPane.add(getJHelpTextScrollPane(), null);
-
- jContentPane.add(jLabel5SupArchList, null);
- jContentPane.add(jLabel6SupModList, null);
-
- jContentPane.add(getJScrollPaneModules(), null);
- jContentPane.add(getJScrollPane1Arch(), null);
-
- }
-
- return jContentPane;
- }
-
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonAdd) {
-
- //ToDo: check before add
- // LAH WAS String[] row = {null, null, null, jComboBox.getSelectedItem()+"", jTextField2RecInstVer.getText(), null, null};
- String[] row = {null, null, null, null, null, null, null};
- row[cnClassName] = jTextFieldAddClass.getText();
- row[cnHdrFile] = jTextFieldHdr.getText().replace('\\', '/');
- row[cnHelpText] = jTextAreaHelp.getText();
-// row[cnRecInstName] = jComboBox.getSelectedItem()+"";
-// row[cnRecInstVer] = jTextField2RecInstVer.getText();
- row[cnSupArch] = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());
- if (row[cnSupArch].length() == 0) {
- row[cnSupArch] = null;
- }
- row[cnSupMod] = vectorToString(iCheckBoxListModules.getAllCheckedItemsString());
- if (row[cnSupMod].length() == 0){
- row[cnSupMod] = null;
- }
- if (!dataValidation(row)) {
- return;
- }
- //
- //convert to GUID before storing recommended lib instance.
- //
-// getLibInstances(row[cnClassName]);
-// String recommendGuid = nameToGuid(row[cnRecInstName]);
-// if (row[cnRecInstName].equals("null")) {
-// row[cnRecInstName] = null;
-// }
-// else{
-// if (recommendGuid == null) {
-// JOptionPane.showMessageDialog(frame, "Recommended Instance does not exist.");
-// return;
-// }
-// }
-
- sfc.genSpdLibClassDeclarations(row[cnClassName], null, row[cnHdrFile], row[cnHelpText], row[cnSupArch], null, null, null, null, row[cnSupMod]);
- model.addRow(row);
- jTable.changeSelection(model.getRowCount()-1, 0, false, false);
- docConsole.setSaved(false);
- }
- //
- // remove selected line
- //
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()){
- jTable.getCellEditor().stopCellEditing();
- }
- int rowSelected = selectedRow;
- if (rowSelected >= 0) {
- model.removeRow(rowSelected);
- docConsole.setSaved(false);
- sfc.removeSpdLibClass(rowSelected);
- }
- }
-
- if (arg0.getSource() == jButtonRemoveAll) {
- if (model.getRowCount() == 0) {
- return;
- }
- docConsole.setSaved(false);
- model.setRowCount(0);
- sfc.removeSpdLibClass();
- }
- }
-
- private boolean dataValidation(String[] row) {
- if (!DataValidation.isKeywordType(row[cnClassName])) {
- JOptionPane.showMessageDialog(this, "Library Class name entered does not match KeyWord datatype.");
- return false;
- }
- if (!DataValidation.isPathAndFilename(row[cnHdrFile])) {
- JOptionPane.showMessageDialog(this, "Include Header does not match the PathAndFilename datatype.");
- return false;
- }
- if (row[cnHelpText].length() == 0) {
- JOptionPane.showMessageDialog(this, "Help Text must be entered!");
- return false;
- }
-// if (row[cnRecInstVer] != null && row[cnRecInstVer].length() > 0) {
-// if (row[cnRecInstName] == null || row[cnRecInstName].length() == 0) {
-// JOptionPane.showMessageDialog(frame, "Recommended Instance Version must associate with the Instance Name.");
-// return false;
-// }
-//
-// if (!DataValidation.isVersionDataType(row[cnRecInstVer])) {
-// JOptionPane.showMessageDialog(frame, "Recommended Instance Version does not match Version datatype.");
-// return false;
-// }
-// }
- return true;
- }
- /**
- Add contents in list to sfc
- **/
- protected void save() {
-
- }
-
- /**
- This method initializes jTextField
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextFieldHdr() {
- if (jTextFieldHdr == null) {
- jTextFieldHdr = new JTextField();
- jTextFieldHdr.setPreferredSize(new java.awt.Dimension(shortWidth,20));
- jTextFieldHdr.setLocation(new java.awt.Point(longValueCol,rowThree));
- jTextFieldHdr.setSize(new java.awt.Dimension(shortWidth,20));
- }
- return jTextFieldHdr;
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(longValueCol + shortWidth + 7,rowThree,90,20));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.setPreferredSize(new java.awt.Dimension(99,20));
- jButtonBrowse.addActionListener(new AbstractAction() {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- //
- // Select files from current pkg
- //
- String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator));
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- int retval = chooser.showOpenDialog(topFrame);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(topFrame, "You can only select files in current package directory structure!");
- return;
- }
-
-
- }
- else {
- return;
- }
-
- headerDest = theFile.getPath();
- int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length());
- jTextFieldHdr.setText(headerDest.substring(fileIndex + 1).replace('\\', '/'));
-
- }
-
- });
- }
- return jButtonBrowse;
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- Tools.resizeComponentWidth(this.jTextFieldAddClass, this.getWidth(), intPreferredWidth-28);
- Tools.resizeComponentWidth(this.jHelpTextScrollPane, this.getWidth(), intPreferredWidth-28);
- Tools.resizeComponentWidth(this.jScrollPaneTable, this.getWidth(), intPreferredWidth-10);
- Tools.resizeComponentWidth(this.jTextFieldHdr, this.getWidth(), intPreferredWidth - 7);
- Tools.relocateComponentX(this.jButtonBrowse, this.getWidth(), intPreferredWidth,
- DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
- }
-
- /**
- * This method initializes jHelpTextScrollPane
- *
- * @return javax.swing.JScrollPane jHelpTextScrollPane
- */
- private JScrollPane getJHelpTextScrollPane() {
- if (jHelpTextScrollPane == null) {
- jHelpTextScrollPane = new JScrollPane();
- jHelpTextScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jHelpTextScrollPane.setPreferredSize(new java.awt.Dimension(longValueWidth, 80));
- jHelpTextScrollPane.setSize(new java.awt.Dimension(longValueWidth, 80));
- jHelpTextScrollPane.setLocation(new java.awt.Point(shortValueCol,rowTwo));
- jHelpTextScrollPane.setViewportView(getJTextAreaHelp());
- }
- return jHelpTextScrollPane;
- }
-
- /**
- * This method initializes jTextAreaHelp
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaHelp() {
- if (jTextAreaHelp == null) {
- jTextAreaHelp = new JTextArea();
- jTextAreaHelp.setLineWrap(true);
- jTextAreaHelp.setWrapStyleWord(true);
- }
- return jTextAreaHelp;
- }
-
- private JScrollPane getJScrollPaneModules() {
- if (jScrollPaneModules == null) {
- jScrollPaneModules = new JScrollPane();
- jScrollPaneModules.setBounds(new java.awt.Rectangle(longValueCol,rowFive,medWidth,60));
- jScrollPaneModules.setPreferredSize(new java.awt.Dimension(medWidth, 60));
- jScrollPaneModules.setViewportView(getICheckBoxListSupportedModules());
- }
- return jScrollPaneModules;
- }
-
- private ICheckBoxList getICheckBoxListSupportedModules() {
- if (iCheckBoxListModules == null) {
- iCheckBoxListModules = new ICheckBoxList();
- iCheckBoxListModules.setBounds(new java.awt.Rectangle(longValueCol,rowFour,medWidth,60));
- Vector<String> v = new Vector<String>();
- v.add("BASE");
- v.add("SEC");
- v.add("PEI_CORE");
- v.add("PEIM");
- v.add("DXE_CORE");
- v.add("DXE_DRIVER");
- v.add("DXE_RUNTIME_DRIVER");
- v.add("DXE_SAL_DRIVER");
- v.add("DXE_SMM_DRIVER");
- v.add("UEFI_DRIVER");
- v.add("UEFI_APPLICATION");
- v.add("USER_DEFINED");
- iCheckBoxListModules.setAllItems(v);
- }
- return iCheckBoxListModules;
- }
-
- private String vectorToString(Vector<String> v) {
- String s = " ";
- for (int i = 0; i < v.size(); ++i) {
- s += v.get(i);
- s += " ";
- }
- return s.trim();
- }
-
- private JScrollPane getJScrollPane1Arch() {
- if (jScrollPane1Arch == null) {
- jScrollPane1Arch = new JScrollPane();
- jScrollPane1Arch.setBounds(new java.awt.Rectangle(longValueCol,rowFour,medWidth,60));
- jScrollPane1Arch.setPreferredSize(new java.awt.Dimension(medWidth, 60));
- jScrollPane1Arch.setViewportView(getICheckBoxListArch());
- }
- return jScrollPane1Arch;
- }
- /**
- * This method initializes iCheckBoxList
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListArch() {
- if (iCheckBoxListArch == null) {
- iCheckBoxListArch = new ICheckBoxList();
- iCheckBoxListArch.setBounds(new java.awt.Rectangle(longValueCol,rowFour,medWidth,60));
- Vector<String> v = new Vector<String>();
- v.add("IA32");
- v.add("X64");
- v.add("IPF");
- v.add("EBC");
- v.add("ARM");
- v.add("PPC");
- iCheckBoxListArch.setAllItems(v);
- }
- return iCheckBoxListArch;
- }
-
-// private void getLibInstances(String libClass){
-// libNameGuidMap.clear();
-// try {
-// Iterator ismi = GlobalData.vModuleList.iterator();
-// while (ismi.hasNext()) {
-// ModuleIdentification mi = (ModuleIdentification) ismi.next();
-//
-// Vector<String> classProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);
-// for (int i = 0; i < classProduced.size(); ++i) {
-// if (classProduced.get(i).equals(libClass)) {
-// libNameGuidMap.put(mi.getName(), mi.getGuid());
-// }
-// }
-// }
-//
-// }
-// catch(Exception e){
-// JOptionPane.showMessageDialog(frame, "Search Instances Failed.");
-// }
-//
-// }
-
-// private String nameToGuid(String name) {
-// String s = null;
-// if (!libNameGuidMap.containsKey(name)) {
-// return s;
-// }
-//
-// s = libNameGuidMap.get(name);
-// return s;
-// }
-
-// private String guidToName(String guid){
-// String s = "";
-// if (!libNameGuidMap.containsValue(guid)) {
-// return s;
-// }
-// Set<String> key = libNameGuidMap.keySet();
-// Iterator<String> is = key.iterator();
-// while(is.hasNext()) {
-// s = is.next();
-// if (libNameGuidMap.get(s).equals(guid)) {
-// break;
-// }
-// }
-// return s;
-// }
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java
deleted file mode 100644
index fb23e05659..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdMsaFiles.java
+++ /dev/null
@@ -1,517 +0,0 @@
-/** @file
- Java class SpdMsaFiles is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.io.File;
-
-import javax.swing.AbstractAction;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-
-/**
- GUI for create library definition elements of spd file.
-
- @since PackageEditor 1.0
-**/
-public class SpdMsaFiles extends IInternalFrame implements TableModelListener{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JFrame topFrame;
-
- private JScrollPane jScrollPane = null; // @jve:decl-index=0:visual-constraint="10,95"
-
- private JTable jTable = null;
-
- private DefaultTableModel model = null;
-
- private JPanel jContentPane = null;
-
- private JScrollPane jScrollPaneMsa = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonClearAll = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonOk = null;
-
- private JLabel jLabel = null;
-
- private JTextField jTextField = null;
-
- private JButton jButtonBrowse = null;
-
- private StarLabel jStarLabel2 = null;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private int selectedRow = -1;
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
-
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- }
-
- /**
- This method initializes jScrollPane
-
- @return javax.swing.JScrollPane
- **/
- private JScrollPane getJScrollPaneMsa() {
- if (jScrollPaneMsa == null) {
- jScrollPaneMsa = new JScrollPane();
- jScrollPaneMsa.setBounds(new java.awt.Rectangle(13,177,461,421));
- jScrollPaneMsa.setViewportView(getJTable());
- }
- return jScrollPaneMsa;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- **/
- private JTable getJTable() {
- if (jTable == null) {
- model = new DefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- model.addColumn("MsaFile");
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTable.getModel().addTableModelListener(this);
- }
- return jTable;
- }
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(163,148,90,20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(266,148,90,20));
- jButtonRemove.setText("Delete");
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonRemoveAll
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonClearAll() {
- if (jButtonClearAll == null) {
- jButtonClearAll = new JButton();
- jButtonClearAll.setBounds(new java.awt.Rectangle(374,148,90,20));
- jButtonClearAll.setText("Clear All");
- jButtonClearAll.addActionListener(this);
- }
- return jButtonClearAll;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setLocation(new java.awt.Point(390, 305));
- jButtonCancel.setText("Cancel");
- jButtonCancel.setSize(new java.awt.Dimension(90, 20));
- jButtonCancel.setVisible(false);
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jButton
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setSize(new java.awt.Dimension(90, 20));
- jButtonOk.setText("OK");
- jButtonOk.setLocation(new java.awt.Point(290, 305));
- jButtonOk.setVisible(false);
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This is the default constructor
- **/
- public SpdMsaFiles(JFrame frame) {
- super();
- initialize();
- init();
- topFrame = frame;
- }
-
- public SpdMsaFiles(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame){
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdMsaFiles(OpeningPackageType opt, JFrame frame){
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- }
- /**
- This method initializes this
-
- @return void
- **/
- private void init() {
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setPreferredSize(new Dimension(490, 400));
- this.setContentPane(getJScrollPane());
- this.setTitle("Msa Files");
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- }
- });
- this.setVisible(true);
- }
-
- private void init(SpdFileContents sfc){
-
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(topFrame, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
-
- if (sfc.getSpdMsaFileCount() == 0) {
- return ;
- }
- //
- // initialize table using SpdFileContents object
- //
- String[][] saa = new String[sfc.getSpdMsaFileCount()][4];
- sfc.getSpdMsaFiles(saa);
- int i = 0;
- while (i < saa.length) {
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- private JScrollPane getJScrollPane(){
- if (jScrollPane == null){
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(2,24));
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(17,24,111,22));
- jLabel.setText("Msa File ");
-
- jContentPane = new JPanel();
- jContentPane.setPreferredSize(new Dimension(480, 325));
- jContentPane.setLayout(null);
- jContentPane.add(jLabel, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(getJScrollPaneMsa(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonClearAll(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonOk(), null);
-
- jContentPane.add(getJTextField(), null);
- jContentPane.add(getJButtonBrowse(), null);
- }
- return jContentPane;
- }
-
- /**
- fill ComboBoxes with pre-defined contents
- **/
- private void initFrame() {
- boolean editable = true;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
-
- jButtonAdd.setEnabled(editable);
- jButtonRemove.setEnabled(editable);
- jButtonClearAll.setEnabled(editable);
- jTable.setEnabled(editable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonOk) {
- this.save();
- this.dispose();
-
- }
- if (arg0.getSource() == jButtonCancel) {
- this.dispose();
- }
-
- if (arg0.getSource() == jButtonAdd) {
- //ToDo: check before add
- String[] row = {jTextField.getText().replace('\\', '/')};
- if (jTextField.getText().length() == 0) {
- JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type.");
- return;
- }
-
- String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator));
- if (!new File(dirPrefix + File.separator + jTextField.getText()).exists()) {
- JOptionPane.showMessageDialog(this, "File NOT Exists in Current Package.");
- return;
- }
- model.addRow(row);
- jTable.changeSelection(model.getRowCount()-1, 0, false, false);
- sfc.genSpdMsaFiles(row[0], null, null, null);
- docConsole.setSaved(false);
- }
- //
- // remove selected line
- //
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()){
- jTable.getCellEditor().stopCellEditing();
- }
- int rowSelected = selectedRow;
- if (rowSelected >= 0) {
- model.removeRow(rowSelected);
- sfc.removeSpdMsaFile(rowSelected);
- docConsole.setSaved(false);
- }
- }
-
- if (arg0.getSource() == jButtonClearAll) {
- if (model.getRowCount() == 0) {
- return;
- }
- model.setRowCount(0);
- sfc.removeSpdMsaFile();
- docConsole.setSaved(false);
- }
-
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
- String[] sa = new String[1];
- sfc.getSpdMsaFile(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
- String file = m.getValueAt(row, 0) + "";
- if (file.length() == 0) {
- JOptionPane.showMessageDialog(this, "Msa File is NOT PathAndFilename type.");
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdMsaFile(row, file, null, null, null);
- }
- }
-
- /**
- Add contents in list to sfc
- **/
- protected void save() {
-
- }
-
- /**
- This method initializes jTextField
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextField() {
- if (jTextField == null) {
- jTextField = new JTextField();
- jTextField.setBounds(new java.awt.Rectangle(14,51,346,21));
- jTextField.setPreferredSize(new java.awt.Dimension(345,20));
- }
- return jTextField;
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(376,50,92,21));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.setPreferredSize(new java.awt.Dimension(90,20));
- jButtonBrowse.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- //
- // Select files from current workspace
- //
- String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator));
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- int retval = chooser.showOpenDialog(SpdMsaFiles.this);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(SpdMsaFiles.this, "You can only select files in current package!");
- return;
- }
-
-
- }
- else {
- return;
- }
-
- headerDest = theFile.getPath();
- int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length());
-
- jTextField.setText(headerDest.substring(fileIndex + 1).replace('\\', '/'));
-
- }
- });
- }
- return jButtonBrowse;
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- Tools.resizeComponentWidth(this.jScrollPaneMsa, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);
- Tools.relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 25);
- }
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java
deleted file mode 100644
index 1c1d13a245..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPackageHeaders.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/** @file
- Java class SpdPackageHeaders is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.io.File;
-
-import javax.swing.DefaultCellEditor;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JTable;
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-
-/**
- GUI for create library definition elements of spd file.
-
- @since PackageEditor 1.0
-**/
-public class SpdPackageHeaders extends IInternalFrame implements TableModelListener{
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JFrame topFrame;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private DefaultTableModel model = null;
-
- private JPanel jContentPane = null;
-
- private JLabel jLabelSelect = null;
-
- private JComboBox jComboBoxSelect = null;
-
- private JButton jButtonAdd = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonClearAll = null;
-
- private JLabel jLabel = null;
-
- private JTextField jTextField = null;
-
- private JButton jButtonBrowse = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private JScrollPane jScrollPane = null;
-
- private JScrollPane jScrollPanePkgHdr = null;
-
- private int selectedRow = -1;
-
- private JTable jTable = null;
-
- private final int buttonWidth = 100;
- private final int buttonSep = 6;
- private final int addButtonCol = 148;
- private final int removeButtonCol = addButtonCol + buttonWidth + buttonSep;
- private final int removeAllButtonCol = removeButtonCol + buttonWidth + buttonSep;
- private final int labelCol = 12;
- private final int valueCol = 168;
- private final int rowOne = 12;
- private final int rowTwo = rowOne + 25;
- private final int rowThree = rowTwo + 25;
- private final int rowFour = rowThree + 30;
- private final int rowFive = rowFour + 30;
-
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
-
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- }
-
- /**
- This method initializes jLabelSelect
-
- @return javax.swing.JLabel jLabelSelect
- **/
- private JLabel getJLabelSelect() {
- if (jLabelSelect == null) {
- jLabelSelect = new JLabel();
- jLabelSelect.setBounds(new java.awt.Rectangle(labelCol,rowOne,155,20));
- jLabelSelect.setText("Select ModuleType");
-
- }
- return jLabelSelect;
- }
-
- /**
- This method initializes jComboBoxSelect
-
- @return javax.swing.JComboBox
- **/
- private JComboBox getJComboBoxSelect() {
- if (jComboBoxSelect == null) {
- jComboBoxSelect = new JComboBox();
- jComboBoxSelect.setBounds(new java.awt.Rectangle(valueCol, rowOne, 260, 20));
- jComboBoxSelect.setPreferredSize(new java.awt.Dimension(260,20));
-
- jComboBoxSelect.setEnabled(true);
- }
- return jComboBoxSelect;
- }
-
- /**
- This method initializes jTable
-
- @return javax.swing.JTable
- *
- private JTable getJTable() {
- if (jTable == null) {
- model = new PackageHeaderTableModel();
- model.addColumn("ModuleType");
- model.addColumn("IncludeHeader");
-
-
- }
- return jTable;
- }*/
- /**
- This method initializes jButtonAdd
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(addButtonCol,rowFour,buttonWidth,20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
- }
-
- /**
- This method initializes jButtonRemove
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(removeButtonCol,rowFour,buttonWidth,20));
- jButtonRemove.setText("Delete");
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- This method initializes jButtonRemoveAll
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonClearAll() {
- if (jButtonClearAll == null) {
- jButtonClearAll = new JButton();
- jButtonClearAll.setBounds(new java.awt.Rectangle(removeAllButtonCol,rowFour,buttonWidth,20));
- jButtonClearAll.setText("Clear All");
- jButtonClearAll.addActionListener(this);
- }
- return jButtonClearAll;
- }
-
- /**
- This is the default constructor
- **/
- public SpdPackageHeaders(JFrame frame) {
- super();
- initialize();
- init();
- topFrame = frame;
- }
-
- public SpdPackageHeaders(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame){
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdPackageHeaders(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- }
- /**
- This method initializes this
-
- @return void
- **/
- private void init() {
-
- this.setContentPane(getJScrollPane());
- this.setTitle("Package Headers");
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setVisible(true);
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- }
- });
- }
-
- private void init(SpdFileContents sfc){
-
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(topFrame, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
-
- if (sfc.getSpdPackageHeaderCount() == 0) {
- return ;
- }
- String[][] saa = new String[sfc.getSpdPackageHeaderCount()][2];
- sfc.getSpdPackageHeaders(saa);
- int i = 0;
- while (i < saa.length) {
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- private JScrollPane getJScrollPane(){
- if (jScrollPane == null){
- jScrollPane = new JScrollPane();
- jScrollPane.setViewportView(getJContentPane());
- }
- return jScrollPane;
- }
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, rowOne));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0,rowTwo));
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(labelCol,rowTwo,320,22));
- jLabel.setText("Include Header for Module Type");
-
- jContentPane = new JPanel();
- jContentPane.setPreferredSize(new Dimension(480, 325));
- jContentPane.setLayout(null);
- jContentPane.add(jLabel, null);
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(getJLabelSelect(), null);
- jContentPane.add(getJComboBoxSelect(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonClearAll(), null);
-
- jContentPane.add(getJTextField(), null);
- jContentPane.add(getJButtonBrowse(), null);
- jContentPane.add(getJScrollPanePkgHdr(), null);
- }
- return jContentPane;
- }
-
- /**
- fill ComboBoxes with pre-defined contents
- **/
- private void initFrame() {
- jComboBoxSelect.addItem("BASE");
- jComboBoxSelect.addItem("SEC");
- jComboBoxSelect.addItem("PEI_CORE");
- jComboBoxSelect.addItem("PEIM");
- jComboBoxSelect.addItem("DXE_CORE");
- jComboBoxSelect.addItem("DXE_DRIVER");
- jComboBoxSelect.addItem("DXE_RUNTIME_DRIVER");
- jComboBoxSelect.addItem("DXE_SAL_DRIVER");
- jComboBoxSelect.addItem("DXE_SMM_DRIVER");
- jComboBoxSelect.addItem("TOOL");
- jComboBoxSelect.addItem("UEFI_DRIVER");
- jComboBoxSelect.addItem("UEFI_APPLICATION");
- jComboBoxSelect.addItem("USER_DEFINED");
- jComboBoxSelect.setSelectedIndex(0);
-
- boolean editable = true;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
-
- jButtonAdd.setEnabled(editable);
- jButtonRemove.setEnabled(editable);
- jButtonClearAll.setEnabled(editable);
- jTable.setEnabled(editable);
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
-
- docConsole.setSaved(false);
-
- if (arg0.getSource() == jButtonAdd) {
- String strLibClass = "";
-
- strLibClass = jComboBoxSelect.getSelectedItem().toString();
- //ToDo: check before add
- String[] row = {"", ""};
- row[0] = strLibClass;
- row[1] = jTextField.getText().replace('\\', '/');
- if (!dataValidation(row)) {
- return;
- }
- model.addRow(row);
- jTable.changeSelection(model.getRowCount()-1, 0, false, false);
- sfc.genSpdModuleHeaders(row[0], row[1], null, null, null, null, null, null);
- }
- //
- // remove selected line
- //
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()){
- jTable.getCellEditor().stopCellEditing();
- }
- int rowSelected = selectedRow;
- if (rowSelected >= 0) {
- model.removeRow(rowSelected);
- sfc.removeSpdPkgHeader(rowSelected);
- }
- }
-
- if (arg0.getSource() == jButtonClearAll) {
- if (model.getRowCount() == 0) {
- return;
- }
- model.setRowCount(0);
- sfc.removeSpdPkgHeader();
- }
-
- }
-
- private boolean dataValidation(String[] row) {
- if (!DataValidation.isPathAndFilename(row[1])) {
- JOptionPane.showMessageDialog(this, "Include header path is NOT PathAndFilename type.");
- return false;
- }
-
- return true;
- }
-
- /**
- Add contents in list to sfc
- **/
- protected void save() {
-
- }
-
- /**
- This method initializes jTextField
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextField() {
- if (jTextField == null) {
- jTextField = new JTextField();
- jTextField.setBounds(new java.awt.Rectangle(labelCol,rowThree,346,20));
- jTextField.setPreferredSize(new java.awt.Dimension(345,20));
- }
- return jTextField;
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(374,rowThree,buttonWidth,20));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.setPreferredSize(new java.awt.Dimension(buttonWidth,20));
- jButtonBrowse.addActionListener(new javax.swing.AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- //
- // Select files from current workspace
- //
- String dirPrefix = Tools.dirForNewSpd.substring(0, Tools.dirForNewSpd.lastIndexOf(File.separator));
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- int retval = chooser.showOpenDialog(SpdPackageHeaders.this);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(SpdPackageHeaders.this, "You can only select files in current package!");
- return;
- }
-
-
- }
- else {
- return;
- }
-
- headerDest = theFile.getPath();
- int fileIndex = headerDest.indexOf(System.getProperty("file.separator"), dirPrefix.length());
-
- jTextField.setText(headerDest.substring(fileIndex + 1).replace('\\', '/'));
-
- }
- });
- }
- return jButtonBrowse;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePkgHdr() {
- if (jScrollPanePkgHdr == null) {
- jScrollPanePkgHdr = new JScrollPane();
- jScrollPanePkgHdr.setBounds(new java.awt.Rectangle(labelCol,rowFive,453,258));
- jScrollPanePkgHdr.setViewportView(getJTable());
- }
- return jScrollPanePkgHdr;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTable() {
- if (jTable == null) {
- model = new DefaultTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- model.addColumn("ModuleType");
- model.addColumn("IncludeHeader");
- TableColumn typeColumn = jTable.getColumnModel().getColumn(0);
- JComboBox jComboBoxSelect = new JComboBox();
- jComboBoxSelect.addItem("BASE");
- jComboBoxSelect.addItem("SEC");
- jComboBoxSelect.addItem("PEI_CORE");
- jComboBoxSelect.addItem("PEIM");
- jComboBoxSelect.addItem("DXE_CORE");
- jComboBoxSelect.addItem("DXE_DRIVER");
- jComboBoxSelect.addItem("DXE_RUNTIME_DRIVER");
- jComboBoxSelect.addItem("DXE_SAL_DRIVER");
- jComboBoxSelect.addItem("DXE_SMM_DRIVER");
- jComboBoxSelect.addItem("TOOL");
- jComboBoxSelect.addItem("UEFI_DRIVER");
- jComboBoxSelect.addItem("UEFI_APPLICATION");
- jComboBoxSelect.addItem("USER_DEFINED");
- typeColumn.setCellEditor(new DefaultCellEditor(jComboBoxSelect));
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTable.getModel().addTableModelListener(this);
- }
- return jTable;
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
- String[] sa = new String[2];
- sfc.getSpdModuleHeader(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
- String pkg = m.getValueAt(row, 0) + "";
- String hdr = m.getValueAt(row, 1) + "";
- String[] rowData = {pkg, hdr};
- if (!dataValidation(rowData)) {
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdPkgHdr(row, pkg, hdr);
- }
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- // Tools.resizeComponentWidth(this.jComboBoxSelect, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextField, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPanePkgHdr, this.getWidth(), intPreferredWidth);
- Tools.relocateComponentX(this.jButtonBrowse, this.getWidth(), this.getPreferredSize().width, 30);
- }
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java
deleted file mode 100644
index 3886843072..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPcdDefs.java
+++ /dev/null
@@ -1,1242 +0,0 @@
-/** @file
- Java class SpdPcdDefs is GUI for create PCD definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-
-import javax.swing.DefaultCellEditor;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import javax.swing.JComboBox;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JCheckBox;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-import org.tianocore.frameworkwizard.platform.ui.ListEditor;
-import org.tianocore.frameworkwizard.platform.ui.LongTextEditor;
-
-import java.awt.Rectangle;
-import java.util.Vector;
-
-/**
- GUI for create PCD definition elements of spd file
-
- @since PackageEditor 1.0
-**/
-public class SpdPcdDefs extends IInternalFrame implements TableModelListener{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JFrame topFrame;
-
- private JPanel jContentPane = null;
-
- private JLabel jLabelItemType = null;
-
- private JLabel jLabelC_Name = null;
-
- private JTextField jTextFieldC_Name = null;
-
- private JLabel jLabelToken = null;
-
- private JTextField jTextFieldToken = null;
-
- private JLabel jLabelDataType = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JComboBox jComboBoxDataType = null;
-
- private SpdFileContents sfc = null;
-
- private OpeningPackageType docConsole = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel = null;
-
- private StarLabel jStarLabel1 = null;
-
- private JLabel jLabelTokenSpace = null;
-
- private JComboBox jComboBoxTsGuid = null;
-
- private JLabel jLabelVarVal = null;
-
- private JTextField jTextFieldHelp = null;
-
- private JLabel jLabelDefVal = null;
-
- private JTextField jTextFieldDefaultValue = null;
-
- private JButton jButtonAdd = null;
-
- private CheckboxTableModel model = null;
-
- private JButton jButtonRemove = null;
-
- private JButton jButtonClearAll = null;
-
- private JScrollPane jScrollPane = null;
-
- private JTable jTable = null;
-
- private JScrollPane topScrollPane = null; // @jve:decl-index=0:visual-constraint="390,10"
-
- private int selectedRow = -1;
-
- private StarLabel starLabel = null;
-
- private JCheckBox jCheckBoxFeatureFlag = null;
-
- private JCheckBox jCheckBoxFixedAtBuild = null;
-
- private JCheckBox jCheckBoxPatchInMod = null;
-
- private JCheckBox jCheckBoxDyn = null;
-
- private JCheckBox jCheckBoxDynEx = null;
-
- private JScrollPane jScrollPaneArch = null;
-
- private ICheckBoxList iCheckBoxListArch = null;
-
- private JScrollPane jScrollPaneMod = null;
-
- private ICheckBoxList iCheckBoxListMod = null;
-
- private JLabel jLabelSupMod = null;
-
- private JLabel jLabelSupArch = null;
-
- private final int pcdCNameMinWidth = 200;
- private final int pcdTokenMinWidth = 100;
- private final int pcdTokenSpaceMinWidth = 200;
- private final int datumTypeMinWidth = 80;
- private final int defaultValueMinWidth = 100;
- private final int helpTextMinWidth = 200;
- private final int usageMinWidth = 60;
- private final int supArchMinWidth = 200;
- private final int supModMinWidth = 200;
-
-// private Object boolModifyLock = new Object();
-// private boolean exclusiveUsage = false;
-
- /**
- This method initializes this
-
- **/
- private void initialize() {
- this.setTitle("PCD Declarations");
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
-
- int xPos = jCheckBoxPatchInMod.getX() + jCheckBoxPatchInMod.getWidth();
- jCheckBoxFixedAtBuild.setLocation(xPos,133);
-
- xPos = jCheckBoxFeatureFlag.getX() + jCheckBoxFeatureFlag.getWidth();
- jCheckBoxDyn.setLocation(xPos,161);
-
- xPos = jCheckBoxDyn.getX() + jCheckBoxDyn.getWidth();
- jCheckBoxDynEx.setLocation(xPos,161);
-
- }
-
- /**
- This method initializes jTextFieldC_Name
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextFieldC_Name() {
- if (jTextFieldC_Name == null) {
- jTextFieldC_Name = new JTextField();
- jTextFieldC_Name.setBounds(new java.awt.Rectangle(156,9,317,20));
- jTextFieldC_Name.setPreferredSize(new java.awt.Dimension(315,20));
- }
- return jTextFieldC_Name;
- }
-
- /**
- This method initializes jTextFieldToken
-
- @return javax.swing.JTextField
- **/
- private JTextField getJTextFieldToken() {
- if (jTextFieldToken == null) {
- jTextFieldToken = new JTextField();
- jTextFieldToken.setBounds(new java.awt.Rectangle(156,33,317,20));
- jTextFieldToken.setPreferredSize(new java.awt.Dimension(315,20));
- }
- return jTextFieldToken;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setText("OK");
- jButtonOk.setBounds(new java.awt.Rectangle(279,276,90,20));
- jButtonOk.setVisible(false);
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setText("Cancel");
- jButtonCancel.setBounds(new java.awt.Rectangle(389,276,82,20));
- jButtonCancel.setVisible(false);
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jComboBoxDataType
-
- @return javax.swing.JComboBox
- **/
- private JComboBox getJComboBoxDataType() {
- if (jComboBoxDataType == null) {
- jComboBoxDataType = new JComboBox();
- jComboBoxDataType.setBounds(new java.awt.Rectangle(156,84,110,20));
- }
- return jComboBoxDataType;
- }
-
- /**
- This is the default constructor
- **/
- public SpdPcdDefs(JFrame frame) {
- super();
- init();
- initialize();
- topFrame = frame;
- }
-
- public SpdPcdDefs(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame) {
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdPcdDefs(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- }
- /**
- This method initializes this
-
- @return void
- **/
- private void init() {
- this.setSize(500, 650);
- this.setContentPane(getJContentPane());
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTable.isEditing()) {
- jTable.getCellEditor().stopCellEditing();
- }
- }
- });
-
- this.setVisible(true);
- }
-
- private void init(SpdFileContents sfc){
-
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(topFrame, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
-
- if (sfc.getSpdPcdDefinitionCount() == 0) {
- return ;
- }
- String[][] saa = new String[sfc.getSpdPcdDefinitionCount()][8];
- String[][] usage = new String[sfc.getSpdPcdDefinitionCount()][5];
- Object[] rowData = new Object[13];
- sfc.getSpdPcdDefinitions(saa, usage);
- int i = 0;
- while (i < saa.length) {
-
- for (int k = 0; k < 6; ++k) {
- rowData[k] = saa[i][k];
- }
- for (int m = 6; m < 11; ++m) {
- rowData[m] = new Boolean("false");
- }
- int j = 0;
- while (j < 5) {
- if (usage[i][j] == null || usage[i][j].length()==0){
- ++j;
- continue;
- }
- if (usage[i][j].equals("FEATURE_FLAG")){
- rowData[6] = new Boolean("true");
- }
- if (usage[i][j].equals("FIXED_AT_BUILD")){
- rowData[7] = new Boolean("true");
- }
- if (usage[i][j].equals("PATCHABLE_IN_MODULE")){
- rowData[8] = new Boolean("true");
- }
- if (usage[i][j].equals("DYNAMIC")){
- rowData[9] = new Boolean("true");
- }
- if (usage[i][j].equals("DYNAMIC_EX")){
- rowData[10] = new Boolean("true");
- }
-
- ++j;
- }
-
- rowData[11] = saa[i][6];
- rowData[12] = saa[i][7];
-
- model.addRow(rowData);
-
- i++;
- }
-
- }
-
- private JScrollPane getJContentPane(){
- if (topScrollPane == null){
- topScrollPane = new JScrollPane();
- topScrollPane.setSize(new java.awt.Dimension(482,451));
- topScrollPane.setViewportView(getJContentPane1());
- }
- return topScrollPane;
- }
- private JPanel getJContentPane1() {
- if (jContentPane == null) {
-
- jLabelSupArch = new JLabel();
- jLabelSupArch.setBounds(new java.awt.Rectangle(241,192,89,16));
- jLabelSupArch.setText("Supported Architectures");
- jLabelSupArch.setEnabled(true);
- FontMetrics fm = jLabelSupArch.getFontMetrics(jLabelSupArch.getFont());
- jLabelSupArch.setSize(fm.stringWidth(jLabelSupArch.getText()) + 10, 20);
- jLabelSupMod = new JLabel();
- jLabelSupMod.setBounds(new java.awt.Rectangle(15,193,103,16));
- jLabelSupMod.setText("Supported Module types");
- jLabelSupMod.setEnabled(true);
- fm = jLabelSupMod.getFontMetrics(jLabelSupMod.getFont());
- jLabelSupMod.setSize(fm.stringWidth(jLabelSupMod.getText()) + 10, 20);
- starLabel = new StarLabel();
- starLabel.setBounds(new java.awt.Rectangle(2,134,10,20));
- jLabelDefVal = new JLabel();
- jLabelDefVal.setBounds(new java.awt.Rectangle(277,84,80,20));
- jLabelDefVal.setText("Default Value");
- fm = jLabelDefVal.getFontMetrics(jLabelDefVal.getFont());
- jLabelDefVal.setSize(fm.stringWidth(jLabelDefVal.getText()) + 10, 20);
- jLabelVarVal = new JLabel();
- jLabelVarVal.setBounds(new java.awt.Rectangle(11,133,100,20));
- jLabelVarVal.setText("Valid Usage");
- jLabelC_Name = new JLabel();
- jLabelC_Name.setText("C Name");
- jLabelC_Name.setBounds(new java.awt.Rectangle(11,9,140,20));
- jLabelTokenSpace = new JLabel();
- jLabelTokenSpace.setBounds(new java.awt.Rectangle(11,58,140,20));
- jLabelTokenSpace.setText("Token Space");
- jLabelDataType = new JLabel();
- jLabelDataType.setText("Data Type");
- jLabelDataType.setBounds(new java.awt.Rectangle(11,83,140,20));
- jLabelToken = new JLabel();
- jLabelToken.setText("Token Number");
- jLabelToken.setBounds(new java.awt.Rectangle(11,33,140,20));
- jLabelItemType = new JLabel();
- jLabelItemType.setText("Help Text");
- jLabelItemType.setBounds(new java.awt.Rectangle(11,108,140,20));
-
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(479,375));
-
- jContentPane.add(jLabelItemType, null);
- jContentPane.add(jLabelC_Name, null);
- jContentPane.add(jLabelTokenSpace, null);
- jContentPane.add(getJComboBoxTsGuid(), null);
- jContentPane.add(jLabelVarVal, null);
- jContentPane.add(getJTextFieldC_Name(), null);
- jContentPane.add(jLabelToken, null);
- jContentPane.add(getJTextFieldToken(), null);
- jContentPane.add(jLabelDataType, null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJComboBoxDataType(), null);
-
- jStarLabel = new StarLabel();
- jStarLabel1 = new StarLabel();
- jStarLabel1.setBounds(new java.awt.Rectangle(2,8,10,20));
- jStarLabel2 = new StarLabel();
- jStarLabel3 = new StarLabel();
- jStarLabel4 = new StarLabel();
- jStarLabel.setLocation(new java.awt.Point(2,84));
- jStarLabel4.setLocation(new java.awt.Point(2, 109));
- jStarLabel2.setLocation(new java.awt.Point(2,33));
- jStarLabel3.setLocation(new java.awt.Point(2, 58));
- jStarLabel3.setSize(new java.awt.Dimension(8,20));
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jStarLabel, null);
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(getJTextFieldHelp(), null);
- jContentPane.add(jLabelDefVal, null);
- jContentPane.add(getJTextFieldDefaultValue(), null);
- jContentPane.add(getJButtonAdd(), null);
- jContentPane.add(getJButtonRemove(), null);
- jContentPane.add(getJButtonClearAll(), null);
- jContentPane.add(getJScrollPane(), null);
- jContentPane.add(starLabel, null);
- jContentPane.add(getJCheckBoxFeatureFlag(), null);
- jContentPane.add(getJCheckBoxFixedAtBuild(), null);
- jContentPane.add(getJCheckBoxPatchInMod(), null);
- jContentPane.add(getJCheckBoxDyn(), null);
- jContentPane.add(getJCheckBoxDynEx(), null);
- jContentPane.add(getJScrollPaneArch(), null);
- jContentPane.add(getJScrollPaneMod(), null);
- jContentPane.add(jLabelSupMod, null);
- jContentPane.add(jLabelSupArch, null);
- }
- return jContentPane;
- }
-
- /**
- This method initializes comboboxes
- jContentPane.add(jLabelTokenSpace, null);
-
- **/
- private void initFrame() {
-
- jComboBoxDataType.addItem("UINT8");
- jComboBoxDataType.addItem("UINT16");
- jComboBoxDataType.addItem("UINT32");
- jComboBoxDataType.addItem("UINT64");
- jComboBoxDataType.addItem("VOID*");
- jComboBoxDataType.addItem("BOOLEAN");
- jComboBoxDataType.setSelectedIndex(0);
-
- Vector<String> vGuidCName = new Vector<String>();
- sfc.getSpdGuidDeclWithType(vGuidCName, "TOKEN_SPACE_GUID");
- for (int i = 0; i < vGuidCName.size(); ++i) {
- jComboBoxTsGuid.addItem(vGuidCName.get(i));
- }
-
- boolean editable = true;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- editable = false;
- }
-
- jButtonAdd.setEnabled(editable);
- jButtonRemove.setEnabled(editable);
- jButtonClearAll.setEnabled(editable);
- jTable.setEnabled(editable);
- }
-
- public void actionPerformed(ActionEvent arg0) {
-
-
- if (arg0.getSource() == jButtonOk) {
- this.save();
- this.dispose();
- }
- if (arg0.getSource() == jButtonCancel) {
- this.dispose();
- }
-
- if (arg0.getSource() == jButtonAdd) {
- //ToDo: check before add
-
- boolean[] b = {jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected()};
- if (!checkValidUsage(b)) {
- return;
- }
- String archList = vectorToString(iCheckBoxListArch.getAllCheckedItemsString());
- if (archList.length() == 0) {
- archList = null;
- }
- String modTypeList = vectorToString(iCheckBoxListMod.getAllCheckedItemsString());
- if (modTypeList.length() == 0) {
- modTypeList = null;
- }
- Object[] row = {jTextFieldC_Name.getText(), jTextFieldToken.getText(),
- jComboBoxTsGuid.getSelectedItem(), jComboBoxDataType.getSelectedItem(),
- jTextFieldDefaultValue.getText(), jTextFieldHelp.getText(),
- jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(),
- jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected(),
- archList, modTypeList};
- try {
- if (!dataValidation(row)) {
- return;
- }
-
- if (tokenCNameExisted(jTextFieldToken.getText(), jTextFieldC_Name.getText())) {
- return;
- }
- } catch (Exception e) {
- JOptionPane.showMessageDialog(this, "Illegal Token:"+ e.getCause());
- return;
- }
-
- model.addRow(row);
- jTable.changeSelection(model.getRowCount()-1, 0, false, false);
- String usage = getValidUsage(jCheckBoxFeatureFlag.isSelected(), jCheckBoxFixedAtBuild.isSelected(), jCheckBoxPatchInMod.isSelected(), jCheckBoxDyn.isSelected(), jCheckBoxDynEx.isSelected());
- if (usage.length() == 0) {
- usage = null;
- }
- sfc.genSpdPcdDefinitions(row[0]+"", row[1]+"", row[3]+"", usage, row[2]+"", row[4]+"", row[5]+"", archList, modTypeList);
- docConsole.setSaved(false);
- }
- //
- // remove selected line
- //
- if (arg0.getSource() == jButtonRemove) {
- if (jTable.isEditing()){
- jTable.getCellEditor().stopCellEditing();
- }
- int rowSelected = selectedRow;
- if (rowSelected >= 0) {
- model.removeRow(rowSelected);
- sfc.removeSpdPcdDefinition(rowSelected);
- docConsole.setSaved(false);
- }
- }
-
- if (arg0.getSource() == jButtonClearAll) {
- if (model.getRowCount() == 0) {
- return;
- }
- model.setRowCount(0);
- sfc.removeSpdPcdDefinition();
- docConsole.setSaved(false);
- }
-
- }
-
- protected void save() {
-
- }
-
- /**
- * This method initializes jComboBoxTsGuid
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxTsGuid() {
- if (jComboBoxTsGuid == null) {
- jComboBoxTsGuid = new JComboBox();
- jComboBoxTsGuid.setBounds(new java.awt.Rectangle(156,58,315,20));
-
- }
- return jComboBoxTsGuid;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldHelp() {
- if (jTextFieldHelp == null) {
- jTextFieldHelp = new JTextField();
- jTextFieldHelp.setBounds(new java.awt.Rectangle(156,108,317,20));
- jTextFieldHelp.setPreferredSize(new java.awt.Dimension(315,20));
- }
- return jTextFieldHelp;
- }
-
- /**
- * This method initializes jTextFieldDefaultValue
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDefaultValue() {
- if (jTextFieldDefaultValue == null) {
- jTextFieldDefaultValue = new JTextField();
- int xPos = jLabelDefVal.getX() + jLabelDefVal.getWidth();
- jTextFieldDefaultValue.setBounds(new java.awt.Rectangle(xPos,84,105,20));
- jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(104,20));
- }
- return jTextFieldDefaultValue;
- }
-
- /**
- * This method initializes jButtonAdd
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setBounds(new java.awt.Rectangle(195,277,71,20));
- jButtonAdd.setPreferredSize(new java.awt.Dimension(70,20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(this);
- }
- return jButtonAdd;
-
- }
-
- /**
- * This method initializes jButtonRemove
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setBounds(new java.awt.Rectangle(278,277,81,20));
- jButtonRemove.setPreferredSize(new java.awt.Dimension(70,20));
- jButtonRemove.setText("Delete");
- jButtonRemove.addActionListener(this);
- }
- return jButtonRemove;
- }
-
- /**
- * This method initializes jButtonClearAll
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonClearAll() {
- if (jButtonClearAll == null) {
- jButtonClearAll = new JButton();
- jButtonClearAll.setBounds(new java.awt.Rectangle(382,277,90,20));
- jButtonClearAll.setPreferredSize(new java.awt.Dimension(81,20));
- jButtonClearAll.setText("Clear All");
- jButtonClearAll.addActionListener(this);
- }
- return jButtonClearAll;
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- Tools.resizeComponentWidth(this.jTextFieldC_Name, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldToken, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jComboBoxTsGuid, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldHelp, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPane, this.getWidth(), intPreferredWidth);
-
- Tools.resizeComponentWidth(this.jTextFieldDefaultValue, this.getWidth(), intPreferredWidth);
-// relocateComponentX(this.jButtonClearAll, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
-// relocateComponentX(this.jButtonRemove, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
-// relocateComponentX(this.jButtonAdd, this.getWidth(), DataType.SPACE_TO_RIGHT_FOR_GENERATE_BUTTON);
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setBounds(new java.awt.Rectangle(5,301,1473,259));
- jScrollPane.setViewportView(getJTable());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTable() {
- if (jTable == null) {
- model = new CheckboxTableModel();
- jTable = new JTable(model);
- jTable.setRowHeight(20);
- jTable.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
- jTable.setSize(new Dimension(1000, 300));
-
- model.addColumn("C_Name");
- model.addColumn("Token");
- model.addColumn("TokenSpace");
- model.addColumn("DatumType");
- model.addColumn("DefaultValue");
- model.addColumn("HelpText");
-
- model.addColumn("FeatureFlag");
- model.addColumn("FixedAtBuild");
- model.addColumn("PatchableInModule");
- model.addColumn("Dynamic");
- model.addColumn("DynamicEx");
- model.addColumn("SupportedArch");
- model.addColumn("SupportedModule");
-
- TableColumn column = jTable.getColumnModel().getColumn(0);
- column.setMinWidth(this.pcdCNameMinWidth);
- column = jTable.getColumnModel().getColumn(1);
- column.setMinWidth(this.pcdTokenMinWidth);
- column = jTable.getColumnModel().getColumn(2);
- column.setMinWidth(this.pcdTokenSpaceMinWidth);
- column = jTable.getColumnModel().getColumn(3);
- column.setMinWidth(this.datumTypeMinWidth);
- column = jTable.getColumnModel().getColumn(4);
- column.setMinWidth(this.defaultValueMinWidth);
- column = jTable.getColumnModel().getColumn(5);
- column.setMinWidth(this.helpTextMinWidth);
- column = jTable.getColumnModel().getColumn(6);
- column.setMinWidth(this.usageMinWidth);
- column = jTable.getColumnModel().getColumn(7);
- column.setMinWidth(this.usageMinWidth);
- column = jTable.getColumnModel().getColumn(8);
- column.setMinWidth(this.usageMinWidth);
- column = jTable.getColumnModel().getColumn(9);
- column.setMinWidth(this.usageMinWidth);
- column = jTable.getColumnModel().getColumn(10);
- column.setMinWidth(this.usageMinWidth);
- column = jTable.getColumnModel().getColumn(11);
- column.setMinWidth(this.supArchMinWidth);
- column = jTable.getColumnModel().getColumn(12);
- column.setMinWidth(this.supModMinWidth);
-
- //ToDo: add a valid usage editor
-
- JComboBox jComboBoxDataType = new JComboBox();
- jComboBoxDataType.addItem("UINT8");
- jComboBoxDataType.addItem("UINT16");
- jComboBoxDataType.addItem("UINT32");
- jComboBoxDataType.addItem("UINT64");
- jComboBoxDataType.addItem("VOID*");
- jComboBoxDataType.addItem("BOOLEAN");
- TableColumn dataTypeColumn = jTable.getColumnModel().getColumn(3);
- dataTypeColumn.setCellEditor(new DefaultCellEditor(jComboBoxDataType));
-
- jTable.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor(topFrame));
-
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTable.getColumnModel().getColumn(11).setCellEditor(new ListEditor(vArch, topFrame));
-
- Vector<String> vModule = new Vector<String>();
- vModule.add("BASE");
- vModule.add("SEC");
- vModule.add("PEI_CORE");
- vModule.add("PEIM");
- vModule.add("DXE_CORE");
- vModule.add("DXE_DRIVER");
- vModule.add("DXE_RUNTIME_DRIVER");
- vModule.add("DXE_SAL_DRIVER");
- vModule.add("DXE_SMM_DRIVER");
- vModule.add("UEFI_DRIVER");
- vModule.add("UEFI_APPLICATION");
- vModule.add("USER_DEFINED");
- jTable.getColumnModel().getColumn(12).setCellEditor(new ListEditor(vModule, topFrame));
-
- jTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTable.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTable.getModel().addTableModelListener(this);
- }
- return jTable;
- }
-
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
- String[] sa = new String[9];
- sfc.getSpdPcdDeclaration(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (column < 6) {
-
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
- }
-
- String usage = getValidUsage(new Boolean(m.getValueAt(row, 6)+""), new Boolean(m.getValueAt(row, 7)+""), new Boolean(m.getValueAt(row, 8)+""), new Boolean(m.getValueAt(row, 9)+""), new Boolean(m.getValueAt(row, 10)+""));
- if (usage.length() == 0) {
- JOptionPane.showMessageDialog(this, "You must choose at least one usage for PCD entry.");
- return;
- }
-
- if (column <= 10 && column >= 6) {
- Vector<String> v = stringToVector(usage);
- if (compareTwoVectors(v, stringToVector(sa[6]))) {
- return;
- }
- if (v.contains("FEATURE_FLAG")/* && v.size() > 1 && !exclusiveUsage*/) {
- if (v.size() > 1) {
- JOptionPane.showMessageDialog(this, "Usage Feature Flag can NOT co-exist with others.");
- return;
- }
-// synchronized (boolModifyLock){
-// exclusiveUsage = true;
-// }
-// m.setValueAt(false, row, 7);
-// m.setValueAt(false, row, 8);
-// m.setValueAt(false, row, 9);
-// m.setValueAt(false, row, 10);
- else {
- m.setValueAt("BOOLEAN", row, 3);
- }
-
- }
- }
-
- if (column == 11) {
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[7])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[7] == null) {
- return;
- }
- }
-
- if (column == 12) {
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[8])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[8] == null) {
- return;
- }
- }
- String cName = m.getValueAt(row, 0) + "";
- String token = m.getValueAt(row, 1) + "";
- String ts = m.getValueAt(row, 2) + "";
- String dataType = m.getValueAt(row, 3) + "";
- String defaultVal = m.getValueAt(row, 4) + "";
- String help = m.getValueAt(row, 5) + "";
-
-
- String archList = null;
- if (m.getValueAt(row, 11) != null){
- archList = m.getValueAt(row, 11).toString();
- }
- String modTypeList = null;
- if (m.getValueAt(row, 12) != null) {
- modTypeList = m.getValueAt(row, 12).toString();
- }
-
- Object[] o = {cName, token, ts, dataType, defaultVal, help};
- try {
- if (!dataValidation(o)){
- return;
- }
- }
- catch (Exception e) {
- JOptionPane.showMessageDialog(this, "Illegal Token:" + e.getCause());
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdPcdDefinition(row, cName, token, dataType, usage, ts, defaultVal, help, archList, modTypeList);
- }
- }
-
- /**
- * This method initializes jCheckBox
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFeatureFlag() {
- if (jCheckBoxFeatureFlag == null) {
- jCheckBoxFeatureFlag = new JCheckBox();
- jCheckBoxFeatureFlag.setBounds(new java.awt.Rectangle(156,161,100,21));
- jCheckBoxFeatureFlag.setText("Feature Flag");
- FontMetrics fm = jCheckBoxFeatureFlag.getFontMetrics(jCheckBoxFeatureFlag.getFont());
- jCheckBoxFeatureFlag.setSize(fm.stringWidth(jCheckBoxFeatureFlag.getText()) + 30, 20);
- jCheckBoxFeatureFlag.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (jCheckBoxFeatureFlag.isSelected()) {
- jCheckBoxPatchInMod.setSelected(false);
- jCheckBoxFixedAtBuild.setSelected(false);
- jCheckBoxDyn.setSelected(false);
- jCheckBoxDynEx.setSelected(false);
- jComboBoxDataType.setSelectedItem("BOOLEAN");
- }
- }
- });
- }
- return jCheckBoxFeatureFlag;
- }
-
- /**
- * This method initializes jCheckBox1
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFixedAtBuild() {
- if (jCheckBoxFixedAtBuild == null) {
- jCheckBoxFixedAtBuild = new JCheckBox();
-
- jCheckBoxFixedAtBuild.setText("Fixed at Build");
- FontMetrics fm = jCheckBoxFixedAtBuild.getFontMetrics(jCheckBoxFixedAtBuild.getFont());
- jCheckBoxFixedAtBuild.setSize(fm.stringWidth(jCheckBoxFixedAtBuild.getText()) + 30, 20);
- jCheckBoxFixedAtBuild.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (jCheckBoxFixedAtBuild.isSelected()) {
- jCheckBoxFeatureFlag.setSelected(false);
- }
- }
- });
- }
- return jCheckBoxFixedAtBuild;
- }
-
- /**
- * This method initializes jCheckBox2
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPatchInMod() {
- if (jCheckBoxPatchInMod == null) {
- jCheckBoxPatchInMod = new JCheckBox();
-
- jCheckBoxPatchInMod.setBounds(new java.awt.Rectangle(156,133,154,20));
- jCheckBoxPatchInMod.setText("Patchable in Module");
- FontMetrics fm = jCheckBoxPatchInMod.getFontMetrics(jCheckBoxPatchInMod.getFont());
- jCheckBoxPatchInMod.setSize(fm.stringWidth(jCheckBoxPatchInMod.getText()) + 30, 20);
- jCheckBoxPatchInMod.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (jCheckBoxPatchInMod.isSelected()) {
- jCheckBoxFeatureFlag.setSelected(false);
- }
- }
- });
- }
- return jCheckBoxPatchInMod;
- }
-
- /**
- * This method initializes jCheckBox3
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxDyn() {
- if (jCheckBoxDyn == null) {
- jCheckBoxDyn = new JCheckBox();
-
- jCheckBoxDyn.setText("Dynamic");
- FontMetrics fm = jCheckBoxDyn.getFontMetrics(jCheckBoxDyn.getFont());
- jCheckBoxDyn.setSize(fm.stringWidth(jCheckBoxDyn.getText()) + 30, 20);
- jCheckBoxDyn.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (jCheckBoxDyn.isSelected()) {
- jCheckBoxFeatureFlag.setSelected(false);
- }
- }
- });
- }
- return jCheckBoxDyn;
- }
-
- /**
- * This method initializes jCheckBox4
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxDynEx() {
- if (jCheckBoxDynEx == null) {
- jCheckBoxDynEx = new JCheckBox();
-
- jCheckBoxDynEx.setText("DynamicEx");
- FontMetrics fm = jCheckBoxDynEx.getFontMetrics(jCheckBoxDynEx.getFont());
- jCheckBoxDynEx.setSize(fm.stringWidth(jCheckBoxDynEx.getText()) + 30, 20);
- jCheckBoxDynEx.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (jCheckBoxDynEx.isSelected()) {
- jCheckBoxFeatureFlag.setSelected(false);
- }
- }
- });
- }
- return jCheckBoxDynEx;
- }
-
- private String getValidUsage(boolean ff, boolean fab, boolean pim, boolean d, boolean de) {
- String usage = "";
- if (ff){
- usage += "FEATURE_FLAG ";
- }
- if (fab){
- usage += "FIXED_AT_BUILD ";
- }
- if (pim){
- usage += "PATCHABLE_IN_MODULE ";
- }
- if (d){
- usage += "DYNAMIC ";
- }
- if (de){
- usage += "DYNAMIC_EX ";
- }
-
- return usage.trim();
- }
-
- private boolean tokenCNameExisted(String token, String cName) throws Exception{
- Long inputToken = Long.decode(token);
-
- for (int i = 0; i < model.getRowCount(); ++i) {
- if (model.getValueAt(i, 0).equals(cName)) {
- JOptionPane.showMessageDialog(this, "C_Name already existed in table.");
- return true;
- }
- if (model.getValueAt(i, 1).equals(token)) {
- JOptionPane.showMessageDialog(this, "Token already existed in table.");
- return true;
- }
- Long tokenValue = Long.decode(model.getValueAt(i, 1)+"");
- if (tokenValue.equals(inputToken)) {
- JOptionPane.showMessageDialog(this, "Same token value already existed in table.");
- return true;
- }
-
- }
- return false;
- }
-
- private boolean checkValidUsage(boolean[] b) {
- if (!(b[0] || b[1] || b[2] || b[3] || b[4])){
- JOptionPane.showMessageDialog(this, "You must specify at least one usage.");
- return false;
- }
- return true;
- }
- private boolean dataValidation(Object[] row) throws Exception{
-
- if (!DataValidation.isC_NameType(row[0].toString())) {
- JOptionPane.showMessageDialog(this, "C_Name is NOT C_NameType.");
- return false;
- }
- if (!DataValidation.isHexDoubleWordDataType(row[1].toString()) &&
- !DataValidation.isLongInt(row[1].toString(), 1, Long.MAX_VALUE)) {
- JOptionPane.showMessageDialog(this, "Token is NOT correct.");
- return false;
- }
- if (!DataValidation.isC_NameType(row[2].toString())) {
- JOptionPane.showMessageDialog(this, "Token Space is NOT C_NameType");
- return false;
- }
- if (row[5].toString().length() == 0) {
- JOptionPane.showMessageDialog(this, "HelpText could NOT be empty.");
- return false;
- }
- return true;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneArch() {
- if (jScrollPaneArch == null) {
- jScrollPaneArch = new JScrollPane();
- jScrollPaneArch.setBounds(new java.awt.Rectangle(242,213,188,54));
- jScrollPaneArch.setViewportView(getICheckBoxListArch());
- jScrollPaneArch.setPreferredSize(new Dimension(188, 74));
- }
- return jScrollPaneArch;
- }
-
- /**
- * This method initializes iCheckBoxList
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListArch() {
- if (iCheckBoxListArch == null) {
- iCheckBoxListArch = new ICheckBoxList();
- iCheckBoxListArch.setBounds(new Rectangle(197, 142, 188, 74));
- Vector<String> v = new Vector<String>();
- v.add("IA32");
- v.add("X64");
- v.add("IPF");
- v.add("EBC");
- v.add("ARM");
- v.add("PPC");
- iCheckBoxListArch.setAllItems(v);
- }
- return iCheckBoxListArch;
- }
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneMod() {
- if (jScrollPaneMod == null) {
- jScrollPaneMod = new JScrollPane();
- jScrollPaneMod.setBounds(new java.awt.Rectangle(15,213,199,55));
- jScrollPaneMod.setViewportView(getICheckBoxListMod());
- jScrollPaneMod.setPreferredSize(new Dimension(170, 74));
- }
- return jScrollPaneMod;
- }
-
- /**
- * This method initializes iCheckBoxList1
- *
- * @return org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList
- */
- private ICheckBoxList getICheckBoxListMod() {
- if (iCheckBoxListMod == null) {
- iCheckBoxListMod = new ICheckBoxList();
- iCheckBoxListMod.setBounds(new Rectangle(14, 142, 170, 74));
- Vector<String> v = new Vector<String>();
- v.add("BASE");
- v.add("SEC");
- v.add("PEI_CORE");
- v.add("PEIM");
- v.add("DXE_CORE");
- v.add("DXE_DRIVER");
- v.add("DXE_RUNTIME_DRIVER");
- v.add("DXE_SAL_DRIVER");
- v.add("DXE_SMM_DRIVER");
- v.add("UEFI_DRIVER");
- v.add("UEFI_APPLICATION");
- v.add("USER_DEFINED");
- iCheckBoxListMod.setAllItems(v);
- }
- return iCheckBoxListMod;
- }
-
- protected String vectorToString(Vector<String> v) {
- if (v == null) {
- return null;
- }
- String s = " ";
- for (int i = 0; i < v.size(); ++i) {
- s += v.get(i);
- s += " ";
- }
- return s.trim();
- }
-
- protected Vector<String> stringToVector(String s){
- Vector<String> v = new Vector<String>();
- if (s == null) {
- return v;
- }
- String[] sArray = s.split(" ");
-
- for (int i = 0; i < sArray.length; ++i) {
- v.add(sArray[i]);
- }
- return v;
- }
-
- private boolean compareTwoVectors(Vector v1, Vector v2) {
- if (v1.size() != v2.size()) {
- return false;
- }
- for (int i = 0; i < v1.size(); ++i) {
- if (!v2.contains(v1.get(i))) {
- return false;
- }
- }
- return true;
- }
-} // @jve:decl-index=0:visual-constraint="22,11"
-
-class CheckboxTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public Class<?> getColumnClass (int c) {
- if (getValueAt(0, c) != null){
- return getValueAt(0, c).getClass();
- }
- return String.class;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java
deleted file mode 100644
index e0b96319a7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdPpiDecls.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/** @file
- Java class SpdProtocolDecls is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.platform.ui.ListEditor;
-
-/**
-GUI for create library definition elements of spd file.
-
-@since PackageEditor 1.0
-**/
-public class SpdPpiDecls extends SpdGuidDecls {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private SpdFileContents sfc = null;
- private OpeningPackageType docConsole = null;
-// private JFrame topFrame = null;
-
- public SpdPpiDecls(JFrame frame) {
- super(frame);
- // TODO Auto-generated constructor stub
- }
-
- public SpdPpiDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame) {
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdPpiDecls(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(this, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
- }
-
- protected void initFrame() {
- super.initFrame();
- this.setTitle("PPI Declarations");
- starLabel.setVisible(false);
- ((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
- }
-
- protected void init(SpdFileContents sfc){
- //
- // initialize table using SpdFileContents object
- //
- DefaultTableModel model = getModel();
- if (sfc.getSpdPpiDeclarationCount() == 0) {
- return ;
- }
- saa = new String[sfc.getSpdPpiDeclarationCount()][7];
- sfc.getSpdPpiDeclarations(saa);
- int i = 0;
- while (i < saa.length) {
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- protected void updateRow(int row, int column, TableModel m){
- String[] sa = new String[7];
- sfc.getSpdPpiDeclaration(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
-
- String name = m.getValueAt(row, 0) + "";
- String cName = m.getValueAt(row, 1) + "";
- String guid = m.getValueAt(row, 2) + "";
- String help = m.getValueAt(row, 3) + "";
- String archList = null;
- if (m.getValueAt(row, 4) != null) {
- archList = m.getValueAt(row, 4).toString();
- }
- String modTypeList = null;
- if (m.getValueAt(row, 5) != null) {
- modTypeList = m.getValueAt(row, 5).toString();
- }
- String guidTypeList = null;
- if (m.getValueAt(row, 6) != null) {
- guidTypeList = m.getValueAt(row, 6).toString();
- }
- String[] rowData = {name, cName, guid, help};
- if (!dataValidation(rowData)){
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdPpiDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
- }
-
- protected int addRow(String[] row) {
-
- if (!dataValidation(row)){
- return -1;
- }
- docConsole.setSaved(false);
- sfc.genSpdPpiDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
- return 0;
- }
-
- protected void removeRow(int i){
- sfc.removeSpdPpiDeclaration(i);
- docConsole.setSaved(false);
- }
-
- protected void clearAllRow(){
- sfc.removeSpdPpiDeclaration();
- docConsole.setSaved(false);
- }
-
- /**
- * @return Returns the sfc.
- */
- protected SpdFileContents getSfc() {
- return sfc;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java
deleted file mode 100644
index 1c4c0cf269..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/packaging/ui/SpdProtocolDecls.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/** @file
- Java class SpdProtocolDecls is GUI for create library definition elements of spd file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.packaging.ui;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.platform.ui.ListEditor;
-
-/**
-GUI for create library definition elements of spd file.
-
-@since PackageEditor 1.0
-**/
-public class SpdProtocolDecls extends SpdGuidDecls {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private SpdFileContents sfc = null;
- private OpeningPackageType docConsole = null;
-
- public SpdProtocolDecls(JFrame frame) {
- super(frame);
- // TODO Auto-generated constructor stub
- }
-
- public SpdProtocolDecls(PackageSurfaceAreaDocument.PackageSurfaceArea inPsa, JFrame frame) {
- this(frame);
- sfc = new SpdFileContents(inPsa);
- init(sfc);
- }
-
- public SpdProtocolDecls(OpeningPackageType opt, JFrame frame) {
- this(opt.getXmlSpd(), frame);
- docConsole = opt;
- if (sfc.getSpdPkgDefsRdOnly().equals("true")) {
- JOptionPane.showMessageDialog(this, "This is a read-only package. You will not be able to edit contents in table.");
- }
- initFrame();
- }
-
- protected void initFrame() {
- super.initFrame();
- this.setTitle("Protocol Declarations");
- starLabel.setVisible(false);
- ((ListEditor)getJTable().getColumnModel().getColumn(6).getCellEditor()).setCanNotBeEmpty(false);
- }
-
- protected void init(SpdFileContents sfc){
- //
- // initialize table using SpdFileContents object
- //
- DefaultTableModel model = getModel();
- if (sfc.getSpdProtocolDeclarationCount() == 0) {
- return ;
- }
- saa = new String[sfc.getSpdProtocolDeclarationCount()][7];
- sfc.getSpdProtocolDeclarations(saa);
- int i = 0;
- while (i < saa.length) {
- model.addRow(saa[i]);
- i++;
- }
-
- }
-
- protected void updateRow(int row, int column, TableModel m){
- String[] sa = new String[7];
- sfc.getSpdProtocolDeclaration(sa, row);
- Object cellData = m.getValueAt(row, column);
- if (cellData == null) {
- cellData = "";
- }
- if (cellData.equals(sa[column])) {
- return;
- }
- if (cellData.toString().length() == 0 && sa[column] == null) {
- return;
- }
-
- String name = m.getValueAt(row, 0) + "";
- String cName = m.getValueAt(row, 1) + "";
- String guid = m.getValueAt(row, 2) + "";
- String help = m.getValueAt(row, 3) + "";
- String archList = null;
- if (m.getValueAt(row, 4) != null) {
- archList = m.getValueAt(row, 4).toString();
- }
- String modTypeList = null;
- if (m.getValueAt(row, 5) != null) {
- modTypeList = m.getValueAt(row, 5).toString();
- }
- String guidTypeList = null;
- if (m.getValueAt(row, 6) != null) {
- guidTypeList = m.getValueAt(row, 6).toString();
- }
- String[] rowData = {name, cName, guid, help};
- if (!dataValidation(rowData)){
- return;
- }
- docConsole.setSaved(false);
- sfc.updateSpdProtocolDecl(row, name, cName, guid, help, archList, modTypeList, guidTypeList);
- }
-
- protected int addRow(String[] row) {
- if (!dataValidation(row)){
- return -1;
- }
- docConsole.setSaved(false);
- sfc.genSpdProtocolDeclarations(row[0], row[1], row[2], row[3], stringToVector(row[4]), stringToVector(row[5]), stringToVector(row[6]));
- return 0;
- }
-
- protected void removeRow(int i){
- sfc.removeSpdProtocolDeclaration(i);
- docConsole.setSaved(false);
- }
-
- protected void clearAllRow(){
- sfc.removeSpdProtocolDeclaration();
- docConsole.setSaved(false);
- }
-
- /**
- * @return Returns the sfc.
- */
- protected SpdFileContents getSfc() {
- return sfc;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
deleted file mode 100644
index bc0b3d2bed..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/PlatformIdentification.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/** @file
-
- The file is used to save basic information of platform
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.platform;
-
-
-import java.io.File;
-
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class PlatformIdentification extends Identification{
-
- public PlatformIdentification(String name, String guid, String version, String path){
- super(name, guid, version, path);
- }
-
- public PlatformIdentification(Identification id){
- super(id.getName(), id.getGuid(), id.getVersion(), id.getPath());
- }
-
- public File getFpdFile(){
- File fpdFile = new File(this.getPath());
- return fpdFile;
- }
-
- public String toString() {
- return getName() + " " + getVersion() + " [" + Tools.getRelativePath(getFpdFile().getPath(), Workspace.getCurrentWorkspace()) + "]";
- }
-
- public boolean equals(String platformGuid, String platformVersion) {
- boolean b = false;
- if (this.getGuid().equals(platformGuid)) {
- b = true;
- //
- // Check Version
- //
- if (platformVersion != null) {
- if (!Tools.isEmpty(platformVersion)) {
- if (!platformVersion.equals(this.getVersion())) {
- b = false;
- }
- }
- }
- }
- return b;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/DynamicTree.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/DynamicTree.java
deleted file mode 100644
index d47352bb3e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/DynamicTree.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/** @file
-
- The file is used to create tree view sections
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui;
-import java.awt.GridLayout;
-
-import javax.swing.JPanel;
-import javax.swing.JTree;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-
-
-public class DynamicTree extends JPanel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- protected DefaultMutableTreeNode rootNode;
- protected DefaultTreeModel treeModel;
- protected JTree tree;
-
- public DynamicTree() {
- super(new GridLayout(1,0));
-
-
- }
-
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
deleted file mode 100644
index feddaeeb71..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdBuildOptions.java
+++ /dev/null
@@ -1,2242 +0,0 @@
-/** @file
-
- The file is used to create, update BuildOptions of Fpd file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-
-import javax.swing.JPanel;
-import javax.swing.JTabbedPane;
-import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import java.awt.FlowLayout;
-import javax.swing.AbstractAction;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentEvent;
-
-import javax.swing.DefaultCellEditor;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JTextField;
-import javax.swing.JButton;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JComboBox;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Set;
-import java.util.Vector;
-import java.awt.Dimension;
-import javax.swing.JSplitPane;
-import java.awt.GridLayout;
-
-public class FpdBuildOptions extends IInternalFrame {
-
- private final int oneRowHeight = 20;
-
- private final int twoRowHeight = 40;
-
- private final int sepHeight = 6;
-
- private final int sepWidth = 10;
-
- private final int buttonWidth = 90;
-
- private final int rowOne = 12;
-
- private final int dialogWidth = 600;
-
- private final int rowTwo = rowOne + oneRowHeight + sepHeight;
-
- private final int rowThree = rowTwo + oneRowHeight + sepHeight;
-
- private final int rowFour = rowThree + oneRowHeight + sepHeight;
-
- private final int rowFive = rowFour + oneRowHeight + sepHeight;
-
- private final int rowSix = rowFive + oneRowHeight + sepHeight;
-
- private final int rowSeven = rowSix + oneRowHeight + sepHeight;
-
- private final int buttonRow = rowSeven + oneRowHeight + sepHeight + sepHeight;
-
- private final int dialogHeight = buttonRow + twoRowHeight + twoRowHeight;
-
- private final int lastButtonXLoc = dialogWidth - buttonWidth - sepWidth;
-
- private final int next2LastButtonLoc = lastButtonXLoc - buttonWidth - sepWidth;
-
- private final int firstButtonLoc = next2LastButtonLoc - buttonWidth - sepWidth;
-
- private final int labelColumn = 12;
-
- private final int fieldColumn = 168;
-
- private final int labelWidth = 155;
-
- private final int fieldWidth = 320;
-
- private static final long serialVersionUID = 1L;
-
- private JPanel jContentPane = null;
-
- // private JPanel jPanelContentSouth = null;
-
- // private JPanel jPanelContentNorth = null;
-
- // private JPanel jPanelContentWest = null;
-
- // private JPanel jPanelContentEast = null;
-
- private JTabbedPane jTabbedPane = null;
-
- private JPanel jPanelUserDef = null;
-
- private JPanel jPanelUserDefNorth = null;
-
- private JPanel jPanelUserDefCenter = null;
-
- private JTextField jTextFieldAntTaskFile = null;
-
- private JLabel jLabelAntTaskId = null;
-
- private JTextField jTextFieldAntTaskId = null;
-
- private JButton jButtonAntTaskAdd = null;
-
- private JButton jButtonAntTaskDel = null;
-
- private JTextField jTextFieldAntCmdOpts = null;
-
- private JScrollPane jScrollPaneAntTasks = null;
-
- private JTable jTableAntTasks = null;
-
- private DefaultTableModel ffsTableModel = null;
-
- private DefaultTableModel sectionsTableModel = null;
-
- private DefaultTableModel sectionTableModel = null;
-
- private DefaultTableModel subsectionsTableModel = null;
-
- private DefaultTableModel antTaskTableModel = null;
-
- private DefaultTableModel ffsAttributesTableModel = null;
-
- private DefaultTableModel optionsTableModel = null;
-
- private JPanel jPanelFfsTab = null;
-
- private JPanel jPanelFfsTabCenter = null;
-
- private JPanel jPanelFfsTabCenterN = null;
-
- private JPanel jPanelFfsTabCenterS = null;
-
- private JButton jButtonFfsAdd = null;
-
- private JButton jButtonFfsDel = null;
-
- private JScrollPane jScrollPaneFfsAttribs = null;
-
- private JTable jTableFfsAttribs = null;
-
- private JPanel jPanelOptionsTab = null;
-
- private JLabel jLabelOptionContents = null;
-
- private JTextField jTextFieldOptionContents = null;
-
- private JLabel jLabelToolChainFamily = null;
-
- private JLabel jLabelSupArch = null;
-
- private JLabel jLabelToolCmd = null;
-
- private JTextField jTextFieldToolCmd = null;
-
- private JScrollPane jScrollPaneOptions = null;
-
- private JTable jTableOptions = null;
-
- private JButton jButtonOptionsAdd = null;
-
- private JButton jButtonOptionsDel = null;
-
- private JButton jButtonFfsAttribNew = null;
-
- private JButton jButtonFfsAttribRemove = null;
-
- private FpdFileContents ffc = null;
-
- private OpeningPlatformType docConsole = null;
-
- private JPanel jArchitectureSelections = null;
-
- private JCheckBox jCheckBoxIA32 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxEBC = null;
-
- private JCheckBox jCheckBoxARM = null;
-
- private JCheckBox jCheckBoxPPC = null;
-
- private JLabel jLabelBuildTargets = null;
-
- private JTextField jTextFieldBuildTargets = null;
-
- private JTextField jTextFieldTagName = null;
-
- private JLabel jLabelTagName = null;
-
- private int selectedRow = -1;
-
- private JLabel jLabelAntTaskFile = null;
-
- private JLabel jLabelAntCmdOpts = null;
-
- private JScrollPane jScrollPaneFfs = null;
-
- private JTable jTableFfs = null;
-
- private JLabel jLabelFfsSection = null;
-
- private JScrollPane jScrollPaneFfsSection = null;
-
- private JTable jTableFfsSection = null;
-
- private JLabel jLabelFfsSubSections = null;
-
- private JScrollPane jScrollPaneFfsSubSection = null;
-
- private JTable jTableFfsSubSection = null;
-
- private JLabel jLabelEncapType = null;
-
- private JTextField jTextFieldEncapType = null;
-
- private JPanel jPanelFfsAttribButtonGroup = null;
-
- private JLabel jLabelFfsAttribs = null;
-
- private JButton jButtonFfsSectionNew = null;
-
- private JButton jButtonFfsSectionRemove = null;
-
- private JButton jButtonFfsSubSectionNew = null;
-
- private JButton jButtonFfsSubSectionRemove = null;
-
- private JLabel jLabelFfsSections = null;
-
- private JButton jButtonFfsSectionsNew = null;
-
- private JButton jButtonFfsSectionsRemove = null;
-
- private JScrollPane jScrollPaneFfsSections = null;
-
- private JTable jTableFfsSections = null;
-
- private JButton jButtonAntTaskFileBrowse = null;
-
- private JTextField jTextFieldToolChainFamily = null;
-
- private JSplitPane jSplitPaneFfsC = null;
-
- private JPanel jPanelFfsCTop = null;
-
- private JSplitPane jSplitPaneFfsCBottom = null;
-
- private JPanel jPanelFfsCBottomTop = null;
-
- private JPanel jPanelFfsCBottomBottom = null;
-
- private JPanel jPanelSectionN = null;
-
- private JPanel jPanelSectionsN = null;
-
- private JPanel jPanelSubSectionN = null;
-
- private JPanel jPanelOptionsContainer = null;
-
- private JPanel jPanelUserDefCenterN = null;
-
- private JPanel jPanelTableOptionsContainer = null;
-
- private JLabel jLabelTableOptionsTitle = null;
-
- private final int buildTargetWidth = 150;
- private final int toolChainFamilyWidth = 150;
- private final int supportArchWidth = 150;
- private final int toolCmdCodeWidth = 200;
- private final int tagNameWidth = 150;
- private final int argWidth = 400;
-
- private boolean ffsSelection = false;
- private int selectedFfsTableRow = -1;
-
- /**
- * This method initializes jPanel
- *
- * @return javax.swing.JPanel
- private JPanel getJPanelContentSouth() {
- if (jPanelContentSouth == null) {
- jPanelContentSouth = new JPanel();
- }
- return jPanelContentSouth;
- }
- */
-
- /**
- * This method initializes jPanel1
- *
- * @return javax.swing.JPanel
- private JPanel getJPanelContentNorth() {
- if (jPanelContentNorth == null) {
- jPanelContentNorth = new JPanel();
- }
- return jPanelContentNorth;
- }
- */
-
- /**
- * This method initializes jPanel2
- *
- * @return javax.swing.JPanel
- private JPanel getJPanelContentWest() {
- if (jPanelContentWest == null) {
- jPanelContentWest = new JPanel();
- }
- return jPanelContentWest;
- }
- */
-
- /**
- * This method initializes jPanel3
- *
- * @return javax.swing.JPanel
- private JPanel getJPanelContentEast() {
- if (jPanelContentEast == null) {
- jPanelContentEast = new JPanel();
- }
- return jPanelContentEast;
- }
- */
-
- /**
- * This method initializes jTabbedPane
- *
- * @return javax.swing.JTabbedPane
- */
- private JTabbedPane getJTabbedPane() {
- if (jTabbedPane == null) {
- jTabbedPane = new JTabbedPane();
- jTabbedPane.addTab("Flash Filesystem Options", null, getJPanelFfsTab(), null);
- jTabbedPane.addTab("Customize Tool Chain Configurations", null, getJPanelOptionsTab(), null);
- jTabbedPane.addTab("User Defined ANT Tasks", null, getJPanelUserDef(), null);
- }
- return jTabbedPane;
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(722, 577);
- this.setTitle("Platform Build Options");
- this.setContentPane(getJContentPane());
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- // jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
- // jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
- // jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
- // jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes jPanelTableOptionsContainer
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelTableOptionsContainer() {
- if (jPanelTableOptionsContainer == null) {
- jLabelTableOptionsTitle = new JLabel();
- jLabelTableOptionsTitle.setText(" Current Argument Lines");
- jPanelTableOptionsContainer = new JPanel();
- jPanelTableOptionsContainer.setLayout(new BorderLayout());
- jPanelTableOptionsContainer.add(jLabelTableOptionsTitle, java.awt.BorderLayout.NORTH);
- jPanelTableOptionsContainer.add(getJScrollPaneOptions(), java.awt.BorderLayout.CENTER);
- }
- return jPanelTableOptionsContainer;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new FpdBuildOptions().setVisible(true);
- }
-
- /**
- * This is the default constructor
- */
- public FpdBuildOptions() {
- super();
- initialize();
- this.setVisible(true);
- }
-
- public FpdBuildOptions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this();
- ffc = new FpdFileContents(fpd);
- init(ffc);
- }
-
- public FpdBuildOptions(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- }
-
- private void init(FpdFileContents ffc) {
- initOptionTable();
- initAntTaskTable();
- initFfsTable();
- this.addInternalFrameListener(new InternalFrameAdapter() {
- public void internalFrameDeactivated(InternalFrameEvent e) {
- if (jTableAntTasks.isEditing()) {
- jTableAntTasks.getCellEditor().stopCellEditing();
- }
- if (jTableOptions.isEditing()) {
- jTableOptions.getCellEditor().stopCellEditing();
- }
- stopEditingInTables ();
- }
- });
- }
-
- private void stopEditingInTables () {
- if (jTableFfs.isEditing()) {
- jTableFfs.getCellEditor().stopCellEditing();
- }
- if (jTableFfsSection.isEditing()) {
- jTableFfsSection.getCellEditor().stopCellEditing();
- }
- if (jTableFfsSections.isEditing()) {
- jTableFfsSections.getCellEditor().stopCellEditing();
- }
- if (jTableFfsSubSection.isEditing()) {
- jTableFfsSubSection.getCellEditor().stopCellEditing();
- }
- if (jTableFfsAttribs.isEditing()) {
- jTableFfsAttribs.getCellEditor().stopCellEditing();
- }
- }
-
- /**
- * This method initializes jPanel13
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsTab() {
- if (jPanelFfsTab == null) {
- jPanelFfsTab = new JPanel();
- jPanelFfsTab.setLayout(new BorderLayout());
- jPanelFfsTab.add(getJPanelFfsTabCenter(), java.awt.BorderLayout.CENTER);
- jPanelFfsTab.add(getJScrollPaneFfs(), java.awt.BorderLayout.WEST);
- }
- return jPanelFfsTab;
- }
-
- /**
- * This method initializes jPanel18
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsTabCenter() {
- if (jPanelFfsTabCenter == null) {
- jPanelFfsTabCenter = new JPanel();
- jPanelFfsTabCenter.setLayout(new BorderLayout());
- jPanelFfsTabCenter.add(getJPanelFfsTabCenterN(), java.awt.BorderLayout.NORTH);
- jPanelFfsTabCenter.add(getJPanelFfsTabCenterS(), java.awt.BorderLayout.SOUTH);
- jPanelFfsTabCenter.add(getJSplitPaneFfsC(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFfsTabCenter;
- }
-
- /**
- * This method initializes jPanel15
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsTabCenterN() {
- if (jPanelFfsTabCenterN == null) {
- jLabelEncapType = new JLabel();
- jLabelEncapType.setText("Encapsulation Type");
- FlowLayout flowLayout5 = new FlowLayout();
- flowLayout5.setAlignment(java.awt.FlowLayout.RIGHT);
-
- jPanelFfsTabCenterN = new JPanel();
- jPanelFfsTabCenterN.setLayout(flowLayout5);
-
-
- jPanelFfsTabCenterN.add(jLabelEncapType, null);
- jPanelFfsTabCenterN.add(getJTextFieldEncapType(), null);
- jPanelFfsTabCenterN.add(getJButtonFfsAdd(), null);
- jPanelFfsTabCenterN.add(getJButtonFfsDel(), null);
- }
- return jPanelFfsTabCenterN;
- }
-
- /**
- * This method initializes jPanel16
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsTabCenterS() {
- if (jPanelFfsTabCenterS == null) {
- jLabelFfsAttribs = new JLabel();
- jLabelFfsAttribs.setText("Attributes");
- jPanelFfsTabCenterS = new JPanel();
- jPanelFfsTabCenterS.setPreferredSize(new java.awt.Dimension(491, 130));
- jPanelFfsTabCenterS.setLayout(new BorderLayout());
- jPanelFfsTabCenterS.add(jLabelFfsAttribs, java.awt.BorderLayout.WEST);
- jPanelFfsTabCenterS.add(getJScrollPaneFfsAttribs(), java.awt.BorderLayout.CENTER);
- jPanelFfsTabCenterS.add(getJPanelFfsAttribButtonGroup(), java.awt.BorderLayout.EAST);
- }
- return jPanelFfsTabCenterS;
- }
-
- /**
- * This method initializes jTextField6
- *
- * @return javax.swing.JTextField
- */
-
-
- /**
- * This method initializes jButton8
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsAdd() {
- if (jButtonFfsAdd == null) {
- jButtonFfsAdd = new JButton();
- jButtonFfsAdd.setPreferredSize(new java.awt.Dimension(70, 20));
- jButtonFfsAdd.setText("New");
- jButtonFfsAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = -2923720717273384221L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
-
- String[] row = { "" };
- ffsTableModel.addRow(row);
- docConsole.setSaved(false);
- ffc.genBuildOptionsFfs("", "");
- jTableFfs.changeSelection(ffsTableModel.getRowCount()-1, 0, false, false);
-
- }
- });
- }
- return jButtonFfsAdd;
- }
-
- /**
- * This method initializes jButton9
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsDel() {
- if (jButtonFfsDel == null) {
- jButtonFfsDel = new JButton();
- jButtonFfsDel.setPreferredSize(new java.awt.Dimension(70, 20));
- jButtonFfsDel.setText("Delete");
- jButtonFfsDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = -4002678939178194476L;
-
- public void actionPerformed(ActionEvent arg0) {
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- stopEditingInTables();
- docConsole.setSaved(false);
- ffc.removeBuildOptionsFfs(jTableFfs.getSelectedRow());
- ffsTableModel.removeRow(jTableFfs.getSelectedRow());
- sectionTableModel.setRowCount(0);
- sectionsTableModel.setRowCount(0);
- subsectionsTableModel.setRowCount(0);
- ffsAttributesTableModel.setRowCount(0);
- }
- });
- }
- return jButtonFfsDel;
- }
-
- /**
- * This method initializes jScrollPane5
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFfsAttribs() {
- if (jScrollPaneFfsAttribs == null) {
- jScrollPaneFfsAttribs = new JScrollPane();
-// jScrollPaneFfsAttribs.setPreferredSize(new java.awt.Dimension(350, 100));
- jScrollPaneFfsAttribs.setViewportView(getJTableFfsAttribs());
-
- }
- return jScrollPaneFfsAttribs;
- }
-
- /**
- * This method initializes jTable4
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFfsAttribs() {
- if (jTableFfsAttribs == null) {
- ffsAttributesTableModel = new DefaultTableModel();
- jTableFfsAttribs = new JTable(ffsAttributesTableModel);
-// jTableFfsAttribs.setPreferredSize(new java.awt.Dimension(400, 80));
- jTableFfsAttribs.setRowHeight(20);
- ffsAttributesTableModel.addColumn("Name");
- ffsAttributesTableModel.addColumn("Value");
-
- jTableFfsAttribs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFfsAttribs.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String name = m.getValueAt(row, 0) + "";
- String value = m.getValueAt(row, 1) + "";
-
- if (name.length() == 0) {
- return;
- }
- if (value.length() == 0) {
- return;
- }
- docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), row, name, value);
- }
- }
- });
- }
- return jTableFfsAttribs;
- }
-
- private void initFfsTable() {
- int ffsCount = ffc.getBuildOptionsFfsCount();
- if (ffsCount < 0) {
- return;
- }
- String[][] saa = new String[ffsCount][1];
- ffc.getBuildOptionsFfsKey(saa);
- for (int i = 0; i < saa.length; ++i) {
- ffsTableModel.addRow(saa[i]);
- }
- jTableFfs.changeSelection(0, 0, false, false);
- }
-
- /**
- * This method initializes jButton17
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsAttribNew() {
- if (jButtonFfsAttribNew == null) {
- jButtonFfsAttribNew = new JButton();
- jButtonFfsAttribNew.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsAttribNew.setText("New");
- jButtonFfsAttribNew.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- Object[] o = { "", "" };
- ffsAttributesTableModel.addRow(o);
- docConsole.setSaved(false);
- ffc.genBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(), "", "");
- }
- });
- }
- return jButtonFfsAttribNew;
- }
-
- /**
- * This method initializes jButton18
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsAttribRemove() {
- if (jButtonFfsAttribRemove == null) {
- jButtonFfsAttribRemove = new JButton();
- jButtonFfsAttribRemove.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsAttribRemove.setText("Remove");
- jButtonFfsAttribRemove.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- stopEditingInTables();
- if (jTableFfsAttribs.getSelectedRow() >= 0) {
- docConsole.setSaved(false);
- ffsAttributesTableModel.removeRow(jTableFfsAttribs.getSelectedRow());
- ffc.removeBuildOptionsFfsAttribute(jTableFfs.getSelectedRow(),
- jTableFfsAttribs.getSelectedRow());
- }
- }
- });
- }
- return jButtonFfsAttribRemove;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFfs() {
- if (jScrollPaneFfs == null) {
- jScrollPaneFfs = new JScrollPane();
- jScrollPaneFfs.setPreferredSize(new java.awt.Dimension(200,419));
- jScrollPaneFfs.setViewportView(getJTableFfs());
- }
- return jScrollPaneFfs;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFfs() {
- if (jTableFfs == null) {
- ffsTableModel = new DefaultTableModel();
- ffsTableModel.addColumn("FFS Type");
- jTableFfs = new JTable(ffsTableModel);
- jTableFfs.setShowGrid(false);
- jTableFfs.setRowHeight(20);
-
- jTableFfs.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFfs.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
-
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- int row = lsm.getMinSelectionIndex();
- sectionTableModel.setRowCount(0);
- sectionsTableModel.setRowCount(0);
- subsectionsTableModel.setRowCount(0);
- ffsAttributesTableModel.setRowCount(0);
- String[] sArray = { "", "" };
- LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
- ArrayList<String> alSections = new ArrayList<String>();
- ArrayList<String> alSection = new ArrayList<String>();
- ffc.getBuildOptionsFfs(row, sArray, lhm, alSections, alSection);
- ffsSelection = true;
- jTextFieldEncapType.setText(sArray[1]);
- ffsSelection = false;
- for (int i = 0; i < alSection.size(); ++i) {
- String[] sectionRow = { alSection.get(i) };
- sectionTableModel.addRow(sectionRow);
- }
- for (int j = 0; j < alSections.size(); ++j) {
- String[] sectionsRow = { alSections.get(j) };
- sectionsTableModel.addRow(sectionsRow);
- }
- if (lhm.size() <= 0) {
- return;
- }
- Set<String> keySet = lhm.keySet();
- Iterator<String> is = keySet.iterator();
- while (is.hasNext()) {
- String key = is.next();
- String[] attribRow = { key, lhm.get(key) };
- ffsAttributesTableModel.addRow(attribRow);
- }
- selectedFfsTableRow = row;
- }
- }
- });
-
- jTableFfs.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String id = m.getValueAt(row, 0) + "";
-
- if (id.length() == 0) {
- return;
- }
- docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsKey(row, id);
- }
- }
- });
- }
- return jTableFfs;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFfsSection() {
- if (jScrollPaneFfsSection == null) {
- jScrollPaneFfsSection = new JScrollPane();
-// jScrollPaneFfsSection.setPreferredSize(new java.awt.Dimension(500, 80));
- jScrollPaneFfsSection.setViewportView(getJTableFfsSection());
- }
- return jScrollPaneFfsSection;
- }
-
- /**
- * This method initializes jTable1
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFfsSection() {
- if (jTableFfsSection == null) {
- sectionTableModel = new DefaultTableModel();
- sectionTableModel.addColumn("SectionType");
-
- jTableFfsSection = new JTable(sectionTableModel);
- jTableFfsSection.setRowHeight(20);
- JComboBox cb = new JComboBox();
- cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
- cb.addItem("EFI_SECTION_VERSION");
- cb.addItem("EFI_SECTION_USER_INTERFACE");
- cb.addItem("EFI_SECTION_DXE_DEPEX");
- cb.addItem("EFI_SECTION_PEI_DEPEX");
- cb.addItem("EFI_SECTION_PE32");
- cb.addItem("EFI_SECTION_PIC");
- cb.addItem("EFI_SECTION_TE");
- cb.addItem("EFI_SECTION_RAW");
- cb.addItem("EFI_SECTION_COMPRESSION");
- cb.addItem("EFI_SECTION_GUID_DEFINED");
- cb.addItem("EFI_SECTION_COMPATIBILITY16");
- cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
- jTableFfsSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
-
- jTableFfsSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- jTableFfsSection.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String type = m.getValueAt(row, 0) + "";
- docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row, type);
- }
- }
- });
- }
- return jTableFfsSection;
- }
-
- /**
- * This method initializes jScrollPane3
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFfsSubSection() {
- if (jScrollPaneFfsSubSection == null) {
- jScrollPaneFfsSubSection = new JScrollPane();
-// jScrollPaneFfsSubSection.setPreferredSize(new java.awt.Dimension(500, 90));
- jScrollPaneFfsSubSection.setViewportView(getJTableFfsSubSection());
- }
- return jScrollPaneFfsSubSection;
- }
-
- /**
- * This method initializes jTable3
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFfsSubSection() {
- if (jTableFfsSubSection == null) {
- subsectionsTableModel = new DefaultTableModel();
- subsectionsTableModel.addColumn("SectionType");
- jTableFfsSubSection = new JTable(subsectionsTableModel);
- jTableFfsSubSection.setRowHeight(20);
- JComboBox cb = new JComboBox();
- cb.addItem("EFI_SECTION_FREEFORM_SUBTYPE_GUID");
- cb.addItem("EFI_SECTION_VERSION");
- cb.addItem("EFI_SECTION_USER_INTERFACE");
- cb.addItem("EFI_SECTION_DXE_DEPEX");
- cb.addItem("EFI_SECTION_PEI_DEPEX");
- cb.addItem("EFI_SECTION_PE32");
- cb.addItem("EFI_SECTION_PIC");
- cb.addItem("EFI_SECTION_TE");
- cb.addItem("EFI_SECTION_RAW");
- cb.addItem("EFI_SECTION_COMPRESSION");
- cb.addItem("EFI_SECTION_GUID_DEFINED");
- cb.addItem("EFI_SECTION_COMPATIBILITY16");
- cb.addItem("EFI_SECTION_FIRMWARE_VOLUME_IMAGE");
- jTableFfsSubSection.getColumnModel().getColumn(0).setCellEditor(new DefaultCellEditor(cb));
- jTableFfsSubSection.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- jTableFfsSubSection.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
- return;
- }
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String type = m.getValueAt(row, 0) + "";
- docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(),
- jTableFfsSections.getSelectedRow(), row, type);
- }
- }
- });
- }
- return jTableFfsSubSection;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldEncapType() {
- if (jTextFieldEncapType == null) {
- jTextFieldEncapType = new JTextField();
- jTextFieldEncapType.setPreferredSize(new java.awt.Dimension(200,20));
- jTextFieldEncapType.getDocument().addDocumentListener(new DocumentListener() {
-
- public void insertUpdate(DocumentEvent arg0) {
- if (ffsSelection) {
-// ffsSelection = false;
- return;
- }
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- public void removeUpdate(DocumentEvent arg0) {
- if (ffsSelection) {
-// ffsSelection = false;
- return;
- }
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- public void changedUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- });
- jTextFieldEncapType.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- if (selectedFfsTableRow < 0) {
- return;
- }
- ffc.updateBuildOptionsFfsSectionsType(selectedFfsTableRow, jTextFieldEncapType.getText());
-
- }
- });
- }
- return jTextFieldEncapType;
- }
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsAttribButtonGroup() {
- if (jPanelFfsAttribButtonGroup == null) {
- jPanelFfsAttribButtonGroup = new JPanel();
- jPanelFfsAttribButtonGroup.setPreferredSize(new java.awt.Dimension(100, 100));
- jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribNew(), null);
- jPanelFfsAttribButtonGroup.add(getJButtonFfsAttribRemove(), null);
- }
- return jPanelFfsAttribButtonGroup;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSectionNew() {
- if (jButtonFfsSectionNew == null) {
- jButtonFfsSectionNew = new JButton();
- jButtonFfsSectionNew.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSectionNew.setText("New");
- jButtonFfsSectionNew.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- docConsole.setSaved(false);
- String[] row = { "EFI_SECTION_RAW" };
- sectionTableModel.addRow(row);
- ffc.genBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(), row[0]);
- }
- });
- }
- return jButtonFfsSectionNew;
- }
-
- /**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSectionRemove() {
- if (jButtonFfsSectionRemove == null) {
- jButtonFfsSectionRemove = new JButton();
- jButtonFfsSectionRemove.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSectionRemove.setText("Remove");
-
- jButtonFfsSectionRemove.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0 || jTableFfsSection.getSelectedRow() < 0) {
- return;
- }
- stopEditingInTables();
- docConsole.setSaved(false);
- sectionTableModel.removeRow(jTableFfsSection.getSelectedRow());
- ffc.removeBuildOptionsFfsSectionsSection(jTableFfs.getSelectedRow(),
- jTableFfsSection.getSelectedRow());
- }
- });
- }
- return jButtonFfsSectionRemove;
- }
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSubSectionNew() {
- if (jButtonFfsSubSectionNew == null) {
- jButtonFfsSubSectionNew = new JButton();
- jButtonFfsSubSectionNew.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSubSectionNew.setText("New");
- jButtonFfsSubSectionNew.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
- return;
- }
- docConsole.setSaved(false);
- String[] row = { "EFI_SECTION_RAW" };
- subsectionsTableModel.addRow(row);
- ffc.genBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(),
- jTableFfsSections.getSelectedRow(), row[0]);
-
- }
- });
- }
- return jButtonFfsSubSectionNew;
- }
-
- /**
- * This method initializes jButton3
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSubSectionRemove() {
- if (jButtonFfsSubSectionRemove == null) {
- jButtonFfsSubSectionRemove = new JButton();
- jButtonFfsSubSectionRemove.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSubSectionRemove.setText("Remove");
- jButtonFfsSubSectionRemove.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedFfsRow = jTableFfs.getSelectedRow();
- int selectedSectionsRow = jTableFfsSections.getSelectedRow();
- int selectedSubSectionRow = jTableFfsSubSection.getSelectedRow();
- if (selectedFfsRow < 0 || selectedSectionsRow < 0
- || selectedSubSectionRow < 0) {
- return;
- }
- stopEditingInTables();
- docConsole.setSaved(false);
- subsectionsTableModel.removeRow(selectedSubSectionRow);
- ffc.removeBuildOptionsFfsSectionsSectionsSection(selectedFfsRow,
- selectedSectionsRow,
- selectedSubSectionRow);
- if (subsectionsTableModel.getRowCount() == 0) {
- sectionsTableModel.removeRow(selectedSectionsRow);
- }
- }
- });
- }
- return jButtonFfsSubSectionRemove;
- }
-
- /**
- * This method initializes jButton6
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSectionsNew() {
- if (jButtonFfsSectionsNew == null) {
- jButtonFfsSectionsNew = new JButton();
- jButtonFfsSectionsNew.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSectionsNew.setText("New");
- jButtonFfsSectionsNew.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- docConsole.setSaved(false);
- String[] row = { "Compress" };
- sectionsTableModel.addRow(row);
- ffc.genBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), "");
- JOptionPane.showMessageDialog(FpdBuildOptions.this, "Add Default Section Type EFI_SECTION_PE32 into the New Sections Entry.");
- jTableFfsSections.changeSelection(sectionsTableModel.getRowCount()-1, 0, false, false);
- }
- });
- }
- return jButtonFfsSectionsNew;
- }
-
- /**
- * This method initializes jButton7
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFfsSectionsRemove() {
- if (jButtonFfsSectionsRemove == null) {
- jButtonFfsSectionsRemove = new JButton();
- jButtonFfsSectionsRemove.setPreferredSize(new java.awt.Dimension(80, 20));
- jButtonFfsSectionsRemove.setText("Remove");
- jButtonFfsSectionsRemove.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFfs.getSelectedRow() < 0 || jTableFfsSections.getSelectedRow() < 0) {
- return;
- }
- stopEditingInTables();
- docConsole.setSaved(false);
- sectionsTableModel.removeRow(jTableFfsSections.getSelectedRow());
- ffc.removeBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(),
- jTableFfsSections.getSelectedRow());
- subsectionsTableModel.setRowCount(0);
- }
- });
- }
- return jButtonFfsSectionsRemove;
- }
-
- private JScrollPane getJScrollPaneFfsSections() {
- if (jScrollPaneFfsSections == null) {
- jScrollPaneFfsSections = new JScrollPane();
-// jScrollPaneFfsSections.setPreferredSize(new java.awt.Dimension(500, 80));
- jScrollPaneFfsSections.setViewportView(getJTableFfsSections());
- }
- return jScrollPaneFfsSections;
- }
-
- /**
- * This method initializes jTable6
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFfsSections() {
- if (jTableFfsSections == null) {
- sectionsTableModel = new DefaultTableModel();
- sectionsTableModel.addColumn("EncapsulationType");
- jTableFfsSections = new JTable(sectionsTableModel);
- jTableFfsSections.setRowHeight(20);
- jTableFfsSections.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFfsSections.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- int sectionsRow = lsm.getMinSelectionIndex();
- if (jTableFfs.getSelectedRow() < 0) {
- return;
- }
- subsectionsTableModel.setRowCount(0);
- ArrayList<String> al = new ArrayList<String>();
- ffc.getBuildOptionsFfsSectionsSectionsSection(jTableFfs.getSelectedRow(), sectionsRow, al);
- for (int i = 0; i < al.size(); ++i) {
- String[] subsectionRow = { al.get(i) };
- subsectionsTableModel.addRow(subsectionRow);
- }
- }
- }
- });
-
- jTableFfsSections.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String encapType = m.getValueAt(row, 0) + "";
- docConsole.setSaved(false);
- ffc.updateBuildOptionsFfsSectionsSections(jTableFfs.getSelectedRow(), row, encapType);
- }
- }
- });
- }
- return jTableFfsSections;
- }
-
- /**
- * This method initializes jSplitPaneFfsC
- *
- * @return javax.swing.JSplitPane
- */
- private JSplitPane getJSplitPaneFfsC() {
- if (jSplitPaneFfsC == null) {
- jSplitPaneFfsC = new JSplitPane();
- jSplitPaneFfsC.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
- jSplitPaneFfsC.setDividerLocation(130);
- jSplitPaneFfsC.setTopComponent(getJPanelFfsCTop());
- jSplitPaneFfsC.setBottomComponent(getJSplitPaneFfsCBottom());
- jSplitPaneFfsC.setDividerSize(5);
- }
- return jSplitPaneFfsC;
- }
-
- /**
- * This method initializes jPanelFfsCTop
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsCTop() {
- if (jPanelFfsCTop == null) {
- jPanelFfsCTop = new JPanel();
- jPanelFfsCTop.setLayout(new BorderLayout());
- jPanelFfsCTop.add(getJPanelSectionN(), java.awt.BorderLayout.NORTH);
- jPanelFfsCTop.add(getJScrollPaneFfsSection(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFfsCTop;
- }
-
- /**
- * This method initializes jSplitPaneFfsCBottom
- *
- * @return javax.swing.JSplitPane
- */
- private JSplitPane getJSplitPaneFfsCBottom() {
- if (jSplitPaneFfsCBottom == null) {
- jSplitPaneFfsCBottom = new JSplitPane();
- jSplitPaneFfsCBottom.setDividerSize(5);
- jSplitPaneFfsCBottom.setDividerLocation(130);
- jSplitPaneFfsCBottom.setTopComponent(getJPanelFfsCBottomTop());
- jSplitPaneFfsCBottom.setBottomComponent(getJPanelFfsCBottomBottom());
- jSplitPaneFfsCBottom.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
- }
- return jSplitPaneFfsCBottom;
- }
-
- /**
- * This method initializes jPanelFfsCBottomTop
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsCBottomTop() {
- if (jPanelFfsCBottomTop == null) {
- jPanelFfsCBottomTop = new JPanel();
- jPanelFfsCBottomTop.setLayout(new BorderLayout());
- jPanelFfsCBottomTop.add(getJPanelSectionsN(), java.awt.BorderLayout.NORTH);
- jPanelFfsCBottomTop.add(getJScrollPaneFfsSections(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFfsCBottomTop;
- }
-
- /**
- * This method initializes jPanelFfsCBottomBottom
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFfsCBottomBottom() {
- if (jPanelFfsCBottomBottom == null) {
- jPanelFfsCBottomBottom = new JPanel();
- jPanelFfsCBottomBottom.setLayout(new BorderLayout());
- jPanelFfsCBottomBottom.add(getJPanelSubSectionN(), java.awt.BorderLayout.NORTH);
- jPanelFfsCBottomBottom.add(getJScrollPaneFfsSubSection(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFfsCBottomBottom;
- }
-
- /**
- * This method initializes jPanelSectionN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSectionN() {
- if (jPanelSectionN == null) {
- jPanelSectionN = new JPanel();
- jLabelFfsSection = new JLabel();
- jLabelFfsSection.setText("Section");
- jPanelSectionN.add(jLabelFfsSection, null);
- jPanelSectionN.add(getJButtonFfsSectionNew(), null);
- jPanelSectionN.add(getJButtonFfsSectionRemove(), null);
- }
- return jPanelSectionN;
- }
-
- /**
- * This method initializes jPanelSectionsN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSectionsN() {
- if (jPanelSectionsN == null) {
- jPanelSectionsN = new JPanel();
- jLabelFfsSections = new JLabel();
- jLabelFfsSections.setText("Sections");
- jPanelSectionsN.add(jLabelFfsSections, null);
- jPanelSectionsN.add(getJButtonFfsSectionsNew(), null);
- jPanelSectionsN.add(getJButtonFfsSectionsRemove(), null);
- }
- return jPanelSectionsN;
- }
-
- /**
- * This method initializes jPanelSubSectionN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSubSectionN() {
- if (jPanelSubSectionN == null) {
- jPanelSubSectionN = new JPanel();
- jLabelFfsSubSections = new JLabel();
- jLabelFfsSubSections.setText("Sub-Sections");
- jPanelSubSectionN.add(jLabelFfsSubSections, null);
- jPanelSubSectionN.add(getJButtonFfsSubSectionNew(), null);
- jPanelSubSectionN.add(getJButtonFfsSubSectionRemove(), null);
- }
- return jPanelSubSectionN;
- }
-
- /**
- * The following section contains all Build Options content
- */
-
- /**
- * This method initializes jPanelOptionsTab
- *
- * This is the main Options screen
- *
- * @return javax.swing.JPanel jPanelOptionsTab
- */
- private JPanel getJPanelOptionsTab() {
- if (jPanelOptionsTab == null) {
- // This container holds the Options Tab content
-
- // FlowLayout flowLayout9 = new FlowLayout();
- // flowLayout9.setAlignment(java.awt.FlowLayout.LEFT);
-
- GridLayout gridLayout = new GridLayout();
- gridLayout.setRows(2);
- jPanelOptionsTab = new JPanel();
- jPanelOptionsTab.setLayout(gridLayout);
- jPanelOptionsTab.setBounds(new java.awt.Rectangle(0, 0, dialogWidth * 2, dialogHeight * 3));
- jPanelOptionsTab.setPreferredSize(new java.awt.Dimension(dialogWidth + 10, (dialogHeight * 3) + 10));
- jPanelOptionsTab.setAutoscrolls(true);
- jPanelOptionsTab.setLocation(0, 0);
- jPanelOptionsTab.add(getJPanelOptionsContainer(), null);
-// jPanelOptionsTab.add(getJScrollPaneOptions(), null);
- jPanelOptionsTab.add(getJPanelTableOptionsContainer(), null);
- }
- return jPanelOptionsTab;
- }
-
- /**
- * This method initializes jPanelOptionsContainer
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelOptionsContainer() {
- if (jPanelOptionsContainer == null) {
- jLabelTagName = new JLabel();
- jLabelTagName.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
- jLabelTagName.setLocation(new java.awt.Point(labelColumn, rowOne));
- jLabelTagName.setText("Tag Name");
- jLabelBuildTargets = new JLabel();
- jLabelBuildTargets.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
- jLabelBuildTargets.setLocation(new java.awt.Point(labelColumn, rowTwo));
- jLabelBuildTargets.setText("Build Targets");
- jLabelToolCmd = new JLabel();
- jLabelToolCmd.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
- jLabelToolCmd.setLocation(new java.awt.Point(labelColumn, rowThree));
- jLabelToolCmd.setText("Tool Command");
- jLabelSupArch = new JLabel();
- jLabelSupArch.setBounds(new java.awt.Rectangle(labelColumn, rowFour, labelWidth, oneRowHeight));
- jLabelSupArch.setLocation(new java.awt.Point(labelColumn, rowFour));
- jLabelSupArch.setText("Supported Architectures");
- jLabelToolChainFamily = new JLabel();
- jLabelToolChainFamily.setBounds(new java.awt.Rectangle(labelColumn, rowFive, labelWidth, oneRowHeight));
- jLabelToolChainFamily.setLocation(new java.awt.Point(labelColumn, rowFive));
- jLabelToolChainFamily.setText("Tool Chain Family");
-
- jLabelOptionContents = new JLabel();
- jLabelOptionContents.setBounds(new java.awt.Rectangle(labelColumn, rowSix, labelWidth, oneRowHeight));
- jLabelOptionContents.setLocation(new java.awt.Point(labelColumn, rowSix));
- jLabelOptionContents.setText("Argument Strings");
-
- jPanelOptionsContainer = new JPanel();
-
- jPanelOptionsContainer.setLayout(null);
-
- jPanelOptionsContainer.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
- /*
- jPanelOptionsContainer
- .setBorder(javax.swing.BorderFactory
- .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
-*/
- jPanelOptionsContainer.add(jLabelTagName, null);
- jPanelOptionsContainer.add(getJTextFieldTagName(), null);
-
- jPanelOptionsContainer.add(jLabelBuildTargets, null);
- jPanelOptionsContainer.add(getJTextFieldBuildTargets(), null);
-
- jPanelOptionsContainer.add(jLabelToolChainFamily, null);
- jPanelOptionsContainer.add(getJTextFieldToolChainFamily(), null);
-
- jPanelOptionsContainer.add(jLabelToolCmd, null);
- jPanelOptionsContainer.add(getJTextFieldToolCmd(), null);
-
- jPanelOptionsContainer.add(jLabelSupArch, null);
- jPanelOptionsContainer.add(getArchitectureSelections(), null);
-
- jPanelOptionsContainer.add(jLabelOptionContents, null);
- jPanelOptionsContainer.add(getJTextFieldOptionContents(), null);
-
- jPanelOptionsContainer.add(getJButtonOptionsAdd(), null);
- jPanelOptionsContainer.add(getJButtonOptionsDel(), null);
- }
- return jPanelOptionsContainer;
- }
-
- /**
- * This method initializes jTextFieldOptionTagName Row 1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldTagName() {
- if (jTextFieldTagName == null) {
- jTextFieldTagName = new JTextField();
- jTextFieldTagName.setBounds(new java.awt.Rectangle(fieldColumn, rowOne, fieldWidth, oneRowHeight));
- jTextFieldTagName.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jTextFieldTagName.setLocation(new java.awt.Point(fieldColumn, rowOne));
- }
- return jTextFieldTagName;
- }
-
- /**
- * This method initializes jTextFieldBuildTargets Row 2
- *
- * @return javax.swing.JTextField jTextFieldBuildTargets
- */
- private JTextField getJTextFieldBuildTargets() {
- if (jTextFieldBuildTargets == null) {
- jTextFieldBuildTargets = new JTextField();
- jTextFieldBuildTargets.setBounds(new java.awt.Rectangle(fieldColumn, rowTwo, fieldWidth, oneRowHeight));
- jTextFieldBuildTargets.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jTextFieldBuildTargets.setLocation(new java.awt.Point(fieldColumn, rowTwo));
- }
- return jTextFieldBuildTargets;
- }
-
- /**
- * This method initializes jTextFieldToolCmd Row 3
- *
- * This should be a dropdown box of command codes from tools_def.txt
- *
- * @return javax.swing.JTextField jTextFieldToolCmd
- */
- private JTextField getJTextFieldToolCmd() {
- if (jTextFieldToolCmd == null) {
- jTextFieldToolCmd = new JTextField();
- jTextFieldToolCmd.setBounds(new java.awt.Rectangle(fieldColumn, rowThree, fieldWidth, oneRowHeight));
- jTextFieldToolCmd.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jTextFieldToolCmd.setLocation(new java.awt.Point(fieldColumn, rowThree));
- }
- return jTextFieldToolCmd;
- }
-
- /**
- * This method initializes jArchitectureSelections Row 4
- *
- * @return jArchitectureSelections
- */
- private JPanel getArchitectureSelections() {
- if (jArchitectureSelections == null) {
- jArchitectureSelections = new JPanel();
- jArchitectureSelections.setLayout(null);
- jArchitectureSelections.add(getJCheckBoxIA32(), null);
- jArchitectureSelections.add(getJCheckBoxX64(), null);
- jArchitectureSelections.add(getJCheckBoxIpf(), null);
- jArchitectureSelections.add(getJCheckBoxEBC(), null);
- jArchitectureSelections.add(getJCheckBoxARM(), null);
- jArchitectureSelections.add(getJCheckBoxPPC(), null);
- jArchitectureSelections.setBounds(new java.awt.Rectangle(fieldColumn, rowFour, fieldWidth, oneRowHeight));
- jArchitectureSelections.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jArchitectureSelections.setLocation(new java.awt.Point(fieldColumn, rowFour));
- }
- return jArchitectureSelections;
- }
-
- /**
- * This method initializes jCheckBoxIA32
- *
- * @return javax.swing.JCheckBox jCheckBoxIA32
- */
- private JCheckBox getJCheckBoxIA32() {
- if (jCheckBoxIA32 == null) {
- jCheckBoxIA32 = new JCheckBox();
- jCheckBoxIA32.setBounds(new java.awt.Rectangle(0, 0, 55, 20));
- jCheckBoxIA32.setText("IA32");
- }
- return jCheckBoxIA32;
- }
-
- /**
- * This method initializes jCheckBoxX64
- *
- * @return javax.swing.JCheckBox jCheckBoxX64
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20));
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBoxIpf
- *
- * @return javax.swing.JCheckBox jCheckBoxIpf
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20));
- jCheckBoxIpf.setText("IPF");
- }
- return jCheckBoxIpf;
- }
-
-
- /**
- * This method initializes jCheckBoxEBC
- *
- * @return javax.swing.JCheckBox jCheckBoxEBC
- */
- private JCheckBox getJCheckBoxEBC() {
- if (jCheckBoxEBC == null) {
- jCheckBoxEBC = new JCheckBox();
- jCheckBoxEBC.setBounds(new java.awt.Rectangle(160, 0, 53, 20));
- jCheckBoxEBC.setText("EBC");
- }
- return jCheckBoxEBC;
- }
-
- /**
- * This method initializes jCheckBoxARM
- *
- * @return javax.swing.JCheckBox jCheckBoxARM
- */
- private JCheckBox getJCheckBoxARM() {
- if (jCheckBoxARM == null) {
- jCheckBoxARM = new JCheckBox();
- jCheckBoxARM.setBounds(new java.awt.Rectangle(213, 0, 54, 20));
- jCheckBoxARM.setText("ARM");
- }
- return jCheckBoxARM;
- }
-
- /**
- * This method initializes jCheckBoxPPC
- *
- * @return javax.swing.JCheckBox jCheckBoxPPC
- */
- private JCheckBox getJCheckBoxPPC() {
- if (jCheckBoxPPC == null) {
- jCheckBoxPPC = new JCheckBox();
- jCheckBoxPPC.setBounds(new java.awt.Rectangle(267, 0, 53, 20));
- jCheckBoxPPC.setText("PPC");
- }
- return jCheckBoxPPC;
- }
-
- /**
- * This method initializes jTextFieldToolChainFamily Row 5
- *
- * This should be a drop down for MSFT, INTEL, GCC or USER_DEFINED
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldToolChainFamily() {
- if (jTextFieldToolChainFamily == null) {
- jTextFieldToolChainFamily = new JTextField();
- jTextFieldToolChainFamily.setBounds(new java.awt.Rectangle(fieldColumn, rowFive, fieldWidth, oneRowHeight));
- jTextFieldToolChainFamily.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jTextFieldToolChainFamily.setLocation(new java.awt.Point(fieldColumn, rowFive));
- }
- return jTextFieldToolChainFamily;
- }
-
- /**
- * This method initializes jTextFieldOptionContents Row 6
- *
- * This is where we should put the checkbox & entry data for the command arguments
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldOptionContents() {
- if (jTextFieldOptionContents == null) {
- jTextFieldOptionContents = new JTextField();
- jTextFieldOptionContents.setPreferredSize(new java.awt.Dimension(fieldWidth, oneRowHeight));
- jTextFieldOptionContents.setBounds(fieldColumn, rowSix, fieldWidth, oneRowHeight);
- jTextFieldOptionContents.setLocation(new java.awt.Point(fieldColumn, rowSix));
- }
- return jTextFieldOptionContents;
- }
-
- /**
- * This method initializes jButtonOptionsAdd
- *
- * Add entry from the top screen to the table
- *
- * @return javax.swing.JButton jButtonOptionsAdd
- */
- private JButton getJButtonOptionsAdd() {
- if (jButtonOptionsAdd == null) {
- jButtonOptionsAdd = new JButton();
- jButtonOptionsAdd.setText("Add");
-
- jButtonOptionsAdd.setPreferredSize(new java.awt.Dimension(buttonWidth, oneRowHeight));
- jButtonOptionsAdd.setBounds(new java.awt.Rectangle(firstButtonLoc, buttonRow, buttonWidth, oneRowHeight));
- jButtonOptionsAdd.setLocation(new java.awt.Point(firstButtonLoc, buttonRow));
- jButtonOptionsAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- boolean[] boolArray = { jCheckBoxIA32.isSelected(), jCheckBoxIpf.isSelected(),
- jCheckBoxX64.isSelected(), jCheckBoxEBC.isSelected(),
- jCheckBoxARM.isSelected(), jCheckBoxPPC.isSelected() };
- String s = boolToList(boolArray);
- Object[] o = { jTextFieldBuildTargets.getText(), jTextFieldToolChainFamily.getText(), s,
- jTextFieldToolCmd.getText(), jTextFieldTagName.getText(),
- jTextFieldOptionContents.getText() };
- optionsTableModel.addRow(o);
- docConsole.setSaved(false);
- ffc.genBuildOptionsOpt(stringToVector(jTextFieldBuildTargets.getText().trim()),
- jTextFieldToolChainFamily.getText(), jTextFieldTagName.getText(),
- jTextFieldToolCmd.getText(), stringToVector(s.trim()),
- jTextFieldOptionContents.getText());
- }
- });
- }
- return jButtonOptionsAdd;
- }
-
- /**
- * This method initializes jButtonOptionsDel
- *
- * Remove a line from the table below
- *
- * @return javax.swing.JButton jButtonOptionsDel
- */
- private JButton getJButtonOptionsDel() {
- if (jButtonOptionsDel == null) {
- jButtonOptionsDel = new JButton();
- jButtonOptionsDel.setText("Delete");
- jButtonOptionsDel.setPreferredSize(new java.awt.Dimension(buttonWidth, oneRowHeight));
- jButtonOptionsDel.setBounds(new java.awt.Rectangle(next2LastButtonLoc, buttonRow, buttonWidth, oneRowHeight));
- jButtonOptionsDel.setLocation(new java.awt.Point(next2LastButtonLoc, buttonRow));
- jButtonOptionsDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (selectedRow >= 0) {
- optionsTableModel.removeRow(selectedRow);
- docConsole.setSaved(false);
- ffc.removeBuildOptionsOpt(selectedRow);
- }
- }
- });
- }
- return jButtonOptionsDel;
- }
-
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = 500;
-
- Tools.resizeComponentWidth(this.jScrollPaneOptions, this.getWidth(), intPreferredWidth);
-
- }
- /**
- * This method initializes jScrollPaneOptions
- * Contains the Table and is located below the data entry section
- * @return javax.swing.JScrollPane jScrollPaneOptoins
- */
- private JScrollPane getJScrollPaneOptions() {
- if (jScrollPaneOptions == null) {
- jScrollPaneOptions = new JScrollPane();
- jScrollPaneOptions.setViewportView(getJTableOptions());
- }
- return jScrollPaneOptions;
- }
-
- /**
- * This method initializes jTableOptions
- *
- * @return javax.swing.JTable jTableOptions
- */
- private JTable getJTableOptions() {
- if (jTableOptions == null) {
-
- optionsTableModel = new DefaultTableModel();
- jTableOptions = new JTable(optionsTableModel);
- jTableOptions.setRowHeight(20);
- optionsTableModel.addColumn("Build Targets");
- optionsTableModel.addColumn("Tool Chain Family");
- optionsTableModel.addColumn("Supported Architectures");
- optionsTableModel.addColumn("Tool Command Code");
- optionsTableModel.addColumn("TagName");
- optionsTableModel.addColumn("Arguments");
-
- jTableOptions.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth);
- jTableOptions.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth);
- jTableOptions.getColumnModel().getColumn(2).setMinWidth(supportArchWidth);
- jTableOptions.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth);
- jTableOptions.getColumnModel().getColumn(4).setMinWidth(tagNameWidth);
- jTableOptions.getColumnModel().getColumn(5).setMinWidth(argWidth);
-
-// javax.swing.table.TableColumn toolFamilyCol = jTableOptions.getColumnModel().getColumn(1);
-// JComboBox cb = new JComboBox();
-// cb.addItem("MSFT");
-// cb.addItem("GCC");
-// cb.addItem("CYGWIN");
-// cb.addItem("INTEL");
-// cb.addItem("USER_DEFINED");
-// toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTableOptions.getColumnModel().getColumn(2).setCellEditor(new ListEditor(vArch, FrameworkWizardUI.getInstance()));
-
- jTableOptions.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor(FrameworkWizardUI.getInstance()));
-
- jTableOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableOptions.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
- jTableOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- selectedRow = -1;
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTableOptions.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String targets = m.getValueAt(row, 0) + "";
- Vector<Object> targetName = new Vector<Object>();
- String[] sArray = targets.split("( )+");
- for (int i = 0; i < sArray.length; ++i) {
- targetName.add(sArray[i]);
- }
- String toolChain = m.getValueAt(row, 1) + "";
- String archs = m.getValueAt(row, 2) + "";
- Vector<Object> supArch = null;
- if (archs.length() > 0) {
- supArch = new Vector<Object>();
- String[] sArray1 = archs.split("( )+");
- for (int i = 0; i < sArray1.length; ++i) {
- supArch.add(sArray1[i]);
- }
- }
-
- String toolCmd = m.getValueAt(row, 3) + "";
- String tagName = m.getValueAt(row, 4) + "";
- String contents = m.getValueAt(row, 5) + "";
- docConsole.setSaved(false);
- ffc.updateBuildOptionsOpt(row, targetName, toolChain, tagName, toolCmd, supArch, contents);
- }
- }
- });
- }
- return jTableOptions;
- }
-
- private Vector<Object> stringToVector(String s) {
- String[] sArray = s.split(" ");
- Vector<Object> v = null;
- if (s.length() > 0 && !s.trim().equalsIgnoreCase("")) {
- v = new Vector<Object>();
- for (int i = 0; i < sArray.length; ++i) {
- v.add(sArray[i]);
- }
- }
- return v;
- }
-
- private String boolToList(boolean[] bool) {
- String s = " ";
- if (bool[0]) {
- s += "IA32 ";
- }
- if (bool[1]) {
- s += "IPF ";
- }
- if (bool[2]) {
- s += "X64 ";
- }
- if (bool[3]) {
- s += "EBC ";
- }
- if (bool[4]) {
- s += "ARM ";
- }
- if (bool[5]) {
- s += "PPC ";
- }
-
- return s.trim();
- }
-
- private void initOptionTable() {
- if (ffc.getBuildOptionsOptCount() == 0) {
- //ToDo get default options from *.txt file
- return;
- }
- String[][] saa = new String[ffc.getBuildOptionsOptCount()][6];
- ffc.getBuildOptionsOpts(saa);
- for (int i = 0; i < saa.length; ++i) {
- optionsTableModel.addRow(saa[i]);
- }
- }
-
-
- /**
- * Everything below should pertain to the ANT Task Tab
- */
-
- /**
- * This method initializes jButton12
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskFileBrowse() {
- if (jButtonAntTaskFileBrowse == null) {
- jButtonAntTaskFileBrowse = new JButton();
- jButtonAntTaskFileBrowse.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
- jButtonAntTaskFileBrowse.setText("Browse");
- jButtonAntTaskFileBrowse.addActionListener(new AbstractAction() {
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- //
- // Select files from current workspace
- //
- String dirPrefix = Workspace.getCurrentWorkspace();
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- int retval = chooser.showOpenDialog(FpdBuildOptions.this);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(FpdBuildOptions.this, "You can only select files in current package!");
- return;
- }
- } else {
- return;
- }
-
- headerDest = theFile.getPath();
- jTextFieldAntTaskFile.setText(headerDest.substring(dirPrefix.length()).replace('\\', '/'));
-
- }
-
- });
- }
- return jButtonAntTaskFileBrowse;
- }
-
- /**
- * This method initializes jPanelUserDefCenterN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelUserDefCenterN() {
- if (jPanelUserDefCenterN == null) {
- jPanelUserDefCenterN = new JPanel();
- jPanelUserDefCenterN.add(jLabelAntCmdOpts, null);
- jPanelUserDefCenterN.add(getJTextFieldAntCmdOpts(), null);
- jPanelUserDefCenterN.add(getJButtonAntTaskAdd(), null);
- jPanelUserDefCenterN.add(getJButtonAntTaskDel(), null);
- }
- return jPanelUserDefCenterN;
- }
-
- /**
- * This method initializes jPanel8
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelUserDef() {
- if (jPanelUserDef == null) {
- jPanelUserDef = new JPanel();
- jPanelUserDef.setLayout(new BorderLayout());
- jPanelUserDef.add(getJPanelUserDefNorth(), java.awt.BorderLayout.NORTH);
- jPanelUserDef.add(getJPanelUserDefCenter(), java.awt.BorderLayout.CENTER);
-
- }
- return jPanelUserDef;
- }
-
- /**
- * This method initializes jPanel9
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelUserDefNorth() {
- if (jPanelUserDefNorth == null) {
- jLabelAntTaskFile = new JLabel();
- jLabelAntTaskFile.setText("ANT Task File");
- jLabelAntTaskFile.setPreferredSize(new java.awt.Dimension(80, 20));
- FlowLayout flowLayout8 = new FlowLayout();
- flowLayout8.setAlignment(java.awt.FlowLayout.CENTER);
- jLabelAntTaskId = new JLabel();
- jLabelAntTaskId.setText("ID");
- jPanelUserDefNorth = new JPanel();
- jPanelUserDefNorth.setLayout(flowLayout8);
- jPanelUserDefNorth.add(jLabelAntTaskFile, null);
- jPanelUserDefNorth.add(getJTextFieldAntTaskFile(), null);
- jPanelUserDefNorth.add(getJButtonAntTaskFileBrowse(), null);
- jPanelUserDefNorth.add(jLabelAntTaskId, null);
- jPanelUserDefNorth.add(getJTextFieldAntTaskId(), null);
- }
- return jPanelUserDefNorth;
- }
-
- /**
- * This method initializes jPanel11
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelUserDefCenter() {
- if (jPanelUserDefCenter == null) {
- jLabelAntCmdOpts = new JLabel();
- jLabelAntCmdOpts.setText("ANT Command Options");
- jLabelAntCmdOpts.setPreferredSize(new java.awt.Dimension(131, 20));
- jPanelUserDefCenter = new JPanel();
- jPanelUserDefCenter.setLayout(new BorderLayout());
-
- jPanelUserDefCenter.add(getJPanelUserDefCenterN(), java.awt.BorderLayout.NORTH);
- jPanelUserDefCenter.add(getJScrollPaneAntTasks(), java.awt.BorderLayout.CENTER);
- }
- return jPanelUserDefCenter;
- }
-
- /**
- * This method initializes jTextField2
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldAntTaskFile() {
- if (jTextFieldAntTaskFile == null) {
- jTextFieldAntTaskFile = new JTextField();
- jTextFieldAntTaskFile.setPreferredSize(new java.awt.Dimension(200, 20));
- }
- return jTextFieldAntTaskFile;
- }
-
- /**
- * This method initializes jTextField3
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldAntTaskId() {
- if (jTextFieldAntTaskId == null) {
- jTextFieldAntTaskId = new JTextField();
- jTextFieldAntTaskId.setPreferredSize(new java.awt.Dimension(100, 20));
- }
- return jTextFieldAntTaskId;
- }
-
- /**
- * This method initializes jButton4
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskAdd() {
- if (jButtonAntTaskAdd == null) {
- jButtonAntTaskAdd = new JButton();
- jButtonAntTaskAdd.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonAntTaskAdd.setText("Add");
- jButtonAntTaskAdd.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (!DataValidation.isInt(jTextFieldAntTaskId.getText())
- || jTextFieldAntTaskId.getText().length() != 8) {
- JOptionPane.showMessageDialog(FpdBuildOptions.this, "ID must be an 8-digit integer.");
- return;
- }
- Object[] o = { jTextFieldAntTaskId.getText(), null, null };
- o[1] = jTextFieldAntTaskFile.getText();
- o[2] = jTextFieldAntCmdOpts.getText();
- ffc.genBuildOptionsUserDefAntTask(o[0] + "", o[1] + "", o[2] + "");
- antTaskTableModel.addRow(o);
- docConsole.setSaved(false);
- }
- });
- }
- return jButtonAntTaskAdd;
- }
-
- /**
- * This method initializes jButton5
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAntTaskDel() {
- if (jButtonAntTaskDel == null) {
- jButtonAntTaskDel = new JButton();
- jButtonAntTaskDel.setPreferredSize(new java.awt.Dimension(90, 20));
- jButtonAntTaskDel.setText("Delete");
- jButtonAntTaskDel.addActionListener(new ActionListener() {
- public void actionPerformed(ActionEvent e) {
- if (selectedRow >= 0) {
- docConsole.setSaved(false);
- antTaskTableModel.removeRow(selectedRow);
- ffc.removeBuildOptionsUserDefAntTask(selectedRow);
- }
- }
- });
- }
- return jButtonAntTaskDel;
- }
-
- /**
- * This method initializes jTextField4
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldAntCmdOpts() {
- if (jTextFieldAntCmdOpts == null) {
- jTextFieldAntCmdOpts = new JTextField();
- jTextFieldAntCmdOpts.setPreferredSize(new java.awt.Dimension(270, 20));
- jTextFieldAntCmdOpts.setEnabled(true);
- }
- return jTextFieldAntCmdOpts;
- }
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneAntTasks() {
- if (jScrollPaneAntTasks == null) {
- jScrollPaneAntTasks = new JScrollPane();
- jScrollPaneAntTasks.setPreferredSize(new java.awt.Dimension(600, 400));
- jScrollPaneAntTasks.setViewportView(getJTableAntTasks());
- }
- return jScrollPaneAntTasks;
- }
-
- /**
- * This method initializes jTable2
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableAntTasks() {
- if (jTableAntTasks == null) {
- antTaskTableModel = new DefaultTableModel();
- jTableAntTasks = new JTable(antTaskTableModel);
- jTableAntTasks.setRowHeight(20);
- antTaskTableModel.addColumn("ID");
- antTaskTableModel.addColumn("Filename");
- antTaskTableModel.addColumn("ANT Command Options");
-
- jTableAntTasks.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableAntTasks.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- selectedRow = -1;
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTableAntTasks.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String id = m.getValueAt(row, 0) + "";
- String file = m.getValueAt(row, 1) + "";
- String execOrder = m.getValueAt(row, 2) + "";
- if (id.length() == 0) {
- return;
- }
- if (file.length() == 0 && execOrder.length() == 0) {
- return;
- }
- if (file.length() == 0) {
- file = null;
- }
- if (execOrder.length() == 0) {
- execOrder = null;
- }
- ffc.updateBuildOptionsUserDefAntTask(row, id, file, execOrder);
-
- }
- }
- });
- }
- return jTableAntTasks;
- }
-
- private void initAntTaskTable() {
- if (ffc.getBuildOptionsUserDefAntTaskCount() == 0) {
- return;
- }
- String[][] saa = new String[ffc.getBuildOptionsUserDefAntTaskCount()][3];
- ffc.getBuildOptionsUserDefAntTasks(saa);
- for (int i = 0; i < saa.length; ++i) {
- antTaskTableModel.addRow(saa[i]);
- }
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
deleted file mode 100644
index c7a455ed91..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdDynamicPcdBuildDefinitions.java
+++ /dev/null
@@ -1,774 +0,0 @@
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-
-import javax.swing.ButtonGroup;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import javax.swing.JCheckBox;
-import javax.swing.JRadioButton;
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JTextField;
-import java.awt.GridLayout;
-import java.util.ArrayList;
-
-public class FpdDynamicPcdBuildDefinitions extends IInternalFrame {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private JPanel jContentPane = null;
- private JScrollPane jScrollPaneDynPcd = null;
- private JTable jTableDynPcd = null;
- private DynPcdTableModel modelPcd = null;
- private DynPcdTableModel modelSku = null;
- private FpdFileContents ffc = null;
- private OpeningPlatformType docConsole = null;
- private JPanel jPanelSkuInfo = null;
- private JCheckBox jCheckBoxSkuEnable = null;
- private JPanel jPanelDynPcdValue = null;
- private JRadioButton jRadioButtonHii = null;
- private JRadioButton jRadioButtonVpd = null;
- private JScrollPane jScrollPaneSkuInfo = null;
- private JTable jTableSkuInfo = null;
- private JButton jButtonSkuInfoUpdate = null;
- private JLabel jLabelVarName = null;
- private JTextField jTextFieldVarName = null;
- private JLabel jLabelVarGuid = null;
- private JTextField jTextFieldVarGuid = null;
- private JLabel jLabelPad = null;
- private JLabel jLabelVarOffset = null;
- private JTextField jTextFieldVarOffset = null;
- private JLabel jLabelHiiDefaultValue = null;
- private JTextField jTextFieldHiiDefaultValue = null;
- private JTextField jTextFieldVpdOffset = null;
- private JLabel jLabelVpdOffset = null;
- private JTextField jTextFieldDefaultValue = null;
- private JRadioButton jRadioButtonDefaultValue = null;
- private ButtonGroup bg = new ButtonGroup();
- private JLabel jLabelPadd = null;
- private JLabel jLabelPad1 = null;
- private JScrollPane jScrollPane = null;
- /**
- * This is the default constructor
- */
- public FpdDynamicPcdBuildDefinitions() {
- super();
- initialize();
- }
-
- public FpdDynamicPcdBuildDefinitions(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd){
- this();
- init(fpd);
- }
-
- public FpdDynamicPcdBuildDefinitions(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- }
-
- public void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- if (ffc == null) {
- ffc = new FpdFileContents(fpd);
- ffc.initDynPcdMap();
- }
- String[][] saa = new String[ffc.getDynamicPcdBuildDataCount()][5];
- ffc.getDynamicPcdBuildData(saa);
- for (int i = 0; i < saa.length; ++i) {
- modelPcd.addRow(saa[i]);
- }
-
- saa = new String[ffc.getPlatformDefsSkuInfoCount()][2];
- ffc.getPlatformDefsSkuInfos(saa);
- for (int i = 0; i < saa.length; ++i) {
- modelSku.addRow(saa[i]);
- }
-
- }
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(661, 558);
- this.setTitle("Dynamic PCD Build Definitions");
- this.setContentPane(getJContentPane());
- this.setVisible(true);
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJScrollPaneDynPcd(), java.awt.BorderLayout.NORTH);
- jContentPane.add(getJPanelSkuInfo(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneDynPcd() {
- if (jScrollPaneDynPcd == null) {
- jScrollPaneDynPcd = new JScrollPane();
- jScrollPaneDynPcd.setPreferredSize(new java.awt.Dimension(100,250));
- jScrollPaneDynPcd.setViewportView(getJTableDynPcd());
- }
- return jScrollPaneDynPcd;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableDynPcd() {
- if (jTableDynPcd == null) {
- modelPcd = new DynPcdTableModel();
- modelPcd.addColumn("CName");
- modelPcd.addColumn("Token");
- modelPcd.addColumn("TokenSpaceGuid");
- modelPcd.addColumn("MaxDatumSize");
- modelPcd.addColumn("DatumType");
- jTableDynPcd = new JTable(modelPcd);
- jTableDynPcd.setRowHeight(20);
- TableColumn tokenColumn = jTableDynPcd.getColumnModel().getColumn(1);
- jTableDynPcd.removeColumn(tokenColumn);
- jTableDynPcd.getColumnModel().getColumn(0).setMinWidth(250);
-
- jTableDynPcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableDynPcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- int selectedRow = lsm.getMinSelectionIndex();
- jTextFieldDefaultValue.setText("");
- jTextFieldVpdOffset.setText("");
- jTextFieldVarName.setText("");
- jTextFieldVarGuid.setText("");
- jTextFieldVarOffset.setText("");
- jTextFieldHiiDefaultValue.setText("");
- displayDetails(selectedRow);
- }
- }
- });
- }
- return jTableDynPcd;
- }
- //
- // should display default sku info here, as no selection event of table1 will be triggered when change selection of rows in table.
- //
- private void displayDetails(int i) {
- int defaultSkuRow = getDefaultSkuInfoRow();
- jTableSkuInfo.changeSelection(defaultSkuRow, 0, false, false);
-
- int skuCount = ffc.getDynamicPcdSkuInfoCount(i);
- String defaultVal = ffc.getDynamicPcdBuildDataValue(i);
- if (defaultVal != null) {
- jRadioButtonDefaultValue.setSelected(true);
- jTextFieldDefaultValue.setText(defaultVal);
- if ( skuCount == 1) {
- jCheckBoxSkuEnable.setSelected(false);
- }
- else{
- jCheckBoxSkuEnable.setSelected(true);
- }
- }
-
- else if (ffc.getDynamicPcdBuildDataVpdOffset(i) != null) {
- jRadioButtonVpd.setSelected(true);
- jTextFieldVpdOffset.setText(ffc.getDynamicPcdBuildDataVpdOffset(i));
- if (skuCount ==1) {
- jCheckBoxSkuEnable.setSelected(false);
-
- }
- else{
- jCheckBoxSkuEnable.setSelected(true);
- }
- }
- else {
- jRadioButtonHii.setSelected(true);
- String[][] saa = new String[ffc.getDynamicPcdSkuInfoCount(i)][7];
- ffc.getDynamicPcdSkuInfos(i, saa);
-
- String varDisplayName = Tools.convertUnicodeHexStringToString(saa[0][1]);
- jTextFieldVarName.setText(varDisplayName);
-
- jTextFieldVarGuid.setText(saa[0][2]);
- jTextFieldVarOffset.setText(saa[0][3]);
- jTextFieldHiiDefaultValue.setText(saa[0][4]);
- if (skuCount ==1) {
- jCheckBoxSkuEnable.setSelected(false);
- }
- else{
- jCheckBoxSkuEnable.setSelected(true);
- }
- }
-
- }
-
- private void displaySkuInfoDetails(String id) {
- int pcdSelected = jTableDynPcd.getSelectedRow();
- if (pcdSelected < 0) {
- return;
- }
-
- int skuInfoCount = ffc.getDynamicPcdSkuInfoCount(pcdSelected);
- String[][] saa = new String[skuInfoCount][7];
- ffc.getDynamicPcdSkuInfos(pcdSelected, saa);
- int i = 0;
- while (i < skuInfoCount) {
- if (id.equals(saa[i][0])) {
- if (saa[i][5] != null){
- jRadioButtonVpd.setSelected(true);
- jTextFieldVpdOffset.setText(saa[i][5]);
- }
-
- else if (saa[i][1] != null) {
- jRadioButtonHii.setSelected(true);
- String varDisplayName = Tools.convertUnicodeHexStringToString(saa[i][1]);
- jTextFieldVarName.setText(varDisplayName);
- jTextFieldVarGuid.setText(saa[i][2]);
- jTextFieldVarOffset.setText(saa[i][3]);
- jTextFieldHiiDefaultValue.setText(saa[i][4]);
- }
-
- else{
- jRadioButtonDefaultValue.setSelected(true);
- jTextFieldDefaultValue.setText(saa[i][6]);
- }
- return;
- }
- ++i;
- }
- }
-
- private int getDefaultSkuInfoRow () {
- for (int i = 0; i < modelSku.getRowCount(); ++i) {
- if (modelSku.getValueAt(i, 0).equals("0")) {
- return i;
- }
- }
- return 0;
- }
-
- /**
- * This method initializes jPanel3
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelSkuInfo() {
- if (jPanelSkuInfo == null) {
- jPanelSkuInfo = new JPanel();
- jPanelSkuInfo.setLayout(new BorderLayout());
- jPanelSkuInfo.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
- jPanelSkuInfo.setPreferredSize(new java.awt.Dimension(600,120));
-
-// jPanelSkuInfo.add(getJPanelSkuInfoN(), java.awt.BorderLayout.NORTH);
- jPanelSkuInfo.add(getJScrollPane(), java.awt.BorderLayout.NORTH);
- jPanelSkuInfo.add(getJScrollPaneSkuInfo(), java.awt.BorderLayout.CENTER);
-
-
-// jPanelSkuInfo.add(getJPanelDynPcdValue(), java.awt.BorderLayout.SOUTH);
- }
- return jPanelSkuInfo;
- }
-
- /**
- * This method initializes jCheckBox
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxSkuEnable() {
- if (jCheckBoxSkuEnable == null) {
- jCheckBoxSkuEnable = new JCheckBox();
- jCheckBoxSkuEnable.setText("SKU Enable");
- jCheckBoxSkuEnable.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (!jCheckBoxSkuEnable.isSelected()) {
- int defaultSkuRow = getDefaultSkuInfoRow();
- jTableSkuInfo.changeSelection(defaultSkuRow, 0, false, false);
- }
- jTableSkuInfo.setEnabled(jCheckBoxSkuEnable.isSelected());
- }
- });
- }
- return jCheckBoxSkuEnable;
- }
-
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelDynPcdValue() {
- if (jPanelDynPcdValue == null) {
- jLabelPad1 = new JLabel();
- jLabelPad1.setText(" ");
- GridLayout gridLayout = new GridLayout();
- gridLayout.setColumns(5);
- gridLayout.setRows(4);
- gridLayout.setHgap(20);
- gridLayout.setVgap(20);
-
- jLabelVpdOffset = new JLabel();
- jLabelVpdOffset.setPreferredSize(new java.awt.Dimension(80,20));
- jLabelVpdOffset.setText("VPD Offset");
- jLabelHiiDefaultValue = new JLabel();
- jLabelHiiDefaultValue.setPreferredSize(new java.awt.Dimension(100,20));
- jLabelHiiDefaultValue.setText("HII Default Value");
- jLabelVarOffset = new JLabel();
- jLabelVarOffset.setText("Variable Offset");
- jLabelVarOffset.setPreferredSize(new java.awt.Dimension(90,20));
- jLabelPad = new JLabel();
- jLabelPad.setText(" ");
- jLabelVarGuid = new JLabel();
- jLabelVarGuid.setText("Variable GUID");
- jLabelVarGuid.setPreferredSize(new java.awt.Dimension(100,20));
- jLabelVarName = new JLabel();
- jLabelVarName.setText("Variable Name");
- jLabelVarName.setToolTipText("");
- jLabelVarName.setPreferredSize(new java.awt.Dimension(90,20));
- jPanelDynPcdValue = new JPanel();
- jPanelDynPcdValue.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));
- jPanelDynPcdValue.setPreferredSize(new java.awt.Dimension(1000,150));
- jPanelDynPcdValue.setLayout(gridLayout);
- jPanelDynPcdValue.add(getJRadioButtonHii(), null);
- jPanelDynPcdValue.add(jLabelVarName, null);
- jPanelDynPcdValue.add(getJTextFieldVarName(), null);
- jPanelDynPcdValue.add(jLabelVarGuid, null);
- jPanelDynPcdValue.add(getJTextFieldVarGuid(), null);
- jPanelDynPcdValue.add(jLabelPad, null);
- jPanelDynPcdValue.add(jLabelVarOffset, null);
- jPanelDynPcdValue.add(getJTextFieldVarOffset(), null);
- jPanelDynPcdValue.add(jLabelHiiDefaultValue, null);
- jPanelDynPcdValue.add(getJTextFieldHiiDefaultValue(), null);
- jPanelDynPcdValue.add(getJRadioButtonVpd(), null);
- jPanelDynPcdValue.add(jLabelVpdOffset, null);
- jLabelPadd = new JLabel();
- jLabelPadd.setText(" ");
- jPanelDynPcdValue.add(getJTextFieldVpdOffset(), null);
- jLabelVarName.setEnabled(false);
- jLabelVarGuid.setEnabled(false);
- jLabelHiiDefaultValue.setEnabled(false);
- jLabelVarOffset.setEnabled(false);
- jLabelVpdOffset.setEnabled(false);
- jPanelDynPcdValue.add(jLabelPadd, null);
- jPanelDynPcdValue.add(jLabelPad1, null);
- jPanelDynPcdValue.add(getJRadioButtonDefaultValue(), null);
- jPanelDynPcdValue.add(getJTextFieldDefaultValue(), null);
- jPanelDynPcdValue.add(getJCheckBoxSkuEnable(), null);
- jPanelDynPcdValue.add(getJButtonSkuInfoUpdate(), null);
- bg.add(jRadioButtonHii);
- bg.add(jRadioButtonVpd);
- }
-
- return jPanelDynPcdValue;
- }
-
- /**
- * This method initializes jRadioButton
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonHii() {
- if (jRadioButtonHii == null) {
- jRadioButtonHii = new JRadioButton();
- jRadioButtonHii.setText("HII Enable");
- jRadioButtonHii.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- boolean selected = jRadioButtonHii.isSelected();
- jLabelVarName.setEnabled(selected);
- jLabelVarGuid.setEnabled(selected);
- jLabelPad.setEnabled(selected);
- jLabelVarOffset.setEnabled(selected);
- jLabelHiiDefaultValue.setEnabled(selected);
- jTextFieldVarName.setEnabled(selected);
- jTextFieldVarGuid.setEnabled(selected);
- jTextFieldVarOffset.setEnabled(selected);
- jTextFieldHiiDefaultValue.setEnabled(selected);
- }
- });
- }
- return jRadioButtonHii;
- }
-
- /**
- * This method initializes jRadioButton1
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonVpd() {
- if (jRadioButtonVpd == null) {
- jRadioButtonVpd = new JRadioButton();
- jRadioButtonVpd.setText("VPD Enable");
- jRadioButtonVpd.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- boolean selected = jRadioButtonVpd.isSelected();
- jTextFieldVpdOffset.setEnabled(selected);
- jLabelVpdOffset.setEnabled(selected);
- }
- });
- }
- return jRadioButtonVpd;
- }
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneSkuInfo() {
- if (jScrollPaneSkuInfo == null) {
- jScrollPaneSkuInfo = new JScrollPane();
- jScrollPaneSkuInfo.setPreferredSize(new java.awt.Dimension(300,50));
- jScrollPaneSkuInfo.setViewportView(getJTableSkuInfo());
- }
- return jScrollPaneSkuInfo;
- }
-
- /**
- * This method initializes jTable1
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableSkuInfo() {
- if (jTableSkuInfo == null) {
- modelSku = new DynPcdTableModel();
- jTableSkuInfo = new JTable(modelSku);
- modelSku.addColumn("SKU ID");
- modelSku.addColumn("SKU Name");
- jTableSkuInfo.setEnabled(false);
- jTableSkuInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableSkuInfo.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (jTableDynPcd.getSelectedRow() < 0) {
- return;
- }
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- jTextFieldDefaultValue.setText("");
- jTextFieldVpdOffset.setText("");
- jTextFieldVarName.setText("");
- jTextFieldVarGuid.setText("");
- jTextFieldVarOffset.setText("");
- jTextFieldHiiDefaultValue.setText("");
- int selected = lsm.getMinSelectionIndex();
- String skuId = modelSku.getValueAt(selected, 0)+"";
- displaySkuInfoDetails(skuId);
- }
- }
- });
- }
- return jTableSkuInfo;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonSkuInfoUpdate() {
- if (jButtonSkuInfoUpdate == null) {
- jButtonSkuInfoUpdate = new JButton();
- jButtonSkuInfoUpdate.setPreferredSize(new java.awt.Dimension(180,20));
- jButtonSkuInfoUpdate.setText("Update SKU Value");
- FontMetrics fm = jButtonSkuInfoUpdate.getFontMetrics(jButtonSkuInfoUpdate.getFont());
- jButtonSkuInfoUpdate.setPreferredSize(new Dimension (fm.stringWidth(jButtonSkuInfoUpdate.getText()) + 40, 20));
- jButtonSkuInfoUpdate.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int pcdSelected = jTableDynPcd.getSelectedRow();
- if (pcdSelected < 0) {
- return;
- }
- docConsole.setSaved(false);
- updateSkuInfo(pcdSelected);
-
- }
- });
- }
- return jButtonSkuInfoUpdate;
- }
-
- private void updateSkuInfo (int pcdSelected) {
- int skuCount = ffc.getDynamicPcdSkuInfoCount(pcdSelected);
- String cName = modelPcd.getValueAt(pcdSelected, 0)+"";
- String tsGuid = modelPcd.getValueAt(pcdSelected, 2)+"";
-
- String varName = null;
- String varGuid = null;
- String varOffset = null;
- String hiiDefault = null;
- String value = null;
- String vpdOffset = null;
- if (jRadioButtonHii.isSelected()) {
- varName = Tools.convertStringToUnicodeHexString(jTextFieldVarName.getText());
- if (varName.length() == 0) {
- JOptionPane.showMessageDialog(this, "Variable Name is Empty.");
- return;
- }
- varGuid = jTextFieldVarGuid.getText();
- if (varGuid.length() == 0) {
- JOptionPane.showMessageDialog(this, "Variable GUID is Empty.");
- return;
- }
- varOffset = jTextFieldVarOffset.getText();
- if (!DataValidation.isHex64BitDataType(varOffset)) {
- JOptionPane.showMessageDialog(this, "Variable Offset is NOT Hex64BitDataType.");
- return;
- }
- hiiDefault = jTextFieldHiiDefaultValue.getText();
- if (!DataValidation.isDefaultValueType(hiiDefault)) {
- JOptionPane.showMessageDialog(this, "Default Value is NOT DefaultValueType.");
- return;
- }
- }
- if (jRadioButtonVpd.isSelected()) {
- vpdOffset = jTextFieldVpdOffset.getText();
- if (!DataValidation.isHex64BitDataType(vpdOffset)) {
- JOptionPane.showMessageDialog(this, "VPD Offset is NOT Hex64BitDataType.");
- return;
- }
- }
- if (jRadioButtonDefaultValue.isSelected()) {
- value = jTextFieldDefaultValue.getText();
- if (!DataValidation.isDefaultValueType(value)) {
- JOptionPane.showMessageDialog(this, "Value is NOT DefaultValueType.");
- return;
- }
- }
- //
- // SKU disabled. only modify data for default SKU.
- //
- if (!jCheckBoxSkuEnable.isSelected()) {
- if (true) {
- ffc.removeDynamicPcdBuildDataSkuInfo(pcdSelected);
- if (jRadioButtonHii.isSelected()) {
- ffc.genDynamicPcdBuildDataSkuInfo("0", varName, varGuid, varOffset, hiiDefault, null, null, pcdSelected);
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- if (al == null) {
- return;
- }
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- ffc.updatePcdData(mKey, cName, tsGuid, null, null, hiiDefault);
- }
- }
- else if (jRadioButtonVpd.isSelected()){
- ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, vpdOffset, null, pcdSelected);
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- if (al == null) {
- return;
- }
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- ffc.updatePcdData(mKey, cName, tsGuid, null, null, vpdOffset);
- }
- }
- else{
- ffc.genDynamicPcdBuildDataSkuInfo("0", null, null, null, null, null, value, pcdSelected);
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- if (al == null) {
- return;
- }
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- ffc.updatePcdData(mKey, cName, tsGuid, null, null, value);
- }
- }
- }
- }
- //
- // SKU Enabled, need add data to all SKUs.
- //
- if (jCheckBoxSkuEnable.isSelected()) {
- if (skuCount == 1) {
-
- for (int i = 1; i < jTableSkuInfo.getRowCount(); ++i) {
- ffc.genDynamicPcdBuildDataSkuInfo(modelSku.getValueAt(i, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
- }
- }
- else {
- int row = jTableSkuInfo.getSelectedRow();
- if (row < 0) {
- return;
- }
- ffc.updateDynamicPcdBuildDataSkuInfo(modelSku.getValueAt(row, 0)+"", varName, varGuid, varOffset, hiiDefault, vpdOffset, value, pcdSelected);
- }
- }
- }
-
- private String moduleInfo (String pcdInfo) {
-
- return pcdInfo.substring(0, pcdInfo.lastIndexOf(" "));
- }
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVarName() {
- if (jTextFieldVarName == null) {
- jTextFieldVarName = new JTextField();
- jTextFieldVarName.setPreferredSize(new java.awt.Dimension(150,20));
- jTextFieldVarName.setEnabled(false);
- }
- return jTextFieldVarName;
- }
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVarGuid() {
- if (jTextFieldVarGuid == null) {
- jTextFieldVarGuid = new JTextField();
- jTextFieldVarGuid.setPreferredSize(new java.awt.Dimension(150,20));
- jTextFieldVarGuid.setEnabled(false);
- }
- return jTextFieldVarGuid;
- }
-
- /**
- * This method initializes jTextField2
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVarOffset() {
- if (jTextFieldVarOffset == null) {
- jTextFieldVarOffset = new JTextField();
- jTextFieldVarOffset.setPreferredSize(new java.awt.Dimension(150,20));
- jTextFieldVarOffset.setEnabled(false);
- }
- return jTextFieldVarOffset;
- }
-
- /**
- * This method initializes jTextField3
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldHiiDefaultValue() {
- if (jTextFieldHiiDefaultValue == null) {
- jTextFieldHiiDefaultValue = new JTextField();
- jTextFieldHiiDefaultValue.setPreferredSize(new java.awt.Dimension(150,20));
- jTextFieldHiiDefaultValue.setEnabled(false);
- }
- return jTextFieldHiiDefaultValue;
- }
-
- /**
- * This method initializes jTextField4
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldVpdOffset() {
- if (jTextFieldVpdOffset == null) {
- jTextFieldVpdOffset = new JTextField();
- jTextFieldVpdOffset.setPreferredSize(new java.awt.Dimension(150,20));
- jTextFieldVpdOffset.setEnabled(false);
- }
- return jTextFieldVpdOffset;
- }
-
- /**
- * This method initializes jTextField5
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldDefaultValue() {
- if (jTextFieldDefaultValue == null) {
- jTextFieldDefaultValue = new JTextField();
- jTextFieldDefaultValue.setPreferredSize(new java.awt.Dimension(150,20));
- }
- return jTextFieldDefaultValue;
- }
-
- /**
- * This method initializes jRadioButton2
- *
- * @return javax.swing.JRadioButton
- */
- private JRadioButton getJRadioButtonDefaultValue() {
- if (jRadioButtonDefaultValue == null) {
- jRadioButtonDefaultValue = new JRadioButton();
- jRadioButtonDefaultValue.setText("Default PCD Value");
- jRadioButtonDefaultValue.setSelected(true);
- jRadioButtonDefaultValue.setPreferredSize(new java.awt.Dimension(175,20));
- jRadioButtonDefaultValue.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- jTextFieldDefaultValue.setEnabled(jRadioButtonDefaultValue.isSelected());
- }
- });
- bg.add(jRadioButtonDefaultValue);
- }
- return jRadioButtonDefaultValue;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setPreferredSize(new java.awt.Dimension(1003,180));
- jScrollPane.setViewportView(getJPanelDynPcdValue());
- }
- return jScrollPane;
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
-
-class DynPcdTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
-
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
deleted file mode 100644
index c5f854a7e8..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFileContents.java
+++ /dev/null
@@ -1,3818 +0,0 @@
-/** @file
- Java class FpdFileContents is used to parse fpd xml file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.io.File;
-import java.io.IOException;
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.tianocore.AntTaskDocument;
-import org.tianocore.BuildOptionsDocument;
-import org.tianocore.DynamicPcdBuildDefinitionsDocument;
-import org.tianocore.EfiSectionType;
-import org.tianocore.FlashDefinitionFileDocument;
-import org.tianocore.FlashDocument;
-import org.tianocore.FrameworkModulesDocument;
-import org.tianocore.IntermediateOutputType;
-import org.tianocore.LibrariesDocument;
-import org.tianocore.ModuleSADocument;
-import org.tianocore.ModuleSaBuildOptionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.OptionDocument;
-import org.tianocore.OptionsDocument;
-import org.tianocore.PcdBuildDefinitionDocument;
-import org.tianocore.PcdCodedDocument;
-import org.tianocore.PcdDataTypes;
-import org.tianocore.PcdDeclarationsDocument;
-import org.tianocore.PcdItemTypes;
-import org.tianocore.PlatformDefinitionsDocument;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.FvImageTypes;
-import org.tianocore.FvImagesDocument;
-import org.tianocore.LicenseDocument;
-import org.tianocore.PlatformHeaderDocument;
-import org.tianocore.SkuInfoDocument;
-import org.tianocore.UserDefinedAntTasksDocument;
-import org.tianocore.UserExtensionsDocument;
-import org.tianocore.LibrariesDocument.Libraries.Instance;
-import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
-import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-/**
- This class processes fpd file contents such as add remove xml elements.
- @since PackageEditor 1.0
-**/
-public class FpdFileContents {
-
- static final String xmlNs = "http://www.TianoCore.org/2006/Edk2.0";
- static final String regExpNewLineAndSpaces = "((\n)|(\r\n)|(\r)|(\u0085)|(\u2028)|(\u2029))(\\s)*";
-
- private PlatformSurfaceAreaDocument fpdd = null;
-
- private PlatformSurfaceAreaDocument.PlatformSurfaceArea fpdRoot = null;
-
- private PlatformHeaderDocument.PlatformHeader fpdHdr = null;
-
- private PlatformDefinitionsDocument.PlatformDefinitions fpdPlatformDefs = null;
-
- private FlashDocument.Flash fpdFlash = null;
-
- private BuildOptionsDocument.BuildOptions fpdBuildOpts = null;
-
- private FrameworkModulesDocument.FrameworkModules fpdFrameworkModules = null;
-
- private DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions fpdDynPcdBuildDefs = null;
-
- private HashMap<String, ArrayList<String>> dynPcdMap = null;
-
- private HashMap<String, String> defaultPcdValue = new HashMap<String, String>();
-
- private String itemType (String pcdInfo) {
-
- return pcdInfo.substring(pcdInfo.lastIndexOf(" ") + 1);
- }
-
- /**
- * look through all pcd data in all ModuleSA, create pcd -> ModuleSA mappings.
- */
- public void initDynPcdMap() {
- if (dynPcdMap == null) {
- dynPcdMap = new HashMap<String, ArrayList<String>>();
- List<ModuleSADocument.ModuleSA> l = getfpdFrameworkModules().getModuleSAList();
- if (l == null) {
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return;
- }
- ListIterator<ModuleSADocument.ModuleSA> li = l.listIterator();
- while (li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = li.next();
- if (moduleSa.getPcdBuildDefinition() == null || moduleSa.getPcdBuildDefinition().getPcdDataList() == null) {
- continue;
- }
- String ModuleInfo = moduleSa.getModuleGuid().toLowerCase() + " " + moduleSa.getModuleVersion() +
- " " + moduleSa.getPackageGuid().toLowerCase() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList());
- List<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lp = moduleSa.getPcdBuildDefinition().getPcdDataList();
- ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> lpi = lp.listIterator();
- while (lpi.hasNext()) {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = lpi.next();
- String pcdKey = pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName();
- if (dynPcdMap.get(pcdKey) == null) {
- ArrayList<String> al = new ArrayList<String>();
- al.add(ModuleInfo + " " + pcdData.getItemType().toString());
- dynPcdMap.put(pcdKey, al);
- }
- else{
- dynPcdMap.get(pcdKey).add(ModuleInfo + " " + pcdData.getItemType().toString());
- }
- }
- }
- }
- }
-
- public ArrayList<String> getDynPcdMapValue(String key) {
- return dynPcdMap.get(key);
- }
- /**
- Constructor to create a new spd file
- **/
- public FpdFileContents() {
-
- fpdd = PlatformSurfaceAreaDocument.Factory.newInstance();
- fpdRoot = fpdd.addNewPlatformSurfaceArea();
-
- }
-
- /**
- Constructor for existing document object
- @param psa
- **/
- public FpdFileContents(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- fpdRoot = fpd;
- fpdHdr = fpdRoot.getPlatformHeader();
- fpdPlatformDefs = fpdRoot.getPlatformDefinitions();
- fpdBuildOpts = fpdRoot.getBuildOptions();
- fpdFrameworkModules = fpdRoot.getFrameworkModules();
- fpdDynPcdBuildDefs = fpdRoot.getDynamicPcdBuildDefinitions();
- fpdFlash = fpdRoot.getFlash();
- }
-
- /**
- Constructor based on an existing spd file
-
- @param f Existing spd file
- **/
- public FpdFileContents(File f) {
- try {
- fpdd = PlatformSurfaceAreaDocument.Factory.parse(f);
- fpdRoot = fpdd.getPlatformSurfaceArea();
- } catch (Exception e) {
- System.out.println(e.toString());
- }
- }
-
- public DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions getfpdDynPcdBuildDefs() {
- if (fpdDynPcdBuildDefs == null){
- fpdDynPcdBuildDefs = fpdRoot.addNewDynamicPcdBuildDefinitions();
- }
- return fpdDynPcdBuildDefs;
- }
-
- public FrameworkModulesDocument.FrameworkModules getfpdFrameworkModules() {
- if (fpdFrameworkModules == null){
- fpdFrameworkModules = fpdRoot.addNewFrameworkModules();
- }
- return fpdFrameworkModules;
- }
-
- public void getFrameworkModuleSAByFvBinding (String fvName, Vector<String[]> vGuid) {
- if (getFrameworkModulesCount() == 0){
- return;
- }
-
- ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();
- while(li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)li.next();
- if (moduleSa.getModuleSaBuildOptions() == null) {
- continue;
- }
- String fvBinding = moduleSa.getModuleSaBuildOptions().getFvBinding();
- if (fvBinding == null) {
- continue;
- }
-
- String[] fvNames = fvBinding.split(" ");
- for (int i = 0; i < fvNames.length; ++i) {
- //
- // BugBug : underscore "_" should not be replaced!!!
- // But Fv name FVMAIN from fdf file not consist with FV_MAIN in fpd file.
- //
- if (fvNames[i].equals(fvName) || fvNames[i].replaceAll("_", "").equals(fvName)) {
- String[] sa = new String[] {moduleSa.getModuleGuid(), moduleSa.getModuleVersion(),
- moduleSa.getPackageGuid(), moduleSa.getPackageVersion(),
- listToString(moduleSa.getSupArchList())};
- vGuid.add(sa);
- break;
- }
- }
- }
- }
-
- public int getFrameworkModulesCount() {
- if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return 0;
- }
- return getfpdFrameworkModules().getModuleSAList().size();
- }
-
- public void getFrameworkModulesInfo(String[][] saa) {
- if (getFrameworkModulesCount() == 0){
- return;
- }
-
- ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();
- int i = 0;
- while(li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)li.next();
- saa[i][0] = moduleSa.getModuleGuid();
- saa[i][1] = moduleSa.getModuleVersion();
-
- saa[i][2] = moduleSa.getPackageGuid();
- saa[i][3] = moduleSa.getPackageVersion();
- saa[i][4] = listToString(moduleSa.getSupArchList());
- ++i;
- }
- }
-
- public void getFrameworkModuleInfo(int i, String[] sa) {
- ModuleSADocument.ModuleSA msa = getModuleSA(i);
- if (msa == null) {
- return;
- }
- sa[0] = msa.getModuleGuid();
- sa[1] = msa.getModuleVersion();
- sa[2] = msa.getPackageGuid();
- sa[3] = msa.getPackageVersion();
- sa[4] = listToString(msa.getSupArchList());
- }
-
- public ModuleSADocument.ModuleSA getModuleSA(String key) {
-
- if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0) {
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return null;
- }
- String[] s = key.split(" ");
- String archsInKey = "";
- if (s.length > 4) {
- for (int i = 4; i < s.length; ++i) {
- archsInKey += s[i];
- archsInKey += " ";
- }
- archsInKey = archsInKey.trim();
- }
-
- ListIterator li = getfpdFrameworkModules().getModuleSAList().listIterator();
- while(li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)li.next();
- if (moduleSa.getModuleGuid().equalsIgnoreCase(s[0]) && moduleSa.getPackageGuid().equalsIgnoreCase(s[2])) {
- if (moduleSa.getModuleVersion() != null) {
- if (!moduleSa.getModuleVersion().equals(s[1])) {
- continue;
- }
- }
- if (moduleSa.getPackageVersion() != null) {
- if (!moduleSa.getPackageVersion().equals(s[3])) {
- continue;
- }
- }
- //ToDo add arch check .
- if (moduleSa.getSupArchList() != null) {
- if (listToString(moduleSa.getSupArchList()).equals(archsInKey)) {
- return moduleSa;
- }
- }
- else {
- if (archsInKey.length() == 0) {
- return moduleSa;
- }
- }
- }
- }
- return null;
- }
-
- private ModuleSADocument.ModuleSA getModuleSA(int i) {
- ModuleSADocument.ModuleSA moduleSa = null;
- if (fpdRoot.getFrameworkModules() == null) {
- return null;
- }
- XmlCursor cursor = fpdRoot.getFrameworkModules().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- moduleSa = (ModuleSADocument.ModuleSA)cursor.getObject();
- }
- cursor.dispose();
- return moduleSa;
- }
-
- public void removeModuleSA(int i) {
- XmlObject o = fpdRoot.getFrameworkModules();
- if (o == null) {
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- //
- // remove pcd from dynPcdMap, if DynamicPcdBuildData exists, remove them too.
- //
- ModuleSADocument.ModuleSA moduleSa = (ModuleSADocument.ModuleSA)cursor.getObject();
- String moduleInfo = moduleSa.getModuleGuid() + " " + moduleSa.getModuleVersion() + " " +
- moduleSa.getPackageGuid()+ " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList());
- PcdBuildDefinitionDocument.PcdBuildDefinition pcdBuildDef = moduleSa.getPcdBuildDefinition();
- if (pcdBuildDef != null && pcdBuildDef.getPcdDataList() != null) {
- ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData> li = pcdBuildDef.getPcdDataList().listIterator();
- while(li.hasNext()) {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = li.next();
- maintainDynPcdMap(pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName(), moduleInfo);
- }
- }
-
- cursor.push();
- while (cursor.hasPrevToken()) {
- cursor.toPrevToken();
- if (!cursor.isText()) {
- break;
- }
- if (cursor.getObject() == null) {
- break;
- }
- String s = cursor.getTextValue();
- if (s.matches(regExpNewLineAndSpaces)) {
- continue;
- }
- }
-
- if (cursor.isComment()) {
- cursor.removeXml();
- }
-
- cursor.pop();
- cursor.removeXml();
- if (getFrameworkModulesCount() == 0) {
- cursor.dispose();
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return;
- }
- }
- cursor.dispose();
- }
-
- public boolean adjustPcd (String seqModuleSa, Vector<String> vExceptions) throws Exception {
- boolean dataModified = false;
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(seqModuleSa);
- int pcdCount = getPcdDataCount(seqModuleSa);
- String[][] saaModuleSaPcd = new String[pcdCount][7];
- getPcdData(seqModuleSa, saaModuleSaPcd);
- String mg = moduleSa.getModuleGuid().toLowerCase();
- String mv = moduleSa.getModuleVersion();
- String pg = moduleSa.getPackageGuid().toLowerCase();
- String pv = moduleSa.getPackageVersion();
- String arch = listToString(moduleSa.getSupArchList());
- //
- // delete pcd in ModuleSA but not in MSA files any longer.
- //
- String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch;
- int libCount = getLibraryInstancesCount(moduleKey);
- String[][] saaLib = new String[libCount][5];
- getLibraryInstances(moduleKey, saaLib);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- if (mi == null) {
- vExceptions.add("Module " + mg + " does NOT exist in workspace.");
- throw new Exception ("Module does NOT exist in workspace.");
- }
- Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>();
- //
- // create vector for module & library instance MIs.
- //
- vMi.add(mi);
- for (int j = 0; j < saaLib.length; ++j) {
- String libKey = saaLib[j][1] + " " + saaLib[j][2] + " " + saaLib[j][3] + " " + saaLib[j][4];
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(libKey);
- if (libMi != null) {
- vMi.add(libMi);
- }
- }
-
- nextPcd:for (int i = 0; i < saaModuleSaPcd.length; ++i) {
-
- for (int j = 0; j < vMi.size(); ++j) {
- ModuleIdentification nextMi = vMi.get(j);
- if (nextMi == null) {
- continue;
- }
- if (WorkspaceProfile.pcdInMsa(saaModuleSaPcd[i][0], saaModuleSaPcd[i][1], arch, nextMi)) {
- continue nextPcd;
- }
- }
- removePcdData(seqModuleSa, saaModuleSaPcd[i][0], saaModuleSaPcd[i][1]);
- dataModified = true;
- }
- //
- // add new Pcd from MSA file to ModuleSA.
- //
- for (int i = 0; i < vMi.size(); ++i) {
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea) WorkspaceProfile
- .getModuleXmlObject(vMi
- .get(i));
- if (msa.getPcdCoded() == null || msa.getPcdCoded().getPcdEntryList() == null) {
- continue;
- }
- ListIterator li = msa.getPcdCoded().getPcdEntryList().listIterator();
- msaPcdIter:while (li.hasNext()) {
- PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next();
- ArrayList<String> al = getDynPcdMapValue(msaPcd.getCName() + " " + msaPcd.getTokenSpaceGuidCName());
- if (al != null) {
- for (int j = 0; j < al.size(); ++j) {
- if (al.get(j).startsWith(moduleKey)) {
- continue msaPcdIter;
- }
- }
- }
- // Check sup arch conformance for the new PCD
- if (msaPcd.getSupArchList() != null) {
- String newPcdArch = msaPcd.getSupArchList().toString();
- if (!newPcdArch.toLowerCase().contains(arch.toLowerCase())) {
- continue;
- }
- }
-
- PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, vMi.get(i));
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);
- if (spdPcd == null) {
- //
- // ToDo Error
- //
- String errorMessage = "No Declaration for PCD Entry " + msaPcd.getCName() + " in Module "
- + mi.getName();
- if (i != 0) {
- errorMessage += " Library Instance " + vMi.get(i).getName();
- }
- vExceptions.add(errorMessage);
- throw new PcdDeclNotFound(errorMessage);
- }
- //
- // AddItem to ModuleSA PcdBuildDefinitions
- //
- String defaultVal = msaPcd.getDefaultValue() == null ? spdPcd.getDefaultValue()
- : msaPcd.getDefaultValue();
-
- genPcdData(msaPcd.getCName(), spdPcd.getToken(), msaPcd.getTokenSpaceGuidCName(),
- msaPcd.getPcdItemType().toString(), spdPcd.getDatumType() + "", defaultVal, moduleSa, spdPcd);
- dataModified = true;
- }
-
- }
-
- return dataModified;
- }
-
- private synchronized void maintainDynPcdMap(String pcdKey, String moduleInfo) {
-
- ArrayList<String> al = dynPcdMap.get(pcdKey);
- if (al == null) {
- return;
- }
- String[] s = moduleInfo.split(" ");
- for(int i = 0; i < al.size(); ++i){
- String consumer = al.get(i);
- if (consumer.contains(s[0].toLowerCase()) && consumer.contains(s[2].toLowerCase())){
- String[] consumerPart = consumer.split(" ");
- if (!consumerPart[4].equals(s[4])) {
- continue;
- }
- al.remove(consumer);
- break;
- }
- }
-
- if (al.size() == 0) {
- defaultPcdValue.remove(pcdKey);
- dynPcdMap.remove(pcdKey);
- String[] s1 = pcdKey.split(" ");
- removeDynamicPcdBuildData(s1[0], s1[1]);
- }
-
- }
- //
- // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer Arch"
- //
- public int getPcdDataCount (String key){
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
-
- if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){
- return 0;
- }
- return msa.getPcdBuildDefinition().getPcdDataList().size();
-
- }
-
- public void getPcdData (String key, String[][] saa) {
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
-
- if (msa == null || msa.getPcdBuildDefinition() == null || msa.getPcdBuildDefinition().getPcdDataList() == null){
- return;
- }
- ListIterator<PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData>li = msa.getPcdBuildDefinition().getPcdDataList().listIterator();
- for (int k = 0; k < saa.length; ++k) {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = li.next();
- saa[k][0] = pcdData.getCName();
- saa[k][1] = pcdData.getTokenSpaceGuidCName();
- saa[k][2] = pcdData.getItemType()+"";
- saa[k][3] = pcdData.getToken().toString();
- saa[k][4] = pcdData.getMaxDatumSize()+"";
- saa[k][5] = pcdData.getDatumType()+"";
- saa[k][6] = pcdData.getValue();
-
- }
- }
-
- public void removePcdData (String key, String cName, String tsGuid) {
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(key);
- if (moduleSa == null || moduleSa.getPcdBuildDefinition() == null){
- return;
- }
-
- String mg = moduleSa.getModuleGuid();
- String mv = moduleSa.getModuleVersion();
- String pg = moduleSa.getPackageGuid();
- String pv = moduleSa.getPackageVersion();
- String arch = listToString(moduleSa.getSupArchList());
- String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch;
-
- XmlCursor cursor = moduleSa.getPcdBuildDefinition().newCursor();
- if (cursor.toFirstChild()){
-
- do {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();
- if (pcdData.getCName().equals(cName) && pcdData.getTokenSpaceGuidCName().equals(tsGuid)) {
- maintainDynPcdMap(cName + " " + tsGuid, moduleKey);
- if (getPcdDataCount(key) == 1) {
- cursor.toParent();
- }
- cursor.removeXml();
- break;
- }
- }
- while(cursor.toNextSibling());
-
- }
- cursor.dispose();
- }
-
- public void updatePcdData (String key, String cName, String tsGuid, String itemType, String maxSize, String value){
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(key);
- if (moduleSa == null || moduleSa.getPcdBuildDefinition() == null){
- return;
- }
-
- XmlCursor cursor = moduleSa.getPcdBuildDefinition().newCursor();
- if (cursor.toFirstChild()){
- do {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)cursor.getObject();
- if (pcdData.getCName().equals(cName) && pcdData.getTokenSpaceGuidCName().equals(tsGuid)) {
- //
- // change item type while not updating dynPcdData????
- //
- if (itemType != null) {
- pcdData.setItemType(PcdItemTypes.Enum.forString(itemType));
- }
-
- if(pcdData.getDatumType().equals("VOID*") && maxSize != null) {
- pcdData.setMaxDatumSize(new Integer(maxSize));
- }
- //
- // if value input is null, keep old value untouched.
- //
- if (value != null) {
- pcdData.setValue(value);
- defaultPcdValue.put(cName + " " + tsGuid, value);
- }
-
- break;
- }
- }
- while(cursor.toNextSibling());
- }
- cursor.dispose();
- }
-
- /**Get original Pcd info from MSA & SPD files.
- * @param mi ModuleIdentification from which MSA & SPD come
- * @param cName PCD cName
- * @param sa Results: HelpText, Original item type.
- * @return
- */
- public boolean getPcdBuildDataInfo(ModuleIdentification mi, String cName, String tsGuid, String[] sa, Vector<String> validPcdTypes) throws Exception{
-
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea) WorkspaceProfile
- .getModuleXmlObject(mi);
- if (msa.getPcdCoded() == null) {
- return false;
- }
-
- PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, mi);
- //
- // First look through MSA pcd entries.
- //
- List<PcdCodedDocument.PcdCoded.PcdEntry> l = msa.getPcdCoded().getPcdEntryList();
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next();
- if (!msaPcd.getCName().equals(cName)) {
- continue;
- }
- if (!msaPcd.getTokenSpaceGuidCName().equals(tsGuid)) {
- continue;
- }
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);
- if (spdPcd == null || spdPcd.getValidUsage() == null) {
- //
- // ToDo Error
- //
- throw new PcdDeclNotFound(mi.getName() + " " + msaPcd.getCName());
- }
- //
- // Get Pcd help text and original item type.
- //
- sa[0] = spdPcd.getHelpText() + msaPcd.getHelpText();
- sa[1] = msaPcd.getPcdItemType() + "";
- sa[2] = msa.getModuleDefinitions().getBinaryModule() + "";
- ListIterator iter = spdPcd.getValidUsage().listIterator();
- while (iter.hasNext()) {
- String usage = iter.next().toString();
- validPcdTypes.add(usage);
- }
- return true;
- }
-
- return false;
- }
-
- private boolean multiSourcePcd (String cName, String tsGuidCName, String moduleKey) {
- int libCount = getLibraryInstancesCount(moduleKey);
- String[][] saaLib = new String[libCount][5];
- getLibraryInstances(moduleKey, saaLib);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- Vector<ModuleIdentification> vMi = new Vector<ModuleIdentification>();
- //
- // create vector for module & library instance MIs.
- //
- vMi.add(mi);
- for (int j = 0; j < saaLib.length; ++j) {
- String libKey = saaLib[j][1] + " " + saaLib[j][2] + " " + saaLib[j][3] + " " + saaLib[j][4];
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(libKey);
- vMi.add(libMi);
- }
-
- int pcdSourceCount = 0;
- for (int i = 0; i < vMi.size(); ++i) {
- if (WorkspaceProfile.pcdInMsa(cName, tsGuidCName, null, vMi.get(i))) {
- pcdSourceCount++;
- }
- }
-
- if (pcdSourceCount < 2) {
- return false;
- }
- else {
- return true;
- }
-
- }
-
- /**Remove PCDBuildDefinition entries from ModuleSA
- * @param moduleKey identifier of ModuleSA.
- * @param consumer where these entries come from.
- */
- public void removePcdData(String moduleKey, ModuleIdentification consumer) {
-
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)WorkspaceProfile.getModuleXmlObject(consumer);
- if (msa.getPcdCoded() == null) {
- return;
- }
-
- List<PcdCodedDocument.PcdCoded.PcdEntry> l = msa.getPcdCoded().getPcdEntryList();
- ListIterator li = l.listIterator();
-
- while(li.hasNext()) {
- PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();
- ModuleSADocument.ModuleSA moduleSA = getModuleSA(moduleKey);
- if (moduleSA.getPcdBuildDefinition() != null) {
- XmlCursor cursor = moduleSA.getPcdBuildDefinition().newCursor();
- cursor.push();
- if (cursor.toFirstChild()) {
- do {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData) cursor
- .getObject();
- String cName = msaPcd.getCName();
- String tsGuidCName = msaPcd.getTokenSpaceGuidCName();
- if (cName.equals(pcdData.getCName())
- && tsGuidCName.equals(pcdData.getTokenSpaceGuidCName()) && !multiSourcePcd(cName, tsGuidCName, moduleKey)) {
-
- maintainDynPcdMap(pcdData.getCName() + " " + pcdData.getTokenSpaceGuidCName(),
- moduleKey);
- cursor.removeXml();
- break;
- }
- } while (cursor.toNextSibling());
- }
-
- cursor.pop();
- if (moduleSA.getPcdBuildDefinition().getPcdDataList().size() == 0) {
- cursor.removeXml();
- }
- cursor.dispose();
- }
- }
-
- }
- //
- // key for ModuleSA : "ModuleGuid ModuleVer PackageGuid PackageVer Arch"
- //
- public int getLibraryInstancesCount(String key) {
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
- if (msa == null || msa.getLibraries() == null || msa.getLibraries().getInstanceList() == null){
- return 0;
- }
- return msa.getLibraries().getInstanceList().size();
- }
-
- public void getLibraryInstances(String key, String[][] saa){
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
- if (msa == null || msa.getLibraries() == null || msa.getLibraries().getInstanceList() == null){
- return ;
- }
-
- ListIterator<LibrariesDocument.Libraries.Instance> li = msa.getLibraries().getInstanceList().listIterator();
- for (int i = 0; i < saa.length; ++i) {
- LibrariesDocument.Libraries.Instance instance = li.next();
- saa[i][1] = instance.getModuleGuid();
- saa[i][2] = instance.getModuleVersion();
- saa[i][3] = instance.getPackageGuid();
- saa[i][4] = instance.getPackageVersion();
- }
- }
-
- public boolean instanceExistsInModuleSA (String key, String mg, String mv, String pg, String pv) {
- int count = 0;
- if ((count = getLibraryInstancesCount(key)) > 0) {
- String[][] saa = new String[count][5];
- getLibraryInstances (key, saa);
- for (int i = 0; i < count; ++i) {
- if (mg.equalsIgnoreCase(saa[i][1]) && pg.equalsIgnoreCase(saa[i][3])) {
- boolean modVerMatch = false;
- boolean pkgVerMatch = false;
- if ((mv.equals("null") || saa[i][2] == null)) {
- modVerMatch = true;
- }
- if (pv.equals("null") || saa[i][4] == null) {
- pkgVerMatch = true;
- }
- if (modVerMatch && pkgVerMatch) {
- return true;
- }
- else {
- if (mv.equals(saa[i][2]) && pv.equals(saa[i][4])) {
- return true;
- }
- }
- }
- }
- }
- return false;
- }
-
- public void removeLibraryInstance(String key, String instanceKey) {
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
- if (msa == null || msa.getLibraries() == null){
- return ;
- }
-
- String[] instanceInfo = instanceKey.split(" ");
- XmlCursor cursor = msa.getLibraries().newCursor();
- if (cursor.toFirstChild()) {
- do {
- Instance libIns = (Instance)cursor.getObject();
- if (libIns.getModuleGuid().equalsIgnoreCase(instanceInfo[0]) && libIns.getPackageGuid().equalsIgnoreCase(instanceInfo[2])) {
- break;
- }
- }while (cursor.toNextSibling());
- cursor.push();
- while (cursor.hasPrevToken()) {
- cursor.toPrevToken();
- if (!cursor.isText()) {
- break;
- }
- String s = cursor.getTextValue();
- if (s.matches(regExpNewLineAndSpaces)) {
- continue;
- }
- }
-
- if (cursor.isComment()) {
- cursor.removeXml();
- }
- cursor.pop();
- cursor.removeXml();
- if (getLibraryInstancesCount(key) == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
-
- cursor.dispose();
- }
-
- public void genLibraryInstance(ModuleIdentification libMi, String key) {
- ModuleSADocument.ModuleSA msa = getModuleSA(key);
- if (msa == null){
- msa = getfpdFrameworkModules().addNewModuleSA();
- }
- LibrariesDocument.Libraries libs = msa.getLibraries();
- if(libs == null){
- libs = msa.addNewLibraries();
- }
-
- String mn = libMi.getName();
- String mg = libMi.getGuid();
- String mv = libMi.getVersion();
- String pn = libMi.getPackageId().getName();
- String pg = libMi.getPackageId().getGuid();
- String pv = libMi.getPackageId().getVersion();
- LibrariesDocument.Libraries.Instance instance = libs.addNewInstance();
- XmlCursor cursor = instance.newCursor();
- try{
- String comment = "Pkg: " + pn + " Mod: " + mn
- + " Path: " + libMi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
- cursor.insertComment(comment);
- }
- catch (Exception e){
- e.printStackTrace();
- }
- finally {
- cursor.dispose();
- }
-
- instance.setModuleGuid(mg);
- instance.setModuleVersion(mv);
- instance.setPackageGuid(pg);
- instance.setPackageVersion(pv);
-
- }
-
- public String getFvBinding(String moduleKey){
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);
- return getFvBinding (moduleSa);
- }
-
- public String getFvBinding (ModuleSADocument.ModuleSA moduleSa) {
- if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null) {
- return null;
- }
- return moduleSa.getModuleSaBuildOptions().getFvBinding();
- }
-
- public void setFvBinding(ModuleSADocument.ModuleSA moduleSa, String fvBinding) {
- if (moduleSa == null ) {
- return;
- }
- if (fvBinding == null || fvBinding.length() == 0) {
- if(moduleSa.getModuleSaBuildOptions() != null){
- moduleSa.getModuleSaBuildOptions().unsetFvBinding();
- }
- }
- else {
- if(moduleSa.getModuleSaBuildOptions() == null){
- moduleSa.addNewModuleSaBuildOptions().setFvBinding(fvBinding);
- return;
- }
- moduleSa.getModuleSaBuildOptions().setFvBinding(fvBinding);
- }
- }
-
- public void setFvBinding(String moduleKey, String fvBinding){
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);
- setFvBinding (moduleSa, fvBinding);
- }
-
- private int fvBindingForModuleSA (ModuleSADocument.ModuleSA moduleSa, String fvName) {
- if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null || moduleSa.getModuleSaBuildOptions().getFvBinding() == null) {
- return -1;
- }
-
- String fvNameList = moduleSa.getModuleSaBuildOptions().getFvBinding();
- String[] fvNamesArray = fvNameList.split(" ");
- int occursAt = -1;
- for (int i = 0; i < fvNamesArray.length; ++i) {
- if (fvNamesArray[i].equals(fvName)) {
- occursAt = i;
- break;
- }
- }
- return occursAt;
- }
-
- public void removeFvBinding (ModuleSADocument.ModuleSA moduleSa, String fvName) {
- if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null || moduleSa.getModuleSaBuildOptions().getFvBinding() == null) {
- return;
- }
-
- String fvNameList = moduleSa.getModuleSaBuildOptions().getFvBinding();
- String[] fvNamesArray = fvNameList.split(" ");
- int occursAt = -1;
- for (int i = 0; i < fvNamesArray.length; ++i) {
- if (fvNamesArray[i].equals(fvName)) {
- occursAt = i;
- break;
- }
- }
- // jump over where the input fvName occurs in the original Fv list.
- if (occursAt != -1) {
- String newFvNameList = " ";
- for (int i = 0; i < fvNamesArray.length; ++i) {
- if (i == occursAt) {
- continue;
- }
- newFvNameList += fvNamesArray[i];
- }
- setFvBinding (moduleSa, newFvNameList.trim());
- }
-
- }
-
- /**
- * @param fvName The FV name that to be removed from FvBinding List.
- */
- public void removeFvBindingAll (String fvName) {
- if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return;
- }
-
- Iterator<ModuleSADocument.ModuleSA> li = getfpdFrameworkModules().getModuleSAList().iterator();
- while (li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = li.next();
- removeFvBinding (moduleSa, fvName);
- }
- }
-
- public void appendFvBindingAll (String fvName) {
- if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return;
- }
-
- Iterator<ModuleSADocument.ModuleSA> li = getfpdFrameworkModules().getModuleSAList().iterator();
- while (li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = li.next();
- appendFvBinding (moduleSa, fvName);
- }
- }
-
- public void appendFvBindingFor (String oldFvName, String newFvName) {
- if (getfpdFrameworkModules().getModuleSAList() == null || getfpdFrameworkModules().getModuleSAList().size() == 0){
- removeElement(getfpdFrameworkModules());
- fpdFrameworkModules = null;
- return;
- }
-
- Iterator<ModuleSADocument.ModuleSA> li = getfpdFrameworkModules().getModuleSAList().iterator();
- while (li.hasNext()) {
- ModuleSADocument.ModuleSA moduleSa = li.next();
- String fvBinding = getFvBinding (moduleSa);
- if (fvBinding != null && fvBindingForModuleSA (moduleSa, oldFvName) >= 0) {
- appendFvBinding (moduleSa, newFvName);
- }
- }
- }
-
- public void appendFvBinding (String moduleKey, String fvName) {
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);
- appendFvBinding (moduleSa, fvName);
- }
-
- public void appendFvBinding (ModuleSADocument.ModuleSA moduleSa, String fvName) {
- if (moduleSa == null) {
- return;
- }
-
- if (moduleSa.getModuleSaBuildOptions() == null || moduleSa.getModuleSaBuildOptions().getFvBinding() == null) {
- setFvBinding(moduleSa, fvName);
- return;
- }
-
- String fvNameList = moduleSa.getModuleSaBuildOptions().getFvBinding();
- String newFvNameList = fvNameList + " " + fvName;
- setFvBinding (moduleSa, newFvNameList.trim());
- }
-
- public void updateFvBindingInModuleSA (String moduleKey, String fvName) {
-
- appendFvBinding (moduleKey, fvName);
- }
-
- public String getFfsFileNameGuid(String moduleKey){
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(moduleKey);
- if (moduleSa == null || moduleSa.getModuleSaBuildOptions() == null) {
- return null;
- }
- return moduleSa.getModuleSaBuildOptions().getFfsFileNameGuid();
- }
-
- public void setFfsFileNameGuid(String moduleKey, String fileGuid){
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa == null ) {
- return;
- }
- if(msa.getModuleSaBuildOptions() == null){
- msa.addNewModuleSaBuildOptions();
-
- }
- ModuleSaBuildOptionsDocument.ModuleSaBuildOptions msaBuildOpts= msa.getModuleSaBuildOptions();
- if (fileGuid != null) {
- msaBuildOpts.setFfsFileNameGuid(fileGuid);
- }
- else{
- XmlCursor cursor = msaBuildOpts.newCursor();
- if (cursor.toChild(xmlNs, "FfsFileNameGuid")) {
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- }
-
- public String getFfsFormatKey(String moduleKey){
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa == null || msa.getModuleSaBuildOptions() == null) {
- return null;
- }
- return msa.getModuleSaBuildOptions().getFfsFormatKey();
- }
-
- public void setFfsFormatKey(String moduleKey, String ffsKey){
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa == null ) {
- return;
- }
- if(msa.getModuleSaBuildOptions() == null){
- msa.addNewModuleSaBuildOptions().setFfsFormatKey(ffsKey);
- return;
- }
- msa.getModuleSaBuildOptions().setFfsFormatKey(ffsKey);
- }
-
- public void setModuleSAForceDebug(int i, boolean dbgEnable) {
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(i);
- moduleSa.setForceDebug(dbgEnable);
- }
-
- public boolean getModuleSAForceDebug (int i) {
- ModuleSADocument.ModuleSA moduleSa = getModuleSA(i);
- if (moduleSa.getForceDebug() == true) {
- return true;
- }
- return false;
- }
-
- public void getModuleSAOptions(String moduleKey, String[][] saa) {
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa == null || msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null
- || msa.getModuleSaBuildOptions().getOptions().getOptionList() == null) {
- return ;
- }
-
- List<OptionDocument.Option> lOpt = msa.getModuleSaBuildOptions().getOptions().getOptionList();
- ListIterator li = lOpt.listIterator();
- int i = 0;
- while(li.hasNext()) {
- OptionDocument.Option opt = (OptionDocument.Option)li.next();
- if (opt.getBuildTargets() != null) {
- saa[i][0] = listToString(opt.getBuildTargets());
- }
- saa[i][1] = opt.getToolChainFamily();
- saa[i][2] = opt.getTagName();
- saa[i][3] = opt.getToolCode();
-
- if (opt.getSupArchList() != null){
- saa[i][4] = listToString(opt.getSupArchList());
- }
- else {
- saa[i][4] = "";
- }
-
- saa[i][5] = opt.getStringValue();
-
- ++i;
- }
- }
-
- public int getModuleSAOptionsCount(String moduleKey){
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa == null || msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null
- || msa.getModuleSaBuildOptions().getOptions().getOptionList() == null) {
- return 0;
- }
- return msa.getModuleSaBuildOptions().getOptions().getOptionList().size();
- }
-
- public void genModuleSAOptionsOpt(String moduleKey, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa.getModuleSaBuildOptions() == null) {
- msa.addNewModuleSaBuildOptions();
- }
- if (msa.getModuleSaBuildOptions().getOptions() == null){
- msa.getModuleSaBuildOptions().addNewOptions();
- }
- OptionDocument.Option opt = msa.getModuleSaBuildOptions().getOptions().addNewOption();
- setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
- }
-
- public void removeModuleSAOptionsOpt(String moduleKey, int i) {
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null) {
- return ;
- }
- OptionsDocument.Options opts = msa.getModuleSaBuildOptions().getOptions();
- XmlCursor cursor = opts.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j){
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getModuleSAOptionsCount(moduleKey) == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- public void updateModuleSAOptionsOpt(String moduleKey, int i, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
- ModuleSADocument.ModuleSA msa = getModuleSA(moduleKey);
- if (msa.getModuleSaBuildOptions() == null || msa.getModuleSaBuildOptions().getOptions() == null) {
- return ;
- }
- OptionsDocument.Options opts = msa.getModuleSaBuildOptions().getOptions();
- XmlCursor cursor = opts.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j){
- cursor.toNextSibling();
- }
- OptionDocument.Option opt = (OptionDocument.Option)cursor.getObject();
- setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
- }
- cursor.dispose();
- }
-
- /**add pcd information of module mi to a ModuleSA.
- * @param mi
- * @param moduleSa if null, generate a new ModuleSA.
- */
- public void addFrameworkModulesPcdBuildDefs(ModuleIdentification mi, String arch, ModuleSADocument.ModuleSA moduleSa) throws Exception {
- //ToDo add Arch filter
-
- if (moduleSa == null) {
- moduleSa = genModuleSA(mi, arch);
- }
-
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea) WorkspaceProfile
- .getModuleXmlObject(mi);
- if (msa.getPcdCoded() == null) {
- return;
- }
-
- PackageIdentification[] depPkgs = SurfaceAreaQuery.getDependencePkg(null, mi);
- //
- // Implementing InitializePlatformPcdBuildDefinitions
- //
- List<PcdCodedDocument.PcdCoded.PcdEntry> l = msa.getPcdCoded().getPcdEntryList();
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry) li.next();
- if (msaPcd.getSupArchList() != null) {
- if (!msaPcd.getSupArchList().toString().toLowerCase().contains(arch.toLowerCase())) {
- continue;
- }
- }
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = LookupPcdDeclaration(msaPcd, depPkgs);
- if (spdPcd == null) {
- //
- // ToDo Error
- //
- throw new PcdDeclNotFound("No Declaration for PCD Entry " + msaPcd.getCName() + "\n used by Module "
- + mi.getName() + " or its Library Instances.");
- }
- //
- // AddItem to ModuleSA PcdBuildDefinitions
- //
- String defaultVal = msaPcd.getDefaultValue() == null ? spdPcd.getDefaultValue() : msaPcd.getDefaultValue();
-
- genPcdData(msaPcd.getCName(), spdPcd.getToken(), msaPcd.getTokenSpaceGuidCName(), msaPcd.getPcdItemType()
- .toString(),
- spdPcd.getDatumType() + "", defaultVal, moduleSa, spdPcd);
- }
-
- }
-
- private PcdDeclarationsDocument.PcdDeclarations.PcdEntry LookupPcdDeclaration (PcdCodedDocument.PcdCoded.PcdEntry msaPcd, PackageIdentification[] depPkgs) {
-
- PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd = null;
- for (int i = 0; i < depPkgs.length; ++i) {
-
- XmlObject[] xo = SurfaceAreaQuery.getSpdPcdDeclarations(depPkgs[i]);
- if (xo == null) {
- continue;
- }
- for (int j = 0; j < xo.length; ++j) {
- spdPcd = (PcdDeclarationsDocument.PcdDeclarations.PcdEntry)xo[j];
- if (msaPcd.getTokenSpaceGuidCName() == null) {
- if (spdPcd.getCName().equals(msaPcd.getCName())) {
- return spdPcd;
- }
- }
- else{
- if (spdPcd.getCName().equals(msaPcd.getCName()) && spdPcd.getTokenSpaceGuidCName().equals(msaPcd.getTokenSpaceGuidCName())) {
- return spdPcd;
- }
- }
-
- }
-
- }
- return null;
- }
-
- private ModuleSADocument.ModuleSA genModuleSA (ModuleIdentification mi, String arch) {
- PackageIdentification pi = WorkspaceProfile.getPackageForModule(mi);
- ModuleSADocument.ModuleSA msa = getfpdFrameworkModules().addNewModuleSA();
- XmlCursor cursor = msa.newCursor();
- try{
- String comment = "Mod: " + mi.getName() + " Type: " + SurfaceAreaQuery.getModuleType(mi) + " Path: "
- + mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
- cursor.insertComment(comment);
- }
- catch(Exception e){
- e.printStackTrace();
- }
- finally {
- cursor.dispose();
- }
- msa.setModuleGuid(mi.getGuid());
- msa.setModuleVersion(mi.getVersion());
- msa.setPackageGuid(pi.getGuid());
- msa.setPackageVersion(pi.getVersion());
- if (arch != null) {
- Vector<String> v = new Vector<String>();
- v.add(arch);
- msa.setSupArchList(v);
- }
-
- return msa;
- }
-
- private String chooseDefaultPcdType (List validPcdTypes) {
- String choosedType = "";
- if (validPcdTypes.contains("FIXED_AT_BUILD")) {
- choosedType = "FIXED_AT_BUILD";
- }
- else if (validPcdTypes.contains("DYNAMIC")) {
- choosedType = "DYNAMIC";
- }
- else if (validPcdTypes.contains("PATCHABLE_IN_MODULE")) {
- choosedType = "PATCHABLE_IN_MODULE";
- }
- else if (validPcdTypes.contains("DYNAMIC_EX")) {
- choosedType = "DYNAMIC_EX";
- }
- return choosedType;
- }
-
- private synchronized void genPcdData (String cName, Object token, String tsGuid, String itemType, String dataType, String defaultVal,
- ModuleSADocument.ModuleSA moduleSa, PcdDeclarationsDocument.PcdDeclarations.PcdEntry spdPcd)
- throws PcdItemTypeConflictException, PcdValueMalFormed{
- if (moduleSa.getPcdBuildDefinition() == null){
- moduleSa.addNewPcdBuildDefinition();
- }
- //
- // constructe pcd to modulesa mapping first.
- // Attention : for any error condition, remove from map this pcd.
- //
- ArrayList<String> pcdConsumer = LookupPlatformPcdData(cName + " " + tsGuid);
- if (pcdConsumer == null) {
- pcdConsumer = new ArrayList<String>();
- }
- //
- // Check whether this PCD has already added to ModuleSA, if so, just return.
- //
- String moduleInfo = moduleSa.getModuleGuid().toLowerCase() + " " + moduleSa.getModuleVersion()
- + " " + moduleSa.getPackageGuid().toLowerCase() + " " + moduleSa.getPackageVersion() + " " + listToString(moduleSa.getSupArchList());
- for (int i = 0; i < pcdConsumer.size(); ++i) {
- String pcdInfo = pcdConsumer.get(i);
- if (moduleInfo.equals(pcdInfo.substring(0, pcdInfo.lastIndexOf(" ")))){
- return;
- }
- }
- // if pcd type from MSA file is Dynamic
- // we must choose one default type from SPD file for it.
- //
- List validPcdTypes = spdPcd.getValidUsage();
- //
- // Using existing Pcd type, if this pcd already exists in other ModuleSA
- //
- if (pcdConsumer.size() > 0) {
- //
- // platform should only contain one type for each pcd.
- //
- String existingItemType = itemType (pcdConsumer.get(0));
- for (int i = 1; i < pcdConsumer.size(); ++i) {
- if (!existingItemType.equals(itemType(pcdConsumer.get(i)))) {
- throw new PcdItemTypeConflictException (cName, pcdConsumer.get(0), pcdConsumer.get(i));
- }
- }
-
- if (itemType.equals("DYNAMIC")) {
- if (!validPcdTypes.contains(existingItemType)) {
- throw new PcdItemTypeConflictException(cName, pcdConsumer.get(0));
- }
- itemType = existingItemType;
- }
- else {
- if (!itemType.equals(existingItemType)) {
- throw new PcdItemTypeConflictException(cName, pcdConsumer.get(0));
- }
- }
- }
- //
- // if this is the first occurence of this pcd.
- //
- else {
- if (itemType.equals("DYNAMIC")) {
- itemType = chooseDefaultPcdType (validPcdTypes);
- }
- }
- String listValue = moduleInfo + " " + itemType;
- pcdConsumer.add(listValue);
- dynPcdMap.put(cName + " " + tsGuid, pcdConsumer);
-
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData fpdPcd = moduleSa.getPcdBuildDefinition().addNewPcdData();
- fpdPcd.setCName(cName);
- fpdPcd.setToken(token);
- fpdPcd.setTokenSpaceGuidCName(tsGuid);
- fpdPcd.setDatumType(PcdDataTypes.Enum.forString(dataType));
- fpdPcd.setItemType(PcdItemTypes.Enum.forString(itemType));
-
- if (defaultVal != null && defaultVal.length() > 0){
- fpdPcd.setValue(defaultVal);
- }
- else {
- if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {
- fpdPcd.setValue("0");
- }
- if (dataType.equals("BOOLEAN")){
- fpdPcd.setValue("FALSE");
- }
- if (dataType.equals("VOID*")) {
- fpdPcd.setValue("L\"\"");
- }
- }
- //
- // Using existing pcd value, if this pcd already exists in other moduleSa.
- //
- if (defaultPcdValue.get(cName + " " + tsGuid) == null) {
- defaultPcdValue.put(cName + " " + tsGuid, fpdPcd.getValue());
- }
- else {
- fpdPcd.setValue(defaultPcdValue.get(cName + " " + tsGuid));
- }
-
- if (dataType.equals("UINT8")){
- fpdPcd.setMaxDatumSize(1);
- }
- if (dataType.equals("UINT16")) {
- fpdPcd.setMaxDatumSize(2);
- }
- if (dataType.equals("UINT32")) {
- fpdPcd.setMaxDatumSize(4);
- }
- if (dataType.equals("UINT64")){
- fpdPcd.setMaxDatumSize(8);
- }
- if (dataType.equals("BOOLEAN")){
- fpdPcd.setMaxDatumSize(1);
- }
- if (dataType.equals("VOID*")) {
- int maxSize = setMaxSizeForPointer(fpdPcd.getValue());
- fpdPcd.setMaxDatumSize(maxSize);
- }
-
-
- if (itemType.equals("DYNAMIC") || itemType.equals("DYNAMIC_EX")) {
- ArrayList<String> al = LookupDynamicPcdBuildDefinition(cName + " " + tsGuid);
- //
- // if only one module mapped to this pcd, then the one is myself. so no other module mapped.
- // so need to add one dyn pcd.
- //
- if (al.size() == 1) {
- addDynamicPcdBuildData(cName, token, tsGuid, itemType, dataType, defaultVal);
- }
- }
-
- }
-
- public int setMaxSizeForPointer(String datum) throws PcdValueMalFormed{
- if (datum == null) {
- return 0;
- }
- char ch = datum.charAt(0);
- int start, end;
- String strValue;
- //
- // For void* type PCD, only three datum is support:
- // 1) Unicode: string with start char is "L"
- // 2) Ansci: String is ""
- // 3) byte array: String start char "{"
- //
- if (ch == 'L') {
- start = datum.indexOf('\"');
- end = datum.lastIndexOf('\"');
- if ((start > end) ||
- (end > datum.length())||
- ((start == end) && (datum.length() > 0))) {
- //ToDo Error handling here
- throw new PcdValueMalFormed (datum);
- }
-
- strValue = datum.substring(start + 1, end);
- return strValue.length() * 2;
- } else if (ch == '\"'){
- start = datum.indexOf('\"');
- end = datum.lastIndexOf('\"');
- if ((start > end) ||
- (end > datum.length())||
- ((start == end) && (datum.length() > 0))) {
- throw new PcdValueMalFormed (datum);
- }
- strValue = datum.substring(start + 1, end);
- return strValue.length();
- } else if (ch =='{') {
- String[] strValueArray;
-
- start = datum.indexOf('{');
- end = datum.lastIndexOf('}');
- strValue = datum.substring(start + 1, end);
- strValue = strValue.trim();
- if (strValue.length() == 0) {
- return 0;
- }
- strValueArray = strValue.split(",");
- for (int index = 0; index < strValueArray.length; index ++) {
- Integer value = Integer.decode(strValueArray[index].trim());
-
- if (value > 0xFF) {
-// "[FPD file error] The datum type of PCD %s in %s is VOID*, "+
-// "it must be a byte array. But the element of %s exceed the byte range",
- throw new PcdValueMalFormed (datum);
- }
- }
- return strValueArray.length;
-
-
- } else {
-// "[FPD file error] The datum type of PCD %s in %s is VOID*. For VOID* type, you have three format choise:\n "+
-// "1) UNICODE string: like L\"xxxx\";\r\n"+
-// "2) ANSIC string: like \"xxx\";\r\n"+
-// "3) Byte array: like {0x2, 0x45, 0x23}\r\n"+
-// "but the datum in seems does not following above format!",
- throw new PcdValueMalFormed (datum);
-
- }
- }
-
- private ArrayList<String> LookupDynamicPcdBuildDefinition(String dynPcdKey) {
- ArrayList<String> al = dynPcdMap.get(dynPcdKey);
-
- return al;
- }
-
- private ArrayList<String> LookupPlatformPcdData(String pcdKey) {
-
- return dynPcdMap.get(pcdKey);
- }
-
- public int getDynamicPcdBuildDataCount() {
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return 0;
- }
- return getfpdDynPcdBuildDefs().getPcdBuildDataList().size();
- }
-
- public void getDynamicPcdBuildData(String[][] saa) {
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return ;
- }
- List<DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData> l = getfpdDynPcdBuildDefs().getPcdBuildDataList();
- ListIterator<DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData> li = l.listIterator();
- int i = 0;
- while(li.hasNext()) {
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData dynPcd = li.next();
- saa[i][0] = dynPcd.getCName();
- saa[i][1] = dynPcd.getToken().toString();
- saa[i][2] = dynPcd.getTokenSpaceGuidCName();
- saa[i][3] = dynPcd.getMaxDatumSize()+"";
- saa[i][4] = dynPcd.getDatumType()+"";
-
- ++i;
- }
- }
-
- public void addDynamicPcdBuildData(String cName, Object token, String tsGuid, String itemType, String dataType, String defaultVal)
- throws PcdValueMalFormed{
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData dynPcdData = getfpdDynPcdBuildDefs().addNewPcdBuildData();
- dynPcdData.setItemType(PcdItemTypes.Enum.forString(itemType));
- dynPcdData.setCName(cName);
- dynPcdData.setToken(token);
- dynPcdData.setTokenSpaceGuidCName(tsGuid);
- dynPcdData.setDatumType(PcdDataTypes.Enum.forString(dataType));
-
- BigInteger bigInt = new BigInteger("0");
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo skuInfo = dynPcdData.addNewSkuInfo();
- skuInfo.setSkuId(bigInt);
- if (defaultVal != null){
- skuInfo.setValue(defaultVal);
- }
- else {
- if (dataType.equals("UINT8")){
- skuInfo.setValue("0");
- }
- if (dataType.equals("UINT16")) {
- skuInfo.setValue("0");
- }
- if (dataType.equals("UINT32")) {
- skuInfo.setValue("0");
- }
- if (dataType.equals("UINT64")){
- skuInfo.setValue("0");
- }
- if (dataType.equals("BOOLEAN")){
- skuInfo.setValue("false");
- }
- if (dataType.equals("VOID*")) {
- skuInfo.setValue("");
- }
- }
- if (dataType.equals("UINT8")){
- dynPcdData.setMaxDatumSize(1);
- }
- if (dataType.equals("UINT16")) {
- dynPcdData.setMaxDatumSize(2);
- }
- if (dataType.equals("UINT32")) {
- dynPcdData.setMaxDatumSize(4);
- }
- if (dataType.equals("UINT64")){
- dynPcdData.setMaxDatumSize(8);
- }
- if (dataType.equals("BOOLEAN")){
- dynPcdData.setMaxDatumSize(1);
- }
- if (dataType.equals("VOID*")) {
- int maxSize = setMaxSizeForPointer(defaultVal);
- dynPcdData.setMaxDatumSize(maxSize);
- }
- }
-
- public void removeDynamicPcdBuildData(String cName, String tsGuid) {
- XmlObject o = fpdRoot.getDynamicPcdBuildDefinitions();
- if (o == null) {
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- do {
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdBuildData =
- (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdBuildData.getCName().equals(cName) && pcdBuildData.getTokenSpaceGuidCName().equals(tsGuid)) {
-
- if (getDynamicPcdBuildDataCount() == 1) {
- cursor.dispose();
- removeElement(o);
- fpdDynPcdBuildDefs = null;
- return;
- }
- cursor.removeXml();
- cursor.dispose();
- return;
- }
- }
- while (cursor.toNextSibling());
- }
- cursor.dispose();
- }
- //
- // Get the Sku Info count of ith dyn pcd element.
- //
- public int getDynamicPcdSkuInfoCount(int i){
- if (fpdRoot.getDynamicPcdBuildDefinitions() == null || fpdRoot.getDynamicPcdBuildDefinitions().getPcdBuildDataList() == null
- || fpdRoot.getDynamicPcdBuildDefinitions().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return 0;
- }
-
- int skuInfoCount = 0;
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdData.getSkuInfoList() == null) {
- skuInfoCount = 0;
- }
- else {
- skuInfoCount = pcdData.getSkuInfoList().size();
- }
- }
- cursor.dispose();
- return skuInfoCount;
- }
-
- public void getDynamicPcdSkuInfos(int i, String[][] saa){
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return;
- }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdData.getSkuInfoList() == null) {
- cursor.dispose();
- return;
- }
- else {
- ListIterator<DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> li = pcdData.getSkuInfoList().listIterator();
- int k = 0;
- while (li.hasNext()) {
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo skuInfo = li.next();
- saa[k][0] = skuInfo.getSkuId()+"";
- saa[k][1] = skuInfo.getVariableName();
- saa[k][2] = skuInfo.getVariableGuid();
- saa[k][3] = skuInfo.getVariableOffset();
- saa[k][4] = skuInfo.getHiiDefaultValue();
- saa[k][5] = skuInfo.getVpdOffset();
- saa[k][6] = skuInfo.getValue();
- ++k;
- }
-
- }
- }
- cursor.dispose();
-
- }
-
- public String getDynamicPcdBuildDataValue(int i){
- String value = null;
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return value;
- }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdData.getSkuInfoList() == null) {
- value = null;
- }
- else {
- value = pcdData.getSkuInfoArray(0).getValue();
- }
- }
- cursor.dispose();
- return value;
- }
-
- public String getDynamicPcdBuildDataVpdOffset(int i){
- String vpdOffset = null;
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return vpdOffset;
- }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdData.getSkuInfoList() == null) {
- vpdOffset = null;
- }
- else {
- vpdOffset = pcdData.getSkuInfoArray(0).getVpdOffset();
- }
- }
- cursor.dispose();
- return vpdOffset;
- }
-
- public void removeDynamicPcdBuildDataSkuInfo(int i) {
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return;
- }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- if (pcdData.getSkuInfoList() == null) {
- cursor.dispose();
- return;
- }
- else {
- pcdData.getSkuInfoList().clear();
-// QName qSkuInfo = new QName(xmlNs, "SkuInfo");
-// cursor.toChild(qSkuInfo);
-// cursor.removeXml();
- }
- }
- cursor.dispose();
- }
- //
- // generate sku info for ith dyn pcd build data.
- //
- public void genDynamicPcdBuildDataSkuInfo(String id, String varName, String varGuid, String varOffset,
- String hiiDefault, String vpdOffset, String value, int i) {
-// if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
-// return;
-// }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo skuInfo = pcdData.addNewSkuInfo();
- skuInfo.setSkuId(new BigInteger(id));
- if (varName != null){
- skuInfo.setVariableName(varName);
- skuInfo.setVariableGuid(varGuid);
- skuInfo.setVariableOffset(varOffset);
- skuInfo.setHiiDefaultValue(hiiDefault);
- }
- else if (vpdOffset != null){
- skuInfo.setVpdOffset(vpdOffset);
- }
- else{
- skuInfo.setValue(value);
- }
- }
- }
-
- public void updateDynamicPcdBuildDataSkuInfo(String id, String varName, String varGuid, String varOffset,
- String hiiDefault, String vpdOffset, String value, int i){
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null || getfpdDynPcdBuildDefs().getPcdBuildDataList().size() == 0) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- return;
- }
-
- XmlCursor cursor = getfpdDynPcdBuildDefs().newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData pcdData = (DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData)cursor.getObject();
- ListIterator<DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> li = pcdData.getSkuInfoList().listIterator();
- while (li.hasNext()) {
- DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo skuInfo = li.next();
- if (skuInfo.getSkuId().toString().equals(id)){
- if (varName != null){
- skuInfo.setVariableName(varName);
- skuInfo.setVariableGuid(varGuid);
- skuInfo.setVariableOffset(varOffset);
- skuInfo.setHiiDefaultValue(hiiDefault);
- }
- else if (vpdOffset != null){
- skuInfo.setVpdOffset(vpdOffset);
- }
- else{
- skuInfo.setValue(value);
- }
- break;
- }
- }
- }
- }
-
- public BuildOptionsDocument.BuildOptions getfpdBuildOpts() {
- if (fpdBuildOpts == null) {
- fpdBuildOpts = fpdRoot.addNewBuildOptions();
- }
- return fpdBuildOpts;
- }
-
- public void genBuildOptionsUserExtensions(String fvName, String userId, String id, String outputFileName, Vector<String[]> includeModules) {
- QName elementFvName = new QName (xmlNs, "FvName");
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- QName elementInfFileName = new QName(xmlNs, "InfFileName");
- QName elementModule = new QName(xmlNs, "Module");
-
- UserExtensionsDocument.UserExtensions userExts = getfpdBuildOpts().addNewUserExtensions();
- userExts.setUserID(userId);
- userExts.setIdentifier(id);
- XmlCursor cursor = userExts.newCursor();
- cursor.toEndToken();
-
- cursor.beginElement(elementFvName);
- cursor.insertChars(fvName);
- cursor.toNextToken();
-
- cursor.beginElement(elementInfFileName);
- cursor.insertChars(outputFileName);
- cursor.toNextToken();
-
- cursor.beginElement(elementIncludeModules);
- for (int i = 0; i < includeModules.size(); ++i) {
- cursor.beginElement(elementModule);
- cursor.insertAttributeWithValue("ModuleGuid", includeModules.get(i)[0]);
- if (!includeModules.get(i)[1].equals("null") && includeModules.get(i)[1].length() != 0) {
- cursor.insertAttributeWithValue("ModuleVersion", includeModules.get(i)[1]);
- }
- cursor.insertAttributeWithValue("PackageGuid", includeModules.get(i)[2]);
- if (!includeModules.get(i)[3].equals("null") && includeModules.get(i)[3].length() != 0) {
- cursor.insertAttributeWithValue("PackageVersion", includeModules.get(i)[3]);
- }
-
- cursor.insertAttributeWithValue("Arch", includeModules.get(i)[4]);
- cursor.toEndToken();
- cursor.toNextToken();
- }
- cursor.dispose();
- }
-
- public int getUserExtsIncModCount (String fvName, String userId, String id) {
- if (getfpdBuildOpts().getUserExtensionsList() == null) {
- return -1;
- }
-
- ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- while (li.hasNext()) {
- UserExtensionsDocument.UserExtensions ues = li.next();
- if (!ues.getUserID().equals(userId)) {
- continue;
- }
- if (ues.getIdentifier() == null || !ues.getIdentifier().equals(id)) {
- continue;
- }
- XmlCursor cursor = ues.newCursor();
- cursor.toFirstChild();
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toNextSibling(elementIncludeModules);
- if (cursor.toFirstChild()) {
- int i = 1;
- for (i = 1; cursor.toNextSibling(); ++i);
- cursor.dispose();
- return i;
- }
- cursor.dispose();
- return 0;
- }
- cursor.dispose();
- }
- return -1;
- }
-
- public void getUserExtsIncMods(String fvName, String userId, String id, String[][] saa) {
- if (getfpdBuildOpts().getUserExtensionsList() == null) {
- return;
- }
-
- XmlCursor cursor = getfpdBuildOpts().newCursor();
- QName elementUserExts = new QName (xmlNs, "UserExtensions");
- QName attribUserId = new QName ("UserID");
- QName attribId = new QName ("Identifier");
- QName elementFvName = new QName (xmlNs, "FvName");
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- QName attribModuleGuid = new QName("ModuleGuid");
- QName attribModuleVersion = new QName("ModuleVersion");
- QName attribPackageGuid = new QName("PackageGuid");
- QName attribPackageVersion = new QName("PackageVersion");
- QName attribArch = new QName("Arch");
-
- if (cursor.toChild(elementUserExts)) {
- do {
- cursor.push();
- if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id)) {
- cursor.toChild(elementFvName);
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toNextSibling(elementIncludeModules);
- if (cursor.toFirstChild()) {
- int i = 0;
- do {
- saa[i][0] = cursor.getAttributeText(attribModuleGuid);
- saa[i][1] = cursor.getAttributeText(attribModuleVersion);
- saa[i][2] = cursor.getAttributeText(attribPackageGuid);
- saa[i][3] = cursor.getAttributeText(attribPackageVersion);
- saa[i][4] = cursor.getAttributeText(attribArch);
- ++i;
- }while (cursor.toNextSibling());
- }
- break;
- }
- }
- cursor.pop();
- }while (cursor.toNextSibling(elementUserExts));
- }
- cursor.dispose();
-
- }
-
- public void updateBuildOptionsUserExtensions (String oldFvName, String newFvName) {
- if (getfpdBuildOpts().getUserExtensionsList() == null) {
- return;
- }
- ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();
- while (li.hasNext()) {
- UserExtensionsDocument.UserExtensions ues = li.next();
- if (!ues.getUserID().equals("IMAGES")) {
- continue;
- }
- XmlCursor cursor = ues.newCursor();
- cursor.toFirstChild();
- String elementName = cursor.getTextValue();
- if (elementName.equals(oldFvName)) {
- cursor.setTextValue(newFvName);
- }
- cursor.dispose();
- }
-
- }
-
- public void removeBuildOptionsUserExtensions (String fvName, String userId, String id) {
- if (getfpdBuildOpts().getUserExtensionsList() == null) {
- return;
- }
-
- ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();
- while (li.hasNext()) {
- UserExtensionsDocument.UserExtensions ues = li.next();
- if (!ues.getUserID().equals(userId)) {
- continue;
- }
- if (ues.getIdentifier()== null || !ues.getIdentifier().equals(id)) {
- continue;
- }
- XmlCursor cursor = ues.newCursor();
- cursor.toFirstChild();
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toParent();
- cursor.removeXml();
- cursor.dispose();
- return;
- }
- cursor.dispose();
- }
-
- }
-
- private boolean versionEqual (String v1, String v2) {
-
- if ((v1 == null || v1.length() == 0 || v1.equalsIgnoreCase("null"))
- && (v2 == null || v2.length() == 0 || v2.equalsIgnoreCase("null"))) {
- return true;
- }
-
- if (v1 != null && v1.equals(v2)) {
- return true;
- }
-
- return false;
- }
-
- public boolean moduleInBuildOptionsUserExtensions (String fvName, String userId, String id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {
- boolean inList = false;
- if (getUserExtsIncModCount(fvName, userId, id) > 0) {
- XmlCursor cursor = getfpdBuildOpts().newCursor();
- QName elementUserExts = new QName (xmlNs, "UserExtensions");
- QName attribUserId = new QName ("UserID");
- QName attribId = new QName ("Identifier");
- QName elementFvName = new QName (xmlNs, "FvName");
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- QName attribModuleGuid = new QName("ModuleGuid");
- QName attribModuleVersion = new QName("ModuleVersion");
- QName attribPackageGuid = new QName("PackageGuid");
- QName attribPackageVersion = new QName("PackageVersion");
- QName attribArch = new QName("Arch");
-
- if (cursor.toChild(elementUserExts)) {
- do {
- cursor.push();
- if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id)) {
- cursor.toChild(elementFvName);
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toNextSibling(elementIncludeModules);
- if (cursor.toFirstChild()) {
-
- do {
- String mg = cursor.getAttributeText(attribModuleGuid);
- String mv = cursor.getAttributeText(attribModuleVersion);
- String pg = cursor.getAttributeText(attribPackageGuid);
- String pv = cursor.getAttributeText(attribPackageVersion);
- String ar = cursor.getAttributeText(attribArch);
- if (!moduleGuid.equalsIgnoreCase(mg)) {
- continue;
- }
- if (!packageGuid.equalsIgnoreCase(pg)) {
- continue;
- }
- if (!arch.equalsIgnoreCase(ar)) {
- continue;
- }
- if (!versionEqual(moduleVersion, mv)) {
- continue;
- }
- if (!versionEqual(packageVersion, pv)) {
- continue;
- }
- inList = true;
- break;
- }while (cursor.toNextSibling());
- }
- break;
- }
- }
- cursor.pop();
- }while (cursor.toNextSibling(elementUserExts));
- }
- cursor.dispose();
- }
- return inList;
- }
-
- public void removeModuleInBuildOptionsUserExtensions (String fvName, String userId, String id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {
- //
- // if there is only one module before remove operation, the whole user extension should be removed.
- //
- int moduleAmount = getUserExtsIncModCount(fvName, userId, id);
- if (moduleAmount == 1) {
- removeBuildOptionsUserExtensions(fvName, userId, id);
- return;
- }
-
- if (moduleAmount > 1) {
- XmlCursor cursor = getfpdBuildOpts().newCursor();
- QName elementUserExts = new QName (xmlNs, "UserExtensions");
- QName attribUserId = new QName ("UserID");
- QName attribId = new QName ("Identifier");
- QName elementFvName = new QName (xmlNs, "FvName");
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- QName attribModuleGuid = new QName("ModuleGuid");
- QName attribModuleVersion = new QName("ModuleVersion");
- QName attribPackageGuid = new QName("PackageGuid");
- QName attribPackageVersion = new QName("PackageVersion");
- QName attribArch = new QName("Arch");
-
- if (cursor.toChild(elementUserExts)) {
- do {
- cursor.push();
- if (cursor.getAttributeText(attribUserId).equals(userId) && cursor.getAttributeText(attribId).equals(id)) {
- cursor.toChild(elementFvName);
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toNextSibling(elementIncludeModules);
- if (cursor.toFirstChild()) {
-
- do {
- String mg = cursor.getAttributeText(attribModuleGuid);
- String mv = cursor.getAttributeText(attribModuleVersion);
- String pg = cursor.getAttributeText(attribPackageGuid);
- String pv = cursor.getAttributeText(attribPackageVersion);
- String ar = cursor.getAttributeText(attribArch);
- if (!moduleGuid.equalsIgnoreCase(mg)) {
- continue;
- }
- if (!packageGuid.equalsIgnoreCase(pg)) {
- continue;
- }
- if (!arch.equalsIgnoreCase(ar)) {
- continue;
- }
- if (!versionEqual(moduleVersion, mv)) {
- continue;
- }
- if (!versionEqual(packageVersion, pv)) {
- continue;
- }
- cursor.removeXml();
- }while (cursor.toNextSibling());
- }
- break;
- }
- }
- cursor.pop();
- }while (cursor.toNextSibling(elementUserExts));
- }
- cursor.dispose();
- }
- }
-
- public void addModuleIntoBuildOptionsUserExtensions (String fvName, String userId, String id, String moduleGuid, String moduleVersion, String packageGuid, String packageVersion, String arch) {
- if (moduleInBuildOptionsUserExtensions (fvName, userId, id, moduleGuid, moduleVersion, packageGuid, packageVersion, arch)) {
- return;
- }
-
- ListIterator<UserExtensionsDocument.UserExtensions> li = getfpdBuildOpts().getUserExtensionsList().listIterator();
- QName elementIncludeModules = new QName(xmlNs, "IncludeModules");
- QName elementModule = new QName(xmlNs, "Module");
- while (li.hasNext()) {
- UserExtensionsDocument.UserExtensions ues = li.next();
- if (!ues.getUserID().equals(userId)) {
- continue;
- }
- if (ues.getIdentifier() == null || !ues.getIdentifier().equals(id)) {
- continue;
- }
- XmlCursor cursor = ues.newCursor();
- cursor.toFirstChild();
- String elementName = cursor.getTextValue();
- if (elementName.equals(fvName)) {
- cursor.toNextSibling(elementIncludeModules);
- cursor.toLastChild();
- cursor.toEndToken();
- cursor.toNextToken();
- cursor.beginElement(elementModule);
- cursor.insertAttributeWithValue("ModuleGuid", moduleGuid);
- if (!moduleVersion.equals("null") && moduleVersion.length() != 0) {
- cursor.insertAttributeWithValue("ModuleVersion", moduleVersion);
- }
- cursor.insertAttributeWithValue("PackageGuid", packageGuid);
- if (!packageVersion.equals("null") && packageVersion.length() != 0) {
- cursor.insertAttributeWithValue("PackageVersion", packageVersion);
- }
-
- cursor.insertAttributeWithValue("Arch", arch);
- cursor.dispose();
- return;
- }
- cursor.dispose();
- }
-
- }
-
- public void genBuildOptionsUserDefAntTask (String id, String fileName, String execOrder) {
- UserDefinedAntTasksDocument.UserDefinedAntTasks udats = getfpdBuildOpts().getUserDefinedAntTasks();
- if (udats == null) {
- udats = getfpdBuildOpts().addNewUserDefinedAntTasks();
- }
-
- AntTaskDocument.AntTask at = udats.addNewAntTask();
- setBuildOptionsUserDefAntTask(id, fileName, execOrder, at);
- }
-
- private void setBuildOptionsUserDefAntTask(String id, String fileName, String execOrder, AntTaskDocument.AntTask at) {
- at.setId(new Integer(id));
- XmlCursor cursor = at.newCursor();
- if (fileName != null){
- at.setFilename(fileName);
- }
- else if (cursor.toChild(xmlNs, "Filename")) {
- cursor.removeXml();
- }
- if (execOrder != null) {
- at.setAntCmdOptions(execOrder);
- }
- else if (cursor.toChild(xmlNs, "AntCmdOptions")) {
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void removeBuildOptionsUserDefAntTask(int i) {
- XmlObject o = getfpdBuildOpts().getUserDefinedAntTasks();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getBuildOptionsUserDefAntTaskCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- public void updateBuildOptionsUserDefAntTask(int i, String id, String fileName, String execOrder){
- XmlObject o = getfpdBuildOpts().getUserDefinedAntTasks();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- AntTaskDocument.AntTask at = (AntTaskDocument.AntTask)cursor.getObject();
- setBuildOptionsUserDefAntTask(id, fileName, execOrder, at);
- }
- cursor.dispose();
- }
-
- public int getBuildOptionsUserDefAntTaskCount() {
- UserDefinedAntTasksDocument.UserDefinedAntTasks udats = getfpdBuildOpts().getUserDefinedAntTasks();
- if (udats == null || udats.getAntTaskList() == null) {
- return 0;
- }
-
- return udats.getAntTaskList().size();
- }
-
- public void getBuildOptionsUserDefAntTasks(String[][] saa) {
- UserDefinedAntTasksDocument.UserDefinedAntTasks udats = getfpdBuildOpts().getUserDefinedAntTasks();
- if (udats == null || udats.getAntTaskList() == null) {
- return ;
- }
-
- List<AntTaskDocument.AntTask> l = udats.getAntTaskList();
- ListIterator li = l.listIterator();
- int i = 0;
- while (li.hasNext()) {
- AntTaskDocument.AntTask at = (AntTaskDocument.AntTask)li.next();
- saa[i][0] = at.getId() + "";
- saa[i][1] = saa[i][2] = "";
- if (at.getFilename() != null){
- saa[i][1] = at.getFilename();
- }
- if (at.getAntCmdOptions() != null) {
- saa[i][2] = at.getAntCmdOptions();
- }
- ++i;
- }
- }
- public void genBuildOptionsOpt(Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
- OptionsDocument.Options opts = getfpdBuildOpts().getOptions();
- if (opts == null) {
- opts = getfpdBuildOpts().addNewOptions();
- }
- OptionDocument.Option opt = opts.addNewOption();
- setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
- }
-
- private void setBuildOptionsOpt(Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents, OptionDocument.Option opt){
- opt.setStringValue(contents);
- if (buildTargets != null) {
- opt.setBuildTargets(buildTargets);
- }
- else {
- if (opt.isSetBuildTargets()) {
- opt.unsetBuildTargets();
- }
- }
-
- if (toolChain != null && toolChain.length() > 0) {
- opt.setToolChainFamily(toolChain);
- }
- else {
- if (opt.isSetToolChainFamily()) {
- opt.unsetToolChainFamily();
- }
- }
-
- if (tagName != null && tagName.length() > 0) {
- opt.setTagName(tagName);
- }
- else {
- if (opt.isSetTagName()) {
- opt.unsetTagName();
- }
- }
-
- if (toolCmd != null && toolCmd.length() > 0) {
- opt.setToolCode(toolCmd);
- }
- else {
- if (opt.isSetToolCode()) {
- opt.unsetToolCode();
- }
- }
-
-
- if (archList != null) {
- opt.setSupArchList(archList);
- }
- else {
- if (opt.isSetSupArchList()) {
- opt.unsetSupArchList();
- }
- }
- }
-
- public void removeBuildOptionsOpt(int i){
-
- XmlObject o = getfpdBuildOpts().getOptions();
- if (o == null) {
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (getBuildOptionsOptCount() == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- cursor.dispose();
- }
-
- public void updateBuildOptionsOpt(int i, Vector<Object> buildTargets, String toolChain, String tagName, String toolCmd, Vector<Object> archList, String contents) {
- XmlObject o = getfpdBuildOpts().getOptions();
- if (o == null) {
- return;
- }
-
- XmlCursor cursor = o.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- OptionDocument.Option opt = (OptionDocument.Option)cursor.getObject();
- setBuildOptionsOpt(buildTargets, toolChain, tagName, toolCmd, archList, contents, opt);
- }
- cursor.dispose();
- }
-
- public int getBuildOptionsOptCount(){
- if (getfpdBuildOpts().getOptions() == null || getfpdBuildOpts().getOptions().getOptionList() == null) {
- return 0;
- }
- return getfpdBuildOpts().getOptions().getOptionList().size();
- }
-
- public void getBuildOptionsOpts(String[][] saa) {
- if (getfpdBuildOpts().getOptions() == null || getfpdBuildOpts().getOptions().getOptionList() == null) {
- return ;
- }
-
- List<OptionDocument.Option> lOpt = getfpdBuildOpts().getOptions().getOptionList();
- ListIterator li = lOpt.listIterator();
- int i = 0;
- while(li.hasNext()) {
- OptionDocument.Option opt = (OptionDocument.Option)li.next();
- if (opt.getBuildTargets() != null) {
- saa[i][0] = listToString(opt.getBuildTargets());
- }
- saa[i][1] = opt.getToolChainFamily();
- if (opt.getSupArchList() != null){
- saa[i][2] = listToString(opt.getSupArchList());
-
- }
- saa[i][3] = opt.getToolCode();
- saa[i][4] = opt.getTagName();
- saa[i][5] = opt.getStringValue();
-
- ++i;
- }
- }
-
- public void genBuildOptionsFfs(String ffsKey, String type) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getfpdBuildOpts().addNewFfs();
- ffs.setFfsKey(ffsKey);
- if (type != null) {
- ffs.addNewSections().setEncapsulationType(type);
- }
- }
-
- public void updateBuildOptionsFfsSectionsType(int i, String type) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- ffs.getSections().setEncapsulationType(type);
- }
-
- public void genBuildOptionsFfsAttribute(int i, String name, String value) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = ffs.addNewAttribute();
- attrib.setName(name);
- attrib.setValue(value);
- }
-
- /**update jth attribute of ith ffs.
- * @param i
- * @param j
- */
- public void updateBuildOptionsFfsAttribute(int i, int j, String name, String value){
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- XmlCursor cursor = ffs.newCursor();
- QName qAttrib = new QName(xmlNs, "Attribute");
- if (cursor.toChild(qAttrib)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qAttrib);
- }
- BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = (BuildOptionsDocument.BuildOptions.Ffs.Attribute)cursor.getObject();
- attrib.setName(name);
- attrib.setValue(value);
- }
- cursor.dispose();
- }
-
- public void removeBuildOptionsFfsAttribute(int i, int j){
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- XmlCursor cursor = ffs.newCursor();
- QName qAttrib = new QName(xmlNs, "Attribute");
- if (cursor.toChild(qAttrib)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qAttrib);
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void genBuildOptionsFfsSectionsSection(int i, String sectionType) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- if (ffs == null) {
- return;
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
-
- if (sections == null){
- sections = ffs.addNewSections();
- }
- sections.addNewSection().setSectionType(EfiSectionType.Enum.forString(sectionType));
- }
-
- public void removeBuildOptionsFfsSectionsSection(int i, int j) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSection = new QName(xmlNs, "Section");
- if (cursor.toChild(qSection)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSection);
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void updateBuildOptionsFfsSectionsSection(int i, int j, String type){
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSection = new QName(xmlNs, "Section");
- if (cursor.toChild(qSection)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSection);
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Section section = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Section)cursor.getObject();
- section.setSectionType(EfiSectionType.Enum.forString(type));
- }
- cursor.dispose();
- }
-
- public void genBuildOptionsFfsSectionsSections(int i, String encapType) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- if (ffs == null) {
- return;
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
-
- if (sections == null){
- sections = ffs.addNewSections();
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = sections.addNewSections();
- sections2.setEncapsulationType(encapType);
- sections2.addNewSection().setSectionType(EfiSectionType.Enum.forString("EFI_SECTION_PE32"));
- }
-
- public void removeBuildOptionsFfsSectionsSections(int i, int j) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSections);
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void updateBuildOptionsFfsSectionsSections(int i, int j, String type) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)) {
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSections);
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2)cursor.getObject();
- sections2.setEncapsulationType(type);
- }
- cursor.dispose();
- }
-
- public void genBuildOptionsFfsSectionsSectionsSection(int i, int j, String type) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- if (ffs == null) {
- return;
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)){
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSections);
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2)cursor.getObject();
- sections2.addNewSection().setSectionType(EfiSectionType.Enum.forString(type));
- }
- cursor.dispose();
- }
-
- public void removeBuildOptionsFfsSectionsSectionsSection(int i, int j, int k) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)) {
- for (int l = 0; l < j; ++l) {
- cursor.toNextSibling(qSections);
- }
- if (cursor.toFirstChild()) {
- int m = 0;
- for (; m < k; ++m) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- if (m == 0) {
- cursor.toParent();
- cursor.removeXml();
- }
- }
- }
- cursor.dispose();
- }
-
- public void updateBuildOptionsFfsSectionsSectionsSection(int i, int j, int k, String type) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- if (sections == null) {
- return;
- }
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)) {
- for (int l = 0; l < j; ++l) {
- cursor.toNextSibling(qSections);
- }
- if (cursor.toFirstChild()) {
- for (int m = 0; m < k; ++m) {
- cursor.toNextSibling();
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section)cursor.getObject();
- section.setSectionType(EfiSectionType.Enum.forString(type));
- }
- }
- cursor.dispose();
- }
-
- public void getBuildOptionsFfsSectionsSectionsSection(int i, int j, ArrayList<String> al) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- if (ffs == null) {
- return;
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections sections = ffs.getSections();
- XmlCursor cursor = sections.newCursor();
- QName qSections = new QName(xmlNs, "Sections");
- if (cursor.toChild(qSections)){
- for (int k = 0; k < j; ++k) {
- cursor.toNextSibling(qSections);
- }
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2 sections2 = (BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2)cursor.getObject();
- if (sections2.getSectionList() == null){
- cursor.dispose();
- return;
- }
- ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section> li = sections2.getSectionList().listIterator();
- while(li.hasNext()) {
- BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2.Section section = li.next();
-// if (section.isSetSectionType()) {
- al.add(section.getSectionType()+"");
-// }
-
- }
- }
- cursor.dispose();
-
- }
-
- public int getBuildOptionsFfsCount(){
- if (getfpdBuildOpts().getFfsList() == null) {
- return 0;
- }
- return getfpdBuildOpts().getFfsList().size();
- }
-
- public void getBuildOptionsFfsKey(String[][] saa) {
- if (getfpdBuildOpts().getFfsList() == null) {
- return;
- }
- ListIterator<BuildOptionsDocument.BuildOptions.Ffs> li = getfpdBuildOpts().getFfsList().listIterator();
- int i = 0;
- while(li.hasNext()){
- BuildOptionsDocument.BuildOptions.Ffs ffs = li.next();
- saa[i][0] = ffs.getFfsKey();
- ++i;
- }
- }
-
- public void updateBuildOptionsFfsKey(int i, String key) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- ffs.setFfsKey(key);
- }
-
- /**Get ith FFS key and contents.
- * @param saa
- */
- public void getBuildOptionsFfs(int i, String[] sa, LinkedHashMap<String, String> ffsAttribMap, ArrayList<String> firstLevelSections, ArrayList<String> firstLevelSection) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
-
- if (ffs != null) {
-
- sa[0] = ffs.getFfsKey();
- if (ffs.getSections() != null) {
- if(ffs.getSections().getEncapsulationType() != null){
- sa[1] = ffs.getSections().getEncapsulationType();
- }
- if (ffs.getSections().getSectionList() != null){
- ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Section> li = ffs.getSections().getSectionList().listIterator();
- while (li.hasNext()) {
- firstLevelSection.add(li.next().getSectionType()+"");
- }
- }
- if (ffs.getSections().getSectionsList() != null) {
- ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Sections.Sections2> li = ffs.getSections().getSectionsList().listIterator();
- while(li.hasNext()) {
- firstLevelSections.add(li.next().getEncapsulationType());
- }
- }
- }
- if (ffs.getAttributeList() != null) {
- ListIterator<BuildOptionsDocument.BuildOptions.Ffs.Attribute> li = ffs.getAttributeList().listIterator();
- while(li.hasNext()) {
- BuildOptionsDocument.BuildOptions.Ffs.Attribute attrib = li.next();
- ffsAttribMap.put(attrib.getName(), attrib.getValue());
- }
-
- }
- }
-
-
- }
-
- private BuildOptionsDocument.BuildOptions.Ffs getFfs(int i) {
- XmlObject o = getfpdBuildOpts();
- BuildOptionsDocument.BuildOptions.Ffs ffs = null;
-
- XmlCursor cursor = o.newCursor();
- QName qFfs = new QName(xmlNs, "Ffs");
- if (cursor.toChild(qFfs)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFfs);
- }
- ffs = (BuildOptionsDocument.BuildOptions.Ffs)cursor.getObject();
- }
- cursor.dispose();
- return ffs;
- }
-
- public void removeBuildOptionsFfs(int i) {
- BuildOptionsDocument.BuildOptions.Ffs ffs = getFfs(i);
- if (ffs == null){
- return;
- }
-
- XmlCursor cursor = ffs.newCursor();
- cursor.removeXml();
- cursor.dispose();
- }
-
-
-
- public PlatformDefinitionsDocument.PlatformDefinitions getfpdPlatformDefs(){
- if (fpdPlatformDefs == null){
- fpdPlatformDefs = fpdRoot.addNewPlatformDefinitions();
- }
- return fpdPlatformDefs;
- }
-
- public void getPlatformDefsSupportedArchs(Vector<Object> archs){
- if (getfpdPlatformDefs().getSupportedArchitectures() == null) {
- return;
- }
- ListIterator li = getfpdPlatformDefs().getSupportedArchitectures().listIterator();
- while(li.hasNext()) {
- archs.add(li.next());
- }
- }
-
- public void setPlatformDefsSupportedArchs(Vector<Object> archs) {
- if (archs != null) {
- getfpdPlatformDefs().setSupportedArchitectures(archs);
- }
-// else {
-// XmlCursor cursor = getfpdPlatformDefs().newCursor();
-// if (cursor.toChild(xmlNs, "SupportedArchitectures")) {
-// cursor.removeXml();
-// }
-// cursor.dispose();
-// }
- }
-
- public void getPlatformDefsBuildTargets(Vector<Object> targets) {
- if (getfpdPlatformDefs().getBuildTargets() == null) {
- return;
- }
- ListIterator li = getfpdPlatformDefs().getBuildTargets().listIterator();
- while(li.hasNext()) {
- targets.add(li.next());
- }
- }
-
- public void setPlatformDefsBuildTargets(Vector<Object> targets) {
- getfpdPlatformDefs().setBuildTargets(targets);
- }
-
- public void genPlatformDefsSkuInfo(String id, String name) {
- SkuInfoDocument.SkuInfo skuInfo = null;
- if (getfpdPlatformDefs().getSkuInfo() == null) {
- skuInfo = getfpdPlatformDefs().addNewSkuInfo();
- }
- skuInfo = getfpdPlatformDefs().getSkuInfo();
- if (skuInfo.getUiSkuNameList() == null || skuInfo.getUiSkuNameList().size() == 0) {
- SkuInfoDocument.SkuInfo.UiSkuName skuName = skuInfo.addNewUiSkuName();
- skuName.setSkuID(new BigInteger("0"));
- skuName.setStringValue("DEFAULT");
- }
- if (id.equals("0")) {
- return;
- }
- SkuInfoDocument.SkuInfo.UiSkuName skuName = skuInfo.addNewUiSkuName();
- skuName.setSkuID(new BigInteger(id));
- skuName.setStringValue(name);
- }
-
- public int getPlatformDefsSkuInfoCount(){
- if (getfpdPlatformDefs().getSkuInfo() == null || getfpdPlatformDefs().getSkuInfo().getUiSkuNameList() == null) {
- return 0;
- }
- return getfpdPlatformDefs().getSkuInfo().getUiSkuNameList().size();
- }
-
- public void getPlatformDefsSkuInfos(String[][] saa){
- if (getfpdPlatformDefs().getSkuInfo() == null || getfpdPlatformDefs().getSkuInfo().getUiSkuNameList() == null) {
- if (getfpdDynPcdBuildDefs().getPcdBuildDataList() == null) {
- removeElement(getfpdDynPcdBuildDefs());
- fpdDynPcdBuildDefs = null;
- }
- return ;
- }
-
- List<SkuInfoDocument.SkuInfo.UiSkuName> l = getfpdPlatformDefs().getSkuInfo().getUiSkuNameList();
- ListIterator<SkuInfoDocument.SkuInfo.UiSkuName> li = l.listIterator();
- int i = 0;
- while(li.hasNext()) {
- SkuInfoDocument.SkuInfo.UiSkuName sku = li.next();
- saa[i][0] = sku.getSkuID()+"";
- saa[i][1] = sku.getStringValue();
- ++i;
- }
- }
-
- public void removePlatformDefsSkuInfo(int i) {
- SkuInfoDocument.SkuInfo skuInfo = getfpdPlatformDefs().getSkuInfo();
- if (skuInfo == null || i == 0) {
- return ;
- }
-
- XmlCursor cursor = skuInfo.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void updatePlatformDefsSkuInfo(int i, String id, String name) {
- SkuInfoDocument.SkuInfo skuInfo = getfpdPlatformDefs().getSkuInfo();
- if (skuInfo == null || i == 0) {
- return ;
- }
-
- XmlCursor cursor = skuInfo.newCursor();
- if (cursor.toFirstChild()) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling();
- }
- SkuInfoDocument.SkuInfo.UiSkuName sku = (SkuInfoDocument.SkuInfo.UiSkuName)cursor.getObject();
- sku.setSkuID(new BigInteger(id));
- sku.setStringValue(name);
- }
- cursor.dispose();
- }
-
- public String getPlatformDefsInterDir(){
- if (getfpdPlatformDefs().getIntermediateDirectories() == null) {
- return null;
- }
- return getfpdPlatformDefs().getIntermediateDirectories().toString();
- }
-
- public void setPlatformDefsInterDir(String interDir){
- getfpdPlatformDefs().setIntermediateDirectories(IntermediateOutputType.Enum.forString(interDir));
- }
-
- public String getPlatformDefsOutputDir() {
- return getfpdPlatformDefs().getOutputDirectory();
- }
-
- public void setPlatformDefsOutputDir(String outputDir) {
- if (outputDir != null && outputDir.length() > 0) {
- getfpdPlatformDefs().setOutputDirectory(outputDir);
- }
- else{
- XmlCursor cursor = getfpdPlatformDefs().newCursor();
- if (cursor.toChild(new QName(xmlNs, "OutputDirectory"))) {
- cursor.removeXml();
- }
- cursor.dispose();
- }
- }
-
- public FlashDocument.Flash getfpdFlash() {
- if (fpdFlash == null) {
- fpdFlash = fpdRoot.addNewFlash();
- }
- return fpdFlash;
- }
-
- public void genFlashDefinitionFile(String file) {
- FlashDefinitionFileDocument.FlashDefinitionFile fdf = getfpdFlash().getFlashDefinitionFile();
- if (fdf == null) {
- fdf = getfpdFlash().addNewFlashDefinitionFile();
- }
-
- fdf.setStringValue(file);
- }
-
- public String getFlashDefinitionFile() {
- FlashDefinitionFileDocument.FlashDefinitionFile fdf = getfpdFlash().getFlashDefinitionFile();
- if (fdf == null) {
- return "";
- }
-
- return fdf.getStringValue();
- }
-
- public void genFvImagesNameValue(String name, String value) {
-
- FvImagesDocument.FvImages fi = getfpdFlash().getFvImages();
- if (fi == null) {
- fi = getfpdFlash().addNewFvImages();
- }
-
- FvImagesDocument.FvImages.NameValue nv = fi.addNewNameValue();
- nv.setName(name);
- nv.setValue(value);
- }
-
- public void removeFvImagesNameValue(int i){
-
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
-
- QName qNameValue = new QName(xmlNs, "NameValue");
- XmlCursor cursor = o.newCursor();
- if (cursor.toChild(qNameValue)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qNameValue);
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- public void updateFvImagesNameValue(int i, String name, String value){
-
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
-
- QName qNameValue = new QName(xmlNs, "NameValue");
- XmlCursor cursor = o.newCursor();
- if (cursor.toChild(qNameValue)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qNameValue);
- }
- FvImagesDocument.FvImages.NameValue nv = (FvImagesDocument.FvImages.NameValue)cursor.getObject();
- nv.setName(name);
- nv.setValue(value);
- }
- cursor.dispose();
- }
-
- public int getFvImagesNameValueCount() {
-
- FvImagesDocument.FvImages fi = null;
- if ((fi = getfpdFlash().getFvImages()) == null || fi.getNameValueList() == null) {
- return 0;
- }
- return fi.getNameValueList().size();
- }
-
- public void getFvImagesNameValues(String[][] nv) {
-
- FvImagesDocument.FvImages fi = getfpdFlash().getFvImages();
- if (fi == null){
- return;
- }
- List<FvImagesDocument.FvImages.NameValue> l = fi.getNameValueList();
- int i = 0;
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.NameValue e = (FvImagesDocument.FvImages.NameValue) li
- .next();
- nv[i][0] = e.getName();
- nv[i][1] = e.getValue();
-
- i++;
- }
- }
-
- public void getFvImagesFvImageFvImageNames (Vector<String> vImageNames) {
- FvImagesDocument.FvImages fis = getfpdFlash().getFvImages();
- if (fis == null || fis.getFvImageList() == null) {
- return;
- }
-
- ListIterator<FvImagesDocument.FvImages.FvImage> li = fis.getFvImageList().listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = li.next();
- if (fi.getType().toString().equals("ImageName")) {
- vImageNames.addAll(fi.getFvImageNamesList());
- return;
- }
- }
- }
-
- public void addFvImageFvImageNames (String[] fvNames) {
- FvImagesDocument.FvImages fis = getfpdFlash().getFvImages();
- if (fis == null || fis.getFvImageList() == null) {
- genFvImagesFvImage (fvNames, "ImageName", null);
- return;
- }
-
- ListIterator<FvImagesDocument.FvImages.FvImage> li = fis.getFvImageList().listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = li.next();
- if (fi.getType().toString().equals("ImageName")) {
- addFvImageNamesInFvImage (fi, fvNames);
- return;
- }
- }
- genFvImagesFvImage (fvNames, "ImageName", null);
- }
-
- public void addFvImageNamesInFvImage (FvImagesDocument.FvImages.FvImage fi, String[] fvNames) {
-
- for (int i = 0; i < fvNames.length; ++i) {
- fi.addFvImageNames(fvNames[i]);
- }
- }
-
- public void addFvImageNamesInFvImage (int i, String[] fvNames) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- addFvImageNamesInFvImage(fi, fvNames);
- }
- cursor.dispose();
- }
-
- public void genFvImagesFvImage(String[] names, String types, Map<String, String> options) {
-
- FvImagesDocument.FvImages fis = null;
- if ((fis = getfpdFlash().getFvImages()) == null) {
- fis = getfpdFlash().addNewFvImages();
- }
-
- //
- //gen FvImage with FvImageNames array
- //
- FvImagesDocument.FvImages.FvImage fi = fis.addNewFvImage();
- for (int i = 0; i < names.length; ++i) {
- fi.addFvImageNames(names[i]);
- }
- fi.setType(FvImageTypes.Enum.forString(types));
- if (options != null){
- setFvImagesFvImageFvImageOptions(options, fi);
- }
- }
-
- private void setFvImagesFvImageFvImageOptions(Map<String, String> options, FvImagesDocument.FvImages.FvImage fi){
- FvImagesDocument.FvImages.FvImage.FvImageOptions fio = fi.getFvImageOptions();
- if (fio == null){
- fio = fi.addNewFvImageOptions();
- }
-
- Set<String> key = options.keySet();
- Iterator<String> i = key.iterator();
- while (i.hasNext()) {
-
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = fio.addNewNameValue();
- String k = (String)i.next();
-
- nv.setName(k);
- nv.setValue((String)options.get(k));
-
- }
-
- }
-
-
- public void removeFvImagesFvImage(int i) {
-
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
-
- QName qFvImage = new QName(xmlNs, "FvImage");
- XmlCursor cursor = o.newCursor();
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- cursor.removeXml();
- }
- cursor.dispose();
- }
-
- /**
- * @param oldFvName
- * @param newFvName The New FV Name. If null, remove the old FvImageNames entry.
- */
- public void updateFvImageNameAll (String oldFvName, String newFvName) {
- if (getfpdFlash().getFvImages() == null || getfpdFlash().getFvImages().getFvImageList() == null) {
- return;
- }
- ListIterator<FvImagesDocument.FvImages.FvImage> li = getfpdFlash().getFvImages().getFvImageList().listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = li.next();
- updateFvImageNamesInFvImage (fi, oldFvName, newFvName);
- if (fi.getFvImageNamesList().size() == 0) {
- li.remove();
- }
- }
- }
-
- public void updateFvImageNamesInFvImage (int i, String oldFvName, String newFvName) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- updateFvImageNamesInFvImage (fi, oldFvName, newFvName);
- }
- cursor.dispose();
- }
- /**
- * @param fi
- * @param oldFvName The FV Name to be replaced.
- * @param newFvName The New FV Name. If null, remove the old FvImageNames entry.
- */
- public void updateFvImageNamesInFvImage (FvImagesDocument.FvImages.FvImage fi, String oldFvName, String newFvName) {
- QName qFvImageNames = new QName(xmlNs, "FvImageNames");
- XmlCursor cursor = fi.newCursor();
-
- if (cursor.toChild(qFvImageNames)) {
- do {
- String xmlValue = cursor.getTextValue();
- if (xmlValue.equals(oldFvName)){
- if (newFvName != null) {
- cursor.setTextValue(newFvName);
- }
- else {
- cursor.removeXml();
- }
- }
- }while (cursor.toNextSibling(qFvImageNames));
- }
-
- cursor.dispose();
- }
-
- /**update the Type attribute of ith FvImage with new type.
- * @param i
- * @param type
- */
- public void updateFvImagesFvImageType (int i, String type) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- fi.setType(FvImageTypes.Enum.forString(type));
- }
- cursor.dispose();
- }
-
- public void updateFvImagesFvImage(int i, String[] names, String types, Map<String, String> options){
-
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- fi.setType(FvImageTypes.Enum.forString(types));
-
- //
- // remove old FvImageNames before adding new ones
- //
- QName qFvImageNames = new QName(xmlNs, "FvImageNames");
- cursor.toChild(qFvImageNames);
- cursor.removeXml();
- while (cursor.toNextSibling(qFvImageNames)) {
- cursor.removeXml();
- }
-
- for (int k = 0; k < names.length; ++k) {
- fi.addFvImageNames(names[k]);
- }
- //
- // remove old FvImageOptions before adding new options
- //
- QName qFvImageOptions = new QName(xmlNs, "FvImageOptions");
- cursor.toNextSibling(qFvImageOptions);
- cursor.removeXml();
-
- setFvImagesFvImageFvImageOptions(options, fi);
- }
- cursor.dispose();
- }
-
- public int getFvImagesFvImageCount(String type) {
-
- if (getfpdFlash().getFvImages() == null || getfpdFlash().getFvImages().getFvImageList() == null) {
- return 0;
- }
- List<FvImagesDocument.FvImages.FvImage> l = getfpdFlash().getFvImages().getFvImageList();
- ListIterator li = l.listIterator();
- int i = 0;
- while(li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)li.next();
- if (!fi.getType().toString().equals(type) && !type.equals("ALL")) {
- continue;
- }
-
- ++i;
- }
-
- return i;
- }
-
- public Vector<FvImagesDocument.FvImages.FvImage> getFvImagesFvImageWithName (String fvName, String type) {
- Vector<FvImagesDocument.FvImages.FvImage> vFvImage = new Vector<FvImagesDocument.FvImages.FvImage>();
- if (getfpdFlash().getFvImages() == null || getfpdFlash().getFvImages().getFvImageList() == null) {
- return vFvImage;
- }
- List<FvImagesDocument.FvImages.FvImage> l = getfpdFlash().getFvImages().getFvImageList();
- ListIterator li = l.listIterator();
- while(li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)li.next();
- if (!fi.getType().toString().equals(type) && !type.equals("ALL")) {
- continue;
- }
- if (fi.getFvImageNamesList().contains(fvName)) {
- vFvImage.add(fi);
- }
- }
-
- return vFvImage;
- }
- /**
- * @param saa
- * @param type "ALL" means all FvImage types: ImageName, Options, Attributes, Components.
- */
- public void getFvImagesFvImages(String[][] saa, String type) {
-
- if (getfpdFlash().getFvImages() == null) {
- return;
- }
- List<FvImagesDocument.FvImages.FvImage> l = getfpdFlash().getFvImages().getFvImageList();
- if (l == null) {
- return;
- }
- ListIterator li = l.listIterator();
- int i = 0;
- while(li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)li.next();
- if (!fi.getType().toString().equals(type) && !type.equals("ALL")) {
- continue;
- }
- //
- // get FvImageNames array, space separated
- //
- List<String> lfn = fi.getFvImageNamesList();
- ListIterator lfni = lfn.listIterator();
- saa[i][0] = " ";
- while (lfni.hasNext()) {
- saa[i][0] += (String)lfni.next();
- saa[i][0] += " ";
- }
- saa[i][0] = saa[i][0].trim();
-
- saa[i][1] = fi.getType()+"";
-
- ++i;
- }
- }
-
- public void removeFvImageNameValue (int i, String attributeName) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- removeFvImageNameValue (fi, attributeName);
- }
- cursor.dispose();
- }
- /**Remove from fi the attribute pair with attributeName in FvImageOptions.
- * @param fi
- * @param attributeName
- */
- public void removeFvImageNameValue (FvImagesDocument.FvImages.FvImage fi, String attributeName) {
- if (fi.getFvImageOptions() != null && fi.getFvImageOptions().getNameValueList() != null) {
- ListIterator<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> li = fi.getFvImageOptions().getNameValueList().listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = li.next();
- if (nv.getName().equals(attributeName)) {
- li.remove();
- }
- }
- }
- }
-
- public void removeTypedNamedFvImageNameValue (String fvName, String type, String optName) {
- Vector<FvImagesDocument.FvImages.FvImage> vFvImage = getFvImagesFvImageWithName(fvName, type);
- for (int i = 0; i < vFvImage.size(); ++i) {
- FvImagesDocument.FvImages.FvImage fi = vFvImage.get(i);
- removeFvImageNameValue (fi, optName);
- }
- }
-
- /**Add name-value pair to FvImage element with type.
- * @param fvName FV name to add name-value pair.
- * @param type FvImage attribute.
- * @param name
- * @param value
- */
- public void setTypedNamedFvImageNameValue (String fvName, String type, String name, String value, String newName) {
- boolean fvImageExists = false;
- if (getfpdFlash().getFvImages() != null) {
-
- List<FvImagesDocument.FvImages.FvImage> l = getfpdFlash().getFvImages().getFvImageList();
- if (l != null) {
- ListIterator li = l.listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage) li.next();
- if (!fi.getType().toString().equals(type) && !type.equals("ALL")) {
- continue;
- }
- if (!fi.getFvImageNamesList().contains(fvName)) {
- continue;
- }
- fvImageExists = true;
- setFvImagesFvImageNameValue(fi, name, value, newName);
- }
- }
- }
-
- if (!fvImageExists) {
- HashMap<String, String> map = new HashMap<String, String>();
- map.put(name, value);
- genFvImagesFvImage(new String[] { fvName }, type, map);
- }
- }
-
- /**Add to all FvImage elements with type, the name-value pair.
- * @param type
- * @param name
- * @param value
- */
- public void setTypedFvImageNameValue (String type, String name, String value) {
- if (getfpdFlash().getFvImages() == null) {
- return;
- }
- List<FvImagesDocument.FvImages.FvImage> l = getfpdFlash().getFvImages().getFvImageList();
- if (l == null) {
- return;
- }
- ListIterator li = l.listIterator();
- while(li.hasNext()) {
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)li.next();
- if (!fi.getType().toString().equals(type) && !type.equals("ALL")) {
- continue;
- }
- setFvImagesFvImageNameValue (fi, name, value, null);
- }
-
- }
-
- public void setFvImagesFvImageNameValue (int i, String name, String value) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- setFvImagesFvImageNameValue (fi, name, value, null);
- }
- cursor.dispose();
- }
-
- /**Add to FvImage the name-value pair, or replace old name with newName, or generate new name-value pair if not exists before.
- * @param fi
- * @param name
- * @param value
- * @param newName
- */
- public void setFvImagesFvImageNameValue (FvImagesDocument.FvImages.FvImage fi, String name, String value, String newName) {
- if (fi.getFvImageOptions() == null || fi.getFvImageOptions().getNameValueList() == null) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = fi.addNewFvImageOptions().addNewNameValue();
- nv.setName(name);
- nv.setValue(value);
- if (newName != null && !newName.equals(name)) {
- nv.setName(newName);
- }
- return;
- }
-
- XmlCursor cursor = fi.getFvImageOptions().newCursor();
- if (cursor.toFirstChild()) {
- do {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue)cursor.getObject();
- if (nv.getName().equals(name)) {
- nv.setValue(value);
- if (newName != null && !newName.equals(name)) {
- nv.setName(newName);
- }
- cursor.dispose();
- return;
- }
- }while (cursor.toNextSibling());
- }
-
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = fi.getFvImageOptions().addNewNameValue();
- nv.setName(name);
- nv.setValue(value);
- if (newName != null && !newName.equals(name)) {
- nv.setName(newName);
- }
- cursor.dispose();
- }
-
- public void getFvImagesFvImageOptions (String fvName, Map<String, String> m) {
- Vector<FvImagesDocument.FvImages.FvImage> vFvImage = getFvImagesFvImageWithName (fvName, "Options");
- for (int i = 0; i < vFvImage.size(); ++i) {
- FvImagesDocument.FvImages.FvImage fi = vFvImage.get(i);
- if (fi == null || fi.getFvImageOptions() == null || fi.getFvImageOptions().getNameValueList() == null) {
- continue;
- }
-
- ListIterator<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> li = fi.getFvImageOptions()
- .getNameValueList()
- .listIterator();
- while (li.hasNext()) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = li.next();
- m.put(nv.getName(), nv.getValue());
- }
- }
- }
-
- public int getFvImagePosInFvImages (String fvNameList, String type) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return -1;
- }
-
- int pos = -1;
- String[] fvNameArray = fvNameList.trim().split(" ");
- Vector<String> vFvNames = new Vector<String>();
-
-
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- do {
- pos++;
- vFvNames.removeAllElements();
- for (int i = 0; i < fvNameArray.length; ++i) {
- vFvNames.add(fvNameArray[i]);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- if (!fi.getType().toString().equals(type)) {
- continue;
- }
- if (fi.getFvImageNamesList() == null || fi.getFvImageNamesList().size() != vFvNames.size()) {
- continue;
- }
- ListIterator<String> li = fi.getFvImageNamesList().listIterator();
- while (li.hasNext()) {
- String name = li.next();
- vFvNames.remove(name);
- }
- if (vFvNames.size() == 0) {
- cursor.dispose();
- return pos;
- }
-
- }while (cursor.toNextSibling(qFvImage));
-
- }
- cursor.dispose();
- return -1;
- }
- /**Get FvImage Options for FvImage i
- * @param i the ith FvImage
- */
- public void getFvImagesFvImageOptions(int i, Map<String, String> m) {
- XmlObject o = getfpdFlash().getFvImages();
- if (o == null) {
- return;
- }
- XmlCursor cursor = o.newCursor();
- QName qFvImage = new QName(xmlNs, "FvImage");
- if (cursor.toChild(qFvImage)) {
- for (int j = 0; j < i; ++j) {
- cursor.toNextSibling(qFvImage);
- }
- FvImagesDocument.FvImages.FvImage fi = (FvImagesDocument.FvImages.FvImage)cursor.getObject();
- if (fi.getFvImageOptions() == null || fi.getFvImageOptions().getNameValueList() == null){
- cursor.dispose();
- return;
- }
- ListIterator<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> li = fi.getFvImageOptions().getNameValueList().listIterator();
- while(li.hasNext()){
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nv = li.next();
- m.put(nv.getName(), nv.getValue());
- }
- }
- cursor.dispose();
- }
-
- /**
- Get platform header element
- @return PlatformHeaderDocument.PlatformHeader
- **/
- public PlatformHeaderDocument.PlatformHeader getFpdHdr() {
- if (fpdHdr == null) {
- fpdHdr = fpdRoot.addNewPlatformHeader();
- }
-
- return fpdHdr;
- }
-
- public String getFpdHdrPlatformName() {
- return getFpdHdr().getPlatformName();
- }
-
- public String getFpdHdrGuidValue() {
- return getFpdHdr().getGuidValue();
- }
-
- public String getFpdHdrVer() {
- return getFpdHdr().getVersion();
- }
-
- public String getFpdHdrAbs() {
- return getFpdHdr().getAbstract();
- }
-
- public String getFpdHdrDescription() {
- return getFpdHdr().getDescription();
- }
-
- public String getFpdHdrCopyright() {
- return getFpdHdr().getCopyright();
- }
-
- public String getFpdHdrLicense() {
- LicenseDocument.License l = getFpdHdr().getLicense();
- if (l == null) {
- return null;
- }
- return l.getStringValue();
- }
-
- public String getFpdHdrUrl() {
- LicenseDocument.License l = getFpdHdr().getLicense();
- if (l == null) {
- return null;
- }
- return l.getURL();
- }
-
- public String getFpdHdrSpec() {
-
- return "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
-// return getFpdHdr().getSpecification();
- }
-
- public void setFpdHdrPlatformName(String name){
- getFpdHdr().setPlatformName(name);
- }
-
- public void setFpdHdrGuidValue(String guid){
- getFpdHdr().setGuidValue(guid);
- }
-
- public void setFpdHdrVer(String v){
- getFpdHdr().setVersion(v);
- }
-
- public void setFpdHdrAbs(String abs) {
- getFpdHdr().setAbstract(abs);
- }
-
- public void setFpdHdrDescription(String desc){
- getFpdHdr().setDescription(desc);
- }
-
- public void setFpdHdrCopyright(String cr) {
- getFpdHdr().setCopyright(cr);
- }
-
- public void setFpdHdrLicense(String license){
- LicenseDocument.License l = getFpdHdr().getLicense();
- if (l == null) {
- getFpdHdr().addNewLicense().setStringValue(license);
- }
- else {
- l.setStringValue(license);
- }
- }
-
- public void setFpdHdrUrl(String url){
- LicenseDocument.License l = getFpdHdr().getLicense();
-
- l.setURL(url);
-
- }
-
- public void setFpdHdrSpec(String s){
- s = "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
- getFpdHdr().setSpecification(s);
- }
- /**
- Save the processed xml contents to file
-
- @param fpdFile The file to save xml contents
- @throws IOException Exceptions during file operation
- **/
- public void saveAs(File fpdFile) throws IOException {
-
- XmlOptions options = new XmlOptions();
-
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- try {
- fpdd.save(fpdFile, options);
- } catch (IOException e) {
- e.printStackTrace();
- }
-
- }
-
- private String listToString(List l) {
- if (l == null) {
- return null;
- }
- String s = " ";
- ListIterator li = l.listIterator();
- while(li.hasNext()) {
- s += li.next();
- s += " ";
- }
- return s.trim();
- }
-
- private void removeElement(XmlObject o) {
- XmlCursor cursor = o.newCursor();
- cursor.removeXml();
- cursor.dispose();
- }
-}
-
-class PcdItemTypeConflictException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private String details = null;
-
- PcdItemTypeConflictException (String pcdName, String info) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(info);
- if (mi != null) {
- details = pcdName + " ItemType Conflicts with " + mi.getName() + "\n in Pkg " + mi.getPackageId().getName();
- }
- else {
- details = pcdName + " ItemType Conflicts with \n" + info;
- }
- }
-
- PcdItemTypeConflictException (String pcdName, String info1, String info2) {
- ModuleIdentification mi1 = WorkspaceProfile.getModuleId(info1);
- ModuleIdentification mi2 = WorkspaceProfile.getModuleId(info2);
- String moduleInfo1 = "";
- String moduleInfo2 = "";
- if (mi1 != null) {
- moduleInfo1 = mi1.getName() + " in Pkg " + mi1.getPackageId().getName();
- }
- else {
- moduleInfo1 = info1;
- }
-
- if (mi2 != null) {
- moduleInfo2 = mi2.getName() + " in Pkg " + mi2.getPackageId().getName();
- }
- else {
- moduleInfo2 = info2;
- }
-
- details = pcdName + " ItemType Conflicts in \n" + moduleInfo1 + "\n and " + moduleInfo2;
- }
-
- public String getMessage() {
- return details;
- }
-}
-
-class PcdDeclNotFound extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private String details = null;
-
- PcdDeclNotFound(String info) {
- details = "PcdDeclNotFound: " + info;
- }
-
- public String getMessage() {
- return details;
- }
-}
-
-class PcdValueMalFormed extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private String details = null;
-
- PcdValueMalFormed(String info) {
- details = "PcdValueMalFormed: " + info;
- }
-
- public String getMessage() {
- return details;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java
deleted file mode 100644
index 29a6219e51..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFlash.java
+++ /dev/null
@@ -1,3239 +0,0 @@
-/** @file
- Java class FpdFlash is GUI for Flash element operation in SPD file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import javax.swing.JPanel;
-
-import javax.swing.AbstractAction;
-import javax.swing.JFileChooser;
-import javax.swing.JOptionPane;
-import javax.swing.JTabbedPane;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ComponentAdapter;
-import java.awt.event.ComponentEvent;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import javax.swing.JCheckBox;
-import javax.swing.JTextField;
-import java.awt.GridLayout;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.JComboBox;
-import java.awt.Dimension;
-import javax.swing.JSplitPane;
-
-public class FpdFlash extends IInternalFrame {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private final int startIndexOfDynamicTab = 2;
- private JPanel jContentPane = null;
- private JPanel jPanelContentEast = null;
- private JPanel jPanelContentSouth = null;
- private JPanel jPanelContentWest = null;
- private JPanel jPanelContentNorth = null;
- private JTabbedPane jTabbedPane = null;
- private JPanel jPanelFvImages = null;
- private JPanel jPanelFvImageS = null;
- private JPanel jPanelFvImageN = null;
- private JCheckBox jCheckBoxFvProperty = null;
- private JLabel jLabelFvPropName = null;
- private JTextField jTextFieldFvPropName = null;
- private JLabel jLabelFvPropValue = null;
- private JTextField jTextFieldFvPropValue = null;
- private JButton jButtonFvPropAdd = null;
- private JScrollPane jScrollPaneFvProp = null;
- private JTable jTableFvProp = null;
- private JPanel jPanelFvPropButtonGroup = null;
- private JButton jButtonFvPropDel = null;
- private DefaultTableModel fvPropertyTableModel = null;
- private DefaultTableModel fvImageNameTableModel = null;
- private ImageParaTableModel fvImageParaTableModel = null;
- private DefaultTableModel fvOptionTableModel = null;
- private JPanel jPanelFvImageC = null;
- private JLabel jLabelFvParaType = null;
- private JComboBox jComboBoxFvParaType = null;
- private JLabel jLabelFvImageNames = null;
- private JLabel jLabelFvParaName = null;
- private JTextField jTextFieldFvParaName = null;
- private JButton jButtonFvNameAdd = null;
- private JScrollPane jScrollPaneFvImageNames = null;
- private JTable jTableFvImageNames = null;
- private JButton jButtonFvNameDel = null;
- private JPanel jPanelFvImageOpts = null;
- private JButton jButtonAddFvImage = null;
- private JScrollPane jScrollPaneFvInfo = null;
- private JTable jTableFvInfo = null;
- private JButton jButtonDelFvImage = null;
- private JPanel jPanelFvImagePara = null;
- private OpeningPlatformType docConsole = null;
- private FpdFileContents ffc = null;
- private JPanel jPanelFdf = null;
- private JCheckBox jCheckBoxFdf = null;
- private JTextField jTextFieldFdf = null;
- private JButton jButtonFdfBrowse = null;
- private JLabel jLabelFvImageOptName = null;
- private JTextField jTextFieldFvImageOptName = null;
- private JLabel jLabelFvImageOptValue = null;
- private JTextField jTextFieldFvImageOptValue = null;
- private JPanel jPanelFvImageOptsButtonGroup = null;
- private JButton jButtonFvImageOptAdd = null;
- private JButton jButtonFvImageOptDel = null;
- private JScrollPane jScrollPane = null;
- private JTable jTableFvImageOpts = null;
- private JButton jButtonUpdateFvImage = null;
- private JPanel jPanelFdfN = null;
- private JPanel jPanelFdfS = null;
- private JSplitPane jSplitPaneFdfC = null;
- private JPanel jPanelFdfCTop = null;
- private JPanel jPanelFdfCBottom = null;
- private JPanel jPanelFdfCTopN = null;
- private JPanel jPanelFdfCTopS = null;
-// private JPanel jPanelFdfCTopC = null;
- private JPanel jPanelFdfCBottomN = null;
-// private JPanel jPanelFdfCBottomC = null;
- private JLabel jLabelFvInFdf = null;
- private JLabel jLabelFvAdditional = null;
- private JScrollPane jScrollPaneFvInFdf = null;
- private JTable jTableFvInFdf = null;
- private IDefaultTableModel fvInFdfTableModel = null; // @jve:decl-index=0:visual-constraint=""
- private JButton jButtonFvInFdfOptions = null;
- private JScrollPane jScrollPaneFvAdditional = null;
- private JTable jTableFvAdditional = null;
- private DefaultTableModel fvAdditionalTableModel = null; // @jve:decl-index=0:visual-constraint=""
- private JButton jButtonAddFv = null;
- private JButton jButtonDelFv = null;
- private JButton jButtonAddFvOptions = null;
- private int tabIndexForFv = -1;
- private int selectedRowInFvAdditionalTable = -1;
- private String oldFvName = null;
- private Vector<String> vBlockSize = new Vector<String>();
- private String determinedFvBlockSize = null;
- private final String defaultBlkSize = "0x10000";
- private String erasePolarity = "";
- boolean memModified = false;
- private FvOptsTableModel fvInFdfOptTableModel = null;
- private FvOptsTableModel fvAdditionalOptTableModel = null;
- private boolean sizeFromOptionDlg = false;
- private boolean fileFromOptionDlg = false;
- private JLabel jLabelOptions = null;
- private JPanel jPanelBgFvName = null;
- private JPanel jPanelBgFvImage = null;
- private JPanel jPanelW = null;
- private JPanel jPanelFvImageParaN = null;
- private JPanel jPanelFvImageParaS = null;
-// private JPanel jPanelFvImageParaC = null;
- private JPanel jPanelFvImageOptsN = null;
- private JPanel jPanelFvImageOptsS = null;
-// private JPanel jPanelFvImageOptsC = null;
- private JPanel jPanelFvImageParaE = null;
- private JPanel jPanelFvImageOptsE = null;
- private JPanel jPanelFvImageSN = null;
- private JPanel jPanelFvImageSE = null;
- private JPanel jPanelFvImageSS = null;
-
- public FpdFlash() {
- super();
- // TODO Auto-generated constructor stub
-
- initialize();
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setVisible(true);
- }
-
- public FpdFlash(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd){
- this();
- ffc = new FpdFileContents(fpd);
- init(ffc);
- }
-
- public FpdFlash(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- if (memModified) {
- docConsole.setSaved(false);
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Platform Synced with FDF file.");
- memModified = false;
- }
- }
-
- /**
- * This method initializes jPanel
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentEast() {
- if (jPanelContentEast == null) {
- FlowLayout flowLayout7 = new FlowLayout();
- flowLayout7.setVgap(50);
- jPanelContentEast = new JPanel();
- jPanelContentEast.setLayout(flowLayout7);
- }
- return jPanelContentEast;
- }
-
- /**
- * This method initializes jPanel1
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentSouth() {
- if (jPanelContentSouth == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
- flowLayout.setHgap(15);
- jPanelContentSouth = new JPanel();
- jPanelContentSouth.setLayout(flowLayout);
- jPanelContentSouth.setComponentOrientation(java.awt.ComponentOrientation.LEFT_TO_RIGHT);
- }
- return jPanelContentSouth;
- }
-
- /**
- * This method initializes jPanel2
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentWest() {
- if (jPanelContentWest == null) {
- jPanelContentWest = new JPanel();
- }
- return jPanelContentWest;
- }
-
- /**
- * This method initializes jPanel3
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentNorth() {
- if (jPanelContentNorth == null) {
- jPanelContentNorth = new JPanel();
- }
- return jPanelContentNorth;
- }
-
- /**
- * This method initializes jTabbedPane
- *
- * @return javax.swing.JTabbedPane
- */
- private JTabbedPane getJTabbedPane() {
- if (jTabbedPane == null) {
- jTabbedPane = new JTabbedPane();
- jTabbedPane.addTab("General", null, getJPanelFdf(), null);
- jTabbedPane.addTab("Advanced", null, getJPanelFvImages(), null);
-
- }
- return jTabbedPane;
- }
-
- /**
- * This method initializes jPanelFvImages
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImages() {
- if (jPanelFvImages == null) {
- jPanelFvImages = new JPanel();
- jPanelFvImages.setLayout(new BorderLayout());
- jPanelFvImages.add(getJPanelFvImageN(), java.awt.BorderLayout.NORTH);
- jPanelFvImages.add(getJPanelFvImageS(), java.awt.BorderLayout.SOUTH);
- jPanelFvImages.add(getJPanelFvImageC(), java.awt.BorderLayout.CENTER);
- jPanelFvImages.add(getJPanelW(), java.awt.BorderLayout.EAST);
- jPanelFvImages.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent e) {
-// fvImageParaTableModel.setRowCount(0);
-// fvPropertyTableModel.setRowCount(0);
-
-
- }
- });
-
- }
- return jPanelFvImages;
- }
-
- /**
- * This method initializes jPanelFvImageN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageS() {
- if (jPanelFvImageS == null) {
- jLabelFvPropValue = new JLabel();
- jLabelFvPropValue.setText("Value");
- jLabelFvPropValue.setEnabled(false);
- jLabelFvPropValue.setPreferredSize(new java.awt.Dimension(38,20));
- jLabelFvPropName = new JLabel();
- jLabelFvPropName.setText("Name");
- jLabelFvPropName.setEnabled(false);
- jLabelFvPropName.setPreferredSize(new java.awt.Dimension(38,20));
- jPanelFvImageS = new JPanel();
- jPanelFvImageS.setPreferredSize(new java.awt.Dimension(576,130));
- jPanelFvImageS.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
- jPanelFvImageS.setLayout(new BorderLayout());
- jPanelFvImageS.add(getJPanelFvImageSN(), java.awt.BorderLayout.NORTH);
- jPanelFvImageS.add(getJPanelFvImageSE(), java.awt.BorderLayout.EAST);
- jPanelFvImageS.add(getJPanelFvImageSS(), java.awt.BorderLayout.SOUTH);
- jPanelFvImageS.add(getJScrollPaneFvProp(), java.awt.BorderLayout.CENTER);
-
- }
- return jPanelFvImageS;
- }
-
- /**
- * This method initializes jPanelFvImageS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageN() {
- if (jPanelFvImageN == null) {
- GridLayout gridLayout2 = new GridLayout();
- gridLayout2.setRows(1);
- jPanelFvImageN = new JPanel();
- jPanelFvImageN.setPreferredSize(new java.awt.Dimension(480,150));
- jPanelFvImageN.setLayout(gridLayout2);
- jPanelFvImageN.add(getJScrollPaneFvInfo(), null);
- }
- return jPanelFvImageN;
- }
-
-
- /**
- * This method initializes jCheckBox1
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFvProperty() {
- if (jCheckBoxFvProperty == null) {
- jCheckBoxFvProperty = new JCheckBox();
- jCheckBoxFvProperty.setText("Global FV Variables");
- jCheckBoxFvProperty.addItemListener(new ItemListener(){
-
- public void itemStateChanged(ItemEvent arg0) {
- // TODO Auto-generated method stub
- boolean seleted = jCheckBoxFvProperty.isSelected();
-
- jLabelFvPropName.setEnabled(seleted);
- jTextFieldFvPropName.setEnabled(seleted);
- jLabelFvPropValue.setEnabled(seleted);
- jTextFieldFvPropValue.setEnabled(seleted);
- jTableFvProp.setEnabled(seleted);
- jButtonFvPropAdd.setEnabled(seleted);
- jButtonFvPropDel.setEnabled(seleted);
-
-
- }
-
- });
- }
- return jCheckBoxFvProperty;
- }
-
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvPropName() {
- if (jTextFieldFvPropName == null) {
- jTextFieldFvPropName = new JTextField();
- jTextFieldFvPropName.setPreferredSize(new java.awt.Dimension(100,20));
- jTextFieldFvPropName.setEnabled(false);
- }
- return jTextFieldFvPropName;
- }
-
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvPropValue() {
- if (jTextFieldFvPropValue == null) {
- jTextFieldFvPropValue = new JTextField();
- jTextFieldFvPropValue.setPreferredSize(new java.awt.Dimension(100,20));
- jTextFieldFvPropValue.setEnabled(false);
- }
- return jTextFieldFvPropValue;
- }
-
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvPropAdd() {
- if (jButtonFvPropAdd == null) {
- jButtonFvPropAdd = new JButton();
- jButtonFvPropAdd.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonFvPropAdd.setEnabled(false);
- jButtonFvPropAdd.setText("Add");
- jButtonFvPropAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- if (jTextFieldFvPropName.getText().length() > 0 && jTextFieldFvPropValue.getText().length() > 0){
- String[] row = {jTextFieldFvPropName.getText(), jTextFieldFvPropValue.getText()};
- fvPropertyTableModel.addRow(row);
- docConsole.setSaved(false);
- ffc.genFvImagesNameValue(row[0], row[1]);
- }
- }
- });
- }
- return jButtonFvPropAdd;
- }
-
-
- /**
- * This method initializes jScrollPane1
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvProp() {
- if (jScrollPaneFvProp == null) {
- jScrollPaneFvProp = new JScrollPane();
- jScrollPaneFvProp.setPreferredSize(new java.awt.Dimension(350,100));
- jScrollPaneFvProp.setViewportView(getJTableFvProp());
- }
- return jScrollPaneFvProp;
- }
-
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvProp() {
- if (jTableFvProp == null) {
- fvPropertyTableModel = new DefaultTableModel();
- jTableFvProp = new JTable(fvPropertyTableModel);
- fvPropertyTableModel.addColumn("Name");
- fvPropertyTableModel.addColumn("Value");
- jTableFvProp.setRowHeight(20);
- jTableFvProp.setEnabled(false);
-
- jTableFvProp.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFvProp.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
-// selectedRow = lsm.getMinSelectionIndex();
- }
- }
- });
-
- jTableFvProp.getModel().addTableModelListener(new TableModelListener(){
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel)arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE){
-
- String name = m.getValueAt(row, 0) + "";
- String value = m.getValueAt(row, 1) + "";
- docConsole.setSaved(false);
- ffc.updateFvImagesNameValue(row, name, value);
- }
- }
- });
- }
- return jTableFvProp;
- }
-
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvPropButtonGroup() {
- if (jPanelFvPropButtonGroup == null) {
- jPanelFvPropButtonGroup = new JPanel();
- jPanelFvPropButtonGroup.setPreferredSize(new java.awt.Dimension(80,55));
-
- jPanelFvPropButtonGroup.add(getJButtonFvPropAdd(), null);
- jPanelFvPropButtonGroup.add(getJButtonFvPropDel(), null);
- }
- return jPanelFvPropButtonGroup;
- }
-
-
- /**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvPropDel() {
- if (jButtonFvPropDel == null) {
- jButtonFvPropDel = new JButton();
- jButtonFvPropDel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonFvPropDel.setEnabled(false);
- jButtonFvPropDel.setText("Delete");
- jButtonFvPropDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- if (jTableFvProp.getSelectedRow() >= 0){
- fvPropertyTableModel.removeRow(jTableFvProp.getSelectedRow());
- docConsole.setSaved(false);
- ffc.removeFvImagesNameValue(jTableFvProp.getSelectedRow());
- }
- }
- });
- }
- return jButtonFvPropDel;
- }
-
-
- /**
- * This method initializes jPanelFvImageC
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageC() {
- if (jPanelFvImageC == null) {
- GridLayout gridLayout = new GridLayout();
- gridLayout.setRows(2);
- jLabelFvParaName = new JLabel();
- jLabelFvParaName.setPreferredSize(new Dimension(38, 20));
- jLabelFvParaName.setText("Name");
- jLabelFvImageNames = new JLabel();
- jLabelFvImageNames.setText("FV Image Names");
- jLabelFvImageNames.setPreferredSize(new java.awt.Dimension(150,20));
- jLabelFvParaType = new JLabel();
- jLabelFvParaType.setText("Type");
- jLabelFvParaType.setPreferredSize(new java.awt.Dimension(70,20));
- jPanelFvImageC = new JPanel();
- jPanelFvImageC.setLayout(gridLayout);
- jPanelFvImageC.add(getJPanelFvImagePara(), null);
- jPanelFvImageC.add(getJPanelFvImageOpts(), null);
-
-
- }
- return jPanelFvImageC;
- }
-
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxFvParaType() {
- if (jComboBoxFvParaType == null) {
- jComboBoxFvParaType = new JComboBox();
- jComboBoxFvParaType.addItem("Attributes");
- jComboBoxFvParaType.addItem("Components");
- jComboBoxFvParaType.setSelectedIndex(0);
- jComboBoxFvParaType.setPreferredSize(new java.awt.Dimension(180,20));
- jComboBoxFvParaType.addItemListener(new ItemListener() {
-
- public void itemStateChanged(ItemEvent arg0) {
- // TODO disable attribute settings when ValidImageNames selected.
- int selectedRow = jTableFvInfo.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- String fvNameList = jTableFvInfo.getValueAt(selectedRow, 0)+"";
- String oldType = jTableFvInfo.getValueAt(selectedRow, 1)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, oldType);
- if (fvImagePos < 0) {
- return;
- }
-
- String type = jComboBoxFvParaType.getSelectedItem()+"";
- ffc.updateFvImagesFvImageType(fvImagePos, type);
- jTableFvInfo.setValueAt(type, selectedRow, 1);
- docConsole.setSaved(false);
- }
-
- });
- }
- return jComboBoxFvParaType;
- }
-
-
- /**
- * This method initializes jTextField2
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvParaName() {
- if (jTextFieldFvParaName == null) {
- jTextFieldFvParaName = new JTextField();
- jTextFieldFvParaName.setPreferredSize(new java.awt.Dimension(140,20));
- }
- return jTextFieldFvParaName;
- }
-
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvNameAdd() {
- if (jButtonFvNameAdd == null) {
- jButtonFvNameAdd = new JButton();
- jButtonFvNameAdd.setPreferredSize(new Dimension(80, 20));
- jButtonFvNameAdd.setEnabled(true);
- jButtonFvNameAdd.setText("Add");
- jButtonFvNameAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTextFieldFvParaName.getText().length() > 0){
- String[] row = {jTextFieldFvParaName.getText()};
- int selectedRow = jTableFvInfo.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- String fvNameList = jTableFvInfo.getValueAt(selectedRow, 0)+"";
- String type = jTableFvInfo.getValueAt(selectedRow, 1)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, type);
-
- if (fvImagePos < 0) {
- // new FvImage.
- ffc.genFvImagesFvImage(row, jComboBoxFvParaType.getSelectedItem()+"", null);
- }
- else {
- //append Fv name.
- ffc.addFvImageNamesInFvImage(fvImagePos, row);
- }
- docConsole.setSaved(false);
- fvImageNameTableModel.addRow(row);
- fvNameList += " ";
- fvNameList += row[0];
- jTableFvInfo.setValueAt(fvNameList.trim(), selectedRow, 0);
- jTableFvImageNames.changeSelection(jTableFvImageNames.getRowCount() - 1, 0, false, false);
- }
- }
- });
- }
- return jButtonFvNameAdd;
- }
-
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvImageNames() {
- if (jScrollPaneFvImageNames == null) {
- jScrollPaneFvImageNames = new JScrollPane();
- jScrollPaneFvImageNames.setPreferredSize(new java.awt.Dimension(350,80));
- jScrollPaneFvImageNames.setViewportView(getJTableFvImageNames());
- }
- return jScrollPaneFvImageNames;
- }
-
-
- /**
- * This method initializes jTable1
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvImageNames() {
- if (jTableFvImageNames == null) {
- fvImageNameTableModel = new IDefaultTableModel();
- jTableFvImageNames = new JTable(fvImageNameTableModel);
- jTableFvImageNames.setRowHeight(20);
- fvImageNameTableModel.addColumn("FV Image Name");
-
- }
- return jTableFvImageNames;
- }
-
-
- /**
- * This method initializes jButton3
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvNameDel() {
- if (jButtonFvNameDel == null) {
- jButtonFvNameDel = new JButton();
- jButtonFvNameDel.setPreferredSize(new Dimension(80, 20));
- jButtonFvNameDel.setEnabled(true);
- jButtonFvNameDel.setText("Delete");
- jButtonFvNameDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFvImageNames.getSelectedRow() >= 0){
- int selectedRow = jTableFvInfo.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- String selectedFvName = jTableFvImageNames.getValueAt(jTableFvImageNames.getSelectedRow(), 0)+"";
- String fvNameList = jTableFvInfo.getValueAt(selectedRow, 0)+"";
- String type = jTableFvInfo.getValueAt(selectedRow, 1)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, type);
-
- if (fvImagePos < 0) {
- return;
- }
- else {
- //delete Fv name.
- ffc.updateFvImageNamesInFvImage(fvImagePos, selectedFvName, null);
- }
- docConsole.setSaved(false);
- String newList = removeFvNameFromList(fvNameList, selectedFvName);
- jTableFvInfo.setValueAt(newList, selectedRow, 0);
- fvImageNameTableModel.removeRow(jTableFvImageNames.getSelectedRow());
- }
- }
- });
- }
- return jButtonFvNameDel;
- }
-
- private String removeFvNameFromList (String list, String name) {
- String[] nameArray = list.split(" ");
- int occursAt = -1;
- for (int i = 0; i < nameArray.length; ++i) {
- if (nameArray[i].equals(name)) {
- occursAt = i;
- break;
- }
- }
-
- if (occursAt == -1) {
- return list;
- }
-
- String newList = " ";
- for (int j = 0; j < nameArray.length; ++j) {
- if (j != occursAt) {
- newList += nameArray[j];
- newList += " ";
- }
- }
-
- return newList.trim();
- }
-
-
- private JPanel getJPanelFvImageOpts() {
-
-
- if (jPanelFvImageOpts == null) {
- //ToDo add ButtonGroup for RadioButtons
- jLabelOptions = new JLabel();
- jLabelOptions.setText("Attribute");
- jLabelFvImageOptValue = new JLabel();
- jLabelFvImageOptValue.setEnabled(true);
- jLabelFvImageOptValue.setText("Value");
- jLabelFvImageOptValue.setPreferredSize(new Dimension(38, 20));
- jLabelFvImageOptName = new JLabel();
- jLabelFvImageOptName.setEnabled(true);
- jLabelFvImageOptName.setText("Name");
- jLabelFvImageOptName.setPreferredSize(new Dimension(38, 20));
- jPanelFvImageOpts = new JPanel();
- jPanelFvImageOpts.setLayout(new BorderLayout());
- jPanelFvImageOpts.setPreferredSize(new java.awt.Dimension(450,130));
-
-
- jPanelFvImageOpts.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.LOWERED));
-
- jPanelFvImageOpts.add(getJPanelFvImageOptsN(), java.awt.BorderLayout.NORTH);
- jPanelFvImageOpts.add(getJPanelFvImageOptsS(), java.awt.BorderLayout.SOUTH);
- jPanelFvImageOpts.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
-
- jPanelFvImageOpts.add(getJPanelFvImageOptsE(), java.awt.BorderLayout.EAST);
- }
- return jPanelFvImageOpts;
- }
-
-
- /**
- * This method initializes jButton4
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAddFvImage() {
- if (jButtonAddFvImage == null) {
- jButtonAddFvImage = new JButton();
- jButtonAddFvImage.setPreferredSize(new java.awt.Dimension(150,20));
- jButtonAddFvImage.setText("New FV Attributes");
- jButtonAddFvImage.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(java.awt.event.ActionEvent e) {
-
-// String imageName = " ";
-// for (int i = 0; i < jTableFvImageNames.getRowCount(); ++i){
-// imageName += (String)jTableFvImageNames.getValueAt(i, 0);
-// imageName += " ";
-// }
-// imageName = imageName.trim();
-
-// LinkedHashMap<String, String> m = null;
-// m = new LinkedHashMap<String, String>();
-// getOptionNameValue(m);
-// ffc.genFvImagesFvImage(imageName.split(" "), jComboBoxFvParaType.getSelectedItem()+"", m);
-// docConsole.setSaved(false);
- fvImageNameTableModel.setRowCount(0);
- fvOptionTableModel.setRowCount(0);
- Object[] row = {"", jComboBoxFvParaType.getSelectedItem()};
- fvImageParaTableModel.addRow(row);
- jTableFvInfo.changeSelection(jTableFvInfo.getRowCount() - 1, 0, false, false);
- }
- });
- }
- return jButtonAddFvImage;
- }
-
-
- /**
- * This method initializes jScrollPane3
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvInfo() {
- if (jScrollPaneFvInfo == null) {
- jScrollPaneFvInfo = new JScrollPane();
- jScrollPaneFvInfo.setPreferredSize(new java.awt.Dimension(480,150));
- jScrollPaneFvInfo.setViewportView(getJTableFvInfo());
- }
- return jScrollPaneFvInfo;
- }
-
-
- /**
- * This method initializes jTable2
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvInfo() {
- if (jTableFvInfo == null) {
- fvImageParaTableModel = new ImageParaTableModel();
- jTableFvInfo = new JTable(fvImageParaTableModel);
- fvImageParaTableModel.addColumn("FvImageNames");
- fvImageParaTableModel.addColumn("Type");
-
- jTableFvInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFvInfo.setRowHeight(20);
- jTableFvInfo.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- int selectedRow = lsm.getMinSelectionIndex();
- String fvNameList = fvImageParaTableModel.getValueAt(selectedRow, 0)+"";
- String type = fvImageParaTableModel.getValueAt(selectedRow, 1)+"";
- jComboBoxFvParaType.setSelectedItem(type);
- String[] fvNames = fvNameList.split(" ");
- fvImageNameTableModel.setRowCount(0);
- fvOptionTableModel.setRowCount(0);
- for (int i = 0; i < fvNames.length; ++i) {
- String[] row = { fvNames[i] };
- if (row[0].length() > 0) {
- fvImageNameTableModel.addRow(row);
- }
- }
-
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, type);
- if (fvImagePos < 0) {
- return;
- }
- LinkedHashMap<String, String> optionMap = new LinkedHashMap<String, String>();
- ffc.getFvImagesFvImageOptions(fvImagePos, optionMap);
- if (optionMap.size() > 0){
- Set<String> key = optionMap.keySet();
- Iterator<String> i = key.iterator();
- while (i.hasNext()) {
- String k = (String)i.next();
- String[] row = {k, optionMap.get(k)};
- fvOptionTableModel.addRow(row);
- }
- }
- }
- }
- });
-
-
- }
- return jTableFvInfo;
- }
-
-
- /**
- * This method initializes jButton6
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDelFvImage() {
- if (jButtonDelFvImage == null) {
- jButtonDelFvImage = new JButton();
- jButtonDelFvImage.setPreferredSize(new java.awt.Dimension(150,20));
- jButtonDelFvImage.setText("Delete FV Attributes");
- jButtonDelFvImage.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (jTableFvInfo.getSelectedRow() >= 0 ) {
- String fvNameList = fvImageParaTableModel.getValueAt(jTableFvInfo.getSelectedRow(), 0)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, jComboBoxFvParaType.getSelectedItem()+"");
-
- ffc.removeFvImagesFvImage(fvImagePos);
- fvImageParaTableModel.removeRow(jTableFvInfo.getSelectedRow());
- docConsole.setSaved(false);
-
- fvImageNameTableModel.setRowCount(0);
- fvOptionTableModel.setRowCount(0);
- }
- }
-
- });
- }
- return jButtonDelFvImage;
- }
-
-
- /**
- * This method initializes jPanel6
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImagePara() {
- if (jPanelFvImagePara == null) {
- StarLabel starLabel = new StarLabel();
- starLabel.setVisible(false);
- jPanelFvImagePara = new JPanel();
- jPanelFvImagePara.setLayout(new BorderLayout());
- jPanelFvImagePara.setPreferredSize(new java.awt.Dimension(450,140));
- jPanelFvImagePara.setBorder(javax.swing.BorderFactory.createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
-
- jPanelFvImagePara.add(getJPanelFvImageParaN(), java.awt.BorderLayout.NORTH);
- jPanelFvImagePara.add(getJPanelFvImageParaS(), java.awt.BorderLayout.SOUTH);
- jPanelFvImagePara.add(getJScrollPaneFvImageNames(), java.awt.BorderLayout.CENTER);
-
- jPanelFvImagePara.add(getJPanelFvImageParaE(), java.awt.BorderLayout.EAST);
-//
-//
-//
- }
- return jPanelFvImagePara;
- }
-
- /**
- * This method initializes jPanel7
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdf() {
- if (jPanelFdf == null) {
- jPanelFdf = new JPanel();
- jPanelFdf.setLayout(new BorderLayout());
-
- jPanelFdf.add(getJPanelFdfN(), java.awt.BorderLayout.NORTH);
- jPanelFdf.add(getJPanelFdfS(), java.awt.BorderLayout.SOUTH);
- jPanelFdf.add(getJSplitPaneFdfC(), java.awt.BorderLayout.CENTER);
- jPanelFdf.addComponentListener(new ComponentAdapter(){
- public void componentShown(ComponentEvent e) {
-// if (ffc.getFlashDefinitionFile() != null) {
-// jTextFieldFdf.setText(ffc.getFlashDefinitionFile());
-// initFvInFdfTable(Workspace.getCurrenetWorkspace() + File.separator + jTextFieldFdf.getText());
-//
-// }
- }
- public void componentHidden(ComponentEvent e) {
- if (jCheckBoxFdf.isSelected()) {
- ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
- }
- }
- });
- }
- return jPanelFdf;
- }
-
- /**
- * This method initializes jCheckBox
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxFdf() {
- if (jCheckBoxFdf == null) {
- jCheckBoxFdf = new JCheckBox();
- jCheckBoxFdf.setText("Flash Definition File");
- jCheckBoxFdf.addItemListener(new ItemListener() {
-
- public void itemStateChanged(ItemEvent arg0) {
- // TODO Auto-generated method stub
- if (jCheckBoxFdf.isSelected()){
- jTextFieldFdf.setEnabled(true);
- jButtonFdfBrowse.setEnabled(true);
- }
- else {
- getFvInFdfTableModel().setRowCount(0);
- jTextFieldFdf.setEnabled(false);
- jTextFieldFdf.setText("");
- jButtonFdfBrowse.setEnabled(false);
- ffc.genFlashDefinitionFile("");
- docConsole.setSaved(false);
- int selectedBackup = selectedRowInFvAdditionalTable;
- selectedRowInFvAdditionalTable = -1;
- initFvAdditionalTable();
- selectedRowInFvAdditionalTable = selectedBackup;
- }
- }
- });
- }
- return jCheckBoxFdf;
- }
-
- /**
- * This method initializes jTextField3
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFdf() {
- if (jTextFieldFdf == null) {
- jTextFieldFdf = new JTextField();
- jTextFieldFdf.setEnabled(false);
- jTextFieldFdf.setEditable(false);
- jTextFieldFdf.setPreferredSize(new Dimension(300, 20));
- jTextFieldFdf.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
- }
- });
- }
- return jTextFieldFdf;
- }
-
- /**
- * This method initializes jButton5
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFdfBrowse() {
- if (jButtonFdfBrowse == null) {
- jButtonFdfBrowse = new JButton();
- jButtonFdfBrowse.setEnabled(false);
- jButtonFdfBrowse.setText("Browse");
- jButtonFdfBrowse.setPreferredSize(new Dimension(78, 20));
- jButtonFdfBrowse.addActionListener(new AbstractAction(){
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- // TODO Auto-generated method stub
- String wsDir = Workspace.getCurrentWorkspace();
- JFileChooser chooser = new JFileChooser(wsDir);
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
- int retval = chooser.showOpenDialog(FpdFlash.this);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- File theFile = chooser.getSelectedFile();
- String filePath = theFile.getPath();
- if (!filePath.startsWith(wsDir)) {
- JOptionPane.showMessageDialog(FpdFlash.this, "You can only select files in current WORKSPACE.");
- return;
- }
- jTextFieldFdf.setText(filePath.substring(wsDir.length() + 1).replace('\\', '/'));
- ffc.genFlashDefinitionFile(jTextFieldFdf.getText());
- docConsole.setSaved(false);
- initFvInFdfTable(filePath);
- }
- }
-
- });
- }
- return jButtonFdfBrowse;
- }
-
- private void initFvAttributes () {
- if (ffc.getFvImagesFvImageCount("Attributes") == 0 && ffc.getFvImagesFvImageCount("Components") == 0) {
- return;
- }
- String[][] saa = new String[ffc.getFvImagesFvImageCount("Attributes")][2];
- ffc.getFvImagesFvImages(saa, "Attributes");
-
- int i = 0;
- while (i < saa.length) {
- fvImageParaTableModel.addRow(saa[i]);
- ++i;
- }
-
- saa = new String[ffc.getFvImagesFvImageCount("Components")][2];
- ffc.getFvImagesFvImages(saa, "Components");
- i = 0;
- while (i < saa.length) {
- fvImageParaTableModel.addRow(saa[i]);
- ++i;
- }
-
- saa = new String[ffc.getFvImagesNameValueCount()][2];
- ffc.getFvImagesNameValues(saa);
- for (int m = 0; m < saa.length; ++m) {
- fvPropertyTableModel.addRow(saa[m]);
- }
- }
-
- private void initFvAdditionalTable() {
- Vector<String> vFvNames = new Vector<String>();
- ffc.getFvImagesFvImageFvImageNames(vFvNames);
- for (int i = 0; i < vFvNames.size(); ++i) {
- String fvName = vFvNames.get(i);
- if (fvNameExists(fvName)) {
- continue;
- }
- fvAdditionalTableModel.addRow(getBasicFvInfo(fvName));
- addTabForFv(new FvInfoFromFdf(fvName, "", ""));
- }
- }
-
- private void initFvInFdfTable(String fdfPath){
- Vector<FvInfoFromFdf> vFvInfo = new Vector<FvInfoFromFdf>();
- getFvInfoFromFdf(fdfPath, vFvInfo);
- getFlashInfoFromFdf (fdfPath);
- if (!erasePolarity.equals("1") && !erasePolarity.equals("0")) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "FDF file does NOT contain valid Erase Polarity.");
- }
- else {
- ffc.setTypedFvImageNameValue("Attributes", "EFI_ERASE_POLARITY", erasePolarity);
- }
-
- // BugBug: assume all blocks have same size;
-
- String blkSize = defaultBlkSize;
- if (vBlockSize.size() > 0) {
- blkSize = vBlockSize.get(0);
- if (!DataValidation.isInt(blkSize) && !DataValidation.isHexDoubleWordDataType(blkSize)) {
- JOptionPane.showMessageDialog(FpdFlash.this, "FDF file does NOT contain valid FV block size. Default size 0x10000 will be used.");
- blkSize = defaultBlkSize;
- }
- }
- determinedFvBlockSize = blkSize;
-
- getFvInFdfTableModel().setRowCount(0);
- Vector<String> vExistingFvNameInFpd = new Vector<String>();
- ffc.getFvImagesFvImageFvImageNames(vExistingFvNameInFpd);
- for (int j = 0; j < vFvInfo.size(); ++j) {
- FvInfoFromFdf fvInfo = vFvInfo.get(j);
- String[] row = {fvInfo.getFvName(), fvInfo.getSize(), fvInfo.getEfiFileName()};
-
- if (row[0].length() > 0 && !vExistingFvNameInFpd.contains(row[0])) {
- ffc.addFvImageFvImageNames(new String[]{row[0]});
- }
-
- // if FV addtional table contains the same FV from fdf file, remove that row.
- for (int k = 0; k < jTableFvAdditional.getRowCount(); ++k) {
- if (fvAdditionalTableModel.getValueAt(k, 0).equals(row[0])) {
- fvAdditionalTableModel.removeRow(k);
- }
- }
- getFvInFdfTableModel().addRow(row);
- try {
- int blockSize = Integer.decode(blkSize);
- int fvSize = Integer.decode(row[1]);
- int numBlocks = fvSize/blockSize;
- HashMap<String, String> mOptions = new HashMap<String, String>();
- // if no options for this FV before, generate a new options entry for this FV.
- if (ffc.getFvImagesFvImageWithName(row[0], "Options") == null) {
-
- mOptions.put("EFI_BLOCK_SIZE", blkSize);
- mOptions.put("EFI_NUM_BLOCKS", numBlocks+"");
- mOptions.put("EFI_FILE_NAME", row[2]);
- ffc.genFvImagesFvImage(new String[]{row[0]}, "Options", mOptions);
- memModified = true;
- }
- else {
- ffc.getFvImagesFvImageOptions(row[0], mOptions);
- if (mOptions.get("EFI_BLOCK_SIZE") == null || !mOptions.get("EFI_BLOCK_SIZE").equalsIgnoreCase(blkSize)) {
- ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_BLOCK_SIZE", blkSize, null);
- memModified = true;
- }
- if (mOptions.get("EFI_NUM_BLOCKS") == null || Integer.decode(mOptions.get("EFI_NUM_BLOCKS")) != numBlocks) {
- ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_NUM_BLOCKS", numBlocks + "", null);
- memModified = true;
- }
- if (mOptions.get("EFI_FILE_NAME") == null || !mOptions.get("EFI_FILE_NAME").equals(row[2])) {
- ffc.setTypedNamedFvImageNameValue(row[0], "Options", "EFI_FILE_NAME", row[2], null);
- memModified = true;
- }
-
- }
- }
- catch (NumberFormatException e){
- JOptionPane.showMessageDialog(FpdFlash.this, e.getMessage());
- }
- }
-
- for (int k = 0; k < vFvInfo.size(); ++k) {
- FvInfoFromFdf fvInfo = vFvInfo.get(k);
- addTabForFv(fvInfo);
- }
-
- }
-
- private void addTabForFv (FvInfoFromFdf fvInfo) {
- String fvName = fvInfo.getFvName();
- String outputFile = fvInfo.getEfiFileName();
- int index = jTabbedPane.indexOfTab(fvName);
- if (index >= startIndexOfDynamicTab) {
- return;
- }
- ModuleOrderPane pane = new ModuleOrderPane(fvName, outputFile, ffc, this);
- pane.showModulesInFv(fvName);
- pane.showAllModulesInPlatform();
- jTabbedPane.addTab(fvName, null, pane, null);
- }
- /**
- * This method initializes jTextField4
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvImageOptName() {
- if (jTextFieldFvImageOptName == null) {
- jTextFieldFvImageOptName = new JTextField();
- jTextFieldFvImageOptName.setEnabled(true);
- jTextFieldFvImageOptName.setPreferredSize(new Dimension(100, 20));
- }
- return jTextFieldFvImageOptName;
- }
-
- /**
- * This method initializes jTextField5
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvImageOptValue() {
- if (jTextFieldFvImageOptValue == null) {
- jTextFieldFvImageOptValue = new JTextField();
- jTextFieldFvImageOptValue.setEnabled(true);
- jTextFieldFvImageOptValue.setPreferredSize(new Dimension(100, 20));
- }
- return jTextFieldFvImageOptValue;
- }
-
- /**
- * This method initializes jPanel8
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageOptsButtonGroup() {
- if (jPanelFvImageOptsButtonGroup == null) {
- jPanelFvImageOptsButtonGroup = new JPanel();
- jPanelFvImageOptsButtonGroup.setPreferredSize(new Dimension(80, 55));
- jPanelFvImageOptsButtonGroup.add(getJButtonFvImageOptAdd(), null);
- jPanelFvImageOptsButtonGroup.add(getJButtonFvImageOptDel(), null);
- }
- return jPanelFvImageOptsButtonGroup;
- }
-
- /**
- * This method initializes jButton7
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvImageOptAdd() {
- if (jButtonFvImageOptAdd == null) {
- jButtonFvImageOptAdd = new JButton();
- jButtonFvImageOptAdd.setEnabled(true);
- jButtonFvImageOptAdd.setText("Add");
- jButtonFvImageOptAdd.setPreferredSize(new Dimension(80, 20));
- jButtonFvImageOptAdd.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- if (jTextFieldFvImageOptName.getText().length() > 0 && jTextFieldFvImageOptValue.getText().length() > 0){
- int selectedRow = jTableFvInfo.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- String fvNameList = jTableFvInfo.getValueAt(selectedRow, 0)+"";
- String type = jTableFvInfo.getValueAt(selectedRow, 1)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, type);
- String[] row = {jTextFieldFvImageOptName.getText(), jTextFieldFvImageOptValue.getText()};
-
- if (fvImagePos < 0) {
- return;
- }
- else {
- //append options to FvImage.
- ffc.setFvImagesFvImageNameValue(fvImagePos, row[0], row[1]);
- }
- docConsole.setSaved(false);
- fvOptionTableModel.addRow(row);
- jTableFvImageOpts.changeSelection(jTableFvImageOpts.getRowCount() - 1, 0, false, false);
- }
- }
- });
- }
- return jButtonFvImageOptAdd;
- }
-
- /**
- * This method initializes jButton8
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvImageOptDel() {
- if (jButtonFvImageOptDel == null) {
- jButtonFvImageOptDel = new JButton();
- jButtonFvImageOptDel.setEnabled(true);
- jButtonFvImageOptDel.setText("Delete");
- jButtonFvImageOptDel.setPreferredSize(new Dimension(80, 20));
- jButtonFvImageOptDel.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- if (jTableFvImageOpts.getSelectedRow() >= 0){
- int selectedRow = jTableFvInfo.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- String fvNameList = jTableFvInfo.getValueAt(selectedRow, 0)+"";
- String type = jTableFvInfo.getValueAt(selectedRow, 1)+"";
- int fvImagePos = ffc.getFvImagePosInFvImages(fvNameList, type);
- if (fvImagePos < 0) {
- return;
- }
-
- String optName = fvOptionTableModel.getValueAt(jTableFvImageOpts.getSelectedRow(), 0)+"";
- ffc.removeFvImageNameValue(fvImagePos, optName);
- docConsole.setSaved(false);
- fvOptionTableModel.removeRow(jTableFvImageOpts.getSelectedRow());
- }
- }
- });
- }
- return jButtonFvImageOptDel;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setPreferredSize(new java.awt.Dimension(350,100));
- jScrollPane.setViewportView(getJTableFvImageOpts());
- }
- return jScrollPane;
- }
-
- /**
- * This method initializes jTable3
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvImageOpts() {
- if (jTableFvImageOpts == null) {
- fvOptionTableModel = new IDefaultTableModel();
- fvOptionTableModel.addColumn("Name");
- fvOptionTableModel.addColumn("Value");
- jTableFvImageOpts = new JTable(fvOptionTableModel);
-
- jTableFvImageOpts.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFvImageOpts.setRowHeight(20);
-
- }
- return jTableFvImageOpts;
- }
-
- /**
- * This method initializes jButton9
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonUpdateFvImage() {
- if (jButtonUpdateFvImage == null) {
- jButtonUpdateFvImage = new JButton();
- jButtonUpdateFvImage.setPreferredSize(new java.awt.Dimension(150,20));
- jButtonUpdateFvImage.setActionCommand("Update");
- jButtonUpdateFvImage.setText("Update FV Attributes");
- jButtonUpdateFvImage.setVisible(false);
- jButtonUpdateFvImage.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int row = jTableFvInfo.getSelectedRow();
- if (jTableFvInfo.isEditing()) {
- jTableFvInfo.getCellEditor().stopCellEditing();
- }
- if (jTableFvImageOpts.isEditing()) {
- jTableFvImageOpts.getCellEditor().stopCellEditing();
- }
-
- //ToDo Check data validity before update
- String name = fvImageParaTableModel.getValueAt(row, 0) + "";
- String type = fvImageParaTableModel.getValueAt(row, 1) + "";
-
- LinkedHashMap<String, String> lhm = new LinkedHashMap<String, String>();
- getOptionNameValue(lhm);
-
- docConsole.setSaved(false);
- ffc.updateFvImagesFvImage(row, name.split(" "), type, lhm);
-
- }
- });
- }
- return jButtonUpdateFvImage;
- }
-
- /**
- * This method initializes jPanelFdfN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfN() {
- if (jPanelFdfN == null) {
- jPanelFdfN = new JPanel();
- jPanelFdfN.add(getJCheckBoxFdf(), null);
- jPanelFdfN.add(getJTextFieldFdf(), null);
- jPanelFdfN.add(getJButtonFdfBrowse(), null);
- }
- return jPanelFdfN;
- }
-
- /**
- * This method initializes jPanelFdfS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfS() {
- if (jPanelFdfS == null) {
- FlowLayout flowLayout4 = new FlowLayout();
- flowLayout4.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelFdfS = new JPanel();
- jPanelFdfS.setLayout(flowLayout4);
- jPanelFdfS.add(getJButtonAddFv(), null);
- jPanelFdfS.add(getJButtonDelFv(), null);
- jPanelFdfS.add(getJButtonAddFvOptions(), null);
- }
- return jPanelFdfS;
- }
-
- /**
- * This method initializes jSplitPaneFdfC
- *
- * @return javax.swing.JSplitPane
- */
- private JSplitPane getJSplitPaneFdfC() {
- if (jSplitPaneFdfC == null) {
- jSplitPaneFdfC = new JSplitPane();
- jSplitPaneFdfC.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
- jSplitPaneFdfC.setDividerSize(5);
- jSplitPaneFdfC.setTopComponent(getJPanelFdfCTop());
- jSplitPaneFdfC.setBottomComponent(getJPanelFdfCBottom());
- jSplitPaneFdfC.setDividerLocation(280);
- }
- return jSplitPaneFdfC;
- }
-
- /**
- * This method initializes jPanelFdfCTop
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfCTop() {
- if (jPanelFdfCTop == null) {
- jPanelFdfCTop = new JPanel();
- jPanelFdfCTop.setLayout(new BorderLayout());
- jPanelFdfCTop.add(getJPanelFdfCTopN(), java.awt.BorderLayout.NORTH);
- jPanelFdfCTop.add(getJPanelFdfCTopS(), java.awt.BorderLayout.SOUTH);
- jPanelFdfCTop.add(getJScrollPaneFvInFdf(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFdfCTop;
- }
-
- /**
- * This method initializes jPanelFdfCBottom
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfCBottom() {
- if (jPanelFdfCBottom == null) {
- jPanelFdfCBottom = new JPanel();
- jPanelFdfCBottom.setLayout(new BorderLayout());
- jPanelFdfCBottom.add(getJPanelFdfCBottomN(), java.awt.BorderLayout.NORTH);
- jPanelFdfCBottom.add(getJScrollPaneFvAdditional(), java.awt.BorderLayout.CENTER);
- }
- return jPanelFdfCBottom;
- }
-
- /**
- * This method initializes jPanelFdfCTopN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfCTopN() {
- if (jPanelFdfCTopN == null) {
- jLabelFvInFdf = new JLabel();
- jLabelFvInFdf.setText("FVs in Flash Definition File");
- jPanelFdfCTopN = new JPanel();
- jPanelFdfCTopN.add(jLabelFvInFdf, null);
- }
- return jPanelFdfCTopN;
- }
-
- /**
- * This method initializes jPanelFdfCTopS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfCTopS() {
- if (jPanelFdfCTopS == null) {
- FlowLayout flowLayout1 = new FlowLayout();
- flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelFdfCTopS = new JPanel();
- jPanelFdfCTopS.setLayout(flowLayout1);
- jPanelFdfCTopS.add(getJButtonFvInFdfOptions(), null);
- }
- return jPanelFdfCTopS;
- }
-
- /**
- * This method initializes jPanelFdfCTopC
- *
- * @return javax.swing.JPanel
- */
-// private JPanel getJPanelFdfCTopC() {
-// if (jPanelFdfCTopC == null) {
-// jPanelFdfCTopC = new JPanel();
-// jPanelFdfCTopC.add(getJScrollPaneFvInFdf(), null);
-// }
-// return jPanelFdfCTopC;
-// }
-
- /**
- * This method initializes jPanelFdfCBottomN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFdfCBottomN() {
- if (jPanelFdfCBottomN == null) {
- jLabelFvAdditional = new JLabel();
- jLabelFvAdditional.setText("Additional FVs");
- jPanelFdfCBottomN = new JPanel();
- jPanelFdfCBottomN.add(jLabelFvAdditional, null);
- }
- return jPanelFdfCBottomN;
- }
-
- /**
- * This method initializes jPanelFdfCBottomC
- *
- * @return javax.swing.JPanel
- */
-// private JPanel getJPanelFdfCBottomC() {
-// if (jPanelFdfCBottomC == null) {
-// jPanelFdfCBottomC = new JPanel();
-// jPanelFdfCBottomC.add(getJScrollPaneFvAdditional(), null);
-// }
-// return jPanelFdfCBottomC;
-// }
-
- /**
- * This method initializes jScrollPaneFvInFdf
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvInFdf() {
- if (jScrollPaneFvInFdf == null) {
- jScrollPaneFvInFdf = new JScrollPane();
- jScrollPaneFvInFdf.setPreferredSize(new java.awt.Dimension(653,200));
- jScrollPaneFvInFdf.setViewportView(getJTableFvInFdf());
- }
- return jScrollPaneFvInFdf;
- }
-
- /**
- * This method initializes jTableFvInFdf
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvInFdf() {
- if (jTableFvInFdf == null) {
- jTableFvInFdf = new JTable();
- jTableFvInFdf.setRowHeight(20);
- jTableFvInFdf.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
- jTableFvInFdf.setModel(getFvInFdfTableModel());
- }
- return jTableFvInFdf;
- }
-
- /**
- * This method initializes fvInFdfTableModel
- *
- * @return org.tianocore.frameworkwizard.platform.ui.NonEditableTableModel
- */
- private IDefaultTableModel getFvInFdfTableModel() {
- if (fvInFdfTableModel == null) {
- fvInFdfTableModel = new IDefaultTableModel();
- fvInFdfTableModel.addColumn("FV Name");
- fvInFdfTableModel.addColumn("Size");
- fvInFdfTableModel.addColumn("Corresponding File Name");
- }
- return fvInFdfTableModel;
- }
-
- /**
- * This method initializes jButtonFvInFdfOptions
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonFvInFdfOptions() {
- if (jButtonFvInFdfOptions == null) {
- jButtonFvInFdfOptions = new JButton();
- jButtonFvInFdfOptions.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonFvInFdfOptions.setEnabled(true);
- jButtonFvInFdfOptions.setText("Options");
- jButtonFvInFdfOptions.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableFvInFdf.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- String fvName = jTableFvInFdf.getValueAt(selectedRow, 0)+"";
- if (fvName.length() == 0) {
- return;
- }
- DefaultTableModel dtm = getFvInFdfOptTableModel();
- new FpdFvOptions(fvName, dtm, ffc, docConsole);
- }
- });
- }
- return jButtonFvInFdfOptions;
- }
-
- private DefaultTableModel getFvInFdfOptTableModel() {
- if (fvInFdfOptTableModel == null) {
- fvInFdfOptTableModel = new FvOptsTableModel();
- fvInFdfOptTableModel.addColumn("Name");
- fvInFdfOptTableModel.addColumn("Value");
- Vector<Object> v = new Vector<Object>();
- v.add("EFI_BLOCK_SIZE");
- v.add("EFI_NUM_BLOCKS");
- v.add("EFI_FILE_NAME");
- fvInFdfOptTableModel.setVKeyWords(v);
- fvInFdfOptTableModel.setVNonEditableName(v);
- }
- return fvInFdfOptTableModel;
- }
-
- private DefaultTableModel getFvAdditionalOptTableModel() {
- if (fvAdditionalOptTableModel == null) {
- fvAdditionalOptTableModel = new FvOptsTableModel();
- fvAdditionalOptTableModel.addColumn("Name");
- fvAdditionalOptTableModel.addColumn("Value");
- Vector<Object> v = new Vector<Object>();
- v.add("EFI_BLOCK_SIZE");
- v.add("EFI_NUM_BLOCKS");
- v.add("EFI_FILE_NAME");
- fvAdditionalOptTableModel.setVNonEditableName(v);
- }
- return fvAdditionalOptTableModel;
- }
-
- /**
- * This method initializes jScrollPaneFvAdditional
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvAdditional() {
- if (jScrollPaneFvAdditional == null) {
- jScrollPaneFvAdditional = new JScrollPane();
- jScrollPaneFvAdditional.setPreferredSize(new java.awt.Dimension(653,200));
- jScrollPaneFvAdditional.setViewportView(getJTableFvAdditional());
- }
- return jScrollPaneFvAdditional;
- }
-
- /**
- * This method initializes jTableFvAdditional
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvAdditional() {
- if (jTableFvAdditional == null) {
- jTableFvAdditional = new JTable();
- jTableFvAdditional.setRowHeight(20);
- jTableFvAdditional.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
- jTableFvAdditional.setModel(getFvAdditionalTableModel());
-
- jTableFvAdditional.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRowInFvAdditionalTable = lsm.getMinSelectionIndex();
- oldFvName = jTableFvAdditional.getValueAt(selectedRowInFvAdditionalTable, 0)+"";
- }
- }
- });
-
- jTableFvAdditional.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int col = arg0.getColumn();
- TableModel m = (TableModel) arg0.getSource();
-
- if (arg0.getType() == TableModelEvent.UPDATE) {
- if (col == 0) {
- String newFvName = m.getValueAt(row, 0) + "";
- if (newFvName.equals(oldFvName)) {
- return;
- }
- if (fvNameExists(newFvName)) {
- JOptionPane.showMessageDialog(FpdFlash.this, "This FV already exists. Please choose another FV name.");
- m.setValueAt(oldFvName, row, 0);
- return;
- }
-
- tabIndexForFv = jTabbedPane.indexOfTab(oldFvName);
- if (tabIndexForFv >= startIndexOfDynamicTab) {
- jTabbedPane.setTitleAt(tabIndexForFv, newFvName);
- // change FvName in UserExtensions
- ffc.updateBuildOptionsUserExtensions(oldFvName, newFvName);
- // change FvBinding in ModuleSA
- ffc.appendFvBindingFor(oldFvName, newFvName);
- ffc.removeFvBindingAll(oldFvName);
- // change FvImageNames in Flash
- ffc.updateFvImageNameAll(oldFvName, newFvName);
-
- } else {
- ModuleOrderPane pane = new ModuleOrderPane(newFvName, "", ffc, FpdFlash.this);
- pane.showModulesInFv(newFvName);
- pane.showAllModulesInPlatform();
- jTabbedPane.addTab(newFvName, pane);
- // Add FvImageNames in Flash
- String[] fvNames = {newFvName};
- ffc.addFvImageFvImageNames(fvNames);
- }
- docConsole.setSaved(false);
- oldFvName = newFvName;
- }
-
- if (col == 1 && !sizeFromOptionDlg) {
- String fvSize = m.getValueAt(row, col) + "";
- if (!DataValidation.isInt(fvSize) && !DataValidation.isHexDoubleWordDataType(fvSize)) {
- JOptionPane.showMessageDialog(FpdFlash.this, "FV size should be Integer or Hex format.");
- return;
- }
- HashMap<String, String> mFvOpts = new HashMap<String, String>();
- ffc.getFvImagesFvImageOptions(oldFvName, mFvOpts);
- String blkSize = mFvOpts.get("EFI_BLOCK_SIZE");
- if (blkSize == null) {
- if (determinedFvBlockSize != null) {
- blkSize = determinedFvBlockSize;
- }
- else {
- blkSize = defaultBlkSize;
- }
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_BLOCK_SIZE", blkSize, null);
- int fs = Integer.decode(fvSize);
- int bs = Integer.decode(blkSize);
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_NUM_BLOCKS", (fs/bs)+"", null);
- docConsole.setSaved(false);
- }
- else {
- if (!DataValidation.isInt(blkSize) && !DataValidation.isHexDoubleWordDataType(blkSize)) {
- int retVal = JOptionPane.showConfirmDialog(FpdFlash.this, "Confirm", "FPD file contains error block size format. Would you like to replace it with a default value?", JOptionPane.YES_NO_OPTION);
- if (retVal == JOptionPane.YES_OPTION) {
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_BLOCK_SIZE", defaultBlkSize, null);
- int fs = Integer.decode(fvSize);
- int bs = Integer.decode(defaultBlkSize);
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_NUM_BLOCKS", (fs/bs)+"", null);
- docConsole.setSaved(false);
- return;
- }
- else {
- return;
- }
-
- }
- int fs = Integer.decode(fvSize);
- int bs = Integer.decode(blkSize);
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_NUM_BLOCKS", (fs/bs)+"", null);
- docConsole.setSaved(false);
- }
- }
-
- if (col == 2 && !fileFromOptionDlg) {
- ffc.setTypedNamedFvImageNameValue(oldFvName, "Options", "EFI_FILE_NAME", m.getValueAt(row, col)+"", null);
- docConsole.setSaved(false);
- }
-
- }
- }
- });
- }
- return jTableFvAdditional;
- }
-
- private boolean fvNameExistsInFvInFdfTable (String fvName) {
- for (int i = 0; i < jTableFvInFdf.getRowCount(); ++i) {
- if (fvInFdfTableModel.getValueAt(i, 0).equals(fvName)) {
- return true;
- }
- }
- return false;
- }
-
- private boolean fvNameExists (String fvName) {
- if (fvNameExistsInFvInFdfTable(fvName)) {
- return true;
- }
-
- for (int j = 0; j < jTableFvAdditional.getRowCount(); ++j) {
- if (fvAdditionalTableModel.getValueAt(j, 0).equals(fvName) && j != selectedRowInFvAdditionalTable) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * This method initializes fvAdditionalTableModel
- *
- * @return javax.swing.table.DefaultTableModel
- */
- private DefaultTableModel getFvAdditionalTableModel() {
- if (fvAdditionalTableModel == null) {
- fvAdditionalTableModel = new DefaultTableModel();
- fvAdditionalTableModel.addColumn("FV Name");
- fvAdditionalTableModel.addColumn("Size");
- fvAdditionalTableModel.addColumn("Corresponding File Name");
- }
- return fvAdditionalTableModel;
- }
-
- /**
- * This method initializes jButtonAddFv
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAddFv() {
- if (jButtonAddFv == null) {
- jButtonAddFv = new JButton();
- jButtonAddFv.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonAddFv.setEnabled(true);
- jButtonAddFv.setText("New");
- jButtonAddFv.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableFvAdditional.isEditing()) {
- jTableFvAdditional.getCellEditor().stopCellEditing();
- }
- String[] row = {"", "", ""};
- fvAdditionalTableModel.addRow(row);
- }
- });
- }
- return jButtonAddFv;
- }
-
- /**
- * This method initializes jButtonDelFv
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDelFv() {
- if (jButtonDelFv == null) {
- jButtonDelFv = new JButton();
- jButtonDelFv.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonDelFv.setEnabled(true);
- jButtonDelFv.setText("Delete");
- jButtonDelFv.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- //delete row in FvAdditional table.
- int selectedRow = jTableFvAdditional.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- String fvName = fvAdditionalTableModel.getValueAt(selectedRow, 0) + "";
- fvAdditionalTableModel.removeRow(selectedRow);
- //
- //delete tab with selected FV name.
- //
- jTabbedPane.removeTabAt(jTabbedPane.indexOfTab(fvName));
- //delete FV Name from FvImages element.
- ffc.updateFvImageNameAll(fvName, null);
- //delete FvBinding from ModuleSA.
- ffc.removeFvBindingAll(fvName);
- docConsole.setSaved(false);
- }
- });
- }
- return jButtonDelFv;
- }
-
- /**
- * This method initializes jButtonAddFvOptions
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAddFvOptions() {
- if (jButtonAddFvOptions == null) {
- jButtonAddFvOptions = new JButton();
- jButtonAddFvOptions.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonAddFvOptions.setEnabled(true);
- jButtonAddFvOptions.setText("Options");
- jButtonAddFvOptions.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableFvAdditional.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- String fvName = jTableFvAdditional.getValueAt(selectedRow, 0)+"";
- String oldFvSize = jTableFvAdditional.getValueAt(selectedRow, 1)+"";
- String oldFileName = jTableFvAdditional.getValueAt(selectedRow, 2)+"";
- if (fvName.length() == 0) {
- return;
- }
- DefaultTableModel dtm = getFvAdditionalOptTableModel();
- new FpdFvOptions(fvName, dtm, ffc, docConsole);
-
- String[] updatedFvInfo = getBasicFvInfo (fvName);
- if (!oldFvSize.equalsIgnoreCase(updatedFvInfo[1])) {
- sizeFromOptionDlg = true;
- jTableFvAdditional.setValueAt(updatedFvInfo[1], selectedRow, 1);
- sizeFromOptionDlg = false;
- }
- if (!oldFileName.equals(updatedFvInfo[2])) {
- fileFromOptionDlg = true;
- jTableFvAdditional.setValueAt(updatedFvInfo[2], selectedRow, 2);
- fileFromOptionDlg = false;
- }
- }
- });
- }
- return jButtonAddFvOptions;
- }
-
- private String[] getBasicFvInfo (String fvName) {
- HashMap<String, String> mFvOpts = new HashMap<String, String>();
- ffc.getFvImagesFvImageOptions(fvName, mFvOpts);
- String bSize = "";
- String numBlks = "";
- String fvSize = "";
- String fvFile = "";
- if (mFvOpts.get("EFI_FILE_NAME") != null) {
- fvFile = mFvOpts.get("EFI_FILE_NAME");
- }
- if (mFvOpts.get("EFI_BLOCK_SIZE") != null && mFvOpts.get("EFI_NUM_BLOCKS") != null) {
- bSize = mFvOpts.get("EFI_BLOCK_SIZE");
- numBlks = mFvOpts.get("EFI_NUM_BLOCKS");
- boolean blockSizeWellFormat = true;
- boolean numOfBlockWellFormat = true;
- if (!DataValidation.isHexDoubleWordDataType(bSize) && !DataValidation.isInt(bSize)) {
- blockSizeWellFormat = false;
- JOptionPane.showMessageDialog(FpdFlash.this, fvName + " block size bad format.");
- }
- if (!DataValidation.isHexDoubleWordDataType(numBlks) && !DataValidation.isInt(numBlks)) {
- numOfBlockWellFormat = false;
- JOptionPane.showMessageDialog(FpdFlash.this, fvName + " number of blocks bad format.");
- }
- if (blockSizeWellFormat && numOfBlockWellFormat) {
- int size = Integer.decode(bSize);
- int num = Integer.decode(numBlks);
- fvSize = "0x" + Integer.toHexString(size*num);
- }
- }
-
- return new String[]{fvName, fvSize, fvFile};
-
- }
-
- /**
- * This method initializes jPanelBgFvName
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelBgFvName() {
- if (jPanelBgFvName == null) {
- jPanelBgFvName = new JPanel();
- jPanelBgFvName.setPreferredSize(new java.awt.Dimension(80,55));
- jPanelBgFvName.add(getJButtonFvNameAdd(), null);
- jPanelBgFvName.add(getJButtonFvNameDel(), null);
- }
- return jPanelBgFvName;
- }
-
- /**
- * This method initializes jPanelBgFvImage
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelBgFvImage() {
- if (jPanelBgFvImage == null) {
- jPanelBgFvImage = new JPanel();
- jPanelBgFvImage.setPreferredSize(new java.awt.Dimension(150,100));
- jPanelBgFvImage.add(getJButtonAddFvImage(), null);
- jPanelBgFvImage.add(getJButtonDelFvImage(), null);
- jPanelBgFvImage.add(getJButtonUpdateFvImage(), null);
- }
- return jPanelBgFvImage;
- }
-
- /**
- * This method initializes jPanelW
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelW() {
- if (jPanelW == null) {
- jPanelW = new JPanel();
- jPanelW.add(getJPanelBgFvImage(), null);
- }
- return jPanelW;
- }
-
- /**
- * This method initializes jPanelFvImageParaN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageParaN() {
- if (jPanelFvImageParaN == null) {
- FlowLayout flowLayout3 = new FlowLayout();
- flowLayout3.setAlignment(java.awt.FlowLayout.CENTER);
- jPanelFvImageParaN = new JPanel();
- jPanelFvImageParaN.setLayout(flowLayout3);
- jPanelFvImageParaN.add(new StarLabel(), null);
- jPanelFvImageParaN.add(jLabelFvImageNames, null);
- jPanelFvImageParaN.add(jLabelFvParaName, null);
- jPanelFvImageParaN.add(getJTextFieldFvParaName(), null);
- }
- return jPanelFvImageParaN;
- }
-
- /**
- * This method initializes jPanelFvImageParaS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageParaS() {
- if (jPanelFvImageParaS == null) {
- FlowLayout flowLayout6 = new FlowLayout();
- flowLayout6.setAlignment(java.awt.FlowLayout.CENTER);
- jPanelFvImageParaS = new JPanel();
- jPanelFvImageParaS.setLayout(flowLayout6);
- jPanelFvImageParaS.add(jLabelFvParaType, null);
- jPanelFvImageParaS.add(getJComboBoxFvParaType(), null);
- }
- return jPanelFvImageParaS;
- }
-
- /**
- * This method initializes jPanelFvImageParaC
- *
- * @return javax.swing.JPanel
- */
-// private JPanel getJPanelFvImageParaC() {
-// if (jPanelFvImageParaC == null) {
-// jPanelFvImageParaC = new JPanel();
-// jPanelFvImageParaC.add(getJScrollPaneFvImageNames(), null);
-// }
-// return jPanelFvImageParaC;
-// }
-
- /**
- * This method initializes jPanelFvImageOptsN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageOptsN() {
- if (jPanelFvImageOptsN == null) {
- jPanelFvImageOptsN = new JPanel();
- jPanelFvImageOptsN.add(jLabelOptions, null);
- jPanelFvImageOptsN.add(jLabelFvImageOptName, null);
- jPanelFvImageOptsN.add(getJTextFieldFvImageOptName(), null);
- jPanelFvImageOptsN.add(jLabelFvImageOptValue, null);
- jPanelFvImageOptsN.add(getJTextFieldFvImageOptValue(), null);
- }
- return jPanelFvImageOptsN;
- }
-
- /**
- * This method initializes jPanelFvImageOptsS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageOptsS() {
- if (jPanelFvImageOptsS == null) {
- jPanelFvImageOptsS = new JPanel();
- }
- return jPanelFvImageOptsS;
- }
-
- /**
- * This method initializes jPanelFvImageOptsC
- *
- * @return javax.swing.JPanel
- */
-// private JPanel getJPanelFvImageOptsC() {
-// if (jPanelFvImageOptsC == null) {
-// jPanelFvImageOptsC = new JPanel();
-// jPanelFvImageOptsC.add(getJScrollPane(), null);
-// }
-// return jPanelFvImageOptsC;
-// }
-
- /**
- * This method initializes jPanelFvImageParaE
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageParaE() {
- if (jPanelFvImageParaE == null) {
- jPanelFvImageParaE = new JPanel();
- jPanelFvImageParaE.add(getJPanelBgFvName(), null);
- }
- return jPanelFvImageParaE;
- }
-
- /**
- * This method initializes jPanelFvImageOptsE
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageOptsE() {
- if (jPanelFvImageOptsE == null) {
- jPanelFvImageOptsE = new JPanel();
- jPanelFvImageOptsE.add(getJPanelFvImageOptsButtonGroup(), null);
- }
- return jPanelFvImageOptsE;
- }
-
- /**
- * This method initializes jPanelFvImageSN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageSN() {
- if (jPanelFvImageSN == null) {
- jPanelFvImageSN = new JPanel();
- jPanelFvImageSN.add(getJCheckBoxFvProperty(), null);
- jPanelFvImageSN.add(jLabelFvPropName, null);
- jPanelFvImageSN.add(getJTextFieldFvPropName(), null);
- jPanelFvImageSN.add(jLabelFvPropValue, null);
- jPanelFvImageSN.add(getJTextFieldFvPropValue(), null);
- }
- return jPanelFvImageSN;
- }
-
- /**
- * This method initializes jPanelFvImageSE
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageSE() {
- if (jPanelFvImageSE == null) {
- jPanelFvImageSE = new JPanel();
- jPanelFvImageSE.add(getJPanelFvPropButtonGroup(), null);
- }
- return jPanelFvImageSE;
- }
-
- /**
- * This method initializes jPanelFvImageSS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelFvImageSS() {
- if (jPanelFvImageSS == null) {
- jPanelFvImageSS = new JPanel();
- }
- return jPanelFvImageSS;
- }
-
- /**
- * @param args
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
- new FpdFlash().setVisible(true);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(660, 650);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setContentPane(getJContentPane());
- this.setTitle("FPD Flash Definitions");
- this.addInternalFrameListener(new InternalFrameAdapter(){
- public void internalFrameDeactivated(InternalFrameEvent e){
- if (jTableFvProp.isEditing()) {
- jTableFvProp.getCellEditor().stopCellEditing();
- }
- if (jTableFvImageNames.isEditing()) {
- jTableFvImageNames.getCellEditor().stopCellEditing();
- }
- if (jTableFvInfo.isEditing()) {
- jTableFvInfo.getCellEditor().stopCellEditing();
- }
- if (jTableFvAdditional.isEditing()) {
- jTableFvAdditional.getCellEditor().stopCellEditing();
- }
- }
- });
- }
-
- private void init(FpdFileContents ffc) {
- initFvAttributes();
-
- jTextFieldFdf.setText("");
- String fdfFile = ffc.getFlashDefinitionFile();
- if (fdfFile != null && fdfFile.length() > 0) {
- jCheckBoxFdf.setSelected(true);
- jTextFieldFdf.setText(fdfFile);
- String fdfPath = Workspace.getCurrentWorkspace() + File.separator + fdfFile;
- initFvInFdfTable(fdfPath);
- }
-
- initFvAdditionalTable();
- }
-
- private void getOptionNameValue(Map<String, String> m){
- for (int i = 0; i < jTableFvImageOpts.getRowCount(); ++i) {
- m.put(fvOptionTableModel.getValueAt(i, 0)+"", fvOptionTableModel.getValueAt(i, 1)+"");
- }
- }
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
- jContentPane.add(getJPanelContentSouth(), java.awt.BorderLayout.SOUTH);
- jContentPane.add(getJPanelContentWest(), java.awt.BorderLayout.WEST);
- jContentPane.add(getJPanelContentNorth(), java.awt.BorderLayout.NORTH);
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- private void getFlashInfoFromFdf (String fdfPath) {
- File fdf = new File(fdfPath);
- if (!fdf.exists()) {
- return;
- }
- int lines = 0;
-
- try {
- FileReader reader = new FileReader(fdf);
- BufferedReader in = new BufferedReader(reader);
- String str;
-
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with //)
- //
- if (str.length() == 0 || str.startsWith("//")) {
- continue;
- }
- //
- // ErasePolarity
- //
- if (str.startsWith("ErasePolarity")) {
- erasePolarity = str.substring(str.indexOf("=") + 1, str.lastIndexOf(",")).trim();
- }
- //
- // dig into Block section.
- //
- if (str.startsWith("Block") && str.endsWith("}")) {
- String[] blockSec = str.split(",");
- String nv = blockSec[1].trim();
- String[] sizeSec = nv.split("=");
- vBlockSize.add(sizeSec[1].trim());
- }
-
- }
-
- reader.close();
- in.close();
- }
- catch (Exception e) {
-
- }
- }
-
- private void getFvInfoFromFdf(String fdfPath, Vector<FvInfoFromFdf> vFvInfo) {
- File fdf = new File(fdfPath);
- if (!fdf.exists()) {
- return;
- }
- int lines = 0;
-
- try {
- FileReader reader = new FileReader(fdf);
- BufferedReader in = new BufferedReader(reader);
- String str;
-
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with //)
- //
- if (str.length() == 0 || str.startsWith("//")) {
- continue;
- }
- //
- // dig into Region {} section, create FvInfoFromFdf object for it.
- //
- if (str.startsWith("Region") && str.endsWith("{")) {
- FvInfoFromFdf fvInfo = new FvInfoFromFdf();
- boolean nameFound = false;
- boolean sizeFound = false;
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with //)
- //
- if (str.length() == 0 || str.startsWith("//")) {
- continue;
- }
-
- if (str.startsWith("Name")) {
- int firstQuote = str.indexOf("\"");
- int lastQuote = str.lastIndexOf("\"");
- fvInfo.setFvName(str.substring(firstQuote + 1, lastQuote));
- nameFound = true;
- }
-
- if (str.startsWith("Size")) {
- int equalIndex = str.indexOf("=");
- int commaIndex = str.indexOf(",");
- fvInfo.setSize(str.substring(equalIndex + 1, commaIndex).trim());
- sizeFound = true;
- }
-
- if (nameFound && sizeFound) {
- break;
- }
- }
-
- vFvInfo.add(fvInfo);
- }
- //
- // dig into File {} section, supply file name information to existing FvInfoFromFdf object.
- //
- if (str.startsWith("File")) {
- boolean fileNameFound = false;
- boolean fvFound = false;
- String fileName = "";
- String fvName = "";
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with //)
- //
- if (str.length() == 0 || str.startsWith("//")) {
- continue;
- }
-
- if (str.startsWith("Name")) {
- int firstQuote = str.indexOf("\"");
- int lastQuote = str.lastIndexOf("\"");
- fileName = str.substring(firstQuote + 1, lastQuote);
- fileNameFound = true;
- }
-
- if (str.startsWith("Region")) {
- int firstQuote = str.indexOf("\"");
- int lastQuote = str.lastIndexOf("\"");
- fvName = str.substring(firstQuote + 1, lastQuote);
- fvFound = true;
- }
-
- if (fileNameFound && fvFound) {
- break;
- }
- }
-
- for (int i = 0; i <vFvInfo.size(); ++i) {
- if (vFvInfo.get(i).getFvName().equals(fvName)) {
- vFvInfo.get(i).setEfiFileName(fileName);
- }
- }
- }
-
- }
-
- reader.close();
- in.close();
- }
- catch (Exception e) {
-
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.tianocore.frameworkwizard.common.ui.IInternalFrame#actionPerformed(java.awt.event.ActionEvent)
- */
- @Override
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {
- docConsole.setSaved(false);
- jTabbedPane.setSelectedIndex(0);
- }
- else if (arg0.getActionCommand().equals("ModuleOrderPaneCancel")) {
- jTabbedPane.setSelectedIndex(0);
- }
- else {
- return;
- }
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
-
-class ModuleOrderPane extends JPanel implements ActionListener{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private JPanel jPanelModOrderN = null;
- private JPanel jPanelModOrderS = null;
- private JPanel jPanelModOrderC = null;
- private JScrollPane jScrollPaneModInFv = null;
- private JTable jTableModInFv = null;
- private JPanel jPanelController = null;
- private JScrollPane jScrollPaneFpdModules = null;
- private JTable jTableFpdModules = null;
- private JButton jButtonUp = null;
- private JButton jButtonInsert = null;
- private JButton jButtonRemove = null;
- private JButton jButtonDown = null;
- private JButton jButtonOk = null;
- private JButton jButtonCancel = null;
- private IDefaultTableModel modInFvTableModel = null;
- private IDefaultTableModel fpdModTableModel = null;
- private FpdFileContents ffc = null;
- private String title = null;
- private String outputFileName = null;
-
- public ModuleOrderPane(String tabTitle, String file, FpdFileContents inputFfc, ActionListener action) {
- super(new BorderLayout());
- title = tabTitle;
- outputFileName = file;
- ffc = inputFfc;
- add(getJPanelModOrderN(), java.awt.BorderLayout.NORTH);
- add(getJPanelModOrderS(), java.awt.BorderLayout.SOUTH);
- add(getJPanelModOrderC(), java.awt.BorderLayout.CENTER);
- jButtonOk.addActionListener(action);
- jButtonCancel.addActionListener(action);
-
- }
-
- public void showModulesInFv(String fvName) {
-
- if (modInFvTableModel == null) {
- return;
- }
- int size = ffc.getUserExtsIncModCount(fvName, "IMAGES", "1");
-
- if (size != -1) {
- String[][] saa = new String[size][5];
- ffc.getUserExtsIncMods(fvName, "IMAGES", "1", saa);
-
- for (int i = 0; i < size; ++i) {
- String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- String name = "N/A";
- if (mi != null) {
- name = mi.getName();
- }
-
- String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };
- modInFvTableModel.addRow(row);
- }
- }
- //
- // From ModuleSAs, get module guids with FvBinding = fvName.
- //
- Vector<String[]> vModuleSA = new Vector<String[]>();
- ffc.getFrameworkModuleSAByFvBinding(fvName, vModuleSA);
- //
- // If BuildOptions->UserExtensions already contain these module info,
- // no need to add them into table again.
- //
- Iterator<String[]> iter = vModuleSA.iterator();
- while (iter.hasNext()){
- String[] sa = iter.next();
- if (!moduleInfoInTable (sa, modInFvTableModel)) {
- String moduleKey = sa[0] + " " + sa[1] + " " + sa[2] + " " + sa[3];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- String name = "N/A";
- if (mi != null) {
- name = mi.getName();
- }
- String[] row = { name, sa[0] , sa[1], sa[2] , sa[3], sa[4] };
- modInFvTableModel.addRow(row);
- }
- }
-
- }
-
- public void showAllModulesInPlatform() {
-
- if (modInFvTableModel == null || fpdModTableModel == null) {
- return;
- }
- int size = ffc.getFrameworkModulesCount();
- String[][] saa = new String[size][5];
- ffc.getFrameworkModulesInfo(saa);
-
- for (int i = 0; i < size; ++i) {
- if (moduleInfoInTable(saa[i], modInFvTableModel) || moduleInfoInTable(saa[i], fpdModTableModel)) {
- continue;
- }
- String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- String name = "N/A";
- if (mi != null) {
- name = mi.getName();
- }
- String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };
- fpdModTableModel.addRow(row);
- }
-
- TableSorter sorter = (TableSorter)jTableFpdModules.getModel();
- sorter.setSortState(0, TableSorter.ASCENDING);
- }
-
-
- protected boolean moduleInfoInTable (String[] moduleInfo, DefaultTableModel model) {
- boolean matched = false;
- int size = model.getDataVector().size();
- for (int i = 0; i < size; ++i) {
- Vector rowData = (Vector)model.getDataVector().elementAt(i);
- for (int j = 1; j < rowData.size(); ++j) {
- if (rowData.elementAt(j) == null && moduleInfo[j-1] == null) {
- matched = true;
- }
- else if (rowData.elementAt(j).equals("null") && moduleInfo[j-1] == null) {
- matched = true;
- }
- else if (rowData.elementAt(j) == null && moduleInfo[j-1].equals("null")) {
- matched = true;
- }
- else if (rowData.elementAt(j) != null && rowData.elementAt(j).toString().equalsIgnoreCase(moduleInfo[j-1])) {
- matched = true;
- }
- else {
- matched = false;
- break;
- }
- }
-
- if (matched) {
- return true;
- }
-
- }
- return false;
- }
-
-
-
- /**
- * This method initializes jPanelModOrderN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelModOrderN() {
- if (jPanelModOrderN == null) {
- jPanelModOrderN = new JPanel();
- }
- return jPanelModOrderN;
- }
-
- /**
- * This method initializes jPanelModOrderS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelModOrderS() {
- if (jPanelModOrderS == null) {
- FlowLayout flowLayout6 = new FlowLayout();
- flowLayout6.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelModOrderS = new JPanel();
- jPanelModOrderS.setLayout(flowLayout6);
- jPanelModOrderS.add(getJButtonOk(), null);
- jPanelModOrderS.add(getJButtonCancel(), null);
- }
- return jPanelModOrderS;
- }
-
- /**
- * This method initializes jPanelModOrderC
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelModOrderC() {
- if (jPanelModOrderC == null) {
- jPanelModOrderC = new JPanel();
- jPanelModOrderC.add(getJScrollPaneModInFv(), null);
- jPanelModOrderC.add(getJPanelController(), null);
- jPanelModOrderC.add(getJScrollPaneFpdModules(), null);
- }
- return jPanelModOrderC;
- }
-
- /**
- * This method initializes jScrollPaneModInFv
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneModInFv() {
- if (jScrollPaneModInFv == null) {
- jScrollPaneModInFv = new JScrollPane();
- jScrollPaneModInFv.setPreferredSize(new java.awt.Dimension(200,500));
- jScrollPaneModInFv.setViewportView(getJTableModInFv());
- }
- return jScrollPaneModInFv;
- }
-
- /**
- * This method initializes jTableModInFv
- *
- * @return javax.swing.JTable
- */
- protected JTable getJTableModInFv() {
- if (jTableModInFv == null) {
- modInFvTableModel = new IDefaultTableModel();
-
- jTableModInFv = new JTable(modInFvTableModel){
- /**
- *
- */
- private static final long serialVersionUID = 4903583933542581721L;
-
- public String getToolTipText(MouseEvent e) {
- String tip = null;
- java.awt.Point p = e.getPoint();
- int rowIndex = rowAtPoint(p);
-// int colIndex = columnAtPoint(p);
-// int realColumnIndex = convertColumnIndexToModel(colIndex);
-
- TableModel model = getModel();
- String mg = (String) model.getValueAt(rowIndex, 1);
- String mv = (String) model.getValueAt(rowIndex, 2);
- String pg = (String) model.getValueAt(rowIndex, 3);
- String pv = (String) model.getValueAt(rowIndex, 4);
- String arch = (String) model.getValueAt(rowIndex, 5);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);
- if (mi != null) {
- tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";
- }
- else {
- tip = "No Module Path Information.";
- }
-
- return tip;
- }
-
- };
- modInFvTableModel.addColumn("Module Orders in FV");
- modInFvTableModel.addColumn("mg");
- modInFvTableModel.addColumn("mv");
- modInFvTableModel.addColumn("pg");
- modInFvTableModel.addColumn("pv");
- modInFvTableModel.addColumn("arch");
-
- for (int i = 1; i < 6; ++i) {
- jTableModInFv.removeColumn(jTableModInFv.getColumnModel().getColumn(jTableModInFv.getColumnCount()-1));
- }
-
- jTableModInFv.setRowHeight(20);
- jTableModInFv.setShowGrid(false);
- jTableModInFv.setAutoCreateColumnsFromModel(false);
- jTableModInFv.addMouseListener(new MouseAdapter() {
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
- */
- @Override
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getButton() == MouseEvent.BUTTON3) {
- java.awt.Point p = arg0.getPoint();
- int rowIndex = jTableModInFv.rowAtPoint(p);
- TableModel model = jTableModInFv.getModel();
- String mg = (String) model.getValueAt(rowIndex, 1);
- String mv = (String) model.getValueAt(rowIndex, 2);
- String pg = (String) model.getValueAt(rowIndex, 3);
- String pv = (String) model.getValueAt(rowIndex, 4);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);
- String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;
- if (mi != null) {
- details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;
- }
- JOptionPane.showMessageDialog(ModuleOrderPane.this, details);
- }
- }
-
- });
- }
- return jTableModInFv;
- }
-
- /**
- * This method initializes jPanelController
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelController() {
- if (jPanelController == null) {
- FlowLayout flowLayout5 = new FlowLayout();
- flowLayout5.setVgap(50);
- flowLayout5.setHgap(50);
- jPanelController = new JPanel();
- jPanelController.setLayout(flowLayout5);
- jPanelController.setPreferredSize(new java.awt.Dimension(150,500));
- jPanelController.add(getJButtonUp(), null);
- jPanelController.add(getJButtonInsert(), null);
- jPanelController.add(getJButtonRemove(), null);
- jPanelController.add(getJButtonDown(), null);
- }
- return jPanelController;
- }
-
- /**
- * This method initializes jScrollPaneFpdModules
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFpdModules() {
- if (jScrollPaneFpdModules == null) {
- jScrollPaneFpdModules = new JScrollPane();
- jScrollPaneFpdModules.setPreferredSize(new java.awt.Dimension(200,500));
- jScrollPaneFpdModules.setViewportView(getJTableFpdModules());
- }
- return jScrollPaneFpdModules;
- }
-
- /**
- * This method initializes jTableFpdModules
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFpdModules() {
- if (jTableFpdModules == null) {
- fpdModTableModel = new IDefaultTableModel();
- TableSorter sorter = new TableSorter(fpdModTableModel);
- jTableFpdModules = new JTable(sorter){
- /**
- *
- */
- private static final long serialVersionUID = -4666296888377637808L;
-
- public String getToolTipText(MouseEvent e) {
- String tip = null;
- java.awt.Point p = e.getPoint();
- int rowIndex = rowAtPoint(p);
-// int colIndex = columnAtPoint(p);
-// int realColumnIndex = convertColumnIndexToModel(colIndex);
-
- TableModel model = getModel();
- String mg = (String) model.getValueAt(rowIndex, 1);
- String mv = (String) model.getValueAt(rowIndex, 2);
- String pg = (String) model.getValueAt(rowIndex, 3);
- String pv = (String) model.getValueAt(rowIndex, 4);
- String arch = (String) model.getValueAt(rowIndex, 5);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);
- if (mi != null) {
- tip = "Path: " + mi.getPath() + "; Arch: " + arch + ";";
- }
- else {
- tip = "No Module Path Information.";
- }
-
- return tip;
- }
-
- };
-
- fpdModTableModel.addColumn("Modules in Platform");
- fpdModTableModel.addColumn("mg");
- fpdModTableModel.addColumn("mv");
- fpdModTableModel.addColumn("pg");
- fpdModTableModel.addColumn("pv");
- fpdModTableModel.addColumn("arch");
-
- for (int i = 1; i < 6; ++i) {
- jTableFpdModules.removeColumn(jTableFpdModules.getColumnModel().getColumn(jTableFpdModules.getColumnCount()-1));
- }
- jTableFpdModules.setRowHeight(20);
- jTableFpdModules.setShowGrid(false);
- jTableFpdModules.setAutoCreateColumnsFromModel(false);
- jTableFpdModules.addMouseListener(new MouseAdapter() {
-
- /* (non-Javadoc)
- * @see java.awt.event.MouseAdapter#mouseClicked(java.awt.event.MouseEvent)
- */
- @Override
- public void mouseClicked(MouseEvent arg0) {
- if (arg0.getButton() == MouseEvent.BUTTON3) {
- java.awt.Point p = arg0.getPoint();
- int rowIndex = jTableFpdModules.rowAtPoint(p);
- TableModel model = jTableFpdModules.getModel();
- String mg = (String) model.getValueAt(rowIndex, 1);
- String mv = (String) model.getValueAt(rowIndex, 2);
- String pg = (String) model.getValueAt(rowIndex, 3);
- String pv = (String) model.getValueAt(rowIndex, 4);
- ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv);
- String details = "PackageGuid: " + pg + "; ModuleVer:" + mv + "; PkgVer:" + pv;
- if (mi != null) {
- details = "In Package " + mi.getPackageId().getName() + "; ModuleVer:" + mv + "; PkgVer:" + pv;
- }
- JOptionPane.showMessageDialog(ModuleOrderPane.this, details);
- }
- }
-
- });
-
- }
- return jTableFpdModules;
- }
-
- /**
- * This method initializes jButtonUp
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonUp() {
- if (jButtonUp == null) {
- jButtonUp = new JButton();
- jButtonUp.setPreferredSize(new java.awt.Dimension(60,20));
- jButtonUp.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 14));
- jButtonUp.setText("^");
- jButtonUp.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableModInFv.getSelectedRow();
- if (selectedRow <= 0) {
- return;
- }
- modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow - 1);
- jTableModInFv.changeSelection(selectedRow - 1, 0, false, false);
- }
- });
- }
- return jButtonUp;
- }
-
- /**
- * This method initializes jButtonInsert
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonInsert() {
- if (jButtonInsert == null) {
- jButtonInsert = new JButton();
- jButtonInsert.setText("<");
- jButtonInsert.setPreferredSize(new java.awt.Dimension(60,20));
- jButtonInsert.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRowRight = jTableFpdModules.getSelectedRow();
- if (selectedRowRight < 0) {
- return;
- }
-
- int rowInModel = ((TableSorter)jTableFpdModules.getModel()).getModelRowIndex(selectedRowRight);
- String name = fpdModTableModel.getValueAt(rowInModel, 0)+"";
- String mg = fpdModTableModel.getValueAt(rowInModel, 1)+"";
- String mv = fpdModTableModel.getValueAt(rowInModel, 2)+"";
- String pg = fpdModTableModel.getValueAt(rowInModel, 3)+"";
- String pv = fpdModTableModel.getValueAt(rowInModel, 4)+"";
- String arch = fpdModTableModel.getValueAt(rowInModel, 5)+"";
- String[] row = {name, mg, mv, pg, pv, arch};
- if (name.length() == 0 || name.equals("N/A")) {
- return;
- }
-
- int selectedRowLeft = jTableModInFv.getSelectedRow();
- if (selectedRowLeft < 0) {
- modInFvTableModel.addRow(row);
- jTableModInFv.changeSelection(jTableModInFv.getRowCount() - 1, 0, false, false);
- }
- else {
- modInFvTableModel.insertRow(selectedRowLeft, row);
- jTableModInFv.changeSelection(selectedRowLeft, 0, false, false);
- }
- fpdModTableModel.removeRow(rowInModel);
- }
- });
- }
- return jButtonInsert;
- }
-
- /**
- * This method initializes jButtonRemove
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonRemove() {
- if (jButtonRemove == null) {
- jButtonRemove = new JButton();
- jButtonRemove.setPreferredSize(new java.awt.Dimension(60,20));
- jButtonRemove.setText(">");
- jButtonRemove.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRowLeft = jTableModInFv.getSelectedRow();
- if (selectedRowLeft < 0) {
- return;
- }
-
- String name = modInFvTableModel.getValueAt(selectedRowLeft, 0)+"";
- String mg = modInFvTableModel.getValueAt(selectedRowLeft, 1)+"";
- String mv = modInFvTableModel.getValueAt(selectedRowLeft, 2)+"";
- String pg = modInFvTableModel.getValueAt(selectedRowLeft, 3)+"";
- String pv = modInFvTableModel.getValueAt(selectedRowLeft, 4)+"";
- String arch = modInFvTableModel.getValueAt(selectedRowLeft, 5)+"";
- String[] row = {name, mg, mv, pg, pv, arch};
- String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch;
- if (name.length() == 0 || name.equals("N/A") || ffc.getModuleSA(moduleKey) == null) {
- JOptionPane.showMessageDialog(ModuleOrderPane.this, "Module " + name + " not exists in platform. If you want to add back this module, please first add it into current platform. " + moduleKey );
- modInFvTableModel.removeRow(selectedRowLeft);
- return;
- }
-
- fpdModTableModel.addRow(row);
- int viewIndex = ((TableSorter) jTableFpdModules.getModel()).getViewIndexArray()[jTableFpdModules
- .getRowCount() - 1];
- jTableFpdModules.changeSelection(viewIndex, 0, false, false);
- modInFvTableModel.removeRow(selectedRowLeft);
- }
- });
- }
- return jButtonRemove;
- }
-
- /**
- * This method initializes jButtonDown
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDown() {
- if (jButtonDown == null) {
- jButtonDown = new JButton();
- jButtonDown.setPreferredSize(new java.awt.Dimension(60,20));
- jButtonDown.setFont(new java.awt.Font("Dialog", java.awt.Font.BOLD, 10));
- jButtonDown.setText("v");
- jButtonDown.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableModInFv.getSelectedRow();
- if (selectedRow >= jTableModInFv.getRowCount() - 1) {
- return;
- }
- modInFvTableModel.moveRow(selectedRow, selectedRow, selectedRow + 1);
- jTableModInFv.changeSelection(selectedRow + 1, 0, false, false);
- }
- });
- }
- return jButtonDown;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- */
- protected JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonOk.setText("Ok");
- jButtonOk.setActionCommand("ModuleOrderPaneOk");
- jButtonOk.addActionListener(this);
-
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- protected JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.setActionCommand("ModuleOrderPaneCancel");
-
- }
- return jButtonCancel;
- }
-
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonOk) {
- // need reset FvBindings in ModuleSA.
- ffc.removeFvBindingAll(title);
- //
- // collect module order information to store them into <BuildOptions> -> <UserExtensions>.
- // also update the FvBinding info in <ModuleSA>.
- //
- Vector<String[]> vModInFv = new Vector<String[]>();
- for (int i = 0; i < jTableModInFv.getRowCount(); ++i) {
- String moduleName = modInFvTableModel.getValueAt(i, 0)+"";
- if (moduleName.length() == 0 || moduleName.equals("N/A")) {
- continue;
- }
-
- String mg = modInFvTableModel.getValueAt(i, 1)+"";
- String mv = modInFvTableModel.getValueAt(i, 2)+"";
- String pg = modInFvTableModel.getValueAt(i, 3)+"";
- String pv = modInFvTableModel.getValueAt(i, 4)+"";
- String arch = modInFvTableModel.getValueAt(i, 5)+"";
-
- String moduleInfo = mg + " " + mv + " " + pg + " " + pv + " " + arch;
-
- String[] sa = { mg, mv, pg, pv, arch};
- vModInFv.add(sa);
- ffc.updateFvBindingInModuleSA(moduleInfo, title);
-
- }
- ffc.removeBuildOptionsUserExtensions(title, "IMAGES", "1");
- ffc.genBuildOptionsUserExtensions(title, "IMAGES", "1", outputFileName, vModInFv);
-
- }
- }
-
- /**
- * @return Returns the fpdModTableModel.
- */
- protected IDefaultTableModel getFpdModTableModel() {
- return fpdModTableModel;
- }
-
- /**
- * @return Returns the modInFvTableModel.
- */
- protected IDefaultTableModel getModInFvTableModel() {
- return modInFvTableModel;
- }
-}
-
-
-class FvOptsTableModel extends DefaultTableModel {
-
- private static final long serialVersionUID = 1L;
-
- private Vector<Object> vNonEditableName = new Vector<Object>();
- private Vector<Object> vKeyWords = new Vector<Object>();
-
- public boolean isCellEditable(int row, int col) {
-
- if (vNonEditableName.size() > 0 || vKeyWords.size() > 0) {
- if (vKeyWords.contains(getValueAt(row, 0))) {
- return false;
- }
- if (vNonEditableName.contains(getValueAt(row, 0)) && col == 0) {
- return false;
- }
- }
-
- if (col == 0 && getValueAt(row, 0) != null && getValueAt(row, 0).toString().length() > 0) {
- return false;
- }
-
- return true;
- }
-
- /**
- * @return Returns the vKeyWords.
- */
- protected Vector<Object> getVKeyWords() {
- return vKeyWords;
- }
-
- /**
- * @param keyWords The vKeyWords to set.
- */
- protected void setVKeyWords(Vector<Object> keyWords) {
- vKeyWords.removeAllElements();
- vKeyWords.addAll(keyWords);
- }
-
- /**
- * @return Returns the vNonEditableName.
- */
- protected Vector<Object> getVNonEditableName() {
- return vNonEditableName;
- }
-
- /**
- * @param nonEditableName The vNonEditableName to set.
- */
- protected void setVNonEditableName(Vector<Object> nonEditableName) {
- vNonEditableName.removeAllElements();
- vNonEditableName.addAll(nonEditableName);
- }
-
-}
-class ImageParaTableModel extends DefaultTableModel {
-
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
-// if (getValueAt(row, 1).equals("ImageName") && col >=1) {
-// return false;
-// }
-// return true;
- return false;
- }
-}
-
-class FvInfoFromFdf {
- private String fvName;
- private String size;
- private String efiFileName;
-
- public FvInfoFromFdf () {
- fvName = "";
- size = "";
- efiFileName = "";
- }
- public FvInfoFromFdf (String f, String s, String e) {
- this();
- fvName = f;
- size = s;
- efiFileName = e;
- }
- public String getEfiFileName() {
- return efiFileName;
- }
- public void setEfiFileName(String efiFileName) {
- this.efiFileName = efiFileName;
- }
- public String getFvName() {
- return fvName;
- }
- public void setFvName(String fvName) {
- this.fvName = fvName;
- }
- public String getSize() {
- return size;
- }
- public void setSize(String size) {
- this.size = size;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
deleted file mode 100644
index ae5fce8340..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFrameworkModules.java
+++ /dev/null
@@ -1,1084 +0,0 @@
-/** @file
-
- The file is used to create, update FrameworkModules of Fpd file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.FontMetrics;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JSplitPane;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.TableModelEvent;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
-import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.KeyEvent;
-import java.awt.event.MouseEvent;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Vector;
-
-public class FpdFrameworkModules extends IInternalFrame {
-
- /**
- * Initialize Globals
- */
- private static final long serialVersionUID = 1L;
-
- private static final int timeToWait = 2000;
-
- private static final int pcdSyncThreadNumber = 10;
-
- private long savedMs = 0;
-
- String searchField = "";
-
- public static final int forceDbgColForFpdModTable = 7;
-
- private JSplitPane jSplitPane = null;
-
- private JPanel jPanelTop = null;
-
- private JPanel jPanelBottom = null;
-
- private JLabel jLabel = null;
-
- private JScrollPane jScrollPaneAllModules = null;
-
- private JTable jTableAllModules = null;
-
- private JPanel jPanelTopSouth = null;
-
- private JButton jButtonAddModule = null;
-
- private JLabel jLabelModulesAdded = null;
-
- private JPanel jPanelBottomSouth = null;
-
- private JScrollPane jScrollPaneFpdModules = null;
-
- private JTable jTableFpdModules = null;
-
- private JButton jButtonSettings = null;
-
- private JButton jButtonRemoveModule = null;
-
- private NonEditableTableModel modelAllModules = null;
-
- private FpdModulesTableModel modelFpdModules = null;
-
- private FpdModuleSA settingDlg = null;
-
- private FpdFileContents ffc = null;
-
- private OpeningPlatformType docConsole = null;
-
- private Map<String, ArrayList<String>> fpdMsa = null;
-
- private ArrayList<ModuleIdentification> miList = null;
-
- /**
- * Column settings for displaying all modules in workspace
- */
- private final int modNameColForAllModTable = 0;
-
- private final int pkgNameColForAllModTable = 1;
-
- private final int pathColForAllModTable = 2;
-
- private final int typeColForAllModTable = 3;
-
- private final int pkgVerColForAllModTable = 5;
-
- private final int modVerColForAllModTable = 4;
-
- /**
- * Column settings for display modules in the FPD file
- */
- private final int modNameColForFpdModTable = 0;
-
- private final int pkgNameColForFpdModTable = 1;
-
- private final int pathColForFpdModTable = 2;
-
- private final int archColForFpdModTable = 3;
-
- private final int pkgVerColForFpdModTable = 6;
-
- private final int modVerColForFpdModTable = 5;
-
- private final int typeColForFpdModTable = 4;
-
- /**
- * FpdFileContents structure
- */
- private final int ffcModGuid = 0;
-
- private final int ffcModVer = 1;
-
- private final int ffcPkgGuid = 2;
-
- private final int ffcPkgVer = 3;
-
- private final int ffcModArch = 4;
-
- /**
- * Set Column Widths, Only the PATH should not have a max width.
- */
- private final int modNameMinWidth = 168;
-
- private final int modNamePrefWidth = 200;
-
- private final int modNameMaxWidth = 350;
-
- private final int pkgNameMinWidth = 100;
-
- private final int pkgNamePrefWidth = 130;
-
- private final int pkgNameMaxWidth = 150;
-
- private final int verMinWidth = 60;
-
- private final int verMaxWidth = 80;
-
- private final int verPrefWidth = 70;
-
- private final int pathPrefWidth = 600;
-
- private final int pathMinWidth = 280;
-
- private final int archPrefWidth = 80;
-
- private final int archMinWidth = 60;
-
- private final int archMaxWidth = 100;
-
- private final int typePrefWidth = 145;
-
- private final int typeMinWidth = 100;
-
- private final int typeMaxWidth = 155;
-
- private JButton jButtonApriori = null;
-
- /**
- * This method initializes jSplitPane
- *
- * This is the main edit window
- *
- * @return javax.swing.JSplitPane jSplitPane
- */
- private JSplitPane getJSplitPane() {
- if (jSplitPane == null) {
- jSplitPane = new JSplitPane();
- jSplitPane.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
- jSplitPane.setDividerLocation(250);
- jSplitPane.setBottomComponent(getJPanelBottom());
- jSplitPane.setTopComponent(getJPanelTop());
- }
- return jSplitPane;
- }
-
- /**
- * This method initializes jPanelTop
- *
- * This panel contains the All Modules Table
- *
- * @return javax.swing.JPanel jPanelTop
- */
- private JPanel getJPanelTop() {
- if (jPanelTop == null) {
- jLabel = new JLabel();
- jLabel.setText(" Modules in Workspace");
- jPanelTop = new JPanel();
- jPanelTop.setLayout(new BorderLayout());
- jPanelTop.add(jLabel, java.awt.BorderLayout.NORTH);
- jPanelTop.add(getJScrollPaneAllModules(), java.awt.BorderLayout.CENTER);
- jPanelTop.add(getJPanelTopSouth(), java.awt.BorderLayout.SOUTH);
- }
- return jPanelTop;
- }
-
- /**
- * This method initializes jPanelBottom
- *
- * This panel contains the FPD Modules Table
- *
- * @return javax.swing.JPanel jPanelBottom
- */
- private JPanel getJPanelBottom() {
- if (jPanelBottom == null) {
- jLabelModulesAdded = new JLabel();
- jLabelModulesAdded.setText(" Modules Added into Platform");
- jPanelBottom = new JPanel();
- jPanelBottom.setLayout(new BorderLayout());
- jPanelBottom.add(jLabelModulesAdded, java.awt.BorderLayout.NORTH);
- jPanelBottom.add(getJPanelBottomSouth(), java.awt.BorderLayout.SOUTH);
- jPanelBottom.add(getJScrollPaneFpdModules(), java.awt.BorderLayout.CENTER);
- }
- return jPanelBottom;
- }
-
- /**
- * This method initializes jScrollPaneAllModules
- *
- * @return javax.swing.JScrollPane jScrollPaneAllModules
- */
- private JScrollPane getJScrollPaneAllModules() {
- if (jScrollPaneAllModules == null) {
- jScrollPaneAllModules = new JScrollPane();
- jScrollPaneAllModules.setPreferredSize(new java.awt.Dimension(600, 200));
- jScrollPaneAllModules.setViewportView(getJTableAllModules());
- }
- return jScrollPaneAllModules;
- }
-
- /**
- * This method initializes jTableAllModules
- *
- * @return javax.swing.JTable jTableAllModules
- */
- private JTable getJTableAllModules() {
- if (jTableAllModules == null) {
- modelAllModules = new NonEditableTableModel();
- TableSorter sorter = new TableSorter(modelAllModules);
- jTableAllModules = new JTable(sorter);
- sorter.setTableHeader(jTableAllModules.getTableHeader());
- jTableAllModules.setRowHeight(20);
- modelAllModules.addColumn("<html>Module<br>Name</html>");
- modelAllModules.addColumn("<html>Package<br>Name</html>");
- modelAllModules.addColumn("Path");
- modelAllModules.addColumn("<html>Module<br>Type</html>");
- modelAllModules.addColumn("<html>Module<br>Version</html>");
- modelAllModules.addColumn("<html>Package<br>Version</html>");
-
- javax.swing.table.TableColumn column = null;
- column = jTableAllModules.getColumnModel().getColumn(modNameColForAllModTable);
- column.setPreferredWidth(modNamePrefWidth);
- column.setMinWidth(modNameMinWidth);
- column.setMaxWidth(modNameMaxWidth);
- column = jTableAllModules.getColumnModel().getColumn(modVerColForAllModTable);
- column.setPreferredWidth(verPrefWidth);
- column.setMaxWidth(verMaxWidth);
- column.setMinWidth(verMinWidth);
- column = jTableAllModules.getColumnModel().getColumn(pkgNameColForAllModTable);
- column.setPreferredWidth(pkgNamePrefWidth);
- column.setMinWidth(pkgNameMinWidth);
- column.setMaxWidth(pkgNameMaxWidth);
- column = jTableAllModules.getColumnModel().getColumn(pkgVerColForAllModTable);
- column.setPreferredWidth(verPrefWidth);
- column.setMaxWidth(verMaxWidth);
- column.setMinWidth(verMinWidth);
- column = jTableAllModules.getColumnModel().getColumn(typeColForAllModTable);
- column.setPreferredWidth(typePrefWidth);
- column.setMaxWidth(typeMaxWidth);
- column.setMinWidth(typeMinWidth);
- column = jTableAllModules.getColumnModel().getColumn(pathColForAllModTable);
- column.setPreferredWidth(pathPrefWidth);
- column.setMinWidth(pathMinWidth);
-
- jTableAllModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableAllModules.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
- jTableAllModules.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseClicked(java.awt.event.MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
- java.awt.Point p = e.getPoint();
- int rowIndex = jTableAllModules.rowAtPoint(p);
- TableSorter sorter = (TableSorter) jTableAllModules.getModel();
- rowIndex = sorter.getModelRowIndex(rowIndex);
- addModuleIntoPlatform (rowIndex);
- }
- }
- });
- jTableAllModules.addKeyListener(new java.awt.event.KeyAdapter() {
- public void keyPressed(java.awt.event.KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER) {
- int selectedRow = jTableAllModules.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- TableSorter sorter = (TableSorter) jTableAllModules.getModel();
- selectedRow = sorter.getModelRowIndex(selectedRow);
- addModuleIntoPlatform (selectedRow);
- }
- }
- });
-
- jTableAllModules.addKeyListener(new java.awt.event.KeyAdapter() {
- public void keyTyped(java.awt.event.KeyEvent e) {
-
- if (System.currentTimeMillis() - savedMs < timeToWait) {
- searchField += e.getKeyChar();
- }
- else {
- searchField = "" + e.getKeyChar();
- }
-
- int viewIndex = gotoFoundRow (searchField, jTableAllModules);
- if (viewIndex >= 0){
- jTableAllModules.changeSelection(viewIndex, 0, false, false);
- }
- savedMs = System.currentTimeMillis();
- }
- });
-
-
- }
- return jTableAllModules;
- }
-
- private int gotoFoundRow (String s, JTable model) {
- for (int i = 0; i < model.getRowCount(); ++i) {
- if (model.getValueAt(i, 0) != null && model.getValueAt(i, 0).toString().regionMatches(true, 0, s, 0, s.length())) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * This method initializes jPanelTopSouth
- *
- * This panel contains the ADD button
- *
- * @return javax.swing.JPanel jPanelTopSouth
- */
- private JPanel getJPanelTopSouth() {
- if (jPanelTopSouth == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelTopSouth = new JPanel();
- jPanelTopSouth.setLayout(flowLayout);
- jPanelTopSouth.add(getJButtonAddModule(), null);
- }
- return jPanelTopSouth;
- }
-
- private void addModuleIntoPlatform (int selectedRow) {
- String path = modelAllModules.getValueAt(selectedRow, pathColForAllModTable) + "";
- ModuleIdentification mi = miList.get(selectedRow);
- Vector<String> vArchs = null;
-
- vArchs = WorkspaceProfile.getModuleSupArchs(mi);
-
- if (vArchs == null) {
- JOptionPane.showMessageDialog(this, "No Supported Architectures specified in MSA file.");
- return;
- }
-
- Vector<Object> platformSupArch = new Vector<Object>();
- ffc.getPlatformDefsSupportedArchs(platformSupArch);
- platformSupArch.retainAll(vArchs);
- if (platformSupArch.size() == 0) {
- JOptionPane.showMessageDialog(this, "This Module does not support this platform architectures.");
- return;
- }
-
- String archsAdded = "";
- String mg = mi.getGuid();
- String mv = mi.getVersion();
- String pg = mi.getPackageId().getGuid();
- String pv = mi.getPackageId().getVersion();
- String mType = SurfaceAreaQuery.getModuleType(mi);
-
- ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);
- if (al == null) {
- //
- // if existing ModuleSA does not specify version info.
- //
- al = fpdMsa.get(mg + "null" + pg + "null");
- if (al == null) {
- al = fpdMsa.get(mg + "null" + pg + pv);
- if (al == null){
- al = fpdMsa.get(mg + mv + pg + "null");
- if (al == null) {
- al = new ArrayList<String>();
- fpdMsa.put(mg + mv + pg + pv, al);
- }
- }
- }
- }
- //
- // filter from module SupArchs what archs has been added.
- //
- for (int i = 0; i < al.size(); ++i) {
- vArchs.remove(al.get(i));
- }
- //
- // check whether archs conform to SupArch of platform.
- //
- platformSupArch.removeAllElements();
- ffc.getPlatformDefsSupportedArchs(platformSupArch);
- vArchs.retainAll(platformSupArch);
- //
- // Archs this Module supported have already been added.
- //
- if (vArchs.size() == 0) {
- JOptionPane.showMessageDialog(this, "This Module has already been added.");
- return;
- }
- //ToDo put Arch instead of null
- boolean errorOccurred = false;
- for (int i = 0; i < vArchs.size(); ++i) {
- String arch = vArchs.get(i);
- al.add(arch);
- archsAdded += arch + " ";
- String[] row = { "", "", "", "", "", "", "" };
-
- if (mi != null) {
- row[modNameColForFpdModTable] = mi.getName();
- row[pkgNameColForFpdModTable] = mi.getPackageId().getName();
- row[pathColForFpdModTable] = path;
- row[archColForFpdModTable] = arch;
- row[pkgVerColForFpdModTable] = pv;
- row[modVerColForFpdModTable] = mv;
- row[typeColForFpdModTable] = mType;
-
- }
- modelFpdModules.addRow(row);
-
- docConsole.setSaved(false);
- try {
- //ToDo : specify archs need to add.
- ffc.addFrameworkModulesPcdBuildDefs(mi, arch, null);
- } catch (Exception exception) {
- JOptionPane.showMessageDialog(this, "Adding " + row[modNameColForFpdModTable] + " with Supporting Architectures: " + arch
- + ": " + exception.getMessage());
- errorOccurred = true;
- }
- }
-
- String s = "This Module with Architecture " + archsAdded;
- if (errorOccurred) {
- s += " was added with Error. Platform may NOT Build.";
- } else {
- s += " was added Successfully.";
- }
- JOptionPane.showMessageDialog(this, s);
- TableSorter sorterFpdModules = (TableSorter)jTableFpdModules.getModel();
- int viewIndex = sorterFpdModules.getViewIndexArray()[modelFpdModules.getRowCount() - 1];
- jTableFpdModules.changeSelection(viewIndex, 0, false, false);
-
- }
-
- /**
- * This method initializes jButtonAddModule
- *
- * @return javax.swing.JButton jButtonAddModule
- */
- private JButton getJButtonAddModule() {
- if (jButtonAddModule == null) {
- jButtonAddModule = new JButton();
- jButtonAddModule.setPreferredSize(new java.awt.Dimension(130, 20));
- jButtonAddModule.setText("Add a Module");
- jButtonAddModule.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableAllModules.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- TableSorter sorter = (TableSorter) jTableAllModules.getModel();
- selectedRow = sorter.getModelRowIndex(selectedRow);
- addModuleIntoPlatform (selectedRow);
- }
- });
- }
- return jButtonAddModule;
- }
-
- /**
- * This method initializes jPanelBottomSouth
- *
- * This panel contains the Settings and Remove Buttons
- *
- * @return javax.swing.JPanel jPanelBottomSouth
- */
- private JPanel getJPanelBottomSouth() {
- if (jPanelBottomSouth == null) {
- FlowLayout flowLayout1 = new FlowLayout();
- flowLayout1.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelBottomSouth = new JPanel();
- jPanelBottomSouth.setLayout(flowLayout1);
- jPanelBottomSouth.add(getJButtonSettings(), null);
- jPanelBottomSouth.add(getJButtonRemoveModule(), null);
- jPanelBottomSouth.add(getJButtonApriori(), null);
- }
- return jPanelBottomSouth;
- }
-
- /**
- * This method initializes jScrollPaneFpdModules
- *
- * @return javax.swing.JScrollPane jScrollPaneFpdModules
- */
- private JScrollPane getJScrollPaneFpdModules() {
- if (jScrollPaneFpdModules == null) {
- jScrollPaneFpdModules = new JScrollPane();
- jScrollPaneFpdModules.setPreferredSize(new java.awt.Dimension(453, 200));
- jScrollPaneFpdModules.setViewportView(getJTableFpdModules());
- }
- return jScrollPaneFpdModules;
- }
-
- /**
- * This method initializes jTableFpdModules
- *
- * @return javax.swing.JTable jTableFpdModules
- */
- private JTable getJTableFpdModules() {
- if (jTableFpdModules == null) {
- modelFpdModules = new FpdModulesTableModel();
- TableSorter sorter = new TableSorter(modelFpdModules);
- jTableFpdModules = new JTable(sorter);
- sorter.setTableHeader(jTableFpdModules.getTableHeader());
- jTableFpdModules.setRowHeight(20);
- modelFpdModules.addColumn("<html>Module<br>Name</html>");
- modelFpdModules.addColumn("<html>Package<br>Name</html>");
- modelFpdModules.addColumn("Path");
- modelFpdModules.addColumn("<html>Supported<br>Architectures</html>");
- modelFpdModules.addColumn("<html>Module<br>Type</html>");
- modelFpdModules.addColumn("<html>Module<br>Version</html>");
- modelFpdModules.addColumn("<html>Package<br>Version</html>");
- modelFpdModules.addColumn("<html>Force<br>Debug</html>");
-
- javax.swing.table.TableColumn column = null;
- column = jTableFpdModules.getColumnModel().getColumn(modNameColForFpdModTable);
- column.setPreferredWidth(modNamePrefWidth);
- column.setMinWidth(modNameMinWidth);
- column.setMaxWidth(modNameMaxWidth);
- column = jTableFpdModules.getColumnModel().getColumn(modVerColForFpdModTable);
- column.setPreferredWidth(verPrefWidth);
- column.setMaxWidth(verMaxWidth);
- column.setMinWidth(verMinWidth);
- column = jTableFpdModules.getColumnModel().getColumn(pkgNameColForFpdModTable);
- column.setPreferredWidth(pkgNamePrefWidth);
- column.setMinWidth(pkgNameMinWidth);
- column.setMaxWidth(pkgNameMaxWidth);
- column = jTableFpdModules.getColumnModel().getColumn(pkgVerColForFpdModTable);
- column.setPreferredWidth(verPrefWidth);
- column.setMaxWidth(verMaxWidth);
- column.setMinWidth(verMinWidth);
- column = jTableFpdModules.getColumnModel().getColumn(archColForFpdModTable);
- column.setPreferredWidth(archPrefWidth);
- column.setMaxWidth(archMaxWidth);
- column.setMinWidth(archMinWidth);
- column = jTableFpdModules.getColumnModel().getColumn(pathColForFpdModTable);
- column.setPreferredWidth(pathPrefWidth);
- column.setMinWidth(pathMinWidth);
- column = jTableFpdModules.getColumnModel().getColumn(typeColForFpdModTable);
- column.setPreferredWidth(typePrefWidth);
- column.setMaxWidth(typeMaxWidth);
- column.setMinWidth(typeMinWidth);
-
- jTableFpdModules.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableFpdModules.setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
-
- jTableFpdModules.addMouseListener(new java.awt.event.MouseAdapter() {
- public void mouseClicked(java.awt.event.MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() == 2) {
- java.awt.Point p = e.getPoint();
- int rowIndex = jTableFpdModules.rowAtPoint(p);
- TableSorter sorter = (TableSorter) jTableFpdModules.getModel();
- rowIndex = sorter.getModelRowIndex(rowIndex);
- showSettingsDlg (rowIndex);
- }
- }
- });
-
- jTableFpdModules.addKeyListener(new java.awt.event.KeyAdapter() {
- public void keyPressed(java.awt.event.KeyEvent e) {
- if (e.getKeyCode() == KeyEvent.VK_ENTER) {
- int selectedRow = jTableFpdModules.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- TableSorter sorter = (TableSorter) jTableFpdModules.getModel();
- selectedRow = sorter.getModelRowIndex(selectedRow);
- showSettingsDlg (selectedRow);
- }
- }
- });
-
- jTableFpdModules.addKeyListener(new java.awt.event.KeyAdapter() {
- public void keyTyped(java.awt.event.KeyEvent e) {
-
- if (System.currentTimeMillis() - savedMs < timeToWait) {
- searchField += e.getKeyChar();
- }
- else {
- searchField = "" + e.getKeyChar();
- }
-
- int viewIndex = gotoFoundRow (searchField, jTableFpdModules);
- if (viewIndex >= 0){
- jTableFpdModules.changeSelection(viewIndex, 0, false, false);
- }
- savedMs = System.currentTimeMillis();
- }
- });
-
- jTableFpdModules.getModel().addTableModelListener(this);
- }
- return jTableFpdModules;
- }
-
- public void tableChanged(TableModelEvent arg0) {
- if (arg0.getType() == TableModelEvent.UPDATE){
- int row = arg0.getFirstRow();
- int column = arg0.getColumn();
- TableModel m = (TableModel)arg0.getSource();
-
- if (column != forceDbgColForFpdModTable) {
- return;
- }
- String s = m.getValueAt(row, column)+"";
- boolean dbgEnable = new Boolean(s);
- ffc.setModuleSAForceDebug(row, dbgEnable);
- docConsole.setSaved(false);
- }
- }
-
- private void showSettingsDlg (int row) {
-// As PCD sync. check is full platform range now during opening FrameworkModules editor,
-// the following check is no longer needed.
-// try {
-// Vector<String> vExceptions = new Vector<String>();
-// if (ffc.adjustPcd(row, vExceptions)) {
-// JOptionPane.showMessageDialog(frame, "Pcd entries sync. with those in MSA files.");
-// docConsole.setSaved(false);
-// }
-// }
-// catch (Exception exp) {
-// JOptionPane.showMessageDialog(frame, exp.getMessage());
-// }
-
- if (settingDlg == null) {
- settingDlg = new FpdModuleSA(ffc);
- }
-
- String[] sa = new String[5];
- ffc.getFrameworkModuleInfo(row, sa);
- String mg = sa[ffcModGuid];
- String mv = sa[ffcModVer];
- String pg = sa[ffcPkgGuid];
- String pv = sa[ffcPkgVer];
- String arch = sa[ffcModArch];
- settingDlg.setKey(mg + " " + mv + " " + pg + " " + pv + " " + arch, row, docConsole);
- settingDlg.setVisible(true);
- }
- /**
- * This method initializes jButtonSettings
- *
- * @return javax.swing.JButton jButtonSettings
- */
- private JButton getJButtonSettings() {
- if (jButtonSettings == null) {
- jButtonSettings = new JButton();
- jButtonSettings.setPreferredSize(new java.awt.Dimension(130,20));
- jButtonSettings.setText("Settings");
- jButtonSettings.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableFpdModules.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
-
- TableSorter sorter = (TableSorter) jTableFpdModules.getModel();
- selectedRow = sorter.getModelRowIndex(selectedRow);
- showSettingsDlg (selectedRow);
- }
- });
- }
- return jButtonSettings;
- }
-
- /**
- * This method initializes jButtonRemoveModule
- *
- * @return javax.swing.JButton jButtonRemoveModule
- */
- private JButton getJButtonRemoveModule() {
- if (jButtonRemoveModule == null) {
- jButtonRemoveModule = new JButton();
- jButtonRemoveModule.setText("Remove Module");
- FontMetrics fm = jButtonRemoveModule.getFontMetrics(jButtonRemoveModule.getFont());
- jButtonRemoveModule.setPreferredSize(new Dimension (fm.stringWidth(jButtonRemoveModule.getText()) + 40, 20));
- jButtonRemoveModule.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableFpdModules.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- int nextSelection = selectedRow;
-
- TableSorter sorter = (TableSorter) jTableFpdModules.getModel();
- selectedRow = sorter.getModelRowIndex(selectedRow);
-
- String[] sa = new String[5];
- ffc.getFrameworkModuleInfo(selectedRow, sa);
- String mg = sa[ffcModGuid];
- String mv = sa[ffcModVer];
- String pg = sa[ffcPkgGuid];
- String pv = sa[ffcPkgVer];
- String arch = sa[ffcModArch];
- //
- // sync. module order list in BuildOptions-UserExtensions.
- //
- String moduleKey = mg + " " + mv + " " + pg + " " + pv + " " + arch;
- String fvBindings = ffc.getFvBinding(moduleKey);
- if (fvBindings != null) {
- String[] fvArray = fvBindings.split(" ");
- for (int i = 0; i < fvArray.length; ++i) {
- ffc.removeModuleInBuildOptionsUserExtensions(fvArray[i].trim(), "IMAGES", "1", mg, mv, pg, pv, arch);
- }
- }
-
- ModuleIdentification mi = WorkspaceProfile.getModuleId(mg + " " + mv + " " + pg + " " + pv + " " + arch);
- if (mi != null) {
- mv = mi.getVersion();
- pv = mi.getPackageId().getVersion();
- }
-
- try {
- ffc.removeModuleSA(selectedRow);
- }
- catch (Exception exp) {
- JOptionPane.showMessageDialog(FpdFrameworkModules.this, exp.getMessage());
- return;
- }
-
- if (arch == null) {
- // if no arch specified in ModuleSA
- fpdMsa.remove(mg + mv + pg + pv);
-
- } else {
- ArrayList<String> al = fpdMsa.get(mg + mv + pg + pv);
- if (al != null) {
- al.remove(arch);
- if (al.size() == 0) {
- fpdMsa.remove(mg + mv + pg + pv);
- }
- }
- }
-
- modelFpdModules.removeRow(selectedRow);
- if (nextSelection >= jTableFpdModules.getRowCount()) {
- nextSelection = jTableFpdModules.getRowCount() - 1;
- }
- jTableFpdModules.changeSelection(nextSelection, 0, false, false);
- docConsole.setSaved(false);
- }
- });
- }
- return jButtonRemoveModule;
- }
-
- /**
- * This method initializes jButtonApriori
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonApriori() {
- if (jButtonApriori == null) {
- jButtonApriori = new JButton();
- jButtonApriori.setText("Apriori Files");
- FontMetrics fm = jButtonApriori.getFontMetrics(jButtonApriori.getFont());
- int buttonWidth = fm.stringWidth(jButtonApriori.getText()) + 40;
- if (jButtonRemoveModule.getWidth() > buttonWidth) {
- buttonWidth = jButtonRemoveModule.getWidth();
- }
- jButtonApriori.setPreferredSize(new Dimension (buttonWidth, 20));
- jButtonApriori.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(ActionEvent arg0) {
- new GenAprioriFileDialog(ffc, docConsole).setVisible(true);
- }});
- }
- return jButtonApriori;
- }
-
- /**
- *
- * @param args
- */
- public static void main(String[] args) {
- // Set the pane visable
- new FpdFrameworkModules().setVisible(true);
- }
-
- private class PcdSyncTask extends Thread {
-
- boolean pcdSynced = false;
- public void run () {
- Vector<String> vExceptions = new Vector<String>();
- pcdSync(vExceptions);
- if (pcdSynced) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "PCD in this platform are synchronized with those in MSA files.");
- docConsole.setSaved(false);
- }
- if (vExceptions.size() > 0) {
- String errorMsg = "";
- for (int i = 0; i < vExceptions.size(); ++i) {
- errorMsg += " " + vExceptions.get(i) + "\n";
- }
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Error occurred during synchronization:\n" + errorMsg);
- }
- }
-
- private void pcdSync(Vector<String> v) {
-
- Vector<PcdSyncSubTask> vThreads = new Vector<PcdSyncSubTask> ();
- int moduleCount = jTableFpdModules.getRowCount();
- int start = 0;
- for (int i = 0; i < FpdFrameworkModules.pcdSyncThreadNumber; ++i) {
- int end = start + moduleCount/FpdFrameworkModules.pcdSyncThreadNumber + 1;
- if (end > moduleCount) {
- end = moduleCount;
- }
- vThreads.add(new PcdSyncSubTask (start, end, v));
- start = end;
- }
-
- for (int i = 0; i < vThreads.size(); ++i) {
- vThreads.get(i).start();
- }
-
- try {
- for (int i = 0; i < vThreads.size(); ++i) {
- vThreads.get(i).join();
- }
- }
- catch (InterruptedException e) {
-
- }
-
- }
-
- private class PcdSyncSubTask extends Thread {
-
- private int startModule = 0;
- private int endModulePlusOne = 1;
- private Vector<String> v = null;
-
- PcdSyncSubTask (int start, int endPlusOne, Vector<String> vErr) {
- startModule = start;
- endModulePlusOne = endPlusOne;
- v = vErr;
- }
-
- public void run () {
- String[] sa = new String[5];
- for (int i = startModule; i < endModulePlusOne; ++i) {
- try {
- ffc.getFrameworkModuleInfo(i, sa);
- String mg = sa[ffcModGuid];
- String mv = sa[ffcModVer];
- String pg = sa[ffcPkgGuid];
- String pv = sa[ffcPkgVer];
- String arch = sa[ffcModArch];
- String key = mg + " " + mv + " " + pg + " " + pv + " " + arch;
- if (ffc.adjustPcd(key, v)) {
- pcdSynced = true;
- }
- }
- catch (Exception exp) {
-// JOptionPane.showMessageDialog(frame, exp.getMessage());
- continue;
- }
- }
- }
- }
- }
-
- /**
- * This is the default constructor
- */
- public FpdFrameworkModules() {
- super();
- initialize();
- }
-
- public FpdFrameworkModules(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this();
- init(fpd);
-
- }
-
- private PcdSyncTask pst = null;
- public FpdFrameworkModules(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- if (pst == null) {
- pst = new PcdSyncTask();
- }
- pst.start();
- }
-
- private void init(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
-
- if (ffc == null) {
- ffc = new FpdFileContents(fpd);
- ffc.initDynPcdMap();
- }
-
- if (fpdMsa == null) {
- fpdMsa = new HashMap<String, ArrayList<String>>();
- }
-
- if (ffc.getFrameworkModulesCount() > 0) {
- String[][] saa = new String[ffc.getFrameworkModulesCount()][5];
- ffc.getFrameworkModulesInfo(saa);
- for (int i = 0; i < saa.length; ++i) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(saa[i][ffcModGuid] + " " + saa[i][ffcModVer] + " "
- + saa[i][ffcPkgGuid] + " " + saa[i][ffcPkgVer]);
- Object[] row = { "", "", "", "", "", "", "", "" };
- if (mi != null) {
- row[modNameColForFpdModTable] = mi.getName();
- row[modVerColForFpdModTable] = mi.getVersion();
- row[typeColForFpdModTable] = SurfaceAreaQuery.getModuleType(mi);
- row[pkgNameColForFpdModTable] = mi.getPackageId().getName();
- row[pkgVerColForFpdModTable] = mi.getPackageId().getVersion();
- row[archColForFpdModTable] = saa[i][ffcModArch];
- try {
- row[pathColForFpdModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
- } catch (Exception e) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Show FPD Modules:" + e.getMessage());
- }
-
- String fpdMsaKey = saa[i][ffcModGuid] + row[modVerColForFpdModTable]
- + saa[i][ffcPkgGuid] + row[pkgVerColForFpdModTable];
- ArrayList<String> al = fpdMsa.get(fpdMsaKey);
- if (al == null) {
- al = new ArrayList<String>();
- fpdMsa.put(fpdMsaKey, al);
- }
- al.add(saa[i][ffcModArch]);
- }
- else {
- row[modNameColForFpdModTable] = saa[i][ffcModGuid];
- row[modVerColForFpdModTable] = saa[i][ffcModVer];
- row[pkgNameColForFpdModTable] = saa[i][ffcPkgGuid];
- row[pkgVerColForFpdModTable] = saa[i][ffcPkgVer];
- row[archColForFpdModTable] = saa[i][ffcModArch];
- }
- row[forceDbgColForFpdModTable] = ffc.getModuleSAForceDebug(i);
- modelFpdModules.addRow(row);
-
- }
- TableSorter sorter = (TableSorter)jTableFpdModules.getModel();
- sorter.setSortState(modNameColForFpdModTable, TableSorter.ASCENDING);
- }
-
- showAllModules();
-
- }
-
- private void showAllModules() {
-
- if (miList == null) {
- miList = new ArrayList<ModuleIdentification>();
- }
-
- String[] s = { "", "", "", "", "", "" };
-
- Iterator ismi = GlobalData.vModuleList.iterator();
- while (ismi.hasNext()) {
- ModuleIdentification mi = (ModuleIdentification) ismi.next();
- s[modNameColForAllModTable] = mi.getName();
- s[modVerColForAllModTable] = mi.getVersion();
- s[typeColForAllModTable] = SurfaceAreaQuery.getModuleType(mi);
- s[pkgNameColForAllModTable] = mi.getPackageId().getName();
- s[pkgVerColForAllModTable] = mi.getPackageId().getVersion();
- try {
- s[pathColForAllModTable] = mi.getPath().substring(Workspace.getCurrentWorkspace().length() + 1);
- } catch (Exception e) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "Show All Modules:" + e.getMessage());
- }
- modelAllModules.addRow(s);
- miList.add(mi);
- }
-
-
- TableSorter sorter = (TableSorter)jTableAllModules.getModel();
- sorter.setSortState(modNameColForAllModTable, TableSorter.ASCENDING);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(633, 533);
- this.setTitle("Framework Modules");
- this.setContentPane(getJSplitPane());
- this.setVisible(true);
-
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
-
-class NonEditableTableModel extends DefaultTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int col) {
- return false;
- }
-}
-
-class FpdModulesTableModel extends DefaultTableModel {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public Class<?> getColumnClass (int c) {
- if (getValueAt(0, c) != null){
- return getValueAt(0, c).getClass();
- }
- return String.class;
- }
-
- public boolean isCellEditable (int row, int col) {
- if (col == FpdFrameworkModules.forceDbgColForFpdModTable) {
- return true;
- }
- return false;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFvOptions.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFvOptions.java
deleted file mode 100644
index b91f0c8f03..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdFvOptions.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/** @file
- Java class FpdFvOptions is GUI for FV options in FPD file.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-import java.awt.event.MouseEvent;
-import java.awt.event.WindowEvent;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.Set;
-
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JDialog;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.JButton;
-
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-
-/**
- *
- *
- */
-public class FpdFvOptions extends JDialog {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private static JFrame frame;
- private JPanel jContentPane = null;
- private JPanel jPanelN = null;
- private JPanel jPanelS = null;
- private JPanel jPanelC = null;
- private JScrollPane jScrollPaneFvOptions = null;
- private JTable jTableFvOptions = null;
- private DefaultTableModel tableModel = null;
- private String fvName = null;
- private FpdFileContents ffc = null;
- private OpeningPlatformType docConsole = null;
- private JButton jButtonNew = null;
- private JButton jButtonDelete = null;
- private String oldOptionName = "";
- private int selectedRow = -1;
- private TableModelListener tableModelListener = null;
-
- /**
- * This is the default constructor
- */
- public FpdFvOptions(String name, DefaultTableModel tm, FpdFileContents ffc, OpeningPlatformType dc) {
- super(FrameworkWizardUI.getInstance());
- fvName = name;
- this.ffc = ffc;
- this.docConsole = dc;
- setTableModel(tm);
- initOptions();
- initialize();
-
- }
-
- protected void processWindowEvent (WindowEvent e) {
- if (e.getID() == WindowEvent.WINDOW_CLOSING) {
- if (jTableFvOptions.isEditing()) {
- jTableFvOptions.getCellEditor().stopCellEditing();
- }
- tableModel.removeTableModelListener(tableModelListener);
- this.dispose();
- }
- }
-
- private void initOptions() {
- tableModel.setRowCount(0);
- LinkedHashMap<String, String> mOpts = new LinkedHashMap<String, String>();
- ffc.getFvImagesFvImageOptions(fvName, mOpts);
- Set<String> sKey = mOpts.keySet();
- Iterator<String> iter = sKey.iterator();
- while (iter.hasNext()) {
- String name = iter.next();
- String value = mOpts.get(name);
- tableModel.addRow(new String[]{name, value});
- }
- }
-
- private boolean fvOptionNameExists (String name) {
- int count = 0;
- for (int i = 0; i < jTableFvOptions.getRowCount(); ++i) {
- if (getTableModel().getValueAt(i, 0).equals(name)) {
- ++count;
- }
- }
- if (count > 1) {
- return true;
- }
- return false;
- }
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(650, 400);
- this.setModal(true);
- this.setTitle("FV Options");
- this.setDefaultCloseOperation(JDialog.DO_NOTHING_ON_CLOSE);
- this.setContentPane(getJContentPane());
- this.centerWindow();
- this.setVisible(true);
-
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelN(), java.awt.BorderLayout.NORTH);
- jContentPane.add(getJPanelS(), java.awt.BorderLayout.SOUTH);
- jContentPane.add(getJPanelC(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes jPanelN
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelN() {
- if (jPanelN == null) {
- jPanelN = new JPanel();
- }
- return jPanelN;
- }
-
- /**
- * This method initializes jPanelS
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelS() {
- if (jPanelS == null) {
- jPanelS = new JPanel();
- jPanelS.add(getJButtonNew(), null);
- jPanelS.add(getJButtonDelete(), null);
- }
- return jPanelS;
- }
-
- /**
- * This method initializes jPanelC
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelC() {
- if (jPanelC == null) {
- jPanelC = new JPanel();
- jPanelC.add(getJScrollPaneFvOptions(), null);
- }
- return jPanelC;
- }
-
- /**
- * This method initializes jScrollPaneFvOptions
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneFvOptions() {
- if (jScrollPaneFvOptions == null) {
- jScrollPaneFvOptions = new JScrollPane();
- jScrollPaneFvOptions.setPreferredSize(new java.awt.Dimension(600,320));
- jScrollPaneFvOptions.setViewportView(getJTableFvOptions());
- }
- return jScrollPaneFvOptions;
- }
-
- /**
- * This method initializes jTableFvOptions
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableFvOptions() {
- if (jTableFvOptions == null) {
- jTableFvOptions = new JTable(getTableModel()) {
- /**
- *
- */
- private static final long serialVersionUID = -1941328952828651192L;
-
- public String getToolTipText(MouseEvent e) {
- String tip = null;
- java.awt.Point p = e.getPoint();
- int rowIndex = rowAtPoint(p);
-// int colIndex = columnAtPoint(p);
-// int realColumnIndex = convertColumnIndexToModel(colIndex);
-
- TableModel model = getModel();
- String optName = (String) model.getValueAt(rowIndex, 0);
- if (((FvOptsTableModel)model).getVKeyWords().contains(optName)){
- tip = optName + " is from Flash Definition File and it is NOT editable.";
- }
-
- return tip;
- }
-
- };
-
- jTableFvOptions.setRowHeight(20);
-
- jTableFvOptions.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()) {
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel) e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- } else {
- selectedRow = lsm.getMinSelectionIndex();
- oldOptionName = getTableModel().getValueAt(selectedRow, 0)+"";
- }
- }
- });
-
- tableModelListener = new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- int col = arg0.getColumn();
- TableModel m = (TableModel) arg0.getSource();
-
- if (arg0.getType() == TableModelEvent.UPDATE) {
- String newOptionName = m.getValueAt(row, 0) + "";
- if (col == 0) {
- if (newOptionName.equals(oldOptionName)) {
- return;
- }
- if (fvOptionNameExists(newOptionName)) {
- JOptionPane.showMessageDialog(frame, "This Option already exists. Please choose another Option name.");
- m.setValueAt(oldOptionName, row, 0);
- return;
- }
-
- ffc.setTypedNamedFvImageNameValue(fvName, "Options", oldOptionName, m.getValueAt(row, 1)+"", newOptionName);
- docConsole.setSaved(false);
- oldOptionName = newOptionName;
- }
-
- if (col == 1) {
- ffc.setTypedNamedFvImageNameValue(fvName, "Options", oldOptionName, m.getValueAt(row, 1)+"", newOptionName);
- docConsole.setSaved(false);
- }
-
- }
- }
- };
-
- jTableFvOptions.getModel().addTableModelListener(tableModelListener);
- }
- return jTableFvOptions;
- }
-
- protected DefaultTableModel getTableModel() {
- return tableModel;
- }
-
- protected void setTableModel(DefaultTableModel tableModel) {
-
- this.tableModel = tableModel;
-
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
-/**
- * This method initializes jButtonNew
- *
- * @return javax.swing.JButton
- */
-private JButton getJButtonNew() {
- if (jButtonNew == null) {
- jButtonNew = new JButton();
- jButtonNew.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonNew.setText("New");
- jButtonNew.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- tableModel.addRow(new String[]{"", ""});
- oldOptionName = "";
- }
- });
- }
- return jButtonNew;
-}
-
-/**
- * This method initializes jButtonDelete
- *
- * @return javax.swing.JButton
- */
-private JButton getJButtonDelete() {
- if (jButtonDelete == null) {
- jButtonDelete = new JButton();
- jButtonDelete.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonDelete.setText("Delete");
- jButtonDelete.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int selectedRow = jTableFvOptions.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- String optName = tableModel.getValueAt(selectedRow, 0)+"";
- if (((FvOptsTableModel)tableModel).getVKeyWords().contains(optName)){
- return;
- }
- if (((FvOptsTableModel)tableModel).getVNonEditableName().contains(optName)){
- return;
- }
-
- ffc.removeTypedNamedFvImageNameValue(fvName, "Options", optName);
- tableModel.removeRow(selectedRow);
- docConsole.setSaved(false);
- }
- });
- }
- return jButtonDelete;
-}
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
deleted file mode 100644
index 516b063d66..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdHeader.java
+++ /dev/null
@@ -1,786 +0,0 @@
-/** @file
-
- The file is used to create, update FpdHeader of Fpd file
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.Dimension;
-import java.awt.event.ActionEvent;
-import java.awt.event.ComponentEvent;
-import java.awt.event.FocusAdapter;
-import java.awt.event.FocusEvent;
-import java.util.Vector;
-
-import javax.swing.JButton;
-import javax.swing.JLabel;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-
-
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.common.ui.StarLabel;
-
-/**
- The class is used to create, update FpdHeader of Fpd file
- It extends IInternalFrame
-
- @since PackageEditor 1.0
-
- **/
-public class FpdHeader extends IInternalFrame implements DocumentListener{
-
- private int dialogWidth = 560;
-
- private int labelColumn = 12;
-
- private int labelWidth = 155;
-
- private int buttonWidth = 60;
-
- private final int valueColumn = 168;
-
- private final int valueWidth = 320;
-
- private final int specWidth = 420;
-
- private int shortValueWidth = valueWidth - (buttonWidth + 5);
-
- private final int oneRowHeight = 20;
-
- private final int threeRowHeight = 60;
-
- private final int fourRowHeight = 80;
-
- private final int rowSep = 5;
-
- private final int rowOne = 12;
-
- private final int rowTwo = rowOne + oneRowHeight + rowSep;
-
- private final int rowThree = rowTwo + oneRowHeight + rowSep;
-
- private final int rowFour = rowThree + oneRowHeight + rowSep;
-
- private final int rowFive = rowFour + threeRowHeight + rowSep;
-
- private final int rowSix = rowFive + fourRowHeight + rowSep;
-
- private final int rowSeven = rowSix + oneRowHeight + rowSep;
-
- private final int rowEight = rowSeven + oneRowHeight + rowSep;
-
- private final int rowNine = rowEight + fourRowHeight + threeRowHeight +rowSep;
-
- private int dialogHeight = rowNine + threeRowHeight;
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = -8152099582923006900L;
-
- //
- //Define class members
- //
- private JPanel jContentPane = null; // @jve:decl-index=0:visual-constraint="10,53"
-
- private JLabel jLabelBaseName = null;
-
- private JTextField jTextFieldBaseName = null;
-
- private JLabel jLabelGuid = null;
-
- private JTextField jTextFieldGuid = null;
-
- private JLabel jLabelVersion = null;
-
- private JTextField jTextFieldVersion = null;
-
- private JButton jButtonGenerateGuid = null;
-
- private JLabel jLabelLicense = null;
-
- private JTextArea jTextAreaLicense = null;
-
- private JLabel jLabelCopyright = null;
-
- private JLabel jLabelDescription = null;
-
- private JTextArea jTextAreaDescription = null;
-
- private JTextField jTextFieldSpecification = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JScrollPane jScrollPaneLicense = null;
-
- private JScrollPane jScrollPaneDescription = null;
-
- private JScrollPane jCopyrightScrollPane = null;
-
- private JLabel jLabelAbstract = null;
-
- private JTextField jTextFieldAbstract = null;
-
- private StarLabel jStarLabel1 = null;
-
- private StarLabel jStarLabel2 = null;
-
- private StarLabel jStarLabel3 = null;
-
- private StarLabel jStarLabel4 = null;
-
- private StarLabel jStarLabel5 = null;
-
- private StarLabel jStarLabel7 = null;
-
- private StarLabel jStarLabel8 = null;
-
- private JTextArea jCopyrightTextArea = null;
-
- private JLabel jLabel = null;
-
- private JTextField jTextFieldUrl = null;
-
- private FpdFileContents ffc = null;
-
- private OpeningPlatformType docConsole = null;
-
- private boolean amended = false;
-
- /**
- This method initializes jTextFieldBaseName
-
- @return javax.swing.JTextField jTextFieldBaseName
-
- **/
- private JTextField getJTextFieldBaseName() {
- if (jTextFieldBaseName == null) {
- jTextFieldBaseName = new JTextField();
- jTextFieldBaseName.setBounds(new java.awt.Rectangle(valueColumn, rowOne, valueWidth, oneRowHeight));
- jTextFieldBaseName.setPreferredSize(new java.awt.Dimension(valueWidth,oneRowHeight));
- jTextFieldBaseName.getDocument().addDocumentListener(this);
- jTextFieldBaseName.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isUiNameType(jTextFieldBaseName.getText())) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Package Name does not match the UiNameType datatype.");
- return;
- }
- if (jTextFieldBaseName.getText().equals(ffc.getFpdHdrPlatformName())) {
- return;
- }
- ffc.setFpdHdrPlatformName(jTextFieldBaseName.getText());
- }
- });
- }
- return jTextFieldBaseName;
- }
-
- /**
- This method initializes jTextFieldGuid
-
- @return javax.swing.JTextField jTextFieldGuid
-
- **/
- private JTextField getJTextFieldGuid() {
- if (jTextFieldGuid == null) {
- jTextFieldGuid = new JTextField();
- jTextFieldGuid.setBounds(new java.awt.Rectangle(valueColumn, rowTwo, shortValueWidth, oneRowHeight));
- jTextFieldGuid.setPreferredSize(new java.awt.Dimension(shortValueWidth,oneRowHeight));
- jTextFieldGuid.getDocument().addDocumentListener(this);
- jTextFieldGuid.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isGuid(jTextFieldGuid.getText())) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Guid must be in registry (8-4-4-4-12) format.");
- return;
- }
- if (jTextFieldGuid.getText().equals(ffc.getFpdHdrGuidValue())) {
- return;
- }
- ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
- }
- });
- }
- return jTextFieldGuid;
- }
-
- /**
- This method initializes jTextFieldVersion
-
- @return javax.swing.JTextField jTextFieldVersion
-
- **/
- private JTextField getJTextFieldVersion() {
- if (jTextFieldVersion == null) {
- jTextFieldVersion = new JTextField();
- jTextFieldVersion.setBounds(new java.awt.Rectangle(valueColumn, rowThree, valueWidth, oneRowHeight));
- jTextFieldVersion.setPreferredSize(new java.awt.Dimension(valueWidth,oneRowHeight));
- jTextFieldVersion.getDocument().addDocumentListener(this);
- jTextFieldVersion.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isVersion(jTextFieldVersion.getText())) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Version does not match the Version datatype.");
- return;
- }
- if (jTextFieldVersion.getText().equals(ffc.getFpdHdrVer())) {
- return;
- }
- ffc.setFpdHdrVer(jTextFieldVersion.getText());
- }
- });
- }
- return jTextFieldVersion;
- }
-
- /**
- This method initializes jButtonGenerateGuid
-
- @return javax.swing.JButton jButtonGenerateGuid
-
- **/
- private JButton getJButtonGenerateGuid() {
- if (jButtonGenerateGuid == null) {
- jButtonGenerateGuid = new JButton();
- jButtonGenerateGuid.setBounds(new java.awt.Rectangle(valueColumn + shortValueWidth + 5, rowTwo, buttonWidth, oneRowHeight));
- jButtonGenerateGuid.setText("GEN");
- jButtonGenerateGuid.addActionListener(this);
- }
- return jButtonGenerateGuid;
- }
-
- /**
- This method initializes jTextAreaLicense
-
- @return javax.swing.JTextArea jTextAreaLicense
-
- **/
- private JTextArea getJTextAreaLicense() {
- if (jTextAreaLicense == null) {
- jTextAreaLicense = new JTextArea();
- jTextAreaLicense.setText("");
- jTextAreaLicense.setLineWrap(true);
- jTextAreaLicense.getDocument().addDocumentListener(this);
- jTextAreaLicense.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (jTextAreaLicense.getText().length() == 0) {
- JOptionPane.showMessageDialog(FpdHeader.this, "License must be entered!");
- return;
- }
- if (jTextAreaLicense.getText().equals(ffc.getFpdHdrLicense())) {
- return;
- }
- ffc.setFpdHdrLicense(jTextAreaLicense.getText());
- }
- });
- }
- return jTextAreaLicense;
- }
-
- /**
- This method initializes jTextAreaDescription
-
- @return javax.swing.JTextArea jTextAreaDescription
-
- **/
- private JTextArea getJTextAreaDescription() {
- if (jTextAreaDescription == null) {
- jTextAreaDescription = new JTextArea();
- jTextAreaDescription.setLineWrap(true);
- jTextAreaDescription.getDocument().addDocumentListener(this);
- jTextAreaDescription.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (jTextAreaDescription.getText().length() == 0) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Description must be entered.");
- return;
- }
- if (jTextAreaDescription.getText().equals(ffc.getFpdHdrDescription())) {
- return;
- }
- ffc.setFpdHdrDescription(jTextAreaDescription.getText());
- }
- });
- }
- return jTextAreaDescription;
- }
-
- /**
- This method initializes jTextFieldSpecification
-
- @return javax.swing.JTextField jTextFieldSpecification
-
- **/
- private JTextField getJTextFieldSpecification() {
- if (jTextFieldSpecification == null) {
- jTextFieldSpecification = new JTextField();
- jTextFieldSpecification.setBounds(new java.awt.Rectangle(labelColumn,rowNine,specWidth,oneRowHeight));
- jTextFieldSpecification.setEditable(false);
- jTextFieldSpecification.setPreferredSize(new java.awt.Dimension(specWidth,oneRowHeight));
- jTextFieldSpecification.setBorder(null);
-// jTextFieldSpecification.addFocusListener(new FocusAdapter(){
-// public void focusLost(FocusEvent e) {
-// ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
-// }
-// });
- }
- return jTextFieldSpecification;
- }
-
- /**
- This method initializes jButtonOk
-
- @return javax.swing.JButton jButtonOk
-
- **/
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setText("OK");
- jButtonOk.setBounds(new java.awt.Rectangle(290,351,90,20));
- jButtonOk.setVisible(false);
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- This method initializes jButtonCancel
-
- @return javax.swing.JButton jButtonCancel
-
- **/
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setText("Cancel");
- jButtonCancel.setBounds(new java.awt.Rectangle(390,351,90,20));
- jButtonCancel.setVisible(false);
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- This method initializes jScrollPaneLicense
-
- @return javax.swing.JScrollPane jScrollPaneLicense
-
- **/
- private JScrollPane getJScrollPaneLicense() {
- if (jScrollPaneLicense == null) {
- jScrollPaneLicense = new JScrollPane();
- jScrollPaneLicense.setBounds(new java.awt.Rectangle(valueColumn,rowFive,valueWidth,fourRowHeight));
- jScrollPaneLicense.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneLicense.setPreferredSize(new java.awt.Dimension(valueWidth,fourRowHeight));
- jScrollPaneLicense.setViewportView(getJTextAreaLicense());
- }
- return jScrollPaneLicense;
- }
-
- /**
- This method initializes jScrollPaneDescription
-
- @return javax.swing.JScrollPane jScrollPaneDescription
-
- **/
- private JScrollPane getJScrollPaneDescription() {
- if (jScrollPaneDescription == null) {
- jScrollPaneDescription = new JScrollPane();
- jScrollPaneDescription.setBounds(new java.awt.Rectangle(valueColumn,rowEight,valueWidth,fourRowHeight));
- jScrollPaneDescription.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneDescription.setPreferredSize(new java.awt.Dimension(valueWidth, fourRowHeight));
- jScrollPaneDescription.setViewportView(getJTextAreaDescription());
- }
- return jScrollPaneDescription;
- }
-
- /**
- This method initializes jTextFieldAbstract
-
- @return javax.swing.JTextField jTextFieldAbstract
-
- **/
- private JTextField getJTextFieldAbstract() {
- if (jTextFieldAbstract == null) {
- jTextFieldAbstract = new JTextField();
- jTextFieldAbstract.setBounds(new java.awt.Rectangle(valueColumn,rowSeven,valueWidth,oneRowHeight));
- jTextFieldAbstract.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jTextFieldAbstract.getDocument().addDocumentListener(this);
- jTextFieldAbstract.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isAbstract(jTextFieldAbstract.getText())) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Abstract must be entered.");
- return;
- }
- if (jTextFieldAbstract.getText().equals(ffc.getFpdHdrAbs())) {
- return;
- }
- ffc.setFpdHdrAbs(jTextFieldAbstract.getText());
- }
- });
- }
- return jTextFieldAbstract;
- }
-
- private JScrollPane getCopyrightScrollPane() {
- if (jCopyrightScrollPane == null) {
- jCopyrightScrollPane = new JScrollPane();
- jCopyrightScrollPane.setBounds(new java.awt.Rectangle(valueColumn, rowFour, valueWidth, threeRowHeight));
- jCopyrightScrollPane.setHorizontalScrollBarPolicy(javax.swing.JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jCopyrightScrollPane.setPreferredSize(new java.awt.Dimension(valueWidth, threeRowHeight));
- jCopyrightScrollPane.setViewportView(getJCopyrightTextArea());
- }
- return jCopyrightScrollPane;
- }
- /**
- This method initializes jTextFieldCopyright
-
- @return javax.swing.JTextField jTextFieldCopyright
-
- **/
- private JTextArea getJCopyrightTextArea() {
- if (jCopyrightTextArea == null) {
- jCopyrightTextArea = new JTextArea();
- jCopyrightTextArea.setWrapStyleWord(true);
- jCopyrightTextArea.setLineWrap(true);
- jCopyrightTextArea.getDocument().addDocumentListener(this);
- jCopyrightTextArea.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e) {
- if (!DataValidation.isCopyright(jCopyrightTextArea.getText())) {
- JOptionPane.showMessageDialog(FpdHeader.this, "Copyright must be entered.");
- return;
- }
- if (jCopyrightTextArea.getText().equals(ffc.getFpdHdrCopyright())) {
- return;
- }
- ffc.setFpdHdrCopyright(jCopyrightTextArea.getText());
- }
- });
- }
- return jCopyrightTextArea;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldUrl() {
- if (jTextFieldUrl == null) {
- jTextFieldUrl = new JTextField();
- jTextFieldUrl.setBounds(new java.awt.Rectangle(valueColumn,rowSix,valueWidth,oneRowHeight));
- jTextFieldUrl.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
- jTextFieldUrl.getDocument().addDocumentListener(this);
- jTextFieldUrl.addFocusListener(new FocusAdapter(){
- public void focusLost(FocusEvent e){
- if (jTextFieldUrl.getText().length() == 0 && ffc.getFpdHdrUrl() == null) {
- return;
- }
- if (jTextFieldUrl.getText().equals(ffc.getFpdHdrUrl())) {
- return;
- }
- ffc.setFpdHdrLicense(jTextAreaLicense.getText());
- ffc.setFpdHdrUrl(jTextFieldUrl.getText());
- }
- });
- }
- return jTextFieldUrl;
- }
-
- public static void main(String[] args) {
- new FpdHeader().setVisible(true);
- }
-
- /**
- This is the default constructor
-
- **/
- public FpdHeader() {
- super();
- init();
- this.setVisible(true);
- }
-
- /**
- This is the override edit constructor
-
- @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
-
- **/
- public FpdHeader(PlatformSurfaceAreaDocument.PlatformSurfaceArea inFpd) {
- this();
- ffc = new FpdFileContents(inFpd);
- init(ffc);
-
- }
-
- public FpdHeader(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- if (amended) {
- docConsole.setSaved(false);
- amended = false;
- }
- }
-
- /**
- This method initializes this
-
- **/
- private void init() {
- //this.setSize(500, 515);
- this.setContentPane(getJContentPane());
- this.setTitle("Platform Surface Area Header");
- initFrame();
-
- }
-
- /**
- This method initializes this
- Fill values to all fields if these values are not empty
-
- @param inFpdHeader The input data of FpdHeaderDocument.FpdHeader
-
- **/
- private void init(FpdFileContents ffc) {
-
- if (ffc.getFpdHdrPlatformName() != null) {
- jTextFieldBaseName.setText(ffc.getFpdHdrPlatformName());
- }
- if (ffc.getFpdHdrGuidValue() != null) {
- jTextFieldGuid.setText(ffc.getFpdHdrGuidValue());
- }
- if (ffc.getFpdHdrVer() != null) {
- jTextFieldVersion.setText(ffc.getFpdHdrVer());
- }
- if (ffc.getFpdHdrLicense() != null) {
- jTextAreaLicense.setText(ffc.getFpdHdrLicense());
- }
- if (ffc.getFpdHdrAbs() != null) {
- jTextFieldAbstract.setText(ffc.getFpdHdrAbs());
- }
- if (ffc.getFpdHdrUrl() != null) {
- jTextFieldUrl.setText(ffc.getFpdHdrUrl());
- }
- if (ffc.getFpdHdrCopyright() != null) {
- jCopyrightTextArea.setText(ffc.getFpdHdrCopyright());
- }
- if (ffc.getFpdHdrDescription() != null) {
- jTextAreaDescription.setText(ffc.getFpdHdrDescription());
- }
- if (ffc.getFpdHdrSpec() != null) {
- jTextFieldSpecification.setText(ffc.getFpdHdrSpec());
- }
- ffc.setFpdHdrSpec(jTextFieldSpecification.getText());
-
- if (ffc.getPlatformDefsSkuInfoCount() == 0) {
- ffc.genPlatformDefsSkuInfo("0", "DEFAULT");
- amended = true;
- JOptionPane.showMessageDialog(this, "Default SKU set for this platform.");
- }
- Vector<Object> v = new Vector<Object>();
- ffc.getPlatformDefsSupportedArchs(v);
- if (v.size() == 0) {
- v.add("IA32");
- ffc.setPlatformDefsSupportedArchs(v);
- amended = true;
- JOptionPane.showMessageDialog(this, "Supported Arch. IA32 added for this platform.");
- }
- v.removeAllElements();
- ffc.getPlatformDefsBuildTargets(v);
- if (v.size() == 0) {
- v.add("DEBUG");
- ffc.setPlatformDefsBuildTargets(v);
- amended = true;
- JOptionPane.showMessageDialog(this, "Build target IA32 added for this platform.");
- }
- if (ffc.getPlatformDefsInterDir() == null) {
- ffc.setPlatformDefsInterDir("UNIFIED");
- amended = true;
- JOptionPane.showMessageDialog(this, "UNIFIED Intermediate Directory set for this platform.");
- }
- }
-
- /**
- This method initializes jContentPane
-
- @return javax.swing.JPanel jContentPane
-
- **/
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setLocation(new java.awt.Point(0, 0));
- jContentPane.setSize(new java.awt.Dimension(dialogWidth - 20 ,dialogHeight - 20));
-
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(labelColumn,rowSix,labelWidth,oneRowHeight));
- jLabel.setText("URL");
- jLabelAbstract = new JLabel();
- jLabelAbstract.setBounds(new java.awt.Rectangle(labelColumn,rowSeven,labelWidth,oneRowHeight));
- jLabelAbstract.setText("Abstract");
- jLabelDescription = new JLabel();
- jLabelDescription.setText("Description");
- jLabelDescription.setBounds(new java.awt.Rectangle(labelColumn,rowEight,labelWidth,oneRowHeight));
- jLabelCopyright = new JLabel();
- jLabelCopyright.setText("Copyright");
- jLabelCopyright.setBounds(new java.awt.Rectangle(labelColumn,rowFour,labelWidth,oneRowHeight));
- jLabelLicense = new JLabel();
- jLabelLicense.setText("License");
- jLabelLicense.setBounds(new java.awt.Rectangle(labelColumn,rowFive,labelWidth,oneRowHeight));
- jLabelVersion = new JLabel();
- jLabelVersion.setText("Version");
- jLabelVersion.setBounds(new java.awt.Rectangle(labelColumn, rowThree, labelWidth, oneRowHeight));
- jLabelGuid = new JLabel();
- jLabelGuid.setPreferredSize(new java.awt.Dimension(labelWidth, oneRowHeight));
- jLabelGuid.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
- jLabelGuid.setText("Guid");
- jLabelBaseName = new JLabel();
- jLabelBaseName.setText("Platform Name");
- jLabelBaseName.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
- jStarLabel1 = new StarLabel();
- jStarLabel1.setLocation(new java.awt.Point(0, rowOne));
- jStarLabel2 = new StarLabel();
- jStarLabel2.setLocation(new java.awt.Point(0, rowTwo));
- jStarLabel3 = new StarLabel();
- jStarLabel3.setLocation(new java.awt.Point(0, rowThree));
- jStarLabel4 = new StarLabel();
- jStarLabel4.setLocation(new java.awt.Point(0,rowFour));
- jStarLabel5 = new StarLabel();
- jStarLabel5.setLocation(new java.awt.Point(0,rowFive));
- jStarLabel7 = new StarLabel();
- jStarLabel7.setLocation(new java.awt.Point(0,rowSeven));
- jStarLabel8 = new StarLabel();
- jStarLabel8.setLocation(new java.awt.Point(0,rowEight));
-
- jContentPane.add(jLabelBaseName, null);
- jContentPane.add(getJTextFieldBaseName(), null);
- jContentPane.add(jLabelGuid, null);
- jContentPane.add(getJTextFieldGuid(), null);
- jContentPane.add(jLabelVersion, null);
- jContentPane.add(getJTextFieldVersion(), null);
- jContentPane.add(getJButtonGenerateGuid(), null);
- jContentPane.add(jLabelLicense, null);
- jContentPane.add(jLabelCopyright, null);
- jContentPane.add(jLabelDescription, null);
- jContentPane.add(getJTextFieldSpecification(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJScrollPaneLicense(), null);
- jContentPane.add(getJScrollPaneDescription(), null);
- jContentPane.add(jLabelAbstract, null);
- jContentPane.add(getJTextFieldAbstract(), null);
-
- jContentPane.add(jStarLabel1, null);
- jContentPane.add(jStarLabel2, null);
- jContentPane.add(jStarLabel3, null);
- jContentPane.add(jStarLabel4, null);
- jContentPane.add(jStarLabel5, null);
- jContentPane.add(jStarLabel7, null);
- jContentPane.add(jStarLabel8, null);
- jContentPane.add(getCopyrightScrollPane(), null);
-
- jContentPane.add(jLabel, null);
- jContentPane.add(getJTextFieldUrl(), null);
- }
- return jContentPane;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonGenerateGuid) {
- jTextFieldGuid.setText(Tools.generateUuidString());
- ffc.setFpdHdrGuidValue(jTextFieldGuid.getText());
- }
- }
-
-
- /**
- This method initializes Package type and Compontent type
-
- **/
- private void initFrame() {
-
-
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ComponentListener#componentResized(java.awt.event.ComponentEvent)
- *
- * Override componentResized to resize all components when frame's size is changed
- */
- public void componentResized(ComponentEvent arg0) {
- int intPreferredWidth = dialogWidth;
- int intCurrentWidth = this.getJContentPane().getWidth();
-
- // Tools.resizeComponentWidth(this.jTextFieldBaseName, this.getWidth(), intPreferredWidth);
- // Tools.resizeComponentWidth(this.jTextFieldGuid, this.getWidth(), intPreferredWidth);
-// Tools.relocateComponentX(this.jButtonGenerateGuid, this.getWidth(), jButtonGenerateGuid.getWidth(), 25);
- // Tools.resizeComponentWidth(this.jTextFieldVersion, this.getWidth(), intPreferredWidth);
- // Tools.resizeComponentWidth(this.jTextFieldCopyright, this.getWidth(), intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneLicense, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldUrl, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jTextFieldAbstract, intCurrentWidth, intPreferredWidth);
- Tools.resizeComponentWidth(this.jScrollPaneDescription, intCurrentWidth, intPreferredWidth);
- // Tools.resizeComponentWidth(this.jTextFieldSpecification, this.getWidth(), intPreferredWidth);
-
-
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#changedUpdate(javax.swing.event.DocumentEvent)
- */
- public void changedUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#insertUpdate(javax.swing.event.DocumentEvent)
- */
- public void insertUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-
- /* (non-Javadoc)
- * @see javax.swing.event.DocumentListener#removeUpdate(javax.swing.event.DocumentEvent)
- */
- public void removeUpdate(DocumentEvent arg0) {
- // TODO Auto-generated method stub
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
deleted file mode 100644
index b2d577e4dd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdModuleSA.java
+++ /dev/null
@@ -1,2240 +0,0 @@
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JDialog;
-import javax.swing.JTabbedPane;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.JTextArea;
-import javax.swing.JSplitPane;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableColumn;
-import javax.swing.table.TableModel;
-
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.DataValidation;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.IDefaultTableModel;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.platform.ui.global.LibraryClassDescriptor;
-import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
-import org.tianocore.frameworkwizard.platform.ui.global.SurfaceAreaQuery;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Set;
-import java.util.Stack;
-import java.util.Vector;
-
-import javax.swing.JTextField;
-import java.awt.GridLayout;
-import javax.swing.JComboBox;
-
-public class FpdModuleSA extends JDialog implements ActionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private JPanel jContentPane = null;
- private JTabbedPane jTabbedPane = null;
- private JPanel jPanelPcd = null;
- private JPanel jPanelLibrary = null;
- private JLabel jLabelPcdData = null;
- private JScrollPane jScrollPaneTablePcd = null;
- private JTable jTablePcd = null;
- private JPanel jPanelPcdSouth = null;
- private JScrollPane jScrollPanePcdHelp = null;
- private JTextArea jTextAreaPcdHelp = null;
- private JPanel jPanelContentPaneSouth = null;
- private JSplitPane jSplitPane = null;
- private JPanel jPanelLibraryLeft = null;
- private JPanel jPanelLibraryRight = null;
- private JLabel jLabelLibClass = null;
- private JLabel jLabelQualifiedInstance = null;
- private JScrollPane jScrollPaneSelectedInstances = null;
- private JTable jTableSelectedInstances = null;
- private JScrollPane jScrollPaneLibClass = null;
- private JTable jTableLibClass = null;
- private JScrollPane jScrollPaneQualifiedInstance = null;
- private JTable jTableLibInstances = null;
- private JPanel jPanelLibrarySouth = null;
- private JPanel jPanelLibraryCenter = null;
- private JScrollPane jScrollPaneInstanceHelp = null;
- private JTextArea jTextAreaInstanceHelp = null;
- private JLabel jLabelSelectedInstances = null;
- private JLabel jLabelInstanceHelp = null;
- private JButton jButtonAdd = null;
- private JButton jButtonDeleteInstance = null;
- private JLabel jLabelPcdHelp = null;
- private JButton jButtonOk = null;
- private JButton jButtonCancel = null;
- private IDefaultTableModel model = null;
- private IDefaultTableModel selectedInstancesTableModel = null;
- private IDefaultTableModel libClassTableModel = null;
- private IDefaultTableModel libInstanceTableModel = null;
- private DefaultTableModel optionsTableModel = null;
- private FpdFileContents ffc = null;
- private String moduleKey = null;
- private ModuleIdentification moduleId = null;
- private HashMap<LibraryClassDescriptor, ArrayList<String>> classInstanceMap = null;
- //
- // map of <{libName, supArch, supMod}, list of Module information>
- //
- private HashMap<LibraryClassDescriptor, ArrayList<String>> classConsumed = null;
- private HashMap<LibraryClassDescriptor, ArrayList<String>> classProduced = null;
-
- private JPanel jPanelModuleSaOpts = null;
- private JLabel jLabelFvBinding = null;
- private JTextField jTextFieldFvBinding = null;
- private JLabel jLabelFfsFileGuid = null;
- private JTextField jTextFieldFileGuid = null;
- private JLabel jLabelFfsFormatKey = null;
- private JTextField jTextFieldFfsKey = null;
- private JScrollPane jScrollPaneModuleSaOptions = null;
- private JTable jTableModuleSaOptions = null;
- private JButton jButtonNew = null;
- private JButton jButtonDeleteOption = null;
- private JPanel jPanelPcdFields = null;
- private JPanel jPanelPcdFieldsSecondRow = null;
- private JPanel jPanelPcdFieldsThirdRow = null;
- private JPanel jPanelPcdFieldsFirstRow = null;
- private JLabel jLabelItemType = null;
- private JComboBox jComboBoxItemType = null;
- private JLabel jLabelMaxDatumSize = null;
- private JTextField jTextFieldMaxDatumSize = null;
- private JLabel jLabelPcdDefaultValue = null;
- private JTextField jTextFieldPcdDefault = null;
- private JButton jButtonUpdatePcd = null;
- private JComboBox jComboBoxFeatureFlagValue = null;
- private OpeningPlatformType docConsole = null;
- private JPanel jPanelCustomToolChain = null;
- private JPanel jPanelToolchainS = null;
- private JPanel jPanelLibraryCenterN = null;
- private JPanel jPanelLibraryCenterC = null; // @jve:decl-index=0:visual-constraint="20,224"
-
- private final int buildTargetWidth = 150;
- private final int toolChainFamilyWidth = 150;
- private final int supportArchWidth = 150;
- private final int toolCmdCodeWidth = 200;
- private final int tagNameWidth = 150;
- private final int argWidth = 400;
-
- /**
- * This is the default constructor
- */
- public FpdModuleSA() {
- super(FrameworkWizardUI.getInstance());
- initialize();
- }
- public FpdModuleSA(FpdFileContents ffc) {
- this();
- this.ffc = ffc;
- }
-
- public void setKey(String k, int i, OpeningPlatformType dc){
- this.moduleKey = k;
- this.docConsole = dc;
- classInstanceMap = null;
- classProduced = null;
- classConsumed = null;
- int tabIndex = jTabbedPane.indexOfTab("FV Info");
- jTabbedPane.setSelectedIndex(tabIndex);
- initFvInfo(moduleKey);
- initPcdBuildDefinition(moduleKey);
- moduleId = WorkspaceProfile.getModuleId(moduleKey);
- if (moduleId == null) {
- return;
- }
- tabIndex = jTabbedPane.indexOfTab("Libraries");
- if (moduleId.isLibrary()) {
- jTabbedPane.setEnabledAt(tabIndex, false);
- }
- else {
- jTabbedPane.setEnabledAt(tabIndex, true);
- }
- }
-
- /**
- init will be called each time FpdModuleSA object is to be shown.
- @param key Module information.
- **/
- public void initPcdBuildDefinition(String key) {
- //
- // display pcd for key.
- //
- model.setRowCount(0);
- jTextAreaPcdHelp.setText("");
- jComboBoxItemType.setSelectedIndex(-1);
- jTextFieldMaxDatumSize.setText("");
- jTextFieldPcdDefault.setText("");
- int pcdCount = ffc.getPcdDataCount(key);
- if (pcdCount != 0) {
- String[][] saa = new String[pcdCount][7];
- ffc.getPcdData(key, saa);
- for (int j = 0; j < saa.length; ++j) {
- model.addRow(saa[j]);
- }
- }
- }
-
- public void initLibraries(String key) {
- libClassTableModel.setRowCount(0);
- libInstanceTableModel.setRowCount(0);
- selectedInstancesTableModel.setRowCount(0);
- Vector<String> errorMsg = new Vector<String>();
- Vector<ModuleIdentification> newInstances = new Vector<ModuleIdentification>();
-
- addConsumedClassFromModule (key);
- addProducedClassFromModule (key);
-
- int instanceCount = ffc.getLibraryInstancesCount(key);
- if (instanceCount != 0) {
- String[][] saa = new String[instanceCount][5];
- ffc.getLibraryInstances(key, saa);
- for (int i = 0; i < saa.length; ++i) {
- String libInstanceKey = saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(libInstanceKey);
- if (mi != null) {
- //
- // ToDo: verify this instance first.
- //
- saa[i][0] = mi.getName();
- saa[i][2] = mi.getVersion();
- saa[i][4] = mi.getPackageId().getVersion();
- //
- // re-evaluate lib instance usage when adding a already-selected lib instance.
- //
- addConsumedClassFromModule (libInstanceKey);
- addProducedClassFromModule (libInstanceKey);
- selectedInstancesTableModel.addRow(saa[i]);
- }
- }
- }
-
- Set<LibraryClassDescriptor> sLcd = this.classConsumed.keySet();
- Iterator<LibraryClassDescriptor> iter = sLcd.iterator();
- Stack<LibraryClassDescriptor> lcdStack = new Stack<LibraryClassDescriptor>();
- while (iter.hasNext()) {
- LibraryClassDescriptor lcd = iter.next();
- if (this.classConsumed.get(lcd) == null || this.classConsumed.get(lcd).size() == 0) {
- continue;
- }
- if (isBoundedClass(lcd, errorMsg)) {
- continue;
- }
-
- if (!lcdStack.contains(lcd)) {
- lcdStack.push(lcd);
- }
- }
-
- try {
- resolveLibraryInstances(lcdStack, true, errorMsg, newInstances);
- } catch (Exception e) {
- String exceptionMsg = e.getCause() + " " + e.getMessage();
- if (!errorMsg.contains(exceptionMsg)) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), e.getCause() + " " + e.getMessage());
- }
- }
-
- String newInstancesAddedMsg = "Library instance automatically added to this module :\n";
- for (int i = 0; i < newInstances.size(); ++i) {
- ModuleIdentification libMi = newInstances.get(i);
- newInstancesAddedMsg += libMi.getName();
- newInstancesAddedMsg += " ";
- }
- if (newInstances.size() > 0) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), newInstancesAddedMsg);
- }
-
- showClassToResolved();
-
- if (errorMsg.size() > 0) {
- String errors = "";
- for (int i = 0; i < errorMsg.size(); ++i) {
- errors += " " + errorMsg.get(i) + "\n";
- }
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), errors);
- }
- }
-
- public void initFvInfo (String key) {
- //
- // display module SA options
- //
- jTextFieldFvBinding.setText("");
- String fvBinding = ffc.getFvBinding(key);
- if (fvBinding != null) {
- jTextFieldFvBinding.setText(fvBinding);
- }
- jTextFieldFileGuid.setText("");
- String fileGuid = ffc.getFfsFileNameGuid(key);
- if (fileGuid != null) {
- jTextFieldFileGuid.setText(fileGuid);
- }
- jTextFieldFfsKey.setText("");
- String ffsKey = ffc.getFfsFormatKey(key);
- if (ffsKey != null) {
- jTextFieldFfsKey.setText(ffsKey);
- }
- }
-
- public void initToolChainOptions(String key) {
-
- optionsTableModel.setRowCount(0);
- String[][] saa = new String[ffc.getModuleSAOptionsCount(key)][6];
- ffc.getModuleSAOptions(key, saa);
- for (int i = 0; i < saa.length; ++i) {
- optionsTableModel.addRow(saa[i]);
- }
- }
-
- private void filterClassConsumedByArch (Vector<LibraryClassDescriptor> v) {
- String[] moduleInfo = moduleKey.split(" ");
- Vector<String> vModuleArchs = new Vector<String>();
- //
- // Skip guid, version information, get archs to check.
- //
- for (int i = 4; i < moduleInfo.length; ++i) {
- vModuleArchs.add(moduleInfo[i]);
- }
- //
- // if module will be built on all platforms, no filter needed for lib classes.
- //
- if (vModuleArchs.size() == 0) {
- return;
- }
-
- Iterator<LibraryClassDescriptor> iter = v.iterator();
- while (iter.hasNext()) {
- LibraryClassDescriptor libInfo = iter.next();
-
- Vector<String> vSupArchs = libInfo.getVectorFromString(libInfo.supArchs);
-
- if (vSupArchs.size() == 0 || (vSupArchs.size() == 1 && vSupArchs.get(0).equalsIgnoreCase(""))) {
- //
- // update lib info to module archs only.
- //
- libInfo.supArchs = "";
- for (int i = 0; i < vModuleArchs.size(); ++i) {
- libInfo.supArchs += vModuleArchs.get(i);
- libInfo.supArchs += " ";
- }
- libInfo.supArchs.trim();
- continue;
- }
- //
- // only retain those lib class used by module archs.
- //
- vSupArchs.retainAll(vModuleArchs);
- if (vSupArchs.size() > 0) {
- //
- // update lib info to reflect which kind of arch need to select instance.
- //
- libInfo.supArchs = "";
- for (int i = 0; i < vSupArchs.size(); ++i) {
- libInfo.supArchs += vSupArchs.get(i);
- libInfo.supArchs += " ";
- }
- libInfo.supArchs.trim();
- continue;
- }
- //
- // remove this lib definition if it supports no archs module will be built under.
- //
- iter.remove();
- }
- }
-
- private void addProducedClassFromModule (String key) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(key);
- Vector<LibraryClassDescriptor> vClassProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);
- if (this.classProduced == null) {
- this.classProduced = new HashMap<LibraryClassDescriptor, ArrayList<String>>();
- }
- for (int i = 0; i < vClassProduced.size(); ++i) {
- ArrayList<String> producedBy = this.classProduced.get(vClassProduced.get(i));
- if (producedBy == null) {
- producedBy = new ArrayList<String>();
- }
- //
- // class already produced by previous module (lib instance).
- /*
- if (producedBy.size() == 1) {
- String instanceKey = producedBy.get(0);
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey);
- throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName());
- }
- Iterator<LibraryClassDescriptor> lcdi = this.classProduced.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if (vClassProduced.get(i).hasInterSectionWith(lcd)) {
- ArrayList<String> alreadyProducedBy = this.classProduced.get(lcd);
- String instanceKey = alreadyProducedBy.get(0);
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceKey);
- throw new MultipleInstanceException (vClassProduced.get(i).className, libMi.getName(), mi.getName());
- }
- }
- */
- // normal case.
- //
- producedBy.add(key);
- this.classProduced.put(vClassProduced.get(i), producedBy);
-
- }
- }
-
- private Vector<LibraryClassDescriptor> addConsumedClassFromModule (String key) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(key);
-// PackageIdentification[] depPkgList = null;
-
- //
- // Get dependency pkg list into which we will search lib instances.
- //
- //depPkgList = SurfaceAreaQuery.getDependencePkg(null, mi);
- //
- // Get the lib class consumed, produced by this module itself.
- //
- Vector<LibraryClassDescriptor> vClassConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi);
- for (int i = 0; i < vClassConsumed.size(); ++i) {
- vClassConsumed.get(i).supModTypes = WorkspaceProfile.getModuleType(moduleId);
- }
- filterClassConsumedByArch(vClassConsumed);
- if (this.classConsumed == null) {
- this.classConsumed = new HashMap<LibraryClassDescriptor, ArrayList<String>>();
- }
-
- for (int i = 0; i < vClassConsumed.size(); ++i) {
- ArrayList<String> consumedBy = this.classConsumed.get(vClassConsumed.get(i));
- if (consumedBy == null) {
- consumedBy = new ArrayList<String>();
- }
- consumedBy.add(key);
- this.classConsumed.put(vClassConsumed.get(i), consumedBy);
- }
-
- return vClassConsumed;
- }
-
- private void resolveLibraryInstances(Stack<LibraryClassDescriptor> lcdStack, boolean autoSelectSingleInstance, Vector<String> errorMsg, Vector<ModuleIdentification> newInstances) throws MultipleInstanceException, NoInstanceException{
-
- if (classInstanceMap == null) {
- classInstanceMap = new HashMap<LibraryClassDescriptor, ArrayList<String>>();
- }
- while (!lcdStack.empty()) {
- LibraryClassDescriptor cls = lcdStack.pop();
- if (isBoundedClass(cls, errorMsg)) {
- continue;
- }
- ArrayList<String> instances = getInstancesForClass(cls, null);
- if (instances.size() == 0) {
-// throw new NoInstanceException (cls.className);
- String exceptionMsg = new NoInstanceException (cls.className).getMessage();
- if (!errorMsg.contains(exceptionMsg)) {
- errorMsg.add(exceptionMsg);
- }
-
- }
- classInstanceMap.put(cls, instances);
- if (instances.size() == 1 && autoSelectSingleInstance) {
- String instanceInfo = instances.get(0);
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(instanceInfo);
- try {
- Object[] row = {libMi.getName(), libMi.getGuid(), libMi.getVersion(),
- libMi.getPackageId().getGuid(), libMi.getPackageId().getVersion()};
- if (!ffc.instanceExistsInModuleSA(moduleKey, row[1]+"", row[2]+"", row[3]+"", row[4]+"")) {
- addLibInstance(libMi);
- newInstances.add(libMi);
- docConsole.setSaved(false);
- selectedInstancesTableModel.addRow(row);
- addProducedClassFromModule (instanceInfo);
- Vector<LibraryClassDescriptor> vLcd = addConsumedClassFromModule(instanceInfo);
- for (int i = 0; i < vLcd.size(); ++i) {
- LibraryClassDescriptor lcd = vLcd.get(i);
- if (!lcdStack.contains(lcd)) {
- lcdStack.push(lcd);
- }
- }
- }
- }
- catch (Exception e) {
- if (!errorMsg.contains(e.getMessage())) {
- errorMsg.add(e.getMessage());
- }
- }
- }
- }
- }
-//
-
- /**Search classProduced map to see if this class has been produced by some instance (module).
- * @param cls
- * @return
- */
- private boolean isBoundedClass (LibraryClassDescriptor cls, Vector<String> errorMsg) {
-// if (this.classProduced.containsKey(cls)) {
-// return true;
-// }
- Iterator<LibraryClassDescriptor> lcdi = this.classProduced.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if (cls.className.equals(lcd.className)) {
- if (cls.isSubSetByArchs(lcd) && cls.isSubSetByModTypes(lcd)) {
- return true;
- }
- else {
- ArrayList<String> producedBy = this.classProduced.get(lcd);
- String instancesName = "";
- for (int i = 0; i < producedBy.size(); ++i) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(producedBy.get(i));
- instancesName += mi.getName();
- instancesName += " ";
- }
- String msg = new ImproperInstanceException(lcd.className, instancesName, lcd.supArchs, lcd.supModTypes).getMessage();
- if (!errorMsg.contains(msg)) {
- errorMsg.add(msg);
- }
- }
- }
- }
-
- return false;
- }
-
- private ArrayList<String> getInstancesForClass(LibraryClassDescriptor cls, PackageIdentification[] depPkgList){
- ArrayList<String> al = new ArrayList<String>();
-
-// for (int i = 0; i < depPkgList.length; ++i) {
- Iterator ismi = GlobalData.vModuleList.iterator();
- while(ismi.hasNext()) {
- ModuleIdentification mi = (ModuleIdentification)ismi.next();
-// if (!mi.getPackageId().getGuid().equalsIgnoreCase(depPkgList[i].getGuid())) {
-// continue;
-// }
- Vector<LibraryClassDescriptor> clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);
-
- boolean isPotential = false;
- Iterator<LibraryClassDescriptor> lcdi = clsProduced.iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if (cls.isSubSetByArchs(lcd) && cls.isSubSetByModTypes(lcd)){
- isPotential = true;
- }
-
- if (isPotential && hasBeenProduced(lcd)) {
- isPotential = false;
- break;
- }
- }
- if (isPotential) {
- al.add(mi.getGuid() + " " + mi.getVersion() + " " +
- mi.getPackageId().getGuid() + " " + mi.getPackageId().getVersion());
- }
- }
-// }
-
- return al;
- }
-
- private boolean hasBeenProduced (LibraryClassDescriptor cls) {
- Iterator<LibraryClassDescriptor> lcdi = this.classProduced.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if (cls.isSubSetByArchs(lcd) && cls.isSubSetByModTypes(lcd)) {
- return true;
- }
- }
- return false;
- }
-
- private ArrayList<String> getConsumedBy (String className) {
- Iterator<LibraryClassDescriptor> lcdi = this.classConsumed.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if ((lcd.className != null) && lcd.className.equals(className)) {
- return this.classConsumed.get(lcd);
- }
- }
- return null;
- }
-
- private ArrayList<String> getProducedBy (String className) {
- Iterator<LibraryClassDescriptor> lcdi = this.classProduced.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if ((lcd.className != null) && lcd.className.equals(className)) {
- return this.classProduced.get(lcd);
- }
- }
- return null;
- }
- //
- // Get class name list related with instanceKey from HashMap m<LibraryClass, ArrayList<instanceKey>>.
- //
- private ArrayList<String> getLibraryClassList (String instanceKey, HashMap<LibraryClassDescriptor, ArrayList<String>> m) {
- ArrayList<String> libraryClass = new ArrayList<String>();
- Iterator<LibraryClassDescriptor> lcdi = m.keySet().iterator();
- while (lcdi.hasNext()) {
- LibraryClassDescriptor lcd = lcdi.next();
- if ((m.get(lcd) != null) && m.get(lcd).contains(instanceKey)) {
- libraryClass.add(lcd.className);
- }
- }
- return libraryClass;
- }
-
- private void removeInstance(String key) {
- ModuleIdentification mi = WorkspaceProfile.getModuleId(key);
- //
- // remove pcd information of instance from current ModuleSA
- // Note that Pcd data SHOULD be removed prior to library instance
- // because Multi-Sourced PCD could not be removed, if we remove library instance first,
- // it will impact the judgement of whether a PCD entry is Multi-Sourced.
- //
- ffc.removePcdData(moduleKey, mi);
- ffc.removeLibraryInstance(moduleKey, key);
- //
- // remove class produced by this instance and add back these produced class to be bound.
- //
- Vector<LibraryClassDescriptor> clsProduced = getClassProduced(mi);
- for (int i = 0; i < clsProduced.size(); ++i) {
-
- classProduced.remove(clsProduced.get(i));
- }
- //
- // remove class consumed by this instance. we do not need to bound it now.
- //
- String[] clsConsumed = getClassConsumed(mi);
- for (int i = 0; i < clsConsumed.length; ++i) {
- ArrayList<String> al = getConsumedBy (clsConsumed[i]);
-
- if (al == null ) {
- continue;
- }
- al.remove(key);
- if (al.size() == 0) {
- ArrayList<String> from = getProducedBy (clsConsumed[i]);
- if (from == null) {
- continue;
- }
- boolean noUse = true;
- for (int j = 0; j < from.size(); ++j) {
- ArrayList<String> libClasses = getLibraryClassList(from.get(j), classProduced);
- for (int k = 0; k < libClasses.size(); ++k) {
- if (getConsumedBy (libClasses.get(k)) != null && getConsumedBy (libClasses.get(k)).size() > 0) {
- noUse = false;
- }
- }
- if (noUse) {
- removeInstance(from.get(j));
- }
- noUse = true;
- }
- }
- }
-
- }
-
-
- private Vector<LibraryClassDescriptor> getClassProduced(ModuleIdentification mi){
-
- Vector<LibraryClassDescriptor> clsProduced = SurfaceAreaQuery.getLibraryClasses("ALWAYS_PRODUCED", mi);
- return clsProduced;
-// String[] sClassProduced = new String[clsProduced.size()];
-// for (int i = 0; i < clsProduced.size(); ++i) {
-// sClassProduced[i] = clsProduced.get(i).className;
-// }
-// return sClassProduced;
- }
-
- private String[] getClassConsumed(ModuleIdentification mi){
-
- Vector<LibraryClassDescriptor> clsConsumed = SurfaceAreaQuery.getLibraryClasses("ALWAYS_CONSUMED", mi);
- String[] sClassConsumed = new String[clsConsumed.size()];
- for (int i = 0; i < clsConsumed.size(); ++i) {
- sClassConsumed[i] = clsConsumed.get(i).className;
- }
- return sClassConsumed;
- }
-
- private void showClassToResolved(){
- Vector<String> errorMsg = new Vector<String>();
- libClassTableModel.setRowCount(0);
- libInstanceTableModel.setRowCount(0);
- if (classConsumed == null || classConsumed.size() == 0) {
- return;
- }
-
- Iterator<LibraryClassDescriptor> li = classConsumed.keySet().iterator();
- while(li.hasNext()){
- LibraryClassDescriptor lcd = li.next();
- if (classConsumed.get(lcd) == null || classConsumed.get(lcd).size() == 0) {
- continue;
- }
-
- if (!isBoundedClass(lcd, errorMsg)){
-
- String[] s = { lcd.className, lcd.supArchs, lcd.supModTypes };
- libClassTableModel.addRow(s);
- }
- }
-
- if (errorMsg.size() > 0) {
- String errors = "";
- for (int i = 0; i < errorMsg.size(); ++i) {
- errors += " " + errorMsg.get(i) + "\n";
- }
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), errors);
- }
- }
-
- private String getModuleArch () {
- String arch = "";
- String[] moduleInfo = moduleKey.split(" ");
- for (int i = 4; i < moduleInfo.length; ++i) {
- arch += moduleInfo[i];
- arch += " ";
- }
- return arch.trim();
- }
- private void addLibInstance (ModuleIdentification libMi) throws Exception{
-
- //
- // Add pcd information of selected instance to current moduleSA
- //
- ffc.addFrameworkModulesPcdBuildDefs(libMi, getModuleArch(), ffc.getModuleSA(moduleKey));
-
- ffc.genLibraryInstance(libMi, moduleKey);
- }
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(877, 555);
- this.setResizable(false);
- this.centerWindow();
- this.setModal(true);
- this.setTitle("Module Settings");
- this.setContentPane(getJContentPane());
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- jContentPane.add(getJPanelContentPaneSouth(), java.awt.BorderLayout.SOUTH);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes jTabbedPane
- *
- * @return javax.swing.JTabbedPane
- */
- private JTabbedPane getJTabbedPane() {
- if (jTabbedPane == null) {
- jTabbedPane = new JTabbedPane();
- jTabbedPane.addTab("PCD Build Definition", null, getJPanelPcd(), null);
- jTabbedPane.addTab("Libraries", null, getJPanelLibrary(), null);
- jTabbedPane.addTab("FV Info", null, getJPanelModuleSaOpts(), null);
- jTabbedPane.addTab("Custom Toolchain", null, getJPanelCustomToolChain(), null);
-
- }
- return jTabbedPane;
- }
-
- /**
- * This method initializes jPanelPcd
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelPcd() {
- if (jPanelPcd == null) {
- jLabelPcdData = new JLabel();
- jLabelPcdData.setText(" PCD Data");
- jPanelPcd = new JPanel();
- jPanelPcd.setLayout(new BorderLayout());
- jPanelPcd.add(jLabelPcdData, java.awt.BorderLayout.NORTH);
- jPanelPcd.add(getJScrollPaneTablePcd(), java.awt.BorderLayout.CENTER);
- jPanelPcd.add(getJPanelPcdSouth(), java.awt.BorderLayout.SOUTH);
- jPanelPcd.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent e) {
- initPcdBuildDefinition(moduleKey);
- }
- });
-
- }
- return jPanelPcd;
- }
-
- /**
- * This method initializes jPanelLibrary
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibrary() {
- if (jPanelLibrary == null) {
- jPanelLibrary = new JPanel();
- jPanelLibrary.setLayout(new BorderLayout());
- jPanelLibrary.add(getJSplitPane(), java.awt.BorderLayout.NORTH);
- jPanelLibrary.add(getJPanelLibrarySouth(), java.awt.BorderLayout.SOUTH);
- jPanelLibrary.add(getJPanelLibraryCenter(), java.awt.BorderLayout.CENTER);
- jPanelLibrary.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent e) {
- initLibraries(moduleKey);
- }
- });
- }
- return jPanelLibrary;
- }
-
- /**
- * This method initializes jScrollPaneTablePcd
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneTablePcd() {
- if (jScrollPaneTablePcd == null) {
- jScrollPaneTablePcd = new JScrollPane();
- jScrollPaneTablePcd.setViewportView(getJTablePcd());
- }
- return jScrollPaneTablePcd;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTablePcd() {
- if (jTablePcd == null) {
- model = new IDefaultTableModel();
- jTablePcd = new JTable(model);
- jTablePcd.setRowHeight(20);
- jTablePcd.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_ALL_COLUMNS);
- model.addColumn("CName");
- model.addColumn("TokenSpaceGUID");
- model.addColumn("ItemType");
- model.addColumn("Token");
- model.addColumn("MaxDatumSize");
- model.addColumn("DataType");
- model.addColumn("DefaultValue");
-
- jTablePcd.getColumnModel().getColumn(0).setMinWidth(250);
-
- TableColumn tokenColumn = jTablePcd.getColumnModel().getColumn(3);
- jTablePcd.removeColumn(tokenColumn);
-
- jTablePcd.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTablePcd.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
-
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- int selectedRow = lsm.getMinSelectionIndex();
- String cName = model.getValueAt(selectedRow, 0)+"";
- String tsGuid = model.getValueAt(selectedRow, 1)+"";
- String itemType = model.getValueAt(selectedRow, 2)+"";
- //
- // array for pcd related information: helpText, itemType, moduleType.
- //
- String[] pcdInfo = {"", "", ""};
- Vector<String> validPcdTypes = new Vector<String>();
- getPcdInfo(moduleKey, cName, tsGuid, pcdInfo, validPcdTypes);
- jTextAreaPcdHelp.setText(pcdInfo[0]);
- initComboBox(pcdInfo[1], pcdInfo[2], validPcdTypes);
- jComboBoxItemType.setSelectedItem(itemType);
- jTextFieldMaxDatumSize.setEnabled(true);
- jTextFieldMaxDatumSize.setVisible(true);
- jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+"");
- jTextFieldPcdDefault.setEnabled(true);
- jTextFieldPcdDefault.setText(model.getValueAt(selectedRow, 6)+"");
- if ((model.getValueAt(selectedRow, 5) != null) && model.getValueAt(selectedRow, 5).equals("VOID*")) {
- if (pcdInfo[1].equals("FEATURE_FLAG")) {
- jTextFieldMaxDatumSize.setVisible(false);
- }
- else if (pcdInfo[1].equals("FIXED_AT_BUILD")) {
- try{
- jTextFieldMaxDatumSize.setEnabled(false);
- jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(model.getValueAt(selectedRow, 6)+"")+"");
- }
- catch(Exception except){
- JOptionPane.showMessageDialog(FpdModuleSA.this, "Unacceptable PCD Value: " + except.getMessage());
- }
- }
- else{
- jTextFieldMaxDatumSize.setText(model.getValueAt(selectedRow, 4)+"");
- }
- }
- else {
- jTextFieldMaxDatumSize.setEnabled(false);
- }
-
- if (!model.getValueAt(selectedRow, 2).equals("DYNAMIC") && !model.getValueAt(selectedRow, 2).equals("DYNAMIC_EX")) {
- jTextFieldPcdDefault.setText(model.getValueAt(selectedRow, 6)+"");
- if (model.getValueAt(selectedRow, 2).equals("FEATURE_FLAG")){
- jTextFieldPcdDefault.setVisible(false);
- jComboBoxFeatureFlagValue.setVisible(true);
- jComboBoxFeatureFlagValue.setSelectedItem(model.getValueAt(selectedRow, 6)+"");
- }
- else{
- jTextFieldPcdDefault.setVisible(true);
- jTextFieldPcdDefault.setEnabled(true);
- jComboBoxFeatureFlagValue.setVisible(false);
- }
- }
- else{
- jTextFieldPcdDefault.setEnabled(false);
- }
- }
-
-
- }
- });
-
- }
- return jTablePcd;
- }
-
- private void initComboBox(String originalType, String mType, Vector<String> validPcdTypes) {
- jComboBoxItemType.removeAllItems();
-
- if (originalType.equals("DYNAMIC")) {
- for (int i = 0; i < validPcdTypes.size(); ++i) {
- jComboBoxItemType.addItem(validPcdTypes.get(i));
- }
- }
- else {
- jComboBoxItemType.addItem(originalType);
- }
- }
-
- /**
- * @param cName
- * @param tsGuid
- * @param sa sa[0]: HelpText; sa[1]: itemType in Msa; sa[2]: isBinary;
- */
- private void getPcdInfo(String moduleKey, String cName, String tsGuid, String[] sa, Vector<String> validPcdTypes) {
- String[][] saa = new String[ffc.getLibraryInstancesCount(moduleKey)][5];
- ffc.getLibraryInstances(moduleKey, saa);
-
- try{
- if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(moduleKey), cName, tsGuid, sa, validPcdTypes)) {
- return;
- }
- for (int j = 0; j < saa.length; ++j) {
- if (ffc.getPcdBuildDataInfo(WorkspaceProfile.getModuleId(saa[j][1] + " " + saa[j][2] + " " + saa[j][3] + " " + saa[j][4]),
- cName, tsGuid, sa, validPcdTypes)) {
- return;
- }
- }
- }
- catch(Exception e) {
- JOptionPane.showMessageDialog(this, "Get PCD details fail: " + e.getMessage());
- }
- }
-
- /**
- * This method initializes jPanelPcdSouth
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelPcdSouth() {
- if (jPanelPcdSouth == null) {
- jLabelPcdHelp = new JLabel();
- jLabelPcdHelp.setText("PCD Description");
- jPanelPcdSouth = new JPanel();
- jPanelPcdSouth.setPreferredSize(new java.awt.Dimension(607,200));
- jPanelPcdSouth.add(jLabelPcdHelp, null);
- jPanelPcdSouth.add(getJScrollPanePcdHelp(), null);
- jPanelPcdSouth.add(getJPanelPcdFields(), null);
- }
- return jPanelPcdSouth;
- }
-
- /**
- * This method initializes jScrollPanePcdHelp
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPanePcdHelp() {
- if (jScrollPanePcdHelp == null) {
- jScrollPanePcdHelp = new JScrollPane();
- jScrollPanePcdHelp.setPreferredSize(new java.awt.Dimension(500,100));
- jScrollPanePcdHelp.setViewportView(getJTextAreaPcdHelp());
- }
- return jScrollPanePcdHelp;
- }
-
- /**
- * This method initializes jTextAreaPcdHelp
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaPcdHelp() {
- if (jTextAreaPcdHelp == null) {
- jTextAreaPcdHelp = new JTextArea();
- jTextAreaPcdHelp.setEditable(false);
- }
- return jTextAreaPcdHelp;
- }
-
- /**
- * This method initializes jPanelContentPaneSouth
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentPaneSouth() {
- if (jPanelContentPaneSouth == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelContentPaneSouth = new JPanel();
- jPanelContentPaneSouth.setLayout(flowLayout);
- jPanelContentPaneSouth.add(getJButtonOk(), null);
- jPanelContentPaneSouth.add(getJButtonCancel(), null);
- }
- return jPanelContentPaneSouth;
- }
-
- /**
- * This method initializes jSplitPane
- *
- * @return javax.swing.JSplitPane
- */
- private JSplitPane getJSplitPane() {
- if (jSplitPane == null) {
- jSplitPane = new JSplitPane();
- jSplitPane.setDividerLocation(200);
- jSplitPane.setLeftComponent(getJPanelLibraryLeft());
- jSplitPane.setRightComponent(getJPanelLibraryRight());
- jSplitPane.setPreferredSize(new java.awt.Dimension(202,200));
- }
- return jSplitPane;
- }
-
- /**
- * This method initializes jPanelLibraryLeft
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibraryLeft() {
- if (jPanelLibraryLeft == null) {
- jLabelLibClass = new JLabel();
- jLabelLibClass.setText("Library Classes Uninstantiated");
- jPanelLibraryLeft = new JPanel();
- jPanelLibraryLeft.add(jLabelLibClass, null);
- jPanelLibraryLeft.add(getJScrollPaneLibClass(), null);
- }
- return jPanelLibraryLeft;
- }
-
- /**
- * This method initializes jPanelLibraryRight
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibraryRight() {
- if (jPanelLibraryRight == null) {
- jLabelQualifiedInstance = new JLabel();
- jLabelQualifiedInstance.setText("Instances Available");
- jPanelLibraryRight = new JPanel();
- jPanelLibraryRight.add(jLabelQualifiedInstance, null);
- jPanelLibraryRight.add(getJScrollPaneQualifiedInstance(), null);
- }
- return jPanelLibraryRight;
- }
-
- /**
- * This method initializes jScrollPaneSelectedInstances
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneSelectedInstances() {
- if (jScrollPaneSelectedInstances == null) {
- jScrollPaneSelectedInstances = new JScrollPane();
- jScrollPaneSelectedInstances.setPreferredSize(new java.awt.Dimension(600,150));
- jScrollPaneSelectedInstances.setViewportView(getJTableSelectedInstances());
- }
- return jScrollPaneSelectedInstances;
- }
-
- /**
- * This method initializes jTableSelectedInstances
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableSelectedInstances() {
- if (jTableSelectedInstances == null) {
- selectedInstancesTableModel = new IDefaultTableModel();
- selectedInstancesTableModel.addColumn("Name");
- selectedInstancesTableModel.addColumn("ModuleGUID");
- selectedInstancesTableModel.addColumn("ModuleVersion");
- selectedInstancesTableModel.addColumn("PackageGUID");
- selectedInstancesTableModel.addColumn("PackageVersion");
- jTableSelectedInstances = new JTable(selectedInstancesTableModel);
- jTableSelectedInstances.setRowHeight(20);
-
- jTableSelectedInstances.getColumnModel().getColumn(0).setMinWidth(250);
-
- jTableSelectedInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- jTableSelectedInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- }
- return jTableSelectedInstances;
- }
-
- /**
- * This method initializes jScrollPaneLibClass
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneLibClass() {
- if (jScrollPaneLibClass == null) {
- jScrollPaneLibClass = new JScrollPane();
- jScrollPaneLibClass.setPreferredSize(new java.awt.Dimension(200,170));
- jScrollPaneLibClass.setViewportView(getJTableLibClass());
- }
- return jScrollPaneLibClass;
- }
-
- /**
- * This method initializes jTableLibClass
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableLibClass() {
- if (jTableLibClass == null) {
- libClassTableModel = new IDefaultTableModel();
- libClassTableModel.addColumn("LibraryClass");
- libClassTableModel.addColumn("Arch");
- libClassTableModel.addColumn("ModType");
- jTableLibClass = new JTable(libClassTableModel);
- jTableLibClass.setRowHeight(20);
- jTableLibClass.setShowGrid(false);
- jTableLibClass.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- TableColumn column = jTableLibClass.getColumnModel().getColumn(1);
- jTableLibClass.getColumnModel().removeColumn(column);
- column = jTableLibClass.getColumnModel().getColumn(1);
- jTableLibClass.getColumnModel().removeColumn(column);
-
- jTableLibClass.getSelectionModel().addListSelectionListener(new ListSelectionListener(){
- public void valueChanged(ListSelectionEvent e) {
- if (e.getValueIsAdjusting()){
- return;
- }
- ListSelectionModel lsm = (ListSelectionModel)e.getSource();
- if (lsm.isSelectionEmpty()) {
- return;
- }
- else{
- int selectedRow2 = lsm.getMinSelectionIndex();
- if (selectedRow2 < 0) {
- return;
- }
- //
- // display potential lib instances according to class selection
- //
- libInstanceTableModel.setRowCount(0);
- String cls = libClassTableModel.getValueAt(selectedRow2, 0).toString();
- String arch = libClassTableModel.getValueAt(selectedRow2, 1).toString();
- String modType = libClassTableModel.getValueAt(selectedRow2, 2).toString();
- LibraryClassDescriptor lcd = new LibraryClassDescriptor(cls, arch, modType);
- ArrayList<String> al = classInstanceMap.get(lcd);
- if (al == null) {
- al = getInstancesForClass(lcd, null);
- if (al.size() != 0) {
- classInstanceMap.put(lcd, al);
- }
-
- }
- ListIterator<String> li = al.listIterator();
- while(li.hasNext()) {
- String instance = li.next();
- String[] s = {"", "", "", "", ""};
- if (WorkspaceProfile.getModuleId(instance) != null) {
- s[0] = WorkspaceProfile.getModuleId(instance).getName();
- }
-
- String[] instancePart = instance.split(" ");
- for (int i = 0; i < instancePart.length; ++i){
- s[i+1] = instancePart[i];
- }
- libInstanceTableModel.addRow(s);
- }
-
- }
- }
- });
- }
- return jTableLibClass;
- }
-
- /**
- * This method initializes jScrollPaneQualifiedInstance
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneQualifiedInstance() {
- if (jScrollPaneQualifiedInstance == null) {
- jScrollPaneQualifiedInstance = new JScrollPane();
- jScrollPaneQualifiedInstance.setPreferredSize(new java.awt.Dimension(600,170));
- jScrollPaneQualifiedInstance.setViewportView(getJTableLibInstances());
- }
- return jScrollPaneQualifiedInstance;
- }
-
- /**
- * This method initializes jTableLibInstances
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableLibInstances() {
- if (jTableLibInstances == null) {
- libInstanceTableModel = new IDefaultTableModel();
- libInstanceTableModel.addColumn("Name");
- libInstanceTableModel.addColumn("ModuleGUID");
- libInstanceTableModel.addColumn("ModuleVersion");
- libInstanceTableModel.addColumn("PackageGUID");
- libInstanceTableModel.addColumn("PackageVersion");
- jTableLibInstances = new JTable(libInstanceTableModel);
- jTableLibInstances.setRowHeight(20);
-
- jTableLibInstances.getColumnModel().getColumn(0).setMinWidth(250);
-
- jTableLibInstances.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_SUBSEQUENT_COLUMNS);
- jTableLibInstances.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- }
- return jTableLibInstances;
- }
-
- /**
- * This method initializes jPanelLibrarySouth
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibrarySouth() {
- if (jPanelLibrarySouth == null) {
- jPanelLibrarySouth = new JPanel();
- }
- return jPanelLibrarySouth;
- }
-
- /**
- * This method initializes jPanelLibraryCenter
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelLibraryCenter() {
- if (jPanelLibraryCenter == null) {
- jLabelInstanceHelp = new JLabel();
- jLabelInstanceHelp.setText("Instance Description");
- jLabelSelectedInstances = new JLabel();
- jLabelSelectedInstances.setText("Selected Instances");
- jPanelLibraryCenter = new JPanel();
- jPanelLibraryCenter.setLayout(new BorderLayout());
-
- jPanelLibraryCenter.add(getJPanelLibraryCenterC(), java.awt.BorderLayout.CENTER);
- jPanelLibraryCenter.add(getJPanelLibraryCenterN(), java.awt.BorderLayout.NORTH);
-
- }
- return jPanelLibraryCenter;
- }
-
- /**
- * This method initializes jScrollPaneInstanceHelp
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneInstanceHelp() {
- if (jScrollPaneInstanceHelp == null) {
- jScrollPaneInstanceHelp = new JScrollPane();
- jScrollPaneInstanceHelp.setPreferredSize(new java.awt.Dimension(400,50));
- jScrollPaneInstanceHelp.setViewportView(getJTextAreaInstanceHelp());
- }
- return jScrollPaneInstanceHelp;
- }
-
- /**
- * This method initializes jTextAreaInstanceHelp
- *
- * @return javax.swing.JTextArea
- */
- private JTextArea getJTextAreaInstanceHelp() {
- if (jTextAreaInstanceHelp == null) {
- jTextAreaInstanceHelp = new JTextArea();
- jTextAreaInstanceHelp.setEditable(false);
- }
- return jTextAreaInstanceHelp;
- }
-
- /**
- * This method initializes jButtonAdd
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAdd() {
- if (jButtonAdd == null) {
- jButtonAdd = new JButton();
- jButtonAdd.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonAdd.setText("Add");
- jButtonAdd.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int row = jTableLibInstances.getSelectedRow();
- if (row < 0) {
- return;
- }
-
- String libInstanceKey = libInstanceTableModel.getValueAt(row, 1) + " " +
- libInstanceTableModel.getValueAt(row, 2) + " " +
- libInstanceTableModel.getValueAt(row, 3) + " " +
- libInstanceTableModel.getValueAt(row, 4);
- ModuleIdentification libMi = WorkspaceProfile.getModuleId(libInstanceKey);
- try {
- addLibInstance (libMi);
- }
- catch (Exception exception) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, "Adding Instance " + libMi.getName() + " : \n"+ exception.getMessage());
- return;
- }
- docConsole.setSaved(false);
- Object[] s = {libInstanceTableModel.getValueAt(row, 0), libInstanceTableModel.getValueAt(row, 1),
- libInstanceTableModel.getValueAt(row, 2), libInstanceTableModel.getValueAt(row, 3),
- libInstanceTableModel.getValueAt(row, 4)};
- selectedInstancesTableModel.addRow(s);
-
- Vector<LibraryClassDescriptor> vLcd = addConsumedClassFromModule (libInstanceKey);
- addProducedClassFromModule (libInstanceKey);
-
- Vector<String> errorMsg = new Vector<String>();
- Vector<ModuleIdentification> newInstances = new Vector<ModuleIdentification>();
- Stack<LibraryClassDescriptor> lcdStack = new Stack<LibraryClassDescriptor>();
- for (int i = 0; i < vLcd.size(); ++i) {
- LibraryClassDescriptor lcd = vLcd.get(i);
- if (!lcdStack.contains(lcd)) {
- lcdStack.push(lcd);
- }
- }
- try {
- resolveLibraryInstances(lcdStack, true, errorMsg, newInstances);
- }
- catch (Exception exp) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, exp.getMessage());
- }
-
- showClassToResolved();
-
- if (errorMsg.size() > 0) {
- String errors = "";
- for (int i = 0; i < errorMsg.size(); ++i) {
- errors += " " + errorMsg.get(i) + "\n";
- }
- JOptionPane.showMessageDialog(FpdModuleSA.this, errors);
- }
- }
- });
- }
- return jButtonAdd;
- }
-
- /**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDeleteInstance() {
- if (jButtonDeleteInstance == null) {
- jButtonDeleteInstance = new JButton();
- jButtonDeleteInstance.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonDeleteInstance.setText("Delete");
- jButtonDeleteInstance.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int row = jTableSelectedInstances.getSelectedRow();
- if (row < 0) {
- return;
- }
- docConsole.setSaved(false);
- String instanceKey = selectedInstancesTableModel.getValueAt(row, 1) + " "
- + selectedInstancesTableModel.getValueAt(row, 2) + " "
- + selectedInstancesTableModel.getValueAt(row, 3) + " "
- + selectedInstancesTableModel.getValueAt(row, 4);
- removeInstance(instanceKey);
-
- selectedInstancesTableModel.setRowCount(0);
- int instanceCount = ffc.getLibraryInstancesCount(moduleKey);
- if (instanceCount != 0) {
- String[][] saa = new String[instanceCount][5];
- ffc.getLibraryInstances(moduleKey, saa);
- for (int i = 0; i < saa.length; ++i) {
- String libInstanceKey = saa[i][1] + " " + saa[i][2] + " " + saa[i][3] + " " + saa[i][4];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(libInstanceKey);
- if (mi != null) {
- //
- // ToDo: verify this instance first.
- //
- saa[i][0] = mi.getName();
- saa[i][2] = mi.getVersion();
- saa[i][4] = mi.getPackageId().getVersion();
- selectedInstancesTableModel.addRow(saa[i]);
- }
- }
- }
- showClassToResolved();
- }
- });
- }
- return jButtonDeleteInstance;
- }
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonOk.setText("Close");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButton3
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.setVisible(false);
- }
- return jButtonCancel;
- }
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonOk) {
- if (jTableModuleSaOptions.isEditing()) {
- jTableModuleSaOptions.getCellEditor().stopCellEditing();
- }
- this.setVisible(false);
- }
- }
- /**
- * This method initializes jPanelModuleSaOpts
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelModuleSaOpts() {
- if (jPanelModuleSaOpts == null) {
- FlowLayout flowLayout4 = new FlowLayout();
- flowLayout4.setAlignment(java.awt.FlowLayout.LEFT);
- jLabelFfsFormatKey = new JLabel();
- jLabelFfsFormatKey.setText("FFS Format Key");
- jLabelFfsFormatKey.setPreferredSize(new java.awt.Dimension(90,16));
- jLabelFfsFileGuid = new JLabel();
- jLabelFfsFileGuid.setText("FFS File GUID");
- jLabelFfsFileGuid.setPreferredSize(new java.awt.Dimension(90,16));
- jLabelFfsFileGuid.setVisible(false);
- jLabelFvBinding = new JLabel();
- jLabelFvBinding.setText("FV Binding");
- jLabelFvBinding.setPreferredSize(new java.awt.Dimension(90,16));
- jPanelModuleSaOpts = new JPanel();
- jPanelModuleSaOpts.setLayout(flowLayout4);
- jPanelModuleSaOpts.add(jLabelFvBinding, null);
- jPanelModuleSaOpts.add(getJTextFieldFvBinding(), null);
- jPanelModuleSaOpts.add(jLabelFfsFileGuid, null);
- jPanelModuleSaOpts.add(getJTextFieldFileGuid(), null);
- jPanelModuleSaOpts.add(jLabelFfsFormatKey, null);
- jPanelModuleSaOpts.add(getJTextFieldFfsKey(), null);
- jPanelModuleSaOpts.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent e) {
- initFvInfo(moduleKey);
- }
- });
- }
- return jPanelModuleSaOpts;
- }
-
- private Vector<String> getVectorFromString (String s) {
- if (s == null || s.equals("null")) {
- s = "";
- }
- String[] sa1 = s.split(" ");
- Vector<String> v = new Vector<String>();
- for (int i = 0; i < sa1.length; ++i) {
- v.add(sa1[i]);
- }
- return v;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFvBinding() {
- if (jTextFieldFvBinding == null) {
- jTextFieldFvBinding = new JTextField();
- jTextFieldFvBinding.setPreferredSize(new java.awt.Dimension(400,20));
- jTextFieldFvBinding.setEditable(true);
- jTextFieldFvBinding.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- String originalFvBinding = ffc.getFvBinding(moduleKey);
- String newFvBinding = jTextFieldFvBinding.getText();
- if (newFvBinding.equals(originalFvBinding)) {
- return;
- }
- if (newFvBinding.length() == 0 && originalFvBinding == null) {
- return;
- }
-
- Vector<String> oldFvList = getVectorFromString (originalFvBinding);
- Vector<String> newFvList = getVectorFromString (newFvBinding);
- String moduleInfo[] = moduleKey.split(" ");
- ffc.setFvBinding(moduleKey, newFvBinding);
- //
- // remove module from Fvs that not in newFvList now.
- //
- oldFvList.removeAll(newFvList);
- for (int j = 0; j < oldFvList.size(); ++j) {
- ffc.removeModuleInBuildOptionsUserExtensions(oldFvList.get(j), "IMAGES", "1", moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);
- }
- //
- // add module to Fvs that were not in oldFvList.
- //
- oldFvList = getVectorFromString (originalFvBinding);
- newFvList.removeAll(oldFvList);
- for (int i = 0; i < newFvList.size(); ++i) {
- ffc.addModuleIntoBuildOptionsUserExtensions(newFvList.get(i), "IMAGES", "1", moduleInfo[0], moduleInfo[1], moduleInfo[2], moduleInfo[3], moduleInfo[4]);
- }
- docConsole.setSaved(false);
- }
- });
-
- }
- return jTextFieldFvBinding;
- }
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFileGuid() {
- if (jTextFieldFileGuid == null) {
- jTextFieldFileGuid = new JTextField();
- jTextFieldFileGuid.setPreferredSize(new java.awt.Dimension(300,20));
- jTextFieldFileGuid.setVisible(false);
- jTextFieldFileGuid.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- String originalFileGuid = ffc.getFfsFileNameGuid(moduleKey);
- String newFileGuid = jTextFieldFileGuid.getText();
- if (newFileGuid.equals(originalFileGuid)) {
- return;
- }
- if (newFileGuid.length() == 0 && originalFileGuid == null) {
- return;
- }
- if (newFileGuid.length() > 0) {
- if (!DataValidation.isGuid(newFileGuid)) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, "FFS File Guid is NOT GUID Type.");
- return;
- }
- }
-
- docConsole.setSaved(false);
- if (newFileGuid.length() == 0) {
- newFileGuid = null;
- }
- ffc.setFfsFileNameGuid(moduleKey, newFileGuid);
- }
- });
-
- }
- return jTextFieldFileGuid;
- }
- /**
- * This method initializes jTextFieldFfsKey
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldFfsKey() {
- if (jTextFieldFfsKey == null) {
- jTextFieldFfsKey = new JTextField();
- jTextFieldFfsKey.setPreferredSize(new java.awt.Dimension(250,20));
- jTextFieldFfsKey.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- String originalFfsKey = ffc.getFfsFormatKey(moduleKey);
- String newFfsKey = jTextFieldFfsKey.getText();
- if (newFfsKey.equals(originalFfsKey)) {
- return;
- }
- if (newFfsKey.length() == 0 && originalFfsKey == null) {
- return;
- }
- docConsole.setSaved(false);
- ffc.setFfsFormatKey(moduleKey, newFfsKey);
- }
- });
-
- }
- return jTextFieldFfsKey;
- }
- /**
- * This method initializes jScrollPaneModuleSaOptions
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneModuleSaOptions() {
- if (jScrollPaneModuleSaOptions == null) {
- jScrollPaneModuleSaOptions = new JScrollPane();
- jScrollPaneModuleSaOptions.setPreferredSize(new java.awt.Dimension(600,350));
- jScrollPaneModuleSaOptions.setViewportView(getJTableModuleSaOptions());
- }
- return jScrollPaneModuleSaOptions;
- }
- /**
- * This method initializes jTableModuleSaOptions
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableModuleSaOptions() {
- if (jTableModuleSaOptions == null) {
- optionsTableModel = new DefaultTableModel();
- optionsTableModel.addColumn("BuildTargets");
- optionsTableModel.addColumn("ToolChainFamily");
- optionsTableModel.addColumn("TagName");
- optionsTableModel.addColumn("ToolCode");
- optionsTableModel.addColumn("SupportedArchs");
- optionsTableModel.addColumn("Contents");
- jTableModuleSaOptions = new JTable(optionsTableModel);
- jTableModuleSaOptions.setRowHeight(20);
-
- jTableModuleSaOptions.getColumnModel().getColumn(0).setMinWidth(buildTargetWidth);
- jTableModuleSaOptions.getColumnModel().getColumn(1).setMinWidth(toolChainFamilyWidth);
- jTableModuleSaOptions.getColumnModel().getColumn(2).setMinWidth(tagNameWidth);
- jTableModuleSaOptions.getColumnModel().getColumn(3).setMinWidth(toolCmdCodeWidth);
- jTableModuleSaOptions.getColumnModel().getColumn(4).setMinWidth(supportArchWidth);
- jTableModuleSaOptions.getColumnModel().getColumn(5).setMinWidth(argWidth);
-// javax.swing.table.TableColumn toolFamilyCol = jTableModuleSaOptions.getColumnModel().getColumn(1);
-// JComboBox cb = new JComboBox();
-// cb.addItem("MSFT");
-// cb.addItem("GCC");
-// cb.addItem("CYGWIN");
-// cb.addItem("INTEL");
-// cb.addItem("USER_DEFINED");
-// toolFamilyCol.setCellEditor(new DefaultCellEditor(cb));
-
- Vector<String> vArch = new Vector<String>();
- vArch.add("IA32");
- vArch.add("X64");
- vArch.add("IPF");
- vArch.add("EBC");
- vArch.add("ARM");
- vArch.add("PPC");
- jTableModuleSaOptions.getColumnModel().getColumn(4).setCellEditor(new ListEditor(vArch, FrameworkWizardUI.getInstance()));
-
- jTableModuleSaOptions.getColumnModel().getColumn(5).setCellEditor(new LongTextEditor(FrameworkWizardUI.getInstance()));
-
- jTableModuleSaOptions.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableModuleSaOptions.setAutoResizeMode(javax.swing.JTable.AUTO_RESIZE_OFF);
- jTableModuleSaOptions.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel)arg0.getSource();
-
- if (arg0.getType() == TableModelEvent.UPDATE){
- //ToDo Data Validition check.
- String targets = m.getValueAt(row, 0) + "";
- Vector<Object> targetName = null;
- if (targets.length() > 0) {
- targetName = new Vector<Object>();
- String[] sArray = targets.split(" ");
- for (int i = 0; i < sArray.length; ++i) {
- targetName.add(sArray[i]);
- }
- }
-
- String toolChain = m.getValueAt(row, 1) + "";
- String tagName = m.getValueAt(row, 2) + "";
- String toolCode = m.getValueAt(row, 3) + "";
- String archs = m.getValueAt(row, 4) + "";
- Vector<Object> supArch = null;
- if (archs.length() > 0) {
- supArch = new Vector<Object>();
- String[] sArray1 = archs.split(" ");
- for (int i = 0; i < sArray1.length; ++i) {
- supArch.add(sArray1[i]);
- }
- }
-
- String contents = m.getValueAt(row, 5) + "";
- docConsole.setSaved(false);
- ffc.updateModuleSAOptionsOpt(moduleKey, row, targetName, toolChain, tagName, toolCode, supArch, contents);
- }
- }
- });
- }
- return jTableModuleSaOptions;
- }
- /**
- * This method initializes jButtonNew
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonNew() {
- if (jButtonNew == null) {
- jButtonNew = new JButton();
- jButtonNew.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonNew.setText("New");
- jButtonNew.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- String[] row = {"", "", "", "", "", ""};
- optionsTableModel.addRow(row);
- Vector<Object> v = null;
- Vector<Object> v1 = null;
- docConsole.setSaved(false);
- ffc.genModuleSAOptionsOpt(moduleKey, v, "", "", "", v1, "");
- }
- });
- }
- return jButtonNew;
- }
- /**
- * This method initializes jButtonDelete
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDeleteOption() {
- if (jButtonDeleteOption == null) {
- jButtonDeleteOption = new JButton();
- jButtonDeleteOption.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonDeleteOption.setText("Delete");
- jButtonDeleteOption.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableModuleSaOptions.getSelectedRow() < 0) {
- return;
- }
- docConsole.setSaved(false);
- ffc.removeModuleSAOptionsOpt(moduleKey, jTableModuleSaOptions.getSelectedRow());
- optionsTableModel.removeRow(jTableModuleSaOptions.getSelectedRow());
- }
- });
- }
- return jButtonDeleteOption;
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-/**
- * This method initializes jPanelPcdFields
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelPcdFields() {
- if (jPanelPcdFields == null) {
- GridLayout gridLayout = new GridLayout();
- gridLayout.setRows(3);
- gridLayout.setColumns(2);
- jPanelPcdFields = new JPanel();
- jPanelPcdFields.setLayout(gridLayout);
- jPanelPcdFields.setPreferredSize(new java.awt.Dimension(600,90));
- jPanelPcdFields.add(getJPanelPcdFieldsFirstRow(), null);
- jPanelPcdFields.add(getJPanelPcdFieldsSecondRow(), null);
- jPanelPcdFields.add(getJPanelPcdFieldsThirdRow(), null);
- }
- return jPanelPcdFields;
-}
-/**
- * This method initializes jPanelPcdFieldsSecondRow
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelPcdFieldsSecondRow() {
- if (jPanelPcdFieldsSecondRow == null) {
- FlowLayout flowLayout2 = new FlowLayout();
- flowLayout2.setAlignment(java.awt.FlowLayout.LEFT);
- jLabelMaxDatumSize = new JLabel();
- jLabelMaxDatumSize.setText("Max Datum Size");
- jPanelPcdFieldsSecondRow = new JPanel();
- jPanelPcdFieldsSecondRow.setLayout(flowLayout2);
- jPanelPcdFieldsSecondRow.add(jLabelMaxDatumSize, null);
- jPanelPcdFieldsSecondRow.add(getJTextFieldMaxDatumSize(), null);
- }
- return jPanelPcdFieldsSecondRow;
-}
-/**
- * This method initializes jPanelPcdFieldsThirdRow
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelPcdFieldsThirdRow() {
- if (jPanelPcdFieldsThirdRow == null) {
- FlowLayout flowLayout3 = new FlowLayout();
- flowLayout3.setAlignment(java.awt.FlowLayout.LEFT);
- jLabelPcdDefaultValue = new JLabel();
- jLabelPcdDefaultValue.setText("Default Value");
- jLabelPcdDefaultValue.setPreferredSize(new java.awt.Dimension(91,16));
- jPanelPcdFieldsThirdRow = new JPanel();
- jPanelPcdFieldsThirdRow.setLayout(flowLayout3);
- jPanelPcdFieldsThirdRow.add(jLabelPcdDefaultValue, null);
- jPanelPcdFieldsThirdRow.add(getJTextFieldPcdDefault(), null);
- jPanelPcdFieldsThirdRow.add(getJComboBoxFeatureFlagValue(), null);
- jPanelPcdFieldsThirdRow.add(getJButtonUpdatePcd(), null);
- }
- return jPanelPcdFieldsThirdRow;
-}
-/**
- * This method initializes jPanelPcdFieldsFirstRow
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelPcdFieldsFirstRow() {
- if (jPanelPcdFieldsFirstRow == null) {
- FlowLayout flowLayout1 = new FlowLayout();
- flowLayout1.setAlignment(java.awt.FlowLayout.LEFT);
- jLabelItemType = new JLabel();
- jLabelItemType.setText("Item Type");
- jLabelItemType.setPreferredSize(new java.awt.Dimension(91,16));
- jPanelPcdFieldsFirstRow = new JPanel();
- jPanelPcdFieldsFirstRow.setLayout(flowLayout1);
- jPanelPcdFieldsFirstRow.add(jLabelItemType, null);
- jPanelPcdFieldsFirstRow.add(getJComboBoxItemType(), null);
- }
- return jPanelPcdFieldsFirstRow;
-}
-/**
- * This method initializes jComboBoxItemType
- *
- * @return javax.swing.JComboBox
- */
-private JComboBox getJComboBoxItemType() {
- if (jComboBoxItemType == null) {
- jComboBoxItemType = new JComboBox();
- jComboBoxItemType.setPreferredSize(new java.awt.Dimension(200,20));
- jComboBoxItemType.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
-
- int row = jTablePcd.getSelectedRow();
- if (row < 0) {
- return;
- }
-
- if (jComboBoxItemType.getSelectedItem() != null && jComboBoxItemType.getSelectedItem().equals("FIXED_AT_BUILD")) {
- jTextFieldPcdDefault.setEnabled(true);
- }
- else {
- jTextFieldPcdDefault.setEnabled(false);
- }
- }
- });
- }
- return jComboBoxItemType;
-}
-
-private void pcdDynamicToNonDynamic(String cName, String tsGuid) {
- String[][] saa = new String[ffc.getDynamicPcdBuildDataCount()][5];
- ffc.getDynamicPcdBuildData(saa);
- String maxSize = "";
- String value = "";
- for (int i = 0; i < saa.length; ++i) {
- if (saa[i][0].equals(cName) && saa[i][2].equals(tsGuid)) {
- maxSize = saa[i][3];
- value = ffc.getDynamicPcdBuildDataValue(i);
- break;
- }
- }
-
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- value = null;
- String itemType = jComboBoxItemType.getSelectedItem()+"";
- ffc.updatePcdData(mKey, cName, tsGuid, itemType, maxSize, value);
- al.set(i, mKey + " " + itemType);
- }
-
- ffc.removeDynamicPcdBuildData(cName, tsGuid);
-}
-
-private void pcdNonDynamicToDynamic(String cName, String tsGuid) {
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- String itemType = jComboBoxItemType.getSelectedItem()+"";
- ffc.updatePcdData(mKey, cName, tsGuid, itemType, jTextFieldMaxDatumSize.getText(), jTextFieldPcdDefault.isVisible() ? jTextFieldPcdDefault.getText() : jComboBoxFeatureFlagValue.getSelectedItem()+"");
- al.set(i, mKey + " " + itemType);
- }
- try{
- ffc.addDynamicPcdBuildData(cName, model.getValueAt(jTablePcd.getSelectedRow(), 3), tsGuid, "DYNAMIC", model.getValueAt(jTablePcd.getSelectedRow(), 5)+"", jTextFieldPcdDefault.isVisible() ? jTextFieldPcdDefault.getText() : jComboBoxFeatureFlagValue.getSelectedItem()+"");
- }
- catch(Exception e){
- JOptionPane.showMessageDialog(FpdModuleSA.this, "PCD value format: " + e.getMessage());
- }
-}
-
-private void changePcdTypeWithinSameCategory (String cName, String tsGuid) {
- ArrayList<String> al = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- for (int i = 0; i < al.size(); ++i) {
- String mKey = moduleInfo (al.get(i));
- String itemType = jComboBoxItemType.getSelectedItem()+"";
- ffc.updatePcdData(mKey, cName, tsGuid, itemType, null, null);
- al.set(i, mKey + " " + itemType);
- }
-}
-
-private String moduleInfo (String pcdInfo) {
-
- return pcdInfo.substring(0, pcdInfo.lastIndexOf(" "));
-}
-
-/**
- * This method initializes jTextFieldMaxDatumSize
- *
- * @return javax.swing.JTextField
- */
-private JTextField getJTextFieldMaxDatumSize() {
- if (jTextFieldMaxDatumSize == null) {
- jTextFieldMaxDatumSize = new JTextField();
- jTextFieldMaxDatumSize.setPreferredSize(new java.awt.Dimension(200,20));
- }
- return jTextFieldMaxDatumSize;
-}
-/**
- * This method initializes jTextField4
- *
- * @return javax.swing.JTextField
- */
-private JTextField getJTextFieldPcdDefault() {
- if (jTextFieldPcdDefault == null) {
- jTextFieldPcdDefault = new JTextField();
- jTextFieldPcdDefault.setPreferredSize(new java.awt.Dimension(200,20));
- }
- return jTextFieldPcdDefault;
-}
-/**
- * This method initializes jButton6
- *
- * @return javax.swing.JButton
- */
-private JButton getJButtonUpdatePcd() {
- if (jButtonUpdatePcd == null) {
- jButtonUpdatePcd = new JButton();
- jButtonUpdatePcd.setPreferredSize(new java.awt.Dimension(150,20));
- jButtonUpdatePcd.setText("Update PCD Data");
- jButtonUpdatePcd.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- int row = jTablePcd.getSelectedRow();
- if (row < 0) {
- return;
- }
-
- String cName = model.getValueAt(row, 0)+"";
- String tsGuid = model.getValueAt(row, 1)+"";
- String oldItemType = model.getValueAt(row, 2)+"";
- String dataType = model.getValueAt(row, 5)+"";
- String newItemType = jComboBoxItemType.getSelectedItem()+"";
- String newValue = jTextFieldPcdDefault.isVisible()? jTextFieldPcdDefault.getText():jComboBoxFeatureFlagValue.getSelectedItem()+"";
- if (newValue.length() == 0){
-
- if (dataType.equals("UINT8") || dataType.equals("UINT16") || dataType.equals("UINT32") || dataType.equals("UINT64")) {
- newValue = "0";
- }
- if (dataType.equals("BOOLEAN")){
- newValue = "FALSE";
- }
- if (dataType.equals("VOID*")) {
- newValue = "L\"\"";
- }
- }
-
- String[] pcdInfo = {"", "", ""};
- Vector<String> validPcdTypes = new Vector<String>();
- getPcdInfo (moduleKey, cName, tsGuid, pcdInfo, validPcdTypes);
- if (pcdInfo[1].equals("FIXED_AT_BUILD") && model.getValueAt(row, 5).equals("VOID*")) {
- try {
- jTextFieldMaxDatumSize.setText(ffc.setMaxSizeForPointer(newValue)+"");
- }
- catch (Exception exp) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, "PCD Value MalFormed: " + exp.getMessage());
- return;
- }
- }
- String newMaxDatumSize = jTextFieldMaxDatumSize.getText();
-
- if (!newItemType.equals(oldItemType)) {
- Vector<ModuleIdentification> moduleInfo = new Vector<ModuleIdentification>();
- try {
- boolean changable = itemTypeCouldBeChanged (cName, tsGuid, newItemType, moduleInfo);
- if (!changable) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, "Can NOT Change Pcd Type in: " + moduleInfo.get(0).getName() + " contained in package " + moduleInfo.get(0).getPackageId().getName());
- return;
- }
- }
- catch (Exception exp) {
- JOptionPane.showMessageDialog(FpdModuleSA.this, "Can NOT Change Pcd Type in: " + moduleInfo.get(0).getName() + " contained in package " + moduleInfo.get(0).getPackageId().getName() + " " + exp.getMessage());
- return;
- }
-
- if ((oldItemType.equals("DYNAMIC") || oldItemType.equals("DYNAMIC_EX")) && !newItemType.equals("DYNAMIC") && !newItemType.equals("DYNAMIC_EX")) {
- pcdDynamicToNonDynamic(cName, tsGuid);
- }
- if (!oldItemType.equals("DYNAMIC") && !oldItemType.equals("DYNAMIC_EX") && (newItemType.equals("DYNAMIC") || newItemType.equals("DYNAMIC_EX"))) {
- pcdNonDynamicToDynamic(cName, tsGuid);
- }
- else {
- changePcdTypeWithinSameCategory (cName, tsGuid);
- }
- model.setValueAt(newItemType, row, 2);
- }
-
- ffc.updatePcdData(moduleKey, cName, tsGuid, model.getValueAt(row, 2)+"", newMaxDatumSize, newValue);
- docConsole.setSaved(false);
- model.setValueAt(newValue, row, 6);
- model.setValueAt(newMaxDatumSize, row, 4);
-
- }
- });
- }
- return jButtonUpdatePcd;
-}
-
-private boolean itemTypeCouldBeChanged (String cName, String tsGuid, String newItemType, Vector<ModuleIdentification> mi) throws Exception{
- ArrayList<String> pcdConsumers = ffc.getDynPcdMapValue(cName + " " + tsGuid);
- for (int i = 0; i < pcdConsumers.size(); ++i) {
- String consumerInfo = moduleInfo (pcdConsumers.get(i));
- mi.removeAllElements();
- mi.add(WorkspaceProfile.getModuleId(consumerInfo));
- String[] sa = {"", "", ""};
- Vector<String> validPcdTypes = new Vector<String>();
- getPcdInfo (consumerInfo, cName, tsGuid, sa, validPcdTypes);
- if (validPcdTypes.size() == 0) {
- return false;
- }
- if (!sa[1].equals("DYNAMIC")) {
- return false;
- }
- if (!validPcdTypes.contains(newItemType)) {
- return false;
- }
- }
- return true;
-}
-
-/**
- * This method initializes jComboBoxFeatureFlagValue
- *
- * @return javax.swing.JComboBox
- */
-private JComboBox getJComboBoxFeatureFlagValue() {
- if (jComboBoxFeatureFlagValue == null) {
- jComboBoxFeatureFlagValue = new JComboBox();
- jComboBoxFeatureFlagValue.setPreferredSize(new java.awt.Dimension(100,20));
- jComboBoxFeatureFlagValue.setVisible(false);
- jComboBoxFeatureFlagValue.addItem("TRUE");
- jComboBoxFeatureFlagValue.addItem("FALSE");
- }
- return jComboBoxFeatureFlagValue;
-}
-/**
- * This method initializes jPanelCustomToolChain
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelCustomToolChain() {
- if (jPanelCustomToolChain == null) {
- jPanelCustomToolChain = new JPanel();
- jPanelCustomToolChain.setLayout(new BorderLayout());
- jPanelCustomToolChain.add(getJPanelToolchainS(), java.awt.BorderLayout.SOUTH);
- jPanelCustomToolChain.add(getJScrollPaneModuleSaOptions(), java.awt.BorderLayout.CENTER);
- jPanelCustomToolChain.addComponentListener(new java.awt.event.ComponentAdapter() {
- public void componentShown(java.awt.event.ComponentEvent e) {
- initToolChainOptions(moduleKey);
- }
- });
- }
- return jPanelCustomToolChain;
-}
-/**
- * This method initializes jPanelToolchainS
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelToolchainS() {
- if (jPanelToolchainS == null) {
- jPanelToolchainS = new JPanel();
- jPanelToolchainS.add(getJButtonNew(), null);
- jPanelToolchainS.add(getJButtonDeleteOption(), null);
- }
- return jPanelToolchainS;
-}
-
-/**
- * This method initializes jPanelLibraryCenterN
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelLibraryCenterN() {
- if (jPanelLibraryCenterN == null) {
- FlowLayout flowLayout5 = new FlowLayout();
- flowLayout5.setAlignment(java.awt.FlowLayout.CENTER);
- flowLayout5.setHgap(10);
- jPanelLibraryCenterN = new JPanel();
- jPanelLibraryCenterN.setLayout(flowLayout5);
- jPanelLibraryCenterN.add(jLabelInstanceHelp, null);
- jPanelLibraryCenterN.add(getJScrollPaneInstanceHelp(), null);
- jPanelLibraryCenterN.add(getJButtonAdd(), null);
- jPanelLibraryCenterN.add(getJButtonDeleteInstance(), null);
- }
- return jPanelLibraryCenterN;
-}
-/**
- * This method initializes jPanelLibraryCenterC
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelLibraryCenterC() {
- if (jPanelLibraryCenterC == null) {
- jPanelLibraryCenterC = new JPanel();
- jPanelLibraryCenterC.add(jLabelSelectedInstances, null);
- jPanelLibraryCenterC.add(getJScrollPaneSelectedInstances(), null);
- }
- return jPanelLibraryCenterC;
-}
-
-
-} // @jve:decl-index=0:visual-constraint="10,10"
-
-class MultipleInstanceException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = -9148463005930920297L;
- private String className = null;
- private String libInstance1 = null;
- private String libInstance2 = null;
-
- MultipleInstanceException (String libClass, String instance1, String instance2) {
- super();
- className = libClass;
- libInstance1 = instance1;
- libInstance2 = instance2;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#getMessage()
- */
- @Override
- public String getMessage() {
- // TODO Auto-generated method stub
- return " Library Class " + className + "is Produced by Two Instances: "
- + libInstance1 + " and " + libInstance2 + ". Platform Build will Fail.";
- }
-
-}
-
-class ImproperInstanceException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = -5279700566993277033L;
- private String className = null;
- private String libInstance = null;
- private String instanceSupArch = null;
- private String instanceSupModType = null;
-
- ImproperInstanceException (String libClass, String instance1, String arch, String type) {
- super();
- className = libClass;
- libInstance = instance1;
- instanceSupArch = arch;
- instanceSupModType = type;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Throwable#getMessage()
- */
- @Override
- public String getMessage() {
- // TODO Auto-generated method stub
- return " Library Class " + className + " Produced by Library Instance: "
- + libInstance + "\nOnly Supports " + instanceSupArch + " and Module Type " + instanceSupModType + ".\n This instance should be removed.\n";
- }
-
-}
-
-class NoInstanceException extends Exception {
-
- /**
- *
- */
- private static final long serialVersionUID = 1987122786598970598L;
-
- private String className = null;
-
- NoInstanceException (String libClass) {
- className = libClass;
- }
-
- public String getMessage() {
- return "No Applicable Instance for Library Class " + className
- + ", Platform Build will Fail.";
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java
deleted file mode 100644
index c87f466bdd..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/FpdPlatformDefs.java
+++ /dev/null
@@ -1,1043 +0,0 @@
-/** @file
- Java class FpdPlatformDefs is GUI for Flash element operation in SPD file.
-
- 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.
- **/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import javax.swing.JPanel;
-
-import javax.swing.JTabbedPane;
-import javax.swing.JButton;
-import javax.swing.ListSelectionModel;
-
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.common.ui.IInternalFrame;
-import org.tianocore.frameworkwizard.toolchain.ToolChainId;
-
-import javax.swing.JCheckBox;
-import javax.swing.JOptionPane;
-import javax.swing.JTextField;
-import javax.swing.JLabel;
-import javax.swing.JScrollPane;
-import javax.swing.JTable;
-import javax.swing.event.InternalFrameAdapter;
-import javax.swing.event.InternalFrameEvent;
-//import javax.swing.event.ListSelectionEvent;
-//import javax.swing.event.ListSelectionListener;
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.DefaultTableModel;
-import javax.swing.table.TableModel;
-import javax.swing.JComboBox;
-import java.awt.Dimension;
-import java.util.Vector;
-
-public class FpdPlatformDefs extends IInternalFrame {
-
- private static boolean Debug = false;
-
- private final int dialogWidth = 600;
-
- private final int oneRowHeight = 20;
-
- private final int twoRowHeight = 40;
-
- // private final int threeRowHeight = 60;
-
- private final int fourRowHeight = 80;
-
- private final int sepHeight = 6;
-
- // private final int sepWidth = 10;
-
- private final int offsetWidth = 70;
-
- private final int buttonWidth = 90;
-
- private final int rowOne = 12;
-
- private final int rowTwo = rowOne + oneRowHeight + sepHeight * 3;
-
- private final int rowThree = rowTwo + oneRowHeight + sepHeight;
-
- private final int rowFour = rowThree + oneRowHeight + sepHeight;
-
- private final int rowFive = rowFour + fourRowHeight + sepHeight * 3;
-
- private final int rowSix = rowFive + oneRowHeight + sepHeight;
-
- private final int rowSeven = rowSix + oneRowHeight + sepHeight;
-
- private final int rowEight = rowSeven + oneRowHeight + sepHeight;
-
- private final int rowNine = rowEight + oneRowHeight + sepHeight;
-
- private final int rowTen = rowNine + fourRowHeight + sepHeight + sepHeight * 3;
-
- private final int rowEleven = rowTen + oneRowHeight + sepHeight;
-
- private final int rowTwelve = rowEleven + oneRowHeight + sepHeight;
-
- private final int dialogHeight = rowTwelve + twoRowHeight;
-
- private final int labelColumn = 12;
-
- private final int valueColumn = 168;
-
- private final int labelWidth = 155;
-
- private final int valueWidth = 320;
-
- private final int valueCenter = valueColumn + (valueWidth / 2);
-
- private final int tableHeight = fourRowHeight;
-
- private final int tableWidth = valueWidth;
-
- private JPanel jContentPane = null;
-
- private JTabbedPane jTabbedPane = null;
-
- private TargetTableModel buildTargetTableModel = null;
-
- private SkuInfoTableModel skuInfoTableModel = null;
-
- private OpeningPlatformType docConsole = null;
-
- private FpdFileContents ffc = null;
-
- private JPanel jPanelGeneralTab = null;
-
- private JPanel jPanelGeneralContainer = null;
-
- private JLabel jLabelSupArch = null;
-
- private JCheckBox jCheckBoxIa32 = null;
-
- private JCheckBox jCheckBoxX64 = null;
-
- private JCheckBox jCheckBoxIpf = null;
-
- private JComboBox jComboBoxInterDir = null;
-
- private JComboBox jBuildTargetComboBox = null;
-
- private JTable jTableBuildTargets = null;
-
- private JPanel jArchitectureSelections = null;
-
- private JLabel jLabelBuildTargets = null;
-
- // private JTextField jTextFieldBuildTarget = null;
-
- private JButton jButtonAddBuildTarget = null;
-
- private JButton jButtonDelBuildTarget = null;
-
- private JScrollPane jScrollPaneBuildTargets = null;
-
- private JScrollPane jScrollPaneSkuInfo = null;
-
- private JTable jTableSkuInfo = null;
-
- private JCheckBox jCheckBoxEbc = null;
-
- private JCheckBox jCheckBoxArm = null;
-
- private JCheckBox jCheckBoxPpc = null;
-
- private JLabel jLabelSkuInfo = null;
-
- private JLabel jLabelSkuId = null;
-
- private JTextField jTextFieldSkuId = null;
-
- private JLabel jLabelSkuName = null;
-
- private JTextField jTextFieldSkuName = null;
-
- private JButton jButtonSkuAdd = null;
-
- private JButton jButtonSkuDel = null;
-
- private JLabel jLabelIntermediateDirs = null;
-
- private JLabel jLabelOutputDir = null;
-
- private JTextField jTextFieldOutputDir = null;
-
- private JLabel jLabelOutputInfo = null;
-
- private int selectedRow = -1;
-
- /**
- * The following are not used by the UI
- */
- private static final long serialVersionUID = 1L;
-
- private ToolChainId tid = new ToolChainId();
-
- public FpdPlatformDefs() {
- super();
- initialize();
- this.setBounds(new java.awt.Rectangle(0, 0, 500, 370));
- this.setVisible(true);
- }
-
- public FpdPlatformDefs(PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd) {
- this();
- ffc = new FpdFileContents(fpd);
- init(ffc);
- }
-
- public FpdPlatformDefs(OpeningPlatformType opt) {
- this(opt.getXmlFpd());
- docConsole = opt;
- }
-
- /**
- * This method initializes jTabbedPane
- *
- * @return javax.swing.JTabbedPane
- */
- private JTabbedPane getJTabbedPane() {
- if (jTabbedPane == null) {
- jTabbedPane = new JTabbedPane();
- jTabbedPane.addTab("General", null, getJPanelGeneralTab(), null);
- }
- return jTabbedPane;
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(dialogWidth, dialogHeight);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setTitle("FPD Platform Definitions");
- this.setContentPane(getJContentPane());
- this.addInternalFrameListener(new InternalFrameAdapter() {
- public void internalFrameDeactivated(InternalFrameEvent e) {
- if (jTableBuildTargets.isEditing()) {
- jTableBuildTargets.getCellEditor().stopCellEditing();
- }
- if (jTableSkuInfo.isEditing()) {
- jTableSkuInfo.getCellEditor().stopCellEditing();
- }
-
- }
- });
- }
-
- private void init(FpdFileContents ffc) {
- Vector<Object> v = new Vector<Object>();
- ffc.getPlatformDefsSupportedArchs(v);
- showSupportedArchitectures(v);
- v.removeAllElements();
-
- ffc.getPlatformDefsBuildTargets(v);
- buildTargetTableModel.setRowCount(0);
- for (int i = 0; i < v.size(); ++i) {
- Object[] row = { v.get(i) };
- buildTargetTableModel.addRow(row);
- }
-
- String[][] saa = new String[ffc.getPlatformDefsSkuInfoCount()][2];
- ffc.getPlatformDefsSkuInfos(saa);
- for (int i = 0; i < saa.length; ++i) {
- skuInfoTableModel.addRow(saa[i]);
- }
-
- String interDir = ffc.getPlatformDefsInterDir();
- if (interDir != null) {
- jComboBoxInterDir.setSelectedItem(interDir);
- }
-
- String outputDir = ffc.getPlatformDefsOutputDir();
- if (outputDir != null) {
- jTextFieldOutputDir.setText(outputDir);
- }
- }
-
- private void showSupportedArchitectures(Vector<Object> v) {
- if (v.contains("IA32")) {
- jCheckBoxIa32.setSelected(true);
- } else {
- jCheckBoxIa32.setSelected(false);
- }
- if (v.contains("X64")) {
- jCheckBoxX64.setSelected(true);
- } else {
- jCheckBoxX64.setSelected(false);
- }
- if (v.contains("IPF")) {
- jCheckBoxIpf.setSelected(true);
- } else {
- jCheckBoxIpf.setSelected(false);
- }
- if (v.contains("EBC")) {
- jCheckBoxEbc.setSelected(true);
- } else {
- jCheckBoxEbc.setSelected(false);
- }
- if (v.contains("ARM")) {
- jCheckBoxArm.setSelected(true);
- } else {
- jCheckBoxArm.setSelected(false);
- }
- if (v.contains("PPC")) {
- jCheckBoxPpc.setSelected(true);
- } else {
- jCheckBoxPpc.setSelected(false);
- }
- }
-
- private void getSupportedArchitectures(Vector<Object> v) {
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- v.removeAllElements();
- if (jCheckBoxIa32.isSelected()) {
- v.add("IA32");
- }
- if (jCheckBoxX64.isSelected()) {
- v.add("X64");
- }
- if (jCheckBoxIpf.isSelected()) {
- v.add("IPF");
- }
- if (jCheckBoxEbc.isSelected()) {
- v.add("EBC");
- }
- if (jCheckBoxArm.isSelected()) {
- v.add("ARM");
- }
- if (jCheckBoxPpc.isSelected()) {
- v.add("PPC");
- }
-
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelGeneralTab() {
- if (jPanelGeneralTab == null) {
- jPanelGeneralTab = new JPanel();
- jPanelGeneralTab.setBounds(new java.awt.Rectangle(0, 0, dialogWidth * 2, dialogHeight * 3));
- jPanelGeneralTab.setPreferredSize(new java.awt.Dimension(dialogWidth + 10, (dialogHeight * 3) + 10));
- jPanelGeneralTab.setAutoscrolls(true);
- jPanelGeneralTab.setLocation(0, 0);
- jPanelGeneralTab.setLayout(null);
- jPanelGeneralTab.add(getJPanelGeneralContainer(), null);
- }
- return jPanelGeneralTab;
- }
-
- /**
- * This method initializes jPanel5
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelGeneralContainer() {
- if (jPanelGeneralContainer == null) {
- jLabelSupArch = new JLabel();
- jLabelSupArch.setText("Supported Architectures");
- jLabelSupArch.setBounds(new java.awt.Rectangle(labelColumn, rowOne, labelWidth, oneRowHeight));
- jLabelBuildTargets = new JLabel();
- jLabelBuildTargets.setText("Build Targets");
- jLabelBuildTargets.setBounds(new java.awt.Rectangle(labelColumn, rowTwo, labelWidth, oneRowHeight));
- jLabelSkuInfo = new JLabel();
- jLabelSkuInfo.setText("SKU Information");
- jLabelSkuInfo.setBounds(new java.awt.Rectangle(labelColumn, rowFive, labelWidth, oneRowHeight));
- jLabelSkuId = new JLabel();
- jLabelSkuId.setText("SKU ID Number");
- jLabelSkuId.setBounds(new java.awt.Rectangle(labelColumn + 10, rowSix, labelWidth, oneRowHeight));
- jLabelSkuName = new JLabel();
- jLabelSkuName.setText("SKU Name");
- jLabelSkuName.setBounds(new java.awt.Rectangle(labelColumn + 10, rowSeven, labelWidth, oneRowHeight));
- jLabelOutputInfo = new JLabel();
- jLabelOutputInfo.setText("Output Directory Configuration");
- jLabelOutputInfo.setBounds(new java.awt.Rectangle(labelColumn, rowTen, valueWidth, oneRowHeight));
- jLabelIntermediateDirs = new JLabel();
- jLabelIntermediateDirs.setText("Intermediate Build Directories");
- jLabelIntermediateDirs.setBounds(new java.awt.Rectangle(labelColumn + 10, rowEleven, valueWidth,
- oneRowHeight));
- jLabelOutputDir = new JLabel();
- jLabelOutputDir.setText("Name of the Output Directory");
- jLabelOutputDir.setBounds(new java.awt.Rectangle(labelColumn + 10, rowTwelve, valueWidth, oneRowHeight));
-
- jPanelGeneralContainer = new JPanel();
- jPanelGeneralContainer.setLayout(null);
- jPanelGeneralContainer.setLocation(new java.awt.Point(2, 2));
- jPanelGeneralContainer.setBounds(new java.awt.Rectangle(2, 2, dialogWidth * 2, dialogHeight));
- jPanelGeneralContainer.setPreferredSize(new java.awt.Dimension(dialogWidth, dialogHeight));
-
- jPanelGeneralContainer.add(jLabelSupArch, null);
- jPanelGeneralContainer.add(getArchitectureSelections(), null);
-
- jPanelGeneralContainer.add(jLabelBuildTargets, null);
- // jPanelGeneralContainer.add(getJTextFieldBuildTarget(), null);
- jPanelGeneralContainer.add(getJBuildTargetComboBox(), null);
-
- jPanelGeneralContainer.add(getJButtonAddBuildTarget(), null);
- jPanelGeneralContainer.add(getJButtonDelBuildTarget(), null);
- jPanelGeneralContainer.add(getJScrollPaneBuildTargets(), null);
-
- jPanelGeneralContainer.add(jLabelSkuInfo, null);
- jPanelGeneralContainer.add(jLabelSkuId, null);
- jPanelGeneralContainer.add(getJTextFieldSkuId(), null);
- jPanelGeneralContainer.add(jLabelSkuName, null);
- jPanelGeneralContainer.add(getJTextFieldSkuName(), null);
- jPanelGeneralContainer.add(getJButtonSkuAdd(), null);
- jPanelGeneralContainer.add(getJButtonSkuDel(), null);
- jPanelGeneralContainer.add(getJScrollPaneSkuInfo(), null);
-
- jPanelGeneralContainer.add(jLabelOutputInfo, null);
- jPanelGeneralContainer.add(jLabelIntermediateDirs, null);
- jPanelGeneralContainer.add(getJComboBoxInterDir(), null);
- jPanelGeneralContainer.add(jLabelOutputDir, null);
- jPanelGeneralContainer.add(getJTextFieldOutputDir(), null);
-
- }
- return jPanelGeneralContainer;
- }
-
- /**
- * This method initializes jArchitectureSelections Row 4
- *
- * @return jArchitectureSelections
- */
- private JPanel getArchitectureSelections() {
- if (jArchitectureSelections == null) {
- jArchitectureSelections = new JPanel();
- jArchitectureSelections.setLayout(null);
- jArchitectureSelections.add(getJCheckBoxIa32(), null);
- jArchitectureSelections.add(getJCheckBoxX64(), null);
- jArchitectureSelections.add(getJCheckBoxIpf(), null);
- jArchitectureSelections.add(getJCheckBoxEbc(), null);
- jArchitectureSelections.add(getJCheckBoxArm(), null);
- jArchitectureSelections.add(getJCheckBoxPpc(), null);
- jArchitectureSelections.setBounds(new java.awt.Rectangle(valueColumn, rowOne, valueWidth, oneRowHeight));
- jArchitectureSelections.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jArchitectureSelections.setLocation(new java.awt.Point(valueColumn, rowOne));
- jArchitectureSelections.setToolTipText("<html>A Platform may support one or more architectures,"
- + "<br>at least one architecture must be selected!</html>");
- }
- return jArchitectureSelections;
- }
-
- /**
- * This method initializes jCheckBox1
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIa32() {
- if (jCheckBoxIa32 == null) {
- jCheckBoxIa32 = new JCheckBox();
- jCheckBoxIa32.setText("IA32");
- jCheckBoxIa32.setBounds(new java.awt.Rectangle(0, 0, 55, 20));
- jCheckBoxIa32.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxIa32.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxIa32;
- }
-
- /**
- * This method initializes jCheckBox2
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxX64() {
- if (jCheckBoxX64 == null) {
- jCheckBoxX64 = new JCheckBox();
- jCheckBoxX64.setText("X64");
- jCheckBoxX64.setBounds(new java.awt.Rectangle(55, 0, 53, 20));
- jCheckBoxX64.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxX64.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxX64;
- }
-
- /**
- * This method initializes jCheckBox3
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxIpf() {
- if (jCheckBoxIpf == null) {
- jCheckBoxIpf = new JCheckBox();
- jCheckBoxIpf.setText("IPF");
- jCheckBoxIpf.setBounds(new java.awt.Rectangle(108, 0, 52, 20));
- jCheckBoxIpf.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxIpf.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxIpf;
- }
-
- /**
- * This method initializes jCheckBox
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxEbc() {
- if (jCheckBoxEbc == null) {
- jCheckBoxEbc = new JCheckBox();
- // jCheckBoxEbc.setPreferredSize(new java.awt.Dimension(50, 20));
- jCheckBoxEbc.setBounds(new java.awt.Rectangle(160, 0, 53, 20));
- jCheckBoxEbc.setText("EBC");
- jCheckBoxEbc.setVisible(true);
- jCheckBoxEbc.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxEbc.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxEbc;
- }
-
- /**
- * This method initializes jCheckBox5
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxArm() {
- if (jCheckBoxArm == null) {
- jCheckBoxArm = new JCheckBox();
- // jCheckBoxArm.setPreferredSize(new java.awt.Dimension(52, 20));
- jCheckBoxArm.setBounds(new java.awt.Rectangle(213, 0, 54, 20));
- jCheckBoxArm.setText("ARM");
- jCheckBoxArm.setVisible(true);
- jCheckBoxArm.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxArm.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxArm;
- }
-
- /**
- * This method initializes jCheckBox6
- *
- * @return javax.swing.JCheckBox
- */
- private JCheckBox getJCheckBoxPpc() {
- if (jCheckBoxPpc == null) {
- jCheckBoxPpc = new JCheckBox();
- // jCheckBoxPpc.setPreferredSize(new Dimension(50, 20));
- jCheckBoxPpc.setBounds(new java.awt.Rectangle(267, 0, 53, 20));
- jCheckBoxPpc.setText("PPC");
- jCheckBoxPpc.setVisible(true);
- jCheckBoxPpc.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- Vector<Object> v = new Vector<Object>();
- getSupportedArchitectures(v);
- if (v.size() == 0) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "Platform must support at least ONE Architecture.");
- jCheckBoxPpc.setSelected(true);
- return;
- }
- ffc.setPlatformDefsSupportedArchs(v);
- }
- });
- }
- return jCheckBoxPpc;
- }
-
- /**
- * Use a ComboBox for BuildTargets
- *
- * @return javax.swing.JComboBox jBuildTargetComboBox
- */
- private JComboBox getJBuildTargetComboBox() {
- if (jBuildTargetComboBox == null) {
- String toolBt = null;
- if (tid.getToolsDefTargetNames() == null)
- toolBt = "DEBUG RELEASE";
- else
- toolBt = tid.getToolsDefTargetNames().trim();
-
- if ((toolBt.contains("*")) || (toolBt.length() < 1)) {
- toolBt = "DEBUG RELEASE";
- }
- if (Debug)
- System.out.println("Using Build Targets: " + toolBt.trim());
-
- toolBt = toolBt.replaceAll(" ", ":");
- toolBt = " :" + toolBt;
- if (Debug)
- System.out.println("Using Build Targets: " + toolBt.trim());
- String[] buildTargets = toolBt.trim().split(":");
-
- jBuildTargetComboBox = new JComboBox(buildTargets);
- jBuildTargetComboBox.setEditable(true);
- jBuildTargetComboBox.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
- jBuildTargetComboBox.setBounds(new java.awt.Rectangle(valueColumn, rowTwo, valueWidth, oneRowHeight));
- jBuildTargetComboBox.setLocation(new java.awt.Point(valueColumn, rowTwo));
- jBuildTargetComboBox.setToolTipText("<html>Select a defined Target and then click Add,<br>"
- + "or enter a new, one word TargetName and then click Add.<br>"
- + "Remember to define the Targetname in the tool defintion file."
- + "</html>");
-
- }
- return jBuildTargetComboBox;
- }
-
- /**
- * This method initializes jTextField1
- *
- * @return javax.swing.JTextField
- */
- // private JTextField getJTextFieldBuildTarget() {
- // if (jTextFieldBuildTarget == null) {
- // jTextFieldBuildTarget = new JTextField();
- // jTextFieldBuildTarget.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
- // jTextFieldBuildTarget.setBounds(new java.awt.Rectangle(valueColumn, rowTwo, valueWidth, oneRowHeight));
- // jTextFieldBuildTarget.setLocation(new java.awt.Point(valueColumn, rowTwo));
- // }
- // return jTextFieldBuildTarget;
- // }
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonAddBuildTarget() {
- if (jButtonAddBuildTarget == null) {
- jButtonAddBuildTarget = new JButton();
- jButtonAddBuildTarget.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
- jButtonAddBuildTarget.setBounds(new java.awt.Rectangle(valueCenter - buttonWidth - 5, rowThree,
- buttonWidth, oneRowHeight));
- jButtonAddBuildTarget.setLocation(new java.awt.Point(valueCenter - buttonWidth - 5, rowThree));
- jButtonAddBuildTarget.setText("Add");
- jButtonAddBuildTarget.setVisible(true);
-
- jButtonAddBuildTarget.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- // Used with Text Field
- // if (jTextFieldBuildTarget.getText().length() > 0) {
- // String[] row = { jTextFieldBuildTarget.getText() };
- // jTextFieldBuildTarget.setText("");
- // buildTargetTableModel.addRow(row);
- // Vector<Object> v = new Vector<Object>();
- // for (int i = 0; i < jTableBuildTargets.getRowCount(); ++i) {
- // v.add(buildTargetTableModel.getValueAt(i, 0));
- // }
- // docConsole.setSaved(false);
- // ffc.setPlatformDefsBuildTargets(v);
- // }
- // Use with ComboBox
- if (jBuildTargetComboBox.getSelectedItem().toString().length() > 0) {
- String[] row = { jBuildTargetComboBox.getSelectedItem().toString() };
- buildTargetTableModel.addRow(row);
- Vector<Object> v = new Vector<Object>();
- for (int i = 0; i < jTableBuildTargets.getRowCount(); ++i) {
- v.add(buildTargetTableModel.getValueAt(i, 0));
- }
- docConsole.setSaved(false);
- ffc.setPlatformDefsBuildTargets(v);
- }
- }
- });
- }
- return jButtonAddBuildTarget;
- }
-
- /**
- * This method initializes jButton3
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonDelBuildTarget() {
- if (jButtonDelBuildTarget == null) {
- jButtonDelBuildTarget = new JButton();
- jButtonDelBuildTarget.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
- jButtonDelBuildTarget
- .setBounds(new java.awt.Rectangle(valueCenter + 5, rowThree, buttonWidth, oneRowHeight));
- jButtonDelBuildTarget.setLocation(new java.awt.Point(valueCenter + 5, rowThree));
- jButtonDelBuildTarget.setText("Delete");
- jButtonDelBuildTarget.setVisible(true);
-
- jButtonDelBuildTarget.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableBuildTargets.getSelectedRow() < 0) {
- return;
- }
- if (jTableBuildTargets.getRowCount() == 1) {
- JOptionPane.showMessageDialog(FpdPlatformDefs.this, "At least one build target should be set for this platform.");
- return;
- }
- buildTargetTableModel.removeRow(jTableBuildTargets.getSelectedRow());
- Vector<Object> v = new Vector<Object>();
- for (int i = 0; i < jTableBuildTargets.getRowCount(); ++i) {
- v.add(buildTargetTableModel.getValueAt(i, 0));
- }
- docConsole.setSaved(false);
- ffc.setPlatformDefsBuildTargets(v);
- }
- });
- }
- return jButtonDelBuildTarget;
- }
-
- /**
- * This method initializes jScrollPane2
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneBuildTargets() {
- if (jScrollPaneBuildTargets == null) {
- jScrollPaneBuildTargets = new JScrollPane();
- jScrollPaneBuildTargets.setPreferredSize(new Dimension(tableWidth - 20, tableHeight - 20));
- jScrollPaneBuildTargets.setBounds(new java.awt.Rectangle(valueColumn, rowFour, tableWidth - 5,
- tableHeight - 5));
- jScrollPaneBuildTargets.setLocation(new java.awt.Point(valueColumn, rowFour));
- jScrollPaneBuildTargets
- .setBorder(javax.swing.BorderFactory
- .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
-
- jScrollPaneBuildTargets.setViewportView(getJTableBuildTargets());
- }
- return jScrollPaneBuildTargets;
- }
-
- /**
- * This method initializes jTable
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableBuildTargets() {
- if (jTableBuildTargets == null) {
- buildTargetTableModel = new TargetTableModel();
-
- jTableBuildTargets = new JTable(buildTargetTableModel);
- jTableBuildTargets.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
- jTableBuildTargets.setRowHeight(oneRowHeight);
- jTableBuildTargets.setToolTipText("<html>Select one of the Targets from the table and<br>"
- + "click Delete to remove the target from the platform.</html>");
- buildTargetTableModel.addColumn("Build Target");
-
- jTableBuildTargets.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- selectedRow = jTableBuildTargets.getSelectedRow();
- if (selectedRow < 0) {
- return;
- }
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- Vector<Object> v = new Vector<Object>();
- for (int i = 0; i < jTableBuildTargets.getRowCount(); ++i) {
- v.add(m.getValueAt(i, 0));
- }
- docConsole.setSaved(false);
- ffc.setPlatformDefsBuildTargets(v);
- }
- }
- });
-
- }
- return jTableBuildTargets;
- }
-
- /**
- * This method initializes jTextField2
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldSkuId() {
- if (jTextFieldSkuId == null) {
- jTextFieldSkuId = new JTextField();
- jTextFieldSkuId.setPreferredSize(new Dimension(40, oneRowHeight));
- jTextFieldSkuId.setBounds(new java.awt.Rectangle(valueColumn, rowSix, 40, oneRowHeight));
- jTextFieldSkuId.setLocation(new java.awt.Point(valueColumn, rowSix));
- jTextFieldSkuId.setToolTipText("Enter a unique integer value.");
- }
- return jTextFieldSkuId;
- }
-
- /**
- * This method initializes jTextField3
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldSkuName() {
- if (jTextFieldSkuName == null) {
- jTextFieldSkuName = new JTextField();
- jTextFieldSkuName.setPreferredSize(new Dimension(valueWidth, oneRowHeight));
- jTextFieldSkuName.setBounds(new java.awt.Rectangle(valueColumn, rowSeven, valueWidth, oneRowHeight));
- jTextFieldSkuName.setLocation(new java.awt.Point(valueColumn, rowSeven));
- jTextFieldSkuName.setToolTipText("<html>Enter a name to help identify this SKU.<br>"
- + "This entry is not used by the build system, it is<br>"
- + "used only by this user interface.</html>");
- }
- return jTextFieldSkuName;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonSkuAdd() {
- if (jButtonSkuAdd == null) {
- jButtonSkuAdd = new JButton();
-
- jButtonSkuAdd.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
- jButtonSkuAdd.setBounds(new java.awt.Rectangle(valueCenter - buttonWidth - 5, rowEight, buttonWidth,
- oneRowHeight));
- jButtonSkuAdd.setLocation(new java.awt.Point(valueCenter - buttonWidth - 5, rowEight));
- jButtonSkuAdd.setText("Add");
- jButtonSkuAdd.setVisible(true);
-
- jButtonSkuAdd.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTextFieldSkuId.getText().length() > 0) {
- String[] row = { jTextFieldSkuId.getText(), jTextFieldSkuName.getText() };
- skuInfoTableModel.addRow(row);
- docConsole.setSaved(false);
- ffc.genPlatformDefsSkuInfo(row[0], row[1]);
- }
- }
- });
- }
- return jButtonSkuAdd;
- }
-
- /**
- * This method initializes jButton1
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonSkuDel() {
- if (jButtonSkuDel == null) {
- jButtonSkuDel = new JButton();
- jButtonSkuDel.setPreferredSize(new Dimension(buttonWidth, oneRowHeight));
- jButtonSkuDel.setBounds(new java.awt.Rectangle(valueCenter + 5, rowEight, buttonWidth, oneRowHeight));
- jButtonSkuDel.setLocation(new java.awt.Point(valueCenter + 5, rowEight));
- jButtonSkuDel.setText("Delete");
- jButtonSkuDel.setVisible(true);
- jButtonSkuDel.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent e) {
- if (jTableSkuInfo.isEditing()) {
- jTableSkuInfo.getCellEditor().stopCellEditing();
- }
- if (jTableSkuInfo.getSelectedRow() < 1) {
- return;
- }
- docConsole.setSaved(false);
- ffc.removePlatformDefsSkuInfo(jTableSkuInfo.getSelectedRow());
- skuInfoTableModel.removeRow(jTableSkuInfo.getSelectedRow());
- }
- });
- }
- return jButtonSkuDel;
- }
-
- /**
- * This method initializes jScrollPane3
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPaneSkuInfo() {
- if (jScrollPaneSkuInfo == null) {
- jScrollPaneSkuInfo = new JScrollPane();
- jScrollPaneSkuInfo.setPreferredSize(new Dimension(tableWidth - 20, tableHeight - 20));
- jScrollPaneSkuInfo.setBounds(new java.awt.Rectangle(valueColumn, rowNine, tableWidth - 5, tableHeight - 5));
- jScrollPaneSkuInfo.setLocation(new java.awt.Point(valueColumn, rowNine));
-
- jScrollPaneSkuInfo
- .setBorder(javax.swing.BorderFactory
- .createEtchedBorder(javax.swing.border.EtchedBorder.RAISED));
-
- jScrollPaneSkuInfo.setViewportView(getJTableSkuInfo());
- }
- return jScrollPaneSkuInfo;
- }
-
- /**
- * This method initializes jTable2
- *
- * @return javax.swing.JTable
- */
- private JTable getJTableSkuInfo() {
- if (jTableSkuInfo == null) {
- skuInfoTableModel = new SkuInfoTableModel();
- skuInfoTableModel.addColumn("SKU ID");
- skuInfoTableModel.addColumn("Name");
- jTableSkuInfo = new JTable(skuInfoTableModel);
- jTableSkuInfo.setToolTipText("<html>SKU ID 0 must always be defined as the default.<br>"
- + "0 can mean either SKU disabled, or it can be the<br>"
- + "default value if more than one SKU is defined, and the<br>"
- + "platform is not jumpered to use one of the other SKU values.</html>");
-
- jTableSkuInfo.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
-
- jTableSkuInfo.getModel().addTableModelListener(new TableModelListener() {
- public void tableChanged(TableModelEvent arg0) {
- // TODO Auto-generated method stub
- int row = arg0.getFirstRow();
- TableModel m = (TableModel) arg0.getSource();
- if (arg0.getType() == TableModelEvent.UPDATE) {
- //ToDo Data Validition check.
- String id = m.getValueAt(row, 0) + "";
- String name = m.getValueAt(row, 1) + "";
- docConsole.setSaved(false);
- ffc.updatePlatformDefsSkuInfo(row, id, name);
- }
- }
- });
- }
- return jTableSkuInfo;
- }
-
- /**
- * This method initializes jComboBox
- *
- * @return javax.swing.JComboBox
- */
- private JComboBox getJComboBoxInterDir() {
- if (jComboBoxInterDir == null) {
- jComboBoxInterDir = new JComboBox();
- jComboBoxInterDir.setPreferredSize(new Dimension(75, oneRowHeight));
- jComboBoxInterDir.setBounds(new java.awt.Rectangle(valueColumn + offsetWidth, rowEleven, 95, oneRowHeight));
- jComboBoxInterDir.setLocation(new java.awt.Point(valueColumn + offsetWidth, rowEleven));
- jComboBoxInterDir.addItem("UNIFIED");
- jComboBoxInterDir.addItem("MODULE");
- jComboBoxInterDir.setSelectedIndex(0);
- jComboBoxInterDir.setToolTipText("<html>Select UNIFIED to generate intermediate directories under<br>"
- + "under platform directory tree.<br>"
- + "Select MODULE to generate intermediate directories under the<br>"
- + "individual module directories.</html>");
- jComboBoxInterDir.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- if (docConsole != null) {
- docConsole.setSaved(false);
- }
- ffc.setPlatformDefsInterDir(jComboBoxInterDir.getSelectedItem() + "");
- }
- });
- }
- return jComboBoxInterDir;
- }
-
- /**
- * This method initializes jTextField
- *
- * @return javax.swing.JTextField Row Twelve
- */
- private JTextField getJTextFieldOutputDir() {
- if (jTextFieldOutputDir == null) {
- jTextFieldOutputDir = new JTextField();
- jTextFieldOutputDir.setPreferredSize(new java.awt.Dimension(290, 20));
- jTextFieldOutputDir.setBounds(new java.awt.Rectangle(valueColumn + offsetWidth, rowTwelve, valueWidth - 30,
- oneRowHeight));
- jTextFieldOutputDir.setLocation(new java.awt.Point(valueColumn + offsetWidth, rowTwelve));
- jTextFieldOutputDir.setToolTipText("Select the name or URL for the output directory tree.");
- jTextFieldOutputDir.addFocusListener(new java.awt.event.FocusAdapter() {
- public void focusLost(java.awt.event.FocusEvent e) {
- docConsole.setSaved(false);
- ffc.setPlatformDefsOutputDir(jTextFieldOutputDir.getText());
- }
- });
- }
- return jTextFieldOutputDir;
- }
-
-} // @jve:decl-index=0:visual-constraint="10,10"
-
-class SkuInfoTableModel extends DefaultTableModel {
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int column) {
- if (row == 0) {
- return false;
- }
- return true;
- }
-}
-
-class TargetTableModel extends DefaultTableModel {
- private static final long serialVersionUID = 1L;
-
- public boolean isCellEditable(int row, int column) {
- if (row < 2) {
- return false;
- }
- return true;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java
deleted file mode 100644
index 401772f28a..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenAprioriFileDialog.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/**
- *
- */
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-
-import javax.swing.JPanel;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Vector;
-
-import javax.swing.JDialog;
-import javax.swing.JLabel;
-import javax.swing.JComboBox;
-import javax.swing.JTabbedPane;
-
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPlatformType;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.platform.ui.global.WorkspaceProfile;
-
-/**
- * @author jlin16
- *
- */
-public class GenAprioriFileDialog extends JDialog implements ActionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 3627991301208644354L;
- private JPanel jContentPane = null;
- private JPanel jPanelN = null;
- private JLabel jLabelFvName = null;
- private JComboBox jComboBoxFvNames = null;
- private JTabbedPane jTabbedPane = null;
- private FpdFileContents ffc = null;
- private OpeningPlatformType docConsole = null;
-
- /**
- * This is the default constructor
- */
- public GenAprioriFileDialog(FpdFileContents inputFfc, OpeningPlatformType dc) {
- super();
- ffc = inputFfc;
- docConsole = dc;
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(670, 670);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setTitle("Apriori Files");
- this.setContentPane(getJContentPane());
- this.setResizable(false);
- this.setModal(true);
-
- String fvName = jComboBoxFvNames.getSelectedItem()+"";
- if (fvName.length() > 0) {
- jTabbedPane.removeAll();
- AprioriModuleOrderPane peiPane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, true);
- peiPane.showModulesInFv(fvName);
- peiPane.showAllModulesInPlatform();
- jTabbedPane.addTab("PEIMs", peiPane);
- AprioriModuleOrderPane dxePane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, false);
- dxePane.showModulesInFv(fvName);
- dxePane.showAllModulesInPlatform();
- jTabbedPane.addTab("DXE Drivers", dxePane);
- }
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelN(), java.awt.BorderLayout.NORTH);
- jContentPane.add(getJTabbedPane(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {
- docConsole.setSaved(false);
- return;
- }
- if (arg0.getActionCommand().equals("ModuleOrderPaneCancel")) {
- this.dispose();
- }
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
-/**
- * This method initializes jPanelN
- *
- * @return javax.swing.JPanel
- */
-private JPanel getJPanelN() {
- if (jPanelN == null) {
- jLabelFvName = new JLabel();
- jLabelFvName.setText("FV Name");
- jPanelN = new JPanel();
- jPanelN.add(jLabelFvName, null);
- jPanelN.add(getJComboBoxFvNames(), null);
- }
- return jPanelN;
-}
-
-/**
- * This method initializes jComboBoxFvNames
- *
- * @return javax.swing.JComboBox
- */
-private JComboBox getJComboBoxFvNames() {
- if (jComboBoxFvNames == null) {
- jComboBoxFvNames = new JComboBox();
- jComboBoxFvNames.setPreferredSize(new java.awt.Dimension(200,20));
- Vector<String> vFvNames = new Vector<String>();
- ffc.getFvImagesFvImageFvImageNames(vFvNames);
- for (int i = 0; i < vFvNames.size(); ++i) {
- jComboBoxFvNames.addItem(vFvNames.get(i));
- }
-// if (jComboBoxFvNames.getItemCount() > 0) {
-// jComboBoxFvNames.setSelectedIndex(0);
-//
-// }
- jComboBoxFvNames.addItemListener(new java.awt.event.ItemListener() {
- public void itemStateChanged(java.awt.event.ItemEvent e) {
- String fvName = jComboBoxFvNames.getSelectedItem()+"";
- if (fvName.length() > 0) {
- jTabbedPane.removeAll();
- AprioriModuleOrderPane peiPane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, true);
- peiPane.showModulesInFv(fvName);
- peiPane.showAllModulesInPlatform();
- jTabbedPane.addTab("PEIMs", peiPane);
- AprioriModuleOrderPane dxePane = new AprioriModuleOrderPane(fvName, "", GenAprioriFileDialog.this, false);
- dxePane.showModulesInFv(fvName);
- dxePane.showAllModulesInPlatform();
- jTabbedPane.addTab("DXE Drivers", dxePane);
- }
-
- }
- });
- }
- return jComboBoxFvNames;
-}
-
-/**
- * This method initializes jTabbedPane
- *
- * @return javax.swing.JTabbedPane
- */
-private JTabbedPane getJTabbedPane() {
- if (jTabbedPane == null) {
- jTabbedPane = new JTabbedPane();
- }
- return jTabbedPane;
-}
-
-private class AprioriModuleOrderPane extends ModuleOrderPane {
- /**
- *
- */
- private static final long serialVersionUID = -7952853414833230546L;
- private boolean forPEI = false;
- private String fvName = null;
-
- AprioriModuleOrderPane (String fvName, String file, ActionListener action, boolean b) {
-
- super(fvName, file, ffc, action);
- this.fvName = fvName;
- forPEI = b;
- getJTableModInFv().getColumnModel().getColumn(0).setHeaderValue("Modules in Apriori File");
- getJButtonOk().setText("Save");
- getJButtonCancel().setText("Close");
- }
-
- public void showModulesInFv (String fvName) {
- String id = "1";
- if (forPEI) {
- id = "0";
- }
- int size = ffc.getUserExtsIncModCount(fvName, "APRIORI", id);
-
- if (size != -1) {
- String[][] saa = new String[size][5];
- ffc.getUserExtsIncMods(fvName, "APRIORI", id, saa);
-
- for (int i = 0; i < size; ++i) {
- String moduleKey = saa[i][0] + " " + saa[i][1] + " " + saa[i][2] + " " + saa[i][3];
- ModuleIdentification mi = WorkspaceProfile.getModuleId(moduleKey);
- String name = "N/A";
- if (mi != null) {
- name = mi.getName();
- }
-
- String[] row = { name, saa[i][0] , saa[i][1], saa[i][2] , saa[i][3], saa[i][4] };
- getModInFvTableModel().addRow(row);
- }
- }
- }
-
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getActionCommand().equals("ModuleOrderPaneOk")) {
- String id = "1";
- if (forPEI) {
- id = "0";
- }
-
- Vector<String[]> vModInFv = new Vector<String[]>();
- for (int i = 0; i < getJTableModInFv().getRowCount(); ++i) {
- String moduleName = getModInFvTableModel().getValueAt(i, 0)+"";
- if (moduleName.length() == 0 || moduleName.equals("N/A")) {
- continue;
- }
-
- String mg = getModInFvTableModel().getValueAt(i, 1)+"";
- String mv = getModInFvTableModel().getValueAt(i, 2)+"";
- String pg = getModInFvTableModel().getValueAt(i, 3)+"";
- String pv = getModInFvTableModel().getValueAt(i, 4)+"";
- String arch = getModInFvTableModel().getValueAt(i, 5)+"";
-
- String[] sa = { mg, mv, pg, pv, arch};
- vModInFv.add(sa);
-
- }
-
- ffc.removeBuildOptionsUserExtensions(fvName, "APRIORI", id);
- ffc.genBuildOptionsUserExtensions(fvName, "APRIORI", id, "", vModInFv);
-
- }
- }
-}
-} // @jve:decl-index=0:visual-constraint="10,10"
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenListDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenListDialog.java
deleted file mode 100644
index ef918f0cd7..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenListDialog.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/** @file
- Java class GenListDialog.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JDialog;
-import javax.swing.KeyStroke;
-
-import javax.swing.JButton;
-
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.util.Vector;
-
-import javax.swing.JScrollPane;
-
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.ICheckBoxList;
-
-
-/**
- Dialog for List generation.
- @since PackageEditor 1.0
-**/
-public class GenListDialog extends JDialog implements ActionListener{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JPanel jContentPane = null;
- private JPanel jPanelContentEast = null;
- private JPanel jPanelContentCenter = null;
- private JButton jButtonCancel = null;
- private JButton jButtonOk = null;
- private ICheckBoxList checkBoxList = null;
-
-
- private JScrollPane jScrollPane = null;
-
-
-
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonOk){
-
-// this.dispose();
- }
-
- if (arg0.getSource() == jButtonCancel){
- this.dispose();
- }
- }
-
- /**
- * This method initializes jPanel
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentEast() {
- if (jPanelContentEast == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setVgap(10);
- jPanelContentEast = new JPanel();
- jPanelContentEast.setLayout(flowLayout);
- jPanelContentEast.setPreferredSize(new java.awt.Dimension(100,30));
- jPanelContentEast.add(getJButtonOk(), null);
- jPanelContentEast.add(getJButtonCancel(), null);
- }
- return jPanelContentEast;
- }
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentCenter() {
- if (jPanelContentCenter == null) {
- jPanelContentCenter = new JPanel();
- jPanelContentCenter.setLayout(new FlowLayout());
- jPanelContentCenter.add(getJScrollPane(), null);
-
- }
- return jPanelContentCenter;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- jButtonCancel.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonOk.setText("Ok");
- jButtonOk.setActionCommand("GenGuidValue");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setPreferredSize(new java.awt.Dimension(300,100));
- jScrollPane.setViewportView(getICheckBoxList());
- }
- return jScrollPane;
- }
-
- private ICheckBoxList getICheckBoxList() {
- if (checkBoxList == null) {
- checkBoxList = new ICheckBoxList();
- checkBoxList.setBounds(new java.awt.Rectangle(40,20,177,74));
-
- }
- return checkBoxList;
- }
-
- public void initList(Vector<String> v){
- checkBoxList.setAllItems(v);
- }
- public Vector<String> getList(){
- Vector<String> v = checkBoxList.getAllCheckedItemsString();
- return v;
- }
-
- public void setList(String s){
- Vector<String> v = new Vector<String>();
- if (s == null) {
- checkBoxList.setAllItemsUnchecked();
- return;
- }
- String[] sArray = s.split(" ");
- for (int i = 0; i < sArray.length; ++i){
- v.add(sArray[i]);
- }
- checkBoxList.initCheckedItem(true, v);
- }
- /**
- * This is the default constructor
- */
- public GenListDialog(JFrame frame) {
- super(frame);
- initialize();
- }
-
- public GenListDialog(ActionListener i, JFrame frame){
- this(frame);
- jButtonOk.addActionListener(i);
- jButtonOk.registerKeyboardAction(i, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(466, 157);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setModal(true);
- this.setTitle("List");
- this.setContentPane(getJContentPane());
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.EAST);
- jContentPane.add(getJPanelContentCenter(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
-
-
-} // @jve:decl-index=0:visual-constraint="10,10"
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenLongTextDialog.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenLongTextDialog.java
deleted file mode 100644
index 856e227180..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/GenLongTextDialog.java
+++ /dev/null
@@ -1,229 +0,0 @@
-/** @file
- Java class GenLongTextDialog.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.BorderLayout;
-import java.awt.Dimension;
-import java.awt.Toolkit;
-
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JPanel;
-import javax.swing.JDialog;
-import javax.swing.JTextArea;
-import javax.swing.JButton;
-import javax.swing.KeyStroke;
-
-import java.awt.FlowLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-
-import javax.swing.JScrollPane;
-
-
-
-/**
- Dialog for Long Text generation.
- @since PackageEditor 1.0
-**/
-public class GenLongTextDialog extends JDialog implements ActionListener{
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- private JPanel jContentPane = null;
- private JPanel jPanelContentEast = null;
- private JPanel jPanelContentCenter = null;
- private JButton jButtonCancel = null;
- private JButton jButtonOk = null;
- private JTextArea jTextArea = null;
-
-
- private JScrollPane jScrollPane = null;
-
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonOk){
-
-// this.dispose();
- }
-
- if (arg0.getSource() == jButtonCancel){
- this.dispose();
- }
- }
-
- /**
- * This method initializes jPanel
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentEast() {
- if (jPanelContentEast == null) {
- FlowLayout flowLayout = new FlowLayout();
- flowLayout.setVgap(5);
- flowLayout.setAlignment(java.awt.FlowLayout.RIGHT);
- jPanelContentEast = new JPanel();
- jPanelContentEast.setLayout(flowLayout);
- jPanelContentEast.setPreferredSize(new java.awt.Dimension(100,30));
- jPanelContentEast.add(getJButtonOk(), null);
- jPanelContentEast.add(getJButtonCancel(), null);
- }
- return jPanelContentEast;
- }
-
- /**
- * This method initializes jPanel4
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJPanelContentCenter() {
- if (jPanelContentCenter == null) {
- jPanelContentCenter = new JPanel();
- jPanelContentCenter.setLayout(new FlowLayout());
- jPanelContentCenter.add(getJScrollPane(), null);
-
- }
- return jPanelContentCenter;
- }
-
- /**
- * This method initializes jButton
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- jButtonCancel.registerKeyboardAction(this, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButton2
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setPreferredSize(new java.awt.Dimension(80,20));
- jButtonOk.setText("Ok");
- jButtonOk.setActionCommand("GenGuidValue");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jScrollPane
- *
- * @return javax.swing.JScrollPane
- */
- private JScrollPane getJScrollPane() {
- if (jScrollPane == null) {
- jScrollPane = new JScrollPane();
- jScrollPane.setPreferredSize(new java.awt.Dimension(600,40));
- jScrollPane.setViewportView(getJTextArea());
- }
- return jScrollPane;
- }
-
- private JTextArea getJTextArea() {
- if (jTextArea == null) {
- jTextArea = new JTextArea();
-// jTextArea.setBounds(new java.awt.Rectangle(40,20,300,54));
-
- }
- return jTextArea;
- }
-
-
- public String getText(){
-
- return jTextArea.getText();
- }
-
- public void setText(String s){
- jTextArea.setText(s);
- }
- /**
- * This is the default constructor
- */
- public GenLongTextDialog(JFrame frame) {
- super(frame);
- initialize();
- }
-
- public GenLongTextDialog(ActionListener i, JFrame frame){
- this(frame);
- jButtonOk.addActionListener(i);
- jButtonOk.registerKeyboardAction(i, KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0, false), JComponent.WHEN_FOCUSED);
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(620, 120);
- this.setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
- this.setModal(true);
- this.setTitle("Text Content");
- this.setContentPane(getJContentPane());
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jContentPane = new JPanel();
- jContentPane.setLayout(new BorderLayout());
- jContentPane.add(getJPanelContentEast(), java.awt.BorderLayout.SOUTH);
- jContentPane.add(getJPanelContentCenter(), java.awt.BorderLayout.CENTER);
- }
- return jContentPane;
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow(int intWidth, int intHeight) {
- Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
- this.setLocation((d.width - intWidth) / 2, (d.height - intHeight) / 2);
- }
-
- /**
- Start the window at the center of screen
-
- **/
- protected void centerWindow() {
- centerWindow(this.getSize().width, this.getSize().height);
- }
-
-
-
-} // @jve:decl-index=0:visual-constraint="10,10"
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java
deleted file mode 100644
index 804dc605f4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/ListEditor.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/** @file
- Java class GuidEditor.
-
-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.
-
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.Vector;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JTable;
-import javax.swing.table.TableCellEditor;
-
-
-/**
- Editor for table cell with GUID value.
- @since PackageEditor 1.0
- **/
-public class ListEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- private boolean canNotBeEmpty = false;
- private JFrame topFrame = null;
- String archs;
- JButton button;
- GenListDialog dialog;
- protected static final String EDIT = "edit";
-
- public ListEditor(JFrame frame) {
- topFrame = frame;
- button = new JButton();
- button.setActionCommand(EDIT);
- button.addActionListener(this);
- button.setBorderPainted(false);
-
-
- dialog = new GenListDialog(this, frame);
-
- }
-
- public ListEditor(Vector<String> v, JFrame frame) {
- this(frame);
- dialog.initList(v);
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)
- */
- public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {
- // TODO Auto-generated method stub
- archs = (String)arg1;
- return button;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.CellEditor#getCellEditorValue()
- */
- public Object getCellEditorValue() {
- // TODO Auto-generated method stub
- return archs;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (EDIT.equals(arg0.getActionCommand())) {
- //The user has clicked the cell, so
- //bring up the dialog.
- button.setText(archs);
- dialog.setList(archs);
- dialog.setVisible(true);
-
- //Make the renderer reappear.
- fireEditingStopped();
- }
- else { //User pressed dialog's "OK" button.
- Vector<String> v = dialog.getList();
- if (canNotBeEmpty && v.size() == 0) {
- JOptionPane.showMessageDialog(topFrame, "You must select at least one item.");
- return;
- }
- String s = " ";
- for (int i = 0; i < v.size(); ++i) {
- s += v.get(i);
- s += " ";
- }
- archs = s.trim();
- dialog.dispose();
- }
-
- }
-
- /**
- * @param canNotBeEmpty The canNotBeEmpty to set.
- */
- public void setCanNotBeEmpty(boolean canNotBeEmpty) {
- this.canNotBeEmpty = canNotBeEmpty;
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/LongTextEditor.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/LongTextEditor.java
deleted file mode 100644
index 6e89ba7334..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/LongTextEditor.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/** @file
- Java class LongTextEditor.
-
-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.
-
-**/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-
-import javax.swing.AbstractCellEditor;
-import javax.swing.JButton;
-import javax.swing.JFrame;
-import javax.swing.JTable;
-import javax.swing.table.TableCellEditor;
-
-
-/**
- Editor for table cell with Long Text.
- @since PackageEditor 1.0
- **/
-public class LongTextEditor extends AbstractCellEditor implements TableCellEditor, ActionListener {
-
- /**
- *
- */
- private static final long serialVersionUID = 1L;
- String text;
- JButton button;
- GenLongTextDialog dialog;
- protected static final String EDIT = "editLongText";
-
- public LongTextEditor(JFrame frame) {
-
- button = new JButton();
- button.setActionCommand(EDIT);
- button.addActionListener(this);
- button.setBorderPainted(false);
-
- dialog = new GenLongTextDialog(this, frame);
-
- }
-
- /* (non-Javadoc)
- * @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable, java.lang.Object, boolean, int, int)
- */
- public Component getTableCellEditorComponent(JTable arg0, Object arg1, boolean arg2, int arg3, int arg4) {
- // TODO Auto-generated method stub
- text = (String)arg1;
- return button;
- }
-
- /* (non-Javadoc)
- * @see javax.swing.CellEditor#getCellEditorValue()
- */
- public Object getCellEditorValue() {
- // TODO Auto-generated method stub
- return text;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- */
- public void actionPerformed(ActionEvent arg0) {
- // TODO Auto-generated method stub
- if (EDIT.equals(arg0.getActionCommand())) {
- //The user has clicked the cell, so
- //bring up the dialog.
- button.setText(text);
- dialog.setText(text);
- dialog.setVisible(true);
-
- //Make the renderer reappear.
- fireEditingStopped();
- }
- else { //User pressed dialog's "OK" button.
-
- text = dialog.getText().trim();
- dialog.dispose();
- }
-
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/TableSorter.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/TableSorter.java
deleted file mode 100644
index 3f37efb38c..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/TableSorter.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/** @file
-
- The file is used to sort FrameworkModules of Fpd file
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui;
-
-import java.awt.event.*;
-import java.util.*;
-
-import javax.swing.event.TableModelEvent;
-import javax.swing.event.TableModelListener;
-import javax.swing.table.*;
-
-
-public class TableSorter extends AbstractTableModel {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- protected DefaultTableModel tableModel;
- private TableRow[] rowInView;
- private int[] viewPos;
-
- public static final String DESCENDING = "down";
- public static final String NOT_SORTED = "none";
- public static final String ASCENDING = "up";
-
- private JTableHeader tableHeader;
- private MouseListener mouseListener = new MouseHandler();
- private TableModelListener tableModelListener = new TableModelHandler();
-
- private HashMap<Integer, String> sortingOrders = new HashMap<Integer, String>();
-
- public TableSorter(DefaultTableModel tableModel) {
- setTableModel(tableModel);
- }
-
-
- private void resetSortState() {
- rowInView = null;
- viewPos = null;
- }
-
- public DefaultTableModel getTableModel() {
- return tableModel;
- }
-
- public void setTableModel(DefaultTableModel dtm) {
- if (tableModel != null) {
- tableModel.removeTableModelListener(tableModelListener);
- }
-
- tableModel = dtm;
- if (tableModel != null) {
- tableModel.addTableModelListener(tableModelListener);
- }
-
- resetSortState();
- fireTableStructureChanged();
- }
-
- public JTableHeader getTableHeader() {
- return tableHeader;
- }
-
- public void setTableHeader(JTableHeader th) {
- if (tableHeader != null) {
- tableHeader.removeMouseListener(mouseListener);
- }
- tableHeader = th;
- if (tableHeader != null) {
- tableHeader.addMouseListener(mouseListener);
-
- }
- }
-
- private String getSortState(int column) {
-
- Integer i = new Integer(column);
- if (sortingOrders.get(i) != null) {
- return sortingOrders.get(i);
- }
- return NOT_SORTED;
- }
-
- private void sortStateChanged() {
- resetSortState();
- fireTableDataChanged();
-
- }
-
- public void setSortState(int column, String status) {
- Integer i = new Integer(column);
- sortingOrders.put(i, status);
- sortStateChanged();
- }
-
- private TableRow[] getSortedViewRows() {
- if (rowInView == null) {
- int rowCount = tableModel.getRowCount();
- rowInView = new TableRow[rowCount];
- int i = 0;
- while ( i < rowCount ) {
- rowInView[i] = new TableRow(i);
- ++i;
- }
-
- if (sortingOrders.size() != 0) {
- Arrays.sort(rowInView);
- }
- }
- return rowInView;
- }
-
- public int getModelRowIndex(int viewIndex) {
- TableRow[] rArray = getSortedViewRows();
- return rArray[viewIndex].modelIndex;
- }
-
- public int[] getViewIndexArray() {
- if (viewPos == null) {
- int n = getSortedViewRows().length;
- viewPos = new int[n];
- for (int i = 0; i < n; i++) {
- viewPos[getModelRowIndex(i)] = i;
- }
- }
- return viewPos;
- }
-
-
-
- public int getRowCount() {
- if (tableModel == null) {
- return 0;
- }
- return tableModel.getRowCount();
- }
-
- public String getColumnName(int col) {
- return tableModel.getColumnName(col);
- }
-
- public int getColumnCount() {
- if (tableModel == null) {
- return 0;
- }
- return tableModel.getColumnCount();
- }
-
- public Class<?> getColumnClass(int col) {
- return tableModel.getColumnClass(col);
- }
-
- public boolean isCellEditable(int row, int col) {
- int modelIndex = getModelRowIndex(row);
- return tableModel.isCellEditable(modelIndex, col);
- }
-
- public Object getValueAt(int row, int col) {
- int modelIndex = getModelRowIndex(row);
- return tableModel.getValueAt(modelIndex, col);
- }
-
- public void setValueAt(Object val, int row, int col) {
- int modelIndex = getModelRowIndex(row);
- tableModel.setValueAt(val, modelIndex, col);
- }
-
- // Helper classes
-
- private class TableRow implements Comparable {
- private int modelIndex;
-
- public TableRow(int index) {
- this.modelIndex = index;
- }
-
- public int compareTo(Object o) {
- int row1 = modelIndex;
- int row2 = ((TableRow) o).modelIndex;
-
- Iterator<Integer> mapIter = sortingOrders.keySet().iterator();
-
- while (mapIter.hasNext()) {
-
- Integer column = mapIter.next();
- Object o1 = tableModel.getValueAt(row1, column);
- Object o2 = tableModel.getValueAt(row2, column);
-
- int comparison = 0;
- if (o1 == null && o2 == null) {
- comparison = 0;
- } else if (o1 == null) {
- comparison = -1;
- } else if (o2 == null) {
- comparison = 1;
- } else {
- comparison = o1.toString().compareTo(o2.toString());;
- }
- if (comparison != 0) {
- if (getSortState(column.intValue()).equals(DESCENDING)) {
- return -comparison;
- }
- return comparison;
- }
- }
- return 0;
- }
- }
-
- private class TableModelHandler implements TableModelListener {
- public void tableChanged(TableModelEvent e) {
- if (sortingOrders.size() != 0) {
- resetSortState();
- fireTableChanged(e);
- return;
- }
- if (e.getFirstRow() == TableModelEvent.HEADER_ROW) {
-
- fireTableChanged(e);
- return;
- }
- int column = e.getColumn();
- if (e.getFirstRow() == e.getLastRow()
- && column != TableModelEvent.ALL_COLUMNS
- && getSortState(column).equals(NOT_SORTED)
- && viewPos != null) {
- int viewIndex = getViewIndexArray()[e.getFirstRow()];
- fireTableChanged(new TableModelEvent(TableSorter.this,
- viewIndex, viewIndex,
- column, e.getType()));
- return;
- }
-
- resetSortState();
- fireTableDataChanged();
- return;
- }
- }
-
- private class MouseHandler extends MouseAdapter {
- public void mouseClicked(MouseEvent e) {
- JTableHeader h = (JTableHeader) e.getSource();
- TableColumnModel columnModel = h.getColumnModel();
- int viewColumn = columnModel.getColumnIndexAtX(e.getX());
- int column = columnModel.getColumn(viewColumn).getModelIndex();
- if (column == 0) {
- String status = getSortState(column);
-
-
- if (status.equals(ASCENDING)) {
- status = DESCENDING;
- }
- else if (status.equals(DESCENDING)) {
- status = NOT_SORTED;
- }
- else if (status.equals(NOT_SORTED)) {
- status = ASCENDING;
- }
- setSortState(column, status);
- }
- }
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/LibraryClassDescriptor.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/LibraryClassDescriptor.java
deleted file mode 100644
index df689c6ef1..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/LibraryClassDescriptor.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/** @file
- This file is for surface area information retrieval.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui.global;
-
-import java.util.Vector;
-
-public class LibraryClassDescriptor {
- public String className = "";
- public String supArchs = "";
- public String supModTypes = "";
-
- public LibraryClassDescriptor (String s1, String s2, String s3) {
- className = s1;
- if (s2 != null) {
- supArchs = s2;
- }
- if (s3 != null) {
- supModTypes = s3;
- }
-
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof LibraryClassDescriptor) {
- LibraryClassDescriptor id = (LibraryClassDescriptor)obj;
- if (className.equals(id.className) && sameArchs (supArchs, id.supArchs) && sameModTypes(supModTypes, id.supModTypes)) {
- return true;
- }
- return false;
- }
- else {
- return super.equals(obj);
- }
- }
-
- public int hashCode(){
- return (className + supArchs + supModTypes).toLowerCase().hashCode();
- }
-
- public String toString() {
- return "Library Class "+ className + " [SupArchs: " + supArchs + " SupModTypes: " + supModTypes + "]";
- }
-
- public boolean isSubSetByArchs (LibraryClassDescriptor lcd) {
- if (className.equals(lcd.className)) {
- Vector<String> vArchs1 = getVectorFromString(supArchs);
- Vector<String> vArchs2 = getVectorFromString(lcd.supArchs);
-
- if (isSubSet(vArchs1, vArchs2)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean isSubSetByModTypes (LibraryClassDescriptor lcd) {
- if (className.equals(lcd.className)) {
- Vector<String> vModTypes1 = getVectorFromString(supModTypes);
- Vector<String> vModTypes2 = getVectorFromString(lcd.supModTypes);
-
- if (isSubSet(vModTypes1, vModTypes2)) {
- return true;
- }
- }
- return false;
- }
-
- public boolean hasInterSectionWith (LibraryClassDescriptor lcd) {
- if (className.equals(lcd.className)) {
- Vector<String> vArchs1 = getVectorFromString(supArchs);
- Vector<String> vArchs2 = getVectorFromString(lcd.supArchs);
- if (vArchs1.size() == 0 || (vArchs1.size() == 1 && vArchs1.get(0).equalsIgnoreCase(""))) {
- return true;
- }
- if (vArchs2.size() == 0 || (vArchs2.size() == 1 && vArchs2.get(0).equalsIgnoreCase(""))) {
- return true;
- }
- vArchs1.retainAll(vArchs2);
- if (vArchs1.size() > 0) {
- return true;
- }
- }
- return false;
- }
-
- private boolean isSubSet (Vector<String> v1, Vector<String> v2) {
- if (v2.size() == 0 || (v2.size() == 1 && v2.get(0).equalsIgnoreCase(""))) {
- return true;
- }
- if (v2.containsAll(v1)) {
- return true;
- }
- return false;
- }
-
- public Vector<String> getVectorFromString (String s) {
- if (s == null || s.equals("null")) {
- s = "";
- }
- String[] sa1 = s.split(" ");
- Vector<String> v = new Vector<String>();
- for (int i = 0; i < sa1.length; ++i) {
- v.add(sa1[i]);
- }
- return v;
- }
-
- private boolean sameArchs (String archs1, String archs2) {
- Vector<String> vArchs1 = getVectorFromString(archs1);
- Vector<String> vArchs2 = getVectorFromString(archs2);
-
- if (vArchs1.containsAll(vArchs2) && vArchs2.containsAll(vArchs1)) {
- return true;
- }
- return false;
- }
-
- private boolean sameModTypes (String modTypes1, String modTypes2) {
- return sameArchs(modTypes1, modTypes2);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java
deleted file mode 100644
index ad0e82ca3f..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/SurfaceAreaQuery.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/** @file
- This file is for surface area information retrieval.
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.platform.ui.global;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.Vector;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.BuildTargetList;
-import org.tianocore.LibraryClassDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.PackageDependenciesDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.FilenameDocument.Filename;
-
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-
-/**
- * SurfaceAreaQuery class is used to query Surface Area information from msa,
- * mbd, spd and fpd files.
- *
- * This class should not instantiated. All the public interfaces is static.
- *
- * @since GenBuild 1.0
- */
-public class SurfaceAreaQuery {
-
- public static String prefix = "http://www.TianoCore.org/2006/Edk2.0";
-
- // /
- // / Contains name/value pairs of Surface Area document object. The name is
- // / always the top level element name.
- // /
- private static Map<String, XmlObject> map = null;
-
- // /
- // / mapStack is used to do nested query
- // /
- private static Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();
-
- // /
- // / prefix of name space
- // /
- private static String nsPrefix = "sans";
-
- // /
- // / xmlbeans needs a name space for each Xpath element
- // /
- private static String ns = null;
-
- // /
- // / keep the namep declaration for xmlbeans Xpath query
- // /
- private static String queryDeclaration = null;
-
- /**
- * Set a Surface Area document for query later
- *
- * @param map
- * A Surface Area document in TopLevelElementName/XmlObject
- * format.
- */
- public static void setDoc(Map<String, XmlObject> map) {
- ns = prefix;
- queryDeclaration = "declare namespace " + nsPrefix + "='" + ns + "'; ";
- SurfaceAreaQuery.map = map;
- }
-
- /**
- * Push current used Surface Area document into query stack. The given new
- * document will be used for any immediately followed getXXX() callings,
- * untill pop() is called.
- *
- * @param newMap
- * The TopLevelElementName/XmlObject format of a Surface Area
- * document.
- */
- public static void push(Map<String, XmlObject> newMap) {
- mapStack.push(SurfaceAreaQuery.map);
- SurfaceAreaQuery.map = newMap;
- }
-
- /**
- * Discard current used Surface Area document and use the top document in
- * stack instead.
- */
- public static void pop() {
- SurfaceAreaQuery.map = mapStack.pop();
- }
-
- // /
- // / Convert xPath to be namespace qualified, which is necessary for
- // XmlBeans
- // / selectPath(). For example, converting /MsaHeader/ModuleType to
- // / /ns:MsaHeader/ns:ModuleType
- // /
- private static String normalizeQueryString(String[] exp, String from) {
- StringBuffer normQueryString = new StringBuffer(4096);
-
- int i = 0;
- while (i < exp.length) {
- String newExp = from + exp[i];
- Pattern pattern = Pattern.compile("([^/]*)(/|//)([^/]+)");
- Matcher matcher = pattern.matcher(newExp);
-
- while (matcher.find()) {
- String starter = newExp.substring(matcher.start(1), matcher
- .end(1));
- String seperator = newExp.substring(matcher.start(2), matcher
- .end(2));
- String token = newExp.substring(matcher.start(3), matcher
- .end(3));
-
- normQueryString.append(starter);
- normQueryString.append(seperator);
- normQueryString.append(nsPrefix);
- normQueryString.append(":");
- normQueryString.append(token);
- }
-
- ++i;
- if (i < exp.length) {
- normQueryString.append(" | ");
- }
- }
-
- return normQueryString.toString();
- }
-
- /**
- * Search all XML documents stored in "map" for the specified xPath, using
- * relative path (starting with '$this')
- *
- * @param xPath
- * xpath query string array
- * @returns An array of XmlObject if elements are found at the specified
- * xpath
- * @returns NULL if nothing is at the specified xpath
- */
- public static XmlObject[] get(String[] xPath) {
- if (map == null) {
- return null;
- }
-
- String[] keys = (String[]) map.keySet().toArray(new String[map.size()]);
- List<XmlObject> result = new ArrayList<XmlObject>();
- for (int i = 0; i < keys.length; ++i) {
- XmlObject rootNode = (XmlObject) map.get(keys[i]);
- if (rootNode == null) {
- continue;
- }
-
- String query = queryDeclaration
- + normalizeQueryString(xPath, "$this/" + keys[i]);
- XmlObject[] tmp = rootNode.selectPath(query);
- for (int j = 0; j < tmp.length; ++j) {
- result.add(tmp[j]);
- }
- }
-
- int size = result.size();
- if (size <= 0) {
- return null;
- }
-
- return (XmlObject[]) result.toArray(new XmlObject[size]);
- }
-
- /**
- * Search XML documents named by "rootName" for the given xPath, using
- * relative path (starting with '$this')
- *
- * @param rootName
- * The top level element name
- * @param xPath
- * The xpath query string array
- * @returns An array of XmlObject if elements are found at the given xpath
- * @returns NULL if nothing is found at the given xpath
- */
- public static XmlObject[] get(String rootName, String[] xPath) {
- if (map == null) {
- return null;
- }
-
- XmlObject root = (XmlObject) map.get(rootName);
- if (root == null) {
- return null;
- }
-
- String query = queryDeclaration
- + normalizeQueryString(xPath, "$this/" + rootName);
- XmlObject[] result = root.selectPath(query);
- if (result.length > 0) {
- return result;
- }
-
- query = queryDeclaration + normalizeQueryString(xPath, "/" + rootName);
- result = root.selectPath(query);
- if (result.length > 0) {
- return result;
- }
-
- return null;
- }
-
- /**
- * Retrieve SourceFiles/Filename for specified ARCH type
- *
- * @param arch
- * architecture name
- * @returns An 2 dimension string array if elements are found at the known
- * xpath
- * @returns NULL if nothing is found at the known xpath
- */
- public static String[][] getSourceFiles(String arch) {
- String[] xPath;
- XmlObject[] returns;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[] { "/Filename" };
- } else {
- xPath = new String[] { "/Filename[not(@SupArchList) or @SupArchList='"
- + arch + "']" };
- }
-
- returns = get("SourceFiles", xPath);
-
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- Filename[] sourceFileNames = (Filename[]) returns;
- String[][] outputString = new String[sourceFileNames.length][2];
- for (int i = 0; i < sourceFileNames.length; i++) {
- outputString[i][0] = sourceFileNames[i].getToolCode();
- outputString[i][1] = sourceFileNames[i].getStringValue();
- }
- return outputString;
- }
-
- /**
- * Retrieve /PlatformDefinitions/OutputDirectory from FPD
- *
- * @returns Directory names array if elements are found at the known xpath
- * @returns Empty if nothing is found at the known xpath
- */
- public static String getFpdOutputDirectory() {
- String[] xPath = new String[] { "/PlatformDefinitions/OutputDirectory" };
-
- XmlObject[] returns = get("FrameworkPlatformDescription", xPath);
- if (returns != null && returns.length > 0) {
- // String TBD
- }
-
- return null;
- }
-
- public static String getFpdIntermediateDirectories() {
- String[] xPath = new String[] { "/PlatformDefinitions/IntermediateDirectories" };
-
- XmlObject[] returns = get("FrameworkPlatformDescription", xPath);
- if (returns != null && returns.length > 0) {
- // TBD
- }
- return "UNIFIED";
- }
-
- public static String getBuildTarget() {
- String[] xPath = new String[] { "/PlatformDefinitions/BuildTargets" };
-
- XmlObject[] returns = get("FrameworkPlatformDescription", xPath);
- if (returns != null && returns.length > 0) {
- return ((BuildTargetList) returns[0]).getStringValue();
- }
-
- return null;
- }
-
- /**
- * Retrieve <xxxHeader>/ModuleType
- *
- * @returns The module type name if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public static String getModuleType(ModuleIdentification mi) {
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = WorkspaceProfile.getModuleXmlObject(mi);
-
- return msa.getMsaHeader().getModuleType()+"";
- }
-
- /**
- * Retrieve PackageDependencies/Package
- *
- * @param arch
- * Architecture name
- *
- * @returns package name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
-
- public static PackageIdentification[] getDependencePkg(String arch, ModuleIdentification mi){
-
- String packageGuid = null;
- String packageVersion = null;
-
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea) WorkspaceProfile.getModuleXmlObject(mi);
- if (msa.getPackageDependencies() == null) {
- return new PackageIdentification[0];
- }
- int size = msa.getPackageDependencies().getPackageList().size();
- XmlObject[] returns = new XmlObject[size];
- for (int i = 0; i < size; ++i) {
- returns[i] = msa.getPackageDependencies().getPackageList().get(i);
- }
-
- PackageIdentification[] packageIdList = new PackageIdentification[returns.length];
- for (int i = 0; i < returns.length; i++) {
- PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];
- packageGuid = item.getPackageGuid();
- packageVersion = item.getPackageVersion();
-
- Iterator<PackageIdentification> ispi = GlobalData.vPackageList.iterator();
- String ver = "";
- while(ispi.hasNext()) {
- PackageIdentification pi = ispi.next();
- if (packageVersion != null) {
- if (pi.getGuid().equalsIgnoreCase(packageGuid) && pi.getVersion().equals(packageVersion)) {
- packageIdList[i] = pi;
- break;
- }
- }
- else {
- if (pi.getGuid().equalsIgnoreCase(packageGuid)) {
- if (pi.getVersion() != null && pi.getVersion().compareTo(ver) > 0){
- ver = pi.getVersion();
- packageIdList[i] = pi;
- }
- else if (packageIdList[i] == null){
- packageIdList[i] = pi;
- }
- }
- }
-
- }
- }
- return packageIdList;
- }
-
- /**
- * Retrieve LibraryClassDefinitions/LibraryClass for specified usage
- *
- * @param usage
- * Library class usage
- *
- * @returns LibraryClass objects list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public static Vector<LibraryClassDescriptor> getLibraryClasses(String usage, ModuleIdentification mi){
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)WorkspaceProfile.getModuleXmlObject(mi);
- Vector<LibraryClassDescriptor> libraryClassInfo = new Vector<LibraryClassDescriptor>();
- if (msa.getLibraryClassDefinitions() == null) {
- return libraryClassInfo;
- }
-
- int size = msa.getLibraryClassDefinitions().getLibraryClassList().size();
-
- for (int i = 0; i < size; i++) {
- LibraryClassDocument.LibraryClass libClass = msa.getLibraryClassDefinitions().getLibraryClassList().get(i);
- if (usage.equals(libClass.getUsage().toString())) {
-
- libraryClassInfo.add(new LibraryClassDescriptor(libClass.getKeyword(), libClass.getSupArchList()+"", libClass.getSupModuleList()+""));
- }
- }
-
- return libraryClassInfo;
- }
-
- public static XmlObject[] getSpdPcdDeclarations(PackageIdentification pi) {
- XmlObject[] returns = null;
- PackageSurfaceAreaDocument.PackageSurfaceArea psa = WorkspaceProfile.getPackageXmlObject(pi);
- if (psa.getPcdDeclarations() != null && psa.getPcdDeclarations().getPcdEntryList() != null) {
- int size = psa.getPcdDeclarations().getPcdEntryList().size();
- returns = new XmlObject[size];
- for (int i = 0; i < size; ++i) {
- returns[i] = psa.getPcdDeclarations().getPcdEntryList().get(i);
- }
- }
-
- return returns;
- }
-
-}
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java
deleted file mode 100644
index 954cda112c..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/platform/ui/global/WorkspaceProfile.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/** @file
- WorkspaceProfile class.
-
- WorkspaceProfile provide initializing, instoring, querying and update global data.
- It is a bridge to intercommunicate between multiple component, such as AutoGen,
- PCD and so on.
-
-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.
-**/
-package org.tianocore.frameworkwizard.platform.ui.global;
-
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.PcdCodedDocument;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import java.util.Iterator;
-import java.util.ListIterator;
-import java.util.Vector;
-
-/**
- WorkspaceProfile provide initializing, instoring, querying and update global data.
- It is a bridge to intercommunicate between multiple component, such as AutoGen,
- PCD and so on.
-
- <p>Note that all global information are initialized incrementally. All data will
- parse and record only of necessary during build time. </p>
-
- @since GenBuild 1.0
-**/
-public class WorkspaceProfile {
- ///
- /// Record current WORKSPACE Directory
- ///
- private static String workspaceDir = "";
-
- /**
- Get the current WORKSPACE Directory.
-
- @return current workspace directory
- **/
- public synchronized static String getWorkspacePath() {
- return workspaceDir;
- }
-
- public synchronized static PackageIdentification getPackageForModule(ModuleIdentification moduleId) {
- //
- // If package already defined in module
- //
- if (moduleId.getPackageId() != null) {
- return moduleId.getPackageId();
- }
-
- return null;
- }
- //
- // expanded by FrameworkWizard
- //
- public synchronized static ModuleSurfaceAreaDocument.ModuleSurfaceArea getModuleXmlObject(ModuleIdentification moduleId) {
- return GlobalData.openingModuleList.getModuleSurfaceAreaFromId(moduleId);
- }
-
- public synchronized static PackageSurfaceAreaDocument.PackageSurfaceArea getPackageXmlObject(PackageIdentification packageId) {
- return GlobalData.openingPackageList.getPackageSurfaceAreaFromId(packageId);
- }
-
- public static ModuleIdentification getModuleId(String key){
- //
- // Get ModuleGuid, ModuleVersion, PackageGuid, PackageVersion, Arch into string array.
- //
- String[] keyPart = key.split(" ");
-
- Iterator<ModuleIdentification> iMiList = GlobalData.vModuleList.iterator();
-
- while (iMiList.hasNext()) {
- ModuleIdentification mi = iMiList.next();
- if (mi.getGuid().equalsIgnoreCase(keyPart[0])){
- if (keyPart[1] != null && keyPart[1].length() > 0 && !keyPart[1].equals("null")){
- if(!mi.getVersion().equals(keyPart[1])){
- continue;
- }
- }
-
- PackageIdentification pi = mi.getPackageId();
- if ( !pi.getGuid().equalsIgnoreCase(keyPart[2])){
- continue;
- }
- if (keyPart[3] != null && keyPart[3].length() > 0 && !keyPart[3].equals("null")){
- if(!pi.getVersion().equals(keyPart[3])){
- continue;
- }
- }
- return mi;
- }
- }
-
- return null;
- }
-
- public static Vector<String> getModuleSupArchs(ModuleIdentification mi){
- Vector<String> vArchs = null;
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);
- if (msa.getModuleDefinitions() == null || msa.getModuleDefinitions().getSupportedArchitectures() == null) {
- return vArchs;
- }
- ListIterator li = msa.getModuleDefinitions().getSupportedArchitectures().listIterator();
- while (li.hasNext()) {
- if (vArchs == null) {
- vArchs = new Vector<String>();
- }
- vArchs.add((String)li.next());
- }
-
- return vArchs;
- }
-
- public static String getModuleType (ModuleIdentification mi) {
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = getModuleXmlObject(mi);
- if (msa.getMsaHeader() == null || msa.getMsaHeader().getModuleType() == null) {
- return null;
- }
- return msa.getMsaHeader().getModuleType().toString();
- }
-
- public static boolean pcdInMsa (String cName, String tsGuid, String supArchList, ModuleIdentification mi) {
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea)getModuleXmlObject(mi);
- if (msa.getPcdCoded() == null || msa.getPcdCoded().getPcdEntryList() == null) {
- return false;
- }
- ListIterator li = msa.getPcdCoded().getPcdEntryList().listIterator();
- while (li.hasNext()) {
- PcdCodedDocument.PcdCoded.PcdEntry msaPcd = (PcdCodedDocument.PcdCoded.PcdEntry)li.next();
- if (msaPcd.getCName().equals(cName) && msaPcd.getTokenSpaceGuidCName().equals(tsGuid)) {
- if (supArchList != null && msaPcd.getSupArchList() != null) {
- if (msaPcd.getSupArchList().toString().toLowerCase().contains(supArchList.trim().toLowerCase())) {
- return true;
- }
- }
- else{
- return true;
- }
- }
- }
- return false;
- }
-
-}
-
-
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
deleted file mode 100644
index 0c23b6a854..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/Preferences.java
+++ /dev/null
@@ -1,1152 +0,0 @@
-/** @file
- <<The file is used to update the Build Preferences file, target.txt>>
-
- <<The program will use target.txt, the tools config file specified in that file,
- or it will use the default tools_def.txt file, and it will also scan the
- FrameworkDatabase.db file for certain parameters. >>
-
- 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.
-
- Package Name: Tools
- Module Name: FrameworkWizard
-
- **/
-
-package org.tianocore.frameworkwizard.toolchain;
-
-import java.awt.event.ActionEvent;
-import java.io.*;
-import java.util.Vector;
-import java.util.Iterator;
-import java.util.Scanner;
-
-import javax.swing.*;
-import javax.swing.JScrollPane;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.ui.ArchCheckBox;
-import org.tianocore.frameworkwizard.common.ui.iCheckBoxList.*;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-import org.tianocore.frameworkwizard.workspace.WorkspaceTools;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-import org.tianocore.PlatformSurfaceAreaDocument;
-
-/**
- * The class is used to update the target.txt file.
- *
- * It extends IDialog
- *
- */
-public class Preferences extends IFrame {
-
- // /
- // / Define class Serial Version UID
- // /
- private static final long serialVersionUID = -4777906991966638888L;
-
- private final boolean Debug = false;
-
- //
- // Define class members
- //
- private final int oneRowHeight = 20;
-
- private final int twoRowHeight = 40;
-
- private final int threeRowHeight = 60;
-
- private final int sepHeight = 6;
-
- private final int rowOne = 12;
-
- private final int rowTwo = rowOne + oneRowHeight + sepHeight;
-
- private final int rowThree = rowTwo + oneRowHeight + sepHeight;
-
- private final int rowFour = rowThree + threeRowHeight + sepHeight;
-
- private final int rowFive = rowFour + threeRowHeight + sepHeight;
-
- private final int rowSix = rowFive + oneRowHeight + sepHeight;
-
- private final int buttonRow = rowSix + oneRowHeight + sepHeight + sepHeight;
-
- private final int dialogHeight = buttonRow + twoRowHeight + twoRowHeight;
-
- private final int dialogWidth = 540;
-
- private final int lastButtonXLoc = 430;
-
- private final int next2LastButtonLoc = 329;
-
- /*
- * Define the contents for this dialog box
- */
- private static Preferences bTarget = null;
-
- private WorkspaceTools wt = new WorkspaceTools();
-
- private final int activePlatformId = 0;
-
- private final int buildTargetId = 1;
-
- private final int targetArchId = 2;
-
- private final int toolDefFileId = 3;
-
- private final int tagNameId = 4;
-
- private final int threadEnableId = 5;
-
- private final int threadCountId = 6;
-
- private final int maxTargetLines = threadCountId + 1;
-
- private JPanel jContentPane = null;
-
- private JLabel jLabelToolsConfigFile = null;
-
- private JTextField jTextFieldToolsConfigFile = null;
-
- private final int toolConfigFileRow = rowOne;
-
- private JLabel jLabelActivePlatform = null;
-
- private JComboBox jComboBoxActivePlatform = null;
-
- private final int activePlatformRow = rowTwo;
-
- private JLabel jLabelToolChainTagName = null;
-
- private JScrollPane jScrollPaneTagName = null;
-
- private ICheckBoxList iCheckBoxListTagName = null;
-
- private final int toolChainTagNameRow = rowThree;
-
- private JLabel jLabelBuildTarget = null;
-
- private JScrollPane jScrollPaneBuildTarget = null;
-
- private ICheckBoxList iCheckBoxListBuildTarget = null;
-
- private final int buildTargetRow = rowFour;
-
- private JLabel jLabelTargetArch = null;
-
- private ArchCheckBox jArchCheckBox = null;
-
- private final int targetArchRow = rowFive;
-
- private JLabel jLabelEnableThreads = null;
-
- private JLabel jLabelThreadCount = null;
-
- private final int threadRow = rowSix;
-
- private JCheckBox jCheckBoxEnableThreads = null;
-
- private JTextField jTextFieldThreadCount = null;
-
- private String threadCount = "";
-
- private boolean threadEnabled = false;
-
- private JButton jButtonBrowse = null;
-
- private JButton jButtonSave = null;
-
- private JButton jButtonCancel = null;
-
- private final int labelColumn = 12;
-
- private final int labelWidth = 155;
-
- private final int valueColumn = 168;
-
- private final int valueWidth = 352;
-
- private final int valueWidthShort = 260;
-
- private final int buttonWidth = 90;
-
- private String workspaceDir = Workspace.getCurrentWorkspace() + System.getProperty("file.separator");
-
- private String toolsDir = Workspace.getCurrentWorkspace() + System.getProperty("file.separator") + "Tools"
- + System.getProperty("file.separator") + "Conf";
-
- private String defaultToolsConf = toolsDir + System.getProperty("file.separator") + "tools_def.txt";
-
- private String targetFile = toolsDir + System.getProperty("file.separator") + "target.txt";
-
- private String[] targetFileContents = new String[500];
-
- // private String[] toolsConfContents;
-
- private String[] targetLines = new String[maxTargetLines];
-
- private int targetLineNumber[] = new int[maxTargetLines];
-
- private String toolsConfFile;
-
- private String toolsDefTargetNames = null;
-
- private final int toolsDefTargetNameField = 0;
-
- private String toolsDefTagNames = null;
-
- private final int toolsDefTagNameField = 1;
-
- private String toolsDefArchNames = null;
-
- private final int toolsDefArchNameField = 2;
-
- private String toolsDefIdentifier = null;
-
- private int targetLineNumberMax;
-
- private final int toolDefFieldCount = 5;
-
- private Vector<String> vArchList = null;
-
- private Vector<String> vDisableArchList = null;
-
- //
- // Not used by UI
- //
- // private Preferences id = null;
-
- // private EnumerationData ed = new EnumerationData();
-
- /**
- This method initializes jTextFieldToolsConfigFile
-
- @return javax.swing.JTextField jTextFieldToolsConfigFile
- **/
- private JTextField getJTextFieldToolsConfigFile() {
- if (jTextFieldToolsConfigFile == null) {
- if (targetLines[toolDefFileId] != null) {
- String sLine[] = targetLines[toolDefFileId].trim().split("=");
- jTextFieldToolsConfigFile = new JTextField(sLine[1].trim());
- } else
- jTextFieldToolsConfigFile = new JTextField();
-
- jTextFieldToolsConfigFile.setBounds(new java.awt.Rectangle(valueColumn, toolConfigFileRow, valueWidthShort,
- oneRowHeight));
- jTextFieldToolsConfigFile.setPreferredSize(new java.awt.Dimension(valueWidthShort, oneRowHeight));
- jTextFieldToolsConfigFile
- .setToolTipText("<html>"
- + "Specify the name of the filename to use for specifying"
- + "<br>the tools to use for the build. If not specified,"
- + "<br>tools_def.txt will be used for the build. This file"
- + "<br>MUST be located in the WORKSPACE/Tools/Conf directory.</html>");
-
- }
- return jTextFieldToolsConfigFile;
- }
-
- /**
- * This method initializes jComboBoxActivePlatform
- *
- * @return javax.swing.JComboBox jComboBoxActivePlatform
- *
- */
- private JComboBox getActivePlatform() {
- Vector<PlatformIdentification> vPlatformId = wt.getAllPlatforms();
-
- if (jComboBoxActivePlatform == null) {
- jComboBoxActivePlatform = new JComboBox();
- jComboBoxActivePlatform.setBounds(new java.awt.Rectangle(valueColumn, activePlatformRow, valueWidth,
- oneRowHeight));
- jComboBoxActivePlatform.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
- jComboBoxActivePlatform
- .setToolTipText("<html>Select &quot;Do Not Set&quot; if you want to build a platform"
- + "<br>from the directory where the FPD file exists,"
- + "<br>otherwise scroll down to select the platform.</html>");
-
- /*
- * Generate the data, selecting what is in target.txt
- */
- jComboBoxActivePlatform.addItem("Do Not Set");
- Iterator<PlatformIdentification> iter = vPlatformId.iterator();
- while (iter.hasNext()) {
- PlatformIdentification item = iter.next();
- String path = item.getPath().trim();
- String str = path.substring(workspaceDir.length(), path.length());
- str.replace(System.getProperty("file.separator"), "/");
- jComboBoxActivePlatform.addItem(str.trim());
- }
- if (targetLines[activePlatformId] == null)
- jComboBoxActivePlatform.setSelectedItem("Do Not Set");
- else
- jComboBoxActivePlatform.setSelectedItem(targetLines[activePlatformId]);
- }
- return jComboBoxActivePlatform;
- }
-
- /**
- * This method initializes jScrollPaneTagName
- *
- * @return javax.swing.JScrollPane jScrollPaneTagName
- *
- */
- private JScrollPane getJScrollPaneTagName() {
-
- if (jScrollPaneTagName == null) {
- jScrollPaneTagName = new JScrollPane();
- jScrollPaneTagName.setBounds(new java.awt.Rectangle(valueColumn, toolChainTagNameRow, valueWidth,
- threeRowHeight));
- jScrollPaneTagName.setPreferredSize(new java.awt.Dimension(valueWidth, threeRowHeight));
- jScrollPaneTagName.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneTagName.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
- jScrollPaneTagName.setViewportView(getICheckBoxListTagName());
- jScrollPaneTagName.setToolTipText("<html>"
- + "Specify the TagName(s) from the tool configuration file to use"
- + "<br>for your builds. If not specified, all applicable TagName"
- + " <br>tools will be used for the build.</html>");
- jScrollPaneTagName.setVisible(true);
-
- }
- return jScrollPaneTagName;
- }
-
- private ICheckBoxList getICheckBoxListTagName() {
- if (iCheckBoxListTagName == null) {
- iCheckBoxListTagName = new ICheckBoxList();
-
- if (toolsDefTagNames != null) {
- toolsDefTagNames.trim();
- String aTagNames[] = toolsDefTagNames.trim().split(" ");
- Vector<String> vTags = new Vector<String>();
- for (int i = 0; i < aTagNames.length; i++) {
- vTags.add(aTagNames[i]);
- }
- iCheckBoxListTagName.setAllItems(vTags);
- } else {
- Vector<String> defaultTags = stringToVector("MYTOOLS");
- iCheckBoxListTagName.setAllItems(defaultTags);
- }
-
- iCheckBoxListTagName.setAllItemsUnchecked();
- iCheckBoxListTagName.setToolTipText("<html>"
- + "Specify the TagName(s) from the tool configuration file to use"
- + "<br>for your builds. If not specified, all applicable TagName"
- + " <br>tools will be used for the build.</html>");
- Vector<String> vSelectedTags = new Vector<String>();
- if (targetLines[tagNameId] != null) {
- targetLines[tagNameId].trim();
- String targetTags[] = targetLines[tagNameId].trim().split(" ");
- for (int j = 0; j < targetTags.length; j++)
- vSelectedTags.add(targetTags[j]);
- iCheckBoxListTagName.initCheckedItem(true, vSelectedTags);
- }
- }
- return iCheckBoxListTagName;
- }
-
- /**
- * This method initializes jScrollPaneBuildTarget
- *
- * @return javax.swing.JComboBox jScrollPaneBuildTarget
- *
- */
- private JScrollPane getJScrollPaneBuildTarget() {
- if (jScrollPaneBuildTarget == null) {
- jScrollPaneBuildTarget = new JScrollPane();
- jScrollPaneBuildTarget.setBounds(new java.awt.Rectangle(valueColumn, buildTargetRow, valueWidth,
- threeRowHeight));
- jScrollPaneBuildTarget.setPreferredSize(new java.awt.Dimension(valueWidth, threeRowHeight));
- jScrollPaneBuildTarget.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
- jScrollPaneBuildTarget.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
- jScrollPaneBuildTarget.setViewportView(getICheckBoxListBuildTarget());
- jScrollPaneBuildTarget.setVisible(true);
- jScrollPaneBuildTarget.setToolTipText("<html>"
- + "Select the TARGET Names that you want to build, such as<BR>"
- + "BUILD or BUILD and RELEASE"
- + "<br>If you do not set any of these, all available targets"
- + "<br>will be built.</html>");
-
- }
- return jScrollPaneBuildTarget;
- }
-
- private JCheckBox getCheckBoxEnableThreads() {
- if (jCheckBoxEnableThreads == null) {
- jCheckBoxEnableThreads = new JCheckBox();
- jCheckBoxEnableThreads.setBounds(valueColumn, threadRow, 20, oneRowHeight);
- jCheckBoxEnableThreads.setToolTipText("Select this if you want to enable parallel compilation.");
- jCheckBoxEnableThreads.setSelected(threadEnabled);
- jCheckBoxEnableThreads.addActionListener(this);
-
- }
- return jCheckBoxEnableThreads;
- }
-
- private JTextField getTextFieldThreadCount() {
- if (jTextFieldThreadCount == null) {
- jTextFieldThreadCount = new JTextField();
- jTextFieldThreadCount.setBounds(valueColumn + 215, threadRow, 30, oneRowHeight);
- if (threadCount.length() > 0)
- jTextFieldThreadCount.setText(threadCount);
- jTextFieldThreadCount.setToolTipText("<html>Recommended setting is N+1,<br> where N is the number of physical processors or cores in the system</html>");
- // If CheckBoxEnableThreads is selected, then enable editing
-
- }
- return jTextFieldThreadCount;
- }
-
- private ICheckBoxList getICheckBoxListBuildTarget() {
- if (iCheckBoxListBuildTarget == null) {
-
- String aBuildTargets[] = toolsDefTargetNames.trim().split(" ");
- Vector<String> vBuildTargets = new Vector<String>();
- for (int i = 0; i < aBuildTargets.length; i++) {
- vBuildTargets.add(aBuildTargets[i]);
- }
- iCheckBoxListBuildTarget = new ICheckBoxList();
- iCheckBoxListBuildTarget.setAllItems(vBuildTargets);
- iCheckBoxListBuildTarget.setAllItemsUnchecked();
- iCheckBoxListBuildTarget.setToolTipText("<html>"
- + "Select the TARGET Names that you want to build, such as<BR>"
- + "BUILD or BUILD and RELEASE"
- + "<br>If you do not set any of these, all available targets"
- + "<br>will be built.</html>");
-
- Vector<String> vSelectedTags = new Vector<String>();
- if (targetLines[buildTargetId] != null) {
- targetLines[buildTargetId].trim();
- String targetTags[] = targetLines[buildTargetId].trim().split(" ");
- for (int j = 0; j < targetTags.length; j++)
- vSelectedTags.add(targetTags[j]);
- iCheckBoxListBuildTarget.initCheckedItem(true, vSelectedTags);
- }
- }
- return iCheckBoxListBuildTarget;
- }
-
- /**
- This method initializes jButtonBrowse
-
- @return javax.swing.JButton
- **/
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse
- .setBounds(new java.awt.Rectangle(lastButtonXLoc, toolConfigFileRow, buttonWidth, oneRowHeight));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.setPreferredSize(new java.awt.Dimension(buttonWidth, oneRowHeight));
- jButtonBrowse.addActionListener(new AbstractAction() {
- /**
- *
- */
- private static final long serialVersionUID = 1L;
-
- public void actionPerformed(ActionEvent e) {
- //
- // Select files from current workspace
- //
- String dirPrefix = toolsDir + System.getProperty("file.separator");
- JFileChooser chooser = new JFileChooser(dirPrefix);
- File theFile = null;
- // String headerDest = null;
-
- chooser.setMultiSelectionEnabled(false);
- chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
- int retval = chooser.showOpenDialog(Preferences.this);
- if (retval == JFileChooser.APPROVE_OPTION) {
-
- theFile = chooser.getSelectedFile();
- String file = theFile.getPath();
- if (!file.startsWith(dirPrefix)) {
- JOptionPane.showMessageDialog(Preferences.this, "You can only select files in the Tools"
- + System.getProperty("file.separator")
- + "Conf directory!");
-
- return;
- }
-
- jTextFieldToolsConfigFile.setText("Tools/Conf/" + theFile.getName());
- } else {
- return;
- }
- }
- });
- }
- return jButtonBrowse;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonSave() {
- if (jButtonSave == null) {
- jButtonSave = new JButton();
- jButtonSave.setBounds(new java.awt.Rectangle(next2LastButtonLoc, buttonRow, buttonWidth, oneRowHeight));
- jButtonSave.setText("Save");
- jButtonSave.addActionListener(this);
- }
- return jButtonSave;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- *
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(lastButtonXLoc, buttonRow, buttonWidth, oneRowHeight));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- public static Preferences getInstance() {
- if (bTarget == null) {
- bTarget = new Preferences();
- }
- return bTarget;
- }
-
- /**
- * This is the default constructor
- */
- public Preferences() {
- super();
- init();
- }
-
- /**
- * This method initializes this
- *
- */
- private void init() {
- for (int i = 0; i < maxTargetLines; i++) {
- targetLines[i] = null;
- targetLineNumber[i] = -1;
- }
- initReadFiles();
- this.setSize(dialogWidth, dialogHeight);
- this.setContentPane(getJContentPane());
- this.setTitle("Build Preferences [" + toolsDefIdentifier + "]");
- this.setDefaultCloseOperation(IFrame.DISPOSE_ON_CLOSE);
- this.centerWindow();
- this.setVisible(true);
- }
-
- /**
- * This method initializes this Fill values to all fields if these values are
- * not empty
- *
- * @param initReadFiles
- *
- */
- private void initReadFiles() {
- /*
- * TODO
- * Read Current target.txt file first
- * Read TOOL_CHAIN_CONF file if specified, otherwise use tools_def.txt
- */
- readTargetTxtFile();
- boolean haveBuildTargets = readToolDefinitionFile();
- if (!haveBuildTargets) {
- // Lookup Build Targets from the platforms
- readPlatformFileBuildTargets();
- }
- }
-
- private void readPlatformFileBuildTargets() {
- Vector<PlatformIdentification> vPlatformId = wt.getAllPlatforms();
- String sBuildTargets = "";
-
- // foreach platform, build a list of BuildTargets
- Iterator<PlatformIdentification> iter = vPlatformId.iterator();
- while (iter.hasNext()) {
- PlatformIdentification item = iter.next();
- PlatformSurfaceAreaDocument.PlatformSurfaceArea fpd = GlobalData.openingPlatformList
- .getOpeningPlatformById(
- item)
- .getXmlFpd();
- sBuildTargets += fpd.getPlatformDefinitions().getBuildTargets().toString() + " ";
- }
- String allTargets[] = sBuildTargets.trim().split(" ");
- for (int i = 0; i < allTargets.length; i++) {
- if (!toolsDefTargetNames.contains(allTargets[i])) {
- toolsDefTargetNames += allTargets[i] + " ";
- }
- }
- }
-
- private boolean readToolDefinitionFile() {
-
- // Parse the tool definition file looking for targets and architectures
- toolsConfFile = null;
- boolean buildTargetsExist = true;
-
- if (targetLines[toolDefFileId] != null) {
- String[] result = new String[2];
- targetLines[toolDefFileId].trim();
- result = (targetLines[toolDefFileId]).split("=");
- String resString = (Tools.convertPathToCurrentOsType(result[1])).trim();
- toolsConfFile = workspaceDir.trim() + resString.trim();
- File toolsDefFile = new File(toolsConfFile);
- if (!toolsDefFile.exists()) {
- JOptionPane.showMessageDialog(this, "<html>" + "Tool Definition file, " + toolsConfFile
- + "<br>specified in the target.txt file does not exist!"
- + "<br>Using the default Tool Definition File:<br>"
- + defaultToolsConf);
- toolsConfFile = defaultToolsConf;
- }
- } else {
- toolsConfFile = defaultToolsConf;
- }
- String[] toolsDefFields = new String[toolDefFieldCount];
- for (int i = 0; i < toolDefFieldCount; i++)
- toolsDefFields[i] = null;
- File toolDefFile = new File(toolsConfFile);
- if (toolDefFile.exists()) {
- try {
- FileReader fileReader = new FileReader(toolDefFile);
- BufferedReader reader = new BufferedReader(fileReader);
- String rLine = null;
- String result[];
- int lineCounter = 0;
- while ((rLine = reader.readLine()) != null) {
-
- if (rLine.startsWith("IDENTIFIER")) {
- result = rLine.split("=");
- toolsDefIdentifier = (result[1]).trim();
- } else if ((!rLine.startsWith("#")) && (rLine.contains("="))) {
- result = rLine.split("=");
- toolsDefFields = ((result[0]).trim()).split("_");
- if (toolsDefTargetNames == null) {
- toolsDefTargetNames = (toolsDefFields[toolsDefTargetNameField]).trim() + " ";
- } else if (!toolsDefTargetNames.contains((toolsDefFields[toolsDefTargetNameField]).trim())) {
- toolsDefTargetNames += (toolsDefFields[toolsDefTargetNameField]).trim() + " ";
- }
- if (toolsDefTagNames == null) {
- toolsDefTagNames = (toolsDefFields[toolsDefTagNameField]).trim() + " ";
- } else if (!toolsDefTagNames.contains((toolsDefFields[toolsDefTagNameField]).trim())) {
- toolsDefTagNames += (toolsDefFields[toolsDefTagNameField]).trim() + " ";
- }
- if (toolsDefArchNames == null) {
- toolsDefArchNames = (toolsDefFields[toolsDefArchNameField]).trim() + " ";
- } else if (!toolsDefArchNames.contains((toolsDefFields[toolsDefArchNameField]).trim())) {
- toolsDefArchNames += (toolsDefFields[toolsDefArchNameField]).trim() + " ";
- }
- }
- lineCounter++;
- }
- reader.close();
- // Only enable Architecture selection based on tool chain installations
- String turnOff = "";
- if (!toolsDefArchNames.contains("EBC"))
- turnOff = "EBC ";
- if (!toolsDefArchNames.contains("PPC"))
- turnOff += "PPC ";
- if (!toolsDefArchNames.contains("IPF"))
- turnOff += "IPF ";
- if (!toolsDefArchNames.contains("X64"))
- turnOff += "X64 ";
- if (!toolsDefArchNames.contains("IA32"))
- turnOff += "X64 ";
- if (!toolsDefArchNames.contains("ARM"))
- turnOff += "ARM ";
- turnOff = turnOff.trim();
- vDisableArchList = stringToVector(turnOff);
-
- if (!toolsDefTargetNames.matches("[A-Z]+")) {
- toolsDefTargetNames = toolsDefTargetNames.replace("* ", "").trim();
- if (Debug)
- System.out.println("tools_def file does not define build targets: '" + toolsDefTargetNames
- + "'");
- buildTargetsExist = false;
- }
- } catch (IOException e) {
- Log.log(toolsConfFile + " Read Error ", e.getMessage());
- e.printStackTrace();
- }
- }
- return buildTargetsExist;
- }
-
- private void readTargetTxtFile() {
- File tFile = new File(targetFile);
-
- if (tFile.exists()) {
- try {
- FileReader fileReader = new FileReader(targetFile);
- BufferedReader reader = new BufferedReader(fileReader);
- targetLineNumberMax = 0;
- String rLine = null;
- while ((rLine = reader.readLine()) != null) {
- targetFileContents[targetLineNumberMax] = rLine;
- if (rLine.startsWith("ACTIVE_PLATFORM")) {
- // Only one active platform is permitted!
- targetLines[activePlatformId] = rLine;
- targetLineNumber[activePlatformId] = targetLineNumberMax;
- }
- if ((rLine.startsWith("TARGET" + " ")) || (rLine.startsWith("TARGET" + "\t"))
- || (rLine.startsWith("TARGET="))) {
- // Handle multiple Target Names
- if (rLine.contains(","))
- targetLines[buildTargetId] = rLine.trim().replaceAll(",", " ");
- else
- targetLines[buildTargetId] = rLine.trim();
- targetLineNumber[buildTargetId] = targetLineNumberMax;
- }
- if (rLine.startsWith("TARGET_ARCH")) {
- // Handle multiple Target Architectures
- if (rLine.contains(","))
- targetLines[targetArchId] = rLine.trim().replaceAll(",", " ");
- else
- targetLines[targetArchId] = rLine.trim();
- targetLineNumber[targetArchId] = targetLineNumberMax;
- }
- if (rLine.startsWith("TOOL_CHAIN_CONF")) {
- // Only one file is permitted
- targetLines[toolDefFileId] = rLine.trim();
- targetLineNumber[toolDefFileId] = targetLineNumberMax;
- }
-
- if (rLine.startsWith("TOOL_CHAIN_TAG")) {
- // Handle multiple Tool TagNames
- if (rLine.contains(","))
- targetLines[tagNameId] = rLine.trim().replaceAll(",", " ");
- else
- targetLines[tagNameId] = rLine.trim();
- targetLineNumber[tagNameId] = targetLineNumberMax;
- }
-
- if (rLine.startsWith("MULTIPLE_THREAD")) {
- // Handle Thread Enable flag
- targetLines[threadEnableId] = rLine.trim();
- targetLineNumber[threadEnableId] = targetLineNumberMax;
- if ((rLine.trim().toLowerCase().contains("enabled")) || (rLine.trim().toLowerCase().contains("true"))) {
- threadEnabled = true;
- } else {
- threadEnabled = false;
- }
- }
-
- if (rLine.startsWith("MAX_CONCURRENT_THREAD_NUMBER")) {
- // Handle Thread Enable flag
- targetLines[threadCountId] = rLine.trim();
- targetLineNumber[threadCountId] = targetLineNumberMax;
- }
- targetLineNumberMax++;
- }
- reader.close();
- String archLine[] = new String[2];
- if (targetLines[targetArchId] != null) {
- if (targetLines[targetArchId].contains("=")) {
- if (targetLines[targetArchId].contains(","))
- targetLines[targetArchId] = targetLines[targetArchId].trim().replaceAll(",", " ");
- if (targetLines[targetArchId].length() > 0)
- archLine = targetLines[targetArchId].trim().split("=");
- vArchList = stringToVector(archLine[1]);
- }
- }
-
- if (targetLines[threadCountId] != null) {
- String tcLine[] = new String[2];
- tcLine = targetLines[threadCountId].trim().split("=");
- threadCount = tcLine[1];
- } else
- threadCount = "";
-
- if (Debug == true)
- for (int i = 0; i <= maxTargetLines; i++)
- System.out.println("targetLines[" + i + "] contains: " + targetLines[i] + " index is: "
- + targetLineNumber[i]);
- } catch (IOException e) {
- Log.log(this.targetFile + " Read Error ", e.getMessage());
- e.printStackTrace();
- }
- }
-
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel jContentPane
- *
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabelToolsConfigFile = new JLabel();
- jLabelToolsConfigFile.setBounds(new java.awt.Rectangle(labelColumn, toolConfigFileRow, labelWidth,
- oneRowHeight));
- jLabelToolsConfigFile.setText("Tool Chain Definition File");
- jLabelActivePlatform = new JLabel();
- jLabelActivePlatform.setText("Select Active Platform");
- jLabelActivePlatform.setBounds(new java.awt.Rectangle(labelColumn, activePlatformRow, labelWidth,
- oneRowHeight));
- jLabelToolChainTagName = new JLabel();
- jLabelToolChainTagName.setBounds(new java.awt.Rectangle(labelColumn, toolChainTagNameRow, labelWidth,
- oneRowHeight));
- jLabelToolChainTagName.setText("Select Tool Tag Name");
- jLabelBuildTarget = new JLabel();
- jLabelBuildTarget.setBounds(new java.awt.Rectangle(labelColumn, buildTargetRow, labelWidth, oneRowHeight));
- jLabelBuildTarget.setText("Select Build Target");
- jLabelTargetArch = new JLabel();
- jLabelTargetArch.setBounds(new java.awt.Rectangle(labelColumn, targetArchRow, labelWidth, oneRowHeight));
- jLabelTargetArch.setText("Build Architectures");
-
- jArchCheckBox = new ArchCheckBox();
- jArchCheckBox.setBounds(new java.awt.Rectangle(valueColumn, targetArchRow, valueWidth, oneRowHeight));
- jArchCheckBox.setPreferredSize(new java.awt.Dimension(valueWidth, oneRowHeight));
-
- jLabelEnableThreads = new JLabel();
- jLabelEnableThreads.setBounds(new java.awt.Rectangle(labelColumn, threadRow, labelWidth, oneRowHeight));
- jLabelEnableThreads.setText("Enable Compiler Threading");
-
- jLabelThreadCount = new JLabel();
- jLabelThreadCount.setBounds(new java.awt.Rectangle(valueColumn + 60, threadRow, labelWidth, oneRowHeight));
- jLabelThreadCount.setText("Number of threads to start");
-
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.setPreferredSize(new java.awt.Dimension(dialogWidth - 10, dialogHeight - 10));
-
- jContentPane.add(jLabelToolsConfigFile, null);
- jContentPane.add(getJTextFieldToolsConfigFile(), null);
- jContentPane.add(getJButtonBrowse(), null);
-
- jContentPane.add(jLabelActivePlatform, null);
- jContentPane.add(getActivePlatform(), null);
-
- jContentPane.add(jLabelToolChainTagName, null);
- jContentPane.add(getJScrollPaneTagName(), null);
-
- jContentPane.add(jLabelBuildTarget, null);
- jContentPane.add(getJScrollPaneBuildTarget(), null);
-
- jContentPane.add(jLabelTargetArch, null);
-
- jArchCheckBox.setDisabledItems(vDisableArchList);
- jArchCheckBox.setSelectedItems(vArchList);
- jContentPane.add(jArchCheckBox, null);
-
- jContentPane.add(jLabelEnableThreads, null);
- jContentPane.add(getCheckBoxEnableThreads(), null);
-
- jContentPane.add(jLabelThreadCount, null);
- jContentPane.add(getTextFieldThreadCount(), null);
-
- jContentPane.add(getJButtonSave(), null);
- jContentPane.add(getJButtonCancel(), null);
- }
- return jContentPane;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- *
- */
- public void actionPerformed(ActionEvent arg0) {
-
- if (arg0.getSource() == jButtonBrowse) {
- // TODO: Call file browser, starting in $WORKSPACE/Tools/Conf directory
-
- }
-
- if (arg0.getSource() == jButtonSave) {
- saveTargetFile();
- JOptionPane.showMessageDialog(this, "<html>The target.txt file has been saved!"
- + "<br>A copy of the original file, target.txt.bak has"
- + "<br>also been created.</html>");
- this.exit();
- }
-
- if (arg0.getSource() == jButtonCancel) {
- this.exit();
- }
-
- if (arg0.getSource() == jCheckBoxEnableThreads) {
- if (jCheckBoxEnableThreads.isSelected() == false) {
- threadCount = "";
- jTextFieldThreadCount.setText(threadCount);
- }
- }
- }
-
-
- private void updateActivePlatform() {
- int lineAP;
- if (targetLines[activePlatformId] != null) {
- lineAP = targetLineNumber[activePlatformId];
- } else {
- lineAP = targetLineNumberMax;
- targetLineNumber[activePlatformId] = lineAP;
- targetLineNumberMax++;
- }
- if (jComboBoxActivePlatform.getSelectedItem() == "Do Not Set") {
- targetFileContents[lineAP] = "";
- targetLines[activePlatformId] = "";
- } else {
- targetFileContents[lineAP] = "ACTIVE_PLATFORM = " + jComboBoxActivePlatform.getSelectedItem() + "\r\n";
- targetLines[activePlatformId] = targetFileContents[lineAP];
- }
- if (Debug)
- System.out.println("Active Platform: " + targetFileContents[lineAP]);
- }
-
- private void updateToolDefFile() {
- int lineTDF;
- if (targetLines[toolDefFileId] != null) {
- lineTDF = targetLineNumber[toolDefFileId];
- } else {
- lineTDF = targetLineNumberMax;
- targetLineNumber[toolDefFileId] = lineTDF;
- targetLineNumberMax++;
- }
- if (Debug)
- System.out.println("Tool Config File: " + jTextFieldToolsConfigFile.getText());
- if (jTextFieldToolsConfigFile.getText() == null) {
- targetFileContents[lineTDF] = "#MT#";
- targetLines[toolDefFileId] = "";
- } else {
- targetFileContents[lineTDF] = "TOOL_CHAIN_CONF = " + jTextFieldToolsConfigFile.getText();
- targetLines[toolDefFileId] = targetFileContents[lineTDF];
- }
- }
-
- private void updateToolTagNames() {
- String sTagNames = vectorToString(iCheckBoxListTagName.getAllCheckedItemsString());
- int lineTTN;
-
- if (targetLines[tagNameId] != null) {
- lineTTN = targetLineNumber[tagNameId];
- } else {
- lineTTN = targetLineNumberMax;
- targetLineNumber[tagNameId] = lineTTN;
- targetLineNumberMax++;
- }
-
- if (Debug)
- System.out.println("Tag Name(s): " + sTagNames);
-
- if (sTagNames.length() > 0) {
- targetFileContents[lineTTN] = "TOOL_CHAIN_TAG = " + sTagNames;
- targetLines[tagNameId] = targetFileContents[lineTTN];
- } else {
- targetFileContents[lineTTN] = "#MT#";
- targetLines[tagNameId] = "";
- }
- }
-
- private void updateBuildTargets() {
- String sBuildTargets = vectorToString(iCheckBoxListBuildTarget.getAllCheckedItemsString());
- int lineBT;
-
- if (targetLines[buildTargetId] != null) {
- lineBT = targetLineNumber[buildTargetId];
- } else {
- lineBT = targetLineNumberMax;
- targetLineNumber[buildTargetId] = lineBT;
- targetLineNumberMax++;
- }
- if (Debug)
- System.out.println("Build Target(s): " + sBuildTargets);
- if (sBuildTargets.length() > 0) {
- targetFileContents[lineBT] = "TARGET = " + sBuildTargets;
- targetLines[buildTargetId] = targetFileContents[lineBT];
- } else {
- targetFileContents[lineBT] = "#MT#";
- targetLines[buildTargetId] = "";
- }
-
- }
-
- private void updateArchitectures() {
- String sArchList = jArchCheckBox.getSelectedItemsString().trim();
-
- if (Debug)
- System.out.println("Architectures: " + sArchList);
-
- int lineSA;
- if (targetLines[targetArchId] != null) {
- lineSA = targetLineNumber[targetArchId];
- } else {
- lineSA = targetLineNumberMax;
- targetLineNumber[targetArchId] = lineSA;
- targetLineNumberMax++;
- }
- if (sArchList == "") {
- targetFileContents[lineSA] = "#MT#";
- targetLines[targetArchId] = "";
- } else {
- targetFileContents[lineSA] = "TARGET_ARCH = " + sArchList;
- targetLines[targetArchId] = targetFileContents[lineSA];
- }
-
- }
-
- private void updateEnableThreads() {
- int lineET;
- if (targetLines[threadEnableId] != null) {
- lineET = targetLineNumber[threadEnableId];
- } else {
- lineET = targetLineNumberMax;
- targetLineNumber[threadEnableId] = lineET;
- targetLineNumberMax++;
- }
- if (jCheckBoxEnableThreads.isSelected() == true) {
- targetFileContents[lineET] = "MULTIPLE_THREAD = enabled";
- targetLines[threadEnableId] = targetFileContents[lineET];
- } else {
- targetFileContents[lineET] = "#MT#";
- targetLines[threadEnableId] = "";
- }
- }
-
- private void updateThreadCount() {
- int lineTC;
-
- if (targetLines[threadCountId] != null) {
- lineTC = targetLineNumber[threadCountId];
- } else {
- lineTC = targetLineNumberMax;
- targetLineNumber[threadCountId] = lineTC;
- targetLineNumberMax++;
- }
- if (jCheckBoxEnableThreads.isSelected() == true) {
- // Threading must be enabled
- if (jTextFieldThreadCount.getText().length() > 0) {
- // Thread Count must be greater than 0
- Scanner scan = new Scanner(jTextFieldThreadCount.getText().trim());
- if (scan.nextInt() > 0) {
- targetFileContents[lineTC] = "MAX_CONCURRENT_THREAD_NUMBER = " + jTextFieldThreadCount.getText().trim();
- targetLines[threadCountId] = targetFileContents[lineTC];
- } else {
- Log.wrn("Build Preferences", "Threading Enabled, but thread count is not set, setting to default of 1.");
- targetFileContents[lineTC] = "MAX_CONCURRENT_THREAD_NUMBER = 1";
- targetLines[threadCountId] = "MAX_CONCURRENT_THREAD_NUMBER = 1";
- }
- } else {
- Log.wrn("Build Preferences", "Threading Enabled, but thread count is not set, setting to default of 1.");
- targetFileContents[lineTC] = "MAX_CONCURRENT_THREAD_NUMBER = 1";
- targetLines[threadCountId] = "MAX_CONCURRENT_THREAD_NUMBER = 1";
- }
- } else {
- // Don't track threads if threading is not enabled
- targetFileContents[lineTC] = "#MT#";
- targetLines[threadCountId] = "";
- threadCount = "";
- }
-
- }
- private String vectorToString(Vector<String> v) {
- String s = " ";
- for (int i = 0; i < v.size(); ++i) {
- s += v.get(i);
- s += " ";
- }
- return s.trim();
- }
-
- protected Vector<String> stringToVector(String s) {
- if (s == null) {
- return null;
- }
- String[] sArray = s.split(" ");
- Vector<String> v = new Vector<String>();
- for (int i = 0; i < sArray.length; ++i) {
- v.add(sArray[i]);
- }
- return v;
- }
-
- private void saveTargetFile() {
- updateActivePlatform();
- updateToolDefFile();
- updateToolTagNames();
- updateBuildTargets();
- updateArchitectures();
- updateEnableThreads();
- updateThreadCount();
-
- try {
- copy(targetFile, targetFile + ".bak");
- FileWriter fileWriter = new FileWriter(targetFile);
- BufferedWriter writer = new BufferedWriter(fileWriter);
- for (int i = 0; i < targetLineNumberMax; i++) {
- if (! targetFileContents[i].contains("#MT#"))
- writer.write(targetFileContents[i] + "\n");
- }
- writer.close();
- } catch (IOException e) {
- Log.err(toolsConfFile + " Write Error ", e.getMessage());
- e.printStackTrace();
- }
- }
-
- private void copy(String txtFile, String bakFile) throws IOException {
- File fromFile = new File(txtFile);
- File toFile = new File(bakFile);
- FileInputStream fromTxt = null;
- FileOutputStream toBak = null;
- if (!fromFile.exists()) {
- fromFile.createNewFile();
- }
- try {
- fromTxt = new FileInputStream(fromFile);
- toBak = new FileOutputStream(toFile);
- byte[] buffer = new byte[4096];
- int bytes_read;
- while ((bytes_read = fromTxt.read(buffer)) != -1) {
- toBak.write(buffer, 0, bytes_read);
- }
- } finally {
- if (fromTxt != null)
- try {
- fromTxt.close();
- } catch (IOException e) {
- Log.err(toolsConfFile + " Read Error ", e.getMessage());
-
- }
- if (toBak != null)
- try {
- toBak.close();
- } catch (IOException e) {
- Log.err(toolsConfFile + ".bak Write Error ", e.getMessage());
- }
- }
- }
-
- private void exit() {
- this.setVisible(false);
- if (bTarget != null) {
- bTarget.dispose();
- }
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java
deleted file mode 100644
index 65e20bd665..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/toolchain/ToolChainId.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/** @file
-
- This file is used to init tool chain and tool preference data
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.toolchain;
-
-import java.io.*;
-import java.io.File;
-import java.lang.Integer;
-import java.util.ArrayList;
-
-import javax.swing.JOptionPane;
-
-import org.tianocore.frameworkwizard.FrameworkWizardUI;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class ToolChainId {
- //
- // Define class members
- //
-
- private final boolean Debug = false;
-
- private String toolDefinitionFile = null;
-
- private final int toolDefFieldCount = 5;
-
- private String toolsDefIdentifier = null;
-
- private String toolsDefTargetNames = null;
-
- private final int toolsDefTargetNameField = 0;
-
- private String toolsDefTagNames = null;
-
- private final int toolsDefTagNameField = 1;
-
- private String toolsDefArchNames = null;
-
- private final int toolsDefArchNameField = 2;
-
- private final int toolsDefToolArgumentField = 4;
-
- private String toolCommandCodes = null;
-
- private final int toolsDefCmdCodeArgumentField = 3;
-
-
- private String activePlatform = null;
-
- private String targetArchs = null;
-
- private String tagNames = null;
-
- private String buildTargets = null;
-
- private String toolFamilies = null;
-
- private ArrayList<String> toolDefinitionContents = new ArrayList<String>(50);
-
- private static boolean threadEnabled = false;
-
- private static int maxThreadCount = 0;
-
- private String toolsDir = Workspace.getCurrentWorkspace() + System.getProperty("file.separator") + "Tools"
- + System.getProperty("file.separator") + "Conf";
-
- private String strTargetFile = toolsDir + DataType.FILE_SEPARATOR + "target.txt";
-
- private String defaultToolsConf = toolsDir + DataType.FILE_SEPARATOR + "tools_def.txt";
-
- public void init() {
- readTargetTxtFile();
- readToolDefinitionFile();
- }
-
- public ToolChainId() {
- super();
- init();
- }
-
- public String getToolDefinitionFile() {
- return toolDefinitionFile;
- }
-
- public String getActivePlatform() {
- return activePlatform;
- }
-
- public String getBuildTargets() {
- return buildTargets;
- }
-
- public String getTagNames() {
- return tagNames;
- }
-
- public String getTargetArchitectures() {
- return targetArchs;
- }
-
- public boolean getThreadEnabled() {
- return threadEnabled;
- }
-
- public int getMaxThreadCount() {
- return maxThreadCount;
- }
-
- public String getToolFamilies() {
- return toolFamilies;
- }
-
- public String getToolDefinitionIdentifier() {
- return toolsDefIdentifier;
- }
-
- public ArrayList<String> getToolDefinitionStatements() {
- return toolDefinitionContents;
- }
-
- public String getToolsDefTagNames() {
- return toolsDefTagNames;
- }
-
- public String getToolsDefTargetNames() {
- return toolsDefTargetNames;
- }
-
- public String getToolsDefCommandCodes() {
- return toolCommandCodes;
- }
-
- public String getToolsDefArchNames() {
- return toolsDefArchNames;
- }
-
- private void readTargetTxtFile() {
- File tFile = new File(strTargetFile);
-
- if (tFile.exists()) {
- try {
- FileReader fileReader = new FileReader(strTargetFile);
- BufferedReader reader = new BufferedReader(fileReader);
- String rLine = null;
- String inLine[] = new String[2];
- while ((rLine = reader.readLine()) != null) {
- rLine = rLine.trim();
- if ((rLine.startsWith("ACTIVE_PLATFORM")) && (activePlatform == null)) {
- // Only one active platform is permitted!
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- activePlatform = inLine[1].trim();
- }
- }
- if ((rLine.startsWith("TARGET" + " ")) || (rLine.startsWith("TARGET" + "\t"))
- || (rLine.startsWith("TARGET="))) {
- // Handle multiple Target Names
- if (rLine.contains(",")) {
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- buildTargets = inLine[1].trim().replaceAll(",", " ");
- }
- } else {
- inLine = rLine.trim().split("=");
- if (inLine.length > 1) {
- buildTargets = inLine[1].trim();
- }
- }
- }
- if (rLine.startsWith("TARGET_ARCH")) {
- // Handle multiple Target Architectures
- if (rLine.contains(",")) {
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- targetArchs = inLine[1].trim().replaceAll(",", " ");
- }
- } else {
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- targetArchs = inLine[1].trim();
- }
- }
- }
- if (rLine.startsWith("TOOL_CHAIN_CONF")) {
- // Only one file is permitted
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- toolDefinitionFile = inLine[1].trim();
- }
- }
-
- if (rLine.startsWith("TOOL_CHAIN_TAG")) {
- // Handle multiple Tool TagNames
- if (rLine.contains(",")) {
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- tagNames = inLine[1].trim().replaceAll(",", " ");
- }
- } else {
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- tagNames = inLine[1].trim();
- }
- }
- }
-
- if (rLine.startsWith("MULTIPLE_THREAD")) {
- // Handle Thread Enable flag
- if ((rLine.toLowerCase().contains("enabled"))
- || (rLine.toLowerCase().contains("true"))) {
- threadEnabled = true;
- } else {
- threadEnabled = false;
- }
- }
-
- if (rLine.startsWith("MAX_CONCURRENT_THREAD_NUMBER")) {
- // Handle Thread Enable flag
- inLine = rLine.split("=");
- if (inLine.length > 1) {
- maxThreadCount = Integer.valueOf(inLine[1].trim());
- }
- }
- }
- reader.close();
- } catch (IOException e) {
- Log.log(this.strTargetFile + " Read Error ", e.getMessage());
- e.printStackTrace();
- }
- } else {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "<html>" + "Tool Preferences file: <br>" + strTargetFile
- + "<br>does not exist!</html>");
- }
- }
-
- private void readToolDefinitionFile() {
-
- // Parse the tool definition file looking for targets and architectures
- String toolsConfFile = null;
- if (toolDefinitionFile != null) {
- String resString = (Tools.convertPathToCurrentOsType(toolDefinitionFile)).trim();
- toolsConfFile = Workspace.getCurrentWorkspace() + System.getProperty("file.separator") + resString.trim();
- File toolsDefFile = new File(toolsConfFile);
- if (!toolsDefFile.exists()) {
- JOptionPane.showMessageDialog(FrameworkWizardUI.getInstance(), "<html>" + "Tool Definition file, " + toolDefinitionFile
- + "<br>specified in the target.txt file does not exist!"
- + "<br>Using the default Tool Definition File:<br>"
- + defaultToolsConf);
- toolsConfFile = defaultToolsConf;
- }
- } else {
- toolsConfFile = defaultToolsConf;
- }
- String[] toolsDefFields = new String[toolDefFieldCount];
- for (int i = 0; i < toolDefFieldCount; i++)
- toolsDefFields[i] = null;
- File toolDefFile = new File(toolsConfFile);
- if (toolDefFile.exists()) {
- try {
- FileReader fileReader = new FileReader(toolDefFile);
- BufferedReader reader = new BufferedReader(fileReader);
- String rLine = null;
- String result[];
- while ((rLine = reader.readLine()) != null) {
- if ((rLine.startsWith("IDENTIFIER")) && (toolsDefIdentifier == null)) {
- result = rLine.split("=");
- toolsDefIdentifier = (result[1]).trim();
- } else if ((!rLine.startsWith("#")) && (rLine.contains("="))) {
- result = rLine.split("=");
- toolsDefFields = ((result[0]).trim()).split("_");
- if (toolsDefTargetNames == null) {
- toolsDefTargetNames = (toolsDefFields[toolsDefTargetNameField]).toUpperCase().trim() + " ";
- } else if (!toolsDefTargetNames.contains((toolsDefFields[toolsDefTargetNameField]).toUpperCase().trim())) {
- toolsDefTargetNames += (toolsDefFields[toolsDefTargetNameField]).toUpperCase().trim() + " ";
- }
- if (toolsDefTagNames == null) {
- toolsDefTagNames = (toolsDefFields[toolsDefTagNameField]).toUpperCase().toUpperCase().trim() + " ";
- } else if (!toolsDefTagNames.contains((toolsDefFields[toolsDefTagNameField]).toUpperCase().trim())) {
- toolsDefTagNames += (toolsDefFields[toolsDefTagNameField]).toUpperCase().trim() + " ";
- }
- if (toolsDefArchNames == null) {
- toolsDefArchNames = (toolsDefFields[toolsDefArchNameField]).toUpperCase().trim() + " ";
- } else if (!toolsDefArchNames.contains((toolsDefFields[toolsDefArchNameField]).toUpperCase().trim())) {
- toolsDefArchNames += (toolsDefFields[toolsDefArchNameField]).toUpperCase().trim() + " ";
- }
- if ((toolFamilies == null) && (rLine.trim().contains("FAMILY"))) {
- toolFamilies = (toolsDefFields[toolsDefToolArgumentField]).toUpperCase().trim() + " ";
- } else if ((rLine.trim().contains("FAMILY"))
- && (!toolFamilies.contains((toolsDefFields[toolsDefToolArgumentField]).toUpperCase().trim()))) {
- toolFamilies += (toolsDefFields[toolsDefToolArgumentField]).toUpperCase().trim() + " ";
- }
- if ((toolCommandCodes == null)) {
- toolCommandCodes = (toolsDefFields[toolsDefCmdCodeArgumentField]).toUpperCase().trim() + " ";
- } else if ((!toolCommandCodes.contains((toolsDefFields[toolsDefCmdCodeArgumentField]).toUpperCase().trim()))) {
- toolCommandCodes += (toolsDefFields[toolsDefCmdCodeArgumentField].toUpperCase().trim()) + " ";
- }
-
- toolDefinitionContents.add(rLine.trim().replaceAll(" ", ""));
- }
- }
- reader.close();
- if (!toolsDefTargetNames.matches("[A-Z]+")) {
- toolsDefTargetNames = toolsDefTargetNames.replace("* ", "").trim();
- if (Debug)
- System.out.println("tools_def file does not define build targets: '" + toolsDefTargetNames
- + "'");
- }
- } catch (IOException e) {
- Log.log(toolsConfFile + " Read Error ", e.getMessage());
- e.printStackTrace();
- }
- }
- }
-
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/Workspace.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/Workspace.java
deleted file mode 100644
index 580086ff92..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/Workspace.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/** @file
-
- The file is used to init workspace
-
- 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.
-
- **/
-
-package org.tianocore.frameworkwizard.workspace;
-
-import java.io.File;
-
-import org.tianocore.frameworkwizard.common.DataType;
-
-public class Workspace {
- //
- // Define static return value
- //
- public final static int WORKSPACE_VALID = 0;
-
- public final static int WORKSPACE_NOT_DEFINED = 1;
-
- public final static int WORKSPACE_NOT_EXIST = 2;
-
- public final static int WORKSPACE_NOT_DIRECTORY = 3;
-
- public final static int WORKSPACE_NOT_VALID = 4;
-
- public final static int WORKSPACE_NO_TARGET_FILE = 5;
-
- //
- // Define class members
- //
- private static String currentWorkspace = null;
-
- private static String strWorkspaceDatabaseFile = DataType.FILE_SEPARATOR + "Tools" + DataType.FILE_SEPARATOR
- + "Conf" + DataType.FILE_SEPARATOR + "FrameworkDatabase.db";
-
- private static String targetFile = DataType.FILE_SEPARATOR + "Tools" + DataType.FILE_SEPARATOR + "Conf"
- + DataType.FILE_SEPARATOR + "target.txt";
-
- /**
-
- @param args
-
- **/
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-
- /**
- Get Current Workspace
-
- @return currentWorkspace
-
- */
- public static String getCurrentWorkspace() {
- return currentWorkspace;
- }
-
- /**
- Set Current Workspace
-
- @param currentWorkspace
- The input data of currentWorkspace
-
- */
- public static void setCurrentWorkspace(String currentWorkspace) {
- Workspace.currentWorkspace = currentWorkspace;
- }
-
- /**
- Check if current workspace exists of not
-
- @retval true - The current WORKSPACE exists
- @retval false - The current WORKSPACE doesn't exist
-
- */
- public static int checkCurrentWorkspace() {
- return checkWorkspace(getCurrentWorkspace());
- }
-
- /**
- Check if current workspace exists or not via input workspace path
-
- @param strWorkspace
- The input data of WORKSPACE path
- @retval true - The current WORKSPACE exists
- @retval false - The current WORKSPACE doesn't exist
-
- */
- public static int checkWorkspace(String strWorkspace) {
- //
- // Check if WORKSPACE Environment is defined
- //
- if (strWorkspace == null || strWorkspace == "") {
- return Workspace.WORKSPACE_NOT_DEFINED;
- }
-
- //
- // Check if WORKSPACE Environment exists
- //
- File f = new File(strWorkspace);
- if (!f.exists()) {
- return Workspace.WORKSPACE_NOT_EXIST;
- }
-
- //
- // Check if WORKSPACE Environment is a directory
- //
- if (!f.isDirectory()) {
- return Workspace.WORKSPACE_NOT_DIRECTORY;
- }
-
- //
- // Check if FrameworkDatabase.db exists
- //
- f = new File(strWorkspace + Workspace.getStrWorkspaceDatabaseFile());
- if (!f.exists()) {
- return Workspace.WORKSPACE_NOT_VALID;
- }
-
- //
- // Check if Target.txt exists
- //
- f = new File(strWorkspace + Workspace.getTargetFile());
- if (!f.exists()) {
- return Workspace.WORKSPACE_NO_TARGET_FILE;
- }
-
- return Workspace.WORKSPACE_VALID;
- }
-
- public static String getStrWorkspaceDatabaseFile() {
- return strWorkspaceDatabaseFile;
- }
-
- public static void setStrWorkspaceDatabaseFile(String strWorkspaceDatabaseFile) {
- //Workspace.strWorkspaceDatabaseFile = strWorkspaceDatabaseFile;
- }
-
- public static String getTargetFile() {
- return targetFile;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
deleted file mode 100644
index 9db0fe587e..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/WorkspaceTools.java
+++ /dev/null
@@ -1,958 +0,0 @@
-/** @file
-
- The file is used to init workspace and get basic information of workspace
-
- 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.
-
- **/
-package org.tianocore.frameworkwizard.workspace;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.DbPathAndFilename;
-import org.tianocore.IndustryStdIncludesDocument.IndustryStdIncludes;
-import org.tianocore.LibraryClassDeclarationsDocument.LibraryClassDeclarations;
-import org.tianocore.LibraryClassDefinitionsDocument.LibraryClassDefinitions;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.MsaFilesDocument.MsaFiles;
-import org.tianocore.PackageDependenciesDocument.PackageDependencies;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PlatformSurfaceAreaDocument.PlatformSurfaceArea;
-import org.tianocore.SourceFilesDocument.SourceFiles;
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.GlobalData;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.OpenFile;
-import org.tianocore.frameworkwizard.common.SaveFile;
-import org.tianocore.frameworkwizard.common.Sort;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.Identifications.Identification;
-import org.tianocore.frameworkwizard.common.Identifications.OpeningPackageType;
-import org.tianocore.frameworkwizard.far.FarHeader;
-import org.tianocore.frameworkwizard.far.FarIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.ModuleIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdIdentification;
-import org.tianocore.frameworkwizard.module.Identifications.PcdCoded.PcdVector;
-import org.tianocore.frameworkwizard.packaging.PackageIdentification;
-import org.tianocore.frameworkwizard.platform.PlatformIdentification;
-
-public class WorkspaceTools {
-
- public void addFarToDb(List<String> packageList, List<String> platformList, FarHeader far) {
- //FrameworkDatabase fdb = openFrameworkDb();
-
- for (int i = 0; i < packageList.size(); i++) {
- DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
- item.setFarGuid(far.getGuidValue());
- item.setStringValue(packageList.get(i));
- GlobalData.fdb.getPackageList().getFilenameList().add(item);
- }
-
- for (int i = 0; i < platformList.size(); i++) {
- DbPathAndFilename item = DbPathAndFilename.Factory.newInstance();
- item.setFarGuid(far.getGuidValue());
- item.setStringValue(platformList.get(i));
- GlobalData.fdb.getPlatformList().getFilenameList().add(item);
- }
-
- DbPathAndFilename farItem = DbPathAndFilename.Factory.newInstance();
- farItem.setFarGuid(far.getGuidValue());
- farItem.setStringValue(far.getFarName());
- GlobalData.fdb.getFarList().getFilenameList().add(farItem);
-
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
-
- try {
- SaveFile.saveDbFile(strFrameworkDbFilePath, GlobalData.fdb);
- } catch (Exception e) {
- Log.err("Save Database File", e.getMessage());
- }
- }
-
- public void removeFarFromDb(FarIdentification far) {
- //
- // Remove Packages
- //
- XmlCursor cursor = GlobalData.fdb.getPackageList().newCursor();
- cursor.toFirstChild();
- do {
- DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
- } while (cursor.toNextSibling());
- cursor.dispose();
-
- //
- // Remove Platforms
- //
- cursor = GlobalData.fdb.getPlatformList().newCursor();
- cursor.toFirstChild();
- do {
- DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
- } while (cursor.toNextSibling());
-
- //
- // Remove Far
- //
- cursor = GlobalData.fdb.getFarList().newCursor();
- cursor.toFirstChild();
- do {
- DbPathAndFilename item = (DbPathAndFilename) cursor.getObject();
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- cursor.removeXml();
- }
- } while (cursor.toNextSibling());
- cursor.dispose();
-
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
- try {
- SaveFile.saveDbFile(strFrameworkDbFilePath, GlobalData.fdb);
- } catch (Exception e) {
- Log.err("Save Database File", e.getMessage());
- }
- }
-
- public String getPackageFarGuid(Identification packageId) {
- for (int index = 0; index < GlobalData.fdb.getPackageList().getFilenameList().size(); index++) {
- DbPathAndFilename item = GlobalData.fdb.getPackageList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
- File tempFile = new File(path);
- if (tempFile.getPath().equalsIgnoreCase(packageId.getPath())) {
- return GlobalData.fdb.getPackageList().getFilenameArray(index).getFarGuid();
- }
- }
-
- return null;
- }
-
- public String getPlatformFarGuid(Identification platformId) {
- for (int index = 0; index < GlobalData.fdb.getPlatformList().getFilenameList().size(); index++) {
- DbPathAndFilename item = GlobalData.fdb.getPlatformList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
- File tempFile = new File(path);
- if (tempFile.getPath().equalsIgnoreCase(platformId.getPath())) {
- return GlobalData.fdb.getPlatformList().getFilenameArray(index).getFarGuid();
- }
- }
-
- return null;
- }
-
- public String getModuleFarGuid(Identification moduleId) {
- PackageIdentification packageId = getPackageIdByModuleId(moduleId);
- if (packageId != null) {
- return getPackageFarGuid(packageId);
- } else {
- return null;
- }
- }
-
- /**
- Get all modules' paths from one package
-
- @return a Vector with all modules' path
-
- **/
- public Vector<String> getAllModulesOfPackage(String path) {
- Vector<String> modulePath = new Vector<String>();
- PackageIdentification id = new PackageIdentification(null, null, null, path);
- MsaFiles files = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(id).getMsaFiles();
- if (files != null) {
- for (int index = 0; index < files.getFilenameList().size(); index++) {
- String msaPath = files.getFilenameList().get(index);
- msaPath = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + msaPath;
- msaPath = Tools.convertPathToCurrentOsType(msaPath);
- modulePath.addElement(msaPath);
- }
- }
-
- return modulePath;
- }
-
- /**
- Get all Industry Std Includes' paths from one package
-
- @return a Vector with all paths
-
- **/
- public Vector<String> getAllIndustryStdIncludesOfPackage(String path) {
- Vector<String> includePath = new Vector<String>();
- PackageIdentification id = new PackageIdentification(null, null, null, path);
- IndustryStdIncludes files = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(id)
- .getIndustryStdIncludes();
- if (files != null) {
- for (int index = 0; index < files.getIndustryStdHeaderList().size(); index++) {
- String temp = files.getIndustryStdHeaderList().get(index).getIncludeHeader();
- temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
- temp = Tools.convertPathToCurrentOsType(temp);
- includePath.addElement(temp);
- }
- }
- return includePath;
- }
-
- /**
- Get all package basic information form the FrameworkDatabase.db file
-
- @return vPackageList A vector includes all packages' basic information
-
- */
- public Vector<PackageIdentification> getAllPackages() {
- return GlobalData.vPackageList;
- }
-
- /**
- Get all package which match parameter isRepackagable
-
- @param isRepackagable
- @return
-
- **/
- public Vector<PackageIdentification> getAllRepackagablePackages() {
- Vector<PackageIdentification> v = new Vector<PackageIdentification>();
- for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {
- OpeningPackageType opt = GlobalData.openingPackageList.getOpeningPackageByIndex(index);
- if (opt.getXmlSpd() != null) {
- if (opt.getXmlSpd().getPackageDefinitions() != null) {
- if (opt.getXmlSpd().getPackageDefinitions().getRePackage()) {
- v.addElement(opt.getId());
- }
- } else {
- v.addElement(opt.getId());
- }
- } else {
- v.addElement(opt.getId());
- }
- }
- return v;
- }
-
- public Vector<FarIdentification> getAllFars() {
-
- Vector<FarIdentification> v = new Vector<FarIdentification>();
- for (int index = 0; index < GlobalData.fdb.getFarList().getFilenameList().size(); index++) {
- DbPathAndFilename item = GlobalData.fdb.getFarList().getFilenameList().get(index);
- FarIdentification far = new FarIdentification(item.getFarGuid(), item.getMd5Sum(), item.getStringValue());
- v.addElement(far);
- }
- return v;
- }
-
- public Vector<PackageIdentification> getPackagesByFar(FarIdentification far) {
- Identification id = null;
-
- Vector<PackageIdentification> v = new Vector<PackageIdentification>();
-
- for (int index = 0; index < GlobalData.fdb.getPackageList().getFilenameList().size(); index++) {
- DbPathAndFilename item = GlobalData.fdb.getPackageList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
-
- try {
- id = Tools.getId(path, OpenFile.openSpdFile(path));
- v.addElement(new PackageIdentification(id));
- } catch (IOException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Package Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Package Surface Area " + path, "Invalid file type");
- }
- }
- }
- return v;
- }
-
- public Vector<PlatformIdentification> getPlatformsByFar(FarIdentification far) {
- Identification id = null;
-
- Vector<PlatformIdentification> v = new Vector<PlatformIdentification>();
-
- for (int index = 0; index < GlobalData.fdb.getPlatformList().getFilenameList().size(); index++) {
- DbPathAndFilename item = GlobalData.fdb.getPlatformList().getFilenameArray(index);
- String path = Workspace.getCurrentWorkspace() + DataType.FILE_SEPARATOR + item.getStringValue();
- path = Tools.convertPathToCurrentOsType(path);
-
- if (item.getFarGuid() != null && item.getFarGuid().equalsIgnoreCase(far.getGuid())) {
- try {
- id = Tools.getId(path, OpenFile.openFpdFile(path));
- v.addElement(new PlatformIdentification(id));
- } catch (IOException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (XmlException e) {
- Log.err("Open Platform Surface Area " + path, e.getMessage());
- } catch (Exception e) {
- Log.err("Open Platform Surface Area " + path, "Invalid file type");
- }
- }
- }
- return v;
- }
-
- /**
- Get all module basic information from a package
-
- @param id Package id
- @return A vector includes all modules' basic information
-
- **/
- public Vector<ModuleIdentification> getAllModules(PackageIdentification pid) {
- Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();
- Vector<String> modulePaths = this.getAllModulesOfPackage(pid.getPath());
- String modulePath = null;
-
- for (int index = 0; index < modulePaths.size(); index++) {
- modulePath = modulePaths.get(index);
- ModuleIdentification id = GlobalData.openingModuleList.getIdByPath(modulePath);
- if (id != null) {
- v.addElement(id);
- }
- }
- Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);
- return v;
- }
-
- /**
- Get all module basic information from a platform
-
- @param id Package id
- @return A vector includes all modules' basic information
-
- **/
- public Vector<ModuleIdentification> getAllModules(PlatformIdentification fid) {
- Vector<ModuleIdentification> v = new Vector<ModuleIdentification>();
- PlatformSurfaceArea fpd = GlobalData.openingPlatformList.getOpeningPlatformById(fid).getXmlFpd();
- if (fpd.getFrameworkModules() != null) {
- for (int index = 0; index < fpd.getFrameworkModules().getModuleSAList().size(); index++) {
- String guid = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleGuid();
- String version = fpd.getFrameworkModules().getModuleSAList().get(index).getModuleVersion();
- ModuleIdentification id = GlobalData.openingModuleList.getIdByGuidVersion(guid, version);
- if (id != null) {
- boolean isFind = false;
- for (int indexOfModules = 0; indexOfModules < v.size(); indexOfModules++) {
- if (v.elementAt(indexOfModules).equals(id)) {
- isFind = true;
- break;
- }
- }
- if (!isFind) {
- v.addElement(id);
- }
- }
- }
- }
- Sort.sortModules(v, DataType.SORT_TYPE_ASCENDING);
- return v;
- }
-
- /**
- Get all module basic information form the FrameworkDatabase.db file
-
- @return vModuleList A vector includes all modules' basic information
-
- */
- public Vector<ModuleIdentification> getAllModules() {
- return GlobalData.vModuleList;
- }
-
- /**
- Get all platform basic information form the FrameworkDatabase.db file
-
- @return vplatformList A vector includes all platforms' basic information
-
- */
- public Vector<PlatformIdentification> getAllPlatforms() {
- return GlobalData.vPlatformList;
- }
-
- /**
- Get all Library Class Definitions from a package
-
- @return Vector
- **/
- public Vector<String> getAllLibraryClassDefinitionsFromPackage(PackageSurfaceArea spd) {
- Vector<String> vector = new Vector<String>();
- if (spd.getLibraryClassDeclarations() != null) {
- if (spd.getLibraryClassDeclarations().getLibraryClassList().size() > 0) {
- for (int index = 0; index < spd.getLibraryClassDeclarations().getLibraryClassList().size(); index++) {
- vector.addElement(spd.getLibraryClassDeclarations().getLibraryClassList().get(index).getName());
- }
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- /**
- Get all Protocol Definitions from a package
-
- @return Vector
- **/
- public Vector<String> getAllProtocolDeclarationsFromPackage(PackageSurfaceArea spd) {
- Vector<String> vector = new Vector<String>();
- if (spd.getProtocolDeclarations() != null) {
- if (spd.getProtocolDeclarations().getEntryList().size() > 0) {
- for (int index = 0; index < spd.getProtocolDeclarations().getEntryList().size(); index++) {
- vector.addElement(spd.getProtocolDeclarations().getEntryList().get(index).getCName());
- }
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- /**
- Get all Ppi Definitions from a package
-
- @return Vector
- **/
- public Vector<String> getAllPpiDeclarationsFromPackage(PackageSurfaceArea spd) {
- Vector<String> vector = new Vector<String>();
- if (spd.getPpiDeclarations() != null) {
- if (spd.getPpiDeclarations().getEntryList().size() > 0) {
- for (int index = 0; index < spd.getPpiDeclarations().getEntryList().size(); index++) {
- vector.addElement(spd.getPpiDeclarations().getEntryList().get(index).getCName());
- }
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- /**
- Get all Guid Definitions from a package
-
- @return Vector
- **/
- public Vector<String> getAllGuidDeclarationsFromPackage(PackageSurfaceArea spd, String type) {
- Vector<String> vector = new Vector<String>();
- boolean isFound = false;
- if (spd.getGuidDeclarations() != null) {
- if (spd.getGuidDeclarations().getEntryList().size() > 0) {
- for (int index = 0; index < spd.getGuidDeclarations().getEntryList().size(); index++) {
- Vector<String> vArch = Tools.convertListToVector(spd.getGuidDeclarations().getEntryList()
- .get(index).getGuidTypeList());
- for (int indexOfArch = 0; indexOfArch < vArch.size(); indexOfArch++) {
- if (vArch.get(indexOfArch).equals(type)) {
- isFound = true;
- break;
- }
- }
- if ((isFound) || (vArch == null) || (vArch.size() < 1)) {
- vector.addElement(spd.getGuidDeclarations().getEntryList().get(index).getCName());
- isFound = false;
- }
- }
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- /**
- Get all Pcd Definitions from a package
-
- @return Vector
- **/
- public PcdVector getAllPcdDeclarationsFromPackage(PackageSurfaceArea spd) {
- PcdVector vector = new PcdVector();
- if (spd.getPcdDeclarations() != null) {
- if (spd.getPcdDeclarations().getPcdEntryList().size() > 0) {
- for (int index = 0; index < spd.getPcdDeclarations().getPcdEntryList().size(); index++) {
- String name = spd.getPcdDeclarations().getPcdEntryList().get(index).getCName();
- String guidCName = spd.getPcdDeclarations().getPcdEntryList().get(index).getTokenSpaceGuidCName();
- String help = spd.getPcdDeclarations().getPcdEntryList().get(index).getHelpText();
- Vector<String> type = Tools.convertListToVector(spd.getPcdDeclarations().getPcdEntryList()
- .get(index).getValidUsage());
- //
- // The algorithm for PCD of msa should be:
- // 1. If the type of PCD from Spd is FEATURE_FLAG,
- // the type of Msa only can be FEATURE_FLAG.
- // 2. If the type of PCD from Spd is not FEATURE_FLAG,
- // the type of Msa could be selected from the PCD's all types and "DYNAMIC" type.
- //
- boolean hasFEATURE_FLAG = false;
- boolean hasDYNAMIC = false;
- for (int indexOfType = 0; indexOfType < type.size(); indexOfType++) {
- if (type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_DYNAMIC)) {
- hasDYNAMIC = true;
- }
- if (type.elementAt(indexOfType).equals(DataType.PCD_ITEM_TYPE_FEATURE_FLAG)) {
- hasFEATURE_FLAG = true;
- }
- }
- if (hasFEATURE_FLAG) {
- type.removeAllElements();
- type.addElement(DataType.PCD_ITEM_TYPE_FEATURE_FLAG);
- } else {
- if (!hasDYNAMIC) {
- type.addElement(DataType.PCD_ITEM_TYPE_DYNAMIC);
- }
- }
- vector.addPcd(new PcdIdentification(name, guidCName, help, type));
- }
- }
- }
- Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllLibraryClassDefinitionsFromWorkspace() {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.vPackageList
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllLibraryClassDefinitionsFromPackages(Vector<PackageIdentification> vpid) {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < vpid.size(); index++) {
- Vector<String> v = getAllLibraryClassDefinitionsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(vpid
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllProtocolDeclarationsFromWorkspace() {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.vPackageList
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllProtocolDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < vpid.size(); index++) {
- Vector<String> v = getAllProtocolDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(vpid
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllPpiDeclarationsFromWorkspace() {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.vPackageList
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllPpiDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < vpid.size(); index++) {
- Vector<String> v = getAllPpiDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(vpid
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllGuidDeclarationsFromWorkspace(String type) {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < GlobalData.vPackageList.size(); index++) {
- Vector<String> v = getAllGuidDeclarationsFromPackage(
- GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.vPackageList
- .get(index)),
- type);
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public Vector<String> getAllGuidDeclarationsFromPackages(Vector<PackageIdentification> vpid, String type) {
- Vector<String> vector = new Vector<String>();
- for (int index = 0; index < vpid.size(); index++) {
- Vector<String> v = getAllGuidDeclarationsFromPackage(
- GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(vpid
- .get(index)),
- type);
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortVectorString(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public PcdVector getAllPcdDeclarationsFromWorkspace() {
- PcdVector vector = new PcdVector();
- for (int index = 0; index < GlobalData.openingPackageList.size(); index++) {
- PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(GlobalData.vPackageList
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- public PcdVector getAllPcdDeclarationsFromPackages(Vector<PackageIdentification> vpid) {
- PcdVector vector = new PcdVector();
- for (int index = 0; index < vpid.size(); index++) {
- PcdVector v = getAllPcdDeclarationsFromPackage(GlobalData.openingPackageList
- .getPackageSurfaceAreaFromId(vpid
- .get(index)));
- if (v != null && v.size() > 0) {
- vector.addAll(v);
- }
-
- }
- Sort.sortPcds(vector, DataType.SORT_TYPE_ASCENDING);
- return vector;
- }
-
- /**
- Find a module's package's id
-
- @param id input module id
- @return package id
-
- **/
- public PackageIdentification getPackageIdByModuleId(Identification id) {
- Vector<String> modulePaths = new Vector<String>();
- Identification mid = null;
- String packagePath = null;
- String modulePath = null;
-
- //
- // For each package, get all modules list
- //
- for (int indexI = 0; indexI < GlobalData.vPackageList.size(); indexI++) {
- packagePath = GlobalData.vPackageList.elementAt(indexI).getPath();
- modulePaths = this.getAllModulesOfPackage(packagePath);
- for (int indexJ = 0; indexJ < modulePaths.size(); indexJ++) {
- modulePath = modulePaths.get(indexJ);
- mid = GlobalData.openingModuleList.getIdByPath(modulePath);
- //
- // Check id
- //
- if (mid != null) {
- if (mid.equals(id)) {
- return GlobalData.vPackageList.elementAt(indexI);
- }
- }
- }
- }
-
- return null;
- }
-
- /**
- Add module information to package surface area
-
- @param mid
- @throws IOException
- @throws XmlException
- @throws Exception
-
- **/
- public void addModuleToPackage(ModuleIdentification mid, PackageSurfaceArea spd) throws IOException, XmlException,
- Exception {
- String packagePath = mid.getPackageId().getPath();
- String modulePath = mid.getPath();
- if (spd == null) {
- spd = OpenFile.openSpdFile(packagePath);
- }
- MsaFiles msaFile = spd.getMsaFiles();
- if (msaFile == null) {
- msaFile = MsaFiles.Factory.newInstance();
- }
- packagePath = packagePath.substring(0, packagePath.lastIndexOf(DataType.FILE_SEPARATOR));
- String fn = Tools.getRelativePath(modulePath, packagePath);
- msaFile.addNewFilename();
- msaFile.setFilenameArray(msaFile.getFilenameList().size() - 1, fn);
- spd.setMsaFiles(msaFile);
- SaveFile.saveSpdFile(mid.getPackageId().getPath(), spd);
- //
- // Update GlobalData
- //
- GlobalData.openingPackageList.getPackageSurfaceAreaFromId(mid.getPackageId()).setMsaFiles(msaFile);
- }
-
- /**
- Add input package into database
-
- @param id
- * @throws Exception
-
- **/
- public void addPackageToDatabase(PackageIdentification id) throws Exception {
- String path = id.getPath();
- path = Tools.getRelativePath(path, Workspace.getCurrentWorkspace());
-
- DbPathAndFilename filename = DbPathAndFilename.Factory.newInstance();
- filename.setStringValue(path);
- GlobalData.fdb.getPackageList().addNewFilename();
- GlobalData.fdb.getPackageList().setFilenameArray(GlobalData.fdb.getPackageList().sizeOfFilenameArray() - 1,
- filename);
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
- SaveFile.saveDbFile(strFrameworkDbFilePath, GlobalData.fdb);
- }
-
- /**
- Add input package into database
-
- @param id
- * @throws Exception
-
- **/
- public void addPlatformToDatabase(PlatformIdentification id) throws Exception {
- String path = id.getPath();
- path = Tools.getRelativePath(path, Workspace.getCurrentWorkspace());
-
- DbPathAndFilename filename = DbPathAndFilename.Factory.newInstance();
- filename.setStringValue(path);
- GlobalData.fdb.getPlatformList().addNewFilename();
- GlobalData.fdb.getPlatformList().setFilenameArray(GlobalData.fdb.getPlatformList().sizeOfFilenameArray() - 1,
- filename);
- String strFrameworkDbFilePath = Workspace.getCurrentWorkspace() + Workspace.getStrWorkspaceDatabaseFile();
- strFrameworkDbFilePath = Tools.convertPathToCurrentOsType(strFrameworkDbFilePath);
- SaveFile.saveDbFile(strFrameworkDbFilePath, GlobalData.fdb);
- }
-
- /**
- Get all file's path from one module
-
- @param path
- @return
- @throws IOException
- @throws XmlException
- @throws Exception
-
- **/
- public Vector<String> getAllFilesPathOfModule(String path) {
- Vector<String> v = new Vector<String>();
- path = Tools.convertPathToCurrentOsType(path);
-
- //
- // First add msa file's path
- //
- v.addElement(path);
-
- ModuleSurfaceArea msa = GlobalData.openingModuleList
- .getModuleSurfaceAreaFromId(GlobalData.openingModuleList
- .getIdByPath(path));
- //
- // Get common defined files of module
- //
- if (msa != null) {
- //
- // Get all files' path of a module
- //
- SourceFiles sf = msa.getSourceFiles();
- if (sf != null) {
- for (int index = 0; index < sf.getFilenameList().size(); index++) {
- String temp = sf.getFilenameList().get(index).getStringValue();
- temp = Tools.addFileSeparator(Tools.getFilePathOnly(path)) + temp;
- v.addElement(Tools.convertPathToCurrentOsType(temp));
- }
- }
- }
-
- //
- // Get include header files for this module
- //
- if (msa.getLibraryClassDefinitions() != null) {
- LibraryClassDefinitions lcd = msa.getLibraryClassDefinitions();
- for (int index = 0; index < lcd.sizeOfLibraryClassArray(); index++) {
- if (lcd.getLibraryClassList().get(index).getUsage().toString()
- .equals(DataType.USAGE_TYPE_ALWAYS_PRODUCED)
- || lcd.getLibraryClassList().get(index).getUsage().toString()
- .equals(DataType.USAGE_TYPE_SOMETIMES_PRODUCED)) {
- //
- // Get library class name
- //
- String name = lcd.getLibraryClassList().get(index).getKeyword();
-
- //
- // Find file path for this class
- //
- PackageIdentification pid = GlobalData.openingModuleList.getIdByPath(path).getPackageId();
- PackageSurfaceArea spd = GlobalData.openingPackageList.getPackageSurfaceAreaFromId(pid);
- String headerFile = getHeaderFileFromPackageByLibraryClassName(spd, name);
- if (!Tools.isEmpty(headerFile)) {
- v.addElement(Tools.convertPathToCurrentOsType(Tools.getFilePathOnly(pid.getPath())
- + DataType.FILE_SEPARATOR + headerFile));
- }
- }
- }
- }
-
- return v;
- }
-
- /**
- Get all file's path from one package
-
- @param path
- @return
- @throws IOException
- @throws XmlException
- @throws Exception
-
- **/
- public Vector<String> getAllFilesPathOfPakcage(String path) {
- Vector<String> v = new Vector<String>();
- path = Tools.convertPathToCurrentOsType(path);
- //
- // First add package
- //
- v.addElement(path);
-
- //
- // Add the package's industry std includes one by one
- //
- Vector<String> f1 = new Vector<String>();
- f1 = getAllIndustryStdIncludesOfPackage(path);
- for (int index = 0; index < f1.size(); index++) {
- v.addElement(f1.get(index));
- }
-
- //
- // Add module's files one by one
- //
- f1 = new Vector<String>();
- f1 = getAllModulesOfPackage(path);
- for (int indexI = 0; indexI < f1.size(); indexI++) {
- Vector<String> f2 = getAllFilesPathOfModule(f1.get(indexI));
- for (int indexJ = 0; indexJ < f2.size(); indexJ++) {
- v.addElement(f2.get(indexJ));
- }
- }
-
- return v;
- }
-
- /**
- Get a module's all package dependencies
-
- @param mid The module id
- @return A vector of all package dependency ids
-
- **/
- public Vector<PackageIdentification> getPackageDependenciesOfModule(ModuleIdentification mid) {
- Vector<PackageIdentification> vpid = new Vector<PackageIdentification>();
- ModuleSurfaceArea msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(mid);
- if (msa != null) {
- PackageDependencies pd = msa.getPackageDependencies();
- if (pd != null) {
- for (int index = 0; index < pd.getPackageList().size(); index++) {
- String guid = pd.getPackageList().get(index).getPackageGuid();
- String version = pd.getPackageList().get(index).getPackageVersion();
- PackageIdentification pid = GlobalData.openingPackageList.getIdByGuidVersion(guid, version);
- if (pid != null) {
- vpid.addElement(pid);
- }
- }
- }
- }
- return vpid;
- }
-
- public Vector<String> getAllModuleGuidXref() {
- Vector<String> v = new Vector<String>();
- for (int index = 0; index < GlobalData.openingModuleList.size(); index++) {
- ModuleIdentification id = GlobalData.openingModuleList.getOpeningModuleByIndex(index).getId();
- v.addElement(id.getGuid() + " " + id.getName());
- }
- return v;
- }
-
- public Vector<String> getModuleArch(ModuleIdentification id) {
- Vector<String> v = new Vector<String>();
- ModuleSurfaceArea msa = null;
- if (id != null) {
- msa = GlobalData.openingModuleList.getModuleSurfaceAreaFromId(id);
- }
- if (msa != null) {
- if (msa.getModuleDefinitions() != null) {
- v = Tools.convertListToVector(msa.getModuleDefinitions().getSupportedArchitectures());
- }
- }
- return v;
- }
-
- public String getHeaderFileFromPackageByLibraryClassName(PackageSurfaceArea spd, String name) {
- String headerFile = "";
- if (spd != null) {
- if (spd.getLibraryClassDeclarations() != null) {
- LibraryClassDeclarations lcdl = spd.getLibraryClassDeclarations();
- for (int indexOfLibOfSpd = 0; indexOfLibOfSpd < lcdl.sizeOfLibraryClassArray(); indexOfLibOfSpd++) {
- if (lcdl.getLibraryClassList().get(indexOfLibOfSpd).getName().equals(name)) {
- return lcdl.getLibraryClassList().get(indexOfLibOfSpd).getIncludeHeader();
- }
- }
- }
- }
-
- return headerFile;
- }
-}
diff --git a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/ui/SwitchWorkspace.java b/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/ui/SwitchWorkspace.java
deleted file mode 100644
index e5f28c56c4..0000000000
--- a/Tools/Java/Source/FrameworkWizard/src/org/tianocore/frameworkwizard/workspace/ui/SwitchWorkspace.java
+++ /dev/null
@@ -1,217 +0,0 @@
-package org.tianocore.frameworkwizard.workspace.ui;
-
-import java.awt.event.ActionEvent;
-
-import javax.swing.JButton;
-import javax.swing.JFileChooser;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.JTextField;
-
-import org.tianocore.frameworkwizard.common.DataType;
-import org.tianocore.frameworkwizard.common.Log;
-import org.tianocore.frameworkwizard.common.Tools;
-import org.tianocore.frameworkwizard.common.ui.IDialog;
-import org.tianocore.frameworkwizard.common.ui.IFrame;
-import org.tianocore.frameworkwizard.workspace.Workspace;
-
-public class SwitchWorkspace extends IDialog {
-
- ///
- /// Define class Serial Version UID
- ///
- private static final long serialVersionUID = 2184556370155608202L;
-
- //
- // Define class members
- //
- private JPanel jContentPane = null;
-
- private JLabel jLabel = null;
-
- private JLabel jLabel1 = null;
-
- private JTextField jTextFieldOld = null;
-
- private JTextField jTextFieldNew = null;
-
- private JButton jButtonOk = null;
-
- private JButton jButtonCancel = null;
-
- private JButton jButtonBrowse = null;
-
- /**
- * This method initializes jTextFieldOld
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldOld() {
- if (jTextFieldOld == null) {
- jTextFieldOld = new JTextField();
- jTextFieldOld.setBounds(new java.awt.Rectangle(140, 10, 320, 20));
- jTextFieldOld.setEditable(false);
- jTextFieldOld.setText(Workspace.getCurrentWorkspace() == null ? "Not Defined"
- : Workspace.getCurrentWorkspace());
- }
- return jTextFieldOld;
- }
-
- /**
- * This method initializes jTextFieldNew
- *
- * @return javax.swing.JTextField
- */
- private JTextField getJTextFieldNew() {
- if (jTextFieldNew == null) {
- jTextFieldNew = new JTextField();
- jTextFieldNew.setBounds(new java.awt.Rectangle(140, 35, 220, 20));
- }
- return jTextFieldNew;
- }
-
- /**
- * This method initializes jButtonOk
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonOk() {
- if (jButtonOk == null) {
- jButtonOk = new JButton();
- jButtonOk.setBounds(new java.awt.Rectangle(290, 70, 80, 20));
- jButtonOk.setText("Ok");
- jButtonOk.addActionListener(this);
- }
- return jButtonOk;
- }
-
- /**
- * This method initializes jButtonCancel
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonCancel() {
- if (jButtonCancel == null) {
- jButtonCancel = new JButton();
- jButtonCancel.setBounds(new java.awt.Rectangle(380, 70, 80, 20));
- jButtonCancel.setText("Cancel");
- jButtonCancel.addActionListener(this);
- }
- return jButtonCancel;
- }
-
- /**
- * This method initializes jButtonBrowse
- *
- * @return javax.swing.JButton
- */
- private JButton getJButtonBrowse() {
- if (jButtonBrowse == null) {
- jButtonBrowse = new JButton();
- jButtonBrowse.setBounds(new java.awt.Rectangle(370, 35, 90, 20));
- jButtonBrowse.setText("Browse");
- jButtonBrowse.addActionListener(this);
- }
- return jButtonBrowse;
- }
-
- /**
- * This is the default constructor
- *
- */
- public SwitchWorkspace() {
- super();
- initialize();
- }
-
- /**
- * This is the override constructor
- *
- */
- public SwitchWorkspace(IFrame parentFrame, boolean modal) {
- super(parentFrame, modal);
- initialize();
- }
-
- /**
- * This method initializes this
- *
- * @return void
- */
- private void initialize() {
- this.setSize(472, 132);
- this.setContentPane(getJContentPane());
- this.setTitle("Select workspace");
- this.centerWindow();
- }
-
- /**
- * This method initializes jContentPane
- *
- * @return javax.swing.JPanel
- */
- private JPanel getJContentPane() {
- if (jContentPane == null) {
- jLabel1 = new JLabel();
- jLabel1.setBounds(new java.awt.Rectangle(15, 10, 120, 20));
- jLabel1.setText("Current Workspace");
- jLabel = new JLabel();
- jLabel.setBounds(new java.awt.Rectangle(15, 35, 120, 20));
- jLabel.setText("Change to ");
- jContentPane = new JPanel();
- jContentPane.setLayout(null);
- jContentPane.add(jLabel, null);
- jContentPane.add(jLabel1, null);
- jContentPane.add(getJTextFieldOld(), null);
- jContentPane.add(getJTextFieldNew(), null);
- jContentPane.add(getJButtonOk(), null);
- jContentPane.add(getJButtonCancel(), null);
- jContentPane.add(getJButtonBrowse(), null);
- }
- return jContentPane;
- }
-
- private boolean check() {
- if (isEmpty(this.jTextFieldNew.getText())) {
- Log.wrn("Switch Workspace", "New workspace must be entered!");
- return false;
- }
- if (Workspace.checkWorkspace(this.jTextFieldNew.getText()) != Workspace.WORKSPACE_VALID) {
- Log.wrn("Switch Workspace", "Please select a valid workspace!");
- return false;
- }
- return true;
- }
-
- /* (non-Javadoc)
- * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
- *
- * Override actionPerformed to listen all actions
- */
- public void actionPerformed(ActionEvent arg0) {
- if (arg0.getSource() == jButtonCancel) {
- this.setVisible(false);
- returnType = DataType.RETURN_TYPE_CANCEL;
- }
-
- if (arg0.getSource() == jButtonOk) {
- if (!check()) {
- return;
- } else {
- Workspace.setCurrentWorkspace(this.jTextFieldNew.getText());
- returnType = DataType.RETURN_TYPE_OK;
- this.setVisible(false);
- }
- }
-
- if (arg0.getSource() == jButtonBrowse) {
- JFileChooser fc = new JFileChooser();
- fc.setAcceptAllFileFilterUsed(false);
- fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
- int result = fc.showOpenDialog(new JPanel());
- if (result == JFileChooser.APPROVE_OPTION) {
- this.jTextFieldNew.setText(Tools.convertPathToCurrentOsType(fc.getSelectedFile().getPath()));
- }
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/GenBuild.msa b/Tools/Java/Source/GenBuild/GenBuild.msa
deleted file mode 100644
index bfddea1ff7..0000000000
--- a/Tools/Java/Source/GenBuild/GenBuild.msa
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>GenBuild</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>0FC76CF5-8ACF-49a7-82E9-EA5BE953CC48</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano Tool Resources Module</Abstract>
- <Description>
- This Module provides the EFI/Tiano Tools that are used to create EFI/Tiano
- Modules and Platform Binary Files (PBF)
- These tools require compilation only once if the Developer Workstation and
- the Developer's choice of HOST tool chain are stable. If the developer
- updates either the OS or the HOST tool chain, these tools should be rebuilt.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>GenBuild.tasks</Filename>
- <Filename>org/tianocore/build/FfsProcess.java</Filename>
- <Filename>org/tianocore/build/FileProcess.java</Filename>
- <Filename>org/tianocore/build/FrameworkBuildTask.java</Filename>
- <Filename>org/tianocore/build/GenBuildTask.java</Filename>
- <Filename>org/tianocore/build/ModuleBuildFileGenerator.java</Filename>
- <Filename>org/tianocore/build/GenBuildThread.java</Filename>
-
- <Filename>org/tianocore/build/autogen/AutoGen.java</Filename>
- <Filename>org/tianocore/build/autogen/AutogenLibOrder.java</Filename>
- <Filename>org/tianocore/build/autogen/CommonDefinition.java</Filename>
-
- <Filename>org/tianocore/build/exception/AutoGenException.java</Filename>
- <Filename>org/tianocore/build/exception/GenBuildException.java</Filename>
- <Filename>org/tianocore/build/exception/PcdAutogenException.java</Filename>
- <Filename>org/tianocore/build/exception/PlatformPcdPreprocessBuildException.java</Filename>
- <Filename>org/tianocore/build/exception/XmlParseException.java</Filename>
-
- <Filename>org/tianocore/build/fpd/FpdParserTask.java</Filename>
- <Filename>org/tianocore/build/fpd/PlatformBuildFileGenerator.java</Filename>
- <Filename>org/tianocore/build/fpd/FpdParserForThread.java</Filename>
-
- <Filename>org/tianocore/build/global/DpFile.java</Filename>
- <Filename>org/tianocore/build/global/DpFileList.java</Filename>
- <Filename>org/tianocore/build/global/GenBuildLogger.java</Filename>
- <Filename>org/tianocore/build/global/GlobalData.java</Filename>
- <Filename>org/tianocore/build/global/OnDependency.java</Filename>
- <Filename>org/tianocore/build/global/OutputManager.java</Filename>
- <Filename>org/tianocore/build/global/Spd.java</Filename>
- <Filename>org/tianocore/build/global/SurfaceAreaQuery.java</Filename>
- <Filename>org/tianocore/build/global/VariableTask.java</Filename>
-
- <Filename>org/tianocore/build/id/FpdModuleIdentification.java</Filename>
- <Filename>org/tianocore/build/id/Identification.java</Filename>
- <Filename>org/tianocore/build/id/ModuleIdentification.java</Filename>
- <Filename>org/tianocore/build/id/PackageIdentification.java</Filename>
- <Filename>org/tianocore/build/id/PlatformIdentification.java</Filename>
-
- <Filename>org/tianocore/build/pcd/action/PCDAutoGenAction.java</Filename>
- <Filename>org/tianocore/build/pcd/action/PcdDatabase.java</Filename>
- <Filename>org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java</Filename>
-
- <Filename>org/tianocore/build/toolchain/ConfigReader.java</Filename>
- <Filename>org/tianocore/build/toolchain/ToolChainConfig.java</Filename>
- <Filename>org/tianocore/build/toolchain/ToolChainElement.java</Filename>
- <Filename>org/tianocore/build/toolchain/ToolChainInfo.java</Filename>
- <Filename>org/tianocore/build/toolchain/ToolChainKey.java</Filename>
- <Filename>org/tianocore/build/toolchain/ToolChainMap.java</Filename>
-
- <Filename>org/tianocore/build/tools/ModuleItem.java</Filename>
- <Filename>org/tianocore/build/tools/PackageItem.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea> \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/GenBuild.tasks b/Tools/Java/Source/GenBuild/GenBuild.tasks
deleted file mode 100644
index d581323b8d..0000000000
--- a/Tools/Java/Source/GenBuild/GenBuild.tasks
+++ /dev/null
@@ -1,8 +0,0 @@
-FPDParser = org.tianocore.build.fpd.FpdParserTask
-bl = org.tianocore.build.global.VariableTask
-GenBuild = org.tianocore.build.GenBuildTask
-FrameworkBuild = org.tianocore.build.FrameworkBuildTask
-OnDependency = org.tianocore.build.global.OnDependency
-sourcefiles = org.tianocore.build.global.DpFileList
-targetfiles = org.tianocore.build.global.DpFileList
-file = org.tianocore.build.global.DpFile
diff --git a/Tools/Java/Source/GenBuild/build.xml b/Tools/Java/Source/GenBuild/build.xml
deleted file mode 100644
index 2f9476f4bd..0000000000
--- a/Tools/Java/Source/GenBuild/build.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?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="GenBuild" default="GenBuild" basedir=".">
-
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <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="${WORKSPACE}/Tools/Jars" includes="PcdTools.jar"/>
- <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
- </path>
- <property name="buildDir" value="build"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/Jars"/>
- <target name="GenBuild" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/GenBuild" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: GenBuild.jar"/>
- <delete file="${installLocation}/GenBuild.jar"/>
- <if>
- <available file="${installLocation}/GenBuild.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/GenBuild.jar"/>
- <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>
- </then>
- </if>
- </target>
- <target name="install" depends="source">
- <copy file="GenBuild.tasks" toDir="${buildDir}"/>
- <jar destfile="${installLocation}/GenBuild.jar"
- basedir="${buildDir}"
- includes="**"
- />
- </target>
-</project>
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java
deleted file mode 100644
index f63b7d95f0..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/FfsProcess.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/** @file
- File is FfsProcess class which is used to get the corresponding FFS layout
- information for driver module.
-
-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.
-**/
-package org.tianocore.build;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.security.MessageDigest;
-import java.util.Vector;
-
-import javax.xml.namespace.QName;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.apache.xmlbeans.XmlCursor;
-import org.tianocore.BuildOptionsDocument;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.common.definitions.EdkDefinitions;
-import org.tianocore.common.logger.EdkLog;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- <p><code>FfsProcess</code> is a class to find the corresponding FFS layout. </p>
-
- <p>The FFS Layout is like following: </p>
-
- <pre>
- &lt;Ffs type="APPLICATION"&gt;
- &lt;Attribute Name="FFS_FILETYPE" Value="EFI_FV_FILETYPE_APPLICATION" /&gt;
- &lt;Attribute Name="FFS_ATTRIB_CHECKSUM" Value="TRUE" /&gt;
- &lt;Sections EncapsulationType="Compress"&gt;
- &lt;Sections EncapsulationType="Guid-Defined"&gt;
- &lt;Section SectionType="EFI_SECTION_PE32" /&gt;
- &lt;Section SectionType="EFI_SECTION_USER_INTERFACE" /&gt;
- &lt;Section SectionType="EFI_SECTION_VERSION" /&gt;
- &lt;/Sections&gt;
- &lt;/Sections&gt;
- &lt;/Ffs&gt;
- </pre>
-
- @since GenBuild 1.0
-**/
-public class FfsProcess {
-
- private BuildOptionsDocument.BuildOptions.Ffs ffsXmlObject;
-
- private Project project = null;
- ///
- /// ANT script to call GenFfs
- ///
- private Element ffsNode = null;
-
- ///
- /// Module base name
- ///
- private String basename;
-
- ///
- /// Sections type: normal
- ///
- private static int MODE_NONE = 0;
-
- ///
- /// Sections type: compress
- ///
- private static int MODE_COMPRESS = 1;
-
- ///
- /// Sections type: guid-define
- ///
- private static int MODE_GUID_DEFINED = 2;
-
- ///
- /// mapping from section type to section output file extension
- ///
- public static final String[][] sectionExt = EdkDefinitions.SectionTypeExtensions;
-
- /**
- search in the type, if componentType is listed in type, return true;
- otherwise return false.
-
- @param type a list supported component type separated by comma
- @param componentType current module component type
- @return whether componentType is one of type
- **/
- private boolean isMatch(String type, String componentType) {
- String[] items = type.split("[ \t]*,[ \t]*");
- for (int i = 0; i < items.length; i++) {
- if (items[i].equalsIgnoreCase(componentType)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- Find the corresponding FFS layout in <code>FPD</code>.
-
- @param buildType Current module's component type
- @param project Ant project
- @return whether find the corresponding FFS layout
- @throws BuildException
- If can't find FFS Layout in FPD.
- **/
- public boolean initSections(String buildType, Project project, FpdModuleIdentification fpdModuleId) throws BuildException {
- this.project = project;
- //
- // Try to find Ffs layout from FPD file
- //
- SurfaceAreaQuery saq = new SurfaceAreaQuery(GlobalData.getFpdBuildOptionsMap());
- BuildOptionsDocument.BuildOptions.Ffs[] ffsArray = saq.getFpdFfs();
- for (int i = 0; i < ffsArray.length; i++) {
- if (isMatch(ffsArray[i].getFfsKey(), buildType)) {
- ffsXmlObject = ffsArray[i];
- genDigest();
- return true;
- }
- }
-
- //
- // If FfsFormatKey is not null, report exception and fail build
- // Otherwise report warning message
- //
- if (buildType == null) {
- EdkLog.log(EdkLog.EDK_WARNING, "Warning: this module doesn't specify a FfsFormatKey. ");
- } else {
- throw new BuildException("Can't find the FfsFormatKey [" + buildType + "] attribute in the FPD file!");
- }
-
- return false;
- }
-
- /**
- Recursive parse the FFS layout. Find out all section type here used.
-
- @param document BaseName_build.xml Xml document
- @param basename Module's base name
- @param guid Module's GUID
- @param targetFilename Module's final file name (GUID-BaseName.APP)
- @return List of section type
- **/
- public String[] getGenSectionElements(Document document, String basename, String guid, String targetFilename) {
- this.basename = basename;
- if (ffsXmlObject == null) {
- return new String[0];
- }
- Vector<String> sectionList = new Vector<String>();
- XmlCursor cursor = null;
-
- cursor = ffsXmlObject.newCursor();
-
- int mode = MODE_NONE;
- Element genffsfileEle = document.createElement("genffsfile");
- genffsfileEle.setAttribute("outputDir", "${BIN_DIR}");
- genffsfileEle.setAttribute("moduleType", "${MODULE_TYPE}");
- genffsfileEle.setAttribute("BaseName", basename);
- genffsfileEle.setAttribute("fileGuid", guid);
-
- if (cursor.toFirstChild()) {
- do {
- if (cursor.getName().getLocalPart().equalsIgnoreCase("Attribute")) {
- String name = cursor.getAttributeText(new QName("Name"));
- String value = cursor.getAttributeText(new QName("Value"));
- genffsfileEle.setAttribute(changeAttributeName(name), value);
- } else if (cursor.getName().getLocalPart().equalsIgnoreCase("Section")) {
- cursor.push();
- dealSection(mode, document, genffsfileEle, cursor, sectionList);
- cursor.pop();
- } else if (cursor.getName().getLocalPart().equalsIgnoreCase("Sections")) {
- cursor.push();
- dealSections(mode, document, genffsfileEle, cursor, sectionList);
- cursor.pop();
- }
- } while (cursor.toNextSibling());
- }
- //
- // Check dependency
- //
- Element outofdateEle = document.createElement("OnDependency");
- Element sourceEle = document.createElement("sourcefiles");
- Vector<String> sections = new Vector<String>();
- for (int i = 0; i < sectionList.size(); i++) {
- String section = (String) sectionList.get(i);
- if (isSectionType(section)) {
- sections.addElement(section);
- }
- Element pathEle = document.createElement("file");
- pathEle.setAttribute("name", getSectionFile(basename, section));
- sourceEle.appendChild(pathEle);
- }
- //
- // add FFS layout digest into the source file list
- //
- Element pathEle = document.createElement("file");
- pathEle.setAttribute("name", "${DEST_DIR_OUTPUT}" + File.separator + "ffs.md5");
- sourceEle.appendChild(pathEle);
-
- String[] result = sections.toArray(new String[sections.size()]);
-
- outofdateEle.appendChild(sourceEle);
- Element targetEle = document.createElement("targetfiles");
- Element fileEle = document.createElement("file");
- fileEle.setAttribute("name", "${BIN_DIR}" + File.separatorChar + targetFilename);
- targetEle.appendChild(fileEle);
- outofdateEle.appendChild(targetEle);
- Element sequentialEle = document.createElement("sequential");
- sequentialEle.appendChild(genffsfileEle);
- outofdateEle.appendChild(sequentialEle);
- ffsNode = outofdateEle;
- return result;
- }
-
- /**
- Change the attribute name. For example:
-
- <pre>
- Before change: FFS_ATTRIB_CHECKSUM
- After change: ffsATTRIBCHECKSUM
- </pre>
-
- @param name Original attribute name
- @return Changed attribute name
- **/
- private String changeAttributeName(String name) {
- String[] strs = name.split("_");
- String str = strs[0].toLowerCase();
- for (int j = 1; j < strs.length; j++) {
- str += strs[j];
- }
- return str;
- }
-
- /**
- Recursively deal with Sections. If sections does not specify a type, then omit it.
-
- @param mode Current node mode (MODE_NONE | MODE_COMPREE | MODE_GUID_DEFINED)
- @param doc Xml Document
- @param root Root Node
- @param cursor Current FFS layout cursor
- @param list List of section type here used
- **/
- private void dealSections(int mode, Document doc, Element root, XmlCursor cursor, Vector<String> list) {
- String type = cursor.getAttributeText(new QName("EncapsulationType"));
- String toolName = cursor.getAttributeText(new QName("ToolName"));
- String sectType = cursor.getAttributeText(new QName("SectionType"));
- if (type == null && sectType == null) {
- if (cursor.toFirstChild()) {
- do {
- if (cursor.getName().getLocalPart().equalsIgnoreCase("Section")) {
- cursor.push();
- dealSection(mode, doc, root, cursor, list);
- cursor.pop();
- } else if (cursor.getName().getLocalPart().equalsIgnoreCase("Sections")) {
- cursor.push();
- dealSections(mode, doc, root, cursor, list);
- cursor.pop();
- }
- } while (cursor.toNextSibling());
- }
- return;
- }
- Element ele;
- Element toolEle = null;
- if (type.equalsIgnoreCase("COMPRESS") && (toolName == null || toolName.equalsIgnoreCase(""))) {
- mode = MODE_COMPRESS;
- //
- // <gensection sectiontype="EFI_SECTION_COMPRESSION">
- //
- ele = doc.createElement("gensection");
- ele.setAttribute("sectionType", "EFI_SECTION_COMPRESSION");
-
- } else {
- mode = MODE_GUID_DEFINED;
- //
- // <gensection sectiontype="EFI_SECTION_GUID_DEFINED">
- //
- ele = doc.createElement("gensection");
- if (type != null) {
- if (type.equalsIgnoreCase("COMPRESS")) {
- ele.setAttribute("sectionType", "EFI_SECTION_COMPRESSION");
- }else {
- ele.setAttribute("sectiontype", "EFI_SECTION_GUID_DEFINED");
- }
-
- } else {
- ele.setAttribute("sectiontype", sectType);
- }
- //
- // <tool toolName="${OEMTOOLPATH}\toolname"
- // outputPath = "${DEST_DIR_OUTPUT}">
- //
- toolEle = doc.createElement("tool");
- if (toolName == null || toolName.equalsIgnoreCase("")) {
- toolEle.setAttribute("toolName", "${WORKSPACE_DIR}" + File.separatorChar + "Tools" + File.separatorChar + "bin"
- + File.separatorChar + "GenCRC32Section");
- }else{
- File toolExe = new File(toolName);
- //
- // If <Tool> element exist, add sub element under <tool> .
- //
- if (toolExe.isAbsolute()) {
- toolEle.setAttribute("toolName", toolName);
- } else {
- toolEle.setAttribute("toolName", "${WORKSPACE_DIR}" + File.separatorChar + "Tools" + File.separatorChar + "bin"
- + File.separatorChar + toolName);
- }
- }
-
- toolEle.setAttribute("outputPath", "${DEST_DIR_OUTPUT}");
- ele.appendChild(toolEle);
- }
- if (cursor.toFirstChild()) {
- do {
- if (cursor.getName().getLocalPart().equalsIgnoreCase("Section")) {
- cursor.push();
- if (toolEle == null) {
- dealSection(mode, doc, ele, cursor, list);
- } else {
- dealSection(mode, doc, toolEle, cursor, list);
- }
-
- cursor.pop();
- } else if (cursor.getName().getLocalPart().equalsIgnoreCase("Sections")) {
- cursor.push();
- if (toolEle == null) {
- dealSections(mode, doc, ele, cursor, list);
- } else {
- dealSections(mode, doc, toolEle, cursor, list);
- }
-
- cursor.pop();
- }
- } while (cursor.toNextSibling());
- }
- root.appendChild(ele);
- }
-
- /**
- Recursively deal with section.
-
- @param mode Current node mode (MODE_NONE | MODE_COMPREE | MODE_GUID_DEFINED)
- @param doc Xml Document
- @param root Root Node
- @param cursor Current FFS layout cursor
- @param list List of section type here used
- **/
- private void dealSection(int mode, Document doc, Element root, XmlCursor cursor, Vector<String> list) {
- String type = cursor.getAttributeText(new QName("SectionType"));
- String alignment = cursor.getAttributeText(new QName("Alignment"));
-
- //
- // Judge if file is specified? Yes, just use the file, else call Build Macro
- // If fileName is null, means without FileNames specify in FPD file
- //
- String fileName = null;
- cursor.push();
- if (cursor.toFirstChild()) {
- do {
- if (cursor.getName().getLocalPart().equalsIgnoreCase("Filenames")) {
- cursor.push();
- if (cursor.toFirstChild()) {
- do {
- if (cursor.getName().getLocalPart().equalsIgnoreCase("Filename")) {
- fileName = cursor.getTextValue();
- }
- } while (cursor.toNextSibling());
- }
- cursor.pop();
- }
- } while (cursor.toNextSibling());
- }
-
- cursor.pop();
-
- if (fileName == null) {
- list.addElement(type);
- } else {
- list.addElement(fileName);
- }
-
- if (mode == MODE_GUID_DEFINED) {
- //
- // <input file="${DEST_DIR_OUTPUT}\Bds.pe32"/>
- //
- Element ele = doc.createElement("input");
- if (fileName == null) {
- ele.setAttribute("file", getSectionFile(basename, type));
- } else {
- ele.setAttribute("file", fileName);
- }
- root.appendChild(ele);
- } else {
- //
- // <sectFile fileName= "..."/>
- //
- Element ele = doc.createElement("sectFile");
- if (fileName == null) {
- ele.setAttribute("fileName", getSectionFile(basename, type));
- } else {
- ele.setAttribute("fileName", fileName);
- }
- if (alignment != null) {
- ele.setAttribute("Alignment", alignment);
- }
- root.appendChild(ele);
- }
- }
-
- /**
- Get the corresponding section file suffix.
-
- @param type Section type
- @return Corresponding section file extension
- **/
- private String getSectionFile(String basename, String type) {
- for (int i = 0; i < sectionExt.length; i++) {
- if (sectionExt[i][0].equalsIgnoreCase(type)) {
- return "${DEST_DIR_OUTPUT}" + File.separatorChar + basename + sectionExt[i][1];
- }
- }
- return type;
- }
-
- private boolean isSectionType(String type) {
- for (int i = 0; i < sectionExt.length; i++) {
- if (sectionExt[i][0].equalsIgnoreCase(type)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- Return the ANT script to call GenFfs Tool.
-
- @return ANT script to call GenFfs Tool
- **/
- public Element getFfsNode() {
- return ffsNode;
- }
-
- private void genDigest() {
- String digestFilePath = project.getProperty("DEST_DIR_OUTPUT");
- if (digestFilePath == null) {
- EdkLog.log(EdkLog.EDK_WARNING, "Warning: cannot get DEST_DIR_OUTPUT!");
- return;
- }
-
- //
- // use MD5 algorithm
- //
- MessageDigest md5 = null;
- try {
- md5 = MessageDigest.getInstance("MD5");
- //
- // convert the FFS layout XML DOM tree into string and use it to
- // calculate its MD5 digest value
- //
- md5.update(ffsXmlObject.xmlText().getBytes());
- } catch (Exception e) {
- EdkLog.log(EdkLog.EDK_WARNING, "Warning: " + e.getMessage());
- return;
- }
-
- //
- // get the MD5 digest value
- //
- byte[] digest = md5.digest();
-
- //
- // put the digest in a file named "ffs.md5" if it doesn't exist, otherwise
- // we will compare the digest in the file with the one just calculated
- //
- digestFilePath += File.separator + "ffs.md5";
- File digestFile = new File(digestFilePath);
- if (digestFile.exists()) {
- byte[] oldDigest = new byte[digest.length];
- try {
- FileInputStream fIn = new FileInputStream(digestFile);
- fIn.read(oldDigest);
- fIn.close();
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
-
- boolean noChange = true;
- for (int i = 0; i < oldDigest.length; ++i) {
- if (digest[i] != oldDigest[i]) {
- noChange = false;
- break;
- }
- }
-
- if (noChange) {
- return;
- }
- }
-
- //
- // update the "ffs.md5" file content with new digest value
- //
- try {
- FileOutputStream fOut = new FileOutputStream(digestFile);
- fOut.write(digest);
- fOut.close();
- } catch (Exception e) {
- throw new BuildException(e.getMessage());
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FileProcess.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FileProcess.java
deleted file mode 100644
index 59a2e587bd..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/FileProcess.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/** @file
- File is FileProcess class which is used to generate ANT script to build
- source files.
-
-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.
-**/
-package org.tianocore.build;
-
-import java.io.File;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- <p><code>FileProcess</code> is class to generate ANT script to build source
- files.</p>
-
- <p>If file does not specify file type, <code>FileProcess</code> will judge
- by its extension. Following is the current supported extensions. </p>
-
- <pre>
- Source File Suffix File Type Description
- .h CHeader C header file
- .c CCode C source file
- .inc ASMHeader Assembly header file
- .asm ASM Assembly source file, usually for IA32 and X64 Arch and MSFT tool chain
- .S ASM Assembly source file, usually for IPF Arch
- .s ASM Assembly source file, usually for IA32 and X64 Arch and GCC tool chain
- .uni UNI Unicode file
- .vfr VFR Visual Forms Representation File
- .fv FV Firmware Volume
- .SEC FFS Firmware File System file
- .PEI FFS Firmware File System file
- .DXE FFS Firmware File System file
- .APP FFS Firmware File System file
- .FVI FFS Firmware File System file
- .FFS FFS Firmware File System file
- .bmp BMP Graphic File
- .i PPCode IPF PreProcessor Code
- </pre>
-
- @since GenBuild 1.0
-**/
-public class FileProcess {
- ///
- /// The mapping information about source suffix, tool code, file type.
- ///
- public final String[][] fileTypes = { {".h", "", "CHeader" },
- {".c", "CC", "CCode" },
- {".inc", "", "ASMHeader" },
- {".asm", "ASM", "ASM" },
- {".S", "ASM", "ASM" },
- {".s", "ASM", "ASM" },
- {".uni", "", "UNI" },
- {".vfr", "", "VFR" },
- {".Vfr", "", "VFR" },
- {".dxs", "", "DPX"},
- {".fv", "", "FV" },
- {".efi", "", "EFI" },
- {".SEC", "", "FFS" },
- {".PEI", "", "FFS" },
- {".DXE", "", "FFS" },
- {".APP", "", "FFS" },
- {".FYI", "", "FFS" },
- {".FFS", "", "FFS" },
- {".bmp", "", "BMP" },
- {".i", "PP", "PPCode"}};
- ///
- /// Current ANT context.
- ///
- private Project project;
-
- ///
- /// Current module's include pathes
- ///
- private String[] includes;
-
- ///
- /// Xml Document.
- ///
- private Document document;
-
- ///
- /// The flag to ensure all unicode files build before others.
- ///
- private boolean unicodeFirst = true;
-
- ///
- /// The flag present whether current module contains Unicode files or not.
- ///
- private boolean unicodeExist = false;
-
- /**
- Initialize the project, includes, sourceFiles, document members.
-
- @param project ANT project
- @param includes Module include pathes
- @param sourceFiles Modules source files
- @param document XML document
- **/
- public void init(Project project, String[] includes, Document document) {
- this.document = document;
- this.includes = includes;
- this.project = project;
- }
-
- /**
- Parse file without file type.
-
- @param filename Source file name
- @param root Root node
- @param unicodeFirst whether build Unicode file firstly or not
- **/
- public synchronized void parseFile(String filename, String family, Node root, boolean unicodeFirst) {
- this.unicodeFirst = unicodeFirst;
- parseFile(filename, family, root);
- }
-
- /**
- Get whether current module contains Unicode files or not.
-
- @return Whether current module contains Unicode files or not
- **/
- public boolean isUnicodeExist() {
- return unicodeExist;
- }
-
- /**
- Parse file.
-
- @param filename Source file name
- @param filetype Source file type
- @param root Root node
- @param unicodeFirst whether build Unicode file firstly or not
- **/
- public synchronized void parseFile(String filename, String filetype, String family, Node root, boolean unicodeFirst) {
- this.unicodeFirst = unicodeFirst;
- parseFile(filename, filetype, family, root);
- }
-
- /**
- Find out source file's type.
-
- @param filename Source file name
- @param root Root node
- **/
- public synchronized void parseFile(String filename, String family, Node root) throws BuildException {
- for (int i = 0; i < fileTypes.length; i++) {
- if (filename.endsWith(fileTypes[i][0])) {
- parseFile(filename, fileTypes[i][2], family, root);
- return ;
- }
- }
- }
-
- /**
- Parse file. If flag <code>unicodeFirst</code> is true, then build all
- unicode files firstly.
-
- <p>Note that AutoGen.c is processed specially. It's output path is always
- <code>${DEST_DIR_OUTPUT}</code>, others are <code>${DEST_DIR_OUTPUT}</code>
- and relative to module path. </p>
-
- @param filename Source file name
- @param filetype Source file type
- @param root Root node
- **/
- public synchronized void parseFile(String filename, String filetype, String family, Node root) {
- //
- // Filter file with family. Only family is specified in source file and
- // not include current family will skip the file.
- //
- String toolCode = getToolCodeByFileType(filetype);
- if (family != null && !family.trim().equalsIgnoreCase("")) {
- String toolChainFamily = project.getProperty(toolCode + "_FAMILY");
- if (toolChainFamily != null) {
- if(!toolChainFamily.equalsIgnoreCase(family)) {
- return ;
- }
- }
- }
-
- if (unicodeFirst) {
- if ( ! filetype.equalsIgnoreCase("UNI")){
- return ;
- }
- unicodeExist= true;
- } else {
- if (filetype.equalsIgnoreCase("UNI")){
- return ;
- }
- }
-
- //
- // If file is C or ASM header file, skip it
- //
- if (filetype.equalsIgnoreCase("CHeader") || filetype.equalsIgnoreCase("ASMHeader")) {
- return;
- }
-
- //
- // If file is pre-processor file, skip it
- //
- if (filetype.equalsIgnoreCase("PPCode")) {
- return;
- }
-
- //
- // If define CC_EXT in tools_def.txt file, the source file with
- // different suffix is skipped
- //
- String toolsDefExtName = project.getProperty(toolCode + "_EXT");
- if (toolsDefExtName != null) {
- String[] exts = toolsDefExtName.split(" ");
- for (int i = 0; i < exts.length; i++) {
- if ( ! filename.endsWith(exts[i])) {
- return ;
- }
- }
- }
-
- String module_path = project.getProperty("MODULE_DIR");
- File moduleFile = new File(module_path);
- File sourceFile = new File(filename);
-
- //
- // If source file is AutoGen.c, then Filepath is .
- //
- String sourceFilepath = "";
- String sourceFilename = "";
- String sourceFileext = "";
- if (sourceFile.getPath().endsWith("AutoGen.c")) {
- sourceFilepath = ".";
- sourceFilename = "AutoGen";
- sourceFileext = ".c";
- filetype = "AUTOGEN";
- } else {
- // sourceFile.
- String str = sourceFile.getPath().substring(moduleFile.getPath().length() + 1);
- int index = str.lastIndexOf(File.separatorChar);
- sourceFilepath = ".";
- if (index > 0) {
- sourceFilepath = str.substring(0, index);
- str = str.substring(index + 1);
- }
- sourceFilename = str;
- index = str.lastIndexOf('.');
- if (index > 0) {
- sourceFilename = str.substring(0, index);
- sourceFileext = str.substring(index);
- }
- }
- // <Build_filetype FILEPATH="" FILENAME="" />
- Element ele = document.createElement("Build_" + filetype);
- ele.setAttribute("FILEPATH", sourceFilepath);
- ele.setAttribute("FILENAME", sourceFilename);
- ele.setAttribute("FILEEXT", sourceFileext.substring(1));
- Element includesEle = document.createElement("EXTRA.INC");
- for (int i = 0; i < includes.length; i++) {
- Element includeEle = document.createElement("includepath");
- includeEle.setAttribute("path", project.replaceProperties(includes[i]));
- includesEle.appendChild(includeEle);
- }
- ele.appendChild(includesEle);
- root.appendChild(ele);
- }
-
- private String getToolCodeByFileType(String fileType) {
- for (int i = 0; i < fileTypes.length; i++) {
- if (fileTypes[i][2].equalsIgnoreCase(fileType)) {
- return fileTypes[i][1];
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
deleted file mode 100644
index 8482401bb0..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/FrameworkBuildTask.java
+++ /dev/null
@@ -1,415 +0,0 @@
-/** @file FrameworkBuildTask.java
-
- The file is ANT task to find MSA or FPD file and build them.
-
- 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.
- **/
-package org.tianocore.build;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.tianocore.build.exception.AutoGenException;
-import org.tianocore.build.exception.GenBuildException;
-import org.tianocore.build.exception.PcdAutogenException;
-import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;
-import org.tianocore.build.fpd.FpdParserForThread;
-import org.tianocore.build.fpd.FpdParserTask;
-import org.tianocore.build.global.GenBuildLogger;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.toolchain.ConfigReader;
-import org.tianocore.build.toolchain.ToolChainInfo;
-import org.tianocore.common.definitions.ToolDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- <p>
- <code>FrameworkBuildTask</code> is an Ant task. The main function is finding
- and processing a FPD or MSA file, then building a platform or stand-alone
- module.
-
- <p>
- The task search current directory and find out all MSA and FPD files by file
- extension. Base on ACTIVE_PLATFORM policy, decide to build a platform or a
- stand-alone module. The ACTIVE_PLATFORM policy is:
-
- <pre>
- 1. More than one MSA files, report error;
- 2. Only one MSA file, but ACTIVE_PLATFORM is not specified, report error;
- 3. Only one MSA file, and ACTIVE_PLATFORM is also specified, build this module;
- 4. No MSA file, and ACTIVE_PLATFORM is specified, build the active platform;
- 5. No MSA file, no ACTIVE_PLATFORM, and no FPD file, report error;
- 6. No MSA file, no ACTIVE_PLATFORM, and only one FPD file, build the platform;
- 7. No MSA file, no ACTIVE_PLATFORM, and more than one FPD files, Report Error!
- </pre>
-
- <p>
- Framework build task also parse target file [${WORKSPACE_DIR}/Tools/Conf/target.txt].
- And load all system environment variables to Ant properties.
-
- <p>
- The usage for this task is :
-
- <pre>
- &lt;FrameworkBuild type="cleanall" /&gt;
- </pre>
-
- @since GenBuild 1.0
-**/
-public class FrameworkBuildTask extends Task{
-
- private Set<File> fpdFiles = new LinkedHashSet<File>();
-
- private Set<File> msaFiles = new LinkedHashSet<File>();
-
- ///
- /// This is only for none-multi-thread build to reduce overriding message
- ///
- public static Hashtable<String, String> originalProperties = new Hashtable<String, String>();
-
- String toolsDefFilename = ToolDefinitions.DEFAULT_TOOLS_DEF_FILE_PATH;
-
- String targetFilename = ToolDefinitions.TARGET_FILE_PATH;
-
- String dbFilename = ToolDefinitions.FRAMEWORK_DATABASE_FILE_PATH;
-
- String activePlatform = null;
-
- ///
- /// The flag to present current is multi-thread enabled
- ///
- public static boolean multithread = false;
-
- ///
- /// The concurrent thread number
- ///
- public static int MAX_CONCURRENT_THREAD_NUMBER = 2;
-
- ///
- /// there are three type: all (build), clean and cleanall
- ///
- private String type = "all";
-
- public void execute() throws BuildException {
- //
- // set Logger
- //
- GenBuildLogger logger = new GenBuildLogger(getProject());
- EdkLog.setLogLevel(EdkLog.EDK_DEBUG);
- EdkLog.setLogLevel(getProject().getProperty("env.LOGLEVEL"));
- EdkLog.setLogger(logger);
-
- try {
- processFrameworkBuild();
- }catch (BuildException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (PcdAutogenException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (AutoGenException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (PlatformPcdPreprocessBuildException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (GenBuildException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (EdkException e) {
- //
- // Add more logic process here
- //
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- }
- }
-
- private void processFrameworkBuild() throws EdkException, GenBuildException, AutoGenException, PcdAutogenException, PlatformPcdPreprocessBuildException {
- try {
- //
- // Get current working dir
- //
- File dummyFile = new File(".");
- File cwd = dummyFile.getCanonicalFile();
- File[] files = cwd.listFiles();
-
- //
- // Scan current dir, and find out all .FPD and .MSA files
- //
- for (int i = 0; i < files.length; i++) {
- if (files[i].isFile()) {
- if (files[i].getName().endsWith(ToolDefinitions.FPD_EXTENSION)) {
- //
- // Found FPD file
- //
- fpdFiles.add(files[i]);
- } else if (files[i].getName().endsWith(ToolDefinitions.MSA_EXTENSION)) {
- //
- // Found MSA file
- //
- msaFiles.add(files[i]);
- }
- }
- }
- } catch (IOException ex) {
- BuildException buildException = new BuildException("Scanning current directory error. \n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- }
-
- //
- // Import all system environment variables to ANT properties
- //
- importSystemEnvVariables();
-
- //
- // Read target.txt file
- //
- readTargetFile();
-
- //
- // Global Data initialization
- //
- File workspacePath = new File(getProject().getProperty("WORKSPACE"));
- getProject().setProperty("WORKSPACE_DIR", workspacePath.getPath().replaceAll("(\\\\)", "/"));
- GlobalData.initInfo(getProject(), dbFilename, workspacePath.getPath(), toolsDefFilename);
-
- //
- // If find MSA file and ACTIVE_PLATFORM is set, build the module;
- // else fail build.
- // If without MSA file, and ACTIVE_PLATFORM is set, build the ACTIVE_PLATFORM.
- // If ACTIVE_PLATFORM is not set, and only find one FPD file, build the platform;
- // If find more than one FPD files, report error.
- //
- File buildFile = null;
- if (msaFiles.size() > 0) {
- if (activePlatform == null) {
- throw new BuildException("If trying to build a single module, please set ACTIVE_PLATFORM in file [" + targetFilename + "]. ");
- }
- //
- // Build the single module
- //
- buildFile = msaFiles.toArray(new File[1])[0];
- } else if (activePlatform != null) {
- buildFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);
- } else if (fpdFiles.size() == 1) {
- buildFile = fpdFiles.toArray(new File[1])[0];
- } else if (fpdFiles.size() > 1) {
- throw new BuildException("Found " + fpdFiles.size() + " FPD files in current dir. ");
- }
-
- //
- // If there is no build files or FPD files or MSA files, stop build
- //
- else {
- throw new BuildException("Can't find any FPD or MSA files in the current directory. ");
- }
-
- //
- // Build every FPD files (PLATFORM build)
- //
- if (buildFile.getName().endsWith(ToolDefinitions.FPD_EXTENSION)) {
- EdkLog.log(this, "Processing the FPD file [" + buildFile.getPath() + "] ..>> ");
- //
- // Iff for platform build will enable the multi-thread if set in target.txt
- //
- if (multithread && type.equalsIgnoreCase("all")) {
- EdkLog.log(this, "Multi-thread build is enabled. ");
- FpdParserForThread fpdParserForThread = new FpdParserForThread();
- fpdParserForThread.setType(type);
- fpdParserForThread.setProject(getProject());
- fpdParserForThread.setFpdFile(buildFile);
- fpdParserForThread.perform();
- return ;
- }
-
- FpdParserTask fpdParserTask = new FpdParserTask();
- fpdParserTask.setType(type);
- fpdParserTask.setProject(getProject());
- fpdParserTask.setFpdFile(buildFile);
- fpdParserTask.perform();
-
- //
- // If cleanall delete the Platform_build.xml
- //
- if (type.compareTo("cleanall") == 0) {
- File platformBuildFile =
- new File(getProject().getProperty("BUILD_DIR")
- + File.separatorChar
- + getProject().getProperty("PLATFORM")
- + "_build.xml");
- platformBuildFile.deleteOnExit();
- }
- }
-
- //
- // Build every MSA files (SINGLE MODULE BUILD)
- //
- else if (buildFile.getName().endsWith(ToolDefinitions.MSA_EXTENSION)) {
- if (multithread) {
- EdkLog.log(this, EdkLog.EDK_WARNING, "Multi-Thead do not take effect on Stand-Alone (Single) module build. ");
- multithread = false;
- }
- File tmpFile = new File(GlobalData.getWorkspacePath() + File.separatorChar + activePlatform);
- EdkLog.log(this, "Using the FPD file [" + tmpFile.getPath() + "] for the active platform. ");
-
- File[] moduleFiles = msaFiles.toArray(new File[msaFiles.size()]);
- for (int i = 0; i < moduleFiles.length; ++i) {
- EdkLog.log(this, "Processing the MSA file [" + moduleFiles[i].getPath() + "] ..>> ");
- GenBuildTask genBuildTask = new GenBuildTask();
- genBuildTask.setSingleModuleBuild(true);
- genBuildTask.setType(type);
- getProject().setProperty("PLATFORM_FILE", activePlatform);
- if( !multithread) {
- originalProperties.put("PLATFORM_FILE", activePlatform);
- }
- genBuildTask.setProject(getProject());
- genBuildTask.setMsaFile(moduleFiles[i]);
- genBuildTask.perform();
- }
- }
- }
-
- /**
- Import system environment variables to ANT properties. If system variable
- already exiests in ANT properties, skip it.
-
- **/
- private void importSystemEnvVariables() {
- Map<String, String> sysProperties = System.getenv();
- Iterator<String> iter = sysProperties.keySet().iterator();
- while (iter.hasNext()) {
- String name = iter.next();
-
- //
- // If system environment variable is not in ANT properties, add it
- //
- if (getProject().getProperty(name) == null) {
- getProject().setProperty(name, sysProperties.get(name));
- }
- }
-
- Hashtable allProperties = getProject().getProperties();
- Iterator piter = allProperties.keySet().iterator();
- while (piter.hasNext()) {
- String name = (String)piter.next();
- originalProperties.put(new String(name), new String((String)allProperties.get(name)));
- }
- }
-
- public void setType(String type) {
- this.type = type.toLowerCase();
- }
-
- private void readTargetFile() throws EdkException{
- String targetFile = getProject().getProperty("WORKSPACE_DIR") + File.separatorChar + targetFilename;
-
- String[][] targetFileInfo = ConfigReader.parse(getProject(), targetFile);
-
- //
- // Get ToolChain Info from target.txt
- //
- ToolChainInfo envToolChainInfo = new ToolChainInfo();
- String str = getValue(ToolDefinitions.TARGET_KEY_TARGET, targetFileInfo);
- if (str == null || str.trim().equals("")) {
- envToolChainInfo.addTargets("*");
- } else {
- envToolChainInfo.addTargets(str);
- }
- str = getValue(ToolDefinitions.TARGET_KEY_TOOLCHAIN, targetFileInfo);
- if (str == null || str.trim().equals("")) {
- envToolChainInfo.addTagnames("*");
- } else {
- envToolChainInfo.addTagnames(str);
- }
- str = getValue(ToolDefinitions.TARGET_KEY_ARCH, targetFileInfo);
- if (str == null || str.trim().equals("")) {
- envToolChainInfo.addArchs("*");
- } else {
- envToolChainInfo.addArchs(str);
- }
- GlobalData.setToolChainEnvInfo(envToolChainInfo);
-
- str = getValue(ToolDefinitions.TARGET_KEY_TOOLS_DEF, targetFileInfo);
- if (str != null && str.trim().length() > 0) {
- toolsDefFilename = str;
- }
-
- str = getValue(ToolDefinitions.TARGET_KEY_ACTIVE_PLATFORM, targetFileInfo);
- if (str != null && ! str.trim().equals("")) {
- if ( ! str.endsWith(".fpd")) {
- throw new BuildException("FPD file's extension must be \"" + ToolDefinitions.FPD_EXTENSION + "\"!");
- }
- activePlatform = str;
- }
-
- str = getValue(ToolDefinitions.TARGET_KEY_MULTIPLE_THREAD, targetFileInfo);
- if (str != null && str.trim().equalsIgnoreCase("Enable")) {
- multithread = true;
- }
-
- str = getValue(ToolDefinitions.TARGET_KEY_MAX_CONCURRENT_THREAD_NUMBER, targetFileInfo);
- //
- // Need to check the # of threads iff multithread is enabled.
- //
- if ((multithread) && (str != null )) {
- try {
- int threadNum = Integer.parseInt(str);
- if (threadNum > 0) {
- MAX_CONCURRENT_THREAD_NUMBER = threadNum;
- }
- } catch (Exception ex) {
- //
- // Give a warning message, and keep the default value
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Incorrent number specified for MAX_CONCURRENT_THREAD_NUMBER in file [" + targetFilename + "]");
- }
- }
- }
-
- private String getValue(String key, String[][] map) {
- for (int i = 0; i < map[0].length; i++){
- if (key.equalsIgnoreCase(map[0][i])) {
- return map[1][i];
- }
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java
deleted file mode 100644
index 2225a56edb..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildTask.java
+++ /dev/null
@@ -1,858 +0,0 @@
-/** @file
- This file is ANT task GenBuild.
-
- The file is used to parse a specified Module, and generate its build time
- ANT script build.xml, then call the the ANT script to build the module.
-
-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.
-**/
-package org.tianocore.build;
-
-import java.io.File;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.Location;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Ant;
-import org.apache.tools.ant.taskdefs.Property;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.build.autogen.AutoGen;
-import org.tianocore.build.exception.AutoGenException;
-import org.tianocore.build.exception.GenBuildException;
-import org.tianocore.build.exception.PcdAutogenException;
-import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;
-import org.tianocore.build.fpd.FpdParserTask;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.OutputManager;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.id.PlatformIdentification;
-import org.tianocore.build.tools.ModuleItem;
-import org.tianocore.common.definitions.ToolDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- <p>
- <code>GenBuildTask</code> is an ANT task that can be used in ANT build
- system.
-
- <p>The main function of this task is to parse module's surface area (MSA),
- then generate the corresponding <em>BaseName_build.xml</em> (the real ANT
- build script) and call this to build the module. The whole process including:
-
- <pre>
- 1. generate AutoGen.c and AutoGen.h;
- 2. build all dependent library instances;
- 3. build all source files inlcude AutoGen.c;
- 4. generate sections;
- 5. generate FFS file if it is driver module while LIB file if it is Library module.
- </pre>
-
-
- <p>
- The usage is (take module <em>HelloWorld</em> for example):
- </p>
-
- <pre>
- &lt;GenBuild
- msaFile="${PACKAGE_DIR}/Application/HelloWorld/HelloWorld.msa"
- type="cleanall" /&gt;
- </pre>
-
- <p>
- This task calls <code>AutoGen</code> to generate <em>AutoGen.c</em> and
- <em>AutoGen.h</em>.
- </p>
-
- <p>
- This task will also set properties for current module, such as PACKAGE,
- PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
- (relative to Workspace), MODULE or BASE_NAME, GUID, VERSION, MODULE_DIR,
- MODULE_RELATIVE_DIR (relative to Package), CONFIG_DIR, BIN_DIR,
- DEST_DIR_DEBUG, DEST_DIR_OUTPUT, TARGET, ARCH, TOOLCHAIN, TOOLCHAIN_FAMILY,
- SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH, all compiler command related
- properties (CC, CC_FLAGS, CC_DPATH, CC_SPATH, CC_FAMILY, CC_EXT).
- </p>
-
- @since GenBuild 1.0
-**/
-public class GenBuildTask extends Ant {
-
- ///
- /// Module surface area file.
- ///
- File msaFile;
-
- public ModuleIdentification parentId;
-
- private String type = "all";
-
- ///
- /// Module's Identification.
- ///
- private ModuleIdentification moduleId;
-
- private Vector<Property> properties = new Vector<Property>();
-
- private boolean isSingleModuleBuild = false;
-
- private SurfaceAreaQuery saq = null;
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public GenBuildTask() {
- }
-
- /**
-
- @throws BuildException
- From module build, exception from module surface area invalid.
- **/
- public void execute() throws BuildException {
- this.setTaskName("GenBuild");
- try {
- processGenBuild();
- } catch (PcdAutogenException e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (AutoGenException e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (PlatformPcdPreprocessBuildException e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (GenBuildException e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (EdkException e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- } catch (Exception e) {
- BuildException buildException = new BuildException(e.getMessage());
- buildException.setStackTrace(e.getStackTrace());
- throw buildException;
- }
- }
-
- private void processGenBuild() throws EdkException, BuildException, GenBuildException, AutoGenException, PcdAutogenException, PlatformPcdPreprocessBuildException {
- if (!FrameworkBuildTask.multithread) {
- cleanupProperties();
- }
-
- //
- // Enable all specified properties
- //
- Iterator<Property> iter = properties.iterator();
- while (iter.hasNext()) {
- Property item = iter.next();
- getProject().setProperty(item.getName(), item.getValue());
- }
-
- //
- // GenBuild should specify either msaFile or moduleGuid & packageGuid
- //
- if (msaFile == null ) {
- String moduleGuid = getProject().getProperty("MODULE_GUID");
- String moduleVersion = getProject().getProperty("MODULE_VERSION");
- String packageGuid = getProject().getProperty("PACKAGE_GUID");
- String packageVersion = getProject().getProperty("PACKAGE_VERSION");
- //
- // If one of module Guid or package Guid is not specified, report error
- //
- if (moduleGuid == null || packageGuid == null) {
- throw new BuildException("GenBuild parameter error.");
- }
-
- PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);
- GlobalData.refreshPackageIdentification(packageId);
- moduleId = new ModuleIdentification(moduleGuid, moduleVersion);
- moduleId.setPackage(packageId);
- GlobalData.refreshModuleIdentification(moduleId);
- Map<String, XmlObject> doc = GlobalData.getNativeMsa(moduleId);
- saq = new SurfaceAreaQuery(doc);
- } else {
- Map<String, XmlObject> doc = GlobalData.getNativeMsa(msaFile);
- saq = new SurfaceAreaQuery(doc);
- moduleId = saq.getMsaHeader();
- moduleId.setMsaFile(msaFile);
- }
-
- String[] producedLibraryClasses = saq.getLibraryClasses("ALWAYS_PRODUCED", null, null);
- if (producedLibraryClasses.length == 0) {
- moduleId.setLibrary(false);
- } else {
- moduleId.setLibrary(true);
- }
- moduleId.setBinary(saq.getBinaryModule());
-
- //
- // Judge whether it is single module build or not
- //
- if (isSingleModuleBuild) {
- //
- // Single Module build
- //
- prepareSingleModuleBuild();
- }
-
- //
- // If single module : get arch from pass down, otherwise intersection MSA
- // supported ARCHs and tools def
- //
- Set<String> archListSupByToolChain = new LinkedHashSet<String>();
- String[] archs = GlobalData.getToolChainInfo().getArchs();
-
- for (int i = 0; i < archs.length; i ++) {
- archListSupByToolChain.add(archs[i]);
- }
-
- Set<String> archSet = new LinkedHashSet<String>();
- String archString = getProject().getProperty("ARCH");
- if (archString != null && archString.length() > 0) {
- String[] fpdArchList = archString.split(" ");
-
- for (int i = 0; i < fpdArchList.length; i++) {
- if (archListSupByToolChain.contains(fpdArchList[i])) {
- archSet.add(fpdArchList[i]);
- }
- }
- } else {
- archSet = archListSupByToolChain;
- }
-
- String[] archList = archSet.toArray(new String[archSet.size()]);
-
- //
- // Judge if arch is all supported by current module. If not, throw Exception.
- //
- List moduleSupportedArchs = saq.getModuleSupportedArchs();
- if (moduleSupportedArchs != null) {
- for (int k = 0; k < archList.length; k++) {
- if (!moduleSupportedArchs.contains(archList[k])) {
- EdkLog.log(this, EdkLog.EDK_WARNING, "Specified architecture [" + archList[k] + "] is not supported by " + moduleId + ". The module " + moduleId + " only supports [" + moduleSupportedArchs + "] architectures.");
- archList[k] = "";
- }
- }
- }
-
- if (archList.length == 0) {
- EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + "[" + archString + "] is not supported for " + moduleId + " in this build!\n");
- }
-
- for (int k = 0; k < archList.length; k++) {
- if (archList[k] == "") {
- continue;
- }
-
- getProject().setProperty("ARCH", archList[k]);
-
- FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, archList[k]);
-
- //
- // Whether the module is built before
- //
- if ((moduleId.isLibrary() == false || isSingleModuleBuild) && GlobalData.hasFpdModuleSA(fpdModuleId) == false) {
- if (isSingleModuleBuild) {
- EdkLog.log(this, EdkLog.EDK_ERROR, "Error: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");
- throw new BuildException("No platform containing this module!");
- } else {
- EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: " + moduleId + " for " + archList[k] + " was not found in current platform FPD file!\n");
- }
- continue;
- } else if (GlobalData.isModuleBuilt(fpdModuleId)) {
- break;
- } else {
- GlobalData.registerBuiltModule(fpdModuleId);
- }
-
- //
- // For Every TOOLCHAIN, TARGET
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i ++){
- //
- // Prepare for target related common properties
- // TARGET
- //
- getProject().setProperty("TARGET", targetList[i]);
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j ++){
- //
- // check if any tool is defined for current target + toolchain + arch
- // don't do anything if no tools found
- //
- if (GlobalData.isCommandSet(targetList[i], toolchainList[j], archList[k]) == false) {
- EdkLog.log(this, EdkLog.EDK_WARNING, "Warning: No build issued. No tools found for [target=" + targetList[i] + " toolchain=" + toolchainList[j] + " arch=" + archList[k] + "]\n");
- continue;
- }
-
- //
- // Prepare for toolchain related common properties
- // TOOLCHAIN
- //
- getProject().setProperty("TOOLCHAIN", toolchainList[j]);
-
- EdkLog.log(this, "Build " + moduleId + " start >>>");
- EdkLog.log(this, "Target: " + targetList[i] + " Tagname: " + toolchainList[j] + " Arch: " + archList[k]);
- saq.push(GlobalData.getDoc(fpdModuleId));
-
- //
- // Prepare for all other common properties
- // PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
- // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
- // MODULE_DIR, MODULE_RELATIVE_DIR
- // SUBSYSTEM, ENTRYPOINT, EBC_TOOL_LIB_PATH
- //
- setModuleCommonProperties(archList[k]);
-
- //
- // OutputManage prepare for
- // BIN_DIR, DEST_DIR_DEBUG, DEST_DIR_OUTPUT, BUILD_DIR, FV_DIR
- //
- OutputManager.getInstance().update(getProject());
-
- if (type.equalsIgnoreCase("all") || type.equalsIgnoreCase("build")) {
- applyBuild(targetList[i], toolchainList[j], fpdModuleId);
- } else {
- applyNonBuildTarget(fpdModuleId);
- }
- }
- }
- }
- }
-
- /**
- This method is used to prepare Platform-related information.
-
- <p>In Single Module Build mode, platform-related information is not ready.
- The method read the system environment variable <code>ACTIVE_PLATFORM</code>
- and search in the Framework Database. Note that platform name in the Framework
- Database must be unique. </p>
-
- **/
- private void prepareSingleModuleBuild() throws EdkException {
- //
- // Find out the package which the module belongs to
- //
- PackageIdentification packageId = GlobalData.getPackageForModule(moduleId);
- GlobalData.refreshPackageIdentification(packageId);
- moduleId.setPackage(packageId);
- GlobalData.refreshModuleIdentification(moduleId);
-
- //
- // Read ACTIVE_PLATFORM's FPD file
- //
- String filename = getProject().getProperty("PLATFORM_FILE");
-
- if (filename == null){
- throw new BuildException("Please set ACTIVE_PLATFORM in the file: Tools/Conf/target.txt if you want to build a single module!");
- }
-
- PlatformIdentification platformId = GlobalData.getPlatform(filename);
-
- //
- // Read FPD file (Call FpdParserTask's method)
- //
- FpdParserTask fpdParser = new FpdParserTask();
- fpdParser.setProject(getProject());
- fpdParser.parseFpdFile(platformId.getFpdFile());
- getProject().setProperty("ARCH", fpdParser.getAllArchForModule(moduleId));
- }
-
- private void cleanupProperties() {
- Project newProject = new Project();
-
- Hashtable<String, String> passdownProperties = FrameworkBuildTask.originalProperties;
- Iterator<String> iter = passdownProperties.keySet().iterator();
- while (iter.hasNext()) {
- String item = iter.next();
- newProject.setProperty(item, passdownProperties.get(item));
- }
-
- newProject.setInputHandler(getProject().getInputHandler());
-
- Iterator listenerIter = getProject().getBuildListeners().iterator();
- while (listenerIter.hasNext()) {
- newProject.addBuildListener((BuildListener) listenerIter.next());
- }
-
- getProject().initSubProject(newProject);
-
- setProject(newProject);
- }
-
- /**
- Set Module-Related information to properties.
-
- @param arch current build ARCH
- **/
- private void setModuleCommonProperties(String arch) {
- //
- // Prepare for all other common properties
- // PACKAGE, PACKAGE_GUID, PACKAGE_VERSION, PACKAGE_DIR, PACKAGE_RELATIVE_DIR
- //
- PackageIdentification packageId = moduleId.getPackage();
- getProject().setProperty("PACKAGE", packageId.getName());
- getProject().setProperty("PACKAGE_GUID", packageId.getGuid());
- getProject().setProperty("PACKAGE_VERSION", packageId.getVersion());
- getProject().setProperty("PACKAGE_DIR", packageId.getPackageDir().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PACKAGE_RELATIVE_DIR", packageId.getPackageRelativeDir().replaceAll("(\\\\)", "/"));
-
- //
- // MODULE or BASE_NAME, GUID or FILE_GUID, VERSION, MODULE_TYPE
- // MODULE_DIR, MODULE_RELATIVE_DIR
- //
- getProject().setProperty("MODULE", moduleId.getName());
- String baseName = saq.getModuleOutputFileBasename();
- if (baseName == null) {
- getProject().setProperty("BASE_NAME", moduleId.getName());
- } else {
- getProject().setProperty("BASE_NAME", baseName);
- }
- getProject().setProperty("GUID", moduleId.getGuid());
- getProject().setProperty("FILE_GUID", moduleId.getGuid());
- getProject().setProperty("VERSION", moduleId.getVersion());
- getProject().setProperty("MODULE_TYPE", moduleId.getModuleType());
- File msaFile = moduleId.getMsaFile();
- String msaFileName = msaFile.getName();
- getProject().setProperty("MODULE_DIR", msaFile.getParent().replaceAll("(\\\\)", "/"));
- getProject().setProperty("MODULE_RELATIVE_DIR", moduleId.getModuleRelativePath().replaceAll("(\\\\)", "/")
- + File.separatorChar + msaFileName.substring(0, msaFileName.lastIndexOf('.')));
-
- //
- // SUBSYSTEM
- //
- String[][] subsystemMap = { { "BASE", "EFI_BOOT_SERVICE_DRIVER"},
- { "SEC", "EFI_BOOT_SERVICE_DRIVER" },
- { "PEI_CORE", "EFI_BOOT_SERVICE_DRIVER" },
- { "PEIM", "EFI_BOOT_SERVICE_DRIVER" },
- { "DXE_CORE", "EFI_BOOT_SERVICE_DRIVER" },
- { "DXE_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
- { "DXE_RUNTIME_DRIVER", "EFI_RUNTIME_DRIVER" },
- { "DXE_SAL_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
- { "DXE_SMM_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
- { "TOOL", "EFI_BOOT_SERVICE_DRIVER" },
- { "UEFI_DRIVER", "EFI_BOOT_SERVICE_DRIVER" },
- { "UEFI_APPLICATION", "EFI_APPLICATION" },
- { "USER_DEFINED", "EFI_BOOT_SERVICE_DRIVER"} };
-
- String subsystem = "EFI_BOOT_SERVICE_DRIVER";
- for (int i = 0; i < subsystemMap.length; i++) {
- if (moduleId.getModuleType().equalsIgnoreCase(subsystemMap[i][0])) {
- subsystem = subsystemMap[i][1];
- break ;
- }
- }
- getProject().setProperty("SUBSYSTEM", subsystem);
-
- //
- // ENTRYPOINT
- //
- if (arch.equalsIgnoreCase("EBC")) {
- getProject().setProperty("ENTRYPOINT", "EfiStart");
- } else {
- getProject().setProperty("ENTRYPOINT", "_ModuleEntryPoint");
- }
-
- getProject().setProperty("OBJECTS", "");
- }
-
- private void getCompilerFlags(String target, String toolchain, FpdModuleIdentification fpdModuleId) throws EdkException {
- String[] cmd = GlobalData.getToolChainInfo().getCommands();
- for ( int m = 0; m < cmd.length; m++) {
- //
- // Set cmd, like CC, DLINK
- //
- String[] key = new String[]{target, toolchain, fpdModuleId.getArch(), cmd[m], null};
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_PATH;
- String cmdPath = GlobalData.getCommandSetting(key, fpdModuleId);
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME;
- String cmdName = GlobalData.getCommandSetting(key, fpdModuleId);
- if (cmdName.length() == 0) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "Warning: " + cmd[m] + " hasn't been defined!");
- getProject().setProperty(cmd[m], "");
- continue;
- }
- File cmdFile = new File(cmdPath + File.separatorChar + cmdName);
- getProject().setProperty(cmd[m], cmdFile.getPath().replaceAll("(\\\\)", "/"));
-
- //
- // set CC_FLAGS
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS;
- String cmdFlags = GlobalData.getCommandSetting(key, fpdModuleId);
- if (cmdFlags != null)
- {
- getProject().setProperty(cmd[m] + "_FLAGS", cmdFlags);
- }
- else
- {
- getProject().setProperty(cmd[m] + "_FLAGS", "");
- }
-
- //
- // Set CC_EXT
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_EXT;
- String extName = GlobalData.getCommandSetting(key, fpdModuleId);
- if ( extName != null && ! extName.equalsIgnoreCase("")) {
- getProject().setProperty(cmd[m] + "_EXT", extName);
- } else {
- getProject().setProperty(cmd[m] + "_EXT", "");
- }
-
- //
- // set CC_FAMILY
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY;
- String toolChainFamily = GlobalData.getCommandSetting(key, fpdModuleId);
- if (toolChainFamily != null) {
- getProject().setProperty(cmd[m] + "_FAMILY", toolChainFamily);
- }
-
- //
- // set CC_SPATH
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_SPATH;
- String spath = GlobalData.getCommandSetting(key, fpdModuleId);
- if (spath != null) {
- getProject().setProperty(cmd[m] + "_SPATH", spath.replaceAll("(\\\\)", "/"));
- } else {
- getProject().setProperty(cmd[m] + "_SPATH", "");
- }
-
- //
- // set CC_DPATH
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_DPATH;
- String dpath = GlobalData.getCommandSetting(key, fpdModuleId);
- if (dpath != null) {
- getProject().setProperty(cmd[m] + "_DPATH", dpath.replaceAll("(\\\\)", "/"));
- } else {
- getProject().setProperty(cmd[m] + "_DPATH", "");
- }
-
- //
- // Set CC_LIBPATH
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_LIBPATH;
- String libpath = GlobalData.getCommandSetting(key, fpdModuleId);
- if (libpath != null) {
- getProject().setProperty(cmd[m] + "_LIBPATH", libpath.replaceAll("(\\\\)", "/"));
- } else {
- getProject().setProperty(cmd[m] + "_LIBPATH", "");
- }
-
- //
- // Set CC_INCLUDEPATH
- //
- key[4] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_INCLUDEPATH;
- String includepath = GlobalData.getCommandSetting(key, fpdModuleId);
- if (dpath != null) {
- getProject().setProperty(cmd[m] + "_INCLUDEPATH", includepath.replaceAll("(\\\\)", "/"));
- } else {
- getProject().setProperty(cmd[m] + "_INCLUDEPATH", "");
- }
- }
- }
-
- public void setMsaFile(File msaFile) {
- this.msaFile = msaFile;
- }
-
- /**
- Method is for ANT to initialize MSA file.
-
- @param msaFilename MSA file name
- **/
- public void setMsaFile(String msaFilename) {
- String moduleDir = getProject().getProperty("MODULE_DIR");
-
- //
- // If is Single Module Build, then use the Base Dir defined in build.xml
- //
- if (moduleDir == null) {
- moduleDir = getProject().getBaseDir().getPath();
- }
- msaFile = new File(moduleDir + File.separatorChar + msaFilename);
- }
-
- public void addConfiguredModuleItem(ModuleItem moduleItem) {
- PackageIdentification packageId = new PackageIdentification(moduleItem.getPackageGuid(), moduleItem.getPackageVersion());
- ModuleIdentification moduleId = new ModuleIdentification(moduleItem.getModuleGuid(), moduleItem.getModuleVersion());
- moduleId.setPackage(packageId);
- this.moduleId = moduleId;
- }
-
- /**
- Add a property.
-
- @param p property
- **/
- public void addProperty(Property p) {
- properties.addElement(p);
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- private void applyBuild(String buildTarget, String buildTagname, FpdModuleIdentification fpdModuleId) throws EdkException {
- //
- // Call AutoGen to generate AutoGen.c and AutoGen.h for non-binary module
- //
- if (!fpdModuleId.getModule().isBinary()) {
- AutoGen autogen = new AutoGen(getProject().getProperty("FV_DIR"), getProject().getProperty("DEST_DIR_DEBUG"), fpdModuleId.getModule(),fpdModuleId.getArch(), saq, parentId);
- autogen.genAutogen();
- }
-
- //
- // Get compiler flags
- //
- try {
- getCompilerFlags(buildTarget, buildTagname, fpdModuleId);
- }
- catch (EdkException ee) {
- throw new BuildException(ee.getMessage());
- }
-
- //
- // Prepare LIBS
- //
- ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());
- String propertyLibs = "";
- for (int i = 0; i < libinstances.length; i++) {
- propertyLibs += getProject().getProperty("BIN_DIR") + File.separatorChar + libinstances[i].getName() + ".lib" + " ";
- }
- getProject().setProperty("LIBS", propertyLibs.replaceAll("(\\\\)", "/"));
-
- //
- // Get all includepath and set to INCLUDE_PATHS
- //
- String[] includes = prepareIncludePaths(fpdModuleId);
-
- //
- // if it is CUSTOM_BUILD
- // then call the exist BaseName_build.xml directly.
- //
- String buildFilename = "";
- if ((buildFilename = GetCustomizedBuildFile(fpdModuleId.getArch())) != "") {
- EdkLog.log(this, "Call user-defined " + buildFilename);
-
- String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + buildFilename;
- antCall(antFilename, null);
-
- return ;
- }
-
- //
- // Generate ${BASE_NAME}_build.xml
- // TBD
- //
- String ffsKeyword = saq.getModuleFfsKeyword();
- ModuleBuildFileGenerator fileGenerator = new ModuleBuildFileGenerator(getProject(), ffsKeyword, fpdModuleId, includes, saq);
- buildFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
- fileGenerator.genBuildFile(buildFilename);
-
- //
- // Ant call ${BASE_NAME}_build.xml
- //
- String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, null);
- }
-
- private void applyNonBuildTarget(FpdModuleIdentification fpdModuleId){
- //
- // if it is CUSTOM_BUILD
- // then call the exist BaseName_build.xml directly.
- //
- if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {
- EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml");
-
- String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, this.type);
-
- return ;
- }
-
- String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, this.type);
- }
-
- private void applyClean(FpdModuleIdentification fpdModuleId){
- //
- // if it is CUSTOM_BUILD
- // then call the exist BaseName_build.xml directly.
- //
- if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {
- EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml");
-
- String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, "clean");
-
- return ;
- }
-
- String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, "clean");
- }
-
- private void applyCleanall(FpdModuleIdentification fpdModuleId){
- //
- // if it is CUSTOM_BUILD
- // then call the exist BaseName_build.xml directly.
- //
- if (moduleId.getModuleType().equalsIgnoreCase("USER_DEFINED")) {
- EdkLog.log(this, "Calling user-defined " + moduleId.getName() + "_build.xml");
-
- String antFilename = getProject().getProperty("MODULE_DIR") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, "cleanall");
-
- return ;
- }
-
- String antFilename = getProject().getProperty("DEST_DIR_OUTPUT") + File.separatorChar + moduleId.getName() + "_build.xml";
- antCall(antFilename, "cleanall");
- }
-
- private void antCall(String antFilename, String target) {
- Ant ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(antFilename);
- if (target != null) {
- ant.setTarget(target);
- }
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
- }
-
- public void setSingleModuleBuild(boolean isSingleModuleBuild) {
- this.isSingleModuleBuild = isSingleModuleBuild;
- }
-
- private String[] prepareIncludePaths(FpdModuleIdentification fpdModuleId) throws EdkException{
- //
- // Prepare the includes: PackageDependencies and Output debug direactory
- //
- Set<String> includes = new LinkedHashSet<String>();
- String arch = fpdModuleId.getArch();
-
- //
- // WORKSPACE
- //
- includes.add("${WORKSPACE_DIR}" + File.separatorChar);
-
- //
- // Module iteself
- //
- includes.add("${MODULE_DIR}");
- includes.add("${MODULE_DIR}" + File.separatorChar + archDir(arch));
-
- //
- // Packages in PackageDenpendencies
- //
- PackageIdentification[] packageDependencies = saq.getDependencePkg(fpdModuleId.getArch());
- for (int i = 0; i < packageDependencies.length; i++) {
- GlobalData.refreshPackageIdentification(packageDependencies[i]);
- File packageFile = packageDependencies[i].getSpdFile();
- includes.add(packageFile.getParent() + File.separatorChar + "Include");
- includes.add(packageFile.getParent() + File.separatorChar + "Include" + File.separatorChar + archDir(arch));
- }
-
- //
- // All Dependency Library Instance's PackageDependencies
- //
- ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());
- for (int i = 0; i < libinstances.length; i++) {
- saq.push(GlobalData.getDoc(libinstances[i], fpdModuleId.getArch()));
- PackageIdentification[] libraryPackageDependencies = saq.getDependencePkg(fpdModuleId.getArch());
- for (int j = 0; j < libraryPackageDependencies.length; j++) {
- GlobalData.refreshPackageIdentification(libraryPackageDependencies[j]);
- File packageFile = libraryPackageDependencies[j].getSpdFile();
- includes.add(packageFile.getParent() + File.separatorChar + "Include");
- includes.add(packageFile.getParent() + File.separatorChar + "Include" + File.separatorChar + archDir(arch));
- }
- saq.pop();
- }
-
-
- //
- // The package which the module belongs to
- // TBD
- includes.add(fpdModuleId.getModule().getPackage().getPackageDir() + File.separatorChar + "Include");
- includes.add(fpdModuleId.getModule().getPackage().getPackageDir() + File.separatorChar + "Include" + File.separatorChar + archDir(arch));
-
- //
- // Debug files output directory
- //
- includes.add("${DEST_DIR_DEBUG}");
-
- //
- // set to INCLUDE_PATHS property
- //
- Iterator<String> iter = includes.iterator();
- StringBuffer includePaths = new StringBuffer();
- while (iter.hasNext()) {
- includePaths.append(iter.next());
- includePaths.append("; ");
- }
- getProject().setProperty("INCLUDE_PATHS", getProject().replaceProperties(includePaths.toString()).replaceAll("(\\\\)", "/"));
-
- return includes.toArray(new String[includes.size()]);
- }
-
- /**
- Return the name of the directory that corresponds to the architecture.
- This is a translation from the XML Schema tag to a directory that
- corresponds to our directory name coding convention.
-
- **/
- private String archDir(String arch) {
- return arch.replaceFirst("X64", "x64")
- .replaceFirst("IPF", "Ipf")
- .replaceFirst("IA32", "Ia32")
- .replaceFirst("ARM", "Arm")
- .replaceFirst("EBC", "Ebc");
- }
-
-
- public void setExternalProperties(Vector<Property> v) {
- this.properties = v;
- }
-
- private String GetCustomizedBuildFile(String arch) {
- String[][] files = saq.getSourceFiles(arch);
- for (int i = 0; i < files.length; ++i) {
- if (files[i][1].endsWith("build.xml")) {
- return files[i][1];
- }
- }
-
- return "";
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildThread.java b/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildThread.java
deleted file mode 100644
index 738a448f3a..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/GenBuildThread.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/** @file
- This file is for single module thread definition.
-
-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.
-**/
-package org.tianocore.build;
-
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.BuildListener;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.taskdefs.Property;
-import org.tianocore.build.GenBuildTask;
-import org.tianocore.build.fpd.FpdParserForThread;
-import org.tianocore.build.global.GenBuildLogger;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- Add more comment here.
-
- @since GenBuild 1.0
-**/
-public class GenBuildThread implements Runnable {
-
- private ModuleIdentification parentModuleId = null;
-
- private ModuleIdentification moduleId = null;
-
- private Set<FpdModuleIdentification> dependencies = new LinkedHashSet<FpdModuleIdentification>();
-
- private int status = FpdParserForThread.STATUS_DEPENDENCY_NOT_READY;
-
- private Project project = null;
-
- public Object semaphore = new Object();
-
- private String arch = null;
-
- private boolean highPriority = false;
-
- private Thread thread;
-
- public GenBuildThread(ModuleIdentification moduleId, String arch) {
- this.moduleId = moduleId;
- this.arch = arch;
- thread = new Thread(FpdParserForThread.tg, this, moduleId + ":" + arch);
- }
-
- public boolean start() {
- if (highPriority) {
- thread.setPriority(Thread.MAX_PRIORITY);
- }
-
- status = FpdParserForThread.STATUS_START_RUN;
-
- thread.start();
-
- return true;
- }
-
- public void run() {
-
- FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, arch);
-
- try {
- //
- // Prepare pass down properties
- // ARCH, MODULE_GUID, MODULE_VERSION, PACKAGE_GUID, PACKAGE_VERSION, PLATFORM_FILE
- //
- Vector<Property> properties = new Vector<Property>();
- Property property = new Property();
- property.setName("ARCH");
- property.setValue(arch);
- properties.add(property);
-
- property = new Property();
- property.setName("MODULE_GUID");
- property.setValue(moduleId.getGuid());
- properties.add(property);
-
- property = new Property();
- property.setName("MODULE_VERSION");
- if (moduleId.getVersion() == null) {
- property.setValue("");
- } else {
- property.setValue(moduleId.getVersion());
- }
- properties.add(property);
-
- property = new Property();
- property.setName("PACKAGE_GUID");
- property.setValue(moduleId.getPackage().getGuid());
- properties.add(property);
-
- property = new Property();
- property.setName("PACKAGE_VERSION");
- if (moduleId.getPackage().getVersion() == null) {
- property.setValue("");
- } else {
- property.setValue(moduleId.getPackage().getVersion());
- }
- properties.add(property);
-
- //
- // Build the Module
- //
- GenBuildTask genBuildTask = new GenBuildTask();
-
- Project newProject = new Project();
-
- Hashtable passdownProperties = project.getProperties();
- Iterator iter = passdownProperties.keySet().iterator();
- while (iter.hasNext()) {
- String item = (String) iter.next();
- newProject.setProperty(item, (String) passdownProperties.get(item));
- }
-
- newProject.setInputHandler(project.getInputHandler());
-
- Iterator listenerIter = project.getBuildListeners().iterator();
- GenBuildLogger newLogger = null;
- while (listenerIter.hasNext()) {
- BuildListener item = (BuildListener)listenerIter.next();
- if (item instanceof GenBuildLogger) {
- newLogger = (GenBuildLogger)((GenBuildLogger)item).clone();
- newLogger.setId(fpdModuleId);
- newProject.addBuildListener(newLogger);
- } else {
- newProject.addBuildListener(item);
- }
- }
-
- project.initSubProject(newProject);
-
- genBuildTask.setProject(newProject);
-
- genBuildTask.setExternalProperties(properties);
-
- genBuildTask.parentId = parentModuleId;
-
- genBuildTask.perform();
- } catch (BuildException be) {
-
- EdkLog.log("GenBuild", EdkLog.EDK_ALWAYS, fpdModuleId + " build error. \n" + be.getMessage());
-
- if (FpdParserForThread.errorModule == null) {
- FpdParserForThread.errorModule = fpdModuleId;
- }
-
- synchronized (FpdParserForThread.deamonSemaphore) {
- FpdParserForThread.subCount();
- FpdParserForThread.deamonSemaphore.notifyAll();
- }
-
- return ;
- }
-
- status = FpdParserForThread.STATUS_END_RUN;
-
- EdkLog.log("GenBuild", EdkLog.EDK_ALWAYS, fpdModuleId + " build finished. ");
-
- //
- //
- //
- synchronized (FpdParserForThread.deamonSemaphore) {
- FpdParserForThread.subCount();
- FpdParserForThread.deamonSemaphore.notifyAll();
- }
- }
-
- public void setArch(String arch) {
- this.arch = arch;
- }
-
- public void setDependencies(Set<FpdModuleIdentification> dependencies) {
- this.dependencies = dependencies;
- }
-
- public void setModuleId(ModuleIdentification moduleId) {
- this.moduleId = moduleId;
- }
-
- public void setParentModuleId(ModuleIdentification parentModuleId) {
- this.parentModuleId = parentModuleId;
- }
-
- public void setProject(Project project) {
- this.project = project;
- }
-
- public void setHighPriority(boolean highPriority) {
- this.highPriority = highPriority;
- }
-
-
- public Set<FpdModuleIdentification> getDependencies() {
- return dependencies;
- }
-
- public ModuleIdentification getModuleId() {
- return moduleId;
- }
-
- public int getStatus() {
- //
- // Add code here to judge dependency
- //
- if (status == FpdParserForThread.STATUS_DEPENDENCY_NOT_READY) {
- Iterator<FpdModuleIdentification> iter = dependencies.iterator();
- boolean flag = true;
- while (iter.hasNext()) {
- FpdModuleIdentification item = iter.next();
- if (FpdParserForThread.allThreads.get(item).getStatus() == 1) {
- flag = false;
- break ;
- }
- }
- if (flag) {
- status = FpdParserForThread.STATUS_DEPENDENCY_READY;
- }
- }
- return status;
- }
-
- public void setStatus(int status) {
- this.status = status;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java b/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
deleted file mode 100644
index bbb51cd93f..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/ModuleBuildFileGenerator.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/** @file
-
- 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.
- **/
-package org.tianocore.build;
-
-import java.io.File;
-import java.util.LinkedHashMap;
-import java.util.Map;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.OutputStreamWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.tianocore.build.exception.GenBuildException;
-import org.tianocore.build.fpd.FpdParserTask;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.common.exception.EdkException;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-public class ModuleBuildFileGenerator {
-
- ///
- /// Pass: TARGET, TOOLCHAIN, ARCH
- /// PACKAGE, PACKAGE_GUID, PACKAGE_VERSION
- ///
- String[] inheritProperties = {"ARCH", "MODULE_GUID", "MODULE_VERSION", "PACKAGE_GUID", "PACKAGE_VERSION"};
-
- ///
- /// The information at the header of <em>build.xml</em>.
- ///
- private String info = "DO NOT EDIT \n"
- + "This file is auto-generated by the build utility\n"
- + "\n"
- + "Abstract:\n"
- + "Auto-generated ANT build file for build EFI Modules and Platforms\n";
-
- private FpdModuleIdentification fpdModuleId;
-
- private Project project;
-
- private String ffsKeyword;
-
- private String[] includes;
-
- private SurfaceAreaQuery saq = null;
-
- public ModuleBuildFileGenerator(Project project, String ffsKeyword, FpdModuleIdentification fpdModuleId, String[] includes, SurfaceAreaQuery saq) {
- this.project = project;
- this.fpdModuleId = fpdModuleId;
- this.ffsKeyword = ffsKeyword;
- this.includes = includes;
- this.saq = saq;
- }
-
- /**
- The whole BaseName_build.xml is composed of seven part.
- <ul>
- <li> ANT properties; </li>
- <li> Dependent module (dependent library instances in most case); </li>
- <li> Source files; </li>
- <li> Sections if module is not library; </li>
- <li> Output (different for library module and driver module); </li>
- <li> Clean; </li>
- <li> Clean all. </li>
- </ul>
-
- @throws BuildException
- Error throws during BaseName_build.xml generating.
- **/
- public void genBuildFile(String buildFilename) throws GenBuildException, EdkException {
- FfsProcess fp = new FfsProcess();
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- try {
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- Document document = dombuilder.newDocument();
- Comment rootComment = document.createComment(info);
-
- //
- // create root element and its attributes
- //
- Element root = document.createElement("project");
- root.setAttribute("name", fpdModuleId.getModule().getName());
- root.setAttribute("default", "all");
- root.setAttribute("basedir", ".");
-
- //
- // element for External ANT tasks
- //
- root.appendChild(document.createComment("Apply external ANT tasks"));
- Element ele = document.createElement("taskdef");
- ele.setAttribute("resource", "frameworktasks.tasks");
- root.appendChild(ele);
- ele = document.createElement("taskdef");
- ele.setAttribute("resource", "cpptasks.tasks");
- root.appendChild(ele);
- ele = document.createElement("typedef");
- ele.setAttribute("resource", "cpptasks.types");
- root.appendChild(ele);
- ele = document.createElement("taskdef");
- ele.setAttribute("resource", "net/sf/antcontrib/antlib.xml");
- root.appendChild(ele);
-
- //
- // Generate the default target,
- // which depends on init, sections and output target
- //
- root.appendChild(document.createComment("Default target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "all");
- ele.setAttribute("depends", "libraries, sourcefiles, sections, output");
- root.appendChild(ele);
-
- //
- // compile all source files
- //
- root.appendChild(document.createComment("Compile all dependency Library instances."));
- ele = document.createElement("target");
- ele.setAttribute("name", "libraries");
-
- //
- // Parse all sourfiles but files specified in sections
- //
- if (!FrameworkBuildTask.multithread) {
- applyLibraryInstance(document, ele);
- }
- root.appendChild(ele);
-
- //
- // compile all source files
- //
- root.appendChild(document.createComment("sourcefiles target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "sourcefiles");
-
- //
- // Parse all sourfiles but files specified in sections
- //
- applyCompileElement(document, ele);
- root.appendChild(ele);
-
- //
- // generate the init target
- // main purpose is create all nessary pathes
- // generate the sections target
- //
- root.appendChild(document.createComment("sections target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "sections");
- applySectionsElement(document, ele, fp);
- root.appendChild(ele);
-
- //
- // generate the output target
- //
- root.appendChild(document.createComment("output target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "output");
- applyOutputElement(document, ele, fp);
- root.appendChild(ele);
-
-
- //
- // generate the clean target
- //
- root.appendChild(document.createComment("clean target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "clean");
- applyCleanElement(document, ele);
- root.appendChild(ele);
-
- //
- // generate the Clean All target
- //
- root.appendChild(document.createComment("Clean All target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "cleanall");
- applyDeepcleanElement(document, ele);
- root.appendChild(ele);
-
- //
- // add the root element to the document
- //
- document.appendChild(rootComment);
- document.appendChild(root);
- //
- // Prepare the DOM document for writing
- //
- Source source = new DOMSource(document);
-
- //
- // Prepare the output file
- //
- File file = new File(buildFilename);
-
- //
- // generate all directory path
- //
- (new File(file.getParent())).mkdirs();
- FileOutputStream outputStream = new FileOutputStream(file);
- Result result = new StreamResult(new OutputStreamWriter(outputStream));
-
- //
- // Write the DOM document to the file
- //
- Transformer xformer = TransformerFactory.newInstance().newTransformer();
- xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- xformer.setOutputProperty(OutputKeys.INDENT, "yes");
- xformer.transform(source, result);
- } catch (ParserConfigurationException ex) {
- GenBuildException e = new GenBuildException("Generating the module [" + fpdModuleId.getModule().getName() + "] build.xml file failed!.\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- } catch (FileNotFoundException ex) {
- GenBuildException e = new GenBuildException("Generating the module [" + fpdModuleId.getModule().getName() + "] build.xml file failed!.\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- } catch (TransformerConfigurationException ex) {
- GenBuildException e = new GenBuildException("Generating the module [" + fpdModuleId.getModule().getName() + "] build.xml file failed!.\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- } catch (TransformerException ex) {
- GenBuildException e = new GenBuildException("Generating the module [" + fpdModuleId.getModule().getName() + "] build.xml file failed!.\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- }
- }
-
- /**
- Generate the clean elements for BaseName_build.xml.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applyCleanElement(Document document, Node root) {
- //
- // <delete includeemptydirs="true">
- // <fileset dir="${DEST_DIR_OUTPUT}" includes="" excludes="" />
- // </delete>
- //
- Element deleteEle = document.createElement("delete");
- deleteEle.setAttribute("includeemptydirs", "true");
- Element filesetEle = document.createElement("fileset");
- filesetEle.setAttribute("dir", "${DEST_DIR_OUTPUT}");
- filesetEle.setAttribute("includes", "**/*");
- filesetEle.setAttribute("excludes", "*.xml");
- deleteEle.appendChild(filesetEle);
- root.appendChild(deleteEle);
- }
-
- /**
- Generate the cleanall elements for BaseName_build.xml.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applyDeepcleanElement(Document document, Node root) {
- //
- // <delete includeemptydirs="true">
- // <fileset dir="${DEST_DIR_OUTPUT}" includes="" excludes="" />
- // </delete>
- //
- Element deleteEle = document.createElement("delete");
- deleteEle.setAttribute("includeemptydirs", "true");
- Element filesetEle = document.createElement("fileset");
- filesetEle.setAttribute("dir", "${DEST_DIR_OUTPUT}");
- filesetEle.setAttribute("includes", "**/*");
- filesetEle.setAttribute("excludes", "*.xml");
- deleteEle.appendChild(filesetEle);
- root.appendChild(deleteEle);
-
- //
- // <delete includeemptydirs="true">
- // <fileset dir="${DEST_DIR_DEBUG}" includes="" />
- // </delete>
- //
- deleteEle = document.createElement("delete");
- deleteEle.setAttribute("includeemptydirs", "true");
- filesetEle = document.createElement("fileset");
- filesetEle.setAttribute("dir", "${DEST_DIR_DEBUG}");
- filesetEle.setAttribute("includes", "**/*");
- deleteEle.appendChild(filesetEle);
- root.appendChild(deleteEle);
- }
-
- /**
- Generate the dependent library instances elements for BaseName_build.xml.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applyLibraryInstance(Document document, Node root) throws EdkException {
- ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());
- for (int i = 0; i < libinstances.length; i++) {
- //
- // Put package file path to module identification
- //
- PackageIdentification packageId = libinstances[i].getPackage();
-
- //
- // Generate ANT script to build library instances
- //
- Element ele = document.createElement("GenBuild");
- ele.setAttribute("type", "build");
-
- //
- // Prepare pass down information
- //
- Map<String, String> passDownMap = new LinkedHashMap<String, String>();
- for (int j = 0; j < inheritProperties.length; j ++){
- passDownMap.put(inheritProperties[j], "${" + inheritProperties[j] + "}");
- }
-
- passDownMap.put("MODULE_GUID", libinstances[i].getGuid());
- passDownMap.put("MODULE_VERSION", libinstances[i].getVersion());
-
- passDownMap.put("PACKAGE_GUID", packageId.getGuid());
- passDownMap.put("PACKAGE_VERSION", packageId.getVersion());
-
- for (int j = 0; j < inheritProperties.length; j ++){
- Element property = document.createElement("property");
- property.setAttribute("name", inheritProperties[j]);
- property.setAttribute("value", passDownMap.get(inheritProperties[j]));
- ele.appendChild(property);
- }
-
- root.appendChild(ele);
- }
- }
-
- /**
- Generate the build source files elements for BaseName_build.xml.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applyCompileElement(Document document, Node root) {
- //
- // sourceFiles[][0] is FileType,
- // [][1] is File name relative to Module_Dir,
- // [][2] is ToolChainFamily
- //
- String[][] sourceFiles = saq.getSourceFiles(fpdModuleId.getArch());
-
- FileProcess fileProcess = new FileProcess();
- fileProcess.init(project, includes, document);
-
- boolean isBinaryModule = fpdModuleId.getModule().isBinary();
- boolean isLibraryModule = fpdModuleId.getModule().isLibrary();
-
- if (!isBinaryModule) {
- //
- // Initialize some properties by user
- //
- Element initEle = document.createElement("Build_Init");
- Element initIncEle = document.createElement("EXTRA.INC");
- for (int i = 0; i < includes.length; i++) {
- Element includeEle = document.createElement("includepath");
- includeEle.setAttribute("path", includes[i]);
- initIncEle.appendChild(includeEle);
- }
- initEle.appendChild(initIncEle);
- root.appendChild(initEle);
- }
-
- String moduleDir = project.getProperty("MODULE_DIR");
- //
- // Parse all Unicode files
- //
- for (int i = 0; i < sourceFiles.length; i++) {
- //
- // Go through all source files. Add MODULE_DIR to preffix
- //
- File sourceFile = new File(moduleDir + File.separatorChar + sourceFiles[i][1]);
- sourceFiles[i][1] = sourceFile.getPath();
- String filetype = sourceFiles[i][0];
- if (filetype != null) {
- fileProcess.parseFile(sourceFiles[i][1], filetype, sourceFiles[i][2], root, true);
- } else {
- fileProcess.parseFile(sourceFiles[i][1], sourceFiles[i][2], root, true);
- }
- }
-
- //
- // If exist Unicode file
- //
- if (fileProcess.isUnicodeExist()) {
- Element ele = document.createElement("Build_Unicode_Database");
- ele.setAttribute("FILEPATH", ".");
- ele.setAttribute("FILENAME", "${BASE_NAME}");
- Element includesEle = document.createElement("EXTRA.INC");
- for (int i = 0; i < includes.length; i++) {
- Element includeEle = document.createElement("includepath");
- includeEle.setAttribute("path", includes[i]);
- includesEle.appendChild(includeEle);
- }
- ele.appendChild(includesEle);
- root.appendChild(ele);
- }
-
- //
- // Don't build AutoGen.c for library and binary module
- //
- if (!isLibraryModule && !isBinaryModule) {
- fileProcess.parseFile(project.getProperty("DEST_DIR_DEBUG") + File.separatorChar + "AutoGen.c", null, root, false);
- }
-
- //
- // Parse all source files but Unicode files
- //
- for (int i = 0; i < sourceFiles.length; i++) {
- String filetype = sourceFiles[i][0];
- if (filetype != null) {
- fileProcess.parseFile(sourceFiles[i][1], filetype, sourceFiles[i][2], root, false);
- } else {
- fileProcess.parseFile(sourceFiles[i][1], sourceFiles[i][2], root, false);
- }
- }
-
- //
- // Initialize SOURCE_FILES for dependcy check use
- //
- String str = "";
- for (int i = 0; i < sourceFiles.length; i++) {
- str += " " + sourceFiles[i][1];
- }
- project.setProperty("SOURCE_FILES", str.replaceAll("(\\\\)", "/"));
- }
-
- /**
- Generate the section elements for BaseName_build.xml. Library module will
- skip this process.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applySectionsElement(Document document, Node root, FfsProcess fp) {
- if (fpdModuleId.getModule().isLibrary()) {
- return ;
- }
- if (fp.initSections(ffsKeyword, project, fpdModuleId)) {
- String targetFilename = fpdModuleId.getModule().getGuid() + "-" + "${BASE_NAME}" + FpdParserTask.getSuffix(fpdModuleId.getModule().getModuleType());
- String[] list = fp.getGenSectionElements(document, "${BASE_NAME}", fpdModuleId.getModule().getGuid(), targetFilename);
-
- for (int i = 0; i < list.length; i++) {
- String sectiontype = list[i];
- if (sectiontype.equalsIgnoreCase("EFI_SECTION_RAW") && project.getProperty("MODULE_TYPE").equalsIgnoreCase("SEC")) {
- sectiontype += "_SEC";
- }
- if ((sectiontype.equalsIgnoreCase("EFI_SECTION_PE32") ||
- sectiontype.equalsIgnoreCase("EFI_SECTION_TE"))
- && !fpdModuleId.getModule().isLibrary()
- && !fpdModuleId.getModule().isBinary()) {
- //
- // Generate code to generate efi file
- //
- Element ele = document.createElement("GenEfi");
- ele.setAttribute("FILEPATH", ".");
- ele.setAttribute("FILENAME", "${BASE_NAME}");
- root.appendChild(ele);
- }
- Element ele = document.createElement(sectiontype);
- ele.setAttribute("FILEPATH", ".");
- ele.setAttribute("FILENAME", "${BASE_NAME}");
- root.appendChild(ele);
- }
- }
- }
-
- /**
- Generate the output elements for BaseName_build.xml. If module is library,
- call the <em>LIB</em> command, else call the <em>GenFfs</em> command.
-
- @param document current BaseName_build.xml XML document
- @param root Root element for current
- **/
- private void applyOutputElement(Document document, Node root, FfsProcess fp) {
- if (fpdModuleId.getModule().isLibrary()) {
- //
- // call Lib command
- //
- Element cc = document.createElement("Build_Library");
- cc.setAttribute("FILENAME", fpdModuleId.getModule().getName());
- root.appendChild(cc);
- }
- //
- // if it is a module but library
- //
- else {
- if (fp.getFfsNode() != null) {
- root.appendChild(fp.getFfsNode());
- }
- }
- }
-
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
deleted file mode 100644
index ad69f07c13..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutoGen.java
+++ /dev/null
@@ -1,2303 +0,0 @@
-/** @file
- AutoGen class.
-
- This class is to generate Autogen.h and Autogen.c according to module surface area
- or library surface area.
-
- 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.
-
- **/
-
-package org.tianocore.build.autogen;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.build.exception.AutoGenException;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.pcd.action.PCDAutoGenAction;
-import org.tianocore.common.definitions.ToolDefinitions;
-import org.tianocore.common.definitions.EdkDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-
-/**
- This class is to generate Autogen.h and Autogen.c according to module surface
- area or library surface area.
-**/
-public class AutoGen {
- ///
- /// The output path of Autogen.h and Autogen.c
- ///
- private String outputPath;
-
- ///
- /// The name of FV directory
- ///
- private String fvDir;
-
- ///
- /// The base name of module or library.
- ///
- private ModuleIdentification moduleId;
-
- ///
- /// The build architecture
- ///
- private String arch;
-
- ///
- /// PcdAutogen instance which is used to manage how to generate the PCD
- /// information.
- ///
- private PCDAutoGenAction myPcdAutogen;
-
- ///
- /// the one of type : NOT_PCD_DRIVER, PEI_PCD_DRIVER, DXE_PCD_DRIVER
- ///
- private CommonDefinition.PCD_DRIVER_TYPE pcdDriverType;
-
- ///
- /// The Guid CName list which recoreded in module or library surface area
- /// and it's dependence on library instance surface area.
- ///
- private Set<String> mGuidCNameList = new HashSet<String>();
-
- ///
- /// The dependence package list which recoreded in module or library surface
- /// area and it's dependence on library instance surface area.
- ///
- private List<PackageIdentification> mDepPkgList = new LinkedList<PackageIdentification>();
-
- ///
- /// For non library module, add its library instance's construct and destructor to
- /// list. String[0] recode LibConstructor name, String[1] recode Lib instance
- /// module type.
- ///
- private List<String[]> libConstructList = new ArrayList<String[]>();
- private List<String[]> libDestructList = new ArrayList<String[]>();
-
- ///
- /// List to store SetVirtalAddressMapCallBack, ExitBootServiceCallBack
- ///
- private List<String> setVirtalAddList = new ArrayList<String>();
- private List<String> exitBootServiceList = new ArrayList<String>();
-
- private StringBuffer functionDeclarations = new StringBuffer(10240);
- private StringBuffer globalDeclarations = new StringBuffer(10240);
-
- //
- // flag of PcdComponentNameDisable, PcdDriverDiagnosticDisable
- //
- private boolean componentNamePcd = false;
- private boolean driverDiagnostPcd = false;
-
- //
- // Instance of SurfaceAreaQuery
- //
- private SurfaceAreaQuery saq = null;
-
- private ModuleIdentification parentId = null;
-
- /**
- Construct function
-
- This function mainly initialize some member variable.
-
- @param fvDir
- Absolute path of FV directory.
- @param outputPath
- Output path of AutoGen file.
- @param moduleId
- Module identification.
- @param arch
- Target architecture.
- **/
- public AutoGen(String fvDir, String outputPath, ModuleIdentification moduleId, String arch, SurfaceAreaQuery saq, ModuleIdentification parentId) {
- this.outputPath = outputPath;
- this.moduleId = moduleId;
- this.arch = arch;
- this.fvDir = fvDir;
- this.saq = saq;
- this.parentId = parentId;
- }
-
- /**
- saveFile function
-
- This function save the content in stringBuffer to file.
-
- @param fileName
- The name of file.
- @param fileBuffer
- The content of AutoGen file in buffer.
- @return boolean
- "true" successful
- "false" failed
- **/
- private boolean saveFile(String fileName, StringBuffer fileBuffer) {
-
- File autoGenH = new File(fileName);
-
- //
- // if the file exists, compare their content
- //
- if (autoGenH.exists()) {
- char[] oldFileBuffer = new char[(int) autoGenH.length()];
- try {
- FileReader fIn = new FileReader(autoGenH);
- fIn.read(oldFileBuffer, 0, (int) autoGenH.length());
- fIn.close();
- } catch (IOException e) {
- EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName()
- + "'s "
- + fileName
- + " is exist, but can't be open!!");
- return false;
- }
-
- //
- // if we got the same file, don't re-generate it to prevent
- // sources depending on it from re-building
- //
- if (fileBuffer.toString().compareTo(new String(oldFileBuffer)) == 0) {
- return true;
- }
- }
-
- try {
- FileWriter fOut = new FileWriter(autoGenH);
- fOut.write(fileBuffer.toString());
- fOut.flush();
- fOut.close();
- } catch (IOException e) {
- EdkLog.log(EdkLog.EDK_INFO, this.moduleId.getName()
- + "'s "
- + fileName
- + " can't be create!!");
- return false;
- }
- return true;
- }
-
- /**
- genAutogen function
-
- This function call libGenAutoGen or moduleGenAutogen function, which
- dependence on generate library autogen or module autogen.
-
- @throws BuildException
- Failed to creat AutoGen.c & AutoGen.h.
- **/
- public void genAutogen() throws EdkException {
- //
- // If outputPath do not exist, create it.
- //
- File path = new File(outputPath);
- path.mkdirs();
-
- //
- // Check current is library or not, then call the corresponding
- // function.
- //
- if (this.moduleId.isLibrary()) {
- libGenAutogen();
- } else {
- moduleGenAutogen();
- }
- }
-
- /**
- moduleGenAutogen function
-
- This function generates AutoGen.c & AutoGen.h for module.
-
- @throws BuildException
- Faile to create module AutoGen.c & AutoGen.h.
- **/
- void moduleGenAutogen() throws EdkException {
- setPcdComponentName();
- setPcdDriverDiagnostic();
- collectLibInstanceInfo();
- moduleGenAutogenC();
- moduleGenAutogenH();
- }
-
- /**
- libGenAutogen function
-
- This function generates AutoGen.c & AutoGen.h for library.
-
- @throws BuildException
- Faile to create library AutoGen.c & AutoGen.h
- **/
- void libGenAutogen() throws EdkException {
- libGenAutogenC();
- libGenAutogenH();
- }
-
- /**
- moduleGenAutogenH
-
- This function generates AutoGen.h for module.
-
- @throws BuildException
- Failed to generate AutoGen.h.
- **/
- void moduleGenAutogenH() throws EdkException {
-
- Set<String> libClassIncludeH;
- String moduleType;
- // List<String> headerFileList;
- List<String> headerFileList;
- Iterator item;
- StringBuffer fileBuffer = new StringBuffer(8192);
-
- //
- // Write Autogen.h header notation
- //
- fileBuffer.append(CommonDefinition.AUTOGENHNOTATION);
-
- //
- // Add #ifndef ${BaseName}_AUTOGENH
- // #def ${BseeName}_AUTOGENH
- //
- fileBuffer.append(CommonDefinition.IFNDEF
- + CommonDefinition.AUTOGENH
- + this.moduleId.getGuid().replaceAll("-", "_")
- + ToolDefinitions.LINE_SEPARATOR);
- fileBuffer.append(CommonDefinition.DEFINE
- + CommonDefinition.AUTOGENH
- + this.moduleId.getGuid().replaceAll("-", "_")
- + ToolDefinitions.LINE_SEPARATOR
- + ToolDefinitions.LINE_SEPARATOR);
-
- //
- // Write the specification version and release version at the begine
- // of autogen.h file.
- // Note: the specification version and release version should
- // be got from module surface area instead of hard code by it's
- // moduleType.
- //
- moduleType = saq.getModuleType();
-
- //
- // Add "extern int __make_me_compile_correctly;" at begin of
- // AutoGen.h.
- //
- fileBuffer.append(CommonDefinition.AUTOGENHBEGIN);
-
- //
- // Put EFI_SPECIFICATION_VERSION, and EDK_RELEASE_VERSION.
- //
- String[] specList = saq.getExternSpecificaiton();
- for (int i = 0; i < specList.length; i++) {
- fileBuffer.append(CommonDefinition.DEFINE + specList[i]
- + "\r\n");
- }
- //
- // Write consumed package's mdouleInfo related .h file to autogen.h
- //
- // PackageIdentification[] consumedPkgIdList = SurfaceAreaQuery
- // .getDependencePkg(this.arch);
- PackageIdentification[] consumedPkgIdList = saq.getDependencePkg(this.arch);
- if (consumedPkgIdList != null) {
- headerFileList = depPkgToAutogenH(consumedPkgIdList, moduleType);
- item = headerFileList.iterator();
- while (item.hasNext()) {
- fileBuffer.append(item.next().toString());
- }
- }
-
- //
- // Write library class's related *.h file to autogen.h.
- //
- List<String> libClasses = new ArrayList<String>(100);
- String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch, null);
- for (int i = 0; i < libClassList.length; ++i) {
- libClasses.add(libClassList[i]);
- }
-
- libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch, null);
- for (int i = 0; i < libClassList.length; ++i) {
- libClasses.add(libClassList[i]);
- }
- //
- // Add AutoGen used library class
- //
- int moduleTypeId = CommonDefinition.getModuleType(moduleType);
- if (!libClasses.contains("DebugLib") && moduleTypeId != CommonDefinition.ModuleTypeUnknown
- && moduleTypeId != CommonDefinition.ModuleTypeBase) {
- libClasses.add("DebugLib");
- }
- switch (moduleTypeId) {
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- if (!libClasses.contains("UefiBootServicesTableLib")) {
- libClasses.add("UefiBootServicesTableLib");
- }
- break;
- }
- LibraryClassToAutogenH(fileBuffer, libClasses.toArray(new String[libClasses.size()]));
- fileBuffer.append("\r\n");
-
- //
- // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
- // {DEST_DIR_DRBUG}/FlashMap.h
- //
- if (saq.isHaveTianoR8FlashMap()) {
- fileBuffer.append(CommonDefinition.INCLUDE);
- fileBuffer.append(" <");
- fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");
- copyFlashMapHToDebugDir();
- }
-
- // Write PCD autogen information to AutoGen.h.
- //
- if (this.myPcdAutogen != null) {
- fileBuffer.append("\r\n");
- fileBuffer.append(this.myPcdAutogen.getHAutoGenString());
- }
-
- fileBuffer.append(globalDeclarations);
- fileBuffer.append(functionDeclarations);
- //
- // Append the #endif at AutoGen.h
- //
- fileBuffer.append("#endif\r\n");
-
- //
- // Save string buffer content in AutoGen.h.
- //
- if (!saveFile(outputPath + File.separatorChar + "AutoGen.h", fileBuffer)) {
- throw new AutoGenException("Failed to generate AutoGen.h !!!");
- }
- }
-
- /**
- moduleGenAutogenC
-
- This function generates AutoGen.c for module.
-
- @throws BuildException
- Failed to generate AutoGen.c.
- **/
- void moduleGenAutogenC() throws EdkException {
-
- StringBuffer fileBuffer = new StringBuffer(8192);
- //
- // Write Autogen.c header notation
- //
- fileBuffer.append(CommonDefinition.AUTOGENCNOTATION);
-
- //
- // Get the native MSA file infomation. Since before call autogen,
- // the MSA native <Externs> information were overrided. So before
- // process <Externs> it should be set the DOC as the Native MSA info.
- //
- Map<String, XmlObject> doc = GlobalData.getNativeMsa(this.moduleId);
- saq.push(doc);
- //
- // Write <Extern>
- // DriverBinding/ComponentName/DriverConfiguration/DriverDialog
- // to AutoGen.c
- //
- if (!moduleId.getModuleType().equalsIgnoreCase("UEFI_APPLICATION")) {
- ExternsDriverBindingToAutoGenC(fileBuffer);
- }
-
- //
- // Write DriverExitBootServicesEvent/DriverSetVirtualAddressMapEvent
- // to Autogen.c
- //
- ExternCallBackToAutoGenC(fileBuffer);
-
- //
- // Write EntryPoint to autgoGen.c
- //
- String[] entryPointList = saq.getModuleEntryPointArray();
- String[] unloadImageList = saq.getModuleUnloadImageArray();
- EntryPointToAutoGen(CommonDefinition.remDupString(entryPointList),
- CommonDefinition.remDupString(unloadImageList),
- fileBuffer);
-
- pcdDriverType = saq.getPcdDriverType();
-
- //
- // Restore the DOC which include the FPD module info.
- //
- saq.pop();
-
- //
- // Write Guid to autogen.c
- //
- String guid = CommonDefinition.formatGuidName(saq.getModuleGuid());
- if (this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- globalDeclarations.append("extern GUID gEfiCallerIdGuid;\r\n");
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED GUID gEfiCallerIdGuid = {");
- } else if (!this.moduleId.getModuleType().equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_USER_DEFINED)) {
- globalDeclarations.append("extern EFI_GUID gEfiCallerIdGuid;\r\n");
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID gEfiCallerIdGuid = {");
- }
-
- if (guid == null) {
- throw new AutoGenException("Guid value must set!\n");
- }
-
- //
- // Formate Guid as ANSI c form.Example:
- // {0xd2b2b828, 0x826, 0x48a7,{0xb3, 0xdf, 0x98, 0x3c, 0x0, 0x60, 0x24,
- // 0xf0}}
- //
-
- fileBuffer.append(guid);
- fileBuffer.append("};\r\n");
-
- //
- // Generate library instance consumed protocol, guid, ppi, pcd list.
- // Save those to this.protocolList, this.ppiList, this.pcdList,
- // this.guidList. Write Consumed library constructor and desconstuct to
- // autogen.c
- //
- LibInstanceToAutogenC(fileBuffer);
-
- //
- // Get module dependent Package identification.
- //
- PackageIdentification[] packages = saq.getDependencePkg(this.arch);
- for (int i = 0; i < packages.length; i++) {
- if (!this.mDepPkgList.contains(packages[i])) {
- this.mDepPkgList.add(packages[i]);
- }
-
- }
-
- //
- // Write consumed ppi, guid, protocol, etc to autogen.c
- //
- CNameToAutogenC(fileBuffer);
-
- //
- // Call pcd autogen.
- //
- this.myPcdAutogen = new PCDAutoGenAction(moduleId,
- arch,
- false,
- null,
- pcdDriverType,
- parentId);
-
- this.myPcdAutogen.execute();
- if (this.myPcdAutogen != null) {
- fileBuffer.append("\r\n");
- fileBuffer.append(this.myPcdAutogen.getCAutoGenString());
- }
-
- if (!saveFile(outputPath + File.separatorChar + "AutoGen.c", fileBuffer)) {
- throw new AutoGenException("Failed to generate AutoGen.c !!!");
- }
-
- }
-
- /**
- libGenAutogenH
-
- This function generates AutoGen.h for library.
-
- @throws BuildException
- Failed to generate AutoGen.c.
- **/
- void libGenAutogenH() throws EdkException {
-
- Set<String> libClassIncludeH;
- String moduleType;
- List<String> headerFileList;
- Iterator item;
- StringBuffer fileBuffer = new StringBuffer(10240);
-
- //
- // Write Autogen.h header notation
- //
- fileBuffer.append(CommonDefinition.AUTOGENHNOTATION);
-
- //
- // Add #ifndef ${BaseName}_AUTOGENH
- // #def ${BseeName}_AUTOGENH
- //
- fileBuffer.append(CommonDefinition.IFNDEF
- + CommonDefinition.AUTOGENH
- + this.moduleId.getGuid().replaceAll("-", "_")
- + ToolDefinitions.LINE_SEPARATOR);
- fileBuffer.append(CommonDefinition.DEFINE
- + CommonDefinition.AUTOGENH
- + this.moduleId.getGuid().replaceAll("-", "_")
- + ToolDefinitions.LINE_SEPARATOR
- + ToolDefinitions.LINE_SEPARATOR);
-
- //
- // Write EFI_SPECIFICATION_VERSION and EDK_RELEASE_VERSION
- // to autogen.h file.
- // Note: the specification version and release version should
- // be get from module surface area instead of hard code.
- //
- fileBuffer.append(CommonDefinition.AUTOGENHBEGIN);
- String[] specList = saq.getExternSpecificaiton();
- for (int i = 0; i < specList.length; i++) {
- fileBuffer.append(CommonDefinition.DEFINE + specList[i] + "\r\n");
- }
- // fileBuffer.append(CommonDefinition.autoGenHLine1);
- // fileBuffer.append(CommonDefinition.autoGenHLine2);
-
- //
- // Write consumed package's mdouleInfo related *.h file to autogen.h.
- //
- moduleType = saq.getModuleType();
- PackageIdentification[] cosumedPkglist = saq.getDependencePkg(this.arch);
- headerFileList = depPkgToAutogenH(cosumedPkglist, moduleType);
- item = headerFileList.iterator();
- while (item.hasNext()) {
- fileBuffer.append(item.next().toString());
- }
- //
- // Write library class's related *.h file to autogen.h
- //
- List<String> libClasses = new ArrayList<String>(100);
- String[] libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, this.arch, null);
- for (int i = 0; i < libClassList.length; ++i) {
- libClasses.add(libClassList[i]);
- }
-
- libClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, this.arch, null);
- for (int i = 0; i < libClassList.length; ++i) {
- libClasses.add(libClassList[i]);
- }
- //
- // Add AutoGen used library class
- //
- int moduleTypeId = CommonDefinition.getModuleType(moduleType);
- if (!libClasses.contains("DebugLib") && moduleTypeId != CommonDefinition.ModuleTypeUnknown
- && moduleTypeId != CommonDefinition.ModuleTypeBase) {
- libClasses.add("DebugLib");
- }
- switch (moduleTypeId) {
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- if (!libClasses.contains("UefiBootServicesTableLib")) {
- libClasses.add("UefiBootServicesTableLib");
- }
- break;
- }
- LibraryClassToAutogenH(fileBuffer, libClasses.toArray(new String[libClasses.size()]));
- fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);
-
- //
- // If is TianoR8FlashMap, copy {Fv_DIR}/FlashMap.h to
- // {DEST_DIR_DRBUG}/FlashMap.h
- //
- if (saq.isHaveTianoR8FlashMap()) {
- fileBuffer.append(CommonDefinition.INCLUDE);
- fileBuffer.append(" <");
- fileBuffer.append(CommonDefinition.TIANOR8PLASHMAPH + ">\r\n");
- copyFlashMapHToDebugDir();
- }
-
- //
- // Write PCD information to library AutoGen.h.
- //
- if (this.myPcdAutogen != null) {
- fileBuffer.append("\r\n");
- fileBuffer.append(this.myPcdAutogen.getHAutoGenString());
- }
- //
- // generate function prototype for constructor and destructor
- //
- LibConstructorToAutogenH(moduleType);
- LibDestructorToAutogenH(moduleType);
- ExternCallBackToAutoGenH(moduleType);
- fileBuffer.append(functionDeclarations);
- //
- // Append the #endif at AutoGen.h
- //
- fileBuffer.append("#endif\r\n");
- //
- // Save content of string buffer to AutoGen.h file.
- //
- if (!saveFile(outputPath + File.separatorChar + "AutoGen.h", fileBuffer)) {
- throw new AutoGenException("Failed to generate AutoGen.h !!!");
- }
- }
-
- /**
- libGenAutogenC
-
- This function generates AutoGen.h for library.
-
- @throws BuildException
- Failed to generate AutoGen.c.
- **/
- void libGenAutogenC() throws EdkException {
- StringBuffer fileBuffer = new StringBuffer(10240);
-
- //
- // Write Autogen.c header notation
- //
- fileBuffer.append(CommonDefinition.AUTOGENCNOTATION);
-
- fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);
- fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);
-
- //
- // Call pcd autogen.
- //
- this.myPcdAutogen = new PCDAutoGenAction(moduleId,
- arch,
- true,
- saq.getModulePcdEntryNameArray(this.arch),
- pcdDriverType,
- parentId);
- this.myPcdAutogen.execute();
- if (this.myPcdAutogen != null) {
- fileBuffer.append(ToolDefinitions.LINE_SEPARATOR);
- fileBuffer.append(this.myPcdAutogen.getCAutoGenString());
- }
- }
-
- /**
- LibraryClassToAutogenH
-
- This function returns *.h files declared by library classes which are
- consumed or produced by current build module or library.
-
- @param libClassList
- List of library class which consumed or produce by current
- build module or library.
- @return includeStrList List of *.h file.
- **/
- void LibraryClassToAutogenH(StringBuffer fileBuffer, String[] libClassList)
- throws EdkException {
- String includeName[];
- String str = "";
-
- //
- // Get include file from GlobalData's SPDTable according to
- // library class name.
- //
- for (int i = 0; i < libClassList.length; i++) {
- includeName = GlobalData.getLibraryClassHeaderFiles(
- saq.getDependencePkg(this.arch),
- libClassList[i]);
- if (includeName == null) {
- throw new AutoGenException("Can not find library class ["
- + libClassList[i] + "] declaration in any SPD package. ");
- }
- for (int j = 0; j < includeName.length; j++) {
- String includeNameStr = includeName[j];
- if (includeNameStr != null) {
- fileBuffer.append(CommonDefinition.INCLUDE);
- fileBuffer.append(" <");
- fileBuffer.append(includeNameStr);
- fileBuffer.append(">\r\n");
- includeNameStr = null;
- }
- }
- }
- }
-
- /**
- IncludesToAutogenH
-
- This function add include file in AutoGen.h file.
-
- @param packageNameList
- List of module depended package.
- @param moduleType
- Module type.
- @return
- **/
- List<String> depPkgToAutogenH(PackageIdentification[] packageNameList,
- String moduleType) throws AutoGenException {
-
- List<String> includeStrList = new LinkedList<String>();
- String pkgHeader;
- String includeStr = "";
-
- //
- // Get include file from moduleInfo file
- //
- for (int i = 0; i < packageNameList.length; i++) {
- pkgHeader = GlobalData.getPackageHeaderFiles(packageNameList[i],
- moduleType);
- if (pkgHeader == null) {
- throw new AutoGenException("Can not find package ["
- + packageNameList[i]
- + "] declaration in any SPD package. ");
- } else if (!pkgHeader.equalsIgnoreCase("")) {
- includeStr = CommonDefinition.INCLUDE + " <" + pkgHeader + ">\r\n";
- includeStrList.add(includeStr);
- }
- }
-
- return includeStrList;
- }
-
- /**
- EntryPointToAutoGen
-
- This function convert <ModuleEntryPoint> & <ModuleUnloadImage>
- information in mas to AutoGen.c
-
- @param entryPointList
- List of entry point.
- @param fileBuffer
- String buffer fo AutoGen.c.
- @throws Exception
- **/
- void EntryPointToAutoGen(String[] entryPointList, String[] unloadImageList, StringBuffer fileBuffer)
- throws EdkException {
-
- String typeStr = saq.getModuleType();
- String debugStr = "DEBUG ((EFI_D_INFO | EFI_D_LOAD, \"Module Entry Point (%s) 0x%%p\\n\", (VOID *)(UINTN)%s));\r\n";
- int unloadImageCount = 0;
- int entryPointCount = 0;
-
- //
- // The parameters and return value of entryPoint is difference
- // for difference module type.
- //
- switch (CommonDefinition.getModuleType(typeStr)) {
-
- case CommonDefinition.ModuleTypePeiCore:
- if (entryPointList == null ||entryPointList.length != 1 ) {
- throw new AutoGenException("Module type = 'PEI_CORE', can have only one module entry point!");
- } else {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(entryPointList[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n");
- functionDeclarations.append(" IN VOID *OldCoreData\r\n");
- functionDeclarations.append(" );\r\n\r\n");
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_PEI_STARTUP_DESCRIPTOR *PeiStartupDescriptor,\r\n");
- fileBuffer.append(" IN VOID *OldCoreData\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" return ");
- fileBuffer.append(entryPointList[0]);
- fileBuffer.append(" (PeiStartupDescriptor, OldCoreData);\r\n");
- fileBuffer.append("}\r\n\r\n");
- }
- break;
-
- case CommonDefinition.ModuleTypeDxeCore:
- fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
- if (entryPointList == null || entryPointList.length != 1) {
- throw new AutoGenException("Module type = 'DXE_CORE', can have only one module entry point!");
- } else {
- functionDeclarations.append("VOID\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(entryPointList[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN VOID *HobStart\r\n");
- functionDeclarations.append(" );\r\n\r\n");
-
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN VOID *HobStart\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" ");
- fileBuffer.append(entryPointList[0]);
- fileBuffer.append(" (HobStart);\r\n");
- fileBuffer.append("}\r\n\r\n");
- }
- break;
-
- case CommonDefinition.ModuleTypePeim:
- entryPointCount = 0;
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT32 _gPeimRevision = 0;\r\n");
- if (entryPointList == null || entryPointList.length == 0) {
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" return EFI_SUCCESS;\r\n");
- fileBuffer.append("}\r\n\r\n");
- break;
- }
- for (int i = 0; i < entryPointList.length; i++) {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(entryPointList[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- functionDeclarations.append(" );\r\n");
- entryPointCount++;
- }
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- if (entryPointCount == 1) {
- fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
- fileBuffer.append(" return ");
- fileBuffer.append(entryPointList[0]);
- fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
- } else {
- fileBuffer.append(" EFI_STATUS Status;\r\n");
- fileBuffer.append(" EFI_STATUS CombinedStatus;\r\n\r\n");
- fileBuffer.append(" CombinedStatus = EFI_LOAD_ERROR;\r\n\r\n");
- for (int i = 0; i < entryPointList.length; i++) {
- if (!entryPointList[i].equals("")) {
- fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
- fileBuffer.append(" Status = ");
- fileBuffer.append(entryPointList[i]);
- fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
- fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (CombinedStatus)) {\r\n");
- fileBuffer.append(" CombinedStatus = Status;\r\n");
- fileBuffer.append(" }\r\n\r\n");
- } else {
- break;
- }
- }
- fileBuffer.append(" return CombinedStatus;\r\n");
- }
- fileBuffer.append("}\r\n\r\n");
- break;
-
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- entryPointCount = 0;
- //
- // If entryPoint is null, create an empty ProcessModuleEntryPointList
- // function.
- //
- if (entryPointList == null || entryPointList.length == 0) {
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
- fileBuffer.append(Integer.toString(entryPointCount));
- fileBuffer.append(";\r\n");
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" return EFI_SUCCESS;\r\n");
- fileBuffer.append("}\r\n\r\n");
-
- } else {
- for (int i = 0; i < entryPointList.length; i++) {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(entryPointList[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- entryPointCount++;
- }
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
- fileBuffer.append(Integer.toString(entryPointCount));
- fileBuffer.append(";\r\n");
- fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n");
- fileBuffer.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n\r\n");
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
-
- for (int i = 0; i < entryPointList.length; i++) {
- fileBuffer.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
- fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
- fileBuffer.append(" ExitDriver (");
- fileBuffer.append(entryPointList[i]);
- fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
- fileBuffer.append(" ASSERT (FALSE);\r\n");
- fileBuffer.append(" }\r\n");
- }
- fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
- fileBuffer.append("}\r\n\r\n");
-
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ExitDriver (\r\n");
- fileBuffer.append(" IN EFI_STATUS Status\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
- fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n");
- fileBuffer.append(" }\r\n");
- fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");
- fileBuffer.append(" ASSERT (FALSE);\r\n");
- fileBuffer.append("}\r\n\r\n");
- }
-
-
- //
- // Add "ModuleUnloadImage" for DxeSmmDriver module type;
- //
-
- unloadImageCount = 0;
- if (unloadImageList != null) {
- for (int i = 0; i < unloadImageList.length; i++) {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append(unloadImageList[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle\r\n");
- functionDeclarations.append(" );\r\n");
- unloadImageCount++;
- }
- }
-
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
- fileBuffer.append(Integer.toString(unloadImageCount));
- fileBuffer.append(";\r\n\r\n");
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleUnloadList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n");
- fileBuffer.append(" )\r\n");
- fileBuffer.append("{\r\n");
-
- if (unloadImageCount == 0) {
- fileBuffer.append(" return EFI_SUCCESS;\r\n");
- } else if (unloadImageCount == 1) {
- fileBuffer.append(" return ");
- fileBuffer.append(unloadImageList[0]);
- fileBuffer.append("(ImageHandle);\r\n");
- } else {
- fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");
- fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");
- for (int i = 0; i < unloadImageList.length; i++) {
- if (i == 0) {
- fileBuffer.append(" Status = ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- } else {
- fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
- fileBuffer.append(" ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- fileBuffer.append(" } else {\r\n");
- fileBuffer.append(" Status = ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- fileBuffer.append(" }\r\n");
- }
- }
- fileBuffer.append(" return Status;\r\n");
- }
- fileBuffer.append("}\r\n\r\n");
- break;
-
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- entryPointCount = 0;
- fileBuffer.append("const UINT32 _gUefiDriverRevision = 0;\r\n");
- //
- // If entry point is null, create a empty ProcessModuleEntryPointList function.
- //
- if (entryPointList == null || entryPointList.length == 0) {
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = 0;\r\n");
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- fileBuffer.append(" return EFI_SUCCESS;\r\n");
- fileBuffer.append("}\r\n");
-
- } else {
- for (int i = 0; i < entryPointList.length; i++) {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(entryPointList[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- entryPointCount++;
- }
-
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverEntryPointCount = ");
- fileBuffer.append(Integer.toString(entryPointCount));
- fileBuffer.append(";\r\n");
- if (entryPointCount > 1) {
- fileBuffer.append("static BASE_LIBRARY_JUMP_BUFFER mJumpContext;\r\n");
- fileBuffer.append("static EFI_STATUS mDriverEntryPointStatus = EFI_LOAD_ERROR;\r\n");
- }
- fileBuffer.append("\r\n");
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleEntryPointList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
-
- if (entryPointCount == 1) {
- fileBuffer.append(String.format(" " + debugStr, entryPointList[0], entryPointList[0]));
- fileBuffer.append(" return ");
- fileBuffer.append(entryPointList[0]);
- fileBuffer.append(" (ImageHandle, SystemTable);\r\n");
- } else {
- for (int i = 0; i < entryPointList.length; i++) {
- if (!entryPointList[i].equals("")) {
- fileBuffer.append(" if (SetJump (&mJumpContext) == 0) {\r\n");
- fileBuffer.append(String.format(" " + debugStr, entryPointList[i], entryPointList[i]));
- if (CommonDefinition.getModuleType(typeStr) == CommonDefinition.ModuleTypeUefiApplication) {
- fileBuffer.append(" Exit (");
- } else {
- fileBuffer.append(" ExitDriver (");
- }
- fileBuffer.append(entryPointList[i]);
- fileBuffer.append(" (ImageHandle, SystemTable));\r\n");
- fileBuffer.append(" ASSERT (FALSE);\r\n");
- fileBuffer.append(" }\r\n");
- } else {
- break;
- }
- }
- fileBuffer.append(" return mDriverEntryPointStatus;\r\n");
- }
- fileBuffer.append("}\r\n\r\n");
-
- if (CommonDefinition.getModuleType(typeStr) != CommonDefinition.ModuleTypeUefiApplication) {
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ExitDriver (\r\n");
- fileBuffer.append(" IN EFI_STATUS Status\r\n");
- fileBuffer.append(" )\r\n\r\n");
- fileBuffer.append("{\r\n");
- if (entryPointCount <= 1) {
- fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
- fileBuffer.append(" ProcessLibraryDestructorList (gImageHandle, gST);\r\n");
- fileBuffer.append(" }\r\n");
- fileBuffer.append(" gBS->Exit (gImageHandle, Status, 0, NULL);\r\n");
- } else {
- fileBuffer.append(" if (!EFI_ERROR (Status) || EFI_ERROR (mDriverEntryPointStatus)) {\r\n");
- fileBuffer.append(" mDriverEntryPointStatus = Status;\r\n");
- fileBuffer.append(" }\r\n");
- fileBuffer.append(" LongJump (&mJumpContext, (UINTN)-1);\r\n");
- fileBuffer.append(" ASSERT (FALSE);\r\n");
- }
- fileBuffer.append("}\r\n\r\n");
- }
- }
-
- if (CommonDefinition.getModuleType(typeStr) == CommonDefinition.ModuleTypeUefiApplication) {
- break;
- }
- //
- // Add ModuleUnloadImage for DxeDriver and UefiDriver module type.
- //
- //entryPointList = SurfaceAreaQuery.getModuleUnloadImageArray();
- //
- // Remover duplicate unload entry point.
- //
- //entryPointList = CommonDefinition.remDupString(entryPointList);
- //entryPointCount = 0;
- unloadImageCount = 0;
- if (unloadImageList != null) {
- for (int i = 0; i < unloadImageList.length; i++) {
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(unloadImageList[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle\r\n");
- functionDeclarations.append(" );\r\n");
- unloadImageCount++;
- }
- }
-
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverUnloadImageCount = ");
- fileBuffer.append(Integer.toString(unloadImageCount));
- fileBuffer.append(";\r\n\r\n");
-
- fileBuffer.append("EFI_STATUS\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessModuleUnloadList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle\r\n");
- fileBuffer.append(" )\r\n");
- fileBuffer.append("{\r\n");
-
- if (unloadImageCount == 0) {
- fileBuffer.append(" return EFI_SUCCESS;\r\n");
- } else if (unloadImageCount == 1) {
- fileBuffer.append(" return ");
- fileBuffer.append(unloadImageList[0]);
- fileBuffer.append("(ImageHandle);\r\n");
- } else {
- fileBuffer.append(" EFI_STATUS Status;\r\n\r\n");
- fileBuffer.append(" Status = EFI_SUCCESS;\r\n\r\n");
- for (int i = 0; i < unloadImageList.length; i++) {
- if (i == 0) {
- fileBuffer.append(" Status = ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- } else {
- fileBuffer.append(" if (EFI_ERROR (Status)) {\r\n");
- fileBuffer.append(" ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- fileBuffer.append(" } else {\r\n");
- fileBuffer.append(" Status = ");
- fileBuffer.append(unloadImageList[i]);
- fileBuffer.append("(ImageHandle);\r\n");
- fileBuffer.append(" }\r\n");
- }
- }
- fileBuffer.append(" return Status;\r\n");
- }
- fileBuffer.append("}\r\n\r\n");
- break;
- }
- }
-
- /**
- CNameToAutogenc
-
- This function gets GUIDs from SPD file accrodeing to <Protocols> <Ppis>
- <Guids> information and write those GUIDs to AutoGen.c.
-
- @param fileBuffer
- String Buffer for Autogen.c file.
-
- **/
- void CNameToAutogenC(StringBuffer fileBuffer) throws AutoGenException {
- String[] cNameGuid = null;
- String guidKeyWord = null;
-
- String[] cnameList = saq.getCNameArray(this.arch);
- for (int i = 0; i < cnameList.length; i++) {
- this.mGuidCNameList.add(cnameList[i]);
- }
-
-
- Iterator guidIterator = this.mGuidCNameList.iterator();
- while (guidIterator.hasNext()) {
- guidKeyWord = guidIterator.next().toString();
- cNameGuid = GlobalData.getGuid(this.mDepPkgList, guidKeyWord);
- if (cNameGuid == null) {
- cNameGuid = GlobalData.getProtocolGuid(this.mDepPkgList, guidKeyWord);
- if (cNameGuid == null) {
- cNameGuid = GlobalData.getPpiGuid(this.mDepPkgList, guidKeyWord);
- if (cNameGuid == null) {
- //
- // If can't find GUID declaration in every package, stop the build
- //
- EdkLog.log(EdkLog.EDK_INFO,"WARN: Can not find Guid [" + guidKeyWord + "] declaration in any SPD file.");
- continue;
- //throw new AutoGenException("Can not find Guid [" + guidKeyWord
- // + "] declaration in any SPD package. ");
- }
- }
- }
-
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID ");
- fileBuffer.append(cNameGuid[0]);
- fileBuffer.append(" = { ");
- fileBuffer.append(CommonDefinition.formatGuidName(cNameGuid[1]));
- fileBuffer.append("} ;");
- }
- }
-
- /**
- LibInstanceToAutogenC
-
- This function adds dependent library instance to autogen.c,which
- includeing library's constructor, destructor, and library dependent ppi,
- protocol, guid, pcd information.
-
- @param fileBuffer
- String buffer for AutoGen.c
- @throws BuildException
- **/
- void LibInstanceToAutogenC(StringBuffer fileBuffer) throws EdkException {
- String moduleType = this.moduleId.getModuleType();
- //
- // Add library constructor to AutoGen.c
- //
- LibConstructorToAutogenC(libConstructList, moduleType, fileBuffer);
- //
- // Add library destructor to AutoGen.c
- //
- LibDestructorToAutogenC(libDestructList, moduleType, fileBuffer);
- }
-
- /**
- LibConstructorToAutogenH
-
- This function writes library constructor declarations AutoGen.h. The library
- constructor's parameter and return value depend on module type.
-
- @param libInstanceList
- List of library construct name.
- @param moduleType
- Module type.
- @param fileBuffer
- String buffer for AutoGen.c
- @throws Exception
- **/
- void LibConstructorToAutogenH(String moduleType) throws EdkException {
- boolean isFirst = true;
-
- //
- // If not yet parse this library instance's constructor
- // element,parse it.
- //
- String libConstructName = saq.getLibConstructorName();
- if (libConstructName == null) {
- return;
- }
-
- //
- // The library constructor's parameter and return value depend on
- // module type.
- //
- if (moduleType.equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libConstructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- } else {
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libConstructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libConstructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libConstructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- }
- }
- }
-
- /**
- LibDestructorToAutogenH
-
- This function writes library destructor declarations AutoGen.h. The library
- destructor's parameter and return value depend on module type.
-
- @param libInstanceList
- List of library destructor name.
- @param moduleType
- Module type.
- @param fileBuffer
- String buffer for AutoGen.c
- @throws Exception
- **/
- void LibDestructorToAutogenH(String moduleType) throws EdkException {
- boolean isFirst = true;
- String libDestructName = saq.getLibDestructorName();
- if (libDestructName == null) {
- return;
- }
-
- if (moduleType.equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libDestructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- } else {
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libDestructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libDestructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libDestructName);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- }
- }
- }
-
- /**
- LibConstructorToAutogenc
-
- This function writes library constructor list to AutoGen.c. The library
- constructor's parameter and return value depend on module type.
-
- @param libInstanceList
- List of library construct name.
- @param moduleType
- Module type.
- @param fileBuffer
- String buffer for AutoGen.c
- @throws Exception
- **/
- void LibConstructorToAutogenC(List<String[]> libInstanceList,
- String moduleType, StringBuffer fileBuffer) throws EdkException {
- boolean isFirst = true;
-
- //
- // The library constructor's parameter and return value depend on
- // module type.
- //
- for (int i = 0; i < libInstanceList.size(); i++) {
- if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- } else {
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- break;
-
- }
- }
- }
-
- //
- // Add ProcessLibraryConstructorList in AutoGen.c
- //
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessLibraryConstructorList (\r\n");
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- fileBuffer.append(" VOID\r\n");
- break;
-
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- fileBuffer.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- fileBuffer.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- break;
-
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- break;
- }
-
- fileBuffer.append(" )\r\n");
- fileBuffer.append("{\r\n");
- //
- // If no constructor function, return EFI_SUCCESS.
- //
- for (int i = 0; i < libInstanceList.size(); i++) {
- if (isFirst) {
- fileBuffer.append(" EFI_STATUS Status;\r\n");
- fileBuffer.append(" Status = EFI_SUCCESS;\r\n");
- fileBuffer.append("\r\n");
- isFirst = false;
- }
- if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append("();\r\n");
- } else {
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append("();\r\n");
- break;
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append(" (FfsHeader, PeiServices);\r\n");
- break;
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append(" (ImageHandle, SystemTable);\r\n");
- break;
- default:
- EdkLog.log(EdkLog.EDK_INFO,"Autogen doesn't know how to deal with module type - " + moduleType + "!");
- }
-
- }
- fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");
- }
- fileBuffer.append("}\r\n");
- }
-
- /**
- LibDestructorToAutogenc
-
- This function writes library destructor list to AutoGen.c. The library
- destructor's parameter and return value depend on module type.
-
- @param libInstanceList
- List of library destructor name.
- @param moduleType
- Module type.
- @param fileBuffer
- String buffer for AutoGen.c
- @throws Exception
- **/
- void LibDestructorToAutogenC(List<String[]> libInstanceList,
- String moduleType, StringBuffer fileBuffer) throws EdkException {
- boolean isFirst = true;
- for (int i = 0; i < libInstanceList.size(); i++) {
- if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- } else {
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- functionDeclarations.append("RETURN_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" VOID\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_FFS_FILE_HEADER *FfsHeader,\r\n");
- functionDeclarations.append(" IN EFI_PEI_SERVICES **PeiServices\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- functionDeclarations.append("EFI_STATUS\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(libInstanceList.get(i)[0]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_HANDLE ImageHandle,\r\n");
- functionDeclarations.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- functionDeclarations.append(" );\r\n");
- break;
- }
- }
- }
-
- //
- // Write ProcessLibraryDestructor list to autogen.c
- //
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeBase:
- case CommonDefinition.ModuleTypePeiCore:
- case CommonDefinition.ModuleTypePeim:
- break;
- case CommonDefinition.ModuleTypeDxeCore:
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSmmDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- fileBuffer.append("VOID\r\n");
- fileBuffer.append("EFIAPI\r\n");
- fileBuffer.append("ProcessLibraryDestructorList (\r\n");
- fileBuffer.append(" IN EFI_HANDLE ImageHandle,\r\n");
- fileBuffer.append(" IN EFI_SYSTEM_TABLE *SystemTable\r\n");
- fileBuffer.append(" )\r\n");
- fileBuffer.append("{\r\n");
- //
- // If no library destructor function, return EFI_SUCCESS.
- //
-
- for (int i = 0; i < libInstanceList.size(); i++) {
- if (isFirst) {
- fileBuffer.append(" EFI_STATUS Status;\r\n");
- fileBuffer.append(" Status = EFI_SUCCESS;\r\n");
- fileBuffer.append("\r\n");
- isFirst = false;
- }
- if (libInstanceList.get(i)[1].equalsIgnoreCase(EdkDefinitions.MODULE_TYPE_BASE)) {
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append("();\r\n");
- fileBuffer.append(" VOID\r\n");
- } else {
- fileBuffer.append(" Status = ");
- fileBuffer.append(libInstanceList.get(i)[0]);
- fileBuffer.append("(ImageHandle, SystemTable);\r\n");
- fileBuffer.append(" ASSERT_EFI_ERROR (Status);\r\n");
- }
- }
- fileBuffer.append("}\r\n");
- break;
- }
- }
-
- /**
- ExternsDriverBindingToAutoGenC
-
- This function is to write DRIVER_BINDING, COMPONENT_NAME,
- DRIVER_CONFIGURATION, DRIVER_DIAGNOSTIC in AutoGen.c.
-
- @param fileBuffer
- String buffer for AutoGen.c
- **/
- void ExternsDriverBindingToAutoGenC(StringBuffer fileBuffer)
- throws EdkException {
- //
- // Get the arry of extern. The driverBindingGroup is a 2 dimension array.
- // The second dimension is include following element: DriverBinding,
- // ComponentName, DriverConfiguration, DriverDiag;
- //
- String[][] driverBindingGroup = this.saq.getExternProtocolGroup();
-
-
- //
- // inital BitMask;
- //
- int BitMask = 0;
-
- //
- // Write driver binding protocol extern to autogen.c
- //
- for (int i = 0; i < driverBindingGroup.length; i++) {
- if (driverBindingGroup[i][0] != null) {
- globalDeclarations.append("extern EFI_DRIVER_BINDING_PROTOCOL ");
- globalDeclarations.append(driverBindingGroup[i][0]);
- globalDeclarations.append(";\r\n");
- }
- }
-
- //
- // Write component name protocol extern to autogen.c
- //
- if (!componentNamePcd) {
- for (int i = 0; i < driverBindingGroup.length; i++) {
- if (driverBindingGroup[i][1]!= null) {
- if (driverBindingGroup[i][0] != null) {
- BitMask |= 0x01;
- globalDeclarations.append("extern EFI_COMPONENT_NAME_PROTOCOL ");
- globalDeclarations.append(driverBindingGroup[i][1]);
- globalDeclarations.append(";\r\n");
- } else {
- throw new AutoGenException("DriverBinding can't be empty!!");
- }
- }
- }
- }
-
- //
- // Write driver configration protocol extern to autogen.c
- //
- for (int i = 0; i < driverBindingGroup.length; i++) {
- if (driverBindingGroup[i][2] != null) {
- if (driverBindingGroup[i][0] != null) {
- BitMask |= 0x02;
- globalDeclarations.append("extern EFI_DRIVER_CONFIGURATION_PROTOCOL ");
- globalDeclarations.append(driverBindingGroup[i][2]);
- globalDeclarations.append(";\r\n");
- } else {
- throw new AutoGenException("DriverBinding can't be empty!!");
- }
- }
- }
-
- //
- // Write driver dignastic protocol extern to autogen.c
- //
- if (!driverDiagnostPcd) {
- for (int i = 0; i < driverBindingGroup.length; i++) {
- if (driverBindingGroup[i][3] != null) {
- if (driverBindingGroup[i][0] != null) {
- BitMask |= 0x04;
- globalDeclarations.append("extern EFI_DRIVER_DIAGNOSTICS_PROTOCOL ");
- globalDeclarations.append(driverBindingGroup[i][3]);
- globalDeclarations.append(";\r\n");
- } else {
- throw new AutoGenException("DriverBinding can't be empty!!");
- }
- }
- }
- }
-
-
- //
- // Write driver module protocol bitmask.
- //
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gDriverModelProtocolBitmask = ");
- fileBuffer.append(Integer.toString(BitMask));
- fileBuffer.append(";\r\n");
-
- //
- // Write driver module protocol list entry
- //
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverModelProtocolListEntries = ");
-
- fileBuffer.append(Integer.toString(driverBindingGroup.length));
- fileBuffer.append(";\r\n");
-
- //
- // Write drive module protocol list to autogen.c
- //
- if (driverBindingGroup.length > 0) {
- fileBuffer.append("GLOBAL_REMOVE_IF_UNREFERENCED const EFI_DRIVER_MODEL_PROTOCOL_LIST _gDriverModelProtocolList[] = {");
- }
-
-
- for (int i = 0; i < driverBindingGroup.length; i++) {
- if (i != 0) {
- fileBuffer.append(",");
- }
- //
- // DriverBinding
- //
- fileBuffer.append("\r\n {\r\n");
- fileBuffer.append(" &");
- fileBuffer.append(driverBindingGroup[i][0]);
- fileBuffer.append(", \r\n");
-
- //
- // ComponentName
- //
- if (driverBindingGroup[i][1] != null && componentNamePcd != true) {
- fileBuffer.append(" &");
- fileBuffer.append(driverBindingGroup[i][1]);
- fileBuffer.append(", \r\n");
- } else {
- fileBuffer.append(" NULL, \r\n");
- }
-
- //
- // DriverConfiguration
- //
- if (driverBindingGroup[i][2] != null) {
- fileBuffer.append(" &");
- fileBuffer.append(driverBindingGroup[i][2]);
- fileBuffer.append(", \r\n");
- } else {
- fileBuffer.append(" NULL, \r\n");
- }
-
- //
- // DriverDiagnostic
- //
- if (driverBindingGroup[i][3] != null && driverDiagnostPcd != true) {
- fileBuffer.append(" &");
- fileBuffer.append(driverBindingGroup[i][3]);
- fileBuffer.append(", \r\n");
- } else {
- fileBuffer.append(" NULL, \r\n");
- }
- fileBuffer.append(" }");
- }
-
- if (driverBindingGroup.length > 0) {
- fileBuffer.append("\r\n};\r\n");
- }
- }
-
- /**
- ExternCallBackToAutoGenC
-
- This function adds <SetVirtualAddressMapCallBack> and
- <ExitBootServicesCallBack> infomation to AutoGen.c
-
- @param fileBuffer
- String buffer for AutoGen.c
- @throws BuildException
- **/
- void ExternCallBackToAutoGenH(String moduleType)
- throws EdkException {
- //
- // Collect module's <SetVirtualAddressMapCallBack> and
- // <ExitBootServiceCallBack> and add to setVirtualAddList
- // exitBootServiceList.
- //
- String[] setVirtuals = saq.getSetVirtualAddressMapCallBackArray();
- String[] exitBoots = saq.getExitBootServicesCallBackArray();
- //
- // Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>
- // and <ExitBootServicesCallBack>
- //
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- //
- // Write SetVirtualAddressMap function definition.
- //
- for (int i = 0; setVirtuals != null && i < setVirtuals.length; i++) {
- if (setVirtuals[i].equalsIgnoreCase("")) {
- continue;
- }
- functionDeclarations.append("VOID\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(setVirtuals[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_EVENT Event,\r\n");
- functionDeclarations.append(" IN VOID *Context\r\n");
- functionDeclarations.append(" );\r\n\r\n");
- }
-
- //
- // Write DriverExitBootServices function definition.
- //
- for (int i = 0; exitBoots != null && i < exitBoots.length; i++) {
- if (exitBoots[i].equalsIgnoreCase("")) {
- continue;
- }
-
- functionDeclarations.append("VOID\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(exitBoots[i]);
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_EVENT Event,\r\n");
- functionDeclarations.append(" IN VOID *Context\r\n");
- functionDeclarations.append(" );\r\n\r\n");
- }
- break;
- default:
- break;
- }
- }
-
- /**
- ExternCallBackToAutoGenC
-
- This function adds <SetVirtualAddressMapCallBack> and
- <ExitBootServicesCallBack> infomation to AutoGen.c
-
- @param fileBuffer
- String buffer for AutoGen.c
- @throws BuildException
- **/
- void ExternCallBackToAutoGenC(StringBuffer fileBuffer)
- throws EdkException {
- //
- // Collect module's <SetVirtualAddressMapCallBack> and
- // <ExitBootServiceCallBack> and add to setVirtualAddList
- // exitBootServiceList.
- //
- String[] setVirtuals = saq.getSetVirtualAddressMapCallBackArray();
- String[] exitBoots = saq.getExitBootServicesCallBackArray();
- if (setVirtuals != null) {
- for (int j = 0; j < setVirtuals.length; j++) {
- this.setVirtalAddList.add(setVirtuals[j]);
- }
- }
- if (exitBoots != null) {
- for (int k = 0; k < exitBoots.length; k++) {
- this.exitBootServiceList.add(exitBoots[k]);
- }
- }
- //
- // Add c code in autogen.c which relate to <SetVirtualAddressMapCallBack>
- // and <ExitBootServicesCallBack>
- //
- String moduleType = this.moduleId.getModuleType();
- switch (CommonDefinition.getModuleType(moduleType)) {
- case CommonDefinition.ModuleTypeDxeDriver:
- case CommonDefinition.ModuleTypeDxeRuntimeDriver:
- case CommonDefinition.ModuleTypeDxeSalDriver:
- case CommonDefinition.ModuleTypeUefiDriver:
- case CommonDefinition.ModuleTypeUefiApplication:
- //
- // If moduleType is one of above, call setVirtualAddressToAutogenC,
- // and setExitBootServiceToAutogenC.
- //
- setVirtualAddressToAutogenC(fileBuffer);
- setExitBootServiceToAutogenC(fileBuffer);
- break;
- default:
- break;
- }
- }
-
- /**
- copyFlashMapHToDebugDir
-
- This function is to copy the falshmap.h to debug directory and change
- its name to TianoR8FlashMap.h
-
- @param
- @return
- **/
- private void copyFlashMapHToDebugDir() throws AutoGenException{
-
- File inFile = new File(fvDir + File.separatorChar + CommonDefinition.FLASHMAPH);
- int size = (int)inFile.length();
- byte[] buffer = new byte[size];
- File outFile = new File (this.outputPath + File.separatorChar + CommonDefinition.TIANOR8PLASHMAPH);
- //
- // If TianoR8FlashMap.h existed and the flashMap.h don't change,
- // do nothing.
- //
- if ((!outFile.exists()) ||(inFile.lastModified() - outFile.lastModified()) >= 0) {
- if (inFile.exists()) {
- try {
- FileInputStream fis = new FileInputStream (inFile);
- fis.read(buffer);
- FileOutputStream fos = new FileOutputStream(outFile);
- fos.write(buffer);
- fis.close();
- fos.close();
- } catch (IOException e) {
- throw new AutoGenException("The file, flashMap.h can't be open!");
- }
-
- } else {
- throw new AutoGenException("The file, flashMap.h doesn't exist!");
- }
- }
- }
-
- /**
- This function first order the library instances, then collect
- library instance 's PPI, Protocol, GUID,
- SetVirtalAddressMapCallBack, ExitBootServiceCallBack, and
- Destructor, Constructor.
-
- @param
- @return
- **/
- private void collectLibInstanceInfo() throws EdkException{
- int index;
-
- String moduleType = moduleId.getModuleType();
- String libConstructName = null;
- String libDestructName = null;
- String libModuleType = null;
- String[] setVirtuals = null;
- String[] exitBoots = null;
-
- ModuleIdentification[] libraryIdList = saq.getLibraryInstance(this.arch);
- if (libraryIdList.length <= 0) {
- return;
- }
- //
- // Reorder library instance sequence.
- //
- AutogenLibOrder libOrder = new AutogenLibOrder(libraryIdList, this.arch);
- List<ModuleIdentification> orderList = libOrder.orderLibInstance();
- //
- // Process library instance one by one.
- //
- for (int i = 0; i < orderList.size(); i++) {
- //
- // Get library instance basename.
- //
- ModuleIdentification libInstanceId = orderList.get(i);
-
- //
- // Get override map
- //
-
- Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstanceId, this.arch);
- saq.push(libDoc);
- //
- // check if the library instance support current module
- //
- String[] libraryClassList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED,
- this.arch,
- moduleType
- );
- if (libraryClassList.length <= 0) {
- throw new EdkException("Library instance " + libInstanceId.getName()
- + " doesn't support module type " + moduleType);
- }
- //
- // Get CName list from <PPis>, <Protocols>, <Guids>, etc. of this library
- // instance.
- //
- String[] guidCNameList = saq.getCNameArray(this.arch);
- PackageIdentification[] pkgList = saq.getDependencePkg(this.arch);
-
- //
- // Add those ppi, protocol, guid in global ppi,
- // protocol, guid
- // list.
- //
- for (index = 0; index < guidCNameList.length; index++) {
- this.mGuidCNameList.add(guidCNameList[index]);
- }
-
- for (index = 0; index < pkgList.length; index++) {
- if (!this.mDepPkgList.contains(pkgList[index])) {
- this.mDepPkgList.add(pkgList[index]);
- }
- }
-
- //
- // If not yet parse this library instance's constructor
- // element,parse it.
- //
- libConstructName = saq.getLibConstructorName();
- libDestructName = saq.getLibDestructorName();
- libModuleType = saq.getModuleType();
-
- //
- // Collect SetVirtualAddressMapCallBack and
- // ExitBootServiceCallBack.
- //
- setVirtuals = saq.getSetVirtualAddressMapCallBackArray();
- exitBoots = saq.getExitBootServicesCallBackArray();
- if (setVirtuals != null) {
- for (int j = 0; j < setVirtuals.length; j++) {
- this.setVirtalAddList.add(setVirtuals[j]);
- }
- }
- if (exitBoots != null) {
- for (int k = 0; k < exitBoots.length; k++) {
- this.exitBootServiceList.add(exitBoots[k]);
- }
- }
- saq.pop();
- //
- // Add dependent library instance constructor function.
- //
- if (libConstructName != null) {
- this.libConstructList.add(new String[] {libConstructName, libModuleType});
- }
- //
- // Add dependent library instance destructor fuction.
- //
- if (libDestructName != null) {
- this.libDestructList.add(new String[] {libDestructName, libModuleType});
- }
- }
- }
-
- private void setVirtualAddressToAutogenC(StringBuffer fileBuffer){
- //
- // Entry point lib for these module types needs to know the count
- // of entryPoint.
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverSetVirtualAddressMapEventCount = ");
-
- //
- // If the list is not valid or has no entries set count to zero else
- // set count to the number of valid entries
- //
- int Count = 0;
- int i = 0;
- if (this.setVirtalAddList != null) {
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
- }
- Count = i;
- }
-
- fileBuffer.append(Integer.toString(Count));
- fileBuffer.append(";\r\n\r\n");
- if (this.setVirtalAddList == null || this.setVirtalAddList.size() == 0) {
- //
- // No data so make a NULL list
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {\r\n");
- fileBuffer.append(" NULL\r\n");
- fileBuffer.append("};\r\n\r\n");
- } else {
- //
- // Write SetVirtualAddressMap function definition.
- //
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
- functionDeclarations.append("VOID\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(this.setVirtalAddList.get(i));
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_EVENT Event,\r\n");
- functionDeclarations.append(" IN VOID *Context\r\n");
- functionDeclarations.append(" );\r\n\r\n");
- }
-
- //
- // Write SetVirtualAddressMap entry point array.
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverSetVirtualAddressMapEvent[] = {");
- for (i = 0; i < this.setVirtalAddList.size(); i++) {
- if (this.setVirtalAddList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- if (i == 0) {
- fileBuffer.append("\r\n ");
- } else {
- fileBuffer.append(",\r\n ");
- }
-
- fileBuffer.append(this.setVirtalAddList.get(i));
- }
- //
- // add the NULL at the end of _gDriverSetVirtualAddressMapEvent list.
- //
- fileBuffer.append(",\r\n NULL");
- fileBuffer.append("\r\n};\r\n\r\n");
- }
- }
-
-
- private void setExitBootServiceToAutogenC(StringBuffer fileBuffer){
- //
- // Entry point lib for these module types needs to know the count.
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const UINTN _gDriverExitBootServicesEventCount = ");
-
- //
- // If the list is not valid or has no entries set count to zero else
- // set count to the number of valid entries.
- //
- int Count = 0;
- int i = 0;
- if (this.exitBootServiceList != null) {
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
- }
- Count = i;
- }
- fileBuffer.append(Integer.toString(Count));
- fileBuffer.append(";\r\n\r\n");
-
- if (this.exitBootServiceList == null || this.exitBootServiceList.size() == 0) {
- //
- // No data so make a NULL list.
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {\r\n");
- fileBuffer.append(" NULL\r\n");
- fileBuffer.append("};\r\n\r\n");
- } else {
- //
- // Write DriverExitBootServices function definition.
- //
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- functionDeclarations.append("VOID\r\n");
- functionDeclarations.append("EFIAPI\r\n");
- functionDeclarations.append(this.exitBootServiceList.get(i));
- functionDeclarations.append(" (\r\n");
- functionDeclarations.append(" IN EFI_EVENT Event,\r\n");
- functionDeclarations.append(" IN VOID *Context\r\n");
- functionDeclarations.append(" );\r\n\r\n");
- }
-
- //
- // Write DriverExitBootServices entry point array.
- //
- fileBuffer.append("\r\nGLOBAL_REMOVE_IF_UNREFERENCED const EFI_EVENT_NOTIFY _gDriverExitBootServicesEvent[] = {");
- for (i = 0; i < this.exitBootServiceList.size(); i++) {
- if (this.exitBootServiceList.get(i).equalsIgnoreCase("")) {
- break;
- }
-
- if (i == 0) {
- fileBuffer.append("\r\n ");
- } else {
- fileBuffer.append(",\r\n ");
- }
- fileBuffer.append(this.exitBootServiceList.get(i));
- }
-
- fileBuffer.append(",\r\n NULL");
- fileBuffer.append("\r\n};\r\n\r\n");
- }
- }
- /**
- setPcdComponentName
-
- Get the Pcd Value of ComponentName to
- decide whether need to disable the componentName.
-
- **/
- public void setPcdComponentName (){
- String pcdValue = null;
- pcdValue = saq.getPcdValueBycName("PcdComponentNameDisable");
- if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {
- this.componentNamePcd = true;
- }
- }
-
- /**
- setPcdDriverDiagnostic
-
- Get the Pcd Value of DriverDiagnostic to
- decide whether need to disable DriverDiagnostic.
-
- **/
- public void setPcdDriverDiagnostic (){
- String pcdValue = null;
- pcdValue = saq.getPcdValueBycName("PcdDriverDiagnosticsDisable");
- if (pcdValue != null && pcdValue.equalsIgnoreCase("true")) {
- this.driverDiagnostPcd = true;
- }
- }
-
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
deleted file mode 100644
index a131b89cc8..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/AutogenLibOrder.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/**@file
- AutogenLibOrder class.
-
- This class is to reorder library instance sequence according to library
- dependence.
-
- 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.
-
- **/
-package org.tianocore.build.autogen;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.HashSet;
-
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.build.exception.AutoGenException;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-/**
- This class This class is to reorder library instance sequence according to
- library dependence.
-**/
-public class AutogenLibOrder {
- ///
- /// The map of library class and its library instance.
- ///
- private Map<String, ModuleIdentification> libClassProducer = new HashMap<String, ModuleIdentification>();
-
- ///
- /// The map of library instance and its consumed Library Classes.
- ///
- private Map<ModuleIdentification, String[]> libInstanceConsumes = new HashMap<ModuleIdentification, String[]>();
-
- ///
- /// The map of library instance and its implemeted Library Classes.
- ///
- private Map<ModuleIdentification, String[]> libInstanceProduces = new HashMap<ModuleIdentification, String[]>();
-
- ///
- /// The map of library instance and its consumers.
- ///
- private Map<ModuleIdentification, HashSet<ModuleIdentification>> libInstanceConsumedBy = new HashMap<ModuleIdentification, HashSet<ModuleIdentification>>();
-
- ///
- /// List of library instance. It is String[3] list, String[0] is libraryName,
- /// String[1] is libraryConstructor name, String[2] is libDestructor name.
- ///
- private ModuleIdentification[] libInstanceList = null;
-
- /**
- Constructor function
-
- This function mainly initialize some member variable.
-
- @param libraryList List of the library instance.
- @throws Exception
- **/
- AutogenLibOrder(ModuleIdentification[] libraryList, String arch) throws EdkException {
- ModuleIdentification libInstance;
- String[] libClassDeclList = null;
- String[] libClassConsmList = null;
-
- libInstanceList = libraryList;
- for (int i = 0; i < libraryList.length; i++) {
- libInstance = libraryList[i];
- //
- // Fetch the constructor & destructor.
- //
- Map<String, XmlObject> libDoc = GlobalData.getDoc(libInstance, arch);
- SurfaceAreaQuery saq = new SurfaceAreaQuery(libDoc);
- libInstance.setConstructor(saq.getLibConstructorName());
- libInstance.setDestructor(saq.getLibDestructorName());
-
- //
- // Create library class consume database.
- //
- libClassConsmList = saq.getLibraryClasses(CommonDefinition.ALWAYSCONSUMED, arch, null);
- if (libClassConsmList != null) {
- if (this.libInstanceConsumes.containsKey(libInstance)) {
- throw new AutoGenException(
- libraryList[i].getName()
- + "-- this library instance already exists, please check the library instance list!");
- } else {
- this.libInstanceConsumes.put(libInstance, libClassConsmList);
- }
- }
-
- //
- // Create library class implementer database
- //
- libClassDeclList = saq.getLibraryClasses(CommonDefinition.ALWAYSPRODUCED, arch, null);
- if (libClassDeclList != null) {
- this.libInstanceProduces.put(libInstance, libClassDeclList);
- for (int j = 0; j < libClassDeclList.length; j++) {
- if (this.libClassProducer.containsKey(libClassDeclList[j])) {
- EdkLog.log(EdkLog.EDK_ERROR,libClassDeclList[j]
- + " class is already implemented by "
- + this.libClassProducer.get(libClassDeclList[j]));
- throw new AutoGenException("Library Class: " + libClassDeclList
- + " already has a library instance!");
- } else {
- this.libClassProducer.put(libClassDeclList[j], libInstance);
- }
- }
- }
- }
-
- //
- // Create a consumed-by database
- //
- for (Iterator it = libClassProducer.keySet().iterator(); it.hasNext();) {
- String className = (String)it.next();
- libInstance = libClassProducer.get(className);
- libInstanceConsumedBy.put(libInstance, new HashSet<ModuleIdentification>());
-
- for (int k = 0; k < libraryList.length; ++k) {
- ModuleIdentification consumer = libraryList[k];
- String[] consumedClassList = libInstanceConsumes.get(consumer);
-
- for (int l = 0; l < consumedClassList.length; ++l) {
- if (consumedClassList[l].equals(className)) {
- libInstanceConsumedBy.get(libInstance).add(consumer);
- }
- }
- }
- }
- }
-
- /**
- orderLibInstance
-
- This function reorder the library instance according the library class
- dependency, using DAG anaylysis algothim
-
- @return List which content the ordered library instance.
- **/
- List<ModuleIdentification> orderLibInstance() throws EdkException {
- LinkedList<ModuleIdentification> orderList = new LinkedList<ModuleIdentification>();
- LinkedList<ModuleIdentification> noConsumerList = new LinkedList<ModuleIdentification>();
-
- //
- // First, add the library instance without consumers to the Q
- //
- for (int i = 0; i < libInstanceList.length; ++i) {
- if (libInstanceList[i] == null) {
- continue;
- }
-
- if (libInstanceConsumedBy.get(libInstanceList[i]) == null || libInstanceConsumedBy.get(libInstanceList[i]).size() == 0) {
- noConsumerList.add(libInstanceList[i]);
- }
- }
-
- while (noConsumerList.size() > 0) {
- ModuleIdentification n = noConsumerList.poll();
- orderList.addFirst(n);
-
- String[] consumedClassList = libInstanceConsumes.get(n);
- for (int i = 0; i < consumedClassList.length; ++i) {
- ModuleIdentification m = libClassProducer.get(consumedClassList[i]);
- if (m == null) {
- continue;
- }
- HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(m);
- if (consumedBy == null || consumedBy.size() == 0) {
- continue;
- }
-
- consumedBy.remove(n);
- if (consumedBy.size() == 0) {
- noConsumerList.addLast(m);
- }
- }
-
- boolean circularlyConsumed = false;
- while (noConsumerList.size() == 0 && !circularlyConsumed) {
- circularlyConsumed = true;
- for (int i = 0; i < libInstanceList.length; ++i) {
- ModuleIdentification libInstance = libInstanceList[i];
- if (!libInstance.hasConstructor()) {
- continue;
- }
-
- HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstance);
- if (consumedBy == null || consumedBy.size() == 0) {
- continue;
- }
-
- ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]);
- for (int j = 0; j < consumedByList.length; ++j) {
- ModuleIdentification consumer = consumedByList[j];
- if (consumer.hasConstructor()) {
- continue;
- }
-
- //
- // if there's no constructor in the library instance's consumer,
- // remove it from the consumer list
- //
- consumedBy.remove(consumer);
- circularlyConsumed = false;
- if (consumedBy.size() == 0) {
- noConsumerList.addLast(libInstance);
- break;
- }
- }
-
- if (noConsumerList.size() > 0) {
- break;
- }
- }
-
- if (noConsumerList.size() == 0 && !circularlyConsumed) {
- break;
- }
- }
- }
-
- //
- // Append the remaining library instance to the end of sorted list
- //
- boolean HasError = false;
- for (int i = 0; i < libInstanceList.length; ++i) {
- HashSet<ModuleIdentification> consumedBy = libInstanceConsumedBy.get(libInstanceList[i]);
- if (consumedBy != null && consumedBy.size() > 0 && libInstanceList[i].hasConstructor()) {
- EdkLog.log(EdkLog.EDK_ERROR, libInstanceList[i].getName()
- + " with constructor has a circular dependency!");
- ModuleIdentification[] consumedByList = consumedBy.toArray(new ModuleIdentification[consumedBy.size()]);
- for (int j = 0; j < consumedByList.length; ++j) {
- EdkLog.log(EdkLog.EDK_ERROR, " consumed by " + consumedByList[j].getName());
- }
- HasError = true;
- }
-
- if (!orderList.contains(libInstanceList[i])) {
- orderList.add(libInstanceList[i]);
- }
- }
- if (HasError) {
- throw new AutoGenException("Circular dependency in library instances is found!");
- }
-
- return orderList;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java b/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java
deleted file mode 100644
index cb750ffd47..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/autogen/CommonDefinition.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/** @file
- CommonDefinition class.
-
- This class is to define some common marcos and funcions, which used by AutoGen.
-
- 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.
-
- **/
-package org.tianocore.build.autogen;
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-import org.tianocore.common.definitions.EdkDefinitions;
-import org.tianocore.common.definitions.ToolDefinitions;
-/**
- CommonDefinition
-
- This class is to define some common marcos, which used by AutoGen.
-
-**/
-public class CommonDefinition {
-
- ///
- /// final static string
- ///
- public final static String LIBRARY = "LIBRARY";
-
- public final static String AUTOGENHBEGIN = "extern int __make_me_compile_correctly;"
- + ToolDefinitions.LINE_SEPARATOR;
-
- public final static String INCLUDE = "#include";
-
- //public final static String DEBUGPROPERYMASK = "const UINT8 _gDebugPropertyMask "
- // + "= DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED"
- // + " | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED"
- // + " | DEBUG_PROPERTY_DEBUG_CODE_ENABLED;"
- // + ToolDefinitions.LINE_SEPARATOR;
-
- //public final static String DEFAULERROLEVEL = "const UINTN _gModuleDefaultErrorLevel"
- // + " = EFI_D_ERROR | EFI_D_LOAD;"
- // + ToolDefinitions.LINE_SEPARATOR;
-
-
- public final static String INCLUDEAUTOGENH = INCLUDE
- + " <AutoGen.h>"
- + ToolDefinitions.LINE_SEPARATOR;
-
- public final static String DEFINE = "#define ";
-
- public final static String GEFI = "gEfi";
-
- public final static String PRTOCOLGUID = "ProtocolGuid";
-
- public final static String PPIGUID = "PpiGuid";
-
- public final static String GUID = "Guid";
-
- public final static String TIANOR8PLASHMAPH = "TianoR8FlashMap.h";
-
- public final static String FLASHMAPH = "FlashMap.h";
-
- public final static String IFNDEF = "#ifndef ";
-
- public final static String AUTOGENH = "_AUTOGENH_";
-
-
- ///
- /// AutoGen.h and AutoGen.c file's header
- ///
- public final static String AUTOGENHNOTATION = "/**"
- + ToolDefinitions.LINE_SEPARATOR
- + " DO NOT EDIT"
- + ToolDefinitions.LINE_SEPARATOR
- + " FILE auto-generated by GenBuild tasks"
- + ToolDefinitions.LINE_SEPARATOR
- + " Module name:"
- + ToolDefinitions.LINE_SEPARATOR
- + " AutoGen.h"
- + ToolDefinitions.LINE_SEPARATOR
- + " Abstract:"
- + " Auto-generated AutoGen.h for building module or library."
- + ToolDefinitions.LINE_SEPARATOR
- + "**/"
- + ToolDefinitions.LINE_SEPARATOR
- + ToolDefinitions.LINE_SEPARATOR;
-
- public final static String AUTOGENCNOTATION = "/**"
- + ToolDefinitions.LINE_SEPARATOR
- + " DO NOT EDIT"
- + ToolDefinitions.LINE_SEPARATOR
- + " FILE auto-generated by GenBuild tasks"
- + ToolDefinitions.LINE_SEPARATOR
- + " Module name:"
- + ToolDefinitions.LINE_SEPARATOR
- + " AutoGen.c"
- + ToolDefinitions.LINE_SEPARATOR
- + " Abstract:"
- + " Auto-generated AutoGen.c for building module or library."
- + ToolDefinitions.LINE_SEPARATOR
- + "**/"
- + ToolDefinitions.LINE_SEPARATOR
- + ToolDefinitions.LINE_SEPARATOR;
-
- ///
- /// The defintions for identifying current module
- /// is PEI Pcd driver or Dxe Pcd driver.
- ///
- public static enum PCD_DRIVER_TYPE { NOT_PCD_DRIVER,
- PEI_PCD_DRIVER,
- DXE_PCD_DRIVER,
- UNKNOWN_PCD_DRIVER
- };
-
-
- ///
- /// module type
- ///
- public final static int ModuleTypeBase = 0;
- public final static int ModuleTypeSec = 1;
- public final static int ModuleTypePeiCore = 2;
- public final static int ModuleTypePeim = 3;
- public final static int ModuleTypeDxeCore = 4;
- public final static int ModuleTypeDxeDriver = 5;
- public final static int ModuleTypeDxeRuntimeDriver = 6;
- public final static int ModuleTypeDxeSmmDriver = 7;
- public final static int ModuleTypeDxeSalDriver = 8;
- public final static int ModuleTypeUefiDriver = 9;
- public final static int ModuleTypeUefiApplication = 10;
- public final static int ModuleTypeUnknown = 11;
-
- ///
- /// Usaged style
- ///
- public final static String ALWAYSCONSUMED = "ALWAYS_CONSUMED";
- public final static String ALWAYSPRODUCED = "ALWAYS_PRODUCED";
-
-
- public static class MyEnum {
- String moduleTypeStr;
- int type;
-
- MyEnum (String str, int type) {
- this.type = type;
- this.moduleTypeStr = str;
- }
-
- int ForInt(String str) {
- if (str.equals(this.moduleTypeStr)) {
- return this.type;
- } else
- return -1;
- }
- }
-
- ///
- /// Module type
- ///
- public static final MyEnum[] moduleEnum = new MyEnum[] {
- new MyEnum(EdkDefinitions.MODULE_TYPE_BASE, ModuleTypeBase),
- new MyEnum(EdkDefinitions.MODULE_TYPE_SEC, ModuleTypeSec),
- new MyEnum(EdkDefinitions.MODULE_TYPE_PEI_CORE, ModuleTypePeiCore),
- new MyEnum(EdkDefinitions.MODULE_TYPE_PEIM, ModuleTypePeim),
- new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_CORE, ModuleTypeDxeCore),
- new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_DRIVER, ModuleTypeDxeDriver),
- new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_RUNTIME_DRIVER, ModuleTypeDxeRuntimeDriver),
- new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_SAL_DRIVER, ModuleTypeDxeSalDriver),
- new MyEnum(EdkDefinitions.MODULE_TYPE_DXE_SMM_DRIVER, ModuleTypeDxeSmmDriver),
- new MyEnum(EdkDefinitions.MODULE_TYPE_UEFI_DRIVER, ModuleTypeUefiDriver),
- new MyEnum(EdkDefinitions.MODULE_TYPE_UEFI_APPLICATION, ModuleTypeUefiApplication)};
-
- /**
- getModuleType
-
- This function get the module type value according module type string.
-
- @param moduleTypeStr String of modlue type.
- @return
- **/
- public static int getModuleType(String moduleTypeStr) {
- int returnValue = -1;
- for (int i = 0; i < CommonDefinition.moduleEnum.length; i++) {
- returnValue = CommonDefinition.moduleEnum[i].ForInt(moduleTypeStr);
- if (returnValue != -1) {
- return returnValue;
- }
- }
- return CommonDefinition.ModuleTypeUnknown;
- }
-
- /**
- formateGuidName
-
- This function is to formate GUID to ANSI c form.
-
- @param guidNameCon
- String of GUID.
- @return Formated GUID.
- **/
- public static String formatGuidName(String guidNameConv) {
- String[] strList;
- String guid = "";
- int index = 0;
- if (guidNameConv
- .matches("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}")) {
- strList = guidNameConv.split("-");
- guid = "0x" + strList[0] + ", ";
- guid = guid + "0x" + strList[1] + ", ";
- guid = guid + "0x" + strList[2] + ", ";
- guid = guid + "{";
- guid = guid + "0x" + strList[3].substring(0, 2) + ", ";
- guid = guid + "0x" + strList[3].substring(2, 4);
-
- while (index < strList[4].length()) {
- guid = guid + ", ";
- guid = guid + "0x" + strList[4].substring(index, index + 2);
- index = index + 2;
- }
- guid = guid + "}";
- return guid;
- } else if (guidNameConv
- .matches("0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\\})?")) {
- strList = guidNameConv.split(",");
-
- //
- // chang Microsoft specific form to ANSI c form
- //
- for (int i = 0; i < 3; i++) {
- guid = guid + strList[i] + ",";
- }
- guid = guid + "{";
-
- for (int i = 3; i < strList.length; i++) {
- if (i == strList.length - 1) {
- guid = guid + strList[i];
- } else {
- guid = guid + strList[i] + ",";
- }
- }
- guid = guid + "}";
- return guid;
- } else {
- System.out
- .println("Check GUID Value, It doesn't conform to the registry format specified in the schema!!!");
- return "0";
-
- }
- }
-
- /**
- Remove deuplicat string in list
-
- This function is to duplicat string in list
-
- @param String[]
- String list.
- @return String[] String list which remove the duplicate string.
- **/
- public static String[] remDupString (String[] orgList){
- Set<String> strList = new LinkedHashSet<String>();
- String[] desList ;
- if (orgList == null) {
- return new String[0];
- }
- for (int i = 0; i < orgList.length; i++) {
- strList.add(orgList[i]);
- }
- desList = new String[strList.size()];
- Iterator item = strList.iterator();
- int index = 0;
- while (item.hasNext()) {
- desList[index] = (String)item.next();
- index++;
- }
- return desList;
- }
-
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/AutoGenException.java b/Tools/Java/Source/GenBuild/org/tianocore/build/exception/AutoGenException.java
deleted file mode 100644
index 5db092be48..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/AutoGenException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- AutoGenException class.
-
- The class handle the exception throwed by entity class.
-
-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.
-
-**/
-package org.tianocore.build.exception;
-
-
-/**
- The class handle the exception throwed by entity class.
-**/
-public class AutoGenException extends GenBuildException {
- static final long serialVersionUID = -8034897190740066939L;
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public AutoGenException(String expStr) {
- super(expStr);
- }
-
- public AutoGenException() {
-
- }
-
- public AutoGenException(Exception e, String messsge){
- super(e, messsge);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/GenBuildException.java b/Tools/Java/Source/GenBuild/org/tianocore/build/exception/GenBuildException.java
deleted file mode 100644
index b81d54cba2..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/GenBuildException.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/** @file
- GenBuildException class.
-
- The class handle the exception throwed by entity class.
-
-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.
-
-**/
-package org.tianocore.build.exception;
-
-import org.tianocore.common.exception.EdkException;
-
-/**
- The class handle the exception throwed by entity class.
-**/
-public class GenBuildException extends EdkException {
- static final long serialVersionUID = -8034897190740066937L;
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public GenBuildException(String expStr) {
- super(expStr);
- }
-
- public GenBuildException() {
- super();
- }
- public GenBuildException(Exception e, String message){
- super(e, message);
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PcdAutogenException.java b/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PcdAutogenException.java
deleted file mode 100644
index 3a3430c820..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PcdAutogenException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- AutoGenException class.
-
- The class handle the exception throwed by entity class.
-
-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.
-
-**/
-package org.tianocore.build.exception;
-
-/**
- The class handle the exception throwed by entity class.
-**/
-public class PcdAutogenException extends AutoGenException {
- static final long serialVersionUID = -8034897190740066936L;
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public PcdAutogenException(String expStr) {
- super(expStr);
- }
-
- public PcdAutogenException() {
- super();
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PlatformPcdPreprocessBuildException.java b/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PlatformPcdPreprocessBuildException.java
deleted file mode 100644
index 6bf6110148..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/PlatformPcdPreprocessBuildException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- PlatformPcdPreprocessBuildException class.
-
- The class handle the exception throwed by PlatformPcdPreprocessActionForBuilding class.
-
-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.
-
-**/
-package org.tianocore.build.exception;
-
-public class PlatformPcdPreprocessBuildException extends GenBuildException {
- /**
- serial version ID
- **/
- private static final long serialVersionUID = -1014589090055424954L;
-
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public PlatformPcdPreprocessBuildException(String expStr) {
- super(expStr);
- }
-
- public PlatformPcdPreprocessBuildException() {
- super();
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/XmlParseException.java b/Tools/Java/Source/GenBuild/org/tianocore/build/exception/XmlParseException.java
deleted file mode 100644
index 44d3fdc389..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/exception/XmlParseException.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/** @file
- XmlParseException class.
-
- The class handle the exception throwed by entity class.
-
-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.
-
-**/
-package org.tianocore.build.exception;
-
-/**
- The class handle the exception throwed by entity class.
-**/
-public class XmlParseException extends GenBuildException {
- static final long serialVersionUID = -8034897190740066934L;
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public XmlParseException(String expStr) {
- super(expStr);
- }
-
- public XmlParseException() {
- super();
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java
deleted file mode 100644
index ac930f1257..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/** @file
- This file is ANT task FpdParserTask.
-
- 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.
- **/
-package org.tianocore.build.fpd;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.taskdefs.Ant;
-import org.apache.xmlbeans.XmlObject;
-
-import org.tianocore.build.global.GenBuildLogger;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.OutputManager;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.FrameworkBuildTask;
-import org.tianocore.build.GenBuildThread;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-
-/**
-
- @since GenBuild 1.0
-**/
-public class FpdParserForThread extends FpdParserTask {
-
- public static Map<FpdModuleIdentification, GenBuildThread> allThreads = new LinkedHashMap<FpdModuleIdentification, GenBuildThread>();
-
- List<String> queueList = new ArrayList<String>();
-
- public final static Object deamonSemaphore = new Object();
-
- private final static Object countSemaphore = new Object();
-
- public static int STATUS_DEPENDENCY_NOT_READY = 1;
-
- public static int STATUS_DEPENDENCY_READY = 2;
-
- public static int STATUS_START_RUN = 3;
-
- public static int STATUS_END_RUN = 4;
-
- private int currentQueueCode = 0;
-
- public static int currentRunNumber = 0;
-
- public static int totalNumber = 0;
-
- public static int remainNumber = 0;
-
- public static ThreadGroup tg = new ThreadGroup("Framework");
-
- public static FpdModuleIdentification errorModule = null;
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public FpdParserForThread() {
- }
-
- /**
-
-
- **/
- public void execute() throws BuildException {
-
- this.setTaskName(".........");
- //
- // Parse FPD file
- //
- parseFpdFile();
-
- //
- // Prepare BUILD_DIR
- //
- isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
- String buildDir = getProject().getProperty("BUILD_DIR");
-
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++) {
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++) {
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = buildDir + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- fvDir.mkdirs();
- getProject().setProperty("FV_DIR", fvDir.getPath().replaceAll("(\\\\)", "/"));
-
- //
- // Gen Fv.inf files
- //
- genFvInfFiles(ffsCommonDir);
- }
- }
-
- //
- // Gen build.xml
- //
- String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile, aprioriType);
- fileGenerator.genBuildFile();
-
- //
- // Prepare Queue
- //
- queueList.add("libqueue");
-
- String[] validFv = saq.getFpdValidImageNames();
-
- for (int i = 0; i < validFv.length; i++) {
- queueList.add(validFv[i]);
- }
-
- Iterator<String> fvsNameIter = fvs.keySet().iterator();
-
- while (fvsNameIter.hasNext()) {
- String fvName = fvsNameIter.next();
- if (!isContain(validFv, fvName)) {
- queueList.add(fvName);
- }
- }
-
- //
- // Ant call ${PLATFORM}_build.xml
- //
- Ant ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(platformBuildFile);
- ant.setTarget("prebuild");
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
-
- remainNumber = totalNumber = allThreads.size();
-
- EdkLog.log(this, EdkLog.EDK_ALWAYS, "Total thread number is " + totalNumber);
- GenBuildLogger.setCacheEnable(true);
- //
- // Waiting for all thread over, or time out
- //
- synchronized (deamonSemaphore) {
-
- while (true) {
- //
- // If all modules are already built
- //
- if (currentQueueCode >= queueList.size()) {
- break ;
- }
-
- int percentage = (totalNumber - remainNumber) * 100 / totalNumber;
- updateTaskName(percentage);
- EdkLog.log(this, EdkLog.EDK_ALWAYS, percentage + "% finished. Has built " + (totalNumber - remainNumber) + " modules of " + totalNumber + " total. ");
-
- Set<FpdModuleIdentification> currentQueueModules = fvs.get(queueList.get(currentQueueCode));
-
- if (currentQueueModules == null) {
- ++currentQueueCode;
- continue ;
- }
- Iterator<FpdModuleIdentification> currentIter = currentQueueModules.iterator();
-
- GenBuildThread a = null;
-
- boolean existNoneReady = false;
-
- while (currentIter.hasNext()) {
- GenBuildThread item = allThreads.get(currentIter.next());
- if (item.getStatus() == STATUS_DEPENDENCY_NOT_READY) {
- existNoneReady = true;
- } else if (item.getStatus() == STATUS_DEPENDENCY_READY) {
- a = item;
- addCount();
- a.start();
- if (currentRunNumber == FrameworkBuildTask.MAX_CONCURRENT_THREAD_NUMBER) {
- break ;
- }
- }
- }
-
- if (a != null) {
- //
- // Exist ready thread
- //
- EdkLog.log(this, EdkLog.EDK_DEBUG, "Exist ready thread");
-
- } else if (existNoneReady && currentRunNumber == 0) {
- //
- // No active thread, but still have dependency not read thread
- //
- throw new BuildException("Existing some modules can't resolve depedencies. ");
- } else if (!existNoneReady && currentRunNumber == 0) {
- //
- // Current queue build finish, move to next
- //
- EdkLog.log(this, EdkLog.EDK_DEBUG, "Current queue build finish, move to next");
- ++currentQueueCode;
- continue ;
- } else {
- //
- // active thread exist, but no ready thread
- //
- EdkLog.log(this, EdkLog.EDK_DEBUG, "Active thread exist, but no ready thread. Current running number is " + currentRunNumber);
- }
-
- try {
- deamonSemaphore.wait();
-
- //
- // if find error. Waiting running threads to finish
- //
- if (errorModule != null) {
- while (currentRunNumber > 0) {
- deamonSemaphore.wait();
- }
-
- GenBuildLogger.setCacheEnable(false);
-
- GenBuildLogger.flushErrorModuleLog(errorModule);
-
- EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));
-
- throw new BuildException(errorModule + " build error. ");
- }
- } catch (InterruptedException ex) {
- BuildException e = new BuildException("Thread wait Error. \n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- }
- }
- }
-
- GenBuildLogger.setCacheEnable(false);
- //
- // call fvs, postbuild
- //
- ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(platformBuildFile);
- ant.setTarget("fvs");
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
-
- ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(platformBuildFile);
- ant.setTarget("postbuild");
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
-
- EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));
- }
-
-
- /**
- Parse all modules listed in FPD file.
- **/
- void parseModuleSAFiles() throws EdkException{
-
- Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = saq.getFpdModules();
-
- //
- // For every Module lists in FPD file.
- //
- Set<FpdModuleIdentification> keys = moduleSAs.keySet();
- Iterator<FpdModuleIdentification> iter = keys.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = iter.next();
-
- //
- // Generate GenBuildThread
- //
- GenBuildThread genBuildThread = new GenBuildThread(fpdModuleId.getModule(), fpdModuleId.getArch());
- genBuildThread.setParentModuleId(null);
- genBuildThread.setProject(getProject());
-
- Set<FpdModuleIdentification> dependencies = new LinkedHashSet<FpdModuleIdentification>();
-
- GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));
-
- //
- // Add all dependent Library Instance
- //
- saq.push(GlobalData.getDoc(fpdModuleId));
-
- ModuleIdentification[] libinstances = saq.getLibraryInstance(fpdModuleId.getArch());
- saq.pop();
-
- for (int i = 0; i < libinstances.length; i++) {
- FpdModuleIdentification libFpdModuleId = new FpdModuleIdentification(libinstances[i], fpdModuleId.getArch());
- //
- // Add to dependencies
- //
- dependencies.add(libFpdModuleId);
-
- //
- // Create thread for library instances
- //
- GenBuildThread liBuildThread = new GenBuildThread(libinstances[i], fpdModuleId.getArch());
- liBuildThread.setParentModuleId(fpdModuleId.getModule());
- liBuildThread.setProject(getProject());
- liBuildThread.setStatus(STATUS_DEPENDENCY_READY);
- liBuildThread.setHighPriority(true);
- allThreads.put(libFpdModuleId, liBuildThread);
-
- updateFvs("libqueue", libFpdModuleId);
-
- saq.push(GlobalData.getDoc(libinstances[i], fpdModuleId.getArch()));
- GlobalData.addMsaBuildOption(libinstances[i], parseMsaBuildOptions(false));
- GlobalData.addMsaFamilyBuildOption(libinstances[i], parseMsaBuildOptions(true));
- saq.pop();
- }
-
- genBuildThread.setDependencies(dependencies);
-
-// if (dependencies.size() == 0) {
- genBuildThread.setStatus(STATUS_DEPENDENCY_READY);
-// }
-
- allThreads.put(fpdModuleId, genBuildThread);
-
- //
- // Put fpdModuleId to the corresponding FV
- //
- saq.push(GlobalData.getDoc(fpdModuleId));
- String fvBinding = saq.getModuleFvBindingKeyword();
-
- fpdModuleId.setFvBinding(fvBinding);
- updateFvs(fvBinding, fpdModuleId);
-
- //
- // Prepare for out put file name
- //
- ModuleIdentification moduleId = fpdModuleId.getModule();
-
- String baseName = saq.getModuleOutputFileBasename();
-
- if (baseName == null) {
- baseName = moduleId.getName();
- }
- outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar
- + moduleId.getGuid() + "-" + baseName
- + getSuffix(moduleId.getModuleType()));
-
- //
- // parse module build options, if any
- //
- GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));
- GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));
-
- //
- // parse MSA build options
- //
- GlobalData.addMsaBuildOption(moduleId, parseMsaBuildOptions(false));
- GlobalData.addMsaFamilyBuildOption(moduleId, parseMsaBuildOptions(true));
-
- saq.pop();
- }
- }
-
- private boolean isContain(String[] list, String item) {
- for (int i = 0; i < list.length; i++) {
- if (list[i].equalsIgnoreCase(item)) {
- return true;
- }
- }
- return false;
- }
-
- public synchronized static void addCount() {
- synchronized (countSemaphore) {
- ++currentRunNumber;
- }
- }
-
- public synchronized static void subCount() {
- synchronized (countSemaphore) {
- --currentRunNumber;
- --remainNumber;
- }
- }
-
- private void updateTaskName(int percentage){
- int number = percentage/10;
- StringBuffer str = new StringBuffer(9);
- for(int i = 0; i < 9; i++) {
- if (i < number) {
- str.append('>');
- } else {
- str.append('.');
- }
- }
- this.setTaskName(str.toString());
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
deleted file mode 100644
index 325dc437b6..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/FpdParserTask.java
+++ /dev/null
@@ -1,950 +0,0 @@
-/** @file
- This file is ANT task FpdParserTask.
-
- FpdParserTask is used to parse FPD (Framework Platform Description) and generate
- build.out.xml. It is for Package or Platform build use.
-
- 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.
- **/
-package org.tianocore.build.fpd;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Set;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Ant;
-import org.apache.tools.ant.taskdefs.Property;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-
-import org.tianocore.common.definitions.EdkDefinitions;
-import org.tianocore.common.definitions.ToolDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-import org.tianocore.build.FrameworkBuildTask;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.OutputManager;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.id.PlatformIdentification;
-import org.tianocore.build.pcd.action.PlatformPcdPreprocessActionForBuilding;
-import org.tianocore.build.toolchain.ToolChainElement;
-import org.tianocore.build.toolchain.ToolChainMap;
-import org.tianocore.build.toolchain.ToolChainInfo;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- <code>FpdParserTask</code> is an ANT task. The main function is parsing Framework
- Platform Descritpion (FPD) XML file and generating its ANT build script for
- corresponding platform.
-
- <p>The task sets global properties PLATFORM, PLATFORM_DIR, PLATFORM_RELATIVE_DIR
- and BUILD_DIR. </p>
-
- <p>The task generates ${PLATFORM}_build.xml file which will be called by top level
- build.xml. The task also generate Fv.inf files (File is for Tool GenFvImage). </p>
-
- <p>FpdParserTask task stores all FPD information to GlobalData. And parse
- tools definition file to set up compiler options for different Target and
- different ToolChainTag. </p>
-
- <p>The method parseFpdFile is also prepared for single module build. </p>
-
- @since GenBuild 1.0
-**/
-public class FpdParserTask extends Task {
-
- ///
- /// Be used to ensure Global data will be initialized only once.
- ///
- private static boolean parsed = false;
-
- private File fpdFile = null;
-
- PlatformIdentification platformId;
-
- private String type;
-
- ///
- /// Mapping from modules identification to out put file name
- ///
- Map<FpdModuleIdentification, String> outfiles = new LinkedHashMap<FpdModuleIdentification, String>();
-
- ///
- /// Mapping from FV name to its modules
- ///
- Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();
-
- ///
- /// Mapping from FV apriori file to its type (PEI or DXE)
- ///
- Map<String, String> aprioriType = new HashMap<String, String>();
-
- ///
- /// FpdParserTask can specify some ANT properties.
- ///
- private Vector<Property> properties = new Vector<Property>();
-
- SurfaceAreaQuery saq = null;
-
- boolean isUnified = true;
-
- public static String PEI_APRIORI_GUID = "1b45cc0a-156a-428a-af62-49864da0e6e6";
-
- public static String DXE_APRIORI_GUID = "fc510ee7-ffdc-11d4-bd41-0080c73c8881";
-
- /**
- Public construct method. It is necessary for ANT task.
- **/
- public FpdParserTask() {
- }
-
- /**
- ANT task's entry method. The main steps is described as following:
-
- <ul>
- <li>Initialize global information (Framework DB, SPD files and all MSA files
- listed in SPD). This step will execute only once in whole build process;</li>
- <li>Parse specified FPD file; </li>
- <li>Generate FV.inf files; </li>
- <li>Generate PlatformName_build.xml file for Flatform build; </li>
- <li>Collect PCD information. </li>
- </ul>
-
- @throws BuildException
- Surface area is not valid.
- **/
- public void execute() throws BuildException {
- this.setTaskName("FpdParser");
-
- //
- // Parse FPD file
- //
- parseFpdFile();
-
- //
- // Prepare BUILD_DIR
- //
- isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
-
- String buildDir = getProject().getProperty("BUILD_DIR");
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++) {
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++) {
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = buildDir + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- fvDir.mkdirs();
- getProject().setProperty("FV_DIR", fvDir.getPath().replaceAll("(\\\\)", "/"));
-
- //
- // Gen Fv.inf files
- //
- genFvInfFiles(ffsCommonDir);
- }
- }
-
- //
- // Gen build.xml
- //
- String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile, aprioriType);
- fileGenerator.genBuildFile();
-
- //
- // Ant call ${PLATFORM}_build.xml
- //
- Ant ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(platformBuildFile);
- ant.setTarget(type);
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
- }
-
- /**
- Generate Fv.inf files. The Fv.inf file is composed with four
- parts: Options, Attributes, Components and Files. The Fv.inf files
- will be under FV_DIR.
-
- @throws BuildException
- File write FV.inf files error.
- **/
- void genFvInfFiles(String ffsCommonDir) throws BuildException {
- String[] validFv = saq.getFpdValidImageNames();
- for (int i = 0; i < validFv.length; i++) {
- //
- // Get all global variables from FPD and set them to properties
- //
- String[][] globalVariables = saq.getFpdGlobalVariable();
- for (int j = 0; j < globalVariables.length; j++) {
- getProject().setProperty(globalVariables[j][0], globalVariables[j][1]);
- }
-
- getProject().setProperty("FV_FILENAME", validFv[i]);
-
- File fvFile = new File(getProject().replaceProperties( getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".inf"));
- if (fvFile.exists() && (fvFile.lastModified() >= fpdFile.lastModified())) {
- //
- // don't re-generate FV.inf if fpd has not been changed
- //
- continue;
- }
- fvFile.getParentFile().mkdirs();
-
- try {
- FileWriter fw = new FileWriter(fvFile);
- BufferedWriter bw = new BufferedWriter(fw);
-
- //
- // Options
- //
- String[][] options = saq.getFpdOptions(validFv[i]);
- if (options.length > 0) {
- bw.write("[options]");
- bw.newLine();
- for (int j = 0; j < options.length; j++) {
- StringBuffer str = new StringBuffer(100);
- str.append(options[j][0]);
- while (str.length() < 40) {
- str.append(' ');
- }
- str.append("= ");
- str.append(options[j][1]);
- bw.write(getProject().replaceProperties(str.toString()));
- bw.newLine();
- }
- bw.newLine();
- }
-
- //
- // Attributes;
- //
- String[][] attributes = saq.getFpdAttributes(validFv[i]);
- if (attributes.length > 0) {
- bw.write("[attributes]");
- bw.newLine();
- for (int j = 0; j < attributes.length; j++) {
- StringBuffer str = new StringBuffer(100);
- str.append(attributes[j][0]);
- while (str.length() < 40) {
- str.append(' ');
- }
- str.append("= ");
- str.append(attributes[j][1]);
- bw.write(getProject().replaceProperties(str.toString()));
- bw.newLine();
- }
- bw.newLine();
- }
-
- //
- // Components
- //
- String[][] components = saq.getFpdComponents(validFv[i]);
- if (components.length > 0) {
- bw.write("[components]");
- bw.newLine();
- for (int j = 0; j < components.length; j++) {
- StringBuffer str = new StringBuffer(100);
- str.append(components[j][0]);
- while (str.length() < 40) {
- str.append(' ');
- }
- str.append("= ");
- str.append(components[j][1]);
- bw.write(getProject().replaceProperties(str.toString()));
- bw.newLine();
- }
- bw.newLine();
- }
-
- //
- // Files
- //
- Set<FpdModuleIdentification> moduleSeqSet = getModuleSequenceForFv(validFv[i]);
-
- Set<FpdModuleIdentification> filesSet = fvs.get(validFv[i]);
-
- FpdModuleIdentification[] files = null;
-
- if (moduleSeqSet == null) {
- if (filesSet != null) {
- files = filesSet.toArray(new FpdModuleIdentification[filesSet.size()]);
- }
- } else if (filesSet == null) {
- if (moduleSeqSet.size() != 0) {
- throw new BuildException("Can not find any modules belongs to FV[" + validFv[i] + "], but listed some in BuildOptions.UserExtensions[@UserID='IMAGES' @Identifier='1']");
- }
- } else {
- //
- // if moduleSeqSet and filesSet is inconsistent, report error
- //
- if(moduleSeqSet.size() != filesSet.size()){
- throw new BuildException("Modules for FV[" + validFv[i] + "] defined in FrameworkModules and in BuildOptions.UserExtensions[@UserID='IMAGES' @Identifier='1'] are inconsistent. ");
- } else {
- //
- // whether all modules in moduleSeqSet listed in filesSet
- //
- Iterator<FpdModuleIdentification> iter = moduleSeqSet.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification item = iter.next();
- if (!filesSet.contains(item)) {
- throw new BuildException("Can not find " + item + " belongs to FV[" + validFv[i] + "]");
- }
- }
- }
-
- files = moduleSeqSet.toArray(new FpdModuleIdentification[moduleSeqSet.size()]);
- }
-
-
- if (files != null) {
- bw.write("[files]");
- bw.newLine();
-
- Set<FpdModuleIdentification> modules = null;
-
- if ( (modules = getPeiApriori(validFv[i])) != null) {
- //
- // Special GUID - validFv[i].FFS
- //
- String str = ffsCommonDir + File.separatorChar + "FV" + File.separatorChar + PEI_APRIORI_GUID + "-" + validFv[i] + ".FFS";
- bw.write(getProject().replaceProperties("EFI_FILE_NAME = " + str));
- bw.newLine();
-
- File aprioriFile = new File(getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".apr");
- aprioriType.put(validFv[i], PEI_APRIORI_GUID);
- genAprioriFile(modules, aprioriFile);
- } else if((modules = getDxeApriori(validFv[i])) != null) {
- //
- // Special GUID - validFv[i].FFS
- //
- String str = ffsCommonDir + File.separatorChar + "FV" + File.separatorChar + DXE_APRIORI_GUID + "-" + validFv[i] + ".FFS";
- bw.write(getProject().replaceProperties("EFI_FILE_NAME = " + str));
- bw.newLine();
-
- File aprioriFile = new File(getProject().getProperty("FV_DIR") + File.separatorChar + validFv[i] + ".apr");
- aprioriType.put(validFv[i], DXE_APRIORI_GUID);
- genAprioriFile(modules, aprioriFile);
- }
-
- for (int j = 0; j < files.length; j++) {
- String str = ffsCommonDir + File.separatorChar + outfiles.get(files[j]);
- bw.write(getProject().replaceProperties("EFI_FILE_NAME = " + str));
- bw.newLine();
- }
- }
- bw.flush();
- bw.close();
- fw.close();
- } catch (IOException ex) {
- BuildException buildException = new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- } catch (EdkException ex) {
- BuildException buildException = new BuildException("Generation of the FV file [" + fvFile.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- }
- }
- }
-
- /**
- This method is used for Single Module Build.
-
- @throws BuildException
- FPD file is not valid.
- **/
- public void parseFpdFile(File fpdFile) throws BuildException, EdkException {
- this.fpdFile = fpdFile;
- parseFpdFile();
-
- //
- // Call Platform_build.xml prebuild firstly in stand-alone build
- // Prepare BUILD_DIR
- //
- isUnified = OutputManager.getInstance().prepareBuildDir(getProject());
-
- String buildDir = getProject().getProperty("BUILD_DIR");
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++) {
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++) {
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = buildDir + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- fvDir.mkdirs();
- }
- }
-
- String platformBuildFile = buildDir + File.separatorChar + platformId.getName() + "_build.xml";
- PlatformBuildFileGenerator fileGenerator = new PlatformBuildFileGenerator(getProject(), outfiles, fvs, isUnified, saq, platformBuildFile, aprioriType);
- fileGenerator.genBuildFile();
-
- Ant ant = new Ant();
- ant.setProject(getProject());
- ant.setAntfile(platformBuildFile);
- ant.setTarget("prebuild");
- ant.setInheritAll(true);
- ant.init();
- ant.execute();
- }
-
- /**
- Parse FPD file.
-
- @throws BuildException
- FPD file is not valid.
- **/
- void parseFpdFile() throws BuildException {
- try {
- XmlObject doc = XmlObject.Factory.parse(fpdFile);
-
- if (!doc.validate()) {
- throw new BuildException("Platform Surface Area file [" + fpdFile.getPath() + "] format is invalid!");
- }
-
- Map<String, XmlObject> map = new HashMap<String, XmlObject>();
- map.put("PlatformSurfaceArea", doc);
- saq = new SurfaceAreaQuery(map);
-
- //
- // Initialize
- //
- platformId = saq.getFpdHeader();
- platformId.setFpdFile(fpdFile);
- getProject().setProperty("PLATFORM", platformId.getName());
- getProject().setProperty("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
- getProject().setProperty("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
-
- if( !FrameworkBuildTask.multithread) {
- FrameworkBuildTask.originalProperties.put("PLATFORM", platformId.getName());
- FrameworkBuildTask.originalProperties.put("PLATFORM_FILE", platformId.getRelativeFpdFile().replaceAll("(\\\\)", "/"));
- FrameworkBuildTask.originalProperties.put("PLATFORM_DIR", platformId.getFpdFile().getParent().replaceAll("(\\\\)", "/"));
- FrameworkBuildTask.originalProperties.put("PLATFORM_RELATIVE_DIR", platformId.getPlatformRelativeDir().replaceAll("(\\\\)", "/"));
- }
-
- //
- // Build mode. User-defined output dir.
- //
- String buildMode = saq.getFpdIntermediateDirectories();
- String userDefinedOutputDir = saq.getFpdOutputDirectory();
-
- OutputManager.getInstance().setup(userDefinedOutputDir, buildMode);
-
- //
- // TBD. Deal PCD and BuildOption related Info
- //
- GlobalData.setFpdBuildOptions(saq.getFpdBuildOptions());
-
- GlobalData.setToolChainPlatformInfo(saq.getFpdToolChainInfo());
-
- //
- // Parse all list modules SA
- //
- parseModuleSAFiles();
-
- //
- // TBD. Deal PCD and BuildOption related Info
- //
- parseToolChainFamilyOptions();
- parseToolChainOptions();
-
- //
- // check if the tool chain is valid or not
- //
- checkToolChain();
-
- saq.push(map);
-
- //
- // Pcd Collection. Call CollectPCDAction to collect pcd info.
- //
- if (!parsed) {
- PlatformPcdPreprocessActionForBuilding ca = new PlatformPcdPreprocessActionForBuilding();
- ca.perform(platformId.getFpdFile().getPath());
- }
- } catch (IOException ex) {
- BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- } catch (XmlException ex) {
- BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- } catch (EdkException ex) {
- BuildException buildException = new BuildException("Parsing of the FPD file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- }
- if (!parsed) {
- parsed = true;
- }
- }
-
- /**
- Parse all modules listed in FPD file.
- **/
- void parseModuleSAFiles() throws EdkException{
- Map<FpdModuleIdentification, Map<String, XmlObject>> moduleSAs = saq.getFpdModules();
-
- //
- // For every Module lists in FPD file.
- //
- Set<FpdModuleIdentification> keys = moduleSAs.keySet();
- Iterator iter = keys.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
-
- //
- // Judge if Module is existed?
- // TBD
- GlobalData.registerFpdModuleSA(fpdModuleId, moduleSAs.get(fpdModuleId));
-
- //
- // Put fpdModuleId to the corresponding FV
- //
- saq.push(GlobalData.getDoc(fpdModuleId));
- String fvBinding = saq.getModuleFvBindingKeyword();
-
- fpdModuleId.setFvBinding(fvBinding);
- updateFvs(fvBinding, fpdModuleId);
-
- //
- // Prepare for out put file name
- //
- ModuleIdentification moduleId = fpdModuleId.getModule();
-
- String baseName = saq.getModuleOutputFileBasename();
-
- if (baseName == null) {
- baseName = moduleId.getName();
- }
- outfiles.put(fpdModuleId, fpdModuleId.getArch() + File.separatorChar
- + moduleId.getGuid() + "-" + baseName
- + getSuffix(moduleId.getModuleType()));
-
- //
- // parse module build options, if any
- //
- GlobalData.addModuleToolChainOption(fpdModuleId, parseModuleBuildOptions(false));
- GlobalData.addModuleToolChainFamilyOption(fpdModuleId, parseModuleBuildOptions(true));
-
- //
- // parse MSA build options
- //
- GlobalData.addMsaBuildOption(moduleId, parseMsaBuildOptions(false));
- GlobalData.addMsaFamilyBuildOption(moduleId, parseMsaBuildOptions(true));
-
- ModuleIdentification[] libraryInstances = saq.getLibraryInstance(null);
- for (int i = 0; i < libraryInstances.length; i++) {
- saq.push(GlobalData.getDoc(libraryInstances[i], fpdModuleId.getArch()));
- GlobalData.addMsaBuildOption(libraryInstances[i], parseMsaBuildOptions(false));
- GlobalData.addMsaFamilyBuildOption(libraryInstances[i], parseMsaBuildOptions(true));
- saq.pop();
- }
-
- saq.pop();
- }
- }
-
- ToolChainMap parseModuleBuildOptions(boolean toolChainFamilyFlag) throws EdkException {
- String[][] options = saq.getModuleBuildOptions(toolChainFamilyFlag);
- if (options == null || options.length == 0) {
- return new ToolChainMap();
- }
- return parseOptions(options);
- }
-
- private ToolChainMap parsePlatformBuildOptions(boolean toolChainFamilyFlag) throws EdkException {
- String[][] options = saq.getPlatformBuildOptions(toolChainFamilyFlag);
- if (options == null || options.length == 0) {
- return new ToolChainMap();
- }
- return parseOptions(options);
- }
-
- ToolChainMap parseMsaBuildOptions(boolean toolChainFamilyFlag) throws EdkException {
- String[][] options = saq.getMsaBuildOptions(toolChainFamilyFlag);
- if (options == null || options.length == 0) {
- return new ToolChainMap();
- }
- return parseOptions(options);
- }
-
- private ToolChainMap parseOptions(String[][] options) throws EdkException {
- ToolChainMap map = new ToolChainMap();
- int flagIndex = ToolChainElement.ATTRIBUTE.value;
-
- for (int i = 0; i < options.length; ++i) {
- String flagString = options[i][flagIndex];
- if (flagString == null) {
- flagString = "";
- }
- options[i][flagIndex] = ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS;
- map.put(options[i], flagString.trim());
- }
-
- return map;
- }
-
- private void parseToolChainFamilyOptions() throws EdkException {
- GlobalData.setPlatformToolChainFamilyOption(parsePlatformBuildOptions(true));
- }
-
- private void parseToolChainOptions() throws EdkException {
- GlobalData.setPlatformToolChainOption(parsePlatformBuildOptions(false));
- }
-
- /**
- Add the current module to corresponding FV.
-
- @param fvName current FV name
- @param moduleName current module identification
- **/
- void updateFvs(String fvName, FpdModuleIdentification fpdModuleId) {
- if (fvName == null || fvName.trim().length() == 0) {
- fvName = "NULL";
- }
- String[] fvNameArray = fvName.split("[, \t]+");
- for (int i = 0; i < fvNameArray.length; i++) {
- //
- // Put module to corresponding fvName
- //
- if (fvs.containsKey(fvNameArray[i])) {
- Set<FpdModuleIdentification> set = fvs.get(fvNameArray[i]);
- set.add(fpdModuleId);
- } else {
- Set<FpdModuleIdentification> set = new LinkedHashSet<FpdModuleIdentification>();
- set.add(fpdModuleId);
- fvs.put(fvNameArray[i], set);
- }
- }
- }
-
- /**
- Get the suffix based on module type. Current relationship are listed:
-
- <pre>
- <b>ModuleType</b> <b>Suffix</b>
- BASE .FFS
- SEC .SEC
- PEI_CORE .PEI
- PEIM .PEI
- DXE_CORE .DXE
- DXE_DRIVER .DXE
- DXE_RUNTIME_DRIVER .DXE
- DXE_SAL_DRIVER .DXE
- DXE_SMM_DRIVER .DXE
- TOOL .FFS
- UEFI_DRIVER .DXE
- UEFI_APPLICATION .APP
- USER_DEFINED .FFS
- </pre>
-
- @param moduleType module type
- @return
- @throws BuildException
- If module type is null
- **/
- public static String getSuffix(String moduleType) throws BuildException {
- if (moduleType == null) {
- throw new BuildException("Module type is not specified.");
- }
-
- String[][] suffix = EdkDefinitions.ModuleTypeExtensions;
-
- for (int i = 0; i < suffix.length; i++) {
- if (suffix[i][0].equalsIgnoreCase(moduleType)) {
- return suffix[i][1];
- }
- }
- //
- // Default is '.FFS'
- //
- return ".FFS";
- }
- /**
- Add a property.
-
- @param p property
- **/
- public void addProperty(Property p) {
- properties.addElement(p);
- }
-
- public void setFpdFile(File fpdFile) {
- this.fpdFile = fpdFile;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public String getAllArchForModule(ModuleIdentification moduleId) {
- String archs = "";
- Iterator<FpdModuleIdentification> iter = outfiles.keySet().iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = iter.next();
-
- if (fpdModuleId.getModule().equals(moduleId)) {
- archs += fpdModuleId.getArch() + " ";
- }
- }
-
- return archs;
- }
-
- private void genAprioriFile(Set<FpdModuleIdentification> modules, File file) {
- try {
- FileWriter fw = new FileWriter(file);
- BufferedWriter bw = new BufferedWriter(fw);
-
- Iterator<FpdModuleIdentification> iter = modules.iterator();
- while(iter.hasNext()) {
- bw.write(iter.next().getModule().getGuid());
- bw.newLine();
- }
-
- bw.flush();
- bw.close();
- fw.close();
- } catch (IOException ex) {
- BuildException buildException = new BuildException("Generation of the Apriori file [" + file.getPath() + "] failed!\n" + ex.getMessage());
- buildException.setStackTrace(ex.getStackTrace());
- throw buildException;
- }
- }
-
- private Set<FpdModuleIdentification> getPeiApriori(String fvName) throws EdkException {
- Node node = saq.getPeiApriori(fvName);
- Set<FpdModuleIdentification> result = new LinkedHashSet<FpdModuleIdentification>();
- if (node == null) {
- return null;
- }
-
- NodeList childNodes = node.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childItem = childNodes.item(i);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- //
- // Find child elements "IncludeModules"
- //
- if (childItem.getNodeName().compareTo("IncludeModules") == 0) {
- //
- // result will be updated
- //
- processNodes(childItem, result);
- } else if (childItem.getNodeName().compareTo("FvName") == 0) {
-
- } else if (childItem.getNodeName().compareTo("InfFileName") == 0) {
-
- } else {
- //
- // Report Warning
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Unrecognised element " + childItem.getNodeName() + " under FPD.BuildOptions.UserExtensions[UserID='APRIORI' Identifier='0']");
- }
- }
- }
-
- return result;
- }
-
- private Set<FpdModuleIdentification> getDxeApriori(String fvName) throws EdkException {
- Node node = saq.getDxeApriori(fvName);
- Set<FpdModuleIdentification> result = new LinkedHashSet<FpdModuleIdentification>();
- if (node == null) {
- return null;
- }
-
- NodeList childNodes = node.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childItem = childNodes.item(i);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- //
- // Find child elements "IncludeModules"
- //
- if (childItem.getNodeName().compareTo("IncludeModules") == 0) {
- //
- // result will be updated
- //
- processNodes(childItem, result);
- } else if (childItem.getNodeName().compareTo("FvName") == 0) {
-
- } else if (childItem.getNodeName().compareTo("InfFileName") == 0) {
-
- } else {
- //
- // Report Warning
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Unrecognised element " + childItem.getNodeName() + " under FPD.BuildOptions.UserExtensions[UserID='APRIORI' Identifier='1']");
- }
- }
- }
-
- return result;
- }
-
- private Set<FpdModuleIdentification> getModuleSequenceForFv(String fvName) throws EdkException {
- Node node = saq.getFpdModuleSequence(fvName);
- Set<FpdModuleIdentification> result = new LinkedHashSet<FpdModuleIdentification>();
-
- if ( node == null) {
- EdkLog.log(this, EdkLog.EDK_WARNING, "FV[" + fvName + "] does not specify module sequence in FPD. Assuming present sequence as default sequence in FV. ");
- return null;
- } else {
- NodeList childNodes = node.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childItem = childNodes.item(i);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- //
- // Find child elements "IncludeModules"
- //
- if (childItem.getNodeName().compareTo("IncludeModules") == 0) {
- //
- // result will be updated
- //
- processNodes(childItem, result);
- } else if (childItem.getNodeName().compareTo("FvName") == 0) {
-
- } else if (childItem.getNodeName().compareTo("InfFileName") == 0) {
-
- } else {
- //
- // Report Warning
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Unrecognised element " + childItem.getNodeName() + " under FPD.BuildOptions.UserExtensions[UserID='IMAGES' Identifier='1']");
- }
- }
- }
- }
-
- return result;
- }
-
- private void processNodes(Node node, Set<FpdModuleIdentification> result) throws EdkException {
- //
- // Found out all elements "Module"
- //
- NodeList childNodes = node.getChildNodes();
- for (int j = 0; j < childNodes.getLength(); j++) {
- Node childItem = childNodes.item(j);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- if (childItem.getNodeName().compareTo("Module") == 0) {
- String moduleGuid = null;
- String moduleVersion = null;
- String packageGuid = null;
- String packageVersion = null;
- String arch = null;
-
- NamedNodeMap attr = childItem.getAttributes();
- for (int i = 0; i < attr.getLength(); i++) {
- Node attrItem = attr.item(i);
- if (attrItem.getNodeName().compareTo("ModuleGuid") == 0) {
- moduleGuid = attrItem.getNodeValue();
- } else if (attrItem.getNodeName().compareTo("ModuleVersion") == 0) {
- moduleVersion = attrItem.getNodeValue();
- } else if (attrItem.getNodeName().compareTo("PackageGuid") == 0) {
- packageGuid = attrItem.getNodeValue();
- } else if (attrItem.getNodeName().compareTo("PackageVersion") == 0) {
- packageVersion = attrItem.getNodeValue();
- } else if (attrItem.getNodeName().compareTo("Arch") == 0) {
- arch = attrItem.getNodeValue();
- } else {
- //
- // Report warning
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Unrecognised attribute " + attrItem.getNodeName() + " under FPD.BuildOptions.UserExtensions[UserID='IMAGES' Identifier='1'].IncludeModules.Module");
- }
- }
-
- PackageIdentification packageId = new PackageIdentification(packageGuid, packageVersion);
- GlobalData.refreshPackageIdentification(packageId);
-
- ModuleIdentification moduleId = new ModuleIdentification(moduleGuid, moduleVersion);
- moduleId.setPackage(packageId);
- GlobalData.refreshModuleIdentification(moduleId);
-
- if (arch == null) {
- throw new EdkException("Attribute [Arch] is required for element FPD.BuildOptions.UserExtensions[UserID='IMAGES' Identifier='1'].IncludeModules.Module. ");
- }
-
- result.add(new FpdModuleIdentification(moduleId, arch));
- } else {
- //
- // Report Warning
- //
- EdkLog.log(this, EdkLog.EDK_WARNING, "Unrecognised element " + childItem.getNodeName() + " under FPD.BuildOptions.UserExtensions[UserID='IMAGES' Identifier='1'].IncludeModules");
- }
- }
- }
- }
-
-
- private void checkToolChain() throws EdkException {
- ToolChainInfo toolChainInfo = GlobalData.getToolChainInfo();
-
- if (toolChainInfo.getTargets().length == 0) {
- throw new EdkException("No valid target found! "+
- "Please check the TARGET definition in Tools/Conf/target.txt, "+
- "or the <BuildTarget>, <BuildOptions> in the FPD file.");
- }
-
- if (toolChainInfo.getTagnames().length == 0) {
- throw new EdkException("No valid tool chain found! "+
- "Please check the TOOL_CHAIN_TAG definition in Tools/Conf/target.txt, "+
- "or the <BuildOptions> in the FPD file.");
- }
-
- if (toolChainInfo.getArchs().length == 0) {
- throw new EdkException("No valid architecture found! "+
- "Please check the TARGET_ARCH definition in Tools/Conf/target.txt, "+
- "or the <SupportedArchitectures>, <BuildOptions> in the FPD file.");
- }
-
- if (toolChainInfo.getCommands().length == 0) {
- throw new EdkException("No valid COMMAND found! Please check the tool chain definitions "+
- "in Tools/Conf/tools_def.txt.");
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java b/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
deleted file mode 100644
index ad2ee2cdd2..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/fpd/PlatformBuildFileGenerator.java
+++ /dev/null
@@ -1,708 +0,0 @@
-/** @file
-
- 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.
- **/
-package org.tianocore.build.fpd;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Result;
-import javax.xml.transform.Source;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Project;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.global.SurfaceAreaQuery;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- class PlatformBuildFileGenerator is used to generate ${PLATFORM}_build.xml file.
-
- @since GenBuild 1.0
-**/
-public class PlatformBuildFileGenerator {
-
- ///
- /// Mapping from modules identification to out put file name
- ///
- private Map<FpdModuleIdentification, String> outfiles;
-
- ///
- /// Mapping from FV name to its modules
- ///
- private Map<String, Set<FpdModuleIdentification>> fvs = new HashMap<String, Set<FpdModuleIdentification>>();
-
-
- private boolean isUnified = true;
-
- private SurfaceAreaQuery saq = null;
-
- private File platformBuildFile = null;
-
- private Map<String, String> aprioriType = null;
-
- private Project project;
-
- private String info = "DO NOT EDIT \n"
- + "This file is auto-generated by the build utility\n"
- + "\n"
- + "Abstract:\n"
- + "Auto-generated ANT build file for building EFI Modules and Platforms\n";
-
- public PlatformBuildFileGenerator(Project project, Map<FpdModuleIdentification, String> outfiles, Map<String, Set<FpdModuleIdentification>> fvs, boolean isUnified, SurfaceAreaQuery saq, String platformBuildFile, Map<String, String> aprioriType){
- this.project = project;
- this.outfiles = outfiles;
- this.isUnified = isUnified;
- this.fvs = fvs;
- this.saq = saq;
- this.platformBuildFile = new File(platformBuildFile);
- this.aprioriType = aprioriType;
- }
-
- /**
- Generate build.out.xml file.
-
- @throws BuildException
- build.out.xml XML document create error
- **/
- public void genBuildFile() throws BuildException {
- DocumentBuilderFactory domfac = DocumentBuilderFactory.newInstance();
- try {
- DocumentBuilder dombuilder = domfac.newDocumentBuilder();
- Document document = dombuilder.newDocument();
- Comment rootComment = document.createComment(info);
- //
- // create root element and its attributes
- //
- Element root = document.createElement("project");
- root.setAttribute("name", project.getProperty("PLATFORM"));
- root.setAttribute("default", "all");
- root.setAttribute("basedir", ".");
-
- //
- // element for External ANT tasks
- //
- root.appendChild(document.createComment("Apply external ANT tasks"));
- Element ele = document.createElement("taskdef");
- ele.setAttribute("resource", "GenBuild.tasks");
- root.appendChild(ele);
-
- ele = document.createElement("taskdef");
- ele.setAttribute("resource", "frameworktasks.tasks");
- root.appendChild(ele);
-
- ele = document.createElement("taskdef");
- ele.setAttribute("resource", "net/sf/antcontrib/antlib.xml");
- root.appendChild(ele);
-
- ele = document.createElement("property");
- ele.setAttribute("environment", "env");
- root.appendChild(ele);
-
- //
- // Default Target
- //
- root.appendChild(document.createComment("Default target"));
- ele = document.createElement("target");
- ele.setAttribute("name", "all");
- ele.setAttribute("depends", "prebuild, modules, fvs, postbuild");
- root.appendChild(ele);
-
- //
- // Modules and Fvs Target
- //
- applyModules(document, root);
-
- applyFvs(document, root);
-
- //
- // Clean Target
- //
- applyClean(document, root);
-
- //
- // Deep Clean Target
- //
- applyCleanall(document, root);
-
- //
- // User Extension pre build
- //
- applyUserExtensionsPreBuild(document, root);
-
- //
- // User Extension Post build
- //
- applyUserExtensionsPostBuild(document, root);
- applyUserExtensions(document, root);
-
- document.appendChild(rootComment);
- document.appendChild(root);
- //
- // Prepare the DOM document for writing
- //
- Source source = new DOMSource(document);
- //
- // generate all directory path
- //
- (new File(platformBuildFile.getParent())).mkdirs();
- Result result = new StreamResult(platformBuildFile);
- //
- // Write the DOM document to the file
- //
- Transformer xformer = TransformerFactory.newInstance().newTransformer();
- xformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
- xformer.setOutputProperty(OutputKeys.INDENT, "yes");
- xformer.transform(source, result);
- } catch (Exception ex) {
- throw new BuildException("Generating platform build file [" + platformBuildFile.getPath() + "_build.xml] failed. \n" + ex.getMessage());
- }
- }
-
- /**
- 1. Get All valid Fv Image Names in sequence
- 2. For each FV, get modules by sequences
- 3. Get other modules
-
- @param document XML document
- @param root Node
- **/
- private void applyModules(Document document, Node root) {
- root.appendChild(document.createComment("Modules target"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "modules");
-
- //
- // Try to build apriori if necessary
- //
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++){
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++){
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = project.getProperty("BUILD_DIR") + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- Element fvEle = document.createElement("var");
- fvEle.setAttribute("name", "FV_DIR");
- fvEle.setAttribute("value", fvDir.getPath().replaceAll("(\\\\)", "/"));
- ele.appendChild(fvEle);
-
- Iterator<String> aprIter = aprioriType.keySet().iterator();
- while (aprIter.hasNext()) {
- String fvName = aprIter.next();
- Element moduleEle = document.createElement("Build_Apriori");
- moduleEle.setAttribute("FILENAME", fvName);
- moduleEle.setAttribute("GUID", aprioriType.get(fvName));
- ele.appendChild(moduleEle);
- }
- }
- }
-
- //
- // Get all valid FV name
- //
- String[] validFv = saq.getFpdValidImageNames();
-
- //
- // For each valid FV, get all modules in sequence
- //
- for (int i = 0; i < validFv.length; i++) {
- if (fvs.containsKey(validFv[i])) {
- Set<FpdModuleIdentification> set = fvs.get(validFv[i]);
- Iterator<FpdModuleIdentification> iter = set.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = iter.next();
- applySingleModule(document, ele, fpdModuleId);
- }
- }
- }
-
- //
- // Get all other modules
- //
- Iterator<String> fvsNameIter = fvs.keySet().iterator();
-
- while (fvsNameIter.hasNext()) {
- String fvName = fvsNameIter.next();
- if (!isContain(validFv, fvName)) {
- Set<FpdModuleIdentification> set = fvs.get(fvName);
- Iterator iter = set.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
- applySingleModule(document, ele, fpdModuleId);
- }
- }
- }
-
- root.appendChild(ele);
- }
-
- private void applySingleModule(Document document, Node root, FpdModuleIdentification fpdModuleId) {
- ModuleIdentification moduleId = fpdModuleId.getModule();
- Element moduleEle = document.createElement("GenBuild");
- moduleEle.setAttribute("type", "build");
- //
- // Inherit Properties.
- //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}
- //
-
- //
- // ARCH
- //
- Element property = document.createElement("property");
- property.setAttribute("name", "ARCH");
- property.setAttribute("value", fpdModuleId.getArch());
- moduleEle.appendChild(property);
-
- //
- // MODULE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_GUID");
- property.setAttribute("value", moduleId.getGuid());
- moduleEle.appendChild(property);
-
- //
- // MODULE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_VERSION");
- property.setAttribute("value", moduleId.getVersion());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_GUID");
- property.setAttribute("value", moduleId.getPackage().getGuid());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_VERSION");
- property.setAttribute("value", moduleId.getPackage().getVersion());
- moduleEle.appendChild(property);
-
- root.appendChild(moduleEle);
- }
-
- private boolean isContain(String[] list, String item) {
- for (int i = 0; i < list.length; i++) {
- if (list[i].equalsIgnoreCase(item)) {
- return true;
- }
- }
- return false;
- }
-
- private void applyFvs(Document document, Node root) {
- //
- // FVS Target
- //
- root.appendChild(document.createComment("FVs target"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "fvs");
-
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++){
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++){
- String fvOutputDir = project.getProperty("BUILD_DIR") + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j] + File.separatorChar + "FV";
- String[] validFv = saq.getFpdValidImageNames();
- for (int k = 0; k < validFv.length; k++) {
- String inputFile = fvOutputDir + "" + File.separatorChar + validFv[k].toUpperCase() + ".inf";
- Element fvEle = document.createElement("genfvimage");
- fvEle.setAttribute("infFile", inputFile);
- fvEle.setAttribute("outputDir", fvOutputDir);
- ele.appendChild(fvEle);
- }
- }
- }
- root.appendChild(ele);
- }
-
- private void applyClean(Document document, Node root) {
- //
- // Clean Target
- //
- root.appendChild(document.createComment("Clean target"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "clean");
-
- if (isUnified) {
- Element cleanEle = document.createElement("delete");
- cleanEle.setAttribute("includeemptydirs", "true");
- Element filesetEle = document.createElement("fileset");
- filesetEle.setAttribute("dir", project.getProperty("BUILD_DIR"));
- filesetEle.setAttribute("includes", "**\\OUTPUT\\**");
- cleanEle.appendChild(filesetEle);
- ele.appendChild(cleanEle);
- } else {
- Set set = outfiles.keySet();
- Iterator iter = set.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
- ModuleIdentification moduleId = fpdModuleId.getModule();
-
- Element ifEle = document.createElement("if");
- Element availableEle = document.createElement("available");
- availableEle.setAttribute("file", moduleId.getMsaFile().getParent() + File.separatorChar
- + "build.xml");
- ifEle.appendChild(availableEle);
- Element elseEle = document.createElement("then");
-
- Element moduleEle = document.createElement("ant");
- moduleEle.setAttribute("antfile", moduleId.getMsaFile().getParent() + File.separatorChar
- + "build.xml");
- moduleEle.setAttribute("target", "clean");
- //
- // Inherit Properties.
- //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}
- //
-
- //
- // ARCH
- //
- Element property = document.createElement("property");
- property.setAttribute("name", "ARCH");
- property.setAttribute("value", fpdModuleId.getArch());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE");
- property.setAttribute("value", moduleId.getPackage().getName());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_GUID");
- property.setAttribute("value", moduleId.getPackage().getGuid());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_VERSION");
- property.setAttribute("value", moduleId.getPackage().getVersion());
- moduleEle.appendChild(property);
-
- //
- // MODULE_DIR
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_DIR");
- property.setAttribute("value", moduleId.getMsaFile().getParent());
- moduleEle.appendChild(property);
- elseEle.appendChild(moduleEle);
- ifEle.appendChild(elseEle);
- ele.appendChild(ifEle);
- }
- }
- root.appendChild(ele);
- }
-
- private void applyCleanall(Document document, Node root) {
- //
- // Deep Clean Target
- //
- root.appendChild(document.createComment("Target: cleanall"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "cleanall");
-
- if (isUnified) {
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; ++i) {
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++) {
- Element cleanAllEle = document.createElement("delete");
- cleanAllEle.setAttribute("dir", project.getProperty("BUILD_DIR") + File.separatorChar + targetList[i] + "_" + toolchainList[j]);
- ele.appendChild(cleanAllEle);
- }
- }
- } else {
- Set set = outfiles.keySet();
- Iterator iter = set.iterator();
- while (iter.hasNext()) {
- FpdModuleIdentification fpdModuleId = (FpdModuleIdentification) iter.next();
- ModuleIdentification moduleId = fpdModuleId.getModule();
-
- Element ifEle = document.createElement("if");
- Element availableEle = document.createElement("available");
- availableEle.setAttribute("file", moduleId.getMsaFile().getParent() + File.separatorChar
- + "build.xml");
- ifEle.appendChild(availableEle);
- Element elseEle = document.createElement("then");
-
- Element moduleEle = document.createElement("ant");
- moduleEle.setAttribute("antfile", moduleId.getMsaFile().getParent() + File.separatorChar
- + "build.xml");
- moduleEle.setAttribute("target", "cleanall");
- //
- // Inherit Properties.
- //{"ARCH", "PACKAGE", "PACKAGE_GUID", "PACKAGE_VERSION", "MODULE_DIR"}
- //
-
- //
- // ARCH
- //
- Element property = document.createElement("property");
- property.setAttribute("name", "ARCH");
- property.setAttribute("value", fpdModuleId.getArch());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE");
- property.setAttribute("value", moduleId.getPackage().getName());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_GUID
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_GUID");
- property.setAttribute("value", moduleId.getPackage().getGuid());
- moduleEle.appendChild(property);
-
- //
- // PACKAGE_VERSION
- //
- property = document.createElement("property");
- property.setAttribute("name", "PACKAGE_VERSION");
- property.setAttribute("value", moduleId.getPackage().getVersion());
- moduleEle.appendChild(property);
-
- //
- // MODULE_DIR
- //
- property = document.createElement("property");
- property.setAttribute("name", "MODULE_DIR");
- property.setAttribute("value", moduleId.getMsaFile().getParent());
- moduleEle.appendChild(property);
- elseEle.appendChild(moduleEle);
- ifEle.appendChild(elseEle);
- ele.appendChild(ifEle);
- }
- }
- root.appendChild(ele);
- }
-
- private void applyUserExtensionsPreBuild(Document document, Node root) {
- //
- // User Extensions
- //
- root.appendChild(document.createComment("Pre-Build Processing"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "prebuild");
-
- Node node = saq.getFpdUserExtensionPreBuild();
- if (node != null) {
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++){
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++){
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = project.getProperty("BUILD_DIR") + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- Element fvEle = document.createElement("var");
- fvEle.setAttribute("name", "FV_DIR");
- fvEle.setAttribute("value", fvDir.getPath().replaceAll("(\\\\)", "/"));
- ele.appendChild(fvEle);
-
- Element targetDirEle = document.createElement("var");
- targetDirEle.setAttribute("name", "TARGET_DIR");
- targetDirEle.setAttribute("value", ffsCommonDir.replaceAll("(\\\\)", "/"));
- ele.appendChild(targetDirEle);
-
- NodeList childNodes = node.getChildNodes();
- for (int k = 0; k < childNodes.getLength(); k++) {
- Node childItem = childNodes.item(k);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- ele.appendChild(recursiveNode(childItem, document));
- }
- }
- }
- }
- }
-
- root.appendChild(ele);
- }
-
- private void applyUserExtensionsPostBuild(Document document, Node root) {
- //
- // User Extensions
- //
- root.appendChild(document.createComment("Post-Build Processing"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", "postbuild");
-
- Node node = saq.getFpdUserExtensionPostBuild();
- if (node != null) {
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++){
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++){
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = project.getProperty("BUILD_DIR") + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- Element fvEle = document.createElement("var");
- fvEle.setAttribute("name", "FV_DIR");
- fvEle.setAttribute("value", fvDir.getPath().replaceAll("(\\\\)", "/"));
- ele.appendChild(fvEle);
-
- Element targetDirEle = document.createElement("var");
- targetDirEle.setAttribute("name", "TARGET_DIR");
- targetDirEle.setAttribute("value", ffsCommonDir.replaceAll("(\\\\)", "/"));
- ele.appendChild(targetDirEle);
-
- NodeList childNodes = node.getChildNodes();
- for (int k = 0; k < childNodes.getLength(); k++) {
- Node childItem = childNodes.item(k);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- ele.appendChild(recursiveNode(childItem, document));
- }
- }
-
- }
- }
- }
-
- root.appendChild(ele);
- }
-
- private void applyUserExtensions(Document document, Node root) {
- Node[] nodeList = saq.getFpdUserExtensions();
- for (int nodeIndex = 0; nodeIndex < nodeList.length; ++nodeIndex) {
- Node node = nodeList[nodeIndex];
- //
- // User Extensions
- //
- root.appendChild(document.createComment("User Defined Target"));
- Element ele = document.createElement("target");
- ele.setAttribute("name", node.getAttributes().getNamedItem("Identifier").getNodeValue());
-
- if (node != null) {
- //
- // For every Target and ToolChain
- //
- String[] targetList = GlobalData.getToolChainInfo().getTargets();
- for (int i = 0; i < targetList.length; i++){
- String[] toolchainList = GlobalData.getToolChainInfo().getTagnames();
- for(int j = 0; j < toolchainList.length; j++){
- //
- // Prepare FV_DIR
- //
- String ffsCommonDir = project.getProperty("BUILD_DIR") + File.separatorChar
- + targetList[i] + "_"
- + toolchainList[j];
- File fvDir = new File(ffsCommonDir + File.separatorChar + "FV");
- Element fvEle = document.createElement("var");
- fvEle.setAttribute("name", "FV_DIR");
- fvEle.setAttribute("value", fvDir.getPath().replaceAll("(\\\\)", "/"));
- ele.appendChild(fvEle);
-
- Element targetDirEle = document.createElement("var");
- targetDirEle.setAttribute("name", "TARGET_DIR");
- targetDirEle.setAttribute("value", ffsCommonDir.replaceAll("(\\\\)", "/"));
- ele.appendChild(targetDirEle);
-
- NodeList childNodes = node.getChildNodes();
- for (int k = 0; k < childNodes.getLength(); k++) {
- Node childItem = childNodes.item(k);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- ele.appendChild(recursiveNode(childItem, document));
- }
- }
-
- }
- }
- }
-
- root.appendChild(ele);
- }
- }
-
- private Element recursiveNode(Node node, Document document) {
- Element root = document.createElement(node.getNodeName());
- NamedNodeMap attr = node.getAttributes();
- for (int i = 0; i < attr.getLength(); i++) {
- Node attrItem = attr.item(i);
- root.setAttribute(attrItem.getNodeName(), attrItem.getNodeValue());
- }
- NodeList childNodes = node.getChildNodes();
- for (int i = 0; i < childNodes.getLength(); i++) {
- Node childItem = childNodes.item(i);
- if (childItem.getNodeType() == Node.ELEMENT_NODE) {
- root.appendChild(recursiveNode(childItem, document));
- }
- else if (childItem.getNodeType() == Node.TEXT_NODE){
- if (!childItem.getNodeValue().trim().equalsIgnoreCase("")) {
- root.setTextContent(childItem.getNodeValue());
- }
- }
- }
- return root;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFile.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFile.java
deleted file mode 100644
index af6590f5b6..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFile.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/** @file
-This file is used to define class which represents dependency file in ANT task
-
-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.
-
-**/
-package org.tianocore.build.global;
-
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.Path;
-import org.apache.tools.ant.BuildException;
-
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-import java.io.LineNumberReader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-/**
- DpFile is a ANT DataType which can be used to specify dependency files from
- a file list file, from file list string separated by space, comma or semi-comma,
- or from file name with absolute path
- **/
-public class DpFile extends DataType {
- ///
- /// keep the list of files path
- ///
- private List<String> nameList = new ArrayList<String>();
-
- /**
- Empty constructor just in case
- **/
- public DpFile() {
- }
-
- /**
- Empty execute method of ANT task, just in case
- **/
- public void execute() {
- }
-
- /**
- Standard set method of ANT task/datatype, for ListFile attribute. It simply
- fetch one file path a line from specified list file, and put them in nameList
-
- @param fileListFile file which contains a file list, one file a line,
- with full path
- **/
- public void setListFile(String fileListFile) {
- File file = new File(fileListFile);
- if (!file.exists()) {
- return;
- }
-
- try {
- FileReader fileReader = new FileReader(file);
- LineNumberReader lineReader = new LineNumberReader(fileReader);
-
- String filePath = null;
- while ((filePath = lineReader.readLine()) != null) {
- filePath = filePath.trim();
- if (filePath.length() == 0) {
- continue;
- }
- this.nameList.add(filePath);
- }
-
- lineReader.close();
- fileReader.close();
- } catch (IOException e) {
- throw new BuildException(e.getMessage());
- }
- }
-
- /**
- Standard set method of ANT task/datatype, for List attribute.
-
- @param fileList string with file pathes separated by space, comma,
- or semi-comma
- **/
- public void setList(String fileList) {
- //
- // space, comma or semi-comma separated files list
- //
- Pattern pattern = Pattern.compile("([^ ,;\n\r]++)[ ,;\n\r]*+");
- Matcher matcher = pattern.matcher(fileList);
-
- while (matcher.find()) {
- //
- // keep each file name before " ,;\n\r"
- //
- String filePath = fileList.substring(matcher.start(1), matcher.end(1)).trim();
- if (filePath.length() == 0) {
- continue;
- }
- nameList.add(Path.translateFile(filePath));
- }
-
- }
-
- /**
- Standard set method of ANT task/datatype, for Name attribute.
-
- @param fileName string of a file full path
- **/
- public void setName(String fileName) {
- this.nameList.add(fileName);
- }
-
- /**
- Fetch the file name list.
-
- @returns A string list which contains file names specified to check dependnecy
- **/
- public List<String> getList() {
- return this.nameList;
- }
-}
-
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFileList.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFileList.java
deleted file mode 100644
index dd032526d8..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/DpFileList.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/** @file
-This file is used to nest elements corresponding to DpFile
-
-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.
-
-**/
-package org.tianocore.build.global;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.tools.ant.DirectoryScanner;
-import org.apache.tools.ant.types.DataType;
-import org.apache.tools.ant.types.FileSet;
-
-/**
- DpFileList is a container of Dpfile at the point of ANT task/datatype
- **/
-public class DpFileList extends DataType {
- ///
- /// Keep all the file names from all nested DpFile
- ///
- List<String> nameList = new ArrayList<String>();
-
- /**
- Empty constructor just in case
- **/
- public DpFileList() {
- }
-
- /**
- Empty execute method of ANT task. ANT will call it even we don't need it.
- **/
- public void execute() {
- }
-
- /**
- Standard add method of ANT task, for nested DpFile type of elements. It just
- simply fetch the files list from DpFile and put them in its own nameList.
-
- @param f a DpFile object which will be instantiated by ANT
- **/
- public void addConfiguredFile(DpFile f) {
- this.nameList.addAll(f.getList());
- }
-
- public void addConfiguredFileSet(FileSet fileSet) {
- DirectoryScanner ds = fileSet.getDirectoryScanner(getProject());
- String dir = fileSet.getDir(getProject()).getAbsolutePath();
- String[] files = ds.getIncludedFiles();
-
- for (int i = 0; i < files.length; ++i) {
- nameList.add(dir + "/" + files[i]);
- }
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
deleted file mode 100644
index b1e119a501..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GenBuildLogger.java
+++ /dev/null
@@ -1,283 +0,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.
-
- Module Name:
- GenBuildLogger.java
-
- Abstract:
-
- --*/
-
-package org.tianocore.build.global;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.apache.tools.ant.BuildEvent;
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.DefaultLogger;
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.util.StringUtils;
-
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.common.logger.EdkLog;
-import org.tianocore.common.logger.LogMethod;
-
-public class GenBuildLogger extends DefaultLogger implements LogMethod {
-
- Project project = null;
-
- ///
- /// flag to present whether cache all msg or not
- /// true means to cache.
- ///
- private static boolean flag = false;
-
- private static Map<FpdModuleIdentification, List<String>> map = new LinkedHashMap<FpdModuleIdentification, List<String> >(256);
-
- private FpdModuleIdentification id = null;
- //
- // semaroph for multi thread
- //
- public static Object semaphore = new Object();
-
- public GenBuildLogger () {
-
- }
-
- public GenBuildLogger (Project project) {
- this.project = project;
- }
-
- /**
- Rules: flag = false: means no cache Action: Print it to console
-
- flag = true: mean cache all msg exception some special Action: loglevel
- is EDK_ALWAYS -- Print but no cache loglevel is EDK_ERROR -- Print and
- cache the msg others -- No print and cache the msg
- **/
- public synchronized void putMessage(Object msgSource, int msgLevel, String msg) {
- if (this.project == null) {
- return;
- }
-
- //
- // If msgLevel is always print, then print it
- //
- switch (msgLevel) {
- case EdkLog.EDK_ALWAYS:
- //
- // Do some special
- //
- log(msgSource, msg, Project.MSG_ERR);
- break;
- case EdkLog.EDK_ERROR:
- log(msgSource, msg, Project.MSG_ERR);
- break;
- case EdkLog.EDK_WARNING:
- log(msgSource, msg, Project.MSG_WARN);
- break;
- case EdkLog.EDK_INFO:
- log(msgSource, msg, Project.MSG_INFO);
- break;
- case EdkLog.EDK_VERBOSE:
- log(msgSource, msg, Project.MSG_VERBOSE);
- break;
- case EdkLog.EDK_DEBUG:
- log(msgSource, msg, Project.MSG_DEBUG);
- break;
- }
- }
-
- public static void flushErrorModuleLog(FpdModuleIdentification errorModuleId) {
- List<String> errorLogs = map.get(errorModuleId);
- if (errorLogs != null) {
- EdkLog.log("ErrorLog", EdkLog.EDK_ERROR, errorModuleId + " error logs: ");
- for(int i = 0; i < errorLogs.size(); i++) {
- EdkLog.log(EdkLog.EDK_ERROR, errorLogs.get(i));
- }
- }
- }
-
- public void flushToFile(File file) {
- //
- // Put all messages in map to file
- //
- String msg = "Writing log to file [" + file.getPath() + "]";
- log("Logging", msg, Project.MSG_INFO);
- try {
- BufferedWriter bw = new BufferedWriter(new FileWriter(file));
- Iterator<FpdModuleIdentification> iter = map.keySet().iterator();
- List<String> mainLogs = null;
- while (iter.hasNext()) {
- FpdModuleIdentification item = iter.next();
- if(item == null) {
- mainLogs = map.get(item);
- continue ;
- }
- bw.write(">>>>>>>>>>>>>");
- bw.write(" " + item + " Build Log ");
- bw.write(">>>>>>>>>>>>>");
- bw.newLine();
- List<String> allMessages = map.get(item);
- for(int i = 0; i < allMessages.size(); i++) {
- bw.write(allMessages.get(i));
- bw.newLine();
- }
- }
- if (mainLogs != null) {
- bw.write(">>>>>>>>>>>>>");
- bw.write(" Main Logs (already print to command) ");
- bw.write(">>>>>>>>>>>>>");
- bw.newLine();
- for(int i = 0; i < mainLogs.size(); i++) {
- bw.write(mainLogs.get(i));
- bw.newLine();
- }
- }
- bw.flush();
- bw.close();
- } catch (IOException e) {
- new BuildException("Writing log error. " + e.getMessage());
- }
-
- }
-
- private void log(Object msgSource, String msg, int level) {
- if (msgSource instanceof Task) {
- ((Task)msgSource).getProject().log((Task)msgSource, msg, level);
- } else if (msgSource instanceof String){
- //
- // Pad 12 space to keep message in unify format
- //
- msg = msg.replaceAll("\n", "\n ");
- this.project.log(String.format("%12s", "[" + msgSource + "] ") + msg, level);
- } else {
- this.project.log(msg, level);
- }
- }
- public void targetStarted(BuildEvent event) {
- if (!flag) {
- super.targetStarted(event);
- }
- }
-
- public void messageLogged(BuildEvent event) {
-
- int currentLevel = event.getPriority();
- //
- // If current level is upper than Ant Level, skip it
- //
- if (currentLevel <= this.msgOutputLevel) {
- String originalMessage = event.getMessage();
-
- StringBuffer message = new StringBuffer();
- if (!emacsMode && event.getTask() != null) {
- String label = String.format("%12s", "[" + event.getTask().getTaskName() + "] ");
- //
- // Append label first
- //
- message.append(label);
-
- //
- // Format all output message's line separator
- //
- try {
- BufferedReader r = new BufferedReader(new StringReader(originalMessage));
- boolean ifFirstLine = true;
- String line = null;
- while ((line = r.readLine()) != null) {
- if (!ifFirstLine) {
- message.append(StringUtils.LINE_SEP);
- }
- ifFirstLine = false;
- message.append(line);
- }
- } catch (IOException e) {
- message.append(originalMessage);
- }
- } else {
- message.append(originalMessage);
- }
-
- String msg = message.toString();
- if (currentLevel == Project.MSG_ERR) {
- printMessage(msg, err, currentLevel);
- } else if(currentLevel == Project.MSG_WARN) {
- printMessage(msg, out, currentLevel);
- } else if(!flag) {
- printMessage(msg, out, currentLevel);
- }
- log(msg);
- }
- }
-
- public static void setCacheEnable(boolean enable) {
- flag = enable;
- }
-
- protected synchronized void log(String message) {
- //
- // cache log
- //
- if (map.containsKey(this.id)) {
- map.get(this.id).add(message);
- } else {
- List<String> list = new Vector<String>(1024);
- list.add(message);
- map.put(this.id, list);
- }
- }
-
- public Object clone() {
- GenBuildLogger newLogger = new GenBuildLogger();
- //
- // Transfer emacs mode, out, err, level to new Logger
- //
- newLogger.setEmacsMode(this.emacsMode);
- newLogger.setOutputPrintStream(this.out);
- newLogger.setErrorPrintStream(this.err);
- newLogger.setMessageOutputLevel(this.msgOutputLevel);
-
- //
- // Transfer project
- //
- newLogger.project = this.project;
- return newLogger;
- }
-
- public void setId(FpdModuleIdentification id) {
- this.id = id;
- }
-
- public void buildFinished(BuildEvent event) {
- if (this.msgOutputLevel >= Project.MSG_VERBOSE) {
- int level = this.msgOutputLevel;
- synchronized(semaphore){
- this.msgOutputLevel = this.msgOutputLevel - 1;
- super.buildFinished(event);
- this.msgOutputLevel = level;
- }
- } else {
- super.buildFinished(event);
- }
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
deleted file mode 100644
index b5605d4cb1..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/GlobalData.java
+++ /dev/null
@@ -1,948 +0,0 @@
-/** @file
- GlobalData class.
-
- GlobalData provide initializing, instoring, querying and update global data.
- It is a bridge to intercommunicate between multiple component, such as AutoGen,
- PCD and so on.
-
-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.
-**/
-package org.tianocore.build.global;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.tools.ant.Project;
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.tianocore.DbPathAndFilename;
-import org.tianocore.FrameworkDatabaseDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.ModuleSurfaceAreaDocument.ModuleSurfaceArea;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.id.PlatformIdentification;
-import org.tianocore.build.toolchain.ToolChainConfig;
-import org.tianocore.build.toolchain.ToolChainElement;
-import org.tianocore.build.toolchain.ToolChainInfo;
-import org.tianocore.build.toolchain.ToolChainKey;
-import org.tianocore.build.toolchain.ToolChainMap;
-import org.tianocore.common.definitions.ToolDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.tianocore.common.logger.EdkLog;
-import org.tianocore.pcd.entity.MemoryDatabaseManager;
-
-/**
- GlobalData provide initializing, instoring, querying and update global data.
- It is a bridge to intercommunicate between multiple component, such as AutoGen,
- PCD and so on.
-
- <p>Note that all global information are initialized incrementally. All data will
- parse and record only of necessary during build time. </p>
-
- @since GenBuild 1.0
-**/
-public class GlobalData {
- ///
- /// Record current WORKSPACE Directory
- ///
- private static String workspaceDir = "";
-
- ///
- /// Be used to ensure Global data will be initialized only once.
- ///
- private static boolean globalFlag = false;
-
- ///
- /// Framework Database information: package list and platform list
- ///
- private static Set<PackageIdentification> packageList = new HashSet<PackageIdentification>();
-
- private static Set<PlatformIdentification> platformList = new HashSet<PlatformIdentification>();
-
- ///
- /// Every detail SPD informations: Module list, Library class definition,
- /// Package header file, GUID/PPI/Protocol definitions
- ///
- private static final Map<PackageIdentification, Spd> spdTable = new HashMap<PackageIdentification, Spd>();
-
- ///
- /// Build informations are divided into three parts:
- /// 1. From MSA 2. From FPD 3. From FPD' ModuleSA
- ///
- private static Map<ModuleIdentification, Map<String, XmlObject>> nativeMsa = new HashMap<ModuleIdentification, Map<String, XmlObject>>();
-
- private static Map<FpdModuleIdentification, Map<String, XmlObject>> fpdModuleSA= new HashMap<FpdModuleIdentification, Map<String, XmlObject>>();
-
- private static Map<String, XmlObject> fpdBuildOptionsMap = new HashMap<String, XmlObject>();
-
- private static XmlObject fpdBuildOptions;
-
- private static XmlObject fpdDynamicPcds;
-
- ///
- /// Parsed modules list
- ///
- private static Map<FpdModuleIdentification, Map<String, XmlObject>> parsedModules = new HashMap<FpdModuleIdentification, Map<String, XmlObject>>();
-
- ///
- /// built modules list with ARCH, TARGET, TOOLCHAIN
- ///
- private static Set<FpdModuleIdentification> builtModules = new HashSet<FpdModuleIdentification>();
-
- ///
- /// PCD memory database stored all PCD information which collected from FPD,MSA and SPD.
- ///
- private static final MemoryDatabaseManager pcdDbManager = new MemoryDatabaseManager();
-
- ///
- /// build target + tool chain family/tag name + arch + command types + command options
- ///
- ///
- /// Tool Chain Data
- /// toolsDef - build tool program information
- /// fpdBuildOption - all modules's build options for tool tag or tool chain families
- /// moduleSaBuildOption - build options for a specific module
- ///
- private static ToolChainConfig toolsDef;
-
- private static ToolChainInfo toolChainInfo;
- private static ToolChainInfo toolChainEnvInfo;
- private static ToolChainInfo toolChainPlatformInfo;
-
- private static ToolChainMap platformToolChainOption;
- private static ToolChainMap platformToolChainFamilyOption;
-
- private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
- private static Map<FpdModuleIdentification, ToolChainMap> moduleToolChainFamilyOption = new HashMap<FpdModuleIdentification, ToolChainMap>();
-
- private static Map<ModuleIdentification, ToolChainMap> msaBuildOption = new HashMap<ModuleIdentification, ToolChainMap>();
- private static Map<ModuleIdentification, ToolChainMap> msaFamilyBuildOption = new HashMap<ModuleIdentification, ToolChainMap>();
-
- /**
- Parse framework database (DB) and all SPD files listed in DB to initialize
- the environment for next build. This method will only be executed only once
- in the whole build process.
-
- @param workspaceDatabaseFile the file name of framework database
- @param workspaceDir current workspace directory path
- @throws BuildException
- Framework Dababase or SPD or MSA file is not valid
- **/
- public synchronized static void initInfo(Project prj, String workspaceDatabaseFile, String workspaceDir, String toolsDefFilename ) throws EdkException {
- //
- // ensure this method will be revoked only once
- //
- if (globalFlag) {
- return;
- }
- globalFlag = true;
-
- //
- // Backup workspace directory. It will be used by other method
- //
- GlobalData.workspaceDir = workspaceDir.replaceAll("(\\\\)", "/");
-
- //
- // Parse tools definition file
- //
- //
- // If ToolChain has been set up before, do nothing.
- // CONF dir + tools definition file name
- //
- File toolsDefFile = new File(workspaceDir + File.separatorChar + toolsDefFilename);
- EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Using tool definition file [" + toolsDefFile.getPath() + "].");
- toolsDef = new ToolChainConfig(prj, toolsDefFile);
-
- //
- // Parse Framework Database
- //
- File dbFile = new File(workspaceDir + File.separatorChar + workspaceDatabaseFile);
- FrameworkDatabaseDocument db = null;
- try {
- db = (FrameworkDatabaseDocument)parseXmlFile(dbFile);
- //
- // Get package list
- //
- if (db.getFrameworkDatabase().getPackageList() != null ) {
- List<DbPathAndFilename> packages = db.getFrameworkDatabase().getPackageList().getFilenameList();
- Iterator<DbPathAndFilename> iter = packages.iterator();
- while (iter.hasNext()) {
- String fileName = iter.next().getStringValue().trim();
- Spd spd = new Spd(new File(workspaceDir + File.separatorChar + fileName));
- packageList.add(spd.getPackageId());
- //
- // Report warning if existing two packages with same GUID and Version
- //
- if (spdTable.containsKey(spd.getPackageId())) {
- //
- // BUGBUG
- //
- EdkLog.log("Init", EdkLog.EDK_WARNING, "Warning: Existing two packages with same GUID and Version. They are ... " + spd.getPackageId().getSpdFile().getPath());
- }
- spdTable.put(spd.getPackageId(), spd);
- }
- }
- } catch(IOException ex) {
- EdkException edkException = new EdkException("Parse of WORKSPACE Database file [" + dbFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- } catch(XmlException ex) {
- EdkException edkException = new EdkException("Parse of WORKSPACE Database file [" + dbFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- }
-
- File fpdFile = null;
- try {
- //
- // Get platform list
- //
- if (db.getFrameworkDatabase().getPlatformList() != null) {
- List<DbPathAndFilename> platforms = db.getFrameworkDatabase().getPlatformList().getFilenameList();
- Iterator<DbPathAndFilename> iter = platforms.iterator();
- while (iter.hasNext()) {
- String fileName = iter.next().getStringValue().trim();
- fpdFile = new File(workspaceDir + File.separatorChar + fileName);
- if ( !fpdFile.exists() ) {
- throw new EdkException("Platform file [" + fpdFile.getPath() + "] not exists. ");
- }
- XmlObject fpdDoc = parseXmlFile(fpdFile);
- //
- // We can change Map to XmlObject
- //
- Map<String, XmlObject> fpdDocMap = new HashMap<String, XmlObject>();
- fpdDocMap.put("PlatformSurfaceArea", fpdDoc);
- SurfaceAreaQuery saq = new SurfaceAreaQuery(fpdDocMap);
- PlatformIdentification platformId = saq.getFpdHeader();
- platformId.setFpdFile(fpdFile);
- //
- // Report warning if existing two platfrom with same GUID and Version
- //
- if (platformList.contains(platformId)) {
- //
- // BUGBUG
- //
- EdkLog.log("Init", EdkLog.EDK_WARNING, "Warning: Existing two platforms with same GUID and Version. They are ... " + fpdFile.getPath());
- }
- platformList.add(platformId);
- }
- }
- } catch(IOException ex) {
- EdkException edkException = new EdkException("Parse of platform definition file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- } catch(XmlException ex) {
- EdkException edkException = new EdkException("Parse of platform definition file [" + fpdFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- }
- }
-
- /**
- Get the current WORKSPACE Directory.
-
- @return current workspace directory
- **/
- public synchronized static String getWorkspacePath() {
- return workspaceDir;
- }
-
-
- /**
- Get the MSA file name with absolute path
- */
- public synchronized static File getMsaFile(ModuleIdentification moduleId) throws EdkException {
- File msaFile = null;
- //
- // TBD. Do only when package is null.
- //
- Iterator iter = packageList.iterator();
- while (iter.hasNext()) {
- PackageIdentification packageId = (PackageIdentification)iter.next();
- Spd spd = spdTable.get(packageId);
- msaFile = spd.getModuleFile(moduleId);
- if (msaFile != null ) {
- break ;
- }
- }
- if (msaFile == null){
- throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any SPD package!");
- } else {
- return msaFile;
- }
- }
-
- public synchronized static PackageIdentification getPackageForModule(ModuleIdentification moduleId) throws EdkException {
- //
- // If package already defined in module
- //
- if (moduleId.getPackage() != null) {
- return moduleId.getPackage();
- }
-
- PackageIdentification packageId = null;
- Iterator iter = packageList.iterator();
- while (iter.hasNext()) {
- PackageIdentification pid = (PackageIdentification)iter.next();
- moduleId.setPackage(pid);
- Spd spd = spdTable.get(pid);
- File tempMsaFile = null;
- if ((tempMsaFile = spd.getModuleFile(moduleId)) != null ) {
- if (tempMsaFile.getParent().equalsIgnoreCase(moduleId.getMsaFile().getParent())) {
- packageId = pid;
- break ;
- }
- tempMsaFile = null;
- }
- }
- if (packageId == null){
- throw new EdkException("Can't find Module [" + moduleId.getName() + "] in any package!");
- } else {
- return packageId;
- }
- }
-
- /**
- Difference between build and parse: ToolChain and Target
- **/
- public synchronized static boolean isModuleBuilt(FpdModuleIdentification moduleId) {
- return builtModules.contains(moduleId);
- }
-
- public synchronized static void registerBuiltModule(FpdModuleIdentification fpdModuleId) {
- builtModules.add(fpdModuleId);
- }
-
-
- public synchronized static void registerFpdModuleSA(FpdModuleIdentification fpdModuleId, Map<String, XmlObject> doc) throws EdkException{
- Map<String, XmlObject> result = new HashMap<String, XmlObject>();
- Set keySet = doc.keySet();
- Iterator iter = keySet.iterator();
- while (iter.hasNext()){
- String key = (String)iter.next();
- XmlObject item = cloneXmlObject(doc.get(key), true);
- result.put(key, item);
- }
- fpdModuleSA.put(fpdModuleId, result);
- }
-
- public synchronized static boolean hasFpdModuleSA(FpdModuleIdentification fpdModuleId) {
- return fpdModuleSA.containsKey(fpdModuleId);
- }
-
- /**
- Query module surface area information.
-
- <p>Note that surface area parsing is incremental. That means the method will
- only parse the MSA files if necessary. </p>
-
- @param fpdModuleId Module ID with arch
- @return ModuleSA info and MSA info for fpdModuleId
- @throws BuildException Can't find MSA
- **/
- public synchronized static Map<String, XmlObject> getDoc(FpdModuleIdentification fpdModuleId) throws EdkException{
- if (parsedModules.containsKey(fpdModuleId)) {
- return parsedModules.get(fpdModuleId);
- }
- Map<String, XmlObject> doc = new HashMap<String, XmlObject>();
- ModuleIdentification moduleId = fpdModuleId.getModule();
- //
- // First part: get the MSA files info
- //
- doc.putAll(getNativeMsa(moduleId));
-
- //
- // Second part: put build options
- //
- doc.put("BuildOptions", fpdBuildOptions);
-
- //
- // Third part: get Module info from FPD, such as Library instances, PCDs
- //
- if (fpdModuleSA.containsKey(fpdModuleId)){
- //
- // merge module info in FPD to final Doc
- // For Library Module, do nothing here
- //
- doc.putAll(fpdModuleSA.get(fpdModuleId));
- }
- parsedModules.put(fpdModuleId, doc);
- return doc;
- }
-
- public synchronized static Map<String, XmlObject> getDoc(ModuleIdentification moduleId, String arch) throws EdkException{
- FpdModuleIdentification fpdModuleId = new FpdModuleIdentification(moduleId, arch);
- return getDoc(fpdModuleId);
- }
-
- /**
- Query the native MSA information with module base name.
-
- <p>Note that MSA parsing is incremental. That means the method will
- only to parse the MSA files when never parsed before. </p>
-
- @param moduleName the base name of the module
- @return the native MSA information
- @throws BuildException
- MSA file is not valid
- **/
- public synchronized static Map<String, XmlObject> getNativeMsa(ModuleIdentification moduleId) throws EdkException {
- if (nativeMsa.containsKey(moduleId)) {
- return nativeMsa.get(moduleId);
- }
- File msaFile = getMsaFile(moduleId);
- Map<String, XmlObject> msaMap = getNativeMsa(msaFile);
- nativeMsa.put(moduleId, msaMap);
- return msaMap;
- }
-
- public synchronized static Map<String, XmlObject> getNativeMsa(File msaFile) throws EdkException {
- if (!msaFile.exists()) {
- throw new EdkException("Module Surface Area file [" + msaFile.getPath() + "] can't be found!");
- }
- try {
- ModuleSurfaceAreaDocument doc = (ModuleSurfaceAreaDocument)parseXmlFile(msaFile);
- //
- // parse MSA file
- //
- ModuleSurfaceArea msa= doc.getModuleSurfaceArea();
- Map<String, XmlObject> msaMap = new HashMap<String, XmlObject>();
- msaMap.put("MsaHeader", cloneXmlObject(msa.getMsaHeader(), true));
- msaMap.put("ModuleDefinitions", cloneXmlObject(msa.getModuleDefinitions(), true));
- msaMap.put("LibraryClassDefinitions", cloneXmlObject(msa.getLibraryClassDefinitions(), true));
- msaMap.put("SourceFiles", cloneXmlObject(msa.getSourceFiles(), true));
- msaMap.put("PackageDependencies", cloneXmlObject(msa.getPackageDependencies(), true));
- msaMap.put("Protocols", cloneXmlObject(msa.getProtocols(), true));
- msaMap.put("PPIs", cloneXmlObject(msa.getPPIs(), true));
- msaMap.put("Guids", cloneXmlObject(msa.getGuids(), true));
- msaMap.put("Events", cloneXmlObject(msa.getEvents(), true));
- msaMap.put("Hobs", cloneXmlObject(msa.getHobs(), true));
- msaMap.put("Variables", cloneXmlObject(msa.getVariables(), true));
- msaMap.put("SystemTables", cloneXmlObject(msa.getSystemTables(), true));
- msaMap.put("DataHubs", cloneXmlObject(msa.getDataHubs(), true));
- msaMap.put("HiiPackages", cloneXmlObject(msa.getHiiPackages(), true));
- msaMap.put("Externs", cloneXmlObject(msa.getExterns(), true));
- msaMap.put("PcdCoded", cloneXmlObject(msa.getPcdCoded(), true));
- msaMap.put("ModuleBuildOptions", cloneXmlObject(msa.getModuleBuildOptions(), true));
- return msaMap;
- } catch(IOException ex) {
- EdkException edkException = new EdkException("Parse of MSA file [" + msaFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- } catch(XmlException ex) {
- EdkException edkException = new EdkException("Parse of MSA file [" + msaFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- }
- }
-
- public static Map<String, XmlObject> getFpdBuildOptionsMap() {
- return fpdBuildOptionsMap;
- }
-
- public static void setFpdBuildOptions(XmlObject fpdBuildOptions) throws EdkException {
- GlobalData.fpdBuildOptions = cloneXmlObject(fpdBuildOptions, true);
- fpdBuildOptionsMap.put("BuildOptions", GlobalData.fpdBuildOptions);
- }
-
- public static XmlObject getFpdDynamicPcds() {
- return fpdDynamicPcds;
- }
-
- public static void setFpdDynamicPcds(XmlObject fpdDynamicPcds) {
- GlobalData.fpdDynamicPcds = fpdDynamicPcds;
- }
-
- public static Set<ModuleIdentification> getModules(PackageIdentification packageId){
- Spd spd = spdTable.get(packageId);
- if (spd == null ) {
- Set<ModuleIdentification> dummy = new HashSet<ModuleIdentification>();
- return dummy;
- } else {
- return spd.getModules();
- }
- }
-
- /**
- * The header file path is relative to workspace dir
- */
- public static String[] getLibraryClassHeaderFiles(
- PackageIdentification[] packages, String name) throws EdkException{
- if (packages == null) {
- // throw Exception or not????
- return new String[0];
- }
- String[] result = null;
- for (int i = 0; i < packages.length; i++) {
- Spd spd = spdTable.get(packages[i]);
- //
- // If find one package defined the library class
- //
- if ((result = spd.getLibClassIncluder(name)) != null) {
- return result;
- }
- }
- //
- // If can't find library class declaration in every package
- //
- throw new EdkException("Can not find library class [" + name
- + "] declaration in any SPD package!");
- }
-
- /**
- * The header file path is relative to workspace dir
- */
- public static String getPackageHeaderFiles(PackageIdentification packages,
- String moduleType) {
- if (packages == null) {
- return new String("");
- }
- Spd spd = spdTable.get(packages);
- //
- // If can't find package header file, skip it
- //
- String temp = null;
- if (spd != null) {
- if ((temp = spd.getPackageIncluder(moduleType)) != null) {
- return temp;
- } else {
- temp = "";
- return temp;
- }
- } else {
- return null;
- }
- }
-
- /**
- * return two values: {cName, GuidValue}
- */
- public static String[] getGuid(List<PackageIdentification> packages, String name) {
- if (packages == null) {
- // throw Exception or not????
- return new String[0];
- }
- String[] result = null;
- Iterator item = packages.iterator();
- while (item.hasNext()){
- Spd spd = spdTable.get(item.next());
- //
- // If find one package defined the GUID
- //
- if ((result = spd.getGuid(name)) != null) {
- return result;
- }
- }
-
- return null;
- }
-
- /**
- * return two values: {cName, GuidValue}
- */
- public static String[] getPpiGuid(List<PackageIdentification> packages,
- String name) {
- if (packages == null) {
- return new String[0];
- }
- String[] result = null;
- Iterator item = packages.iterator();
- while (item.hasNext()){
- Spd spd = spdTable.get(item.next());
- //
- // If find one package defined the Ppi GUID
- //
- if ((result = spd.getPpi(name)) != null) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * return two values: {cName, GuidValue}
- */
- public static String[] getProtocolGuid(List<PackageIdentification> packages,
- String name) {
- if (packages == null) {
- return new String[0];
- }
- String[] result = null;
- Iterator item = packages.iterator();
- while (item.hasNext()){
- Spd spd = spdTable.get(item.next());
- //
- // If find one package defined the protocol GUID
- //
- if ((result = spd.getProtocol(name))!= null){
- return result;
- }
- }
- return null;
-
- }
-
- public synchronized static PlatformIdentification getPlatformByName(String name) throws EdkException {
- Iterator iter = platformList.iterator();
- while(iter.hasNext()){
- PlatformIdentification platformId = (PlatformIdentification)iter.next();
- if (platformId.getName().equalsIgnoreCase(name)) {
- return platformId;
- }
- }
- throw new EdkException("Can't find platform [" + name + "] in the current WORKSPACE database!");
- }
-
- public synchronized static PlatformIdentification getPlatform(String filename) throws EdkException {
- File file = new File(workspaceDir + File.separatorChar + filename);
- Iterator iter = platformList.iterator();
- while(iter.hasNext()){
- PlatformIdentification platformId = (PlatformIdentification)iter.next();
- if (platformId.getFpdFile().getPath().equalsIgnoreCase(file.getPath())) {
- return platformId;
- }
- }
- throw new EdkException("Can't find platform file [" + filename + "] in the current WORKSPACE database!");
- }
-
- public synchronized static PackageIdentification refreshPackageIdentification(PackageIdentification packageId) throws EdkException {
- Iterator iter = packageList.iterator();
- while(iter.hasNext()){
- PackageIdentification packageItem = (PackageIdentification)iter.next();
- if (packageItem.equals(packageId)) {
- packageId.setName(packageItem.getName());
- packageId.setSpdFile(packageItem.getSpdFile());
- return packageId;
- }
- }
- throw new EdkException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");
- }
-
- public synchronized static ModuleIdentification refreshModuleIdentification(ModuleIdentification moduleId) throws EdkException {
- PackageIdentification packageId = getPackageForModule(moduleId);
- moduleId.setPackage(packageId);
- Spd spd = spdTable.get(packageId);
- if (spd == null) {
- throw new EdkException("Can't find package GUID value " + packageId.toGuidString() + " in the current workspace!");
- }
- Set<ModuleIdentification> modules = spd.getModules();
- Iterator<ModuleIdentification> iter = modules.iterator();
- while (iter.hasNext()) {
- ModuleIdentification item = iter.next();
- if (item.equals(moduleId)) {
- moduleId.setName(item.getName());
- moduleId.setModuleType(item.getModuleType());
- moduleId.setMsaFile(item.getMsaFile());
- return moduleId;
- }
- }
- throw new EdkException("Can't find " + moduleId + " under the current workspace!");
- }
-
- public synchronized static Set<PackageIdentification> getPackageList(){
- return packageList;
- }
-
- /**
- BUGBUG: It is a walk around method. If do not clone, can't query info with
- XPath correctly.
-
- @param object XmlObject
- @param deep flag for deep clone
- @return XmlObject after clone
- @throws BuildException parse original XmlObject error.
- **/
- private static XmlObject cloneXmlObject(XmlObject object, boolean deep) throws EdkException {
- if ( object == null) {
- return null;
- }
- XmlObject result = null;
- try {
- result = XmlObject.Factory.parse(object.getDomNode()
- .cloneNode(deep));
- } catch (XmlException ex) {
- EdkException edkException = new EdkException(ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- }
- return result;
- }
-
- ///
- /// Tool Chain Related, try to refine and put some logic process to ToolChainFactory
- ///
- public synchronized static ToolChainInfo getToolChainInfo() {
- if (toolChainInfo == null) {
- toolChainInfo = toolsDef.getConfigInfo().intersection(toolChainEnvInfo);
- if (toolChainPlatformInfo != null) {
- toolChainInfo = toolChainInfo.intersection(toolChainPlatformInfo);
- }
- toolChainInfo.addCommands(toolsDef.getConfigInfo().getCommands());
- toolChainInfo.normalize();
-
- EdkLog.log("Init", EdkLog.EDK_ALWAYS, "Current build tool chain information summary: ");
- EdkLog.log("Init", EdkLog.EDK_ALWAYS, toolChainInfo + "");
- }
- return toolChainInfo;
- }
-
- public static void setPlatformToolChainFamilyOption(ToolChainMap map) {
- platformToolChainFamilyOption = map;
- }
-
- public static void setPlatformToolChainOption(ToolChainMap map) {
- platformToolChainOption = map;
- }
-
- public static void addModuleToolChainOption(FpdModuleIdentification fpdModuleId,
- ToolChainMap toolChainOption) {
- moduleToolChainOption.put(fpdModuleId, toolChainOption);
- }
-
- public static void addModuleToolChainFamilyOption(FpdModuleIdentification fpdModuleId,
- ToolChainMap toolChainOption) {
- moduleToolChainFamilyOption.put(fpdModuleId, toolChainOption);
- }
-
- public static void addMsaBuildOption(ModuleIdentification moduleId,
- ToolChainMap toolChainOption) {
- msaBuildOption.put(moduleId, toolChainOption);
- }
-
- public static void addMsaFamilyBuildOption(ModuleIdentification moduleId,
- ToolChainMap toolChainOption) {
- msaFamilyBuildOption.put(moduleId, toolChainOption);
- }
-
- public static boolean isCommandSet(String target, String toolchain, String arch) throws EdkException {
- String[] commands = getToolChainInfo().getCommands();
-
- for (int i = 0; i < commands.length; ++i) {
- String cmdName = toolsDef.getConfig().get(new String[] {target, toolchain, arch, commands[i], ToolDefinitions.TOOLS_DEF_ATTRIBUTE_NAME});
- if (cmdName != null && cmdName.length() != 0) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- Except FLAGS, all attribute are from TOOLS_DEF file.
-
- For FLAGS, information from four places, they are:
- <pre>
- 1. tools_def.txt
- 2. MSA &lt;BuildOptions&gt;/&lt;Options&gt;
- 3. FPD &lt;BuildOptions&gt;/&lt;Options&gt;
- 4. FPD &lt;FrameworkModules&gt;/&lt;ModuleSaBuildOptions&gt;/&lt;Options&gt;
- </pre>
-
- @param commandDescription Key: TARGET, TAGNAME, ARCH, COMMANDTYPE, ATTRIBUTE
- @param fpdModuleId Module Identification with Arch
- @return The corresponding String
- @throws EdkException If build option definition error
- **/
- public synchronized static String getCommandSetting(String[] commandDescription, FpdModuleIdentification fpdModuleId) throws EdkException {
- ToolChainKey toolChainKey = new ToolChainKey(commandDescription);
- ToolChainMap toolChainConfig = toolsDef.getConfig();
- String setting = null;
-
- //
- // Default in tools_def.txt
- //
- setting = toolChainConfig.get(toolChainKey);
- if (setting == null) {
- setting = "";
- }
- if (!commandDescription[ToolChainElement.ATTRIBUTE.value].equals(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS)) {
- return setting;
- }
-
- Set<String> flagSet = new LinkedHashSet<String>();
- flagSet.add(setting);
-
- //
- // Tool's option can be in .fpd and/or .msa file
- //
- String optionString;
- ToolChainMap option = null;
- ToolChainKey toolChainFamilyKey = new ToolChainKey(commandDescription);
-
- toolChainFamilyKey.setKey(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FAMILY, ToolChainElement.ATTRIBUTE.value);
- String family = toolChainConfig.get(toolChainFamilyKey);
- toolChainFamilyKey.setKey(family, ToolChainElement.TOOLCHAIN.value);
- toolChainFamilyKey.setKey(ToolDefinitions.TOOLS_DEF_ATTRIBUTE_FLAGS, ToolChainElement.ATTRIBUTE.value);
-
- //
- // MSA's tool chain family option
- //
- option = msaFamilyBuildOption.get(fpdModuleId.getModule());
- if (option != null && (optionString = option.get(toolChainFamilyKey)) != null) {
- flagSet.add(optionString);
- }
-
- //
- // MSA's tool chain option
- //
- option = msaBuildOption.get(fpdModuleId.getModule());
- if (option != null && (optionString = option.get(toolChainKey)) != null) {
- flagSet.add(optionString);
- }
-
- //
- // Platform's tool chain family option
- //
- optionString = platformToolChainFamilyOption.get(toolChainFamilyKey);
- if (optionString != null) {
- flagSet.add(optionString);
- }
-
- //
- // Platform's tool chain tag option
- //
- optionString = platformToolChainOption.get(toolChainKey);
- if (optionString != null) {
- flagSet.add(optionString);
- }
-
- //
- // Module's tool chain family option
- //
- option = moduleToolChainFamilyOption.get(fpdModuleId);
- if (option != null && (optionString = option.get(toolChainFamilyKey)) != null) {
- flagSet.add(optionString);
- }
-
- //
- // Module's tool chain tag option
- //
- option = moduleToolChainOption.get(fpdModuleId);
- if (option != null && (optionString = option.get(toolChainKey)) != null) {
- flagSet.add(optionString);
- }
-
- setting = "";
- for(Iterator<String> iter = flagSet.iterator(); iter.hasNext();) {
- setting += iter.next() +" ";
- }
- return setting;
- }
-
- public static void setToolChainEnvInfo(ToolChainInfo envInfo) {
- toolChainEnvInfo = envInfo;
- }
- public static void setToolChainPlatformInfo(ToolChainInfo platformInfo) {
- toolChainPlatformInfo = platformInfo;
- }
-
- //
- // for PCD
- //
- public synchronized static MemoryDatabaseManager getPCDMemoryDBManager() {
- return pcdDbManager;
- }
-
- //
- // For PCD get tokenSpaceGUid
- //
- public synchronized static String getGuidInfoFromCname(String cName){
- String cNameGuid = null;
- String guid = null;
- Set set = spdTable.keySet();
- Iterator iter = set.iterator();
-
- if (iter == null) {
- return null;
- }
-
- while (iter.hasNext()){
- Spd spd = (Spd) spdTable.get(iter.next());
- guid = spd.getGuidFromCname(cName);
- if (guid != null){
- cNameGuid = guid;
- break;
- }
- }
- return cNameGuid;
- }
-
- //
- // For PCD
- //
- public synchronized static Map<FpdModuleIdentification, XmlObject>
- getFpdModuleSaXmlObject(String xmlObjectName) {
- Set<FpdModuleIdentification> fpdModuleSASet = fpdModuleSA.keySet();
- Iterator item = fpdModuleSASet.iterator();
-
-
- Map<FpdModuleIdentification, XmlObject> SAPcdBuildDef = new HashMap<FpdModuleIdentification, XmlObject>();
- Map<String, XmlObject> SANode = new HashMap<String, XmlObject>();
- FpdModuleIdentification moduleId;
- while (item.hasNext()) {
-
- moduleId = (FpdModuleIdentification) item.next();
- SANode = fpdModuleSA.get(moduleId);
- try{
- if (SANode.get(xmlObjectName)!= null){
- SAPcdBuildDef.put(moduleId,
- (XmlObject) SANode.get(xmlObjectName));
-
- }
- } catch (Exception e){
- EdkLog.log(EdkLog.EDK_INFO, e.getMessage());
- }
- }
- return SAPcdBuildDef;
- }
-
- public synchronized static Map<FpdModuleIdentification,XmlObject> getFpdPcdBuildDefinitions() {
- Map<FpdModuleIdentification,XmlObject> pcdBuildDef = getFpdModuleSaXmlObject ("PcdBuildDefinition");
-
- return pcdBuildDef;
- }
-
- public static XmlObject parseXmlFile(File xmlFile) throws IOException, XmlException {
- Collection errors = new ArrayList();
- XmlOptions opt = new XmlOptions();
-
- opt.setLoadLineNumbers();
- opt.setLoadMessageDigest();
- opt.setErrorListener(errors);
-
- XmlObject doc = XmlObject.Factory.parse(xmlFile, opt);
- //
- // Validate File if they accord with XML Schema
- //
- if (!doc.validate(opt)){
- StringBuilder errorMessage = new StringBuilder(1024);
- for (Iterator it = errors.iterator(); it.hasNext(); ) {
- errorMessage.append(it.next());
- errorMessage.append("\n");
- }
- throw new XmlException(errorMessage.toString());
- }
-
- return doc;
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/OnDependency.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/OnDependency.java
deleted file mode 100644
index 678bfb869b..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/OnDependency.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/** @file
-This file is to define OnDependency class.
-
-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.
-
---*/
-package org.tianocore.build.global;
-
-import java.io.File;
-import java.util.Iterator;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.taskdefs.Sequential;
-import org.tianocore.common.logger.EdkLog;
-import org.tianocore.common.cache.FileTimeStamp;
-
-/**
- Class OnDepdendency is used to check the timestamp between source files and
- target files, which can be used to determine if the target files are needed to
- be re-generated from source files.
- **/
-public class OnDependency extends Task {
- //
- // source files list
- //
- private DpFileList sources = null;
-
- //
- // target files list
- //
- private DpFileList targets = null;
-
- //
- // tasks to be performed to generate target files
- //
- private Sequential task = null;
-
- /**
- An empty constructor for an ANT task can avoid some potential issues
- **/
- public OnDependency(){
- }
-
- /**
- Standard execute method of ANT task
- **/
- public void execute() throws BuildException {
- if (isOutOfDate() && task != null) {
- task.perform();
- }
-
- //
- // Update the time stamp of target files since they are just re-generated
- //
- for (Iterator dstIt = targets.nameList.iterator(); dstIt.hasNext();) {
- FileTimeStamp.update((String)dstIt.next());
- }
- }
-
- //
- // check if the target files are outofdate
- //
- private boolean isOutOfDate() {
- ///
- /// if no source files specified, take it as a fresh start
- ///
- if (sources.nameList.size() == 0) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "No source file spcified!");
- return true;
- }
-
- if (targets.nameList.size() == 0) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "No target file found!");
- return true;
- }
-
- Iterator dstIt = targets.nameList.iterator();
- while (dstIt.hasNext()) {
- String dstFileName = (String)dstIt.next();
- File dstFile = new File(dstFileName);
- if (!dstFile.exists()) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "Target file [" + dstFileName + "] doesn't exist!");
- return true;
- }
-
- long dstTimeStamp = FileTimeStamp.get(dstFileName);
- Iterator srcIt = sources.nameList.iterator();
- while (srcIt.hasNext()) {
- String srcFileName = (String)srcIt.next();
- long srcTimeStamp = FileTimeStamp.get(srcFileName);
-
- if (srcTimeStamp == 0) {
- //
- // time stamp 0 means that the file doesn't exist
- //
- throw new BuildException("Source File name: " + srcFileName + " doesn't exist!!!");
- }
-
- if (dstTimeStamp < srcTimeStamp) {
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "Source file [" + srcFileName + "] has been changed since last build!");
- return true;
- }
- }
- }
-
- EdkLog.log(this, EdkLog.EDK_VERBOSE, "Target files are up-to-date!");
- return false;
- }
-
- /**
- Add method of ANT task for nested element with Sequential type
-
- @param task Sequential object which contains tasks for generating target files
- **/
- public void addSequential(Sequential task) {
- this.task = task;
- }
-
- /**
- Add method of ANT task for nested element with DpFileList type
-
- @param sources DpFileList object which contains the list of source files
- **/
- public void addSourcefiles(DpFileList sources) {
- this.sources = sources;
- }
-
- /**
- Add method of ANT task for nested element with DpFileList type
-
- @param targets DpFileList object which contains the list of target files
- **/
- public void addTargetfiles(DpFileList targets) {
- this.targets = targets;
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/OutputManager.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/OutputManager.java
deleted file mode 100644
index 2c70326202..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/OutputManager.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/** @file
- OutputManager class.
-
- OutputManager class set output directories for every module by BUILD_MODE.
-
-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.
-**/
-package org.tianocore.build.global;
-
-import org.apache.tools.ant.Project;
-import java.io.File;
-
-/**
- OutputManager class is used to setup output directories (BIN_DIR, DEST_DIR_OUTPUT,
- DEST_DIR_DEBUG).
-
- @since GenBuild 1.0
-**/
-public class OutputManager {
-
- ///
- /// means intermediate files will put under Module's dir
- ///
- private String MODULE = "MODULE";
-
- ///
- /// mean intermediate files will put under a unify dir
- ///
- private String UNIFIED = "UNIFIED";
-
-
- private String userdir;
-
- private String type;
- ///
- /// Singleton Design Pattern
- ///
- private static OutputManager object;
-
- public synchronized static OutputManager getInstance() {
- if ( object == null ) {
- object = new OutputManager();
- }
- return object;
- }
-
- public void setup(String userdir, String type) {
- this.userdir = userdir;
- this.type = type;
- }
-
- /**
- Setup BIN_DIR, DEST_DIR_OUTPUT and DEST_DIR_OUTPUT, following are the rules:
-
- <p>Divide all output files into two types: one is final files, such as FFS
- file for driver module while LIB file for library module; another is
- intermediate files, such AutoGen.c, OBJ files, Section files and so on.
-
- <p>In FPD, OutputDirectory element is used to specify where to put the output
- files to. There are two mode (MODULE | UNIFIED). MODULE mode means that all
- output files will put to the module directory while UNIFIED mode means that
- all output files will put together. Default is UNIFIED mode.
-
- <p>BUILD_DIR is the base directory for current module build. By default,
- BUILD_DIR is PLATFORM_DIR/Build in UNIFIED mode while is MODULE_DIR/Build
- in MODULE mode. Of course, user can customize BUILD_DIR. If user-defined
- BUILD_DIR is relative path, then look as related to WORKSPACE_DIR.
-
- <p>Then, BIN_DIR is BUILD_DIR/TARGET/TOOLCHAIN/ARCH;
-
- <p>FV_DIR is BUILD_DIR/TARGET/TOOLCHAIN/FV;
-
- <p>DEST_DIR_DEBUG | DEST_DIR_OUTPUT is:
- BIN_DIR/PACKAGE_RELATIVE_DIR/MODULE_RELATIVE_DIR/DEBUG | OUTPUT
-
-
- @param project current ANT build Project
- @param userdir user-defined directory
- @param type the module build type (MODULE or UNIFIED)
- **/
- public void update(Project project) {
- //
- // Default mode is UNIFIED.
- //
- if (type != null && type.equalsIgnoreCase(MODULE)) {
- type = MODULE;
- }
- else {
- type = UNIFIED;
- }
-
- //
- // default BUILD_DIR value
- //
- String buildDir;
- if(type.equals(MODULE)){
- buildDir = project.getProperty("MODULE_DIR") + File.separatorChar + "Build";
- }
- else {
- buildDir = project.getProperty("PLATFORM_DIR") + File.separatorChar + "Build";
- }
-
- //
- // If user define BUILD_DIR
- //
- if (userdir != null && ! userdir.equals("")) {
- File buildFile = new File(userdir);
- if (buildFile.isAbsolute()){
- buildDir = userdir;
- }
- //
- // If path is not absolute, then look as related to WORKSPACE_DIR
- //
- else {
- buildDir = GlobalData.getWorkspacePath() + File.separatorChar + userdir;
- }
- }
-
- //
- // Define TARGET_DIR
- //
- String targetDir = buildDir + File.separatorChar + project.getProperty("TARGET")
- + "_" + project.getProperty("TOOLCHAIN");
-
- //
- // Define BIN_DIR and FV_DIR
- //
- String binDir = targetDir + File.separatorChar + project.getProperty("ARCH") ;
-
- String fvDir = targetDir + File.separatorChar + "FV";
-
- //
- // Define DEST_DIR_OUTPUT and DEST_DIR_DEBUG
- //
- String destDir = binDir + File.separatorChar + project.getProperty("PACKAGE_RELATIVE_DIR")
- + File.separatorChar + project.getProperty("MODULE_RELATIVE_DIR");
-
- //
- // Set properties
- //
- project.setProperty("BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
- project.setProperty("TARGET_DIR", targetDir.replaceAll("(\\\\)", "/"));
- project.setProperty("FV_DIR", fvDir.replaceAll("(\\\\)", "/"));
- project.setProperty("BIN_DIR", binDir.replaceAll("(\\\\)", "/"));
- project.setProperty("DEST_DIR_DEBUG", (destDir + File.separatorChar + "DEBUG").replaceAll("(\\\\)", "/"));
- project.setProperty("DEST_DIR_OUTPUT", (destDir + File.separatorChar + "OUTPUT").replaceAll("(\\\\)", "/"));
-
- //
- // Create all directory if necessary
- //
- (new File(buildDir)).mkdirs();
- (new File(fvDir)).mkdirs();
- (new File(binDir)).mkdirs();
- (new File(destDir + File.separatorChar + "DEBUG")).mkdirs();
- (new File(destDir + File.separatorChar + "OUTPUT")).mkdirs();
- }
-
- public boolean prepareBuildDir(Project project){
- boolean isUnified = true;
-
- if (type.equalsIgnoreCase("MODULE")) {
- isUnified = false;
- }
-
- String buildDir = project.getProperty("PLATFORM_DIR") + File.separatorChar + "Build";
- //
- // If user define BUILD_DIR
- //
- if (userdir != null && ! userdir.equals("")) {
- File buildFile = new File(userdir);
- if (buildFile.isAbsolute()){
- buildDir = userdir;
- }
- //
- // If path is not absolute, then look as related to WORKSPACE_DIR
- //
- else {
- buildDir = GlobalData.getWorkspacePath() + File.separatorChar + userdir;
- }
- }
-
- //
- // Set to property
- //
- project.setProperty("BUILD_DIR", buildDir.replaceAll("(\\\\)", "/"));
-
- //
- // Create all directory if necessary
- //
- (new File(buildDir)).mkdirs();
- return isUnified;
- }
-
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/Spd.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/Spd.java
deleted file mode 100644
index 951817f64c..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/Spd.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/** @file
- Spd class.
-
- This class is to generate a global table for the content of spd file.
-
- 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.
-
- **/
-package org.tianocore.build.global;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.common.exception.EdkException;
-
-/**
-
- This class is to generate a global table for the content of spd file.
-
-**/
-public class Spd {
- ///
- ///
- ///
- Map<ModuleIdentification, File> msaInfo = new HashMap<ModuleIdentification, File>();
-
- ///
- /// Map of module info.
- /// Key : moduletype
- /// Value: moduletype related include file
- ///
- Map<String, String> packageHeaderInfo = new HashMap<String, String>();
-
- ///
- /// Map of PPI info.
- /// Key : PPI name
- /// value: String[] a. PPI C_NAME; b. PPI GUID;
- ///
- Map<String, String[]> ppiInfo = new HashMap<String, String[]>();
-
- ///
- /// Map of Protocol info.
- /// Key : Protocol name
- /// value: String[] a. Protocol C_NAME; b. Protocol GUID;
- ///
- Map<String, String[]> protocolInfo = new HashMap<String, String[]>();
-
- ///
- /// Map of Guid info.
- /// Key : Guid name
- /// value: String[] a. Guid C_NAME; b. Guid's GUID;
- ///
- Map<String, String[]> guidInfo = new HashMap<String, String[]>();
-
- ///
- /// Map of Guid info
- /// Key: GuidCName
- /// value: String Guid's GUID
- ///
- Map<String, String> guidCnameInfo = new HashMap<String, String>();
-
- /// Map of library class and its exposed header file.
- /// Key : library class name
- /// value : library class corresponding header file
- ///
- Map<String, String[]> libClassHeaderList = new HashMap<String, String[]>();
-
- ///
- /// Package path.
- ///
- PackageIdentification packageId;
-
- /**
- Constructor function
-
- This function mainly initialize some member variables.
- **/
- Spd(File packageFile) throws EdkException {
- //
- // If specified package file not exists
- //
- if ( ! packageFile.exists()) {
- throw new EdkException("Package file [" + packageFile.getPath() + "] does not exist!");
- }
- try {
- XmlObject spdDoc = GlobalData.parseXmlFile(packageFile);
- //
- // We can change Map to XmlObject
- //
- Map<String, XmlObject> spdDocMap = new HashMap<String, XmlObject>();
- spdDocMap.put("PackageSurfaceArea", spdDoc);
- SurfaceAreaQuery saq = new SurfaceAreaQuery(spdDocMap);
-
- packageId = saq.getSpdHeader();
- packageId.setSpdFile(packageFile);
-
- //
- // initialize Msa Files
- // MSA file is absolute file path
- //
- String[] msaFilenames = saq.getSpdMsaFile();
- for (int i = 0; i < msaFilenames.length; i++){
- File msaFile = new File(packageId.getPackageDir() + File.separatorChar + msaFilenames[i]);
- Map<String, XmlObject> msaDoc = GlobalData.getNativeMsa( msaFile );
- saq.push(msaDoc);
- ModuleIdentification moduleId = saq.getMsaHeader();
- saq.pop();
- moduleId.setPackage(packageId);
- moduleId.setMsaFile(msaFile);
- if (msaInfo.containsKey(moduleId)) {
- throw new EdkException("Found two modules with the same GUID and Version in package " + packageId + ".\nThey are module [" + msaInfo.get(moduleId) + "] and MSA file [" + msaFile + "]!");
- }
- msaInfo.put(moduleId, msaFile);
- }
-
- //
- // initialize Package header files
- //
- Map<String, String> packageHeaders = saq.getSpdPackageHeaderFiles();
- Set keys = packageHeaders.keySet();
- Iterator iter = keys.iterator();
- while (iter.hasNext()){
- String moduleType = (String)iter.next();
- String header = packageId.getPackageRelativeDir() + File.separatorChar + packageHeaders.get(moduleType);
-
- //
- // Change path seperator to system-dependent path separator
- //
- File file = new File (header);
- header = file.getPath();
- packageHeaderInfo.put(moduleType, header);
- }
-
- //
- // initialize Guid Info
- //
- guidInfo.putAll(saq.getSpdGuid());
-
- //
- // For Pcd get TokenSpaceGuid
- //
- Set<String> key = guidInfo.keySet();
- Iterator item = key.iterator();
- String [] nameValue = new String[2];
- while(item.hasNext()){
- nameValue = guidInfo.get(item.next());
- guidCnameInfo.put(nameValue[0], nameValue[1]);
- }
-
- //
- // initialize PPI info
- //
- ppiInfo.putAll(saq.getSpdPpi());
-
- //
- // initialize Protocol info
- //
- protocolInfo.putAll(saq.getSpdProtocol());
-
- //
- // initialize library class declaration
- //
- Map<String, String[]> libraryClassHeaders = saq.getSpdLibraryClasses();
- keys = libraryClassHeaders.keySet();
- iter = keys.iterator();
- while (iter.hasNext()){
- String libraryClassName = (String)iter.next();
- String[] headerFiles = libraryClassHeaders.get(libraryClassName);
- for (int i = 0; i < headerFiles.length; i++){
- headerFiles[i] = packageId.getPackageRelativeDir() + File.separatorChar + headerFiles[i];
-
- //
- // Change path separator to system system-dependent path separator.
- //
- File file = new File (headerFiles[i]);
- headerFiles[i] = file.getPath();
- }
- libClassHeaderList.put(libraryClassName, headerFiles);
- }
- } catch (IOException ex) {
- EdkException edkException = new EdkException("Parse of the package description file [" + packageFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- } catch (XmlException ex) {
- EdkException edkException = new EdkException("Parse of the package description file [" + packageFile.getPath() + "] failed!\n" + ex.getMessage());
- edkException.setStackTrace(ex.getStackTrace());
- throw edkException;
- }
- }
-
- public PackageIdentification getPackageId() {
- return packageId;
- }
-
- public File getModuleFile(ModuleIdentification moduleId) {
- return msaInfo.get(moduleId);
- }
-
- public Set<ModuleIdentification> getModules(){
- return msaInfo.keySet();
- }
-
- /**
- return two value {CName, Guid}. If not found, return null.
- **/
- public String[] getPpi(String ppiName) {
- return ppiInfo.get(ppiName);
- }
-
- /**
- return two value {CName, Guid}. If not found, return null.
- **/
- public String[] getProtocol(String protocolName) {
- return protocolInfo.get(protocolName);
- }
-
- /**
- return two value {CName, Guid}. If not found, return null.
- **/
- public String[] getGuid(String guidName) {
- return guidInfo.get(guidName);
- }
-
- /**
- * return Guid Value.
- */
- public String getGuidFromCname(String cName){
- return guidCnameInfo.get(cName);
- }
-
- /**
- getLibClassInclude
-
- This function is to get the library exposed header file name according
- library class name.
-
- @param libName Name of library class
- @return Name of header file
- **/
- String[] getLibClassIncluder(String libName) {
- return libClassHeaderList.get(libName);
- }
-
- /**
- getModuleTypeIncluder
-
- This function is to get the header file name from module info map
- according to module type.
-
- @param moduleType Module type.
- @return Name of header file.
- **/
- String getPackageIncluder(String moduleType) {
- return packageHeaderInfo.get(moduleType);
- }
-
-
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
deleted file mode 100644
index acd8182d3b..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/SurfaceAreaQuery.java
+++ /dev/null
@@ -1,2356 +0,0 @@
-/** @file
- This file is for surface area information retrieval.
-
- 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.
-
- **/
-package org.tianocore.build.global;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Stack;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlString;
-import org.tianocore.*;
-import org.tianocore.ExternsDocument.Externs.Extern;
-import org.tianocore.FilenameDocument.Filename;
-import org.tianocore.ModuleDefinitionsDocument.ModuleDefinitions;
-import org.tianocore.MsaHeaderDocument.MsaHeader;
-import org.tianocore.ProtocolsDocument.Protocols.Protocol;
-import org.tianocore.ProtocolsDocument.Protocols.ProtocolNotify;
-import org.tianocore.build.autogen.CommonDefinition;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.build.id.PackageIdentification;
-import org.tianocore.build.id.PlatformIdentification;
-import org.tianocore.build.toolchain.ToolChainInfo;
-import org.tianocore.common.definitions.EdkDefinitions;
-import org.tianocore.common.exception.EdkException;
-import org.w3c.dom.Node;
-
-/**
- * SurfaceAreaQuery class is used to query Surface Area information from msa,
- * mbd, spd and fpd files.
- *
- * This class should not instantiated. All the public interfaces is static.
- *
- * @since GenBuild 1.0
- */
-public class SurfaceAreaQuery {
-
- public String prefix = "http://www.TianoCore.org/2006/Edk2.0";
-
- //
- // Contains name/value pairs of Surface Area document object. The name is
- // always the top level element name.
- //
- private Map<String, XmlObject> map = null;
-
- //
- // mapStack is used to do nested query
- //
- private Stack<Map<String, XmlObject>> mapStack = new Stack<Map<String, XmlObject>>();
-
- //
- // prefix of name space
- //
- private String nsPrefix = "sans";
-
- //
- // xmlbeans needs a name space for each Xpath element
- //
- private String ns = null;
-
- //
- // keep the namep declaration for xmlbeans Xpath query
- //
- private String queryDeclaration = null;
- private StringBuffer normQueryString = new StringBuffer(4096);
- private Pattern xPathPattern = Pattern.compile("([^/]*)(/|//)([^/]+)");
-
- /**
- * Set a Surface Area document for query later
- *
- * @param map
- * A Surface Area document in TopLevelElementName/XmlObject
- * format.
- */
- public SurfaceAreaQuery(Map<String, XmlObject> map) {
- ns = prefix;
- queryDeclaration = "declare namespace " + nsPrefix + "='" + ns + "'; ";
- this.map = map;
- }
-
- /**
- * Push current used Surface Area document into query stack. The given new
- * document will be used for any immediately followed getXXX() callings,
- * untill pop() is called.
- *
- * @param newMap
- * The TopLevelElementName/XmlObject format of a Surface Area
- * document.
- */
- public void push(Map<String, XmlObject> newMap) {
- mapStack.push(this.map);
- this.map = newMap;
- }
-
- /**
- * Discard current used Surface Area document and use the top document in
- * stack instead.
- */
- public void pop() {
- this.map = mapStack.pop();
- }
-
- // /
- // / Convert xPath to be namespace qualified, which is necessary for
- // XmlBeans
- // / selectPath(). For example, converting /MsaHeader/ModuleType to
- // / /ns:MsaHeader/ns:ModuleType
- // /
- private String normalizeQueryString(String[] exp, String from) {
- normQueryString.setLength(0);
-
- int i = 0;
- while (i < exp.length) {
- String newExp = from + exp[i];
- Matcher matcher = xPathPattern.matcher(newExp);
-
- while (matcher.find()) {
- String starter = newExp.substring(matcher.start(1), matcher
- .end(1));
- String seperator = newExp.substring(matcher.start(2), matcher
- .end(2));
- String token = newExp.substring(matcher.start(3), matcher
- .end(3));
-
- normQueryString.append(starter);
- normQueryString.append(seperator);
- normQueryString.append(nsPrefix);
- normQueryString.append(":");
- normQueryString.append(token);
- }
-
- ++i;
- if (i < exp.length) {
- normQueryString.append(" | ");
- }
- }
-
- return normQueryString.toString();
- }
-
- /**
- * Search all XML documents stored in "map" for the specified xPath, using
- * relative path (starting with '$this')
- *
- * @param xPath
- * xpath query string array
- * @returns An array of XmlObject if elements are found at the specified
- * xpath
- * @returns NULL if nothing is at the specified xpath
- */
- public Object[] get(String[] xPath) {
- if (map == null) {
- return null;
- }
-
- String[] keys = (String[]) map.keySet().toArray(new String[map.size()]);
- List<Object> result = new ArrayList<Object>();
- for (int i = 0; i < keys.length; ++i) {
- XmlObject rootNode = (XmlObject) map.get(keys[i]);
- if (rootNode == null) {
- continue;
- }
-
- String query = queryDeclaration
- + normalizeQueryString(xPath, "$this/" + keys[i]);
- XmlObject[] tmp = rootNode.selectPath(query);
- for (int j = 0; j < tmp.length; ++j) {
- result.add((Object)tmp[j]);
- }
- }
-
- int size = result.size();
- if (size <= 0) {
- return null;
- }
-
- return (Object[]) result.toArray(new Object[size]);
- }
-
- /**
- * Search XML documents named by "rootName" for the given xPath, using
- * relative path (starting with '$this')
- *
- * @param rootName
- * The top level element name
- * @param xPath
- * The xpath query string array
- * @returns An array of XmlObject if elements are found at the given xpath
- * @returns NULL if nothing is found at the given xpath
- */
- public Object[] get(String rootName, String[] xPath) {
- if (map == null) {
- return null;
- }
-
- XmlObject root = (XmlObject) map.get(rootName);
- if (root == null) {
- return null;
- }
-
- String query = queryDeclaration
- + normalizeQueryString(xPath, "$this/" + rootName);
- XmlObject[] result = root.selectPath(query);
- if (result.length > 0) {
- return (Object[])result;
- }
-
- query = queryDeclaration + normalizeQueryString(xPath, "/" + rootName);
- result = root.selectPath(query);
- if (result.length > 0) {
- return (Object[])result;
- }
-
- return null;
- }
-
- /**
- * Retrieve SourceFiles/Filename for specified ARCH type
- *
- * @param arch
- * architecture name
- * @returns An 2 dimension string array if elements are found at the known
- * xpath
- * @returns NULL if nothing is found at the known xpath
- */
- public String[][] getSourceFiles(String arch) {
- String[] xPath;
- Object[] returns;
-
- xPath = new String[] { "/Filename" };
-
- returns = get("SourceFiles", xPath);
-
- if (returns == null || returns.length == 0) {
- return new String[0][3];
- }
-
- Filename[] sourceFileNames = (Filename[]) returns;
- List<String[]> outputList = new ArrayList<String[]>();
- for (int i = 0; i < sourceFileNames.length; i++) {
- List archList = sourceFileNames[i].getSupArchList();
- if (arch == null || arch.trim().equalsIgnoreCase("") || archList == null || contains(archList, arch)) {
- outputList.add(new String[] {sourceFileNames[i].getToolCode(), sourceFileNames[i].getStringValue(), sourceFileNames[i].getToolChainFamily()});
- }
- }
-
- String[][] outputString = new String[outputList.size()][3];
- for (int index = 0; index < outputList.size(); index++) {
- //
- // ToolCode (FileType)
- //
- outputString[index][0] = outputList.get(index)[0];
- //
- // File name (relative to MODULE_DIR)
- //
- outputString[index][1] = outputList.get(index)[1];
- //
- // Tool chain family
- //
- outputString[index][2] = outputList.get(index)[2];
- }
- return outputString;
- }
-
- /**
- * Retrieve /PlatformDefinitions/OutputDirectory from FPD
- *
- * @returns Directory names array if elements are found at the known xpath
- * @returns Empty if nothing is found at the known xpath
- */
- public String getFpdOutputDirectory() {
- String[] xPath = new String[] { "/PlatformDefinitions" };
-
- Object[] returns = get("PlatformSurfaceArea", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];
- return item.getOutputDirectory();
- }
-
- public String getFpdIntermediateDirectories() {
- String[] xPath = new String[] { "/PlatformDefinitions" };
-
- Object[] returns = get("PlatformSurfaceArea", xPath);
- if (returns == null || returns.length == 0) {
- return "UNIFIED";
- }
- PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];
- if(item.getIntermediateDirectories() == null) {
- return null;
- }
- else {
- return item.getIntermediateDirectories().toString();
- }
- }
-
- public String getModuleFfsKeyword() {
- String[] xPath = new String[] { "/" };
-
- Object[] returns = get("ModuleSaBuildOptions", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];
- return item.getFfsFormatKey();
- }
-
- public String getModuleFvBindingKeyword() {
- String[] xPath = new String[] { "/" };
-
- Object[] returns = get("ModuleSaBuildOptions", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- ModuleSaBuildOptionsDocument.ModuleSaBuildOptions item = (ModuleSaBuildOptionsDocument.ModuleSaBuildOptions)returns[0];
- return item.getFvBinding();
- }
-
- public List getModuleSupportedArchs() {
- String[] xPath = new String[] { "/" };
-
- Object[] returns = get("ModuleDefinitions", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
- return item.getSupportedArchitectures();
- }
-
- public BuildOptionsDocument.BuildOptions.Ffs[] getFpdFfs() {
- String[] xPath = new String[] {"/Ffs"};
-
- Object[] returns = get("BuildOptions", xPath);
- if (returns == null || returns.length == 0) {
- return new BuildOptionsDocument.BuildOptions.Ffs[0];
- }
- return (BuildOptionsDocument.BuildOptions.Ffs[])returns;
- }
-
- public String getModuleOutputFileBasename() {
- String[] xPath = new String[] { "/" };
-
- Object[] returns = get("ModuleDefinitions", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- ModuleDefinitionsDocument.ModuleDefinitions item = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
- return item.getOutputFileBasename();
- }
-
- /**
- * Retrieve BuildOptions/Option or Arch/Option
- *
- * @param toolChainFamilyFlag
- * if true, retrieve options for toolchain family; otherwise for
- * toolchain
- *
- * @returns String[][5] name, target, toolchain, arch, coommand of options
- * if elements are found at the known xpath. String[0][] if dont
- * find element.
- *
- * @returns Empty array if nothing is there
- */
- public String[][] getOptions(String from, String[] xPath, boolean toolChainFamilyFlag) {
- String target = null;
- String toolchain = null;
- String toolchainFamily = null;
- List<String> archList = null;
- String cmd = null;
- String optionName = null;
-
- Object[] returns = get(from, xPath);
- if (returns == null) {
- return new String[0][5];
- }
-
- List<String[]> optionList = new ArrayList<String[]>();
- OptionDocument.Option option;
-
- for (int i = 0; i < returns.length; i++) {
- option = (OptionDocument.Option) returns[i];
-
- //
- // Get Target, ToolChain(Family), Arch, Cmd, and Option from Option,
- // then
- // put to result[][5] array in above order.
- //
- String[] targetList;
- if (option.getBuildTargets() == null) {
- target = null;
- }
- else {
- target = option.getBuildTargets().toString();
- }
- if (target != null) {
- targetList = target.split(" ");
- } else {
- targetList = new String[1];
- targetList[0] = null;
- }
-
- if (toolChainFamilyFlag) {
- toolchainFamily = option.getToolChainFamily();
- if (toolchainFamily != null) {
- toolchain = toolchainFamily.toString();
- } else {
- toolchain = null;
- }
- } else {
- toolchain = option.getTagName();
- }
-
- archList = new ArrayList<String>();
- List archEnumList = option.getSupArchList();
- if (archEnumList == null) {
- archList.add(null);
- } else {
- //archList.addAll(archEnumList);
- Iterator it = archEnumList.iterator();
- while (it.hasNext()) {
- String archType = (String)it.next();
- archList.add(archType);
- }
- }
-
- cmd = option.getToolCode();
-
- optionName = option.getStringValue();
- for (int t = 0; t < targetList.length; t++) {
- for (int j = 0; j < archList.size(); j++) {
- optionList.add(new String[] { targetList[t],
- toolchain, archList.get(j), cmd, optionName});
- }
- }
- }
-
- String[][] result = new String[optionList.size()][5];
- for (int i = 0; i < optionList.size(); i++) {
- result[i][0] = optionList.get(i)[0];
- result[i][1] = optionList.get(i)[1];
- result[i][2] = optionList.get(i)[2];
- result[i][3] = optionList.get(i)[3];
- result[i][4] = optionList.get(i)[4];
- }
- return result;
- }
-
- public String[][] getModuleBuildOptions(boolean toolChainFamilyFlag) {
- String[] xPath;
-
- if (toolChainFamilyFlag == true) {
- xPath = new String[] {
- "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/Options/Option[@ToolChainFamily]", };
- } else {
- xPath = new String[] {
- "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/Options/Option[@TagName]", };
- }
- return getOptions("ModuleSaBuildOptions", xPath, toolChainFamilyFlag);
- }
-
- public String[][] getPlatformBuildOptions(boolean toolChainFamilyFlag) {
- String[] xPath;
-
- if (toolChainFamilyFlag == true) {
- xPath = new String[] {
- "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/BuildOptions/Options/Option[@ToolChainFamily]", };
- } else {
- xPath = new String[] {
- "/BuildOptions/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/BuildOptions/Options/Option[@TagName]", };
- }
-
- return getOptions("PlatformSurfaceArea", xPath, toolChainFamilyFlag);
- }
-
- public String[][] getMsaBuildOptions(boolean toolChainFamilyFlag) {
- String[] xPath;
-
- if (toolChainFamilyFlag == true) {
- xPath = new String[] {
- "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/Options/Option[@ToolChainFamily]", };
- } else {
- xPath = new String[] {
- "/Options/Option[not(@ToolChainFamily) and not(@TagName)]",
- "/Options/Option[@TagName]", };
- }
-
- return getOptions("ModuleBuildOptions", xPath, toolChainFamilyFlag);
- }
-
- public ToolChainInfo getFpdToolChainInfo() {
- String[] xPath = new String[] { "/PlatformDefinitions" };
-
- Object[] returns = get("PlatformSurfaceArea", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- PlatformDefinitionsDocument.PlatformDefinitions item = (PlatformDefinitionsDocument.PlatformDefinitions)returns[0];
- ToolChainInfo toolChainInfo = new ToolChainInfo();
- toolChainInfo.addTargets(item.getBuildTargets().toString());
- toolChainInfo.addArchs(item.getSupportedArchitectures().toString());
- toolChainInfo.addTagnames((String)null);
- return toolChainInfo;
- }
-
- /**
- * Retrieve <xxxHeader>/ModuleType
- *
- * @returns The module type name if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String getModuleType() {
- String[] xPath = new String[] { "/ModuleType" };
-
- Object[] returns = get(xPath);
- if (returns != null && returns.length > 0) {
- ModuleTypeDef type = (ModuleTypeDef) returns[0];
- return type.enumValue().toString();
- }
-
- return null;
- }
-
- /**
- * Retrieve <ModuleDefinitions>/<BinaryModule>
- *
- * @returns The module type name if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public boolean getBinaryModule() {
- String[] xPath = new String[] { "/" };
-
- Object[] returns = get("ModuleDefinitions", xPath);
- if (returns != null && returns.length > 0) {
- ModuleDefinitionsDocument.ModuleDefinitions def = (ModuleDefinitionsDocument.ModuleDefinitions)returns[0];
- return def.getBinaryModule();
- }
-
- return false;
- }
-
- /**
- * Retrieve PackageDependencies/Package
- *
- * @param arch
- * Architecture name
- *
- * @returns package name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public PackageIdentification[] getDependencePkg(String arch) throws EdkException {
- String[] xPath;
- String packageGuid = null;
- String packageVersion = null;
-
-
- xPath = new String[] { "/Package" };
-
- Object[] returns = get("PackageDependencies", xPath);
- if (returns == null) {
- return new PackageIdentification[0];
- }
-
- //
- // Get packageIdentification
- //
- List<PackageIdentification> packageIdList = new ArrayList<PackageIdentification>();
- for (int i = 0; i < returns.length; i++) {
- PackageDependenciesDocument.PackageDependencies.Package item = (PackageDependenciesDocument.PackageDependencies.Package) returns[i];
- List archList = item.getSupArchList();
- if (arch == null || archList == null || contains(archList, arch)) {
- packageGuid = item.getPackageGuid();
- packageVersion = item.getPackageVersion();
- PackageIdentification pkgId = new PackageIdentification(null, packageGuid, packageVersion);
- GlobalData.refreshPackageIdentification(pkgId);
- packageIdList.add(pkgId);
- }
- }
-
- return packageIdList.toArray(new PackageIdentification[packageIdList.size()]);
- }
-
- /**
- * Retrieve LibraryClassDefinitions/LibraryClass for specified usage
- *
- * @param usage
- * Library class usage
- *
- * @returns LibraryClass objects list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public String[] getLibraryClasses(String usage, String arch, String moduleType) {
- String[] xPath;
- if (usage == null || usage.equals("")) {
- xPath = new String[] { "/LibraryClass" };
- } else {
- xPath = new String[] { "/LibraryClass[@Usage='" + usage + "']" };
- }
-
- Object[] returns = get("LibraryClassDefinitions", xPath);
- if (returns == null || returns.length == 0) {
- return new String[0];
- }
-
- LibraryClassDocument.LibraryClass[] libraryClassList = (LibraryClassDocument.LibraryClass[]) returns;
- List<String> libraryClassName = new ArrayList<String>();
- for (int i = 0; i < libraryClassList.length; i++) {
- List archList = libraryClassList[i].getSupArchList();
- List moduleTypeList = libraryClassList[i].getSupModuleList();
- if ((arch == null || contains(archList, arch))
- && (moduleType == null || contains(moduleTypeList, moduleType))) {
- libraryClassName.add(libraryClassList[i].getKeyword());
- }
- }
-
- String[] libraryArray = new String[libraryClassName.size()];
- libraryClassName.toArray(libraryArray);
- return libraryArray;
- }
-
- /**
- * Retrieve ModuleEntryPoint names
- *
- * @returns ModuleEntryPoint name list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public String[] getModuleEntryPointArray() {
- String[] xPath = new String[] { "/Extern/ModuleEntryPoint" };
-
- Object[] returns = get("Externs", xPath);
-
- if (returns != null && returns.length > 0) {
- String[] entryPoints = new String[returns.length];
-
- for (int i = 0; i < returns.length; ++i) {
- entryPoints[i] = ((CNameType) returns[i]).getStringValue();
- }
-
- return entryPoints;
- }
-
- return null;
- }
-
- /**
- * retrieve Protocol for specified usage
- *
- * @param usage
- * Protocol usage arch Architecture
- *
- * @returns Protocol String list if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getProtocolArray(String arch, String usage) {
- String[] xPath;
- String usageXpath = "";
- String archXpath = "";
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- archXpath = "/Protocol";
- if (usage != null && !usage.equals("")) {
- usageXpath = "/Protocol[@Usage='" + usage + "']";
- xPath = new String[] { usageXpath, archXpath };
- } else {
- return getProtocolArray(arch);
- }
-
- }
-
- Object[] returns = get("Protocols", xPath);
- if (returns == null) {
- return new String[0];
- }
- Protocol[] protocolList = (Protocol[]) returns;
-
- String[] protocolArray = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- protocolArray[i] = protocolList[i].getProtocolCName();
- }
- return protocolArray;
- }
-
- /**
- * retrieve Protocol for specified usage
- *
- * @param arch
- * Architecture
- *
- * @returns Protocol String list if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getProtocolArray(String arch) {
- String[] xPath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- xPath = new String[] { "/Protocol" };
- }
-
- Object[] returns = get("Protocols", xPath);
- if (returns == null) {
- return new String[0];
- }
- Protocol[] returnlList = (Protocol[]) returns;
-
- List<String> protocolList = new ArrayList<String>();
-
- for (int i = 0; i < returns.length; i++) {
- List archList = returnlList[i].getSupArchList();
- if (archList == null || contains(archList, arch)){
- protocolList.add(returnlList[i].getProtocolCName());
- }
- }
- String[] protocolArray = new String[protocolList.size()];
- for (int i = 0; i < protocolList.size(); i++) {
- protocolArray[i] = protocolList.get(i);
- }
- return protocolArray;
- }
-
- /**
- * Retrieve ProtocolNotify for specified usage
- *
- * @param usage
- * ProtocolNotify usage
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getProtocolNotifyArray(String arch) {
- String[] xPath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- xPath = new String[] { "/ProtocolNotify" };
- }
-
- Object[] returns = get("Protocols", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- List<String> protocolNotifyList = new ArrayList<String>();
-
- for (int i = 0; i < returns.length; i++) {
- List archList = ((ProtocolNotify) returns[i]).getSupArchList();
- if (archList == null || contains(archList, arch)){
- protocolNotifyList.add(((ProtocolNotify) returns[i]).getProtocolNotifyCName());
- }
-
- }
- String[] protocolNotifyArray = new String[protocolNotifyList.size()];
- for (int i = 0; i < protocolNotifyList.size(); i++) {
- protocolNotifyArray[i] = protocolNotifyList.get(i);
- }
- return protocolNotifyArray;
- }
-
- /**
- * Retrieve ProtocolNotify for specified usage
- *
- * @param usage
- * ProtocolNotify usage
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getProtocolNotifyArray(String arch, String usage) {
-
- String[] xPath;
- String usageXpath;
- String archXpath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- archXpath = "/ProtocolNotify";
- if (usage != null && !usage.equals("")) {
- usageXpath = "/ProtocolNotify[@Usage='" + arch + "']";
- xPath = new String[] { archXpath, usageXpath };
- } else {
- return getProtocolNotifyArray(arch);
- }
- }
-
- Object[] returns = get("Protocols", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] protocolNotifyList = new String[returns.length];
-
- for (int i = 0; i < returns.length; i++) {
- protocolNotifyList[i] = ((ProtocolNotify) returns[i]).getProtocolNotifyCName();
- }
- return protocolNotifyList;
- }
-
- /**
- * Retrieve ModuleUnloadImage names
- *
- * @returns ModuleUnloadImage name list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public String[] getModuleUnloadImageArray() {
- String[] xPath = new String[] { "/Extern/ModuleUnloadImage" };
-
- Object[] returns = get("Externs", xPath);
- if (returns != null && returns.length > 0) {
- String[] stringArray = new String[returns.length];
- CNameType[] doc = (CNameType[]) returns;
-
- for (int i = 0; i < returns.length; ++i) {
- stringArray[i] = doc[i].getStringValue();
- }
-
- return stringArray;
- }
-
- return null;
- }
-
- /**
- * Retrieve Extern
- *
- * @returns Extern objects list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public ExternsDocument.Externs.Extern[] getExternArray() {
- String[] xPath = new String[] { "/Extern" };
-
- Object[] returns = get("Externs", xPath);
- if (returns != null && returns.length > 0) {
- return (ExternsDocument.Externs.Extern[]) returns;
- }
-
- return null;
- }
-
- /**
- * Retrieve PpiNotify for specified arch
- *
- * @param arch
- * PpiNotify arch
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getPpiNotifyArray(String arch) {
- String[] xPath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- xPath = new String[] { "/PpiNotify" };
- }
-
- Object[] returns = get("PPIs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
-
- List<String> ppiNotifyList = new ArrayList<String>();
- for (int i = 0; i < returns.length; i++) {
- List archList = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getSupArchList();
- if (archList == null || contains(archList, arch)){
- ppiNotifyList.add(((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName());
- }
-
- }
- String[] ppiNotifyArray = new String[ppiNotifyList.size()];
- for (int i = 0; i < ppiNotifyList.size(); i++) {
- ppiNotifyArray[i] = ppiNotifyList.get(i);
- }
-
- return ppiNotifyArray;
- }
-
- /**
- * Retrieve PpiNotify for specified usage and arch
- *
- * @param arch
- * PpiNotify arch usage PpiNotify usage
- *
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getPpiNotifyArray(String arch, String usage) {
-
- String[] xPath;
- String usageXpath;
- String archXpath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- archXpath = "/PpiNotify";
- if (usage != null && !usage.equals("")) {
- usageXpath = "/PpiNotify[@Usage='" + arch + "']";
- xPath = new String[] { archXpath, usageXpath };
- } else {
- return getProtocolNotifyArray(arch);
- }
- }
-
- Object[] returns = get("PPIs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] ppiNotifyList = new String[returns.length];
-
- for (int i = 0; i < returns.length; i++) {
- ppiNotifyList[i] = ((PPIsDocument.PPIs.PpiNotify) returns[i]).getPpiNotifyCName();
- }
- return ppiNotifyList;
- }
-
- /**
- * Retrieve Ppi for specified arch
- *
- * @param arch
- * Ppi arch
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getPpiArray(String arch) {
- String[] xPath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- xPath = new String[] { "/Ppi" };
- }
-
- Object[] returns = get("PPIs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- List<String> ppiList = new ArrayList<String>();
- for (int i = 0; i < returns.length; i++) {
- List archList = ((PPIsDocument.PPIs.Ppi) returns[i]).getSupArchList();
- if (archList == null || contains(archList, arch)){
- ppiList.add(((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName());
- }
-
- }
- String[] ppiArray = new String[ppiList.size()];
- for (int i = 0; i < ppiList.size(); i++) {
- ppiArray[i] = ppiList.get(i);
- }
- return ppiArray;
- }
-
- /**
- * Retrieve PpiNotify for specified usage and arch
- *
- * @param arch
- * PpiNotify arch usage PpiNotify usage
- *
- *
- * @returns String[] if elements are found at the known xpath
- * @returns String[0] if nothing is there
- */
- public String[] getPpiArray(String arch, String usage) {
-
- String[] xPath;
- String usageXpath;
- String archXpath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- archXpath = "/Ppi";
- if (usage != null && !usage.equals("")) {
- usageXpath = "/Ppi[@Usage='" + arch + "']";
- xPath = new String[] { archXpath, usageXpath };
- } else {
- return getProtocolNotifyArray(arch);
- }
- }
-
- Object[] returns = get("PPIs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] ppiList = new String[returns.length];
-
- for (int i = 0; i < returns.length; i++) {
- ppiList[i] = ((PPIsDocument.PPIs.Ppi) returns[i]).getPpiCName();
- }
- return ppiList;
- }
-
- /**
- * Retrieve GuidEntry information for specified usage
- *
- * @param arch
- * GuidEntry arch
- *
- * @returns GuidEntry objects list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getGuidEntryArray(String arch) {
- String[] xPath;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[] { "/GuidCNames" };
- } else {
- xPath = new String[] { "/GuidCNames" };
- }
-
- Object[] returns = get("Guids", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- List<String> guidList = new ArrayList<String>();
- for (int i = 0; i < returns.length; i++) {
- List archList = ((GuidsDocument.Guids.GuidCNames) returns[i]).getSupArchList();
- if (archList == null || contains(archList, arch)){
- guidList.add(((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName());
- }
-
- }
- String[] guidArray = new String[guidList.size()];
- for (int i = 0; i < guidList.size(); i++) {
- guidArray[i] = guidList.get(i);
- }
- return guidArray;
-
- }
-
- /**
- * Retrieve GuidEntry information for specified usage
- *
- * @param arch
- * GuidEntry arch usage GuidEntry usage
- *
- * @returns GuidEntry objects list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getGuidEntryArray(String arch, String usage) {
- String[] xPath;
- String archXpath;
- String usageXpath;
-
- if (arch == null || arch.equals("")) {
- return new String[0];
- } else {
- archXpath = "/GuidEntry";
- if (usage != null && !usage.equals("")) {
- usageXpath = "/GuidEntry[@Usage='" + arch + "']";
- xPath = new String[] { archXpath, usageXpath };
- } else {
- return getGuidEntryArray(arch);
- }
- }
-
- Object[] returns = get("Guids", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] guidList = new String[returns.length];
-
- for (int i = 0; i < returns.length; i++) {
- guidList[i] = ((GuidsDocument.Guids.GuidCNames) returns[i]).getGuidCName();
- }
- return guidList;
- }
-
- public String[] getEventCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{
- "/CreateEvents/EventTypes[@EventGuidCName]",
- "/SignalEvents/EventTypes[@EventGuidCName]",
- };
- } else {
- xPath = new String[]{
- "/CreateEvents/EventTypes[@EventGuidCName and not(@SupArchList)]",
- "/SignalEvents/EventTypes[@EventGuidCName and not(@SupArchList)]",
- "/CreateEvents/EventTypes[@EventGuidCName and contains(@SupArchList,'" + arch + "')]",
- "/SignalEvents/EventTypes[@EventGuidCName and contains(@SupArchList,'" + arch + "')]",
- };
- }
-
- Object[] returns = get("Events", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- if (returns[i] instanceof EventsDocument.Events.CreateEvents.EventTypes) {
- cnameList[i] = ((EventsDocument.Events.CreateEvents.EventTypes) returns[i]).getEventGuidCName();
- } else {
- cnameList[i] = ((EventsDocument.Events.SignalEvents.EventTypes) returns[i]).getEventGuidCName();
- }
- }
- return cnameList;
- }
-
- public String[] getHobCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{"/HobTypes[@HobGuidCName]"};
- } else {
- xPath = new String[]{
- "/HobTypes[@HobGuidCName and not(@SupArchList)]",
- "/HobTypes[@HobGuidCName and contains(@SupArchList,'" + arch + "')]",
- };
- }
-
- Object[] returns = get("Hobs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- cnameList[i] = ((HobsDocument.Hobs.HobTypes) returns[i]).getHobGuidCName();
- }
- return cnameList;
- }
-
- public String[] getVariableCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{"/Variable"};
- } else {
- xPath = new String[]{"/Variable[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
- }
-
- Object[] returns = get("Variables", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- cnameList[i] = ((VariablesDocument.Variables.Variable) returns[i]).getGuidCName();
- }
- return cnameList;
- }
-
- public String[] getSystemTableCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{"/SystemTableCNames"};
- } else {
- xPath = new String[]{
- "/SystemTableCNames[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"
- };
- }
-
- Object[] returns = get("SystemTables", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- cnameList[i] = ((SystemTablesDocument.SystemTables.SystemTableCNames) returns[i]).getSystemTableCName();
- }
- return cnameList;
- }
-
- public String[] getDataHubCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{"/DataHubRecord"};
- } else {
- xPath = new String[]{"/DataHubRecord[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
- }
-
- Object[] returns = get("DataHubs", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- cnameList[i] = ((DataHubsDocument.DataHubs.DataHubRecord) returns[i]).getDataHubCName();
- }
- return cnameList;
- }
-
- public String[] getHiiPackageCNameArray(String arch) {
- String[] xPath = null;
-
- if (arch == null || arch.equals("")) {
- xPath = new String[]{"/HiiPackage"};
- } else {
- xPath = new String[]{"/HiiPackage[not(@SupArchList) or contains(@SupArchList,'" + arch + "')]"};
- }
-
- Object[] returns = get("HiiPackages", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- String[] cnameList = new String[returns.length];
- for (int i = 0; i < returns.length; i++) {
- cnameList[i] = ((HiiPackagesDocument.HiiPackages.HiiPackage) returns[i]).getHiiCName();
- }
- return cnameList;
- }
-
- public String[] getCNameArray(String arch) {
- List<String> cnameList = new ArrayList<String>(100);
- String[] result = null;
- //
- // "/Guids/GuidCNames/GuidCName",
- //
- result = getGuidEntryArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/Protocols/Protocol/ProtocolCName",
- //
- result = getProtocolArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/Protocols/ProtocolNotify/ProtocolNotifyCName",
- //
- result = getProtocolNotifyArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/Events/CreateEvents/EventTypes[@EventGuidCName]",
- // "/Events/SignalEvents/EventTypes[@EventGuidCName]",
- //
- result = getEventCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/Hobs/HobTypes[@HobGuidCName]",
- //
- result = getHobCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/PPIs/Ppi/PpiCName",
- //
- result = getPpiArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/PPIs/PpiNotify/PpiNotifyCName",
- //
- result = getPpiNotifyArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/Variables/Variable/GuidC_Name",
- //
- result = getVariableCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/SystemTables/SystemTableCNames/SystemTableCName",
- //
- result = getSystemTableCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/DataHubs/DataHubRecord/DataHubCName",
- //
- result = getDataHubCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
- //
- // "/HiiPackages/HiiPackage/HiiCName",
- //
- result = getHiiPackageCNameArray(arch);
- for (int i = 0; i < result.length; ++i) {
- cnameList.add(result[i]);
- }
-
- return cnameList.toArray(new String[cnameList.size()]);
- }
-
- /**
- * Retrieve Library instance information
- *
- * @param arch
- * Architecture name
- * @param usage
- * Library instance usage
- *
- * @returns library instance name list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public ModuleIdentification[] getLibraryInstance(String arch) throws EdkException {
- String[] xPath;
- String saGuid = null;
- String saVersion = null;
- String pkgGuid = null;
- String pkgVersion = null;
-
- if (arch == null || arch.equalsIgnoreCase("")) {
- xPath = new String[] { "/Instance" };
- } else {
- //
- // Since Schema don't have SupArchList now, so the follow Xpath is
- // equal to "/Instance" and [not(@SupArchList) or @SupArchList= arch]
- // don't have effect.
- //
- xPath = new String[] { "/Instance[not(@SupArchList) or @SupArchList='"
- + arch + "']" };
- }
-
- Object[] returns = get("Libraries", xPath);
- if (returns == null || returns.length == 0) {
- return new ModuleIdentification[0];
- }
-
- ModuleIdentification[] saIdList = new ModuleIdentification[returns.length];
- for (int i = 0; i < returns.length; i++) {
- LibrariesDocument.Libraries.Instance library = (LibrariesDocument.Libraries.Instance) returns[i];
- saGuid = library.getModuleGuid();
- saVersion = library.getModuleVersion();
-
- pkgGuid = library.getPackageGuid();
- pkgVersion = library.getPackageVersion();
-
- ModuleIdentification saId = new ModuleIdentification(null, saGuid,
- saVersion);
- PackageIdentification pkgId = new PackageIdentification(null,
- pkgGuid, pkgVersion);
- GlobalData.refreshPackageIdentification(pkgId);
- saId.setPackage(pkgId);
- GlobalData.refreshModuleIdentification(saId);
-
- saIdList[i] = saId;
-
- }
- return saIdList;
- }
-
- // /
- // / This method is used for retrieving the elements information which has
- // / CName sub-element
- // /
- private String[] getCNames(String from, String xPath[]) {
- Object[] returns = get(from, xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- String[] strings = new String[returns.length];
- for (int i = 0; i < returns.length; ++i) {
- // TBD
- strings[i] = ((CNameType) returns[i]).getStringValue();
- }
-
- return strings;
- }
-
- /**
- * Retrive library's constructor name
- *
- * @returns constructor name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String getLibConstructorName() {
- String[] xPath = new String[] { "/Extern/Constructor" };
-
- Object[] returns = get("Externs", xPath);
- if (returns != null && returns.length > 0) {
- CNameType constructor = ((CNameType) returns[0]);
- return constructor.getStringValue();
- }
-
- return null;
- }
-
- /**
- * Retrive library's destructor name
- *
- * @returns destructor name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String getLibDestructorName() {
- String[] xPath = new String[] { "/Extern/Destructor" };
-
- Object[] returns = get("Externs", xPath);
- if (returns != null && returns.length > 0) {
- //
- // Only support one Destructor function.
- //
- CNameType destructor = (CNameType) returns[0];
- return destructor.getStringValue();
- }
-
- return null;
- }
-
- /**
- * Retrive DriverBinding names
- *
- * @returns DriverBinding name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getDriverBindingArray() {
- String[] xPath = new String[] { "/Extern/DriverBinding" };
- return getCNames("Externs", xPath);
- }
-
- /**
- * Retrive ComponentName names
- *
- * @returns ComponentName name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getComponentNameArray() {
- String[] xPath = new String[] { "/Extern/ComponentName" };
- return getCNames("Externs", xPath);
- }
-
- /**
- * Retrive DriverConfig names
- *
- * @returns DriverConfig name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getDriverConfigArray() {
- String[] xPath = new String[] { "/Extern/DriverConfig" };
- return getCNames("Externs", xPath);
- }
-
- /**
- * Retrive DriverDiag names
- *
- * @returns DriverDiag name list if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String[] getDriverDiagArray() {
- String[] xPath = new String[] { "/Extern/DriverDiag" };
- return getCNames("Externs", xPath);
- }
-
- /**
- * Retrive DriverBinding, ComponentName, DriverConfig,
- * DriverDiag group array
- *
- * @returns DriverBinding group name list if elements are found
- * at the known xpath
- * @returns null if nothing is there
- */
- public String[][] getExternProtocolGroup() {
- String[] xPath = new String[] {"/Extern"};
- Object[] returns = get("Externs",xPath);
-
- if (returns == null) {
- return new String[0][4];
- }
- List<Extern> externList = new ArrayList<Extern>();
- for (int i = 0; i < returns.length; i++) {
- org.tianocore.ExternsDocument.Externs.Extern extern = (org.tianocore.ExternsDocument.Externs.Extern)returns[i];
- if (extern.getDriverBinding() != null) {
- externList.add(extern);
- }
- }
-
- String[][] externGroup = new String[externList.size()][4];
- for (int i = 0; i < externList.size(); i++) {
- String driverBindingStr = externList.get(i).getDriverBinding();
- if ( driverBindingStr != null){
- externGroup[i][0] = driverBindingStr;
- } else {
- externGroup[i][0] = null;
- }
-
- String componentNameStr = externList.get(i).getComponentName();
- if (componentNameStr != null) {
- externGroup[i][1] = componentNameStr;
- } else {
- externGroup[i][1] = null;
- }
-
- String driverConfigStr = externList.get(i).getDriverConfig();
- if (driverConfigStr != null) {
- externGroup[i][2] = driverConfigStr;
- } else {
- externGroup[i][2] = null;
- }
-
- String driverDiagStr = externList.get(i).getDriverDiag();
- if (driverDiagStr != null) {
- externGroup[i][3] = driverDiagStr;
- } else {
- externGroup[i][3] = null;
- }
- }
- return externGroup;
- }
-
- /**
- * Retrive SetVirtualAddressMapCallBack names
- *
- * @returns SetVirtualAddressMapCallBack name list if elements are found at
- * the known xpath
- * @returns null if nothing is there
- */
- public String[] getSetVirtualAddressMapCallBackArray() {
- String[] xPath = new String[] { "/Extern/SetVirtualAddressMapCallBack" };
- return getCNames("Externs", xPath);
- }
-
- /**
- * Retrive ExitBootServicesCallBack names
- *
- * @returns ExitBootServicesCallBack name list if elements are found at the
- * known xpath
- * @returns null if nothing is there
- */
- public String[] getExitBootServicesCallBackArray() {
- String[] xPath = new String[] { "/Extern/ExitBootServicesCallBack" };
- return getCNames("Externs", xPath);
- }
-
- /**
- Judge whether current driver is PEI_PCD_DRIVER or DXE_PCD_DRIVER or
- NOT_PCD_DRIVER.
-
- @return CommonDefinition.PCD_DRIVER_TYPE the type of current driver
- **/
- public CommonDefinition.PCD_DRIVER_TYPE getPcdDriverType() {
- String[] xPath = new String[] {"/PcdIsDriver"};
- Object[] results = get ("Externs", xPath);
-
- if (results != null && results.length != 0) {
- PcdDriverTypes type = (PcdDriverTypes) results[0];
- String typeStr = type.enumValue().toString();
- if (typeStr.equals(CommonDefinition.PCD_DRIVER_TYPE.PEI_PCD_DRIVER.toString())) {
- return CommonDefinition.PCD_DRIVER_TYPE.PEI_PCD_DRIVER;
- } else if (typeStr.equals(CommonDefinition.PCD_DRIVER_TYPE.DXE_PCD_DRIVER.toString())) {
- return CommonDefinition.PCD_DRIVER_TYPE.DXE_PCD_DRIVER;
- }
- return CommonDefinition.PCD_DRIVER_TYPE.UNKNOWN_PCD_DRIVER;
- }
-
- return CommonDefinition.PCD_DRIVER_TYPE.NOT_PCD_DRIVER;
- }
-
- /**
- * Retrieve module surface area file information
- *
- * @returns ModuleSA objects list if elements are found at the known xpath
- * @returns Empty ModuleSA list if nothing is there
- */
- public Map<FpdModuleIdentification, Map<String, XmlObject>> getFpdModules() throws EdkException {
- String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };
- Object[] result = get("PlatformSurfaceArea", xPath);
- String arch = null;
- String fvBinding = null;
- String saGuid = null;
- String saVersion = null;
- String pkgGuid = null;
- String pkgVersion = null;
-
- Map<FpdModuleIdentification, Map<String, XmlObject>> fpdModuleMap = new LinkedHashMap<FpdModuleIdentification, Map<String, XmlObject>>();
-
- if (result == null) {
- return fpdModuleMap;
- }
-
- for (int i = 0; i < result.length; i++) {
- //
- // Get Fpd SA Module element node and add to ObjectMap.
- //
- Map<String, XmlObject> ObjectMap = new HashMap<String, XmlObject>();
- ModuleSADocument.ModuleSA moduleSA = (ModuleSADocument.ModuleSA) result[i];
- if (((ModuleSADocument.ModuleSA) result[i]).getLibraries() != null) {
- ObjectMap.put("Libraries", moduleSA.getLibraries());
- }
- if (((ModuleSADocument.ModuleSA) result[i]).getPcdBuildDefinition() != null) {
- ObjectMap.put("PcdBuildDefinition", moduleSA.getPcdBuildDefinition());
- }
- if (((ModuleSADocument.ModuleSA) result[i]).getModuleSaBuildOptions() != null) {
- ObjectMap.put("ModuleSaBuildOptions", moduleSA.getModuleSaBuildOptions());
- }
-
- //
- // Get Fpd SA Module attribute and create FpdMoudleIdentification.
- //
- if (moduleSA.isSetSupArchList()) {
- arch = moduleSA.getSupArchList().toString();
- } else {
- arch = null;
- }
-
- // TBD
- fvBinding = null;
- saVersion = ((ModuleSADocument.ModuleSA) result[i]).getModuleVersion();
-
- saGuid = moduleSA.getModuleGuid();
- pkgGuid = moduleSA.getPackageGuid();
- pkgVersion = moduleSA.getPackageVersion();
-
- //
- // Create Module Identification which have class member of package
- // identification.
- //
- PackageIdentification pkgId = new PackageIdentification(null, pkgGuid, pkgVersion);
- GlobalData.refreshPackageIdentification(pkgId);
-
- ModuleIdentification saId = new ModuleIdentification(null, saGuid, saVersion);
- saId.setPackage(pkgId);
- GlobalData.refreshModuleIdentification(saId);
-
-
-
- //
- // Create FpdModule Identification which have class member of module
- // identification
- //
- String[] archList = new String[0];
- if (arch == null || arch.trim().length() == 0) {
- archList = GlobalData.getToolChainInfo().getArchs();
- } else {
- archList = arch.split(" ");
- }
- for (int j = 0; j < archList.length; j++) {
- FpdModuleIdentification fpdSaId = new FpdModuleIdentification(saId, archList[j]);
-
- if (fvBinding != null) {
- fpdSaId.setFvBinding(fvBinding);
- }
-
- //
- // Put element to Map<FpdModuleIdentification, Map<String,
- // Object>>.
- //
- fpdModuleMap.put(fpdSaId, ObjectMap);
- }
- }
- return fpdModuleMap;
- }
-
- /**
- * Retrieve valid image names
- *
- * @returns valid iamges name list if elements are found at the known xpath
- * @returns empty list if nothing is there
- */
- public String[] getFpdValidImageNames() {
- String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='ImageName']/FvImageNames" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null) {
- return new String[0];
- }
-
- String[] result = new String[queryResult.length];
- for (int i = 0; i < queryResult.length; i++) {
- result[i] = ((XmlString) queryResult[i]).getStringValue();
- }
-
- return result;
- }
-
- public Node getFpdUserExtensionPreBuild() {
- String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='0']" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null || queryResult.length == 0) {
- return null;
- }
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];
-
- return a.getDomNode();
- }
-
- public Node getFpdUserExtensionPostBuild() {
- String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and @Identifier='1']" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null || queryResult.length == 0) {
- return null;
- }
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[0];
-
- return a.getDomNode();
- }
-
- public Node[] getFpdUserExtensions() {
- String[] xPath = new String[] { "/UserExtensions[@UserID='TianoCore' and not(@Identifier='1') and not(@Identifier='0')]" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null || queryResult.length == 0) {
- return new Node[0];
- }
-
- Node[] nodeList = new Node[queryResult.length];
- for (int i = 0; i < queryResult.length; ++i) {
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)queryResult[i];
- nodeList[i] = a.getDomNode();
- }
-
- return nodeList;
- }
- /**
- * Retrieve FV image option information
- *
- * @param fvName
- * FV image name
- *
- * @returns option name/value list if elements are found at the known xpath
- * @returns empty list if nothing is there
- */
- public String[][] getFpdOptions(String fvName) {
- String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Options' and ./FvImageNames='"
- + fvName + "']/FvImageOptions" };
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null) {
- return new String[0][];
- }
- ArrayList<String[]> list = new ArrayList<String[]>();
- for (int i = 0; i < queryResult.length; i++) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];
- List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item
- .getNameValueList();
- Iterator iter = namevalues.iterator();
- while (iter.hasNext()) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter
- .next();
- list.add(new String[] { nvItem.getName(), nvItem.getValue() });
- }
- }
- String[][] result = new String[list.size()][2];
- for (int i = 0; i < list.size(); i++) {
- result[i][0] = list.get(i)[0];
- result[i][1] = list.get(i)[1];
- }
- return result;
-
- }
-
- public XmlObject getFpdBuildOptions() {
- String[] xPath = new String[] { "/BuildOptions" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
-
- if (queryResult == null || queryResult.length == 0) {
- return null;
- }
- return (XmlObject)queryResult[0];
- }
-
- public PlatformIdentification getFpdHeader() {
- String[] xPath = new String[] { "/PlatformHeader" };
-
- Object[] returns = get("PlatformSurfaceArea", xPath);
-
- if (returns == null || returns.length == 0) {
- return null;
- }
- PlatformHeaderDocument.PlatformHeader header = (PlatformHeaderDocument.PlatformHeader) returns[0];
-
- String name = header.getPlatformName();
-
- String guid = header.getGuidValue();
-
- String version = header.getVersion();
-
- return new PlatformIdentification(name, guid, version);
- }
-
- /**
- * Retrieve FV image attributes information
- *
- * @param fvName
- * FV image name
- *
- * @returns attribute name/value list if elements are found at the known
- * xpath
- * @returns empty list if nothing is there
- */
- public String[][] getFpdAttributes(String fvName) {
- String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Attributes' and ./FvImageNames='"
- + fvName + "']/FvImageOptions" };
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null) {
- return new String[0][];
- }
- ArrayList<String[]> list = new ArrayList<String[]>();
- for (int i = 0; i < queryResult.length; i++) {
-
- FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];
- List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();
- Iterator iter = namevalues.iterator();
- while (iter.hasNext()) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter
- .next();
- list.add(new String[] { nvItem.getName(), nvItem.getValue() });
- }
- }
- String[][] result = new String[list.size()][2];
- for (int i = 0; i < list.size(); i++) {
- result[i][0] = list.get(i)[0];
- result[i][1] = list.get(i)[1];
- }
- return result;
- }
-
- /**
- * Retrieve flash definition file name
- *
- * @returns file name if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String getFlashDefinitionFile() {
- String[] xPath = new String[] { "/PlatformDefinitions/FlashDeviceDefinitions/FlashDefinitionFile" };
-
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null || queryResult.length == 0) {
- return null;
- }
-
- FileNameConvention filename = (FileNameConvention) queryResult[queryResult.length - 1];
- return filename.getStringValue();
- }
-
- public String[][] getFpdGlobalVariable() {
- String[] xPath = new String[] { "/Flash/FvImages/NameValue" };
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null) {
- return new String[0][];
- }
-
- String[][] result = new String[queryResult.length][2];
-
- for (int i = 0; i < queryResult.length; i++) {
- FvImagesDocument.FvImages.NameValue item = (FvImagesDocument.FvImages.NameValue)queryResult[i];
- result[i][0] = item.getName();
- result[i][1] = item.getValue();
- }
- return result;
- }
-
- /**
- * Retrieve FV image component options
- *
- * @param fvName
- * FV image name
- *
- * @returns name/value pairs list if elements are found at the known xpath
- * @returns empty list if nothing is there
- */
- public String[][] getFpdComponents(String fvName) {
- String[] xPath = new String[] { "/Flash/FvImages/FvImage[@Type='Components' and ./FvImageNames='"+ fvName + "']/FvImageOptions" };
- Object[] queryResult = get("PlatformSurfaceArea", xPath);
- if (queryResult == null) {
- return new String[0][];
- }
-
- ArrayList<String[]> list = new ArrayList<String[]>();
- for (int i = 0; i < queryResult.length; i++) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions item = (FvImagesDocument.FvImages.FvImage.FvImageOptions) queryResult[i];
- List<FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue> namevalues = item.getNameValueList();
- Iterator iter = namevalues.iterator();
- while (iter.hasNext()) {
- FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue nvItem = (FvImagesDocument.FvImages.FvImage.FvImageOptions.NameValue) iter
- .next();
- list.add(new String[] { nvItem.getName(), nvItem.getValue() });
- }
- }
- String[][] result = new String[list.size()][2];
- for (int i = 0; i < list.size(); i++) {
- result[i][0] = list.get(i)[0];
- result[i][1] = list.get(i)[1];
- }
- return result;
- }
-
- /**
- * Retrieve PCD tokens
- *
- * @returns CName/ItemType pairs list if elements are found at the known
- * xpath
- * @returns null if nothing is there
- */
- public String[][] getPcdTokenArray() {
- String[] xPath = new String[] { "/PcdData" };
-
- Object[] returns = get("PCDs", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- return null;
- }
-
- /**
- * Retrieve MAS header
- *
- * @return
- * @return
- */
- public ModuleIdentification getMsaHeader() {
- String[] xPath = new String[] { "/" };
- Object[] returns = get("MsaHeader", xPath);
-
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- MsaHeader msaHeader = (MsaHeader) returns[0];
- //
- // Get BaseName, ModuleType, GuidValue, Version
- // which in MsaHeader.
- //
- String name = msaHeader.getModuleName();
- String moduleType = msaHeader.getModuleType().toString();
- String guid = msaHeader.getGuidValue();
- String version = msaHeader.getVersion();
-
- ModuleIdentification moduleId = new ModuleIdentification(name, guid,
- version);
-
- moduleId.setModuleType(moduleType);
-
- return moduleId;
- }
-
- /**
- * Retrieve Extern Specification
- *
- * @param
- *
- * @return String[] If have specification element in the <extern> String[0]
- * If no specification element in the <extern>
- *
- */
-
- public String[] getExternSpecificaiton() {
- String[] xPath = new String[] { "/Specification" };
-
- Object[] queryResult = get("Externs", xPath);
- if (queryResult == null) {
- return new String[0];
- }
-
- String[] specificationList = new String[queryResult.length];
- for (int i = 0; i < queryResult.length; i++) {
- specificationList[i] = ((Sentence)queryResult[i])
- .getStringValue();
- }
- return specificationList;
- }
-
- /**
- * Retreive MsaFile which in SPD
- *
- * @param
- * @return String[][3] The string sequence is ModuleName, ModuleGuid,
- * ModuleVersion, MsaFile String[0][] If no msafile in SPD
- */
- public String[] getSpdMsaFile() {
- String[] xPath = new String[] { "/MsaFiles" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
- if (returns == null) {
- return new String[0];
- }
-
- List<String> filenameList = ((MsaFilesDocument.MsaFiles) returns[0])
- .getFilenameList();
- return filenameList.toArray(new String[filenameList.size()]);
- }
-
- /**
- * Reteive
- */
- public Map<String, String[]> getSpdLibraryClasses() {
- String[] xPath = new String[] { "/LibraryClassDeclarations/LibraryClass" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- //
- // Create Map, Key - LibraryClass, String[] - LibraryClass Header file.
- //
- Map<String, String[]> libClassHeaderMap = new HashMap<String, String[]>();
-
- if (returns == null) {
- return libClassHeaderMap;
- }
-
- for (int i = 0; i < returns.length; i++) {
- LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass library = (LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass) returns[i];
- libClassHeaderMap.put(library.getName(), new String[] { library
- .getIncludeHeader() });
- }
- return libClassHeaderMap;
- }
-
- /**
- * Reteive
- */
- public Map<String, String> getSpdPackageHeaderFiles() {
- String[] xPath = new String[] { "/PackageHeaders/IncludePkgHeader" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- //
- // Create Map, Key - ModuleType, String - PackageInclude Header file.
- //
- Map<String, String> packageIncludeMap = new HashMap<String, String>();
-
- if (returns == null) {
- return packageIncludeMap;
- }
-
- for (int i = 0; i < returns.length; i++) {
- PackageHeadersDocument.PackageHeaders.IncludePkgHeader includeHeader = (PackageHeadersDocument.PackageHeaders.IncludePkgHeader) returns[i];
- packageIncludeMap.put(includeHeader.getModuleType().toString(),
- includeHeader.getStringValue());
- }
- return packageIncludeMap;
- }
-
- public PackageIdentification getSpdHeader() {
- String[] xPath = new String[] { "/SpdHeader" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- if (returns == null || returns.length == 0) {
- return null;
- }
-
- SpdHeaderDocument.SpdHeader header = (SpdHeaderDocument.SpdHeader) returns[0];
-
- String name = header.getPackageName();
-
- String guid = header.getGuidValue();
-
- String version = header.getVersion();
-
- return new PackageIdentification(name, guid, version);
- }
-
- /**
- * Reteive
- */
- public Map<String, String[]> getSpdGuid() {
- String[] xPath = new String[] { "/GuidDeclarations/Entry" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- //
- // Create Map, Key - GuidName, String[] - C_NAME & GUID value.
- //
- Map<String, String[]> guidDeclMap = new HashMap<String, String[]>();
- if (returns == null) {
- return guidDeclMap;
- }
-
- for (int i = 0; i < returns.length; i++) {
- GuidDeclarationsDocument.GuidDeclarations.Entry entry = (GuidDeclarationsDocument.GuidDeclarations.Entry) returns[i];
- String[] guidPair = new String[2];
- guidPair[0] = entry.getCName();
- guidPair[1] = entry.getGuidValue();
- guidDeclMap.put(entry.getCName(), guidPair);
- }
- return guidDeclMap;
- }
-
- /**
- * Reteive
- */
- public Map<String, String[]> getSpdProtocol() {
- String[] xPath = new String[] { "/ProtocolDeclarations/Entry" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- //
- // Create Map, Key - protocolName, String[] - C_NAME & GUID value.
- //
- Map<String, String[]> protoclMap = new HashMap<String, String[]>();
-
- if (returns == null) {
- return protoclMap;
- }
-
- for (int i = 0; i < returns.length; i++) {
- ProtocolDeclarationsDocument.ProtocolDeclarations.Entry entry = (ProtocolDeclarationsDocument.ProtocolDeclarations.Entry) returns[i];
- String[] protocolPair = new String[2];
-
- protocolPair[0] = entry.getCName();
- protocolPair[1] = entry.getGuidValue();
- protoclMap.put(entry.getCName(), protocolPair);
- }
- return protoclMap;
- }
-
- /**
- * getSpdPpi() Retrieve the SPD PPI Entry
- *
- * @param
- * @return Map<String, String[2]> if get the PPI entry from SPD. Key - PPI
- * Name String[0] - PPI CNAME String[1] - PPI Guid Null if no PPI
- * entry in SPD.
- */
- public Map<String, String[]> getSpdPpi() {
- String[] xPath = new String[] { "/PpiDeclarations/Entry" };
-
- Object[] returns = get("PackageSurfaceArea", xPath);
-
- //
- // Create Map, Key - protocolName, String[] - C_NAME & GUID value.
- //
- Map<String, String[]> ppiMap = new HashMap<String, String[]>();
-
- if (returns == null) {
- return ppiMap;
- }
-
- for (int i = 0; i < returns.length; i++) {
- PpiDeclarationsDocument.PpiDeclarations.Entry entry = (PpiDeclarationsDocument.PpiDeclarations.Entry) returns[i];
- String[] ppiPair = new String[2];
- ppiPair[0] = entry.getCName();
- ppiPair[1] = entry.getGuidValue();
- ppiMap.put(entry.getCName(), ppiPair);
- }
- return ppiMap;
- }
-
- /**
- * Retrieve module Guid string
- *
- * @returns GUILD string if elements are found at the known xpath
- * @returns null if nothing is there
- */
- public String getModuleGuid() {
- String[] xPath = new String[] { "" };
-
- Object[] returns = get("MsaHeader", xPath);
- if (returns != null && returns.length > 0) {
- String guid = ((MsaHeaderDocument.MsaHeader) returns[0])
- .getGuidValue();
- return guid;
- }
-
- return null;
- }
-
- //
- // For new Pcd
- //
- public ModuleSADocument.ModuleSA[] getFpdModuleSAs() {
- String[] xPath = new String[] { "/FrameworkModules/ModuleSA" };
- Object[] result = get("PlatformSurfaceArea", xPath);
- if (result != null) {
- return (ModuleSADocument.ModuleSA[]) result;
- }
- return new ModuleSADocument.ModuleSA[0];
-
- }
-
- /**
- Get name array who contains all PCDs in a module according to specified arch.
-
- @param arch The specified architecture type.
-
- @return String[] return all PCDs name into array, if no any PCD used by
- this module, a String[0] array is returned.
- **/
- public String[] getModulePcdEntryNameArray(String arch) {
- PcdCodedDocument.PcdCoded.PcdEntry[] pcdEntries = null;
- java.util.List archList = null;
- java.util.List<String> results = new java.util.ArrayList<String> ();
- int index;
- String[] xPath = new String[] {"/PcdEntry"};
- Object[] returns = get ("PcdCoded", xPath);
-
- if (returns == null) {
- return new String[0];
- }
-
- pcdEntries = (PcdCodedDocument.PcdCoded.PcdEntry[])returns;
-
- for (index = 0; index < pcdEntries.length; index ++) {
- archList = pcdEntries[index].getSupArchList();
- //
- // If the ArchList is specified in MSA for this PCD, need check
- // current arch whether can support by this PCD.
- //
- if (archList != null) {
- if (archList.contains(arch)) {
- results.add(new String(pcdEntries[index].getCName()));
- }
- } else {
- //
- // If no ArchList is specificied in MSA for this PCD, that means
- // this PCD support all architectures.
- //
- results.add(new String(pcdEntries[index].getCName()));
- }
- }
-
- if (results.size() == 0) {
- return new String[0];
- }
-
- String[] retArray = new String[results.size()];
- results.toArray(retArray);
-
- return retArray;
- }
-
- /**
- Search in a List for a given string
-
- @return boolean
- **/
- public boolean contains(List list, String str) {
- if (list == null || list.size()== 0) {
- return true;
- }
-
- return list.contains(str);
- }
-
- public boolean isHaveTianoR8FlashMap(){
- String[] xPath = new String[] {"/"};
- Object[] returns = get ("Externs", xPath);
-
- if (returns == null) {
- return false;
- }
-
- ExternsDocument.Externs ext = (ExternsDocument.Externs)returns[0];
-
- if (ext.getTianoR8FlashMapH()){
- return true;
- }else {
- return false;
- }
- }
-
- public Node getPeiApriori(String fvName) {
- String[] xPath = new String[] { "/BuildOptions/UserExtensions[@UserID='APRIORI' and @Identifier='0' and ./FvName='" + fvName + "']" };
- Object[] result = get("PlatformSurfaceArea", xPath);
-
- if (result == null || result.length == 0) {
- return null;
- }
-
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)result[0];
-
- return a.getDomNode();
- }
-
- public Node getDxeApriori(String fvName) {
- String[] xPath = new String[] { "/BuildOptions/UserExtensions[@UserID='APRIORI' and @Identifier='1' and ./FvName='" + fvName + "']" };
- Object[] result = get("PlatformSurfaceArea", xPath);
-
- if (result == null || result.length == 0) {
- return null;
- }
-
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)result[0];
-
- return a.getDomNode();
- }
-
- public Node getFpdModuleSequence(String fvName) {
- String[] xPath = new String[] { "/BuildOptions/UserExtensions[@UserID='IMAGES' and @Identifier='1' and ./FvName='" + fvName + "']" };
- Object[] result = get("PlatformSurfaceArea", xPath);
-
- if (result == null || result.length == 0) {
- return null;
- }
-
- UserExtensionsDocument.UserExtensions a = (UserExtensionsDocument.UserExtensions)result[0];
-
- return a.getDomNode();
- }
-
- /**
- Get the value of PCD by PCD cName
-
- @return PcdValue String of PcdComponentName
- null If don't find ComponentName Pcd
- **/
- public String getPcdValueBycName(String cName){
- String[] xPath = new String[] { "/PcdData" };
- Object[] returns = get("PcdBuildDefinition", xPath);
- if (returns == null || returns.length == 0) {
- return null;
- }
- for (int i = 0; i < returns.length; i++) {
- PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData pcdData = (PcdBuildDefinitionDocument.PcdBuildDefinition.PcdData)returns[i];
- if (pcdData.getCName().equalsIgnoreCase(cName)){
- return pcdData.getValue();
- }
- }
- return null;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/global/VariableTask.java b/Tools/Java/Source/GenBuild/org/tianocore/build/global/VariableTask.java
deleted file mode 100644
index 021b8d5b00..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/global/VariableTask.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/** @file
- * This file is ANT task VariableTask.
- *
- * VariableTask task implements part of ANT property task. The difference is
- * this task will override variable with same name, but ANT property task do not.
- *
- * 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.
- */
-package org.tianocore.build.global;
-
-import org.apache.tools.ant.BuildException;
-import org.apache.tools.ant.Task;
-
-/**
- * VariableTask task implements part of ANT property task. The difference is
- * this task will override variable with same name, but ANT property task do not.
- *
- * @since GenBuild 1.0
- */
-public class VariableTask extends Task {
-
- /**
- * property value
- */
- private String value;
-
- /**
- * property name
- */
- private String name;
-
- /**
- * Set property name.
- *
- * @param name property name
- */
- public void setName( String name ) {
- this.name = name;
- }
-
-
- /**
- * Set property value.
- *
- * @param value property value
- */
- public void setValue( String value ) {
- this.value = value;
- }
-
- /**
- * ANT task's entry point, will be called after init().
- *
- * @exception BuildException
- * If name or value is null
- */
- public void execute() throws BuildException {
- if (name == null || value == null) {
- throw new BuildException("Name or value cannot be null.");
- }
- getProject().setProperty(name, value);
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java
deleted file mode 100644
index c9bb7109d5..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/FpdModuleIdentification.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/** @file
- Java class FpdModuleIdentification is used to present a module identification
- from BaseName, GUID, Version, PackageName, and ARCH.
-
-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.
-**/
-package org.tianocore.build.id;
-
-
-/**
- This class is used to identify a module with Module Guid, Module Version,
- Package Guid, Package Version and Arch.
-
- @since GenBuild 1.0
-**/
-public class FpdModuleIdentification {
-
- private String arch;
-
- private String fvBinding = "NULL"; // Optional
-
- private ModuleIdentification module;
-
- /**
- Constructor Method.
-
- @param arch Build Arch
- @param fvBinding Belong to what FVs
- @param module ModuleIdentification
- **/
- public FpdModuleIdentification(String arch, String fvBinding, ModuleIdentification module){
- this.arch = arch;
- this.fvBinding = fvBinding;
- this.module = module;
- }
-
- /**
- Constructor Method.
-
- @param arch Build Arch
- @param module ModuleIdentification
- **/
- public FpdModuleIdentification(ModuleIdentification module, String arch){
- this.arch = arch;
- this.module = module;
- }
- /**
- Override java.lang.Object#equals.
-
- <p>Currently, use BaseName and ARCH to identify a module. It will enhance
- in the next version. </p>
-
- @see java.lang.Object#equals(java.lang.Object)
- **/
- public boolean equals(Object obj) {
- if (obj instanceof FpdModuleIdentification) {
- FpdModuleIdentification moduleIdObj = (FpdModuleIdentification)obj;
- if ( module.equals(moduleIdObj.module) && arch.equalsIgnoreCase(moduleIdObj.arch)) {
- return true;
- }
- return false;
- }
- else {
- return false;
- }
- }
-
- /**
- @param fvBinding
- **/
- public void setFvBinding(String fvBinding) {
- this.fvBinding = fvBinding;
- }
-
- /* (non-Javadoc)
- @see java.lang.Object#toString()
- **/
- public String toString(){
- return arch + ":" + module;
- }
-
- /**
- @return String fvBinding
- **/
- public String getFvBinding() {
- return fvBinding;
- }
-
- /**
- @return ModuleIdentification module ID
- **/
- public ModuleIdentification getModule() {
- return module;
- }
-
- /**
- @param module Module Identification
- **/
- public void setModule(ModuleIdentification module) {
- this.module = module;
- }
-
- /**
- @return String arch
- **/
- public String getArch() {
- return arch;
- }
-
- /**
- @param arch build ARCH
- **/
- public void setArch(String arch) {
- this.arch = arch;
- }
-
- /* (non-Javadoc)
- @see java.lang.Object#hashCode()
- **/
- public int hashCode(){
- return module.hashCode();
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/Identification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/Identification.java
deleted file mode 100644
index 677d096274..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/Identification.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/** @file
-This file is to define Identification class.
-
-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.
-**/
-
-package org.tianocore.build.id;
-
-
-/**
- This class is used to identify with its GUID and Version.
-
- @since GenBuild 1.0
-**/
-public class Identification {
-
- String name;
-
- String guid;
-
- String version;
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- **/
- Identification(String name, String guid, String version){
- this.name = name;
- this.guid = guid;
- this.version = version;
- }
-
- /**
- @param guid Guid
- @param version Version
- **/
- Identification(String guid, String version){
- this.guid = guid;
- this.version = version;
- }
-
- /* (non-Javadoc)
- @see java.lang.Object#equals(java.lang.Object)
- **/
- public boolean equals(Object obj) {
- if (obj instanceof Identification) {
- Identification id = (Identification)obj;
- if ( guid.equalsIgnoreCase(id.guid)) {
- if (version == null || id.version == null) {
- return true;
- }
- else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){
- return true;
- }
- else if (version.equalsIgnoreCase(id.version)) {
- return true;
- }
- }
- return false;
- }
- else {
- return super.equals(obj);
- }
- }
-
- /**
- @param name Name
- **/
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- @param guid Guid
- **/
- public void setGuid(String guid) {
- this.guid = guid;
- }
-
- /**
- @param version Version
- **/
- public void setVersion(String version) {
- this.version = version;
- }
-
- public String getGuid() {
- return guid;
- }
-
- /**
- @return String Name
- **/
- public String getName() {
- return name;
- }
-
- /**
- @return String Version
- **/
- public String getVersion() {
- return version;
- }
-
- public String toGuidString() {
- if (version == null || version.trim().equalsIgnoreCase("")) {
- return "[" + guid + "]";
- }
- else {
- return "[" + guid + "] and version [" + version + "]";
- }
- }
-
- /* (non-Javadoc)
- @see java.lang.Object#hashCode()
- **/
- public int hashCode(){
- return guid.toLowerCase().hashCode();
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
deleted file mode 100644
index 7082184dfd..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/ModuleIdentification.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/** @file
-This file is to define ModuleIdentification class.
-
-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.
-**/
-
-package org.tianocore.build.id;
-
-import java.io.File;
-
-/**
- This class is used to identify a module with Module Guid, Module Version,
- Package Guid, Package Version.
-
- @since GenBuild 1.0
-**/
-public class ModuleIdentification extends Identification {
-
- private PackageIdentification packageId;
-
- private File msaFile;
-
- private String moduleType;
-
- private boolean isLibrary = false;
-
- private boolean isBinary = false;
-
- private String constructor = "";
-
- private String destructor = "";
-
- /**
- @param guid Guid
- @param version Version
- **/
- public ModuleIdentification(String guid, String version){
- super(guid, version);
- }
-
- /**
- @param guid Guid
- @param version Version
- @param packageId Package Identification
- **/
- public ModuleIdentification(String guid, String version, PackageIdentification packageId){
- super(guid, version);
- this.packageId = packageId;
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- **/
- public ModuleIdentification(String name, String guid, String version){
- super(name, guid, version);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- @param packageId PackageIdentification
- **/
- public ModuleIdentification(String name, String guid, String version, PackageIdentification packageId){
- super(name, guid, version);
- this.packageId = packageId;
- }
-
- /**
- @return boolean is this module is library
- **/
- public boolean isLibrary() {
- return isLibrary;
- }
-
- /**
- @param isLibrary
- **/
- public void setLibrary(boolean isLibrary) {
- this.isLibrary = isLibrary;
- }
-
- /**
- @return boolean is this module is binary
- **/
- public boolean isBinary() {
- return isBinary;
- }
-
- /**
- @param isBinary
- **/
- public void setBinary(boolean isBinary) {
- this.isBinary = isBinary;
- }
-
- /**
- @return MSA File
- **/
- public File getMsaFile() {
- return msaFile;
- }
-
- /**
- @return Module relative path to package
- **/
- public String getModuleRelativePath() {
- if (msaFile.getParent().length() == packageId.getPackageDir().length()) {
- return ".";
- }
- return msaFile.getParent().substring(packageId.getPackageDir().length() + 1);
- }
-
- /**
- @param msaFile Set Msa File
- **/
- public void setMsaFile(File msaFile) {
- this.msaFile = msaFile;
- }
-
- public boolean equals(Object obj) {
- if (obj instanceof ModuleIdentification) {
- ModuleIdentification id = (ModuleIdentification)obj;
- if (guid.equalsIgnoreCase(id.getGuid()) && packageId.equals(id.getPackage())) {
- if (version == null || id.version == null) {
- return true;
- }
- else if (version.trim().equalsIgnoreCase("") || id.version.trim().equalsIgnoreCase("")){
- return true;
- }
- else if (version.equalsIgnoreCase(id.version)) {
- return true;
- }
- }
- return false;
- }
- else {
- return super.equals(obj);
- }
- }
-
- public String toString() {
- String nameString;
- String versionString;
- String packageString;
-
- if (name != null && name != "") {
- nameString = name;
- } else {
- if (guid != null && guid != "") {
- nameString = guid;
- } else {
- nameString = "UNKNOWN";
- }
- }
-
- if (version != null) {
- versionString = version;
- } else {
- versionString = "";
- }
-
- if (packageId != null) {
- packageString = packageId.toString();
- } else {
- packageString = "Package [UNKNOWN]";
- }
-
- return "Module [" + nameString + versionString + "] in " + packageString;
- }
-
- /**
- @param packageId set package identification
- **/
- public void setPackage(PackageIdentification packageId) {
- this.packageId = packageId;
- }
-
- /**
- @return get package identification
- **/
- public PackageIdentification getPackage() {
- return packageId;
- }
-
- /**
- @return get module type
- **/
- public String getModuleType() {
- return moduleType;
- }
-
- /**
- @param moduleType set module type
- **/
- public void setModuleType(String moduleType) {
- this.moduleType = moduleType;
- }
-
- /**
- @return String The module name
- **/
- public String getName() {
- return name;
- }
-
- /**
- @return boolean
- **/
- public boolean hasConstructor() {
- return constructor != "";
- }
-
- /**
- @return boolean
- */
- public boolean hasDestructor() {
- return destructor != "";
- }
-
- /**
- Set the constructor function name if this module is a library
-
- @param name
- */
- public void setConstructor(String name) {
- if (name != null) {
- constructor = name;
- }
- }
-
- /**
- Set the destructor function name if this module is a library
-
- @param name
- */
- public void setDestructor(String name) {
- if (name != null) {
- destructor = name;
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
deleted file mode 100644
index 9371f6afda..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/** @file
-This file is to define PackageIdentification class.
-
-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.
-**/
-
-package org.tianocore.build.id;
-import java.io.File;
-
-import org.tianocore.build.global.GlobalData;
-
-/**
- This class is used to identify a package.
-
- @since GenBuild 1.0
-**/
-public class PackageIdentification extends Identification{
-
- //
- // SPD file
- //
- private File spdFile;
-
- /**
- @param guid Guid
- @param version Version
- **/
- public PackageIdentification(String guid, String version){
- super(guid, version);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- **/
- public PackageIdentification(String name, String guid, String version){
- super(name, guid, version);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- @param spdFilename SPD file name
- **/
- public PackageIdentification(String name, String guid, String version, String spdFilename){
- super(name, guid, version);
- this.spdFile = new File(spdFilename);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- @param spdFile SPD file
- **/
- public PackageIdentification(String name, String guid, String version, File spdFile){
- super(name, guid, version);
- this.spdFile = spdFile;
- }
-
- /**
- set SPD file.
- @param spdFile SPD file
- **/
- public void setSpdFile(File spdFile) {
- this.spdFile = spdFile;
- }
-
- /**
- get SPD file
- @return SPD file
- **/
- public File getSpdFile() {
- return spdFile;
- }
-
- public String toString(){
- if (version == null || version.trim().equalsIgnoreCase("")) {
- return "package [" + name + "]";
- }
- else {
- return "package [" + name + " " + version + "]";
- }
- }
-
- /**
- get package directory
- @return Package Directory
- **/
- public String getPackageDir(){
- return spdFile.getParent();
- }
-
- /**
- get package relative directory.
- @return package relative directory
- **/
- public String getPackageRelativeDir(){
- String relativeDir =spdFile.getParent().substring(GlobalData.getWorkspacePath().length());
- if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
- relativeDir = relativeDir.substring(1);
- }
- return relativeDir;
- }
-
- public String getName() {
- return name;
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java b/Tools/Java/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
deleted file mode 100644
index 7c669652b8..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/** @file
-This file is to define PlatformIdentification class.
-
-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.
-**/
-
-package org.tianocore.build.id;
-import java.io.File;
-
-import org.tianocore.build.global.GlobalData;
-
-/**
- This class is used to identify a platform.
-
- @since GenBuild 1.0
-**/
-public class PlatformIdentification extends Identification{
-
- ///
- /// FPD file
- ///
- private File fpdFile;
-
- /**
- @param guid Guid
- @param version Version
- **/
- public PlatformIdentification(String guid, String version){
- super(guid, version);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- **/
- public PlatformIdentification(String name, String guid, String version){
- super(name, guid, version);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- @param fpdFilename Fpd File Name
- **/
- public PlatformIdentification(String name, String guid, String version, String fpdFilename){
- super(name, guid, version);
- this.fpdFile = new File(fpdFilename);
- }
-
- /**
- @param name Name
- @param guid Guid
- @param version Version
- @param fpdFile Fpd File
- **/
- public PlatformIdentification(String name, String guid, String version, File fpdFile){
- super(name, guid, version);
- this.fpdFile = fpdFile;
- }
-
- public String toString(){
- return "Platform " + name + "["+guid+"]";
- }
-
- /**
- Set FPD file.
- @param fpdFile FPD File
- **/
- public void setFpdFile(File fpdFile) {
- this.fpdFile = fpdFile;
- }
-
- /**
- Get FPD file.
- @return Fpd File
- **/
- public File getFpdFile() {
- return fpdFile;
- }
-
- /**
- Get FPD relative file to workspace.
- @return Fpd Relative file.
- **/
- public String getRelativeFpdFile (){
- String relativeDir = fpdFile.getPath().substring(GlobalData.getWorkspacePath().length());
- if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
- relativeDir = relativeDir.substring(1);
- }
- return relativeDir;
- }
-
- /**
- Get Platform relative directory to workspace.
- @return Platform relative directory
- **/
- public String getPlatformRelativeDir(){
- String relativeDir = fpdFile.getParent().substring(GlobalData.getWorkspacePath().length());
- if(relativeDir.startsWith("\\") || relativeDir.startsWith("/")) {
- relativeDir = relativeDir.substring(1);
- }
- return relativeDir;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java b/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
deleted file mode 100644
index a2f1c6a1bf..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PCDAutoGenAction.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/** @file
- PCDAutoGenAction class.
-
- This class is to manage how to generate the PCD information into Autogen.c and
- Autogen.h.
-
-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.
-
-**/
-package org.tianocore.build.pcd.action;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.tianocore.build.FrameworkBuildTask;
-import org.tianocore.build.autogen.CommonDefinition;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.id.ModuleIdentification;
-import org.tianocore.common.logger.EdkLog;
-import org.tianocore.pcd.action.BuildAction;
-import org.tianocore.pcd.entity.MemoryDatabaseManager;
-import org.tianocore.pcd.entity.Token;
-import org.tianocore.pcd.entity.UsageIdentification;
-import org.tianocore.pcd.entity.UsageInstance;
-import org.tianocore.pcd.exception.BuildActionException;
-
-/**
- This class is to manage how to generate the PCD information into Autogen.c
- and Autogen.h.
-**/
-public class PCDAutoGenAction extends BuildAction {
- ///
- /// The reference of DBManager in GlobalData class.
- ///
- private MemoryDatabaseManager dbManager;
-
- ///
- /// The identification for a UsageInstance.
- ///
- private UsageIdentification usageId;
-
- ///
- /// Whether current autogen is for building library used by current module.
- ///
- private boolean isBuildUsedLibrary;
-
- ///
- /// One of PEI_PCD_DRIVER, DXE_PCD_DRIVER, NOT_PCD_DRIVER
- ///
- private CommonDefinition.PCD_DRIVER_TYPE pcdDriverType;
-
- ///
- /// The generated string for header file.
- ///
- private String hAutoGenString;
-
- ///
- /// The generated string for C code file.
- ///
- private String cAutoGenString;
-
- ///
- /// The name array of <PcdCoded> in a module.
- ///
- private String[] pcdNameArrayInMsa;
-
- private UsageIdentification parentId = null;
- /**
- Set parameter moduleId
-
- @param moduleName the module name parameter.
- **/
- public void setUsageId(UsageIdentification usageId) {
- this.usageId = usageId;
- }
-
- /**
- Set paramter pcdDriverType
-
- @param pcdDriverType the driver type for PCD
- **/
- public void setPcdDriverType(CommonDefinition.PCD_DRIVER_TYPE pcdDriverType) {
- this.pcdDriverType = pcdDriverType;
- }
- /**
- set isBuildUsedLibrary parameter.
-
- @param isBuildUsedLibrary
- **/
- public void setIsBuildUsedLibrary(boolean isBuildUsedLibrary) {
- this.isBuildUsedLibrary = isBuildUsedLibrary;
- }
-
- /**
- set pcdNameArrayInMsa parameter.
-
- @param pcdNameArrayInMsa
- */
- public void setPcdNameArrayInMsa(String[] pcdNameArrayInMsa) {
- this.pcdNameArrayInMsa = pcdNameArrayInMsa;
- }
-
- /**
- Get the output of generated string for header file.
-
- @return the string of header file for PCD
- **/
- public String getHAutoGenString() {
- return hAutoGenString;
- }
-
- /**
- Get the output of generated string for C Code file.
-
- @return the string of C code file for PCD
- **/
- public String getCAutoGenString() {
- return cAutoGenString;
- }
-
-
- /**
- Construct function
-
- This function mainly initialize some member variable.
-
- @param moduleId the identification for module
- @param arch the architecture for module
- @param isBuildUsedLibary Is the current module library.
- @param pcdNameArrayInMsa the pcd name array got from MSA file.
- @param pcdDriverType one of PEI_PCD_DRIVER, DXE_PCD_DRIVER,
- NOT_PCD_DRIVER
- **/
- public PCDAutoGenAction(ModuleIdentification moduleId,
- String arch,
- boolean isBuildUsedLibrary,
- String[] pcdNameArrayInMsa,
- CommonDefinition.PCD_DRIVER_TYPE pcdDriverType,
- ModuleIdentification parentId) {
- dbManager = null;
- hAutoGenString = "";
- cAutoGenString = "";
-
- setUsageId(new UsageIdentification(moduleId.getName(),
- moduleId.getGuid(),
- moduleId.getPackage().getName(),
- moduleId.getPackage().getGuid(),
- arch,
- moduleId.getVersion(),
- moduleId.getModuleType()));
- if (parentId != null) {
- this.parentId = new UsageIdentification(parentId.getName(),
- parentId.getGuid(),
- parentId.getPackage().getName(),
- parentId.getPackage().getGuid(),
- arch,
- parentId.getVersion(),
- parentId.getModuleType());
- }
- setIsBuildUsedLibrary(isBuildUsedLibrary);
- setPcdNameArrayInMsa(pcdNameArrayInMsa);
- setPcdDriverType(pcdDriverType);
- }
-
- /**
- Override function: check the parameter for action class.
-
- @throws BuildActionException Bad parameter.
- **/
- public void checkParameter() {
- }
-
- /**
- Core execution function for this action class.
-
- All PCD information of this module comes from memory dabase. The collection
- work should be done before this action execution.
- Currently, we should generated all PCD information(maybe all dynamic) as array
- in Pei emulated driver for simulating PCD runtime database.
-
- @throws BuildActionException Failed to execute this aciton class.
- **/
- public void performAction() {
- EdkLog.log(EdkLog.EDK_DEBUG, "Starting PCDAutoGenAction to generate autogen.h and autogen.c!...");
-
- dbManager = GlobalData.getPCDMemoryDBManager();
-
- if(dbManager.getDBSize() == 0) {
- return;
- }
-
- EdkLog.log(EdkLog.EDK_DEBUG, "PCD memory database contains " + dbManager.getDBSize() + " PCD tokens.");
-
- generateAutogenForModule();
- }
-
- /**
- Generate the autogen string for a common module.
-
- All PCD information of this module comes from memory dabase. The collection
- work should be done before this action execution.
- **/
- private void generateAutogenForModule()
- {
- int index, index2;
- List<UsageInstance> usageInstanceArray, usageContext;
- String[] guidStringArray = null;
- String guidStringCName = null;
- String guidString = null;
- String moduleName = usageId.moduleName;
- UsageInstance usageInstance = null;
- boolean found = false;
-
- usageInstanceArray = null;
-
- if (FrameworkBuildTask.multithread) {
- if (parentId == null) {
- usageInstanceArray = dbManager.getUsageInstanceArrayById(usageId);
- } else if ((pcdNameArrayInMsa != null) && (pcdNameArrayInMsa.length > 0)) {
- usageContext = dbManager.getUsageInstanceArrayById(parentId);
- //
- // For building library package, although all module are library, but PCD entries of
- // these library should be used to autogen.
- //
- if (usageContext == null) {
- usageInstanceArray = dbManager.getUsageInstanceArrayById(usageId);
- } else {
- usageInstanceArray = new ArrayList<UsageInstance>();
-
- //
- // Try to find all PCD defined in library's PCD in all <PcdEntry> in module's
- // <ModuleSA> in FPD file.
- //
- for (index = 0; index < pcdNameArrayInMsa.length; index++) {
- found = false;
- for (index2 = 0; index2 < usageContext.size(); index2 ++) {
- if (pcdNameArrayInMsa[index].equalsIgnoreCase(usageContext.get(index2).parentToken.cName)) {
- usageInstanceArray.add(usageContext.get(index2));
- found = true;
- break;
- }
- }
-
- if (!found) {
- //
- // All library's PCD should instanted in module's <ModuleSA> who
- // use this library instance. If not, give errors.
- //
- throw new BuildActionException (String.format("Module %s using library instance %s; the PCD %s " +
- "is required by this library instance, but can not be found " +
- "in the %s's <ModuleSA> in the FPD file!",
- MemoryDatabaseManager.CurrentModuleName,
- moduleName,
- pcdNameArrayInMsa[index],
- MemoryDatabaseManager.CurrentModuleName
- ));
- }
- }
- }
- }
- } else {
- if (!isBuildUsedLibrary) {
- usageInstanceArray = dbManager.getUsageInstanceArrayById(usageId);
- MemoryDatabaseManager.UsageInstanceContext = usageInstanceArray;
- MemoryDatabaseManager.CurrentModuleName = moduleName;
- } else if ((pcdNameArrayInMsa != null) && (pcdNameArrayInMsa.length > 0)) {
- usageContext = MemoryDatabaseManager.UsageInstanceContext;
- //
- // For building library package, although all module are library, but PCD entries of
- // these library should be used to autogen.
- //
- if (usageContext == null) {
- usageInstanceArray = dbManager.getUsageInstanceArrayById(usageId);
- } else {
- usageInstanceArray = new ArrayList<UsageInstance>();
-
- //
- // Try to find all PCD defined in library's PCD in all <PcdEntry> in module's
- // <ModuleSA> in FPD file.
- //
- for (index = 0; index < pcdNameArrayInMsa.length; index++) {
- found = false;
- for (index2 = 0; index2 < usageContext.size(); index2 ++) {
- if (pcdNameArrayInMsa[index].equalsIgnoreCase(usageContext.get(index2).parentToken.cName)) {
- usageInstanceArray.add(usageContext.get(index2));
- found = true;
- break;
- }
- }
-
- if (!found) {
- //
- // All library's PCD should instanted in module's <ModuleSA> who
- // use this library instance. If not, give errors.
- //
- throw new BuildActionException (String.format("Module %s using library instance %s; the PCD %s " +
- "is required by this library instance, but can not be found " +
- "in the %s's <ModuleSA> in the FPD file!",
- MemoryDatabaseManager.CurrentModuleName,
- moduleName,
- pcdNameArrayInMsa[index],
- MemoryDatabaseManager.CurrentModuleName
- ));
- }
- }
- }
- }
- }
- if (usageInstanceArray == null) {
- return;
- }
-
- //
- // Generate all PCD entry for a module.
- //
- for(index = 0; index < usageInstanceArray.size(); index ++) {
- usageInstance = usageInstanceArray.get(index);
- //
- // Before generate any PCD information into autogen.h/autogen.c for a module,
- // generate TokenSpaceGuid array variable firstly. For every dynamicEx type
- // PCD in this module the token, they are all reference to TokenSpaceGuid
- // array.
- //
- if (usageInstanceArray.get(index).modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {
- guidStringArray = usageInstance.parentToken.tokenSpaceName.split("-");
- guidStringCName = "_gPcd_TokenSpaceGuid_" +
- usageInstance.parentToken.tokenSpaceName.replaceAll("-", "_");
- guidString = String.format("{ 0x%s, 0x%s, 0x%s, {0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s}}",
- guidStringArray[0],
- guidStringArray[1],
- guidStringArray[2],
- (guidStringArray[3].substring(0, 2)),
- (guidStringArray[3].substring(2, 4)),
- (guidStringArray[4].substring(0, 2)),
- (guidStringArray[4].substring(2, 4)),
- (guidStringArray[4].substring(4, 6)),
- (guidStringArray[4].substring(6, 8)),
- (guidStringArray[4].substring(8, 10)),
- (guidStringArray[4].substring(10, 12)));
-
- Pattern pattern = Pattern.compile("(" + guidStringCName + ")+?");
- Matcher matcher = pattern.matcher(cAutoGenString + " ");
- //
- // Find whether this guid array variable has been generated into autogen.c
- // For different DyanmicEx pcd token who use same token space guid, the token space
- // guid array should be only generated once.
- //
- if (!matcher.find()) {
- hAutoGenString += String.format("extern EFI_GUID %s;\r\n", guidStringCName);
- if (!isBuildUsedLibrary) {
- cAutoGenString += String.format("GLOBAL_REMOVE_IF_UNREFERENCED EFI_GUID %s = %s;\r\n",
- guidStringCName,
- guidString);
- }
- }
- }
-
- usageInstance.generateAutoGen(isBuildUsedLibrary);
- //
- // For every PCD entry for this module(usage instance), autogen string would
- // be appand.
- //
- hAutoGenString += usageInstance.getHAutogenStr() + "\r\n";
- cAutoGenString += usageInstance.getCAutogenStr();
- }
-
- if (pcdDriverType == CommonDefinition.PCD_DRIVER_TYPE.PEI_PCD_DRIVER) {
- hAutoGenString += MemoryDatabaseManager.PcdPeimHString;
- cAutoGenString += MemoryDatabaseManager.PcdPeimCString;
- } else if (pcdDriverType == CommonDefinition.PCD_DRIVER_TYPE.DXE_PCD_DRIVER) {
- hAutoGenString += MemoryDatabaseManager.PcdDxeHString;
- cAutoGenString += MemoryDatabaseManager.PcdDxeCString;
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java b/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java
deleted file mode 100644
index d848d1f561..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PcdDatabase.java
+++ /dev/null
@@ -1,1740 +0,0 @@
-/** @file
- PcdDatabase class.
-
-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.
-
-**/
-package org.tianocore.build.pcd.action;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.UUID;
-import org.tianocore.pcd.entity.DynamicTokenValue;
-import org.tianocore.pcd.entity.Token;
-import org.tianocore.pcd.exception.EntityException;
-
-/**
- CStructTypeDeclaration
-
- This class is used to store the declaration string, such as
- "UINT32 PcdPlatformFlashBaseAddress", of
- each memember in the C structure, which is a standard C language
- feature used to implement a simple and efficient database for
- dynamic(ex) type PCD entry.
-**/
-class CStructTypeDeclaration {
- String key;
- int alignmentSize;
- String cCode;
- boolean initTable;
-
- public CStructTypeDeclaration (String key, int alignmentSize, String cCode, boolean initTable) {
- this.key = key;
- this.alignmentSize = alignmentSize;
- this.cCode = cCode;
- this.initTable = initTable;
- }
-}
-
-/**
- StringTable
-
- This class is used to store the String in a PCD database.
-
-**/
-class StringTable {
- class UnicodeString {
- //
- // In Schema, we define VariableName in DynamicPcdBuildDefinitions in FPD
- // file to be HexWordArrayType. For example, Unicode String L"Setup" is
- // <VariableName>0x0053 0x0065 0x0074 0x0075 0x0070</VariableName>.
- // We use raw to differentiate if the String is in form of L"Setup" (raw is false) or
- // in form of {0x0053, 0x0065, 0x0074, 0x0075, 0x0070}
- //
- // This str is the string that can be pasted directly into the C structure.
- // For example, this str can be two forms:
- //
- // L"Setup",
- // {0x0053, 0065, 0x0074, 0x0075, 0x0070, 0x0000}, //This is another form of L"Setup"
- //
- public String str;
- //
- // This len includes the NULL character at the end of the String.
- //
- public int len;
-
- public UnicodeString (String str, int len) {
- this.str = str;
- this.len = len;
- }
- }
-
- private ArrayList<UnicodeString> al;
- private ArrayList<String> alComments;
- private String phase;
- int stringTableCharNum;
-
- public StringTable (String phase) {
- this.phase = phase;
- al = new ArrayList<UnicodeString>();
- alComments = new ArrayList<String>();
- stringTableCharNum = 0;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.StringTableSizeMacro, phase, getSize());
- }
-
- private int getSize () {
- //
- // We have at least one Unicode Character in the table.
- //
- return stringTableCharNum == 0 ? 1 : stringTableCharNum;
- }
-
- public String getExistanceMacro () {
- return String.format(PcdDatabase.StringTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable) {
- final String stringTable = "StringTable";
- final String tab = "\t";
- final String newLine = "\r\n";
- final String commaNewLine = ",\r\n";
-
- CStructTypeDeclaration decl;
-
- String cDeclCode = "";
- String cInstCode = "";
-
- //
- // If we have a empty StringTable
- //
- if (al.size() == 0) {
- cDeclCode += String.format("%-20s%s[1]; /* StringTable is empty */", "UINT16", stringTable) + newLine;
- decl = new CStructTypeDeclaration (
- stringTable,
- 2,
- cDeclCode,
- true
- );
- declaList.add(decl);
-
- cInstCode = String.format("/* %s */", stringTable) + newLine + tab + "{ 0 }";
- instTable.put(stringTable, cInstCode);
- } else {
-
- //
- // If there is any String in the StringTable
- //
- for (int i = 0; i < al.size(); i++) {
- UnicodeString uStr = al.get(i);
- String stringTableName;
-
- if (i == 0) {
- //
- // StringTable is a well-known name in the PCD DXE driver
- //
- stringTableName = stringTable;
-
- } else {
- stringTableName = String.format("%s_%d", stringTable, i);
- cDeclCode += tab;
- }
- cDeclCode += String.format("%-20s%s[%d]; /* %s */", "UINT16",
- stringTableName, uStr.len,
- alComments.get(i))
- + newLine;
-
- if (i == 0) {
- cInstCode = "/* StringTable */" + newLine;
- }
-
- cInstCode += tab + String.format("%s /* %s */", uStr.str, alComments.get(i));
- if (i != al.size() - 1) {
- cInstCode += commaNewLine;
- }
- }
-
- decl = new CStructTypeDeclaration (
- stringTable,
- 2,
- cDeclCode,
- true
- );
- declaList.add(decl);
-
- instTable.put(stringTable, cInstCode);
- }
- }
-
- public int add (List inputStr, Token token) {
- String str;
-
- str = "{";
-
- for (int i = 0; i < inputStr.size(); i++) {
- str += " " + inputStr.get(i) + ",";
- }
-
- str += " 0x0000";
-
- str += "}";
- //
- // This is a raw Unicode String
- //
- return addToTable (str, inputStr.size() + 1, token);
- }
-
- public int add (String inputStr, Token token) {
-
- int len;
- String str = inputStr;
-
- //
- // The input can be two types:
- // "L\"Bootmode\"" or "Bootmode".
- // We drop the L\" and \" for the first type.
- if (str.startsWith("L\"") && str.endsWith("\"")) {
- //
- // Substract the character of "L", """, """.
- // and add in the NULL character. So it is 2.
- //
- len = str.length() - 2;
- } else {
- //
- // Include the NULL character.
- //
- len = str.length() + 1;
- str = "L\"" + str + "\"";
- }
-
- //
- // After processing, this is L"A String Sample" type of string.
- //
- return addToTable (str, len, token);
- }
-
- private int addToTable (String inputStr, int len, Token token) {
- int i;
- int pos;
-
- //
- // Check if StringTable has this String already.
- // If so, return the current pos.
- //
- for (i = 0, pos = 0; i < al.size(); i++) {
- UnicodeString s = al.get(i);;
-
- if (inputStr.equals(s.str)) {
- return pos;
- }
- pos += s.len;
- }
-
- i = stringTableCharNum;
- //
- // Include the NULL character at the end of String
- //
- stringTableCharNum += len;
- al.add(new UnicodeString(inputStr, len));
- alComments.add(token.getPrimaryKeyString());
-
- return i;
- }
-}
-
-/**
- SizeTable
-
- This class is used to store the Size information for
- POINTER TYPE PCD entry in a PCD database.
-
-**/
-class SizeTable {
- private ArrayList<ArrayList<Integer>> al;
- private ArrayList<String> alComments;
- private int len;
- private String phase;
-
- public SizeTable (String phase) {
- al = new ArrayList<ArrayList<Integer>>();
- alComments = new ArrayList<String>();
- len = 0;
- this.phase = phase;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.SizeTableSizeMacro, phase, getSize());
- }
-
- private int getSize() {
- return len == 0 ? 1 : len;
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {
- final String name = "SizeTable";
-
- CStructTypeDeclaration decl;
- String cCode;
-
- cCode = String.format(PcdDatabase.SizeTableDeclaration, phase);
- decl = new CStructTypeDeclaration (
- name,
- 2,
- cCode,
- true
- );
- declaList.add(decl);
-
-
- cCode = PcdDatabase.genInstantiationStr(getInstantiation());
- instTable.put(name, cCode);
- }
-
- private ArrayList<String> getInstantiation () {
- final String comma = ",";
- ArrayList<String> Output = new ArrayList<String>();
-
- Output.add("/* SizeTable */");
- Output.add("{");
- if (al.size() == 0) {
- Output.add("\t0");
- } else {
- for (int index = 0; index < al.size(); index++) {
- ArrayList<Integer> ial = al.get(index);
-
- String str = "\t";
-
- for (int index2 = 0; index2 < ial.size(); index2++) {
- str += " " + ial.get(index2).toString();
- if (index2 != ial.size() - 1) {
- str += comma;
- }
- }
-
- str += " /* " + alComments.get(index) + " */";
-
- if (index != (al.size() - 1)) {
- str += comma;
- }
-
- Output.add(str);
-
- }
- }
- Output.add("}");
-
- return Output;
- }
-
- public void add (Token token) {
-
- //
- // We only have size information for POINTER type PCD entry.
- //
- if (token.datumType != Token.DATUM_TYPE.POINTER) {
- return;
- }
-
- ArrayList<Integer> ial = token.getPointerTypeSize();
-
- len+= ial.size();
-
- al.add(ial);
- alComments.add(token.getPrimaryKeyString());
-
- return;
- }
-
-}
-
-/**
- GuidTable
-
- This class is used to store the GUIDs in a PCD database.
-**/
-class GuidTable {
- private ArrayList<UUID> al;
- private ArrayList<String> alComments;
- private String phase;
- private int len;
- private int bodyLineNum;
-
- public GuidTable (String phase) {
- this.phase = phase;
- al = new ArrayList<UUID>();
- alComments = new ArrayList<String>();
- len = 0;
- bodyLineNum = 0;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.GuidTableSizeMacro, phase, getSize());
- }
-
- private int getSize () {
- return (al.size() == 0)? 1 : al.size();
- }
-
- public String getExistanceMacro () {
- return String.format(PcdDatabase.GuidTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {
- final String name = "GuidTable";
-
- CStructTypeDeclaration decl;
- String cCode = "";
-
- cCode += String.format(PcdDatabase.GuidTableDeclaration, phase);
- decl = new CStructTypeDeclaration (
- name,
- 4,
- cCode,
- true
- );
- declaList.add(decl);
-
-
- cCode = PcdDatabase.genInstantiationStr(getInstantiation());
- instTable.put(name, cCode);
- }
-
- private String getUuidCString (UUID uuid) {
- String[] guidStrArray;
-
- guidStrArray =(uuid.toString()).split("-");
-
- return String.format("{0x%s, 0x%s, 0x%s, {0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s, 0x%s}}",
- guidStrArray[0],
- guidStrArray[1],
- guidStrArray[2],
- (guidStrArray[3].substring(0, 2)),
- (guidStrArray[3].substring(2, 4)),
- (guidStrArray[4].substring(0, 2)),
- (guidStrArray[4].substring(2, 4)),
- (guidStrArray[4].substring(4, 6)),
- (guidStrArray[4].substring(6, 8)),
- (guidStrArray[4].substring(8, 10)),
- (guidStrArray[4].substring(10, 12))
- );
- }
-
- private ArrayList<String> getInstantiation () {
- ArrayList<String> Output = new ArrayList<String>();
-
- Output.add("/* GuidTable */");
- Output.add("{");
-
- if (al.size() == 0) {
- Output.add("\t" + getUuidCString(new UUID(0, 0)));
- }
-
- for (int i = 0; i < al.size(); i++) {
- String str = "\t" + getUuidCString(al.get(i));
-
- str += "/* " + alComments.get(i) + " */";
- if (i != (al.size() - 1)) {
- str += ",";
- }
- Output.add(str);
- bodyLineNum++;
-
- }
- Output.add("}");
-
- return Output;
- }
-
- public int add (UUID uuid, String name) {
- //
- // Check if GuidTable has this entry already.
- // If so, return the GuidTable index.
- //
- for (int i = 0; i < al.size(); i++) {
- if (al.get(i).compareTo(uuid) == 0) {
- return i;
- }
- }
-
- len++;
- al.add(uuid);
- alComments.add(name);
-
- //
- // Return the previous Table Index
- //
- return len - 1;
- }
-
-}
-
-/**
- SkuIdTable
-
- This class is used to store the SKU IDs in a PCD database.
-
-**/
-class SkuIdTable {
- private ArrayList<Integer[]> al;
- private ArrayList<String> alComment;
- private String phase;
- private int len;
-
- public SkuIdTable (String phase) {
- this.phase = phase;
- al = new ArrayList<Integer[]>();
- alComment = new ArrayList<String>();
- len = 0;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.SkuIdTableSizeMacro, phase, getSize());
- }
-
- private int getSize () {
- return (len == 0)? 1 : len;
- }
-
- public String getExistanceMacro () {
- return String.format(PcdDatabase.SkuTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {
- final String name = "SkuIdTable";
-
- CStructTypeDeclaration decl;
- String cCode = "";
-
- cCode += String.format(PcdDatabase.SkuIdTableDeclaration, phase);
- decl = new CStructTypeDeclaration (
- name,
- 1,
- cCode,
- true
- );
- declaList.add(decl);
-
-
- cCode = PcdDatabase.genInstantiationStr(getInstantiation());
- instTable.put(name, cCode);
-
- //
- // SystemSkuId is in PEI phase PCD Database
- //
- if (phase.equalsIgnoreCase("PEI")) {
- decl = new CStructTypeDeclaration (
- "SystemSkuId",
- 1,
- String.format("%-20sSystemSkuId;\r\n", "SKU_ID"),
- true
- );
- declaList.add(decl);
-
- instTable.put("SystemSkuId", "0");
- }
-
- }
-
- private ArrayList<String> getInstantiation () {
- ArrayList<String> Output = new ArrayList<String> ();
-
- Output.add("/* SkuIdTable */");
- Output.add("{");
-
- if (al.size() == 0) {
- Output.add("\t0");
- }
-
- for (int index = 0; index < al.size(); index++) {
- String str;
-
- str = "/* " + alComment.get(index) + "*/ ";
- str += "/* MaxSku */ ";
-
-
- Integer[] ia = al.get(index);
-
- str += "\t" + ia[0].toString() + ", ";
- for (int index2 = 1; index2 < ia.length; index2++) {
- str += ia[index2].toString();
- if (!((index2 == ia.length - 1) && (index == al.size() - 1))) {
- str += ", ";
- }
- }
-
- Output.add(str);
-
- }
-
- Output.add("}");
-
- return Output;
- }
-
- public int add (Token token) {
-
- int index;
- int pos;
-
- //
- // Check if this SKU_ID Array is already in the table
- //
- pos = 0;
- for (Object o: al) {
- Integer [] s = (Integer[]) o;
- boolean different = false;
- if (s[0] == token.getSkuIdCount()) {
- for (index = 1; index < s.length; index++) {
- if (s[index] != token.skuData.get(index-1).id) {
- different = true;
- break;
- }
- }
- } else {
- different = true;
- }
- if (different) {
- pos += s[0] + 1;
- } else {
- return pos;
- }
- }
-
- Integer [] skuIds = new Integer[token.skuData.size() + 1];
- skuIds[0] = new Integer(token.skuData.size());
- for (index = 1; index < skuIds.length; index++) {
- skuIds[index] = new Integer(token.skuData.get(index - 1).id);
- }
-
- index = len;
-
- len += skuIds.length;
- al.add(skuIds);
- alComment.add(token.getPrimaryKeyString());
-
- return index;
- }
-
-}
-
-class LocalTokenNumberTable {
- private ArrayList<String> al;
- private ArrayList<String> alComment;
- private String phase;
- private int len;
-
- public LocalTokenNumberTable (String phase) {
- this.phase = phase;
- al = new ArrayList<String>();
- alComment = new ArrayList<String>();
-
- len = 0;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.LocalTokenNumberTableSizeMacro, phase, getSize())
- + String.format(PcdDatabase.LocalTokenNumberSizeMacro, phase, al.size());
- }
-
- public int getSize () {
- return (al.size() == 0)? 1 : al.size();
- }
-
- public String getExistanceMacro () {
- return String.format(PcdDatabase.DatabaseExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {
- final String name = "LocalTokenNumberTable";
-
- CStructTypeDeclaration decl;
- String cCode = "";
-
- cCode += String.format(PcdDatabase.LocalTokenNumberTableDeclaration, phase);
- decl = new CStructTypeDeclaration (
- name,
- 4,
- cCode,
- true
- );
- declaList.add(decl);
-
- cCode = PcdDatabase.genInstantiationStr(getInstantiation());
- instTable.put(name, cCode);
- }
-
- private ArrayList<String> getInstantiation () {
- ArrayList<String> output = new ArrayList<String>();
-
- output.add("/* LocalTokenNumberTable */");
- output.add("{");
-
- if (al.size() == 0) {
- output.add("\t0");
- }
-
- for (int index = 0; index < al.size(); index++) {
- String str;
-
- str = "\t" + (String)al.get(index);
-
- str += " /* " + alComment.get(index) + " */ ";
-
-
- if (index != (al.size() - 1)) {
- str += ",";
- }
-
- output.add(str);
-
- }
-
- output.add("}");
-
- return output;
- }
-
- public int add (Token token) {
- int index = len;
- String str;
-
- len++;
-
- str = String.format(PcdDatabase.offsetOfStrTemplate, phase, token.hasDefaultValue() ? "Init" : "Uninit", token.getPrimaryKeyString());
-
- if (token.isUnicodeStringType()) {
- str += " | PCD_TYPE_STRING";
- }
-
- if (token.isSkuEnable()) {
- str += " | PCD_TYPE_SKU_ENABLED";
- }
-
- if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.HII_TYPE) {
- str += " | PCD_TYPE_HII";
- }
-
- if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.VPD_TYPE) {
- str += " | PCD_TYPE_VPD";
- }
-
- switch (token.datumType) {
- case UINT8:
- case BOOLEAN:
- str += " | PCD_DATUM_TYPE_UINT8";
- break;
- case UINT16:
- str += " | PCD_DATUM_TYPE_UINT16";
- break;
- case UINT32:
- str += " | PCD_DATUM_TYPE_UINT32";
- break;
- case UINT64:
- str += " | PCD_DATUM_TYPE_UINT64";
- break;
- case POINTER:
- str += " | PCD_DATUM_TYPE_POINTER";
- break;
- }
-
- al.add(str);
- alComment.add(token.getPrimaryKeyString());
-
- return index;
- }
-}
-
-/**
- ExMapTable
-
- This class is used to store the table of mapping information
- between DynamicEX ID pair(Guid, TokenNumber) and
- the local token number assigned by PcdDatabase class.
-**/
-class ExMapTable {
-
- /**
- ExTriplet
-
- This class is used to store the mapping information
- between DynamicEX ID pair(Guid, TokenNumber) and
- the local token number assigned by PcdDatabase class.
- **/
- class ExTriplet {
- public Integer guidTableIdx;
- public Long exTokenNumber;
- public Long localTokenIdx;
-
- public ExTriplet (int guidTableIdx, long exTokenNumber, long localTokenIdx) {
- this.guidTableIdx = new Integer(guidTableIdx);
- this.exTokenNumber = new Long(exTokenNumber);
- this.localTokenIdx = new Long(localTokenIdx);
- }
- }
-
- private ArrayList<ExTriplet> al;
- private Map<ExTriplet, String> alComment;
- private String phase;
- private int len;
- private int bodyLineNum;
-
- public ExMapTable (String phase) {
- this.phase = phase;
- al = new ArrayList<ExTriplet>();
- alComment = new HashMap<ExTriplet, String>();
- bodyLineNum = 0;
- len = 0;
- }
-
- public String getSizeMacro () {
- return String.format(PcdDatabase.ExMapTableSizeMacro, phase, getTableLen())
- + String.format(PcdDatabase.ExTokenNumber, phase, al.size());
- }
-
- public String getExistanceMacro () {
- return String.format(PcdDatabase.ExMapTableExistenceMacro, phase, (al.size() == 0)? "TRUE":"FALSE");
- }
-
- public void genCode (ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) {
- final String exMapTableName = "ExMapTable";
-
- sortTable();
-
- CStructTypeDeclaration decl;
- String cCode = "";
-
- cCode += String.format(PcdDatabase.ExMapTableDeclaration, phase);
- decl = new CStructTypeDeclaration (
- exMapTableName,
- 4,
- cCode,
- true
- );
- declaList.add(decl);
-
-
- cCode = PcdDatabase.genInstantiationStr(getInstantiation());
- instTable.put(exMapTableName, cCode);
- }
-
- private ArrayList<String> getInstantiation () {
- ArrayList<String> Output = new ArrayList<String>();
-
- Output.add("/* ExMapTable */");
- Output.add("{");
- if (al.size() == 0) {
- Output.add("\t{0, 0, 0}");
- }
-
- int index;
- for (index = 0; index < al.size(); index++) {
- String str;
-
- ExTriplet e = (ExTriplet)al.get(index);
-
- str = "\t" + "{ " + String.format("0x%08X", e.exTokenNumber) + ", ";
- str += e.localTokenIdx.toString() + ", ";
- str += e.guidTableIdx.toString();
-
- str += "}" + " /* " + alComment.get(e) + " */" ;
-
- if (index != al.size() - 1) {
- str += ",";
- }
-
- Output.add(str);
- bodyLineNum++;
-
- }
-
- Output.add("}");
-
- return Output;
- }
-
- public int add (int localTokenIdx, long exTokenNum, int guidTableIdx, String name) {
- int index = len;
-
- len++;
- ExTriplet et = new ExTriplet(guidTableIdx, exTokenNum, localTokenIdx);
-
- al.add(et);
- alComment.put(et, name);
-
- return index;
- }
-
- private int getTableLen () {
- return al.size() == 0 ? 1 : al.size();
- }
-
- //
- // To simplify the algorithm for GetNextToken and GetNextTokenSpace in
- // PCD PEIM/Driver, we need to sort the ExMapTable according to the
- // following order:
- // 1) ExGuid
- // 2) ExTokenNumber
- //
- class ExTripletComp implements Comparator<ExTriplet> {
- public int compare (ExTriplet a, ExTriplet b) {
- if (a.guidTableIdx == b.guidTableIdx ) {
- //
- // exTokenNumber is long, we can't use simple substraction.
- //
- if (a.exTokenNumber > b.exTokenNumber) {
- return 1;
- } else if (a.exTokenNumber == b.exTokenNumber) {
- return 0;
- } else {
- return -1;
- }
- }
-
- return a.guidTableIdx - b.guidTableIdx;
- }
- }
-
- private void sortTable () {
- java.util.Comparator<ExTriplet> comparator = new ExTripletComp();
- java.util.Collections.sort(al, comparator);
- }
-}
-
-/**
- PcdDatabase
-
- This class is used to generate C code for Autogen.h and Autogen.c of
- a PCD service DXE driver and PCD service PEIM.
-**/
-public class PcdDatabase {
-
- private final static int SkuHeadAlignmentSize = 4;
- private final String newLine = "\r\n";
- private final String commaNewLine = ",\r\n";
- private final String tab = "\t";
- public final static String ExMapTableDeclaration = "DYNAMICEX_MAPPING ExMapTable[%s_EXMAPPING_TABLE_SIZE];\r\n";
- public final static String GuidTableDeclaration = "EFI_GUID GuidTable[%s_GUID_TABLE_SIZE];\r\n";
- public final static String LocalTokenNumberTableDeclaration = "UINT32 LocalTokenNumberTable[%s_LOCAL_TOKEN_NUMBER_TABLE_SIZE];\r\n";
- public final static String StringTableDeclaration = "UINT16 StringTable[%s_STRING_TABLE_SIZE];\r\n";
- public final static String SizeTableDeclaration = "SIZE_INFO SizeTable[%s_SIZE_TABLE_SIZE];\r\n";
- public final static String SkuIdTableDeclaration = "UINT8 SkuIdTable[%s_SKUID_TABLE_SIZE];\r\n";
-
-
- public final static String ExMapTableSizeMacro = "#define %s_EXMAPPING_TABLE_SIZE %d\r\n";
- public final static String ExTokenNumber = "#define %s_EX_TOKEN_NUMBER %d\r\n";
- public final static String GuidTableSizeMacro = "#define %s_GUID_TABLE_SIZE %d\r\n";
- public final static String LocalTokenNumberTableSizeMacro = "#define %s_LOCAL_TOKEN_NUMBER_TABLE_SIZE %d\r\n";
- public final static String LocalTokenNumberSizeMacro = "#define %s_LOCAL_TOKEN_NUMBER %d\r\n";
- public final static String SizeTableSizeMacro = "#define %s_SIZE_TABLE_SIZE %d\r\n";
- public final static String StringTableSizeMacro = "#define %s_STRING_TABLE_SIZE %d\r\n";
- public final static String SkuIdTableSizeMacro = "#define %s_SKUID_TABLE_SIZE %d\r\n";
-
-
- public final static String ExMapTableExistenceMacro = "#define %s_EXMAP_TABLE_EMPTY %s\r\n";
- public final static String GuidTableExistenceMacro = "#define %s_GUID_TABLE_EMPTY %s\r\n";
- public final static String DatabaseExistenceMacro = "#define %s_DATABASE_EMPTY %s\r\n";
- public final static String StringTableExistenceMacro = "#define %s_STRING_TABLE_EMPTY %s\r\n";
- public final static String SkuTableExistenceMacro = "#define %s_SKUID_TABLE_EMPTY %s\r\n";
-
- public final static String offsetOfSkuHeadStrTemplate = "offsetof(%s_PCD_DATABASE, %s.%s_SkuDataTable)";
- public final static String offsetOfVariableEnabledDefault = "offsetof(%s_PCD_DATABASE, %s.%s_VariableDefault_%d)";
- public final static String offsetOfStrTemplate = "offsetof(%s_PCD_DATABASE, %s.%s)";
-
- private final static String skuDataTableTemplate = "SkuDataTable";
-
-
- private StringTable stringTable;
- private GuidTable guidTable;
- private LocalTokenNumberTable localTokenNumberTable;
- private SkuIdTable skuIdTable;
- private SizeTable sizeTable;
- private ExMapTable exMapTable;
-
- private ArrayList<Token> alTokens;
- private String phase;
- private int assignedTokenNumber;
-
- //
- // Use two class global variable to store
- // temperary
- //
- private String privateGlobalName;
- private String privateGlobalCCode;
- //
- // After Major changes done to the PCD
- // database generation class PcdDatabase
- // Please increment the version and please
- // also update the version number in PCD
- // service PEIM and DXE driver accordingly.
- //
- private final int version = 2;
-
- private String hString;
- private String cString;
-
- /**
- Constructor for PcdDatabase class.
-
- <p>We have two PCD dynamic(ex) database for the Framework implementation. One
- for PEI phase and the other for DXE phase. </p>
-
- @param alTokens A ArrayList of Dynamic(EX) PCD entry.
- @param exePhase The phase to generate PCD database for: valid input
- is "PEI" or "DXE".
- @param startLen The starting Local Token Number for the PCD database. For
- PEI phase, the starting Local Token Number starts from 0.
- For DXE phase, the starting Local Token Number starts
- from the total number of PCD entry of PEI phase.
- @return void
- **/
- public PcdDatabase (ArrayList<Token> alTokens, String exePhase, int startLen) {
- phase = exePhase;
-
- stringTable = new StringTable(phase);
- guidTable = new GuidTable(phase);
- localTokenNumberTable = new LocalTokenNumberTable(phase);
- skuIdTable = new SkuIdTable(phase);
- sizeTable = new SizeTable(phase);
- exMapTable = new ExMapTable(phase);
-
- //
- // Local token number 0 is reserved for INVALID_TOKEN_NUMBER.
- // So we will increment 1 for the startLen passed from the
- // constructor.
- //
- assignedTokenNumber = startLen + 1;
- this.alTokens = alTokens;
- }
-
- private void getNonExAndExTokens (ArrayList<Token> alTokens, List<Token> nexTokens, List<Token> exTokens) {
- for (int i = 0; i < alTokens.size(); i++) {
- Token t = (Token)alTokens.get(i);
- if (t.isDynamicEx()) {
- exTokens.add(t);
- } else {
- nexTokens.add(t);
- }
- }
-
- return;
- }
-
- private int getDataTypeAlignmentSize (Token token) {
- switch (token.datumType) {
- case UINT8:
- return 1;
- case UINT16:
- return 2;
- case UINT32:
- return 4;
- case UINT64:
- return 8;
- case POINTER:
- return 1;
- case BOOLEAN:
- return 1;
- default:
- return 1;
- }
- }
-
- private int getHiiPtrTypeAlignmentSize(Token token) {
- switch (token.datumType) {
- case UINT8:
- return 1;
- case UINT16:
- return 2;
- case UINT32:
- return 4;
- case UINT64:
- return 8;
- case POINTER:
- if (token.isHiiEnable()) {
- if (token.isHiiDefaultValueUnicodeStringType()) {
- return 2;
- }
- }
- return 1;
- case BOOLEAN:
- return 1;
- default:
- return 1;
- }
- }
-
- private int getAlignmentSize (Token token) {
- if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.HII_TYPE) {
- return 2;
- }
-
- if (token.getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.VPD_TYPE) {
- return 4;
- }
-
- if (token.isUnicodeStringType()) {
- return 2;
- }
-
- return getDataTypeAlignmentSize(token);
- }
-
- public String getCString () {
- return cString;
- }
-
- public String getHString () {
- return hString;
- }
-
- private void genCodeWorker(Token t,
- ArrayList<CStructTypeDeclaration> declaList,
- HashMap<String, String> instTable, String phase)
- throws EntityException {
-
- CStructTypeDeclaration decl;
-
- //
- // Insert SKU_HEAD if isSkuEnable is true
- //
- if (t.isSkuEnable()) {
- int tableIdx;
- tableIdx = skuIdTable.add(t);
- decl = new CStructTypeDeclaration(t.getPrimaryKeyString(),
- SkuHeadAlignmentSize, getSkuEnabledTypeDeclaration(t), true);
- declaList.add(decl);
- instTable.put(t.getPrimaryKeyString(),
- getSkuEnabledTypeInstantiaion(t, tableIdx));
- }
-
- //
- // Insert PCD_ENTRY declaration and instantiation
- //
- getCDeclarationString(t);
-
- decl = new CStructTypeDeclaration(privateGlobalName,
- getAlignmentSize(t), privateGlobalCCode, t.hasDefaultValue());
- declaList.add(decl);
-
- if (t.hasDefaultValue()) {
- instTable.put(privateGlobalName,
- getTypeInstantiation(t, declaList, instTable, phase)
- );
- }
-
- }
-
- private void ProcessTokens (List<Token> tokens,
- ArrayList<CStructTypeDeclaration> cStructDeclList,
- HashMap<String, String> cStructInstTable,
- String phase
- )
- throws EntityException {
-
- for (int idx = 0; idx < tokens.size(); idx++) {
- Token t = tokens.get(idx);
-
- genCodeWorker (t, cStructDeclList, cStructInstTable, phase);
-
- sizeTable.add(t);
- localTokenNumberTable.add(t);
- t.tokenNumber = assignedTokenNumber++;
-
- //
- // Add a mapping if this dynamic PCD entry is a EX type
- //
- if (t.isDynamicEx()) {
- exMapTable.add((int)t.tokenNumber,
- t.dynamicExTokenNumber,
- guidTable.add(translateSchemaStringToUUID(t.tokenSpaceName), t.getPrimaryKeyString()),
- t.getPrimaryKeyString()
- );
- }
- }
-
- }
-
- public void genCode () throws EntityException {
-
- ArrayList<CStructTypeDeclaration> cStructDeclList = new ArrayList<CStructTypeDeclaration>();
- HashMap<String, String> cStructInstTable = new HashMap<String, String>();
-
- List<Token> nexTokens = new ArrayList<Token> ();
- List<Token> exTokens = new ArrayList<Token> ();
-
- getNonExAndExTokens (alTokens, nexTokens, exTokens);
-
- //
- // We have to process Non-Ex type PCD entry first. The reason is
- // that our optimization assumes that the Token Number of Non-Ex
- // PCD entry start from 1 (for PEI phase) and grows continously upwards.
- //
- // EX type token number starts from the last Non-EX PCD entry and
- // grows continously upwards.
- //
- ProcessTokens (nexTokens, cStructDeclList, cStructInstTable, phase);
- ProcessTokens (exTokens, cStructDeclList, cStructInstTable, phase);
-
- stringTable.genCode(cStructDeclList, cStructInstTable);
- skuIdTable.genCode(cStructDeclList, cStructInstTable, phase);
- exMapTable.genCode(cStructDeclList, cStructInstTable, phase);
- localTokenNumberTable.genCode(cStructDeclList, cStructInstTable, phase);
- sizeTable.genCode(cStructDeclList, cStructInstTable, phase);
- guidTable.genCode(cStructDeclList, cStructInstTable, phase);
-
- hString = genCMacroCode ();
-
- HashMap <String, String> result;
-
- result = genCStructCode(cStructDeclList,
- cStructInstTable,
- phase
- );
-
- hString += result.get("initDeclStr");
- hString += result.get("uninitDeclStr");
-
- hString += String.format("#define PCD_%s_SERVICE_DRIVER_AUTOGEN_VERSION %d", phase, version);
-
- cString = newLine + newLine + result.get("initInstStr");
-
- }
-
- private String genCMacroCode () {
- String macroStr = "";
-
- //
- // Generate size info Macro for all Tables
- //
- macroStr += guidTable.getSizeMacro();
- macroStr += stringTable.getSizeMacro();
- macroStr += skuIdTable.getSizeMacro();
- macroStr += localTokenNumberTable.getSizeMacro();
- macroStr += exMapTable.getSizeMacro();
- macroStr += sizeTable.getSizeMacro();
-
- //
- // Generate existance info Macro for all Tables
- //
- macroStr += guidTable.getExistanceMacro();
- macroStr += stringTable.getExistanceMacro();
- macroStr += skuIdTable.getExistanceMacro();
- macroStr += localTokenNumberTable.getExistanceMacro();
- macroStr += exMapTable.getExistanceMacro();
-
- macroStr += newLine;
-
- return macroStr;
- }
-
- private HashMap <String, String> genCStructCode(
- ArrayList<CStructTypeDeclaration> declaList,
- HashMap<String, String> instTable,
- String phase
- ) {
-
- int i;
- HashMap <String, String> result = new HashMap<String, String>();
- HashMap <Integer, ArrayList<String>> alignmentInitDecl = new HashMap<Integer, ArrayList<String>>();
- HashMap <Integer, ArrayList<String>> alignmentUninitDecl = new HashMap<Integer, ArrayList<String>>();
- HashMap <Integer, ArrayList<String>> alignmentInitInst = new HashMap<Integer, ArrayList<String>>();
-
- //
- // Initialize the storage for each alignment
- //
- for (i = 8; i > 0; i>>=1) {
- alignmentInitDecl.put(new Integer(i), new ArrayList<String>());
- alignmentInitInst.put(new Integer(i), new ArrayList<String>());
- alignmentUninitDecl.put(new Integer(i), new ArrayList<String>());
- }
-
- String initDeclStr = "typedef struct {" + newLine;
- String initInstStr = String.format("%s_PCD_DATABASE_INIT g%sPcdDbInit = { ", phase.toUpperCase(), phase.toUpperCase()) + newLine;
- String uninitDeclStr = "typedef struct {" + newLine;
-
- //
- // Sort all C declaration and instantiation base on Alignment Size
- //
- for (Object d : declaList) {
- CStructTypeDeclaration decl = (CStructTypeDeclaration) d;
-
- if (decl.initTable) {
- alignmentInitDecl.get(new Integer(decl.alignmentSize)).add(decl.cCode);
- alignmentInitInst.get(new Integer(decl.alignmentSize)).add(instTable.get(decl.key));
- } else {
- alignmentUninitDecl.get(new Integer(decl.alignmentSize)).add(decl.cCode);
- }
- }
-
- //
- // Generate code for every alignment size
- //
- boolean uinitDatabaseEmpty = true;
- for (int align = 8; align > 0; align >>= 1) {
- ArrayList<String> declaListBasedOnAlignment = alignmentInitDecl.get(new Integer(align));
- ArrayList<String> instListBasedOnAlignment = alignmentInitInst.get(new Integer(align));
- for (i = 0; i < declaListBasedOnAlignment.size(); i++) {
- initDeclStr += tab + declaListBasedOnAlignment.get(i);
- initInstStr += tab + instListBasedOnAlignment.get(i);
-
- //
- // We made a assumption that both PEI_PCD_DATABASE and DXE_PCD_DATABASE
- // has a least one data memember with alignment size of 1. So we can
- // remove the last "," in the C structure instantiation string. Luckily,
- // this is true as both data structure has SKUID_TABLE anyway.
- //
- if ((align == 1) && (i == declaListBasedOnAlignment.size() - 1)) {
- initInstStr += newLine;
- } else {
- initInstStr += commaNewLine;
- }
- }
-
- declaListBasedOnAlignment = alignmentUninitDecl.get(new Integer(align));
-
- if (declaListBasedOnAlignment.size() != 0) {
- uinitDatabaseEmpty = false;
- }
-
- for (Object d : declaListBasedOnAlignment) {
- String s = (String)d;
- uninitDeclStr += tab + s;
- }
- }
-
- if (uinitDatabaseEmpty) {
- uninitDeclStr += tab + String.format("%-20sdummy; /* PCD_DATABASE_UNINIT is emptry */\r\n", "UINT8");
- }
-
- initDeclStr += String.format("} %s_PCD_DATABASE_INIT;", phase) + newLine + newLine;
- initInstStr += "};" + newLine;
- uninitDeclStr += String.format("} %s_PCD_DATABASE_UNINIT;", phase) + newLine + newLine;
-
- result.put("initDeclStr", initDeclStr);
- result.put("initInstStr", initInstStr);
- result.put("uninitDeclStr", uninitDeclStr);
-
- return result;
- }
-
- public static String genInstantiationStr (ArrayList<String> alStr) {
- String str = "";
- for (int i = 0; i< alStr.size(); i++) {
- if (i != 0) {
- str += "\t";
- }
- str += alStr.get(i);
- if (i != alStr.size() - 1) {
- str += "\r\n";
- }
- }
-
- return str;
- }
-
- private String getSkuEnabledTypeDeclaration (Token token) {
- return String.format("%-20s%s;\r\n", "SKU_HEAD", token.getPrimaryKeyString());
- }
-
- private String getSkuEnabledTypeInstantiaion (Token token, int SkuTableIdx) {
-
- String offsetof = String.format(PcdDatabase.offsetOfSkuHeadStrTemplate, phase, token.hasDefaultValue()? "Init" : "Uninit", token.getPrimaryKeyString());
- return String.format("{ %s, %d } /* SKU_ENABLED: %s */", offsetof, SkuTableIdx, token.getPrimaryKeyString());
- }
-
- private String getDataTypeInstantiationForVariableDefault (Token token, String cName, int skuId) {
- return String.format("%s /* %s */", token.skuData.get(skuId).value.hiiDefaultValue, cName);
- }
-
- private String getCType (Token t)
- throws EntityException {
-
- if (t.isHiiEnable()) {
- return "VARIABLE_HEAD";
- }
-
- if (t.isVpdEnable()) {
- return "VPD_HEAD";
- }
-
- if (t.isUnicodeStringType()) {
- return "STRING_HEAD";
- }
-
- switch (t.datumType) {
- case UINT64:
- return "UINT64";
- case UINT32:
- return "UINT32";
- case UINT16:
- return "UINT16";
- case UINT8:
- return "UINT8";
- case BOOLEAN:
- return "BOOLEAN";
- case POINTER:
- return "UINT8";
- default:
- throw new EntityException("Unknown DatumType in getDataTypeCDeclaration");
- }
- }
-
- //
- // privateGlobalName and privateGlobalCCode is used to pass output to caller of getCDeclarationString
- //
- private void getCDeclarationString(Token t)
- throws EntityException {
-
- if (t.isSkuEnable()) {
- privateGlobalName = String.format("%s_%s", t.getPrimaryKeyString(), skuDataTableTemplate);
- } else {
- privateGlobalName = t.getPrimaryKeyString();
- }
-
- String type = getCType(t);
- if ((t.datumType == Token.DATUM_TYPE.POINTER) && (!t.isHiiEnable()) && (!t.isUnicodeStringType())) {
- int bufferSize;
- if (t.isASCIIStringType()) {
- //
- // Build tool will add a NULL string at the end of the ASCII string
- //
- bufferSize = t.datumSize + 1;
- } else {
- bufferSize = t.datumSize;
- }
- privateGlobalCCode = String.format("%-20s%s[%d][%d];\r\n", type, privateGlobalName, t.getSkuIdCount(), bufferSize);
- } else {
- privateGlobalCCode = String.format("%-20s%s[%d];\r\n", type, privateGlobalName, t.getSkuIdCount());
- }
- }
-
- private String getDataTypeDeclarationForVariableDefault (Token token, String cName, int skuId)
- throws EntityException {
-
- String typeStr;
-
- if (token.datumType == Token.DATUM_TYPE.UINT8) {
- typeStr = "UINT8";
- } else if (token.datumType == Token.DATUM_TYPE.UINT16) {
- typeStr = "UINT16";
- } else if (token.datumType == Token.DATUM_TYPE.UINT32) {
- typeStr = "UINT32";
- } else if (token.datumType == Token.DATUM_TYPE.UINT64) {
- typeStr = "UINT64";
- } else if (token.datumType == Token.DATUM_TYPE.BOOLEAN) {
- typeStr = "BOOLEAN";
- } else if (token.datumType == Token.DATUM_TYPE.POINTER) {
- int size;
- if (token.isHiiDefaultValueUnicodeStringType()) {
- typeStr = "UINT16";
- //
- // Include the NULL charactor
- //
- size = token.datumSize / 2 + 1;
- } else {
- typeStr = "UINT8";
- if (token.isHiiDefaultValueASCIIStringType()) {
- //
- // Include the NULL charactor
- //
- size = token.datumSize + 1;
- } else {
- size = token.datumSize;
- }
- }
- return String.format("%-20s%s[%d];\r\n", typeStr, cName, size);
- } else {
- throw new EntityException("Unknown DATUM_TYPE type in when generating code for VARIABLE_ENABLED PCD entry");
- }
-
- return String.format("%-20s%s;\r\n", typeStr, cName);
- }
-
- private String getTypeInstantiation (Token t, ArrayList<CStructTypeDeclaration> declaList, HashMap<String, String> instTable, String phase) throws EntityException {
-
- int i;
-
- String s;
- s = String.format("/* %s */", t.getPrimaryKeyString()) + newLine;
- s += tab + "{" + newLine;
-
- for (i = 0; i < t.skuData.size(); i++) {
- if (t.isUnicodeStringType()) {
- s += tab + tab + String.format(" %d ", stringTable.add(t.skuData.get(i).value.value, t));
- } else if (t.isHiiEnable()) {
- /* VPD_HEAD definition
- typedef struct {
- UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.
- UINT16 StringIndex; // Offset in String Table in units of UINT16.
- UINT16 Offset; // Offset in Variable
- UINT16 DefaultValueOffset; // Offset of the Default Value
- } VARIABLE_HEAD ;
- */
- String variableDefaultName = String.format("%s_VariableDefault_%d", t.getPrimaryKeyString(), i);
-
- s += tab + tab + String.format("{ %d, %d, %s, %s }", guidTable.add(t.skuData.get(i).value.variableGuid, t.getPrimaryKeyString()),
- stringTable.add(t.skuData.get(i).value.getStringOfVariableName(), t),
- t.skuData.get(i).value.variableOffset,
- String.format("offsetof(%s_PCD_DATABASE, Init.%s)", phase, variableDefaultName)
- );
- //
- // We need to support the default value, so we add the declaration and
- // the instantiation for the default value.
- //
- CStructTypeDeclaration decl = new CStructTypeDeclaration (variableDefaultName,
- getHiiPtrTypeAlignmentSize(t),
- getDataTypeDeclarationForVariableDefault(t, variableDefaultName, i),
- true
- );
- declaList.add(decl);
- instTable.put(variableDefaultName, getDataTypeInstantiationForVariableDefault (t, variableDefaultName, i));
- } else if (t.isVpdEnable()) {
- /* typedef struct {
- UINT32 Offset;
- } VPD_HEAD;
- */
- s += tab + tab + String.format("{ %s }", t.skuData.get(i).value.vpdOffset);
- } else {
- if (t.isByteStreamType()) {
- //
- // Byte stream type input has their own "{" "}", so we won't help to insert.
- //
- s += tab + tab + String.format(" %s ", t.skuData.get(i).value.value);
- } else {
- s += tab + tab + String.format("{ %s }", t.skuData.get(i).value.value);
- }
- }
-
- if (i != t.skuData.size() - 1) {
- s += commaNewLine;
- } else {
- s += newLine;
- }
-
- }
-
- s += tab + "}";
-
- return s;
- }
-
- public static String getPcdDatabaseCommonDefinitions () {
-
- String retStr;
-
- retStr = "//\r\n";
- retStr += "// The following definition will be generated by build tool\r\n";
- retStr += "//\r\n";
- retStr += "\r\n";
- retStr += "//\r\n";
- retStr += "// Common definitions\r\n";
- retStr += "//\r\n";
- retStr += "typedef UINT8 SKU_ID;\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_TYPE_SHIFT 28\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_TYPE_DATA (0x0 << PCD_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_TYPE_HII (0x8 << PCD_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_TYPE_VPD (0x4 << PCD_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_TYPE_SKU_ENABLED (0x2 << PCD_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_TYPE_STRING (0x1 << PCD_TYPE_SHIFT)\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_TYPE_ALL_SET (PCD_TYPE_DATA | PCD_TYPE_HII | PCD_TYPE_VPD | PCD_TYPE_SKU_ENABLED | PCD_TYPE_STRING)\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_DATUM_TYPE_SHIFT 24\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_DATUM_TYPE_POINTER (0x0 << PCD_DATUM_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_DATUM_TYPE_UINT8 (0x1 << PCD_DATUM_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_DATUM_TYPE_UINT16 (0x2 << PCD_DATUM_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_DATUM_TYPE_UINT32 (0x4 << PCD_DATUM_TYPE_SHIFT)\r\n";
- retStr += "#define PCD_DATUM_TYPE_UINT64 (0x8 << PCD_DATUM_TYPE_SHIFT)\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_DATUM_TYPE_ALL_SET (PCD_DATUM_TYPE_POINTER | \\\r\n";
- retStr += " PCD_DATUM_TYPE_UINT8 | \\\r\n";
- retStr += " PCD_DATUM_TYPE_UINT16 | \\\r\n";
- retStr += " PCD_DATUM_TYPE_UINT32 | \\\r\n";
- retStr += " PCD_DATUM_TYPE_UINT64)\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_DATABASE_OFFSET_MASK (~(PCD_TYPE_ALL_SET | PCD_DATUM_TYPE_ALL_SET))\r\n";
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " UINT32 ExTokenNumber;\r\n";
- retStr += " UINT16 LocalTokenNumber; // PCD Number of this particular platform build\r\n";
- retStr += " UINT16 ExGuidIndex; // Index of GuidTable\r\n";
- retStr += "} DYNAMICEX_MAPPING;\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " UINT32 SkuDataStartOffset; //We have to use offsetof MACRO as we don't know padding done by compiler\r\n";
- retStr += " UINT32 SkuIdTableOffset; //Offset from the PCD_DB\r\n";
- retStr += "} SKU_HEAD;\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " UINT16 GuidTableIndex; // Offset in Guid Table in units of GUID.\r\n";
- retStr += " UINT16 StringIndex; // Offset in String Table in units of UINT16.\r\n";
- retStr += " UINT16 Offset; // Offset in Variable\r\n";
- retStr += " UINT16 DefaultValueOffset; // Offset of the Default Value\r\n";
- retStr += "} VARIABLE_HEAD ;\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " UINT32 Offset;\r\n";
- retStr += "} VPD_HEAD;\r\n";
- retStr += "\r\n";
- retStr += "typedef UINT16 STRING_HEAD;\r\n";
- retStr += "\r\n";
- retStr += "typedef UINT16 SIZE_INFO;\r\n";
- retStr += "\r\n";
- retStr += "#define offsetof(s,m) (UINT32) (UINTN) &(((s *)0)->m)\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
-
- return retStr;
- }
-
- public static String getPcdDxeDatabaseDefinitions ()
- throws EntityException {
-
- String retStr = "";
-
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " DXE_PCD_DATABASE_INIT Init;\r\n";
- retStr += " DXE_PCD_DATABASE_UNINIT Uninit;\r\n";
- retStr += "} DXE_PCD_DATABASE;\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " PEI_PCD_DATABASE PeiDb;\r\n";
- retStr += " DXE_PCD_DATABASE DxeDb;\r\n";
- retStr += "} PCD_DATABASE;\r\n";
- retStr += "\r\n";
- retStr += "#define DXE_NEX_TOKEN_NUMBER (DXE_LOCAL_TOKEN_NUMBER - DXE_EX_TOKEN_NUMBER)\r\n";
- retStr += "\r\n";
- retStr += "#define PCD_TOTAL_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER + DXE_LOCAL_TOKEN_NUMBER)\r\n";
- retStr += "\r\n";
- retStr += "\r\n";
-
- return retStr;
- }
-
- public static String getPcdPeiDatabaseDefinitions ()
- throws EntityException {
-
- String retStr = "";
-
- retStr += "\r\n";
- retStr += "typedef struct {\r\n";
- retStr += " PEI_PCD_DATABASE_INIT Init;\r\n";
- retStr += " PEI_PCD_DATABASE_UNINIT Uninit;\r\n";
- retStr += "} PEI_PCD_DATABASE;\r\n";
- retStr += "\r\n";
- retStr += "#define PEI_NEX_TOKEN_NUMBER (PEI_LOCAL_TOKEN_NUMBER - PEI_EX_TOKEN_NUMBER)\r\n";
- retStr += "\r\n";
-
- return retStr;
- }
-
- /**
- Translate the schema string to UUID instance.
-
- In schema, the string of UUID is defined as following two types string:
- 1) GuidArrayType: pattern = 0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},(
- )*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})?
-
- 2) GuidNamingConvention: pattern =
- [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
-
- This function will convert string and create uuid instance.
-
- @param uuidString UUID string in XML file
-
- @return UUID UUID instance
- **/
- private UUID translateSchemaStringToUUID(String uuidString)
- throws EntityException {
- String temp;
- String[] splitStringArray;
- int index;
- int chIndex;
- int chLen;
-
- if (uuidString == null) {
- return null;
- }
-
- if (uuidString.length() == 0) {
- return null;
- }
-
- if (uuidString.equals("0") ||
- uuidString.equalsIgnoreCase("0x0")) {
- return new UUID(0, 0);
- }
-
- uuidString = uuidString.replaceAll("\\{", "");
- uuidString = uuidString.replaceAll("\\}", "");
-
- //
- // If the UUID schema string is GuidArrayType type then need translate
- // to GuidNamingConvention type at first.
- //
- if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) {
- splitStringArray = uuidString.split("," );
- if (splitStringArray.length != 11) {
- throw new EntityException ("[FPD file error] Wrong format for GUID string: " + uuidString);
- }
-
- //
- // Remove blank space from these string and remove header string "0x"
- //
- for (index = 0; index < 11; index ++) {
- splitStringArray[index] = splitStringArray[index].trim();
- splitStringArray[index] = splitStringArray[index].substring(2, splitStringArray[index].length());
- }
-
- //
- // Add heading '0' to normalize the string length
- //
- for (index = 3; index < 11; index ++) {
- chLen = splitStringArray[index].length();
- for (chIndex = 0; chIndex < 2 - chLen; chIndex ++) {
- splitStringArray[index] = "0" + splitStringArray[index];
- }
- }
-
- //
- // construct the final GuidNamingConvention string
- //
- temp = String.format("%s-%s-%s-%s%s-%s%s%s%s%s%s",
- splitStringArray[0],
- splitStringArray[1],
- splitStringArray[2],
- splitStringArray[3],
- splitStringArray[4],
- splitStringArray[5],
- splitStringArray[6],
- splitStringArray[7],
- splitStringArray[8],
- splitStringArray[9],
- splitStringArray[10]);
- uuidString = temp;
- }
-
- return UUID.fromString(uuidString);
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java b/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java
deleted file mode 100644
index 234fbff5fa..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/pcd/action/PlatformPcdPreprocessActionForBuilding.java
+++ /dev/null
@@ -1,359 +0,0 @@
-/** @file
- PlatformPcdPreprocessActionForBuilding class.
-
- This action class is to collect PCD information from MSA, SPD, FPD xml file.
- This class will be used for wizard and build tools, So it can *not* inherit
- from buildAction or wizardAction.
-
-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.
-
-**/
-package org.tianocore.build.pcd.action;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.xmlbeans.XmlException;
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;
-import org.tianocore.PcdBuildDefinitionDocument;
-import org.tianocore.PlatformSurfaceAreaDocument;
-import org.tianocore.build.exception.PlatformPcdPreprocessBuildException;
-import org.tianocore.build.global.GlobalData;
-import org.tianocore.build.id.FpdModuleIdentification;
-import org.tianocore.pcd.action.PlatformPcdPreprocessAction;
-import org.tianocore.pcd.entity.MemoryDatabaseManager;
-import org.tianocore.pcd.entity.ModulePcdInfoFromFpd;
-import org.tianocore.pcd.entity.Token;
-import org.tianocore.pcd.entity.UsageIdentification;
-import org.tianocore.pcd.exception.EntityException;
-import org.tianocore.pcd.exception.PlatformPcdPreprocessException;
-
-/**
- This action class is to collect PCD information from MSA, SPD, FPD xml file.
- This class will be used for wizard and build tools, So it can *not* inherit
- from buildAction or UIAction.
-**/
-public class PlatformPcdPreprocessActionForBuilding extends PlatformPcdPreprocessAction {
- ///
- /// FPD file path.
- ///
- private String fpdFilePath;
-
- ///
- /// Cache the fpd docment instance for private usage.
- ///
- private PlatformSurfaceAreaDocument fpdDocInstance;
-
- /**
- Set FPDFileName parameter for this action class.
-
- @param fpdFilePath fpd file path
- **/
- public void setFPDFilePath(String fpdFilePath) {
- this.fpdFilePath = fpdFilePath;
- }
-
- /**
- Common function interface for outer.
-
- @param fpdFilePath The fpd file path of current build or processing.
-
- @throws PlatformPreprocessBuildException
- The exception of this function. Because it can *not* be predict
- where the action class will be used. So only Exception can be throw.
-
- **/
- public void perform(String fpdFilePath)
- throws PlatformPcdPreprocessBuildException {
- this.fpdFilePath = fpdFilePath;
- checkParameter();
- execute();
- }
-
- /**
- Core execution function for this action class.
-
- This function work flows will be:
- 1) Collect and prepocess PCD information from FPD file, all PCD
- information will be stored into memory database.
- 2) Generate 3 strings for
- a) All modules using Dynamic(Ex) PCD entry.(Token Number)
- b) PEI PCDDatabase (C Structure) for PCD Service PEIM.
- c) DXE PCD Database (C structure) for PCD Service DXE.
-
-
- @throws EntityException Exception indicate failed to execute this action.
-
- **/
- public void execute() throws PlatformPcdPreprocessBuildException {
- String errorMessageHeader = "Failed to initialize the Pcd memory database because: ";
- String errorsForPreprocess = null;
-
- //
- // Get memoryDatabaseManager instance from GlobalData.
- // The memoryDatabaseManager should be initialized as static variable
- // in some Pre-process class.
- //
- setPcdDbManager(GlobalData.getPCDMemoryDBManager());
-
- //
- // Collect all PCD information defined in FPD file.
- // Evenry token defind in FPD will be created as an token into
- // memory database.
- //
- try {
- initPcdMemoryDbWithPlatformInfo();
- } catch (PlatformPcdPreprocessException exp) {
- throw new PlatformPcdPreprocessBuildException(errorMessageHeader + exp.getMessage());
- }
- errorsForPreprocess = this.getErrorString();
- if (errorsForPreprocess != null) {
- throw new PlatformPcdPreprocessBuildException(errorMessageHeader + "\r\n" + errorsForPreprocess);
- }
-
- //
- // Generate for PEI, DXE PCD DATABASE's definition and initialization.
- //
- try {
- genPcdDatabaseSourceCode ();
- } catch (EntityException exp) {
- throw new PlatformPcdPreprocessBuildException(errorMessageHeader + "\r\n" + exp.getMessage());
- }
- }
-
- /**
- Override function: implementate the method of get Guid string information from SPD file.
-
- @param guidCName Guid CName string.
-
- @return String Guid information from SPD file.
- **/
- public String getGuidInfoFromSpd(String guidCName) {
- return GlobalData.getGuidInfoFromCname(guidCName);
- }
-
- /**
- This function generates source code for PCD Database.
-
- @throws EntityException If the token does *not* exist in memory database.
-
- **/
- private void genPcdDatabaseSourceCode()
- throws EntityException {
- String PcdCommonHeaderString = PcdDatabase.getPcdDatabaseCommonDefinitions();
-
- ArrayList<Token> alPei = new ArrayList<Token> ();
- ArrayList<Token> alDxe = new ArrayList<Token> ();
-
- getPcdDbManager().getTwoPhaseDynamicRecordArray(alPei, alDxe);
- PcdDatabase pcdPeiDatabase = new PcdDatabase (alPei, "PEI", 0);
- pcdPeiDatabase.genCode();
- MemoryDatabaseManager.PcdPeimHString = PcdCommonHeaderString + pcdPeiDatabase.getHString() +
- PcdDatabase.getPcdPeiDatabaseDefinitions();
- MemoryDatabaseManager.PcdPeimCString = pcdPeiDatabase.getCString();
-
- PcdDatabase pcdDxeDatabase = new PcdDatabase(alDxe, "DXE", alPei.size());
- pcdDxeDatabase.genCode();
- MemoryDatabaseManager.PcdDxeHString = MemoryDatabaseManager.PcdPeimHString + pcdDxeDatabase.getHString() +
- PcdDatabase.getPcdDxeDatabaseDefinitions();
- MemoryDatabaseManager.PcdDxeCString = pcdDxeDatabase.getCString();
- }
-
- /**
- Override function: Get component array from FPD.
-
- This function maybe provided by some Global class.
-
- @return List<ModuleInfo> the component array.
- @throws PlatformPcdPreprocessException get all modules in <ModuleSA> in FPD file.
-
- **/
- public List<ModulePcdInfoFromFpd> getComponentsFromFpd()
- throws PlatformPcdPreprocessException {
- List<ModulePcdInfoFromFpd> allModules = new ArrayList<ModulePcdInfoFromFpd>();
- Map<FpdModuleIdentification, XmlObject> pcdBuildDefinitions = null;
- UsageIdentification usageId = null;
-
- pcdBuildDefinitions = GlobalData.getFpdPcdBuildDefinitions();
- if (pcdBuildDefinitions == null) {
- return null;
- }
-
- //
- // Loop map to retrieve all PCD build definition and Module id
- //
- Iterator item = pcdBuildDefinitions.keySet().iterator();
- while (item.hasNext()){
- FpdModuleIdentification id = (FpdModuleIdentification) item.next();
- usageId = new UsageIdentification(id.getModule().getName(),
- id.getModule().getGuid(),
- id.getModule().getPackage().getName(),
- id.getModule().getPackage().getGuid(),
- id.getArch(),
- id.getModule().getVersion(),
- id.getModule().getModuleType());
- allModules.add(
- new ModulePcdInfoFromFpd(
- usageId,
- ((PcdBuildDefinitionDocument)pcdBuildDefinitions.get(id)).getPcdBuildDefinition()));
- }
- return allModules;
- }
-
- /**
- Override function: Verify the datum value according its datum size and datum type, this
- function maybe moved to FPD verification tools in future.
-
- @param cName The token name
- @param moduleName The module who use this PCD token
- @param datum The PCD's datum
- @param datumType The PCD's datum type
- @param maxDatumSize The max size for PCD's Datum.
-
- @return String exception strings.
- */
- public String verifyDatum(String cName,
- String moduleName,
- String datum,
- Token.DATUM_TYPE datumType,
- int maxDatumSize) {
- //
- // In building system, datum should not be checked, the checking work
- // should be done by wizard tools or PCD verification tools.
- //
- return null;
- }
-
- /**
- Override function: Get dynamic information for a dynamic PCD from <DynamicPcdBuildDefinition> seciton in FPD file.
-
- This function should be implemented in GlobalData in future.
-
- @param token The token instance which has hold module's PCD information
- @param moduleName The name of module who will use this Dynamic PCD.
-
- @return DynamicPcdBuildDefinitions.PcdBuildData
- **/
- public DynamicPcdBuildDefinitions.PcdBuildData getDynamicInfoFromFpd(Token token,
- String moduleName)
- throws PlatformPcdPreprocessException {
- int index = 0;
- String exceptionString = null;
- String dynamicPrimaryKey = null;
- DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null;
- List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray = null;
- String tokenSpaceStrRet = null;
-
- //
- // If FPD document is not be opened, open and initialize it.
- // BUGBUG: The code should be moved into GlobalData in future.
- //
- if (fpdDocInstance == null) {
- try {
- fpdDocInstance = (PlatformSurfaceAreaDocument)XmlObject.Factory.parse(new File(fpdFilePath));
- } catch(IOException ioE) {
- throw new PlatformPcdPreprocessException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
- } catch(XmlException xmlE) {
- throw new PlatformPcdPreprocessException("Can't parse the FPD xml fle:" + fpdFilePath + "\n" + xmlE.getMessage());
- }
- }
-
- dynamicPcdBuildDefinitions = fpdDocInstance.getPlatformSurfaceArea().getDynamicPcdBuildDefinitions();
- if (dynamicPcdBuildDefinitions == null) {
- exceptionString = String.format("[FPD file error] There are no <PcdDynamicBuildDescriptions> elements in FPD file but there are Dynamic type "+
- "PCD entries %s in module %s!",
- token.cName,
- moduleName);
- putError(exceptionString);
- return null;
- }
-
- dynamicPcdBuildDataArray = dynamicPcdBuildDefinitions.getPcdBuildDataList();
- for (index = 0; index < dynamicPcdBuildDataArray.size(); index ++) {
- tokenSpaceStrRet = getGuidInfoFromSpd(dynamicPcdBuildDataArray.get(index).getTokenSpaceGuidCName());
-
- if (tokenSpaceStrRet == null) {
- exceptionString = "Fail to get token space guid for token " + dynamicPcdBuildDataArray.get(index).getCName();
- putError(exceptionString);
- continue;
- }
-
- dynamicPrimaryKey = Token.getPrimaryKeyString(dynamicPcdBuildDataArray.get(index).getCName(),
- tokenSpaceStrRet);
- if (dynamicPrimaryKey.equals(token.getPrimaryKeyString())) {
- return dynamicPcdBuildDataArray.get(index);
- }
- }
-
- return null;
- }
-
- /**
- Override function: get all <DynamicPcdBuildDefinition> from FPD file.
-
- @return List<DynamicPcdBuildDefinitions.PcdBuildData> All DYNAMIC PCD list in <DynamicPcdBuildDefinitions> in FPD file.
- @throws PlatformPcdPreprocessBuildException Failure to get dynamic information list.
-
- **/
- public List<DynamicPcdBuildDefinitions.PcdBuildData>
- getAllDynamicPcdInfoFromFpd()
- throws PlatformPcdPreprocessException {
- DynamicPcdBuildDefinitions dynamicPcdBuildDefinitions = null;
-
- //
- // Open fpd document to get <DynamicPcdBuildDefinition> Section.
- // BUGBUG: the function should be move GlobalData in furture.
- //
- if (fpdDocInstance == null) {
- try {
- fpdDocInstance = (PlatformSurfaceAreaDocument)XmlObject.Factory.parse(new File(fpdFilePath));
- } catch(IOException ioE) {
- throw new PlatformPcdPreprocessException("File IO error for xml file:" + fpdFilePath + "\n" + ioE.getMessage());
- } catch(XmlException xmlE) {
- throw new PlatformPcdPreprocessException("Can't parse the FPD xml fle:" + fpdFilePath + "\n" + xmlE.getMessage());
- }
- }
-
- dynamicPcdBuildDefinitions = fpdDocInstance.getPlatformSurfaceArea().getDynamicPcdBuildDefinitions();
- if (dynamicPcdBuildDefinitions == null) {
- return null;
- }
-
- return dynamicPcdBuildDefinitions.getPcdBuildDataList();
- }
-
- /**
- check parameter for this action.
-
- @throws PlatformPcdPreprocessBuildException Bad parameter.
- **/
- private void checkParameter() throws PlatformPcdPreprocessBuildException {
- File file = null;
-
- if (fpdFilePath == null) {
- throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!");
- }
-
- if (fpdFilePath.length() == 0) {
- throw new PlatformPcdPreprocessBuildException("FPDFileName should be empty for CollectPCDAtion!");
- }
-
- file = new File(fpdFilePath);
-
- if(!file.exists()) {
- throw new PlatformPcdPreprocessBuildException("FPD File " + fpdFilePath + " does not exist!");
- }
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java
deleted file mode 100644
index 4275f8eb78..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ConfigReader.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/** @file
- ConfigReader class.
-
- ConfigReader is used to read tool chain config file with flat format.
-
-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.
-**/
-package org.tianocore.build.toolchain;
-
-import org.apache.tools.ant.Project;
-
-import org.tianocore.build.exception.GenBuildException;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.ArrayList;
-import java.util.List;
-
-/**
-
- ConfigReader is used to read tool chain config file with flat format. Comments
- is line starting with character '#'.
-
- @since GenBuild 1.0
-**/
-public class ConfigReader {
-
- /**
- Parse specified tool chain definition file.
-
- @param filename The config file name with full path
-
- @return String[][] The definition array
- **/
- public static synchronized String[][] parse(Project prj, String filename) throws GenBuildException {
- return parse(prj, new File(filename));
- }
-
- /**
- Get all definitions in config file. the config file format is flat
- with "A=B". If line started with '#' looks as comments.
-
- @param configFile The config file
-
- @return String[][] The variables defined in the config file
-
- @throws GenBuildException
- Config file's format is not valid
- **/
- public static synchronized String[][] parse(Project prj, File configFile) throws GenBuildException {
- List<String> keyList = new ArrayList<String>(256);
- List<String> valueList = new ArrayList<String>(256);
- int lines = 0;
-
- try {
- FileReader reader = new FileReader(configFile);
- BufferedReader in = new BufferedReader(reader);
- String str;
-
- while ((str = in.readLine()) != null) {
- ++lines;
- str = str.trim();
- //
- // skip empty line, comment (start with '#')
- //
- if (str.length() == 0 || str.startsWith("#")) {
- continue;
- }
-
- //
- // stop if the definition line is not in "name=value" form
- //
- int index;
- if ((index = str.indexOf('=')) <= 0) {
- throw new GenBuildException("ERROR Processing file ["
- + configFile.getAbsolutePath()
- + "] (line " + lines + ").\n");
- }
-
- //
- // look as line "A = B"
- //
- keyList.add(str.substring(0, index).trim());
- if (prj != null) {
- valueList.add(prj.replaceProperties(str.substring(index + 1).trim()));
- } else {
- valueList.add(str.substring(index + 1).trim());
- }
- }
- } catch (Exception ex) {
- GenBuildException e = new GenBuildException("ERROR Processing file ["
- + configFile.getAbsolutePath()
- + "] (line " + lines + ").\n" + ex.getMessage());
- e.setStackTrace(ex.getStackTrace());
- throw e;
- }
-
- String[][] definitions = new String[2][keyList.size()];
- definitions[0] = (String[])keyList.toArray(definitions[0]);
- definitions[1] = (String[])valueList.toArray(definitions[1]);
-
- return definitions;
- }
-}
-
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java
deleted file mode 100644
index 9989ab65f8..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainConfig.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/** @file
- ToolChainConfig class.
-
- ToolChainConfig class parse all config files and get tool chain information.
-
-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.
-
-**/
-package org.tianocore.build.toolchain;
-
-import java.io.File;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.apache.tools.ant.Project;
-import org.tianocore.build.exception.GenBuildException;
-import org.tianocore.build.toolchain.ToolChainKey;
-import org.tianocore.build.toolchain.ToolChainMap;
-
-
-/**
-
- ToolChainConfig class parse all config files and get tool chain information.
-
- **/
-public class ToolChainConfig {
- //
- // tool chain definitions
- //
- private ToolChainMap config = null;
- //
- // tool chain information (how many targets, archs, etc.)
- //
- private ToolChainInfo info = new ToolChainInfo();
-
- /**
- Public construct method.
-
- @param toolChainFile File object representing the tool chain configuration file
- **/
- public ToolChainConfig (Project prj, File toolChainFile) throws GenBuildException {
- config = getToolChainConfig(prj, toolChainFile);
- parseToolChainDefKey(config.keySet());
- }
-
- /**
- Read tool chain definitions from specified file and put them in
- ToolChainMap class.
-
- @param ConfigFile The file containing tool chain definitions
-
- @return ToolChainMap
- **/
- private ToolChainMap getToolChainConfig(Project prj, File ConfigFile) throws GenBuildException {
- ToolChainMap map = new ToolChainMap();
- String[][] toolChainDef = ConfigReader.parse(prj, ConfigFile);
-
- for (int i = 0; i < toolChainDef[0].length; ++i) {
- map.put(toolChainDef[0][i], toolChainDef[1][i]);
- }
-
- return map;
- }
-
- /**
- Collect target, tool chain tag, arch and command information from key part
- of configuration
-
- @param toolChainDefKey The set of keys in tool chain configuration
- **/
- private void parseToolChainDefKey (Set<ToolChainKey> toolChainDefKey) {
- Iterator it = toolChainDefKey.iterator();
- while (it.hasNext()) {
- ToolChainKey key = (ToolChainKey)it.next();
- String[] keySet = key.getKeySet();
- info.addTargets(keySet[ToolChainElement.TARGET.value]);
- info.addTagnames(keySet[ToolChainElement.TOOLCHAIN.value]);
- info.addArchs(keySet[ToolChainElement.ARCH.value]);
- info.addCommands(keySet[ToolChainElement.TOOLCODE.value]);
- info.normalize();
- }
- }
-
- /**
- Return the tool chain configuration information in a Map form
-
- @return ToolChainMap Tool chain configurations in a ToolChainMap
- **/
- public ToolChainMap getConfig() {
- return config;
- }
-
- /**
- Return the tool chain's target, arch, tag and commands information
-
- @return ToolChainInfo Tool chain information summary
- **/
- public ToolChainInfo getConfigInfo() {
- return info;
- }
-
- /**
- override toString()
-
- @return String The converted configuration string in name=value form
- **/
- public String toString() {
- StringBuffer ts = new StringBuffer(10240);
-
- Iterator it = config.keySet().iterator();
- while (it.hasNext()) {
- ToolChainKey key = (ToolChainKey)it.next();
- ts.append(key.toString() + " = ");
- ts.append(config.get(key) + "\n");
- }
-
- return ts.toString();
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java
deleted file mode 100644
index 103b3a6362..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainElement.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
-ToolChainElement class
-
-ToolChainElement class is defining enumeration value of key part names.
-
-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.
-**/
-
-package org.tianocore.build.toolchain;
-
-/**
-
- This class is an enumeration definition for key elements in tool chain definition
- file.
-
- **/
-public class ToolChainElement {
- private static int nextValue = 0;
-
- //
- // "TARGET", "TOOLCHAIN", "ARCH", "TOOLCODE", "ATTRIBUTE"
- //
- public final static ToolChainElement TARGET = new ToolChainElement("TARGET");
- public final static ToolChainElement TOOLCHAIN = new ToolChainElement("TOOLCHAIN");
- public final static ToolChainElement ARCH = new ToolChainElement("ARCH");
- public final static ToolChainElement TOOLCODE = new ToolChainElement("TOOLCODE");
- public final static ToolChainElement ATTRIBUTE = new ToolChainElement("ATTRIBUTE");
-
- private final String name;
- public final int value = nextValue++;
-
- /**
- * Default constructor
- */
- private ToolChainElement(String name) {
- this.name = name;
- }
-
- public String toString() {
- return name;
- }
-}
-
-
-
-
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java
deleted file mode 100644
index 9952c0beda..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainInfo.java
+++ /dev/null
@@ -1,347 +0,0 @@
-/** @file
-ToolChainInfo class
-
-This file is to define ToolChainInfo class.
-
-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.
-**/
-
-package org.tianocore.build.toolchain;
-
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- ToolChainInfo collects valid build targets, tool chain tag, ARCHs and commands
- information for real build use.
- **/
-public class ToolChainInfo {
- //
- // build target set
- //
- private Set<String> targets = new LinkedHashSet<String>();
- //
- // tool chain tag name set
- //
- private Set<String> tagnames = new LinkedHashSet<String>();
- //
- // build archs set
- //
- private Set<String> archs = new LinkedHashSet<String>();
- //
- // build commands set
- //
- private Set<String> commands = new LinkedHashSet<String>();
-
- /**
- Add a list of targets in the form of string separated by space
-
- @param targetList target list string
- **/
- public void addTargets(String targetList) {
- //
- // targetList some targets separated by space " "
- //
- if (targetList == null || targetList.length() == 0) {
- targets.add("*");
- } else {
- addTargets(targetList.split(" "));
- }
- }
-
- /**
- Add a list of targets in the form of string array
-
- @param targetArray target string array
- **/
- public void addTargets(String[] targetArray) {
- if (targetArray != null ) {
- for (int i = 0; i < targetArray.length; i++) {
- targets.add(targetArray[i]);
- }
- }
- }
-
- /**
- Add a list of target in the form of set
-
- @param targetSet target string set
- **/
- public void addTargets(Set<String> targetSet) {
- if (targetSet != null) {
- targets.addAll(targetSet);
- }
- }
-
- /**
- Add a list of tool chain tag name in the form of string separated by space
-
- @param tagnameList Tool chain tag name list string
- **/
- public void addTagnames(String tagnameList) {
- //
- // tagnameList some tagnames separated by space " "
- //
- if (tagnameList == null || tagnameList.length() == 0) {
- tagnames.add("*");
- } else {
- addTagnames(tagnameList.split(" "));
- }
- }
-
- /**
- Add a list of tool chain tag name in the form of string array
-
- @param tagnameArray Tool chain tag names array
- **/
- public void addTagnames(String[] tagnameArray) {
- if (tagnameArray != null ) {
- for (int i = 0; i < tagnameArray.length; i++) {
- tagnames.add(tagnameArray[i]);
- }
- }
- }
-
- /**
- Add a list of tool chain tag name in the form of Set
-
- @param tagnameSet Tool chain tag names set
- **/
- public void addTagnames(Set<String> tagnameSet) {
- if (tagnameSet != null) {
- tagnames.addAll(tagnameSet);
- }
- }
-
- /**
- Add a list of ARCH in the form of string
-
- @param archList ARCH string
- **/
- public void addArchs(String archList) {
- //
- // archList some archs separated by space " "
- //
- if (archList == null || archList.length() == 0) {
- archs.add("*");
- } else {
- addArchs(archList.split(" "));
- }
- }
-
- /**
- Add a list of ARCH in the form of string array
-
- @param archArray ARCH array
- **/
- public void addArchs(String[] archArray) {
- if (archArray != null ) {
- for (int i = 0; i < archArray.length; i++) {
- archs.add(archArray[i]);
- }
- }
- }
-
- /**
- Add a list of ARCH in the form of set
-
- @param archSet ARCH set
- **/
- public void addArchs(Set<String> archSet) {
- if (archSet != null) {
- archs.addAll(archSet);
- }
- }
-
- /**
- Add a list of command in the form of string
-
- @param commandList Command list string
- **/
- public void addCommands(String commandList) {
- //
- // archList some archs separated by space " "
- //
- if (commandList == null || commandList.length() == 0) {
- commands.add("*");
- } else {
- addCommands(commandList.split(" "));
- }
- }
-
- /**
- Add a list of ARCH in the form of array
-
- @param commandArray Commands array
- **/
- public void addCommands(String[] commandArray) {
- if (commandArray != null ) {
- for (int i = 0; i < commandArray.length; i++) {
- commands.add(commandArray[i]);
- }
- }
- }
-
- /**
- Add a list of ARCH in the form of set
-
- @param commandSet Commands set
- **/
- public void addCommands(Set<String> commandSet) {
- if (commandSet != null) {
- commands.addAll(commandSet);
- }
- }
-
- /**
- Make a union operation on this ToolChainInfo and the given one.
-
- @param info Another ToolChainInfo object to merge with
-
- @return ToolChainInfo Merged ToolChainInfo object
- **/
- public ToolChainInfo union(ToolChainInfo info) {
- ToolChainInfo result = new ToolChainInfo();
- result.addTargets(union(this.targets, info.targets));
- result.addTagnames(union(this.tagnames, info.tagnames));
- result.addArchs(union(this.archs, info.archs));
- return result;
- }
-
- /**
- Make a intersection operation on this ToolChainInfo and the given one
-
- @param info Another ToolChainInfo object to intersect with
-
- @return ToolChainInfo Intersected ToolChainInfo object
- **/
- public ToolChainInfo intersection(ToolChainInfo info) {
- ToolChainInfo result = new ToolChainInfo();
- result.addTargets(intersection(this.targets, info.targets));
- result.addTagnames(intersection(this.tagnames, info.tagnames));
- result.addArchs(intersection(this.archs, info.archs));
- return result;
- }
-
- /**
- Make a union operation on two Sets
-
- @param set1 One Set
- @param set2 Another Set
-
- @return Set<String> Merged Set object
- **/
- private Set<String> union(Set<String> set1, Set<String> set2) {
- Set<String> result = new LinkedHashSet<String>();
- result.addAll(set1);
- result.addAll(set2);
- result.remove("*");
- return result;
- }
-
- /**
- Make a intersection operation on two Sets with the consideration of wildcard.
-
- @param set1 One Set
- @param set2 Another Set
-
- @return Set<String> The intersected Set object
- **/
- private Set<String> intersection(Set<String> set1, Set<String> set2) {
- Set<String> result = new LinkedHashSet<String>();
- boolean set1HasWildcard = set1.contains("*");
- boolean set2HasWildcard = set2.contains("*");
-
- if (set1HasWildcard && set2HasWildcard) {
- //
- // Both Sets have wildcard, the result will have all elements in them
- //
- result.addAll(set1);
- result.addAll(set2);
- } else if (set1HasWildcard) {
- //
- // Only set1 has wildcard, then result will have only set2 elements.
- //
- result.addAll(set2);
- } else if (set2HasWildcard) {
- //
- // Only set2 has wildcard, then result will have only set1 elements.
- //
- result.addAll(set1);
- } else {
- //
- // No wildcard in both Sets, the result will have the elements in both Sets.
- //
- result.addAll(set1);
- result.retainAll(set2);
- }
-
- return result;
- }
-
- /**
- Get target array.
-
- @return String[]
- **/
- public String[] getTargets() {
- return (String[])targets.toArray(new String[targets.size()]);
- }
-
- /**
- Get tool chain tag name array.
-
- @return String[]
- **/
- public String[] getTagnames() {
- return (String[])tagnames.toArray(new String[tagnames.size()]);
- }
-
- /**
- Get ARCH array.
-
- @return String[]
- **/
- public String[] getArchs() {
- return (String[])archs.toArray(new String[archs.size()]);
- }
-
- /**
- Get command name array.
-
- @return String[]
- **/
- public String[] getCommands() {
- return (String[])commands.toArray(new String[commands.size()]);
- }
-
- /**
- Override the Object's toString().
-
- @return String
- **/
- public String toString() {
- return " TARGET :" + targets + "\n" +
- " TAGNAME:" + tagnames + "\n" +
- " ARCH :" + archs + "\n" +
- " COMMAND:" + commands;
- }
-
- /**
- Remove the wildcard element in the tool chain information because they
- are useless when retrieved.
- **/
- public void normalize() {
- targets.remove("*");
- tagnames.remove("*");
- archs.remove("*");
- commands.remove("*");
- }
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java
deleted file mode 100644
index 1bedf3c685..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainKey.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/** @file
-ToolChainKey class
-
-ToolChainKey class is representing the "name" part of tool chain definition.
-
-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.
-
-**/
-
-package org.tianocore.build.toolchain;
-
-import org.tianocore.build.exception.GenBuildException;
-
-/**
- ToolChainKey class is the java class form of the "name" of tool chain definition.
- It's primarily for the key of a Map data structure.
- **/
-public class ToolChainKey implements java.io.Serializable, Comparable<ToolChainKey> {
- static final long serialVersionUID = -8034897190740066933L;
-
- ///
- /// The part number of key. Currently we only support fixed five parts.
- ///
- public final static int keyLength = 5;
-
- //
- // Default delimiter which is used for concatenating the parts of key
- //
- private String delimiter = "_";
-
- //
- // Key value in string array form
- //
- private String[] keySet = null;
-
- //
- // Key value in one string form
- //
- private String keyString = null;
-
- //
- // Key hash value used for hash table
- //
- private int hashValue = 0;
-
- /**
- Public constructor which can override default delimiter.
-
- @param keyString The key string value
- @param delimiter Delimiter charater concatenating the key parts
- **/
- public ToolChainKey(String keyString, String delimiter) throws GenBuildException {
- setKey(keyString, delimiter);
- }
-
- /**
- Public constructor which uses default delimiter.
-
- @param keyString The key string value
- **/
- public ToolChainKey(String keyString) throws GenBuildException {
- setKey(keyString);
- }
-
- /**
- Public constructor which doesn't use any delimiter.
-
- @param keySet
- **/
- public ToolChainKey(String[] keySet) throws GenBuildException {
- setKey(keySet);
- }
-
- /**
- Calculate hash value of the key string (without the delimiter). It's used
- for Hash Table kind of Map.
-
- @return int The hash value
- **/
- public int hashCode() {
- if (hashValue != 0) {
- return hashValue;
- }
-
- for (int i = 0; i < keySet.length; ++i) {
- char[] keyStringValue = new char[keySet[i].length()];
- this.keySet[i].getChars(0, keyStringValue.length, keyStringValue, 0);
-
- for (int j = 0; j < keyStringValue.length; ++j) {
- hashValue = keyStringValue[j] + hashValue * 31;
- }
- }
-
- return hashValue;
- }
-
- /**
- Compare the string value of two keys . It's used for Tree kind of Map.
-
- @param dstKey Another key to compare to.
-
- @retval 0 Two keys are equal
- @retval >0 This key is after the given key
- @retval <0 This key is before the given key
- **/
- public int compareTo(ToolChainKey dstKey) {
- String[] dstKeySet = dstKey.getKeySet();
- int result = 0;
- for (int i = 0; i < ToolChainKey.keyLength; ++i) {
- result = this.keySet[i].compareToIgnoreCase(dstKeySet[i]);
- if (result != 0) {
- break;
- }
- }
-
- return result;
- }
-
- /**
- Check if this key is the same as the given key.
-
- @param o Another key to compare to
-
- @return boolean
- **/
- public boolean equals(Object o) {
- ToolChainKey dstKey = (ToolChainKey)o;
- String[] dstKeySet = dstKey.getKeySet();
-
- if (this == dstKey) {
- return true;
- }
-
- if (dstKeySet.length != ToolChainKey.keyLength) {
- return false;
- }
-
- for (int i = 0; i < ToolChainKey.keyLength; ++i) {
- if (!this.keySet[i].equalsIgnoreCase(dstKeySet[i])) {
- return false;
- }
- }
-
- return true;
- }
-
- /**
- Set the key value in form of string array.
-
- @param keySet The string array of key value
- **/
- public void setKey(String[] keySet) throws GenBuildException {
- if (keySet.length != ToolChainKey.keyLength) {
- throw new GenBuildException("Invalid ToolChain key");
- }
-
- //
- // Clone the string array because we don't want to change original one
- //
- this.keySet = new String[ToolChainKey.keyLength];
- System.arraycopy(keySet, 0, this.keySet, 0, ToolChainKey.keyLength);
- for (int i = 0; i < ToolChainKey.keyLength; ++i) {
- if (this.keySet[i] == null || this.keySet[i].length() == 0) {
- this.keySet[i] = "*";
- }
- }
-
- //
- // We need to re-generate the single key string and hash value.
- //
- this.keyString = null;
- this.hashValue = 0;
- }
-
- /**
- Set key value at the specified key part .
-
- @param keySetString The new value of "index" part of key
- @param index The key part index
- **/
- public void setKey(String keySetString, int index) throws GenBuildException {
- if (index >= ToolChainKey.keyLength) {
- throw new GenBuildException("Invalid ToolChain key index");
- }
-
- //
- // Allow wildcard in key string
- //
- if (keySetString == null || keySetString.length() == 0) {
- keySetString = "*";
- }
- this.keySet[index] = keySetString;
-
- //
- // We need to re-generate the single key string and hash value.
- //
- this.keyString = null;
- this.hashValue = 0;
- }
-
- /**
- Set key value in the form of single string.
-
- @param keyString The key value string
- **/
- public void setKey(String keyString) throws GenBuildException {
- this.keySet = keyString.split(this.delimiter);
-
- if (this.keySet.length != ToolChainKey.keyLength) {
- throw new GenBuildException("Invalid ToolChain key");
- }
-
- this.keyString = keyString;
- //
- // We need to re-generate hash value.
- //
- this.hashValue = 0;
- }
-
- /**
- Set key value in the form of single string with specified delimiter.
-
- @param keyString The key value string
- @param delimiter The delimiter concatenating the key string
- **/
- public void setKey(String keyString, String delimiter) throws GenBuildException {
- this.keySet = keyString.split(delimiter);
-
- if (this.keySet.length != ToolChainKey.keyLength) {
- throw new GenBuildException("Invalid ToolChain key");
- }
-
- this.keyString = keyString;
- this.delimiter = delimiter;
- //
- // We need to re-generate hash value.
- //
- this.hashValue = 0;
- }
-
- /**
- Return the string array form of key
-
- @return String[]
- **/
- public String[] getKeySet() {
- return keySet;
- }
-
- /**
- Return the single string form of key.
-
- @return String
- **/
- public String toString() {
- if (this.keyString == null) {
- StringBuffer keyStringBuf = new StringBuffer(64);
-
- keyStringBuf.append(this.keySet[0]);
- for (int i = 1; i < ToolChainKey.keyLength; ++i) {
- keyStringBuf.append(this.delimiter);
- keyStringBuf.append(this.keySet[i]);
- }
-
- this.keyString = keyStringBuf.toString();
- }
-
- return this.keyString;
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java b/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java
deleted file mode 100644
index 18e664ccf8..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/toolchain/ToolChainMap.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/** @file
-ToolChainMap class
-
-ToolChainMap class is used for storing tool chain configurations.
-
-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.
-
-**/
-
-package org.tianocore.build.toolchain;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-/**
- ToolChainMap is a wrapper class for a generic Map class which uses ToolChainKey
- class as its key. It's used to store and retrieve tool chain configuration
- information.
- **/
-public class ToolChainMap {
- //
- // From which part of key can be used to match "*"
- //
- private int matchLevel = ToolChainKey.keyLength - 1;
-
- //
- // A Map object in which tool chain configuration information will be stored
- //
- private Map<ToolChainKey, String> map = null;
-
- /**
- Public constructor. It just initializes the private Map object.
- **/
- public ToolChainMap() {
- this.map = new HashMap<ToolChainKey, String>();
- }
-
- /**
- Wrapper function for Map.put(). It's used when default delimiter of
- ToolChainKey is not wanted and will be overrided by "delimiter" parameter.
-
- @param key Key string which is concatenated with "delimiter"
- @param delimiter The delimiter string in the key string
- @param value Value string associated with the "key"
-
- @retval String The "value" string if the "key" is valid.
- @retval null if the "key" is invalid
- **/
- public String put(String key, String delimiter, String value) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key, delimiter);
- } catch (Exception e) {
- return null;
- }
- return (String)map.put(toolChainKey, value);
- }
-
- /**
- Wrapper function for Map.put().
-
- @param key Key string which is concatenated with default "delimiter"
- @param value Value string associated with the "key"
-
- @retval String The "value" string if the "key" is valid.
- @retval null if the "key" is invalid
- **/
- public String put(String key, String value) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key);
- } catch (Exception e) {
- return null;
- }
- return (String)map.put(toolChainKey, value);
- }
-
- /**
- Wrapper function for Map.put(). The key is given in the form of string
- array.
-
- @param key Key string array
- @param value Value string associated with the "key"
-
- @retval String The "value" string if the "key" is valid.
- @retval null if the "key" is invalid
- **/
- public String put(String[] key, String value) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key);
- } catch (Exception e) {
- return null;
- }
- return (String)map.put(toolChainKey, value);
- }
-
- /**
- Wrapper function for Map.put(). The key is given in ToolChainKey class.
-
- @param key ToolChainKey class
- @param value Value string associated with the "key"
-
- @retval String The "value" string if the "key" is valid.
- @retval null if the "key" is invalid
- **/
- public String put(ToolChainKey key, String value) {
- return (String)map.put(key, value);
- }
-
- /**
- Wrapper function for Map.get().
-
- @param key Key string which is concatenated with default "delimiter"
-
- @return String
- **/
- public String get(String key) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key);
- } catch (Exception e) {
- return null;
- }
- return get(toolChainKey);
- }
-
- /**
- Wrapper function for Map.get(). It's used when default delimiter of
- ToolChainKey is not wanted and will be overrided by "delimiter" parameter.
-
- @param key Key string which is concatenated with "delimiter"
- @param delimiter The delimiter string in the key string
-
- @return String
- **/
- public String get(String key, String delimiter) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key, delimiter);
- } catch (Exception e) {
- return null;
- }
- return get(toolChainKey);
- }
-
- /**
- Wrapper function for Map.get(). The key is given in the form of string
- array.
-
- @param key Key string array
-
- @return String
- **/
- public String get(String[] key) {
- ToolChainKey toolChainKey;
-
- try {
- toolChainKey = new ToolChainKey(key);
- } catch (Exception e) {
- return null;
- }
- return get(toolChainKey);
- }
-
- /**
- Wrapper function for Map.get(). The key is given in ToolChainKey class.
- All other form of get() method will eventually call this form of get. It
- will do real job of finding the value associated with the given key. Most
- of the job is to try to match the key with "wildcard".
-
- @param key ToolChainKey class
-
- @return String The value associated with the key
- **/
- public String get(ToolChainKey key) {
- ///
- /// First, we'll try to get the value through the exact given key
- ///
- String result = map.get(key);
- if (result != null || map.containsKey(key)) {
- return result;
- }
-
- ///
- /// If nothing is found, then, we'll try all possible keys combined with
- /// wildcard "*". In order not to change the original key value, we have
- /// to clone one for later use.
- ///
- String[] keySet = key.getKeySet();
- ToolChainKey tmpKey;
- try {
- tmpKey = new ToolChainKey(keySet);
- } catch (Exception e) {
- return null;
- }
-
- ///
- /// In the current tool chain definition format (in name/value pair),
- /// there're five parts in the "name". The last part of the "name" must
- /// not be "wildcard". We should start combining "*" from left to right.
- /// We'll try all the possible combinations until the value can be fetched.
- ///
- /// The following code implements the logic which will try to use, for example,
- /// following key parts combinations sequentially to get the value.
- ///
- /// TARGET_TOOLCHAIN_ARCH_TOOLCODE_ATTRIBUTE
- /// ******_TOOLCHAIN_ARCH_TOOLCODE_ATTRIBUTE
- /// TARGET_*********_ARCH_TOOLCODE_ATTRIBUTE
- /// ******_*********_ARCH_TOOLCODE_ATTRIBUTE
- /// TARGET_TOOLCHAIN_****_TOOLCODE_ATTRIBUTE
- /// ******_TOOLCHAIN_****_TOOLCODE_ATTRIBUTE
- /// TARGET_*********_****_TOOLCODE_ATTRIBUTE
- /// ******_*********_****_TOOLCODE_ATTRIBUTE
- /// TARGET_TOOLCHAIN_ARCH_********_ATTRIBUTE
- /// ******_TOOLCHAIN_ARCH_********_ATTRIBUTE
- /// TARGET_*********_ARCH_********_ATTRIBUTE
- /// ******_*********_ARCH_********_ATTRIBUTE
- /// TARGET_TOOLCHAIN_****_********_ATTRIBUTE
- /// ******_TOOLCHAIN_****_********_ATTRIBUTE
- /// TARGET_*********_****_********_ATTRIBUTE
- /// ******_*********_****_********_ATTRIBUTE
- ///
-
- //
- // The wildcard "*" appears regularly (2^n). "*" in TARGET appears 2^0
- // times at every 2^0 TARGET, "*" in TOOLCHAIN appears 2^1 times at
- // every 2^1 TOOLCHAIN, and "*" in TOOLCODE appears 2^3 times at every
- // 2^3 TOOLCODE. We're going to use this to form all the combinations of key.
- //
- int[] combinations = new int[matchLevel];
- for (int i = 0; i < matchLevel; ++i) {
- //
- // initialize the array with 2^n
- //
- combinations[i] = 1 << (i + 1);
- }
-
- //
- // when last part goes down to zero, we tried all combinations of key
- //
- int lastIndex = matchLevel - 1;
- while (combinations[lastIndex] > 0) {
- //
- // form the key which has "*" in it
- //
- for (int i = 0; i < matchLevel; ++i) {
- //
- // start again if not finished
- //
- if (combinations[i] == 0) {
- combinations[i] = 1 << (i + 1);
- }
-
- //
- // half of 2^n is "*", the rest is non-*
- //
- try {
- if (combinations[i] > (1 << i)) {
- tmpKey.setKey(keySet[i], i);
- } else {
- tmpKey.setKey("*", i);
- }
- } catch (Exception e) {
- return null;
- }
-
- combinations[i] -= 1;
- }
-
- //
- // Try get the value from the map
- //
- result = map.get(tmpKey);
- if (result != null) {
- //
- // The map actually has no exact key as the given "key",
- // putting it back into map can speed up the get() next time
- //
- map.put(key, result);
- return result;
- }
- }
-
- //
- // The map actually has no exact key as the given "key", putting it back
- // into map can speed up the get() next time even we got nothing.
- //
- map.put(key, null);
- return null;
- }
-
- /**
- Wrapper function for Map.size().
-
- @return int The size of map
- **/
- public int size() {
- return map.size();
- }
-
- /**
- Wrapper function for Map.keySet().
-
- @return Set<ToolChainKey> A set of ToolChainKey objects
- */
- public Set<ToolChainKey> keySet() {
- return (Set<ToolChainKey>)map.keySet();
- }
-
- public String toString() {
- return map + "";
- }
-}
-
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java b/Tools/Java/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java
deleted file mode 100644
index 04223cd8fd..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/tools/ModuleItem.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/** @file
-
-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.
-
-**/
-package org.tianocore.build.tools;
-
-import org.apache.tools.ant.BuildException;
-/**
- Ant element for module.
-
- @since GenBuild 1.0
-**/
-public class ModuleItem {
-
- private String moduleName = null;
-
- private String moduleGuid = null;
-
- private String moduleVersion = null;
-
- private String packageName = null;
-
- private String packageGuid = null;
-
- private String packageVersion = null;
-
- public ModuleItem(){
-
- }
-
- public void execute() throws BuildException {
-
- }
-
- /**
- Get module Guid.
- @return Module Guid
- **/
- public String getModuleGuid() {
- return moduleGuid;
- }
-
- /**
- Set module Guid
- @param moduleGuid Module Guid
- **/
- public void setModuleGuid(String moduleGuid) {
- this.moduleGuid = moduleGuid;
- }
-
- /**
- Get Module Name.
- @return Module Name
- **/
- public String getModuleName() {
- return moduleName;
- }
-
- /**
- Set Module Name.
- @param moduleName Module Name
- **/
- public void setModuleName(String moduleName) {
- this.moduleName = moduleName;
- }
-
- /**
- Get Module Version.
- @return Module Version
- **/
- public String getModuleVersion() {
- return moduleVersion;
- }
-
- /**
- Set Module Version.
- @param moduleVersion Module version
- **/
- public void setModuleVersion(String moduleVersion) {
- this.moduleVersion = moduleVersion;
- }
-
- /**
- Get Package Guid.
- @return Package Guid
- **/
- public String getPackageGuid() {
- return packageGuid;
- }
-
- /**
- Set Package Guid.
- @param packageGuid Package Guid
- **/
- public void setPackageGuid(String packageGuid) {
- this.packageGuid = packageGuid;
- }
-
- /**
- Get Package Name.
- @return Package Name
- **/
- public String getPackageName() {
- return packageName;
- }
-
- /**
- Set Package Name.
- @param packageName Package Name
- **/
- public void setPackageName(String packageName) {
- this.packageName = packageName;
- }
-
- /**
- Get Package Version.
- @return Package Version
- **/
- public String getPackageVersion() {
- return packageVersion;
- }
-
- /**
- Set Package Version.
- @param packageVersion Package Version
- **/
- public void setPackageVersion(String packageVersion) {
- this.packageVersion = packageVersion;
- }
-
-
-}
diff --git a/Tools/Java/Source/GenBuild/org/tianocore/build/tools/PackageItem.java b/Tools/Java/Source/GenBuild/org/tianocore/build/tools/PackageItem.java
deleted file mode 100644
index f61782ddbd..0000000000
--- a/Tools/Java/Source/GenBuild/org/tianocore/build/tools/PackageItem.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/** @file
-
-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.
-
-**/
-package org.tianocore.build.tools;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- Ant element for Package.
-
- @since GenBuild 1.0
-**/
-public class PackageItem {
-
- private String packageName = null;
-
- private String packageGuid = null;
-
- private String packageVersion = null;
-
- public PackageItem(){
-
- }
-
- public void execute() throws BuildException {
-
- }
-
- public String toString(){
- return "[" + packageName + packageGuid + "]";
- }
- /**
- Get Package Guid.
- @return Package Guid
- **/
- public String getPackageGuid() {
- return packageGuid;
- }
-
- /**
- Set Package Guid.
- @param packageGuid Package Guid
- **/
- public void setPackageGuid(String packageGuid) {
- this.packageGuid = packageGuid;
- }
-
- /**
- Get Package Name.
- @return Package Name
- **/
- public String getPackageName() {
- return packageName;
- }
-
- /**
- Set Package Name.
- @param packageName Package Name
- **/
- public void setPackageName(String packageName) {
- this.packageName = packageName;
- }
-
- /**
- Get Package Version.
- @return Package Version
- **/
- public String getPackageVersion() {
- return packageVersion;
- }
-
- /**
- Set Package Version.
- @param packageVersion Package Version
- **/
- public void setPackageVersion(String packageVersion) {
- this.packageVersion = packageVersion;
- }
-}
diff --git a/Tools/Java/Source/Merge/Merge.msa b/Tools/Java/Source/Merge/Merge.msa
deleted file mode 100644
index b394d7a90a..0000000000
--- a/Tools/Java/Source/Merge/Merge.msa
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
- <MsaHeader>
- <ModuleName>Merge Tool</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>fbb48848-4776-44a1-8458-1e84701fb62f</GuidValue>
- <Version>0.1</Version>
- <Abstract>The tool merges multiple MSA files (of the same ModuleType) into a single module</Abstract>
- <Description>Merging multiple modules into a single module is useful for size reduction of the binary images.
-This tool will create an MSA file, based on the content of "leaf" MSA files. It is written so that it can be executed from a command line, or later, incorporated into the Wizard.
-USAGE:
-merge [-v] -t target [-u UiName] [-p PackageFile] [-o OutputFileBasename] dir1\mod1.msa ... dirN\modN.msa</Description>
- <Copyright>Copyright (c) 2006, Intel Corporation All rights reserved.</Copyright>
- <License URL="http://opensource.org/licenses/bsd-license.php">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.</License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>EBC IA32 X64 IPF ARM PPC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>Merge</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>src/org/tianocore/Merge/CombineMsa.java</Filename>
- <Filename>src/org/tianocore/Merge/Merge.java</Filename>
- <Filename>src/org/tianocore/Merge/MergeCmd.java</Filename>
- <Filename>build.xml</Filename>
- <Filename>readme.txt</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/Merge/build.xml b/Tools/Java/Source/Merge/build.xml
deleted file mode 100644
index 709c9e8fe9..0000000000
--- a/Tools/Java/Source/Merge/build.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?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="Merge" default="Merge" basedir=".">
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <property name="WORKSPACE" value="${env.WORKSPACE}"/>
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars" includes="*.jar"/>
- <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
- </path>
- <property name="buildDir" value="build"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/bin"/>
- <target name="Merge" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="src" destdir="${buildDir}">
- <classpath refid="classpath"/>
- <!-- <compilerarg value="-Xlint"/> -->
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/Merge" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: Merge.jar"/>
- <delete file="${installLocation}/Merge.jar"/>
- </target>
- <target name="install" depends="source">
- <jar destfile="${installLocation}/Merge.jar">
- <fileset dir="${buildDir}"/>
- </jar>
- </target>
-</project>
diff --git a/Tools/Java/Source/Merge/readme.txt b/Tools/Java/Source/Merge/readme.txt
deleted file mode 100644
index cf423c3be8..0000000000
--- a/Tools/Java/Source/Merge/readme.txt
+++ /dev/null
@@ -1,48 +0,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.
-
-Overview
---------
-The Merge program is designed to merge the contents of similar modules into a
-single module for size reduction. The combined module will link in one copy of
-the libraries, rather than have multiple copies of the libraries linked in to
-each individual driver.
-
-Rules:
- The ModuleType must be identical for each of the (leaf) modules.
- At least one architecture type must be common for all modules, and the merged
-module will only support the common architecture types.
- ALL modules to be merged must be in a directory structure below the location
-of the merged module.
- The package must be within a directly directory line with the merged module's
-MSA file. (Parent directories.)
- The copying of the files from the "leaf" directory into the merge module's
-directory structure must be handled by an external program.
- The merge program must be run everytime a leaf module is modified.
- The external copy program must also be run everytime a leaf module is modified.
- Two or more leaf modules must be specified.
- The merged module must be added to a package (SPD) file before it can be used.
- PCD Driver Modules cannot be merged, nor combined with other modules.
- Leaf Module Global BuildOptions and UserExtensions are not merged.
-
-
-merge Usage:
- merge [-v] -t target [-u UiName] [-p PackageFile] dir1\leaf1 ... dirN\leafN [-h | -? | --help]
- where:
- -h | -? | --help OPTIONAL - This Help Text
- -t Target REQUIRED - The Name of the new Merge Module MSA file
- -p Package OPTIONAL - The Name of the Package (SPD) file to add the target
- -u UiName OPTIONAL - The User Interface Name for the Target Module
- -v OPTIONAL - Verbose, print information messages.
- -o OutputFileBasename OPTIONAL - Set the Output Filename for this module to Basename
- dir1\leaf1 ... dirN\leafN REQUIRED The path to two or more MSA files that will be merged
-
-
diff --git a/Tools/Java/Source/Merge/src/org/tianocore/Merge/CombineMsa.java b/Tools/Java/Source/Merge/src/org/tianocore/Merge/CombineMsa.java
deleted file mode 100644
index 4d4b215267..0000000000
--- a/Tools/Java/Source/Merge/src/org/tianocore/Merge/CombineMsa.java
+++ /dev/null
@@ -1,2007 +0,0 @@
-// @file
-// This Class processes multiple MSA files and merges them into a single,
-// merged MSA file. It will optionally add the merged MSA file into a package.
-//
-//
-// 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.
-//
-//
-
-package org.tianocore.Merge;
-
-import java.io.*;
-import java.util.*;
-// import java.lang.*;
-// import java.lang.ExceptionInInitializerError;
-
-// import org.apache.xmlbeans.*;
-import org.apache.xmlbeans.XmlCursor;
-// import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlOptions;
-import org.apache.xmlbeans.XmlException;
-import org.tianocore.*;
-
-// import org.tianocore.*;
-import org.tianocore.ModuleSurfaceAreaDocument.*;
-import org.tianocore.MsaHeaderDocument.*;
-import org.tianocore.LicenseDocument.*;
-import org.tianocore.ModuleDefinitionsDocument.*;
-import org.tianocore.LibraryClassDefinitionsDocument.*;
-import org.tianocore.SourceFilesDocument.*;
-import org.tianocore.PackageDependenciesDocument.*;
-import org.tianocore.ProtocolsDocument.*;
-import org.tianocore.EventsDocument.*;
-import org.tianocore.HobsDocument.*;
-import org.tianocore.PPIsDocument.*;
-import org.tianocore.VariablesDocument.*;
-import org.tianocore.BootModesDocument.*;
-import org.tianocore.SystemTablesDocument.*;
-import org.tianocore.DataHubsDocument.*;
-import org.tianocore.HiiPackagesDocument.*;
-import org.tianocore.GuidsDocument.*;
-import org.tianocore.ExternsDocument.*;
-import org.tianocore.PcdCodedDocument.*;
-import org.tianocore.ModuleBuildOptionsDocument.*;
-import org.tianocore.UserExtensionsDocument.*;
-
-import org.tianocore.PackageSurfaceAreaDocument.*;
-
-public class CombineMsa {
-
- private final int DEBUG = 0;
-
- private final int PASS = 0;
-
- private final int FAIL = 1;
-
- private final int FOUND = 0;
-
- private final int NOTFOUND = 1;
-
- private int result = PASS;
-
- private String licenseTxt = "";
-
- private ArrayList<String> aLicenses = new ArrayList<String>();
-
- private String Copyright = "";
-
- private ArrayList<String> aCopyright = new ArrayList<String>();
-
- private String Abstract = "\n Merged Modules: \n";
-
- private String Description = "\n Merging Modules: \n";
-
- private String sArchitectures = "";
-
- private MsaHeader header = null;
-
- private final String Specification = "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
-
- private ModuleSurfaceArea mergeMsaFile = null;
-
- private ModuleSurfaceArea leafMsa = null;
-
- private ModuleDefinitions moduleDefs = null;
-
- private LibraryClassDefinitions libClassDefs = null;
-
- private ArrayList<String> aLibClassDefs = new ArrayList<String>();
-
- private int libraryClassIndex = 0;
-
- private SourceFiles mergeSourceFiles = null;
-
- private int sourceFileIndex = 0;
-
- private PackageDependencies mergePackageDependencies = null;
-
- private ArrayList<String> aPackageList = new ArrayList<String>();
-
- private int packageDependenciesIndex = 0;
-
- private Protocols mergeProtocols = null;
-
- private ArrayList<String> aProtocolList = new ArrayList<String>();
-
- private ArrayList<String> aProtocolNotifyList = new ArrayList<String>();
-
- private int protocolIndex = 0;
-
- private int protocolNotifyIndex = 0;
-
- private Events mergeEvents = null;
-
- private Events.CreateEvents mergeCreateEvents = null;
-
- private Events.SignalEvents mergeSignalEvents = null;
-
- private ArrayList<String> aCreateEventsList = new ArrayList<String>();
-
- private ArrayList<String> aSignalEventsList = new ArrayList<String>();
-
- private int createEventIndex = 0;
-
- private int signalEventIndex = 0;
-
- private Hobs mergeHobs = null;
-
- private ArrayList<String> aHobsList = new ArrayList<String>();
-
- private int hobsIndex = 0;
-
- private PPIs mergePpis = null;
-
- private ArrayList<String> aPpiList = new ArrayList<String>();
-
- private ArrayList<String> aPpiNotifyList = new ArrayList<String>();
-
- private int ppiIndex = 0;
-
- private int ppiNotifyIndex = 0;
-
- private Variables mergeVariables = null;
-
- private ArrayList<String> aVariablesList = new ArrayList<String>();
-
- private int variablesIndex = 0;
-
- private BootModes mergeBootModes = null;
-
- private ArrayList<String> aBootModesList = new ArrayList<String>();
-
- private int bootModesIndex = 0;
-
- private SystemTables mergeSystemTables = null;
-
- private ArrayList<String> aSystemTablesList = new ArrayList<String>();
-
- private int systemTableIndex = 0;
-
- private DataHubs mergeDataHubs = null;
-
- private ArrayList<String> aDataHubsList = new ArrayList<String>();
-
- private int dataHubsIndex = 0;
-
- private HiiPackages mergeHiiPackages = null;
-
- private ArrayList<String> aHiiPackagesList = new ArrayList<String>();
-
- private int hiiPackageIndex = 0;
-
- private Guids mergeGuids = null;
-
- private ArrayList<String> aGuidsList = new ArrayList<String>();
-
- private int guidsIndex = 0;
-
- private Externs mergeExterns = null;
-
- private ArrayList<String> aEntryPointList = new ArrayList<String>();
-
- private ArrayList<String> aUnloadImageList = new ArrayList<String>();
-
- private ArrayList<String> aDriverBindingList = new ArrayList<String>();
-
- private ArrayList<String> aConstructorList = new ArrayList<String>();
-
- private ArrayList<String> aDestructorList = new ArrayList<String>();
-
- private ArrayList<String> aVirtualAddressMapList = new ArrayList<String>();
-
- private ArrayList<String> aExitBootServicesList = new ArrayList<String>();
-
- private int externsIndex = 0;
-
- private ArrayList<String> aSpecArray = new ArrayList<String>();
-
- private int specIndex = 0;
-
- private PcdCoded mergePcdCoded = null;
-
- private ArrayList<String> aPcdCNameList = new ArrayList<String>();
-
- private ArrayList<String> aPcdItemTypeList = new ArrayList<String>();
-
- private int pcdIndex = 0;
-
- private ModuleBuildOptions mergeBuildOptions = null;
-
- private UserExtensions mergeUserExtensions = null;
-
- private String mergeUsage = "";
-
- private String leafUsage = "";
-
- private int VERBOSE = 0;
-
- // The combineMsaFiles routine is the primary routine for creating a
- // Merged MSA file.
-
- public int combineMsaFiles(String msaFilename, ArrayList<String> msaFiles, String uiName, String spdFilename,
- String baseName, int Flags) {
- // msaFile has been verified to either not exist, or, if it does exist,
- // it will be over written.
- // All files in the msaFiles ArrayList have been verifed to exist.
- // If the uiName is not null, we will have a new UI Name for the merged
- // module.
- // If the uiName is null, we will use the module name from the first
- // Leaf module.
- // If the spdFile is not null, the Package (SPD) file has been verified
- // to exist.
- // If the spdFile is null, don't attempt to add the new msa file.
-
- if (Flags > 0)
- VERBOSE = 1;
- if (mergeMsaFile == null) {
- //
- // create the data structure for the merged Module
- //
- mergeMsaFile = ModuleSurfaceArea.Factory.newInstance();
-
- System.out.println("Merging " + msaFiles.size() + " Modules");
- //
- // we always require a Header and a Module Definition section.
- // These will be added to the mergeMsaFile after we have completed
- // all processing of the Leaf MSA files.
- //
- header = MsaHeaderDocument.Factory.newInstance().addNewMsaHeader();
- moduleDefs = ModuleDefinitionsDocument.Factory.newInstance().addNewModuleDefinitions();
- //
- // A merged module cannot be created from binary modules - we force
- // the new module to be source here, however we will test every
- // module to make sure that none are binary; exiting the program if
- // a module is binary
- //
- moduleDefs.setBinaryModule(false);
-
- for (int i = 0; i < msaFiles.size(); i++) {
- String leafFilename = msaFiles.get(i).toString();
- leafMsa = getLeafFile(leafFilename);
- if (leafMsa == null) {
- System.out.println("Could not read Leaf MSA file: " + leafFilename);
- System.exit(FAIL);
- }
- if (i == 0) {
- //
- // Special code for first file, since this file is used
- // to initialize some of the data in the mergeMsaFile.
- // Set the Merge module's ModuleName to the name in the
- // first Leaf Module. If a new module name is given,
- // over write it later, just before writing the Merge
- // Module MSA file.
- header.setModuleName(leafMsa.getMsaHeader().getModuleName().toString());
- //
- // All modules must be of the same module type, we set it
- // here, and test the other Leaf modules' type later.
- header.setModuleType(leafMsa.getMsaHeader().getModuleType());
- //
- // This is a new Module, so we need a new GUID
- header.setGuidValue(UUID.randomUUID().toString());
- //
- // Use the version from the first Leaf module as the
- // Merge Module version number.
- header.setVersion(leafMsa.getMsaHeader().getVersion().toString());
- //
- // There is no special requirement for processing the
- // following, so we just fall through on these elements
- // of the header.
- // Abstract will be added after parsing all leaf MSA files.
- // Description will be added after parsing all leaf MSA files.
- // Copyright will be added after parsing all leaf MSA files.
- // License will be added after parsing all leaf MSA files.
- //
- // Force the specification to match this tool's spec version.
- header.setSpecification(Specification);
- //
- // Set the Merged Module's Output Basename to match the first
- // leaf module
- String OutputFileName = leafMsa.getModuleDefinitions().getOutputFileBasename().toString();
- //
- // Just in case someone put a space character in the first
- // leaf module's output filename, replace the spaces with
- // an underscore.
- OutputFileName.replace(" ", "_");
- moduleDefs.setOutputFileBasename(OutputFileName);
- //
- // We start with the first module's list of supported
- // architectures. As we process the additional leaf modules,
- // we may have to remove some supported architectures from
- // the list, as we can only build for the "least common
- // denominator" subset of architectures.
- sArchitectures = leafMsa.getModuleDefinitions().getSupportedArchitectures().toString();
- if ((DEBUG > 5) || (VERBOSE > 5))
- System.out.println("New Header: \"" + header.getModuleName().toString() + "\"");
- }
- //
- // We test the license in each leaf module, and will only print
- // licenses that are may be different in wording (white spaces
- // and line feeds are ignored in this test.)
- if (leafMsa.getMsaHeader().getLicense() != null)
- licenseTxt += checkDuplicateStrings(leafMsa.getMsaHeader().getLicense().getStringValue().trim(),
- aLicenses);
- if ((DEBUG > 10) || (VERBOSE > 10))
- System.out.println("License: " + licenseTxt);
- //
- // We test the copyright line from each leaf module, and will
- // add additional copyright lines only if they are different
- // in wording (white spaces and line feeds are ignored in this
- // test.)
- if (leafMsa.getMsaHeader().getCopyright() != null)
- Copyright += checkDuplicateStrings(leafMsa.getMsaHeader().getCopyright().toString().trim(),
- aCopyright);
- if ((DEBUG > 10) || (VERBOSE > 10))
- System.out.println("Copyright: " + Copyright);
- //
- // ALL leaf modules must be of the same Module Type, if not,
- // print an error and exit.
- if (header.getModuleType() != leafMsa.getMsaHeader().getModuleType()) {
- System.out.println("ERROR: Module Types different!");
- System.out.println(" Expected: " + header.getModuleType());
- System.out.println(" " + leafFilename + " ModuleType: " + leafMsa.getMsaHeader().getModuleType());
- System.out.println("Merge ABORTED!");
- System.exit(FAIL);
- }
- //
- // Combine the Abstract and Descriptions into a single
- // description entry, prefixing each with the Leaf MSA filename,
- // so you know which description is from which Leaf module.
- Description += " -- " + leafFilename + " -- \n Abstract: "
- + leafMsa.getMsaHeader().getAbstract().toString() + "\n Description: "
- + leafMsa.getMsaHeader().getDescription().toString() + "\n";
- //
- // Use the Abstract of the Merged Module to list the Leaf
- // Module's MSA files.
- Abstract += " -- " + leafFilename + " -- \n";
- //
- // Ignore ClonedFrom right now
- //
-
- // Process Supported Architectures
- // A merged module supports the lowest common set of
- // architectures
- String testArch = "";
- if (leafMsa.getModuleDefinitions().getSupportedArchitectures() == null) {
- System.out
- .println("Module " + leafFilename + " does not have the Supported Architectures defined!");
- System.out.println("Supported Architectures is a required element!");
- System.out.println("Merge ABORTED!");
- System.exit(FAIL);
- }
- testArch = leafMsa.getModuleDefinitions().getSupportedArchitectures().toString();
- String aArch[] = sArchitectures.split(" ");
- for (int ictr = 0; ictr < aArch.length; ictr++) {
- if (!testArch.contains(aArch[ictr])) {
- sArchitectures = sArchitectures.replace(aArch[ictr], "");
- }
- }
- if (sArchitectures.length() < 2) {
- System.out.println("ERROR: The Leaf Modules' Supported Architectures are mutually exclusive.");
- System.out.println("At least one architecture must be common to all Leaf Modules!");
- System.out.println("Merge Aborting!");
- System.exit(FAIL);
- }
- //
- // Now start to process the rest of the Leaf Module's MSA files.
- // We will only test a Leaf module's section if it has data, skipping
- // empty sections
- // As part of this process, we will only create a Library Class Definition
- // if one was defined, and we will only do it one time.
- if (leafMsa.isSetLibraryClassDefinitions()) {
- //
- // If libClassDefs == null, create a new libClassDefs and add
- // this module's libClassDefs to the merge Module's
- // If libClassDefs != null, check that we have only unique LibraryClass entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the LibraryClass as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the LibraryClass as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // The RecommendedInstance attributes can be ignored!
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // The SupModuleList must be identical for all Leaf Modules!
- // Probable Enhancement
- // The SupModuleList should be combined to include all possible supported module types.
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each LibraryClass, otherwize fail the Merge
- //
- // Create the working copy if one does not exist!
- if (libClassDefs == null)
- libClassDefs = LibraryClassDefinitionsDocument.Factory.newInstance()
- .addNewLibraryClassDefinitions();
- //
- // Get the Leaf LibraryClassDefinitions Section
- LibraryClassDefinitions leafLibClassDef = leafMsa.getLibraryClassDefinitions();
- //
- // We only need to test there are entries in the Leaf LibraryClassDefinitions section!
- if (leafLibClassDef.getLibraryClassList().size() > 0) {
- for (int index = 0; index < leafLibClassDef.getLibraryClassList().size(); index++) {
- //
- // We can use the Keyword to search to see if the Leaf's Library Class was already
- // added to the Merge Module.
- String test = "";
- String leafKeyword = leafLibClassDef.getLibraryClassList().get(index).getKeyword()
- .toString().trim();
-
- leafUsage = "";
- if (leafLibClassDef.getLibraryClassList().get(index).getUsage() != null)
- leafUsage = leafLibClassDef.getLibraryClassList().get(index).getUsage().toString()
- .trim();
-
- String leafSupArchList = "";
- if (leafLibClassDef.getLibraryClassList().get(index).getSupArchList() != null)
- leafSupArchList = leafLibClassDef.getLibraryClassList().get(index).getSupArchList()
- .toString().trim();
-
- String leafSupModuleList = "";
- if (leafLibClassDef.getLibraryClassList().get(index).getSupModuleList() != null)
- leafSupModuleList = leafLibClassDef.getLibraryClassList().get(index).getSupModuleList()
- .toString().trim();
-
- test = checkDuplicateStrings(leafKeyword, aLibClassDefs);
- if (test.length() > 0) {
- // The checkDuplicateStrings returns "" if a duplicate was found.
- // Here, the Leaf LibraryClass gets entered because the Keyword was not found.
- // No more testing is required, since this is the first instance of the LibraryClass
- libClassDefs.addNewLibraryClass();
- libClassDefs.setLibraryClassArray(libraryClassIndex++,
- leafLibClassDef.getLibraryClassList().get(index));
- } else {
- // The Merged Module has already specified the Library Class
- // Check ATTRIBUTES, following the rules above.
- // Since we cannot get the LibraryClass entry using the Keyword, we have to search
- // all of the Merged Module's LibraryClass statements until we find a match.
- // Also, we may have more than one LibraryClass with the same Keyword, but different
- // Usage, SupArchList, FeatureFlag or SupModuleList
- for (int nidx = 0; nidx < libraryClassIndex; nidx++) {
- String mergeKeyword = libClassDefs.getLibraryClassList().get(nidx).getKeyword()
- .trim();
-
- if (leafKeyword.contentEquals(mergeKeyword)) {
- // We have the FIRST match, let's check usage, remember, we can have more than one LibraryClass Keyword.
- mergeUsage = libClassDefs.getLibraryClassList().get(nidx).getUsage().toString()
- .trim();
- // If the usage is identical, check the SupArchList next
- if (!leafUsage.contentEquals(mergeUsage)) {
- if (checkUsage().trim().contains("DIFFERENT")) {
- // See if there is another entry for PRODUCED or CONSUME
- int anotherLC = NOTFOUND;
- for (int iidx = nidx + 1; iidx < libraryClassIndex; iidx++) {
- String innerTestKeyword = libClassDefs.getLibraryClassList()
- .get(iidx).getKeyword()
- .toString().trim();
- if (leafKeyword.contentEquals(innerTestKeyword)) {
- anotherLC = FOUND;
- mergeUsage = libClassDefs.getLibraryClassList().get(iidx)
- .getUsage().toString().trim();
- if (checkProduced()) {
- libClassDefs
- .getLibraryClassList()
- .get(iidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- }
- // Both Usage types are CONSUMED
- if (checkConsumed()) {
- libClassDefs
- .getLibraryClassList()
- .get(iidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- }
- if (((mergeUsage.contains("TO_START")) && (leafUsage
- .contains("TO_START"))))
- anotherLC = FOUND;
- if (((mergeUsage.contains("BY_START")) && (leafUsage
- .contains("BY_START"))))
- anotherLC = FOUND;
- }
- }
- if (anotherLC == NOTFOUND) {
- // we need to add the leaf Library Class
- libClassDefs.addNewLibraryClass();
- libClassDefs
- .setLibraryClassArray(
- libraryClassIndex++,
- leafLibClassDef
- .getLibraryClassList()
- .get(index));
- }
- }
-
- // Both Usage types are PRODUCED
- if (checkUsage().trim().contains("PRODUCED")) {
- libClassDefs.getLibraryClassList().get(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- }
- // Both Usage types are CONSUMED
- if (checkUsage().trim().contains("CONSUMED")) {
- libClassDefs.getLibraryClassList().get(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- }
- }
- // Usage testing completed
- // Check SupArchList
- String mergeSupArchList = "";
- if (libClassDefs.getLibraryClassList().get(nidx).getSupArchList() != null)
- mergeSupArchList = libClassDefs.getLibraryClassList().get(nidx)
- .getSupArchList().toString().trim();
- if (!mergeSupArchList.equalsIgnoreCase(leafSupArchList)) {
- System.out
- .println("ERROR: Library Class, keyword: " + leafKeyword
- + " defines a different set of supported architectures.");
- System.out
- .println("Version 0.1 of the merge tool requires that they must be identical!");
- System.out.println("First instance of the Library used: "
- + mergeSupArchList);
- System.out.println("While this module, " + leafFilename + " uses: "
- + leafSupArchList);
- System.out.println("Merge ABORTED!");
- System.exit(FAIL);
- }
- // Architecture Testing completed
- // Check SupModuleType
- String mergeSupModuleList = "";
- if (libClassDefs.getLibraryClassList().get(nidx).getSupModuleList() != null)
- mergeSupModuleList = libClassDefs.getLibraryClassList().get(nidx)
- .getSupModuleList().toString().trim();
- if (!mergeSupModuleList.equalsIgnoreCase(leafSupModuleList)) {
- System.out.println("ERROR: Library Class, keyword: " + leafKeyword
- + " defines a different set of supported modules.");
- System.out
- .println("Version 0.1 of the merge tool requires that they must be identical!");
- System.out.println("First instance of the Library used: "
- + mergeSupModuleList);
- System.out.println("While this module, " + leafFilename + " uses: "
- + leafSupModuleList);
- System.out.println("Merge ABORTED!");
- System.exit(FAIL);
- }
- // Supported Module Testing completed
- // Check FeatureFlage
- // Next version, not this one.
- }
- } // end of processing of duplicate Library Class entries
- } // end duplicate entry
- } // end of test loop for duplicates
- } // endif Merge Module LibraryModuleDefinitions existed
- } // endif of LibraryModuleDefinition Tests
-
- if (leafMsa.isSetSourceFiles()) {
- // TODO: test for NULL settings
- // Add Sourcefiles to the Merge Module. NOTE: ONLY MODIFY THE Filename, prepending the path to the MSA file.
- // First get the path portion of the leafMSA file, which will be prepended to the filename
- // everything else stays intact.
- if (mergeSourceFiles == null)
- mergeSourceFiles = SourceFilesDocument.Factory.newInstance().addNewSourceFiles();
-
- String pathToMsa = getPathPartOfLeafMsa(leafFilename);
- if (DEBUG > 10)
- System.out.println("PATH TO SOURCE FILES: " + pathToMsa);
- if (leafMsa.getSourceFiles().getFilenameList() != null) {
- List<FilenameDocument.Filename> leafSourceFiles = leafMsa.getSourceFiles().getFilenameList();
- for (int index = 0; index < leafSourceFiles.size(); index++) {
- String leafFile = leafSourceFiles.get(index).getStringValue().toString();
- leafFile = pathToMsa + leafFile;
- leafSourceFiles.get(index).setStringValue(leafFile);
- mergeSourceFiles.addNewFilename();
- mergeSourceFiles.setFilenameArray(sourceFileIndex++, leafSourceFiles.get(index));
- }
- }
- }
-
- if (leafMsa.isSetPackageDependencies()) {
- //
- // If mergePackageDependencies == null, create a new mergePackageDependencies and
- // add the leaf module's Package Dependencies section to the merge Module's
- // If mergePackageDependencies != null, test the leaf Package entries against
- // what has already been added to the mergePackageDependencies data structure.
- //
- // Add Unique Package entries.
- // For this Merge Tool a Package is defined as PackageGuid
- //
- // ABORT THE MERGE WITH FAIL if the PACKAGE VERSION NUMBERS ARE DIFFERENT
- // between Leaf modules
- //
- // Version 0.1 of the tool
- // SupArchList, if it exists, must be identical for all Leaf Modules
- // Probable Enhancement
- // Just specify the lowest common denominator
- //
- // Create the working copy if one does not exist!
- // TODO: CODE GOES HERE
- if (mergePackageDependencies == null)
- mergePackageDependencies = PackageDependenciesDocument.Factory.newInstance()
- .addNewPackageDependencies();
-
- PackageDependencies leafPackageDependencies = leafMsa.getPackageDependencies();
- if (leafPackageDependencies.sizeOfPackageArray() > 0) {
- for (int index = 0; index < leafPackageDependencies.sizeOfPackageArray(); index++) {
- String packageGuid = leafPackageDependencies.getPackageArray(index).getPackageGuid();
- String test = checkDuplicateStrings(packageGuid, aPackageList);
- if (test.length() > 0) {
- mergePackageDependencies.addNewPackage();
- mergePackageDependencies
- .setPackageArray(packageDependenciesIndex++,
- leafPackageDependencies.getPackageArray(index));
- }
- }
- }
- } // endif PackageDependencies
-
- if (leafMsa.isSetProtocols()) {
- // TODO:
- // TEST FOR NULL SETTINGS so we don't get an error!
- // Add Usage Merging routines
- //
- // If mergeProtocols == null, create a new mergeProtocols and add
- // leaf module's Protocols section to the merge Module's
- //
- // Keep ALL Protocol entries before ProtocolNotify entries!
- //
- // If mergeProtocols != null, check that we have only unique Protocol and ProtocolNotify entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the Protocol or ProtocolNotify as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the Protocol or ProtocolNotify as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique Protocol or ProtocolNotify Entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
-
- if (mergeProtocols == null)
- mergeProtocols = ProtocolsDocument.Factory.newInstance().addNewProtocols();
-
- Protocols leafProtocols = leafMsa.getProtocols();
- // Handle Protocol Entries First
- if (leafProtocols.sizeOfProtocolArray() > 0) {
- for (int index = 0; index < leafProtocols.sizeOfProtocolArray(); index++) {
- String protocolCName = leafProtocols.getProtocolArray(index).getProtocolCName();
- String test = checkDuplicateStrings(protocolCName, aProtocolList);
- if (test.length() > 0) {
- // new Protocol
- mergeProtocols.addNewProtocol();
- mergeProtocols.setProtocolArray(protocolIndex++, leafProtocols.getProtocolArray(index));
- } else {
- // Found an existing protocol
- leafUsage = leafProtocols.getProtocolArray(index).getUsage().toString().trim();
- for (int nidx = 0; nidx < protocolIndex; nidx++) {
- if (mergeProtocols.getProtocolArray(nidx).getProtocolCName()
- .contains(protocolCName)) {
- // Found one entry that matches.
- mergeUsage = mergeProtocols.getProtocolArray(nidx).getUsage().toString().trim();
- if (!mergeUsage.contentEquals(leafUsage)) {
- // Usages are different
- if (checkUsage().trim().contains("DIFFERENT")) {
- // We need to check to see if there's another entry
- int anotherProtocol = NOTFOUND;
- for (int iidx = nidx + 1; iidx < protocolIndex; iidx++) {
-
- if (mergeProtocols.getProtocolArray(iidx).getUsage().toString()
- .trim().contains(protocolCName)) {
- anotherProtocol = FOUND;
- mergeUsage = libClassDefs.getLibraryClassList().get(iidx)
- .getUsage().toString().trim();
- if (checkProduced()) {
- mergeProtocols
- .getProtocolArray(nidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- anotherProtocol = FOUND;
- }
- // Both Usage types are CONSUMED
- if (checkConsumed()) {
- mergeProtocols
- .getProtocolArray(nidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- anotherProtocol = FOUND;
- }
- if (((mergeUsage.contains("TO_START")) && (leafUsage
- .contains("TO_START"))))
- anotherProtocol = FOUND;
- if (((mergeUsage.contains("BY_START")) && (leafUsage
- .contains("BY_START"))))
- anotherProtocol = FOUND;
- }
- }
- if (anotherProtocol == NOTFOUND) {
- mergeProtocols.addNewProtocol();
- mergeProtocols
- .setProtocolArray(
- protocolIndex++,
- leafProtocols
- .getProtocolArray(index));
- }
- } else {
- // usage types are either both PRODUCED or CONSUMED
- if (checkProduced())
- mergeProtocols.getProtocolArray(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- if (checkConsumed())
- mergeProtocols.getProtocolArray(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- }
- }
- }
- } // end of Usage Test
- }
- }
- }
-
- // Handle ProtocolNotify Entries Second
- if (leafProtocols.sizeOfProtocolNotifyArray() > 0) {
- for (int index = 0; index < leafProtocols.sizeOfProtocolNotifyArray(); index++) {
- String protocolNotifyCName = leafProtocols.getProtocolNotifyArray(index)
- .getProtocolNotifyCName();
- String test = checkDuplicateStrings(protocolNotifyCName, aProtocolNotifyList);
- if (test.length() > 0) {
- mergeProtocols.addNewProtocolNotify();
- mergeProtocols.setProtocolNotifyArray(protocolNotifyIndex++,
- leafProtocols.getProtocolNotifyArray(index));
- } else {
- // We have an existing ProtocolNotify Entry
- leafUsage = leafProtocols.getProtocolNotifyArray(index).getUsage().toString().trim();
- for (int nidx = 0; nidx < protocolIndex; nidx++) {
- if (mergeProtocols.getProtocolNotifyArray(nidx).getProtocolNotifyCName()
- .contains(protocolNotifyCName)) {
- // Found one entry that matches.
- mergeUsage = mergeProtocols.getProtocolNotifyArray(nidx).getUsage().toString().trim();
- if (!mergeUsage.contentEquals(leafUsage)) {
- // Usages are different
- if (checkUsage().trim().contains("DIFFERENT")) {
- // We need to check to see if there's another entry
- int anotherProtocol = NOTFOUND;
- for (int iidx = nidx + 1; iidx < protocolIndex; iidx++) {
-
- if (mergeProtocols.getProtocolNotifyArray(iidx).getUsage().toString()
- .trim().contains(protocolNotifyCName)) {
- anotherProtocol = FOUND;
- mergeUsage = libClassDefs.getLibraryClassList().get(iidx)
- .getUsage().toString().trim();
- if (checkProduced()) {
- mergeProtocols
- .getProtocolNotifyArray(nidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- anotherProtocol = FOUND;
- }
- // Both Usage types are CONSUMED
- if (checkConsumed()) {
- mergeProtocols
- .getProtocolNotifyArray(nidx)
- .setUsage(
- org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- anotherProtocol = FOUND;
- }
- if (((mergeUsage.contains("TO_START")) && (leafUsage
- .contains("TO_START"))))
- anotherProtocol = FOUND;
- if (((mergeUsage.contains("BY_START")) && (leafUsage
- .contains("BY_START"))))
- anotherProtocol = FOUND;
- }
- }
- if (anotherProtocol == NOTFOUND) {
- mergeProtocols.addNewProtocolNotify();
- mergeProtocols
- .setProtocolNotifyArray(
- protocolNotifyIndex++,
- leafProtocols
- .getProtocolNotifyArray(index));
- }
- } else {
- // usage types are either both PRODUCED or CONSUMED
- if (checkProduced())
- mergeProtocols.getProtocolNotifyArray(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_PRODUCED);
- if (checkConsumed())
- mergeProtocols.getProtocolNotifyArray(nidx)
- .setUsage(org.tianocore.UsageTypes.ALWAYS_CONSUMED);
- }
- }
- }
- } // end of Usage Test
- } // end of Usage test
- }
- }
-
- } // endif Protocols
-
- if (leafMsa.isSetEvents()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // "Unique" Entries are based on EventsTypes:EventGuidCName attributes
- // NOTE: The EventGuidCName can appear once and only once in a CreateEvents Section
- // The SAME EventGuidCName can appear once and only once in the SignalEvents Section
- // Two EventGuidCName entries, one in CreateEvents the other in SignalEvents IS PERMITTED!
- //
- // If mergeEvents == null, create a new mergeEvents and add
- // leaf module's Events section to the merge Module's
- //
- // Keep ALL CreateEvents entries before SignalEvents entries!
- //
- // If mergeEvents != null, check that we have only unique CreateEvents and SignalEvents entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the CreateEvents.EventTypes or SignalEvents.EventTypes as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the CreateEvents.EventTypes or SignalEvents.EventTypes as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique EventTypes, otherwise fail the Merge
- //
- // The EventTypes.EventType elements must be identical for all instances of
- // the EventGuidCName FAIL THE MERGE WITH ERROR indicating the Leaf file name that
- // was different.
- //
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code goes here
-
- if (mergeCreateEvents == null)
- mergeCreateEvents = EventsDocument.Events.CreateEvents.Factory.newInstance();
-
- Events leafEvents = leafMsa.getEvents();
- if (leafEvents.getCreateEvents() != null) {
- Events.CreateEvents leafCreateEvents = leafEvents.getCreateEvents();
- if (leafCreateEvents.sizeOfEventTypesArray() > 0) {
- for (int index = 0; index < leafCreateEvents.sizeOfEventTypesArray(); index++) {
- String EventGuidCName = leafCreateEvents.getEventTypesArray(index).getEventGuidCName();
- String test = checkDuplicateStrings(EventGuidCName, aCreateEventsList);
- if (test.length() > 0) {
- mergeCreateEvents.addNewEventTypes();
- mergeCreateEvents.setEventTypesArray(createEventIndex++,
- leafEvents.getCreateEvents()
- .getEventTypesArray(index));
-
- }
- }
- }
- }
-
- if (mergeSignalEvents == null)
- mergeSignalEvents = EventsDocument.Events.SignalEvents.Factory.newInstance();
-
- if (leafEvents.getSignalEvents() != null) {
- Events.SignalEvents leafSignalEvents = leafEvents.getSignalEvents();
- if (leafSignalEvents.sizeOfEventTypesArray() > 0) {
- for (int index = 0; index < leafSignalEvents.sizeOfEventTypesArray(); index++) {
- String EventGuidCName = leafSignalEvents.getEventTypesArray(index).getEventGuidCName();
- String test = checkDuplicateStrings(EventGuidCName, aSignalEventsList);
- if (test.length() > 0) {
- mergeSignalEvents.addNewEventTypes();
- mergeSignalEvents.setEventTypesArray(signalEventIndex++,
- leafEvents.getSignalEvents()
- .getEventTypesArray(index));
- }
- }
- }
- }
- } // endif Events
-
- if (leafMsa.isSetHobs()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // "Unique" Entries are based on Hobs.HobTypes:HobGuidCName attribute
- //
- // If mergeHobs == null, create a new mergeHobs and add
- // leaf module's Hobs section to the merge Module's
- //
- //
- // If mergeHobs != null, check that we have only unique Hobs.HobTypes entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the Hobs.HobTypes as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the Hobs.HobTypes as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique HobTypes element, otherwise fail the Merge
- //
- // The HobTypes.HobType elements must be identical for all instances of
- // the HobGuidCName FAIL THE MERGE WITH ERROR indicating the Leaf file name that
- // was different.
- //
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code goes here
- if (mergeHobs == null)
- mergeHobs = HobsDocument.Factory.newInstance().addNewHobs();
-
- Hobs leafHobs = leafMsa.getHobs();
- if (leafHobs.sizeOfHobTypesArray() > 0) {
- for (int index = 0; index < leafHobs.sizeOfHobTypesArray(); index++) {
- String hobGuidCName = leafHobs.getHobTypesArray(index).getHobType().toString();
- String test = checkDuplicateStrings(hobGuidCName, aHobsList);
- if (test.length() > 0) {
- mergeHobs.addNewHobTypes();
- mergeHobs.setHobTypesArray(hobsIndex++, leafHobs.getHobTypesArray(index));
- }
- }
- }
- } // endif Hobs
-
- if (leafMsa.isSetPPIs()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique Ppi or PpiNotify elements, based on the PpiCName and PpiNotifyCName respectively.
-
- // If mergePpi == null, create a new mergePpi and add
- // leaf module's PPIs section to the merge Module's
- //
- // Keep ALL Ppi entries before PpiNotify entries!
- //
- // If mergePpi != null, check that we have only unique Ppi and PpiNotify entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the Ppi or PpiNotify as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the Ppi or PpiNotify as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique Ppi or PpiNotify Entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergePpis == null)
- mergePpis = PPIsDocument.Factory.newInstance().addNewPPIs();
-
- PPIs leafPPIs = leafMsa.getPPIs();
- // Handle the PPI Entries First
- if (leafPPIs.sizeOfPpiArray() > 0) {
- for (int index = 0; index < leafPPIs.sizeOfPpiArray(); index++) {
- String ppiCName = leafPPIs.getPpiArray(index).getPpiCName();
- String test = checkDuplicateStrings(ppiCName, aPpiList);
- if (test.length() > 0) {
- mergePpis.addNewPpi();
- mergePpis.setPpiArray(ppiIndex++, leafPPIs.getPpiArray(index));
- }
- }
- }
-
- // Handle the PpiNotify Second
- if (leafPPIs.sizeOfPpiNotifyArray() > 0) {
- for (int index = 0; index < leafPPIs.sizeOfPpiNotifyArray(); index++) {
- String ppiNotifyCName = leafPPIs.getPpiNotifyArray(index).getPpiNotifyCName();
- String test = checkDuplicateStrings(ppiNotifyCName, aPpiNotifyList);
- if (test.length() > 0) {
- mergePpis.addNewPpiNotify();
- mergePpis.setPpiNotifyArray(ppiNotifyIndex++, leafPPIs.getPpiNotifyArray(index));
- }
- }
- }
-
- } // endif Ppis
-
- if (leafMsa.isSetVariables()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique Variable elements, based on the VariableName element.
- //
- // If mergeVariables == null, create a new mergeVariables and add
- // leaf module's Variables section to the merge Module's
- //
- // If mergeVariables != null, check that we have only unique Variable entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the Variable as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the Variable as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique Variable entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeVariables == null)
- mergeVariables = VariablesDocument.Factory.newInstance().addNewVariables();
-
- Variables leafVariables = leafMsa.getVariables();
- if (leafVariables.sizeOfVariableArray() > 0) {
- for (int index = 0; index < leafVariables.sizeOfVariableArray(); index++) {
- String variableGuidCName = leafVariables.getVariableArray(index).getGuidCName();
- String test = checkDuplicateStrings(variableGuidCName, aVariablesList);
- if (test.length() > 0) {
- mergeVariables.addNewVariable();
- mergeVariables
- .setVariableArray(variablesIndex++, leafVariables.getVariableArray(index));
- }
- }
- }
-
- }// endif Variables
-
- if (leafMsa.isSetBootModes()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique BootMode elements, based on the BootModeName Attribute.
- //
- // If mergeBootModes == null, create a new mergeBootModes and add
- // leaf module's BootModes section to the merge Module's
- //
- // If mergeBootModes != null, check that we have only unique BootMode entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the BootMode as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the BootMode as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique BootMode entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeBootModes == null)
- mergeBootModes = BootModesDocument.Factory.newInstance().addNewBootModes();
-
- BootModes leafBootModes = leafMsa.getBootModes();
- if (leafBootModes.sizeOfBootModeArray() > 0) {
- for (int index = 0; index < leafBootModes.sizeOfBootModeArray(); index++) {
- String bootModeName = leafBootModes.getBootModeArray(index).getBootModeName().toString();
- String test = checkDuplicateStrings(bootModeName, aBootModesList);
- if (test.length() > 0) {
- mergeBootModes.addNewBootMode();
- mergeBootModes
- .setBootModeArray(bootModesIndex++, leafBootModes.getBootModeArray(index));
- }
- }
- }
-
- }// endif BootMode
-
- if (leafMsa.isSetSystemTables()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique SystemTableCNames elements, based on the SystemTableCName element.
- //
- // If mergeSystemTables == null, create a new mergeSystemTables and add
- // leaf module's Variables section to the merge Module's
- //
- // If mergeSystemTables != null, check that we have only unique SystemTableCNames entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the SystemTableCName as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the SystemTableCName as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique SystemTableCNames entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeSystemTables == null)
- mergeSystemTables = SystemTablesDocument.Factory.newInstance().addNewSystemTables();
-
- SystemTables leafSystemTables = leafMsa.getSystemTables();
- if (leafSystemTables.sizeOfSystemTableCNamesArray() > 0) {
- for (int index = 0; index < leafSystemTables.sizeOfSystemTableCNamesArray(); index++) {
- String systemTableCName = leafSystemTables.getSystemTableCNamesArray(index)
- .getSystemTableCName();
- String test = checkDuplicateStrings(systemTableCName, aSystemTablesList);
- if (test.length() > 0) {
- mergeSystemTables.addNewSystemTableCNames();
- mergeSystemTables
- .setSystemTableCNamesArray(
- systemTableIndex++,
- leafSystemTables
- .getSystemTableCNamesArray(index));
- }
- }
- }
-
- }// endif SystemTables
-
- if (leafMsa.isSetDataHubs()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique DataHubs elements, based on the DataHubRecord.DataHubCName element.
- //
- // If mergeDataHubs == null, create a new mergeDataHubs and add
- // leaf module's DataHubs section to the merge Module's
- //
- // If mergeDataHubs != null, check that we have only unique DataHubRecord entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the DataHubCName as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the DataHubCName as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique DataHubRecord entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeDataHubs == null)
- mergeDataHubs = DataHubsDocument.Factory.newInstance().addNewDataHubs();
-
- DataHubs leafDataHubs = leafMsa.getDataHubs();
- if (leafDataHubs.sizeOfDataHubRecordArray() > 0) {
- for (int index = 0; index < leafDataHubs.sizeOfDataHubRecordArray(); index++) {
- String dataHubCName = leafDataHubs.getDataHubRecordArray(index).getDataHubCName();
- String test = checkDuplicateStrings(dataHubCName, aDataHubsList);
- if (test.length() > 0) {
- mergeDataHubs.addNewDataHubRecord();
- mergeDataHubs.setDataHubRecordArray(dataHubsIndex++,
- leafDataHubs.getDataHubRecordArray(index));
- }
- }
- }
-
- }// endif DataHubs
-
- if (leafMsa.isSetHiiPackages()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique HiiPackage elements, based on the HiiPackage.HiiCName element.
- //
- // If mergeHiiPackages == null, create a new mergeHiiPackages and add
- // leaf module's DataHubs section to the merge Module's
- //
- // If mergeHiiPackages != null, check that we have only unique HiiPackage entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the HiiPackage as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the HiiPackage as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique HiiPackage entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeHiiPackages == null)
- mergeHiiPackages = HiiPackagesDocument.Factory.newInstance().addNewHiiPackages();
-
- HiiPackages leafHiiPackages = leafMsa.getHiiPackages();
- if (leafHiiPackages.sizeOfHiiPackageArray() > 0) {
- for (int index = 0; index < leafHiiPackages.sizeOfHiiPackageArray(); index++) {
- String hiiCName = leafHiiPackages.getHiiPackageArray(index).getHiiCName();
- String test = checkDuplicateStrings(hiiCName, aHiiPackagesList);
- if (test.length() > 0) {
- mergeHiiPackages.addNewHiiPackage();
- mergeHiiPackages.setHiiPackageArray(hiiPackageIndex++,
- leafHiiPackages.getHiiPackageArray(index));
- }
- }
- }
-
- }// endif HiiPackage
-
- if (leafMsa.isSetGuids()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique Guids elements, based on the GuidCNames.GuidCName element.
- //
- // If mergeGuids == null, create a new mergeGuids and add
- // leaf module's Guids section to the merge Module's
- //
- // If mergeGuids != null, check that we have only unique GuidCNames entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the GuidCNames as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the GuidCNames as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique GuidCNames entry, otherwise fail the Merge
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeGuids == null)
- mergeGuids = GuidsDocument.Factory.newInstance().addNewGuids();
-
- Guids leafGuids = leafMsa.getGuids();
- if (leafGuids.sizeOfGuidCNamesArray() > 0) {
- for (int index = 0; index < leafGuids.sizeOfGuidCNamesArray(); index++) {
- String hiiCName = leafGuids.getGuidCNamesArray(index).getGuidCName();
- String test = checkDuplicateStrings(hiiCName, aGuidsList);
- if (test.length() > 0) {
- mergeGuids.addNewGuidCNames();
- mergeGuids.setGuidCNamesArray(guidsIndex++, leafGuids.getGuidCNamesArray(index));
- }
- }
- }
-
- }// endif GuidCNames
-
- if (leafMsa.isSetExterns()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // FAIL THE MERGE if Externs.PcdIsDriver is present
- // FAIL THE MERGE if Externs.TianoR8FlashMap_h is TRUE
- //
- // Keep only Unique Extern elements, based on the Extern.* elements.
- //
- // If mergeExterns == null, create a new mergeExterns and add
- // leaf module's Extern section to the merge Module's
- //
- // If mergeExterns != null, check that we have only unique Extern.* entries
- //
- // After storing the initial LEAF MODULE'S SPECIFICATION SECTION
- // ALL other Leaf Modules must declare the exact same specifications
- // If they do not, FAIL the MERGE with an error message, printing the
- // name of the leaf MSA that did not match, along with
- // Expected: from the merge module's specification list
- // Got: from the leaf file that fails!
- //
- // For Each <Extern>
- // For each pair of <ModuleEntryPoint> and/or <ModuleUnloadImage>
- // The ModuleUnloadImage value must be identical for an identical pair of ModuleEntryPoint values
- // If not, FAIL THE MERGE, giving the current leaf MSA filename as the failure, along with the
- // additional error information as follows:
- // -- leafFilename --
- // ModuleEntryPoint:
- // Expected ModuleUnloadImage: fromMergeModule
- // Got ModuleUnloadImage: fromLeaf
- // Merge Aborted!
- // More than one <Extern> Section with a pair of <ModuleEntryPoint><ModuleUnloadImage> is allowed
- //
- // For each pair of one <Constructor> and/or one <Destructor> elements
- // The <Extern> section containing the <Constructor> <Destructor> pairs
- // The Destructor value in all leaf modules must be identical for all Constructor elements that are identical.
- // More than one <Extern> Section with Constructor/Destructor pair is permitted.
- //
- // For each Set four elements, DriverBinding, ComponentName, DriverConfig and DriverDiag,
- // 1 DriverBinding and
- // 0 or 1 ComponentName and/or
- // 0 or 1 DriverConfig and/or
- // 0 or 1 DriverDiag
- // elements must appear in 1 <Extern> Section.
- //
- // A ComponentName cannot be used without a DriverBinding element.
- // A DriverConfig element cannot appear without a DriverBinding element.
- // A DriverDiag element cannot appear without a DriverBinding element
- // These elements are matched within a single <Extern> Section uniquely defined by the DriverBinding element.
- // Multiple <Extern> sections of this type are permitted.
- //
- // Each pair of SetVirtualAddressMapCallBack and ExitBootServiceCallBack elements MUST
- // BE in one Extern Section. ONE AND ONLY ONE of this section is permitted.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique Extern entry, otherwise fail the Merge
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergeExterns == null)
- mergeExterns = ExternsDocument.Factory.newInstance().addNewExterns();
-
- Externs leafExterns = leafMsa.getExterns();
- // PCD IS DRIVER NOT ALLOWED IN A MERGED Module
- if (leafExterns.isSetPcdIsDriver()) {
- System.out.println("The Module: " + leafFilename + " is a PCD Driver and CANNOT BE MERGED!");
- System.out.println("Merge Aborted");
- System.err.flush();
- System.exit(FAIL);
- }
-
- // TIANO R8 FLASHMAP.H NOT ALLOWED IN A MERGED Module
- if (leafExterns.isSetTianoR8FlashMapH()) {
- System.out.println("The Module: " + leafFilename
- + " set the Tiano R8 FlashMap.h Flag and CANNOT BE MERGED!");
- System.out.println("Merge Aborted");
- System.err.flush();
- System.exit(FAIL);
- }
-
- // Add the Specification Array, one time only.
- if (leafExterns.sizeOfSpecificationArray() > 0) {
- for (int index = 0; index < leafExterns.sizeOfSpecificationArray(); index++) {
- String spec = leafExterns.getSpecificationArray(index);
- String test = checkSpecs(spec, leafFilename, aSpecArray);
- if (test.length() > 0) {
- mergeExterns.addNewSpecification();
- mergeExterns.setSpecificationArray(specIndex++, test);
- }
- }
- }
-
- if (leafExterns.sizeOfExternArray() > 0) {
- for (int index = 0; index < leafExterns.sizeOfExternArray(); index++) {
- String test = "";
- if (leafExterns.getExternArray(index).isSetModuleEntryPoint()) {
- // ModuleEntryPoint, if an Unload Image is paired with
- // the Module Entry point, it will piggy back on the
- // Module Entry Point Extern
- String moduleEntryPoint = leafExterns.getExternArray(index).getModuleEntryPoint();
- test = checkDuplicateStrings(moduleEntryPoint, aEntryPointList);
-
- } else if (leafExterns.getExternArray(index).isSetModuleUnloadImage()) {
- // Module Unload Image is here in case there is no
- // Entry Point - not very typical
- String moduleUnloadImage = leafExterns.getExternArray(index).getModuleUnloadImage();
- test = checkDuplicateStrings(moduleUnloadImage, aUnloadImageList);
-
- } else if (leafExterns.getExternArray(index).isSetConstructor()) {
- // Constructors must be unique, if a Destructor is
- // paired with a constructor, it will pigback on
- // the constructor
- String constructor = leafExterns.getExternArray(index).getConstructor();
- test = checkDuplicateStrings(constructor, aConstructorList);
-
- } else if (leafExterns.getExternArray(index).isSetDestructor()) {
- // Destructors must be unique
- String destructor = leafExterns.getExternArray(index).getDestructor();
- test = checkDuplicateStrings(destructor, aDestructorList);
-
- } else if (leafExterns.getExternArray(index).isSetDriverBinding()) {
- // Driver Bindings must be unique
- // Fixed the MSA files - ComponentName, Driver Config and
- // Driver Diag statments must be inside of an Extern that
- // has a Driver Binding
- String driverBinding = leafExterns.getExternArray(index).getDriverBinding();
- test = checkDuplicateStrings(driverBinding, aDriverBindingList);
-
- } else if (leafExterns.getExternArray(index).isSetSetVirtualAddressMapCallBack()) {
- // Handle Virtual Address Map and Exit Boot Services Call Backs
- // in a single Extern if they are present
- String virtualAddressMap = leafExterns.getExternArray(index)
- .getSetVirtualAddressMapCallBack();
- test = checkDuplicateStrings(virtualAddressMap, aVirtualAddressMapList);
-
- } else if (leafExterns.getExternArray(index).isSetExitBootServicesCallBack()) {
- // Handle a stand alone Exit Boot Services Call Back
- String exitBootServices = leafExterns.getExternArray(index)
- .getExitBootServicesCallBack();
- test = checkDuplicateStrings(exitBootServices, aExitBootServicesList);
- } else {
- // Unknown Extern FAIL - May be an invalid Component Name in it's own Extern Statement
- System.out.println("Unknown EXTERN defined in Module: " + leafFilename);
- System.out.println("Value: " + leafExterns.getExternArray(index).toString());
- System.out.println("Merge Aborted!");
- System.err.flush();
- System.exit(FAIL);
- }
-
- if (test.length() > 0) {
- mergeExterns.addNewExtern();
- mergeExterns.setExternArray(externsIndex++, leafExterns.getExternArray(index));
- }
- }
- }
- }// endif mergeExterns
-
- if (leafMsa.isSetPcdCoded()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Keep only Unique PcdCoded elements, based on the PcdCoded.PcdEntry.C_Name element.
- //
- // If mergePcdCoded == null, create a new mergePcdCoded and add
- // leaf module's PcdCoded section to the merge Module's
- //
- // If mergePcdCoded != null, check that we have only unique PcdEntry entries
- // IF one Leaf usage is SOMETIMES_PRODUCED, and another Leaf usage is ALWAYS_PRODUCED,
- // Mark the PcdEntry as ALWAYS_PRODUCED
- // IF one Leaf usage is SOMETIMES_CONSUMED, and another Leaf usage is ALWAYS_CONSUMED,
- // Mark the PcdEntry as ALWAYS_CONSUMED
- // It is permissable to have one PRODUCED and one CONSUMED entry
- // TO_START and BY_START cannot be combined in any fashion, if one Leaf uses TO_START
- // and another Leaf uses BY_START, create two entries, one for each.
- //
- // First PASS of the TOOL
- // SupArchList must be identical for all Leaf Modules! Fail the Merge if not, reporting
- // this as an error!
- // Probable Enhancement
- // The SupArchList, if set, must be for the "Lowest Common Denominator"
- //
- // First PASS of the TOOL
- // Ignore the FeatureFlag - we are not using it now.
- // Probable Enhancement
- // FeatureFlags must be identical for each unique HiiPackage entry, otherwise fail the Merge
- //
- // First PASS of the TOOL
- // Ignore the PcdEntry:Usage Attribute
- // Probable Enhancment
- // Have Usage Combined like was done for the Library Class
- //
- // First PASS of the TOOL
- // If Different PcdItemTypes, Abort The MERGE
- //
- // Probably Enhancement
- // The PcdItemType Should be checked using the following rules
- // Feature Flag MUST ALWAYS BE A FEATURE FLAG
- // If different Item Types occur, mark the PCD as DYNAMIC
- //
- // HelpText RULE:
- // HelpText should be concatenated with a line -- leafFilename -- separator, where leafFilename
- // is the leaf Module's path and filename to the MSA file!
- //
- // Create the working copy if one does not exist!
- // TODO: Code Goes Here!
- if (mergePcdCoded == null)
- mergePcdCoded = PcdCodedDocument.Factory.newInstance().addNewPcdCoded();
-
- PcdCoded leafPcdCoded = leafMsa.getPcdCoded();
- if (leafPcdCoded.sizeOfPcdEntryArray() > 0) {
- for (int index = 0; index < leafPcdCoded.sizeOfPcdEntryArray(); index++) {
- String pcdCName = leafPcdCoded.getPcdEntryArray(index).getCName();
- String pcdItemType = leafPcdCoded.getPcdEntryArray(index).getPcdItemType().toString();
- String test = checkPcd(pcdCName, pcdItemType, leafFilename, aPcdCNameList);
- if (test.length() > 0) {
- mergePcdCoded.addNewPcdEntry();
- mergePcdCoded.setPcdEntryArray(pcdIndex++, leafPcdCoded.getPcdEntryArray(index));
- }
- }
- }
-
- }// endif PcdCoded
-
- if (leafMsa.isSetModuleBuildOptions()) {
- // TODO: TEST FOR NULL SETTINGS so we don't get an error!
- //
- // Any element that appear within a leaf's ModuleBuildOptions should be appended to
- // the Merge Module's BuildOptions section.
- //
- // NO ATTEMPT IS MADE TO VERIFY UNIQUENESS ON ANYTHING WITHIN THIS SECTION!
- //
- // Create the working copy if one does not exist!
- // if (mergeBuildOptions == null)
- // mergeBuildOptions = ModuleBuildOptionsDocument.Factory.newInstance().addNewModuleBuildOptions();
-
- // ModuleBuildOptions leafModuleBuildOptions = leafMsa.getModuleBuildOptions();
-
- // mergeBuildOptions.addNewModuleBuildOptions();
- // mergeBuildOptions.setModuleBuildOptions(leafModuleBuildOptions);
-
- //
- // TODO: Code Goes Here!
- } // endif ModuleBuildOptions
-
- // Need to process any UserExtensions here too.
- if (leafMsa.getUserExtensionsList() != null) {
-
- if (mergeUserExtensions == null)
- mergeUserExtensions = UserExtensionsDocument.Factory.newInstance().addNewUserExtensions();
-
- // for (int index = 0; index < leafMsa.getUserExtensionsList().size(); index++)
-
- }
-
- } // Completed parsing all leaf files.
-
- header.setAbstract(Abstract);
- header.setCopyright(Copyright);
- header.setDescription(Description);
- License mLicense = License.Factory.newInstance();
- mLicense.setStringValue(licenseTxt);
- header.setLicense(mLicense);
- if ((DEBUG > 0) || (VERBOSE > 0))
- System.out.println("Merged Module supports: " + sArchitectures + " architectures.");
- List<String> lArchitectures = new ArrayList<String>();
- String s[] = sArchitectures.replace(" ", " ").trim().split(" ");
- for (int idx = 0; idx < s.length; idx++) {
- lArchitectures.add(s[idx]);
- if (DEBUG > 7)
- System.out.println("Adding architecture: " + s[idx]);
- }
- moduleDefs.setSupportedArchitectures(lArchitectures);
-
- } // endif mergeMsaFile == null
-
- if ((uiName != null) && (uiName.length() > 0) && (result == PASS)) {
- // TODO: Stub for replacing the msaFile UiName
- if ((DEBUG > 0) || (VERBOSE > 0))
- System.out.println("Updating the uiName: " + uiName);
- header.setModuleName(uiName);
- }
-
- if ((baseName != null) && (baseName.length() > 0) && (result == PASS)) {
- if ((DEBUG > 0) || (VERBOSE > 0))
- System.out.println("Setting the Output Filename:" + baseName);
- moduleDefs.setOutputFileBasename(baseName);
- }
-
- if (result == PASS) {
- // TODO: Stub to write out the new MSA file
- File outMsa = new File(msaFilename);
- try {
- if (DEBUG > 2)
- System.out.println("SAVING new MSA FILE: " + msaFilename);
-
- mergeMsaFile.setMsaHeader(header);
- mergeMsaFile.setModuleDefinitions(moduleDefs);
- // ALL THE REST OF THE SECTIONS ARE OPTIONAL
- // SO check that they are not null before adding them to the merged MSA file!
- if (libClassDefs != null)
- mergeMsaFile.setLibraryClassDefinitions(libClassDefs);
- if (mergeSourceFiles != null)
- mergeMsaFile.setSourceFiles(mergeSourceFiles);
- if (mergePackageDependencies != null)
- mergeMsaFile.setPackageDependencies(mergePackageDependencies);
- if (mergeProtocols != null)
- mergeMsaFile.setProtocols(mergeProtocols);
-
- if ((mergeCreateEvents != null) || (mergeSignalEvents != null)) {
- if (mergeEvents == null)
- mergeEvents = EventsDocument.Factory.newInstance().addNewEvents();
-
- if (mergeCreateEvents.getEventTypesList().size() > 0) {
- mergeEvents.addNewCreateEvents();
- mergeEvents.setCreateEvents(mergeCreateEvents);
- }
- if (mergeSignalEvents.getEventTypesList().size() > 0) {
- mergeEvents.addNewSignalEvents();
- mergeEvents.setSignalEvents(mergeSignalEvents);
- }
-
- mergeMsaFile.setEvents(mergeEvents);
- }
-
- if (mergeHobs != null)
- mergeMsaFile.setHobs(mergeHobs);
-
- if (mergePpis != null)
- mergeMsaFile.setPPIs(mergePpis);
-
- if (mergeVariables != null)
- mergeMsaFile.setVariables(mergeVariables);
-
- if (mergeBootModes != null)
- mergeMsaFile.setBootModes(mergeBootModes);
-
- if (mergeSystemTables != null)
- mergeMsaFile.setSystemTables(mergeSystemTables);
-
- if (mergeDataHubs != null)
- mergeMsaFile.setDataHubs(mergeDataHubs);
-
- if (mergeHiiPackages != null)
- mergeMsaFile.setHiiPackages(mergeHiiPackages);
-
- if (mergeGuids != null)
- mergeMsaFile.setGuids(mergeGuids);
-
- if (mergeExterns != null)
- mergeMsaFile.setExterns(mergeExterns);
-
- if (mergePcdCoded != null)
- mergeMsaFile.setPcdCoded(mergePcdCoded);
-
- XmlCursor cursor = XmlConfig.setupXmlCursor(mergeMsaFile.newCursor());
- XmlOptions options = XmlConfig.setupXmlOptions();
- ModuleSurfaceAreaDocument msaDoc = ModuleSurfaceAreaDocument.Factory.newInstance();
- msaDoc.addNewModuleSurfaceArea();
- msaDoc.setModuleSurfaceArea(mergeMsaFile);
- msaDoc.save(outMsa, options);
- System.out.println("The Merged MSA file: " + msaFilename + ", has been created!");
- } catch (IOException e) {
- System.out.println("Problem writing the output file: " + msaFilename + " " + e);
- result = FAIL;
- }
- }
-
- if ((spdFilename != null) && (result == PASS)) {
- // TODO: Stub for adding the msaFile to the <MsaFiles><Filename> in the spdFile
- String msaLine = getPathFromSpd(spdFilename, msaFilename);
- System.out.println("Updating the SPD file (" + spdFilename + ") with: " + msaLine);
- try {
- File spdFile = new File(spdFilename);
- PackageSurfaceAreaDocument spdDoc = PackageSurfaceAreaDocument.Factory.parse(spdFile);
- PackageSurfaceArea spd = spdDoc.getPackageSurfaceArea();
-
- List<String> msaFilenames = spd.getMsaFiles().getFilenameList();
- msaFilenames.add(msaLine);
- XmlCursor cursor = XmlConfig.setupXmlCursor(spd.newCursor());
- XmlOptions options = XmlConfig.setupXmlOptions();
- spdDoc.save(spdFile, options);
- } catch (IOException e) {
- System.out.println("I/O Exception on spd file: " + spdFilename + " " + e);
- } catch (XmlException x) {
- System.out.println("XML Exception on SPD file: " + spdFilename + " " + x);
- }
- } else if ((spdFilename == null) && (result == PASS)) {
-
- System.out.println("The file: " + msaFilename + ", must be added to a package file before it can be used!");
- }
- return result;
- }
-
- public ModuleSurfaceArea getLeafFile(String filename) {
- File leafMsaFile = new File(filename);
- if ((DEBUG > 1) || (VERBOSE > 1))
- System.out.println("Processing MSA File: " + filename);
- try {
- leafMsa = ModuleSurfaceAreaDocument.Factory.parse(leafMsaFile).getModuleSurfaceArea();
- if ((DEBUG > 4) || (VERBOSE > 4))
- System.out.println("Binary: " + leafMsa.getModuleDefinitions().getBinaryModule());
- if (leafMsa.getModuleDefinitions().getBinaryModule()) {
- System.out.println("ERROR: Binary Module was specified in MSA: " + filename);
- System.out.println("Merge Aborted!");
- System.err.flush();
- return null;
- }
- } catch (IOException e) {
- System.out.println("I/O Exception on filename: " + filename + " " + e);
- System.out.println("Merge Aborted!");
- System.err.flush();
- System.exit(FAIL);
- } catch (XmlException x) {
- System.out.println("XML Exception reading file: " + filename + " " + x);
- System.out.println("Merge Aborted!");
- System.err.flush();
- System.exit(FAIL);
- }
- return leafMsa;
- }
-
- private String getPathFromSpd(String spdFn, String msaFn) {
- String path2Msa = null;
-
- spdFn = spdFn.replace("\\", "/").trim();
- String s[] = spdFn.split("/");
- String justSpdFilename = s[s.length - 1];
-
- String Cwd = System.getProperty("user.dir");
- Cwd = Cwd.replace("\\", "/").trim();
- if ((DEBUG > 10) || (VERBOSE > 10)) {
- System.out.println("Current directory = " + Cwd);
- }
- String sp[] = Cwd.split("/");
- int theDirectory = sp.length - (s.length - 1);
- if (DEBUG > 10)
- System.out.println("The Directory length: " + theDirectory + " s.length: " + s.length + " sp.length: "
- + (sp.length - 1));
-
- String path2Spd = "";
- for (int ictr = 0; ictr < theDirectory; ictr++) {
- path2Spd += sp[ictr] + "/";
- if (DEBUG > 10)
- System.out.println("Creating path to SPD file: " + path2Spd);
- }
-
- String testPath2Spd = path2Spd + justSpdFilename;
-
- File tFile = new File(testPath2Spd);
- if (!tFile.exists()) {
- System.out.println("The specified SPD file, " + spdFn + " does not exist at: " + testPath2Spd);
- System.out.println("Please use the FrameworkWizard to add this MSA file to the package.");
- System.exit(FAIL);
- }
- if (path2Spd.equals(Cwd + "/"))
- {
- // .msa file and .spd in the same directory
- path2Msa = msaFn;
- }
- else
- {
- path2Msa = Cwd.replace(path2Spd, "");
- path2Msa = path2Msa + "/" + msaFn;
- }
-
- return path2Msa;
- }
-
- private String checkDuplicateStrings(String aString, ArrayList<String> aList) {
-
- for (int lctr = 0; lctr < aList.size(); lctr++) {
- if (DEBUG > 8)
- System.out.println("Comparing: \n" + aString.replace(" ", "").replace("\n", "") + "\nTo: \n"
- + aList.get(lctr).replace(" ", "").replace("\n", "").toString().trim());
- if (aString.replace(" ", "").replace("\n", "").contains(
- aList.get(lctr).replace(" ", "").replace("\n", "")
- .toString().trim())) {
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Found a duplicate String, skipping!");
- return "";
- }
- }
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Returning UNIQUE String!\n " + aString);
- aList.add(aString);
- return aString;
- }
-
- private String checkSpecs(String specName, String filename, ArrayList<String> aList) {
- // Check Specifications
- // Skip of Specs are identical
- String spec[] = new String[2];
- spec = specName.replace(" ", " ").trim().split(" ");
- String specInMem[] = new String[2];
- if ((DEBUG > 10) || (VERBOSE > 10))
- System.out.println("Specification: " + specName);
-
- for (int lctr = 0; lctr < aList.size(); lctr++) {
- if (DEBUG > 8)
- System.out.println("Comparing: \n" + specName.replace(" ", "").replace("\n", "") + "\nTo: \n"
- + aList.get(lctr).replace(" ", "").replace("\n", "").toString().trim());
- if (specName.replace(" ", "").replace("\n", "").contains(
- aList.get(lctr).replace(" ", "").replace("\n", "")
- .toString().trim())) {
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Found a duplicate String, skipping!");
- return "";
- }
- specInMem = aList.get(lctr).replace(" ", " ").trim().split(" ");
- if (spec[0].contentEquals(specInMem[0])) {
- if (!spec[1].contains(specInMem[1])) {
- System.out.println("Module: " + filename + " is coded to " + specName);
- System.out.println("Merge needs to be coded to: " + aList.get(lctr));
- System.out.println("Merge Aborted!");
- System.err.flush();
- System.exit(FAIL);
- }
- }
-
- }
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Returning Specification: " + specName);
- aList.add(specName);
- return specName;
- }
-
- private String checkPcd(String pcdName, String itemType, String filename, ArrayList<String> aList) {
-
- for (int lctr = 0; lctr < aList.size(); lctr++) {
- if (DEBUG > 8)
- System.out.println("Comparing: \n" + pcdName.replace(" ", "").replace("\n", "") + "\nTo: \n"
- + aList.get(lctr).replace(" ", "").replace("\n", "").toString().trim());
- if (pcdName.replace(" ", "").replace("\n", "").contains(
- aList.get(lctr).replace(" ", "").replace("\n", "")
- .toString().trim())) {
- if (!aPcdItemTypeList.get(lctr).contains(itemType)) {
- System.out
- .println("The Pcd Item Type for " + pcdName + " in file: " + filename + "does not match!");
- System.out.println("Expected: " + aPcdItemTypeList.get(lctr));
- System.out.println("Was set to: " + itemType);
- System.out.println("Merge Aborted!");
- System.err.flush();
- System.exit(FAIL);
- }
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Found a duplicate String, skipping!");
- return "";
- }
- }
- if ((DEBUG > 3) || (VERBOSE > 3))
- System.out.println("Returning UNIQUE String!\n " + pcdName);
- aPcdItemTypeList.add(itemType);
- aList.add(pcdName);
- return pcdName;
- }
-
- private String checkUsage() {
- String result = "";
- // Usage types are different
- if (((mergeUsage.contains("CONSUMED")) && (leafUsage.contains("PRODUCED")))
- || ((mergeUsage.contains("PRODUCED")) && (leafUsage.contains("CONSUMED")))
- || ((mergeUsage.contains("TO_START")) && (leafUsage.contains("BY_START")))
- || ((mergeUsage.contains("BY_START")) && (leafUsage.contains("TO_START")))) {
- result = "DIFFERENT";
- }
- // Both Usage types are PRODUCED
- if (((mergeUsage.contains("ALWAYS_PRODUCED")) && (leafUsage.contains("SOMETIMES_PRODUCED")))
- || ((mergeUsage.contains("SOMETIMES_PRODUCED")) && (leafUsage.contains("ALWAYS_PRODUCED")))) {
- result = "PRODUCED";
- }
-
- // Both Usage types are CONSUMED
- if (((mergeUsage.contains("ALWAYS_CONSUMED")) && (leafUsage.contains("SOMETIMES_CONSUMED")))
- || ((mergeUsage.contains("SOMETIMES_CONSUMED")) && (leafUsage.contains("ALWAYS_CONSUMED")))) {
- result = "CONSUMED";
- }
- return result;
- }
-
- private boolean checkProduced() {
- boolean result = false;
-
- if (((mergeUsage.contains("ALWAYS_PRODUCED")) && (leafUsage.contains("SOMETIMES_PRODUCED")))
- || ((mergeUsage.contains("SOMETIMES_PRODUCED")) && (leafUsage.contains("ALWAYS_PRODUCED")))) {
- result = true;
- }
- return result;
- }
-
- private boolean checkConsumed() {
- boolean result = false;
-
- if (((mergeUsage.contains("ALWAYS_CONSUMED")) && (leafUsage.contains("SOMETIMES_CONSUMED")))
- || ((mergeUsage.contains("SOMETIMES_CONSUMED")) && (leafUsage.contains("ALWAYS_CONSUMED")))) {
- result = true;
- }
- return result;
- }
-
- private String getPathPartOfLeafMsa(String sFilename) {
- String pathName = "";
- String s[] = sFilename.replace("\\", "/").trim().split("/");
- for (int j = 0; j < (s.length - 1); j++) {
- pathName += s[j] + "/";
- }
- return pathName;
- }
-
- private static class XmlConfig {
- public static XmlCursor setupXmlCursor(XmlCursor cursor) {
- String uri = "http://www.TianoCore.org/2006/Edk2.0";
- cursor.push();
- cursor.toNextToken();
- cursor.insertNamespace("", uri);
- cursor.insertNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
- cursor.pop();
- return cursor;
-
- }
-
- public static XmlOptions setupXmlOptions() {
- XmlOptions options = new XmlOptions();
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- return options;
- }
-
- }
-}
diff --git a/Tools/Java/Source/Merge/src/org/tianocore/Merge/Merge.java b/Tools/Java/Source/Merge/src/org/tianocore/Merge/Merge.java
deleted file mode 100644
index 6f727861dc..0000000000
--- a/Tools/Java/Source/Merge/src/org/tianocore/Merge/Merge.java
+++ /dev/null
@@ -1,24 +0,0 @@
-// @file
-// Merge wrapper
-//
-// 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.
-//
-
-package org.tianocore.Merge;
-
-public class Merge {
-
- public static void main(String[] args) {
- if (new MergeCmd().MergeCmdLine(args) != 0)
- System.exit(1);
- System.exit(0);
- }
-}
diff --git a/Tools/Java/Source/Merge/src/org/tianocore/Merge/MergeCmd.java b/Tools/Java/Source/Merge/src/org/tianocore/Merge/MergeCmd.java
deleted file mode 100644
index 1e44d2f8c9..0000000000
--- a/Tools/Java/Source/Merge/src/org/tianocore/Merge/MergeCmd.java
+++ /dev/null
@@ -1,211 +0,0 @@
-// @file
-// MergeCmd command-line interface to the classes that combine
-// multiple MSA files into a single MSA file.
-//
-// 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.
-//
-// This program is the command line interface to the CombineMsa class, which
-// will take the following arguments:
-//
-// Input:
-// -t Target The MSA file that will be created
-// -u UiName The UiName for the merged MSA OPTIONAL
-// If not provided, the UiName will come from the
-// first leaf MSA file
-// -p Package The SPD file that the new MSA file will be added to. OPTIONAL
-// leaf.msa The path and filename of the MSA files to be merged into the Target.
-//
-// Output:
-// Target.msa
-//
-// Modifies - OPTIONAL
-// Package.spd
-//
-
-package org.tianocore.Merge;
-
-import java.io.*;
-import java.util.*;
-
-// import org.tianocore.Merge.CombineMsa;
-
-public class MergeCmd {
-
- private static int DEBUG = 1;
-
- private static final String copyright = "Copyright (c) 2006, Intel Corporation All rights reserved.";
-
- private static final String version = "Version 0.1";
-
- private int VERBOSE = 0;
-
- private String targetFile = null;
-
- private ArrayList<String> leafFiles = new ArrayList<String>();
-
- private String spdFile = null;
-
- private String uiName = null;
-
- private String fileBasename = null;
-
- private final int ESUCCESS = 0;
-
- private final int EFAILURE = 1;
-
- private final static int FOUND = 1;
-
- private final static int NOTFOUND = 0;
-
- private int result = ESUCCESS;
-
- public int MergeCmdLine(String[] args) {
- result = parseCmdLine(args);
- if (result == ESUCCESS) {
- if ((DEBUG > 7) || (VERBOSE > 5)) {
- System.out.println("Parse Succeeded!");
- System.out.println("CWD: " + System.getProperty("user.dir"));
- System.out.println("Merge Module Name: " + targetFile);
- System.out.println("Found Leaf Module: " + leafFiles.size());
- if (spdFile != null)
- System.out.println("Package Name: " + spdFile);
- if (uiName != null)
- System.out.println("User Interface Name: " + uiName);
- }
- CombineMsa newMsa = new CombineMsa();
- result = newMsa.combineMsaFiles(targetFile, leafFiles, uiName, spdFile, fileBasename, VERBOSE);
- }
- return result;
- }
-
- private int parseCmdLine(String[] args) {
-
- if (args.length == NOTFOUND) {
- outputUsage();
- System.exit(EFAILURE);
- }
-
- for (int i = 0; i < args.length; i++) {
- if (args[i].toLowerCase().contains("-t")) {
- i++;
- targetFile = args[i];
- targetFile.replace(" ", "_");
- if (!targetFile.toLowerCase().contains(".msa"))
- targetFile = targetFile + ".msa";
-
-
- } else if (args[i].toLowerCase().contains("-p")) {
- i++;
- spdFile = args[i];
- if (!spdFile.toLowerCase().contains(".spd"))
- spdFile = spdFile + ".spd";
- spdFile = spdFile.replace("\\", "/").trim();
- if (testFile(spdFile) == NOTFOUND) {
- System.out.println("WARNING: The Package file: " + spdFile + " does NOT exist!");
- System.out.print("Do you want to continue anyway [y|N]? ");
- String inputLine = null;
- try {
- BufferedReader inputString = new BufferedReader(new InputStreamReader(System.in));
- inputLine = inputString.readLine();
- if ((inputLine.length() == 0) || (!inputLine.toLowerCase().contains("y"))) {
- System.out.println("Merge Aborted at user request!");
- System.exit(EFAILURE);
- } else {
- spdFile = null;
- System.out
- .println("Continuing with the Merge. Don't forget to add the new MSA file to a Package.");
- }
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
- }
- } else if (args[i].toLowerCase().contains("-u")) {
- i++;
- uiName = args[i];
- } else if (args[i].toLowerCase().contains("-o")) {
- i++;
- fileBasename = args[i];
- } else if (args[i].toLowerCase().contains("-v")) {
- VERBOSE++;
- } else if ((args[i].toLowerCase().contains("-h")) || (args[i].toLowerCase().contains("-?"))
- || (args[i].toLowerCase().contains("/h")) || (args[i].toLowerCase().contains("--help"))) {
- outputUsage();
- System.exit(EFAILURE);
- } else {
- if (args[i].startsWith("-")) {
- System.out.println("Invalid Argument: " + args[i]);
- outputUsage();
- System.out.println("Merge Aborted!");
- System.exit(EFAILURE);
- }
- String leafFile = args[i];
- if (!leafFile.toLowerCase().contains(".msa"))
- leafFile = leafFile + ".msa";
-
- if (testFile(leafFile) == NOTFOUND) {
- System.out.println("ERROR: The Leaf MSA File: " + leafFile + " was NOT FOUND!");
- System.out.println("Merge Aborted!");
- System.exit(EFAILURE);
- } else {
- if (DEBUG > 9)
- System.out.println("Found Leaf Module: " + leafFile);
- leafFiles.add(leafFile);
- }
- }
- }
- if (testFile(targetFile) == FOUND) {
- System.out.println("WARNING: The targetfile: " + targetFile + "Already Exists!");
- System.out.print("Do you want to over write it [y|N]? ");
- String inputLine = null;
- try {
- BufferedReader inputString = new BufferedReader(new InputStreamReader(System.in));
- inputLine = inputString.readLine();
- if ((inputLine.length() == 0) || (!inputLine.toLowerCase().contains("y"))) {
- System.out.println("Please correct the options, then try again.");
- System.out.println("Merge Aborted at user request!");
- System.exit(EFAILURE);
- }
- } catch (IOException e) {
- System.out.println("IOException: " + e);
- }
-
- }
- return ESUCCESS;
- }
-
- private static int testFile(String Filename) {
- File tFile = new File(Filename);
- if (DEBUG > 8)
- System.out.println("File is located: " + tFile.getPath());
- if (tFile.exists())
- return FOUND;
- else
- return NOTFOUND;
- }
-
- private static void outputUsage() {
-
-
- System.out.println("Merge, " + version);
- System.out.println(copyright);
- System.out.println("Usage:");
- System.out.println(" merge [-v] -t target [-u UiName] [-p PackageFile] dir1" + File.separator + "leaf1 ... dirN" + File.separator + "leafN [-h | -? | --help]");
- System.out.println(" where:");
- System.out.println(" -h | -? | --help OPTIONAL - This Help Text");
- System.out.println(" -t Target REQUIRED - The Name of the new Merge Module MSA file");
- System.out.println(" -p Package OPTIONAL - The Name of the Package (SPD) file to add the target");
- System.out.println(" -u UiName OPTIONAL - The User Interface Name for the Target Module");
- System.out.println(" -v OPTIONAL - Verbose, print information messages.");
- System.out.println(" -o OutputFileBasename OPTIONAL - Set the Output Filename for this module to Basename");
- System.out.println(" dir1" + File.separator + "leaf1 ... dirN" + File.separator + "leafN REQUIRED The path to two or more MSA files that will be merged");
- System.out.println("");
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/MANIFEST.MF b/Tools/Java/Source/MigrationTools/MANIFEST.MF
deleted file mode 100644
index ae3092ebad..0000000000
--- a/Tools/Java/Source/MigrationTools/MANIFEST.MF
+++ /dev/null
@@ -1,2 +0,0 @@
-Manifest-Version: 1.0
-Main-Class: org.tianocore.migration.MigrationTool
diff --git a/Tools/Java/Source/MigrationTools/MigrationTools.msa b/Tools/Java/Source/MigrationTools/MigrationTools.msa
deleted file mode 100644
index 8160bcc8ba..0000000000
--- a/Tools/Java/Source/MigrationTools/MigrationTools.msa
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>MigrationTools</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>09C77FAE-6374-408e-AB88-32822B92096E</GuidValue>
- <Version>1.0</Version>
- <Abstract>This is the EFI/Tiano Migration Tool Resources Module</Abstract>
- <Description>
- This Module provdes the entity, action and exception package for Migration
- tools, This package will be shared for building tools or wizard tools.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>org/tianocore/migration/Common.java</Filename>
- <Filename>org/tianocore/migration/Critic.java</Filename>
- <Filename>org/tianocore/migration/Database.java</Filename>
- <Filename>org/tianocore/migration/FirstPanel.java</Filename>
- <Filename>org/tianocore/migration/Func.java</Filename>
- <Filename>org/tianocore/migration/Guid.java</Filename>
- <Filename>org/tianocore/migration/Macro.java</Filename>
- <Filename>org/tianocore/migration/MigrationTool.java</Filename>
- <Filename>org/tianocore/migration/ModuleInfo.java</Filename>
- <Filename>org/tianocore/migration/ModuleReader.java</Filename>
- <Filename>org/tianocore/migration/MsaOwner.java</Filename>
- <Filename>org/tianocore/migration/MsaTreeEditor.java</Filename>
- <Filename>org/tianocore/migration/MsaWriter.java</Filename>
- <Filename>org/tianocore/migration/PathIterator.java</Filename>
- <Filename>org/tianocore/migration/SourceFileReplacer.java</Filename>
- <Filename>org/tianocore/migration/UI.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea> \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/build.xml b/Tools/Java/Source/MigrationTools/build.xml
deleted file mode 100644
index ddb4979ea9..0000000000
--- a/Tools/Java/Source/MigrationTools/build.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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="MigrationTools" default="MigrationTools" basedir=".">
-
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <property name="WORKSPACE" value="${env.WORKSPACE}"/>
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars" includes="*.jar"/>
- <fileset dir="${env.XMLBEANS_HOME}/lib" includes="*.jar"/>
- </path>
- <property name="buildDir" value="build"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/bin"/>
- <target name="MigrationTools" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/MigrationTools" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: MigrationTools.jar"/>
- <delete file="${installLocation}/MigrationTools.jar"/>
- <if>
- <available file="${installLocation}/MigrationTools.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/MigrationTools.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}/MigrationTools.jar"
- basedir="${buildDir}"
- includes="**"
- manifest="MANIFEST.MF"
- />
- </target>
-</project>
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Common.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Common.java
deleted file mode 100644
index 3a6f179df8..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Common.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public final class Common {
- public static final int BOTH = 0;
-
- public static final int FILE = 1;
-
- public static final int DIR = 2;
-
- public static final String STRSEPARATER = "(.*)\\\\([^\\\\]*)";
-
- public static final Pattern PTNSEPARATER = Pattern
- .compile("(.*)\\\\([^\\\\]*)");
-
- // -------------------------------------regex------------------------------------------//
-
- public static final String replaceAll(String line, Pattern ptn, String des) {
- Matcher mtr = ptn.matcher(line);
-
- if (mtr.find()) {
- return mtr.replaceAll(des);
- }
-
- return line;
- }
-
- public static final boolean find(String line, String regex) {
- Pattern ptn = Pattern.compile(regex);
-
- return ptn.matcher(line).find();
- }
-
- // -------------------------------------regex------------------------------------------//
-
- // -----------------------------------file&string---------------------------------------//
-
- public static final String file2string(String filename) throws Exception {
- BufferedReader rd = new BufferedReader(new FileReader(filename));
- StringBuffer wholefile = new StringBuffer();
- String line;
- while ((line = rd.readLine()) != null) {
- wholefile.append(line + "\n");
- }
- rd.close();
- return wholefile.toString();
- }
-
- public static final void string2file(String content, String filename)
- throws Exception {
- ensureDir(filename);
- PrintWriter outfile = new PrintWriter(new BufferedWriter(
- new FileWriter(filename)));
- outfile.append(content);
- outfile.flush();
- outfile.close();
- }
-
- public static final void fileCopy(String src, String des) throws Exception {
- string2file(file2string(src), des);
- }
-
- // -----------------------------------file&string---------------------------------------//
-
- // --------------------------------------dir--------------------------------------------//
- /*
- * public static final HashSet<String> walkDir(String path, int mode)
- * throws Exception { HashSet<String> pathlist = new HashSet<String>();
- * Common.toDoAll(path, Common.class.getMethod("walkDir", String.class),
- * null, null, mode); return pathlist; }
- */
- public static final void ensureDir(String objFileWhole) {
- File tempdir;
- Matcher mtrseparate = PTNSEPARATER.matcher(objFileWhole);
- if (mtrseparate.find()) {
- tempdir = new File(mtrseparate.group(1));
- if (!tempdir.exists())
- tempdir.mkdirs();
- }
- }
-
- public static final void deleteDir(String objFileWhole) {
- String[] list = new File(objFileWhole).list();
- File temp;
- for (int i = 0; i < list.length; i++) {
- temp = new File(objFileWhole + File.separator + list[i]);
- if (temp.isDirectory()) {
- deleteDir(objFileWhole + File.separator + list[i]);
- } else {
- temp.delete();
- }
- }
- new File(objFileWhole).delete();
- }
-
- public static final String dirCopy_(String src) throws Exception {
- Matcher mtrseparate = Common.PTNSEPARATER.matcher(src);
- if (mtrseparate.find()) {
- dirCopy(src, mtrseparate.group(1) + File.separator + "_"
- + mtrseparate.group(2));
- }
- return mtrseparate.group(1) + File.separator + "_"
- + mtrseparate.group(2);
- }
-
- public static final void dirCopy(String src, String des) throws Exception {
- String[] list = new File(src).list();
- File test;
-
- ensureDir(des);
- for (int i = 0; i < list.length; i++) {
- test = new File(src + File.separator + list[i]);
- if (test.isDirectory()) {
- dirCopy(src + File.separator + list[i], des + File.separator
- + list[i]);
- } else {
- // ensureDir(des + File.separator + list[i]);
- string2file(file2string(src + File.separator + list[i]), des
- + File.separator + list[i]);
- }
- }
- }
-
- public static final void oneLevelDirCopy(String src, String des, String type)
- throws Exception {
- String[] list = new File(src).list();
-
- ensureDir(des);
- for (int i = 0; i < list.length; i++) {
- if (list[i].contains(type)) {
- string2file(file2string(src + File.separator + list[i]), des
- + File.separator + list[i]);
- }
- }
- }
-
- // --------------------------------------dir--------------------------------------------//
-
- // -------------------------------like python
- // walk-----------------------------------------//
-
- public static final void toDoAll(String path, Method md, Object obj,
- Object[] args, int type) throws Exception {
- String[] list = new File(path).list();
- ArrayList<Object> _args = new ArrayList<Object>();
-
- _args.add(path);
- if (args != null) {
- for (int i = 0; i < args.length; i++) {
- _args.add(args[i]);
- }
- }
-
- if (type == DIR || type == BOTH) {
- md.invoke(obj, _args.toArray());
- }
- for (int i = 0; i < list.length; i++) {
- if (new File(path + File.separator + list[i]).isDirectory()) {
- toDoAll(path + File.separator + list[i], md, obj, args, type);
- } else {
- if (type == FILE || type == BOTH) {
- _args.set(0, path + File.separator + list[i]);
- md.invoke(obj, _args.toArray());
- }
- }
- }
- }
-
- public static final void toDoAll(Set<String> set, ForDoAll fda)
- throws Exception {
- Iterator<String> di = set.iterator();
- while (di.hasNext()) {
- fda.run(di.next());
- }
- }
-
- public static final void toDoAll(String path, ForDoAll fda, int type)
- throws Exception { // filter of file type can be done in toDo
- String[] list = new File(path).list();
- File test;
-
- if (type == DIR || type == BOTH) {
- fda.run(path);
- }
- for (int i = 0; i < list.length; i++) {
- test = new File(path + File.separator + list[i]);
- if (test.isDirectory()) {
- if (fda.filter(test)) {
- toDoAll(path + File.separator + list[i], fda, type);
- }
- } else {
- if (type == FILE || type == BOTH) {
- fda.run(path + File.separator + list[i]);
- }
- }
- }
- }
-
- public static interface ForDoAll {
- public void run(String filepath) throws Exception;
-
- public boolean filter(File dir);
- }
-
- public static abstract class Laplace {
- public void transform(String src, String des) throws Exception {
- Common.string2file(operation(Common.file2string(src)), des);
- }
-
- public abstract String operation(String wholeline);
-
- public abstract boolean recognize(String filename);
-
- public abstract String namechange(String oldname);
- }
-
- public static interface Element {
-
- // public int replace = 0;
- // public int type = 1;
-
- public String getReplace(String key);
-
- // public void getType(String key);
- //
- // public void setReplace(int num);
- //
- // public void setType(int num);
-
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Critic.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Critic.java
deleted file mode 100644
index e0e48a9671..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Critic.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedReader;
-import java.io.StringReader;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public final class Critic {
- public static final Pattern PTN_NEW_HEAD_COMMENT = Pattern.compile(
- "^\\/\\*\\*.*?\\*\\*\\/", Pattern.DOTALL);
-
- private static final Pattern ptnheadcomment = Pattern.compile(
- "^\\/\\*\\+\\+(.*?)\\-\\-\\*\\/", Pattern.DOTALL);
-
- private static final Pattern ptnfunccomment = Pattern
- .compile(
- "([\\};\\/\">]\\s*)([\\w\\s\\*]*?[_\\w][_\\w\\d]*\\s*\\([^\\)\\(]*\\)\\s*)\\/\\*\\+\\+(.*?)\\-\\-\\*\\/\\s*(.*?)(?=[\\{;])",
- Pattern.DOTALL); // find function with {;">/ , may be
- // unsafe
-
- // private static Pattern ptncommentstructure =
- // Pattern.compile("\\/\\*\\+\\+\\s*Routine
- // Description:\\s*(.*?)\\s*Arguments:\\s*(.*?)\\s*Returns:\\s*(.*?)\\s*\\-\\-\\*\\/",Pattern.DOTALL);
- private static final Pattern ptncommentequation = Pattern
- .compile("([^\\s]*)\\s+-\\s+(.*)\\s*");
-
- private static Matcher mtrcommentequation;
-
- private static final Pattern ptnnewcomment = Pattern
- .compile("(\\s*@(param|retval)\\s+[^\\s]+)\\s+(.*)");
-
- private static Matcher mtrnewcomment;
-
- private static final int totallinelength = 82;
-
- public static final void run(String filepath) throws Exception {
- if (MigrationTool.doCritic) { // this is left here to set an example
- // for future structure
- critic(filepath);
- }
- }
-
- private static final void critic(String filepath) throws Exception {
- if (filepath.contains(".c") || filepath.contains(".h")) {
- BufferedReader rd = null;
- String line = null;
- StringBuffer templine = new StringBuffer();
- boolean incomment = false;
-
- System.out.println("Criticing " + filepath);
- String wholeline = Common.file2string(filepath);
-
- wholeline = wholeline.replaceAll("\t", " ");
- wholeline = Common.replaceAll(wholeline, ptnheadcomment,
- "/** @file$1**/");
- wholeline = Common.replaceAll(wholeline, ptnfunccomment,
- "$1\n/**$3\n**/\n$4$2");
- // wholeline = Common.replaceAll(wholeline, ptncommentstructure,
- // "/**\n#%\n$1\n%#\n#%%\n$2\n%%#\n#%%%\n$3\n%%%#\n**/");
-
- // first scan
- boolean description = false;
- boolean arguments = false;
- boolean returns = false;
- boolean inequation = false;
- rd = new BufferedReader(new StringReader(wholeline));
- while ((line = rd.readLine()) != null) {
- if (line.matches("\\/\\*\\*")) {
- incomment = true;
- description = false;
- arguments = false;
- returns = false;
- templine.append(line + "\n");
- } else if (line.matches("\\*\\*\\/")) {
- incomment = false;
- templine.append("\n" + line + "\n");
- } else if (incomment) {
- if (line.contains("Routine Description:")) {
- description = true;
- arguments = false;
- returns = false;
- } else if (line.contains("Arguments:")) {
- description = false;
- arguments = true;
- returns = false;
- templine.append("\n");
- } else if (line.contains("Returns:")) {
- description = false;
- arguments = false;
- returns = true;
- templine.append("\n");
- } else if (description) {
- if (line.trim().length() != 0) {
- templine.append(" " + line.trim() + "\n");
- }
- } else if (arguments) {
- mtrcommentequation = ptncommentequation.matcher(line);
- if (mtrcommentequation.find()) {
- inequation = true;
- templine.append(" @param "
- + mtrcommentequation.group(1) + " "
- + mtrcommentequation.group(2) + "\n");
- } else if (inequation && line.trim().length() == 0) {
- inequation = false;
- } else if (inequation && line.trim().length() != 0) {
- templine.append("#%#%" + line + "\n");
- } else {
- if (line.trim().length() != 0) {
- templine.append(" " + line.trim() + "\n");
- }
- }
- } else if (returns) {
- mtrcommentequation = ptncommentequation.matcher(line);
- if (mtrcommentequation.find()) {
- inequation = true;
- templine.append(" @retval "
- + mtrcommentequation.group(1) + " "
- + mtrcommentequation.group(2) + "\n");
- } else if (inequation && line.trim().length() == 0) {
- inequation = false;
- } else if (inequation && line.trim().length() != 0) {
- templine.append("#%#%" + line + "\n");
- } else {
- if (line.trim().length() != 0) {
- templine.append(" @return " + line.trim()
- + "\n");
- }
- }
- }
- } else {
- templine.append(line + "\n");
- }
- }
- wholeline = templine.toString();
- wholeline = wholeline.replaceAll("\n#%#%\\s*", " ");
- //
-
- // secend scan
- int startmax = 0;
- rd = new BufferedReader(new StringReader(wholeline));
- while ((line = rd.readLine()) != null) {
- if (line.matches("\\/\\*\\*")) {
- incomment = true;
- templine.append(line + "\n");
- } else if (line.matches("\\*\\*\\/")) {
- incomment = false;
- templine.append(line + "\n");
- } else if (incomment) {
- mtrnewcomment = ptnnewcomment.matcher(line);
- if (mtrnewcomment.find()) {
- startmax = mtrnewcomment.group(1).length() > startmax ? mtrnewcomment
- .group(1).length()
- : startmax;
- }
- }
- }
- startmax++;
- //
-
- // third scan
- int n = 0;
- String temp = null;
- String[] tempcont = null;
- int count = 0;
- templine = new StringBuffer();
- rd = new BufferedReader(new StringReader(wholeline));
- while ((line = rd.readLine()) != null) {
- if (line.matches("\\/\\*\\*")) {
- incomment = true;
- templine.append(line + "\n");
- } else if (line.matches("\\*\\*\\/")) {
- incomment = false;
- templine.append(line + "\n");
- } else if (incomment) {
- mtrnewcomment = ptnnewcomment.matcher(line);
- if (mtrnewcomment.find()) {
- n = startmax - mtrnewcomment.group(1).length();
- templine.append(mtrnewcomment.group(1));
- while (n-- >= 0) {
- templine.append(" ");
- }
- temp = mtrnewcomment.group(3);
- tempcont = temp.split(" "); // use \\s+ ?
-
- count = 0;
- for (int i = 0; i < tempcont.length; i++) {
- count += tempcont[i].length();
- if (count <= (totallinelength - startmax)) {
- templine.append(tempcont[i] + " ");
- count += 1;
- } else {
- templine.append("\n");
- n = startmax;
- while (n-- >= 0) {
- templine.append(" ");
- }
- templine.append(tempcont[i] + " ");
- count = tempcont[i].length() + 1;
- }
- }
- templine.append("\n");
- } else {
- templine.append(line + "\n");
- }
- } else {
- templine.append(line + "\n");
- }
- }
- wholeline = templine.toString();
- //
- // Remove trailing blanks.
- //
- wholeline = wholeline.replaceAll(" +\n", "\n");
- Common.string2file(wholeline, filepath);
- }
- }
-
- public static final void fireAt(String path) throws Exception {
- // Common.toDoAll(Common.dirCopy_(path),
- // Critic.class.getMethod("critic", String.class), null, null,
- // Common.FILE);
- Common.toDoAll(path, Critic.class.getMethod("run", String.class), null,
- null, Common.FILE);
- // Common.toDoAll(Common.dirCopy_(path), critic, Common.FILE);
- System.out.println("Critic Done");
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java
deleted file mode 100644
index 5daae526f3..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Database.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.apache.xmlbeans.XmlObject;
-import org.tianocore.DbPathAndFilename;
-import org.tianocore.FrameworkDatabaseDocument;
-import org.tianocore.PackageSurfaceAreaDocument;
-import org.tianocore.FrameworkDatabaseDocument.FrameworkDatabase;
-import org.tianocore.GuidDeclarationsDocument.GuidDeclarations;
-import org.tianocore.LibraryClassDeclarationsDocument.LibraryClassDeclarations;
-import org.tianocore.LibraryClassDeclarationsDocument.LibraryClassDeclarations.LibraryClass;
-import org.tianocore.PackageSurfaceAreaDocument.PackageSurfaceArea;
-import org.tianocore.PpiDeclarationsDocument.PpiDeclarations;
-import org.tianocore.ProtocolDeclarationsDocument.ProtocolDeclarations;
-
-public final class Database {
- private static final Database INSTANCE = Database.init();;
-
- Database(String path) {
- DatabasePath = path;
-
- try {
- // collectWorkSpaceDatabase();
- importPkgGuid("PkgGuid.csv");
- importDBLib("Library.csv");
- importDBGuid("Guid.csv", "Guid");
- importDBGuid("Ppi.csv", "Ppi");
- importDBGuid("Protocol.csv", "Protocol");
- importDBMacro("Macro.csv");
- importListR8Only();
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
- }
-
- public String DatabasePath;
-
- public Set<String> error = new HashSet<String>();
-
- public Set<String> r8only = new HashSet<String>();
-
- private Map<String, Guid> hashguid = new HashMap<String, Guid>();
-
- private Map<String, Func> hashfunc = new HashMap<String, Func>();
-
- private Map<String, Macro> hashmacro = new HashMap<String, Macro>();
-
- private Map<String, String> hashPkgGuid = new HashMap<String, String>();
-
- // -------------------------------------import------------------------------------------//
- private void importPkgGuid(String filename) throws Exception {
- BufferedReader rd = new BufferedReader(new FileReader(DatabasePath
- + File.separator + filename));
- String line;
- String[] linecontext;
-
- if (rd.ready()) {
- System.out.println("Found " + filename
- + ", Importing Package Guid Database.");
- //
- // Skip the title row.
- //
- line = rd.readLine();
- while ((line = rd.readLine()) != null) {
- if (line.length() != 0) {
- linecontext = line.split(",");
- hashPkgGuid.put(linecontext[0], linecontext[1]);
- }
- }
- }
- }
-
- public Iterator<String> dumpAllPkgGuid() {
- return hashPkgGuid.values().iterator();
- }
-
- private void importDBLib(String filename) throws Exception {
- BufferedReader rd = new BufferedReader(new FileReader(DatabasePath
- + File.separator + filename));
- String line;
- String[] linecontext;
- Func lf;
-
- if (rd.ready()) {
- System.out.println("Found " + filename
- + ", Importing Library Database.");
- while ((line = rd.readLine()) != null) {
- if (line.length() != 0) {
- linecontext = line.split(",");
- lf = new Func(linecontext);
- hashfunc.put(lf.r8funcname, lf);
- }
- }
- }
- }
-
- private void importDBGuid(String filename, String type) throws Exception {
- BufferedReader rd = new BufferedReader(new FileReader(DatabasePath
- + File.separator + filename));
- String line;
- String[] linecontext;
- Guid gu;
-
- if (rd.ready()) {
- System.out.println("Found " + filename + ", Importing " + type
- + " Database.");
- while ((line = rd.readLine()) != null) {
- if (line.length() != 0) {
- linecontext = line.split(",");
- gu = new Guid(linecontext, type);
- hashguid.put(gu.r8name, gu);
- }
- }
- }
- }
-
- private void importDBMacro(String filename) throws Exception {
- BufferedReader rd = new BufferedReader(new FileReader(DatabasePath
- + File.separator + filename));
- String line;
- String[] linecontext;
- Macro mc;
-
- if (rd.ready()) {
- System.out.println("Found " + filename
- + ", Importing Macro Database.");
- while ((line = rd.readLine()) != null) {
- if (line.length() != 0) {
- linecontext = line.split(",");
- mc = new Macro(linecontext);
- hashmacro.put(mc.r8name, mc);
- }
- }
- }
- }
-
- private void importListR8Only() throws Exception {
- Pattern ptnr8only = Pattern.compile(
- "////#?(\\w*)?.*?R8_(.*?)\\s*\\(.*?////~", Pattern.DOTALL);
- String wholeline = Common.file2string(DatabasePath + File.separator
- + "R8Lib.c");
- System.out
- .println("Found " + "R8Lib.c" + ", Importing R8Lib Database.");
- Matcher mtrr8only = ptnr8only.matcher(wholeline);
- while (mtrr8only.find()) {
- r8only.add(mtrr8only.group(2));
- }
- }
-
- // -------------------------------------import------------------------------------------//
-
- // -------------------------------------get------------------------------------------//
-
- public String getR9Lib(String r8funcname) {
- String temp = null;
- if (hashfunc.containsKey(r8funcname)) {
- temp = hashfunc.get(r8funcname).r9libname;
- }
- return temp;
- }
-
- public String getR9Func(String r8funcname) {
- String temp = null;
- if (hashfunc.containsKey(r8funcname)) {
- temp = hashfunc.get(r8funcname).r9funcname;
- }
- return temp;
- }
-
- public String getR9Macro(String r8macro) {
- return hashmacro.get(r8macro).r9name; // the verification job of if
- // the macro exists in the
- // database is done when
- // registering it
- }
-
- public String getR9Guidname(String r8Guid) {
- String temp = null;
- try {
- temp = hashguid.get(r8Guid).r9name;
- } catch (NullPointerException e) {
- error.add("getR9Guidname :" + r8Guid);
- }
- return temp;
- }
-
- public String getGuidType(String r8Guid) {
- String temp = null;
- try {
- temp = hashguid.get(r8Guid).type;
- } catch (NullPointerException e) {
- error.add("getR9Guidname :" + r8Guid);
- }
- return temp;
- }
-
- // -------------------------------------get------------------------------------------//
-
- // -------------------------------------has------------------------------------------//
-
- public boolean hasFunc(String r8lib) {
- return hashfunc.containsKey(r8lib);
- }
-
- public boolean hasGuid(String r8guid) {
- return hashguid.containsKey(r8guid);
- }
-
- public boolean hasMacro(String r8macro) {
- return hashmacro.containsKey(r8macro);
- }
-
- // -------------------------------------has------------------------------------------//
-
- // -------------------------------------init------------------------------------------//
-
- private static final Database init() {
- if (System.getenv("WORKSPACE") == null) {
- return new Database("C:" + File.separator + "tianocore"
- + File.separator + "edk2" + File.separator + "Tools"
- + File.separator + "Conf" + File.separator + "Migration");
- } else {
- return new Database(System.getenv("WORKSPACE") + File.separator
- + "Tools" + File.separator + "Conf" + File.separator
- + "Migration");
- }
- }
-
- public static final Database getInstance() {
- return INSTANCE;
- }
-
- private String workspacePath;
-
- private HashMap<String, String> hashDbGuids = new HashMap<String, String>();
-
- private HashMap<String, String> hashDbPpis = new HashMap<String, String>();
-
- private HashMap<String, String> hashDbProtocols = new HashMap<String, String>();
-
- private HashMap<String, String> hashDbLibSymbols = new HashMap<String, String>();
-
- private HashMap<String, String> hashDbLibFunctions = new HashMap<String, String>();
-
- private HashMap<String, String> hashDbLibExterns = new HashMap<String, String>();
-
- private final String regLibClassName = ".*\\W(\\w[\\w\\d]*)\\.h";
-
- private final Pattern ptnLibClassName = Pattern.compile(regLibClassName);
-
- private final String regLibSymbol = "#define\\s+(\\w[\\w\\d]*)";
-
- private final Pattern ptnLibSymbol = Pattern.compile(regLibSymbol);
-
- private final String regLibDataType = "[A-Z][A-Z0-9_]*\\s*\\**";
-
- private final String regLibFunction = regLibDataType
- + "\\s*(?:EFIAPI)?\\s+" + "(\\w[\\w\\d]*)\\s*\\([^)]*\\)\\s*;";
-
- private Pattern ptnLibFunction = Pattern.compile(regLibFunction);
-
- private final String regLibExtern = "extern\\s+" + regLibDataType
- + "\\s*(\\w[\\w\\d]*)";
-
- private final Pattern ptnLibExtern = Pattern.compile(regLibExtern);
-
- private final String convertToOsFilePath(String filePath) {
- return filePath.replace("/", File.separator).replace("\\",
- File.separator);
- }
-
- private final void collectLibHeaderFileInfo(String libHeaderFile,
- String pkgGuid) throws Exception {
- String fileContents;
- String libClassName;
- String libContainer;
- Matcher mtrLibClass;
- Matcher mtrLibSymbol;
- Matcher mtrLibFunction;
- Matcher mtrLibExtern;
-
- System.out.println("Parsing: " + libHeaderFile);
- mtrLibClass = ptnLibClassName.matcher(libHeaderFile);
- if (!mtrLibClass.matches()) {
- throw new Exception("Illegal libary header file");
- }
- libClassName = mtrLibClass.group(1);
- libContainer = libClassName + "@" + pkgGuid;
-
- fileContents = Common.file2string(libHeaderFile);
- mtrLibSymbol = ptnLibSymbol.matcher(fileContents);
- while (mtrLibSymbol.find()) {
- String libSymbol;
- String oldLibContainer;
-
- libSymbol = mtrLibSymbol.group(1);
- oldLibContainer = hashDbLibSymbols.put(libSymbol, libContainer);
- if (oldLibContainer != null) {
- String warnMessage;
-
- warnMessage = "Duplicated Lib Symbol:" + libSymbol + " Found. "
- + "Later package will overide the previous one";
- System.out.println(warnMessage);
- }
- }
-
- mtrLibFunction = ptnLibFunction.matcher(fileContents);
- while (mtrLibFunction.find()) {
- String libFunction;
- String oldLibContainer;
-
- libFunction = mtrLibFunction.group(1);
- oldLibContainer = hashDbLibFunctions.put(libFunction, libContainer);
- if (oldLibContainer != null) {
- String warnMessage;
-
- warnMessage = "Duplicated Lib Function:" + libFunction
- + " Found. "
- + "Later package will overide the previous one";
- System.out.println(warnMessage);
- }
- }
-
- mtrLibExtern = ptnLibExtern.matcher(fileContents);
- while (mtrLibExtern.find()) {
- String libExtern;
- String oldLibContainer;
-
- libExtern = mtrLibExtern.group(1);
- oldLibContainer = hashDbLibExterns.put(libExtern, libContainer);
- if (oldLibContainer != null) {
- String warnMessage;
-
- warnMessage = "Duplicated Lib Extern:" + libExtern + " Found. "
- + "Later package will overide the previous one";
- System.out.println(warnMessage);
- }
- }
- }
-
- private final void collectLibDataBase(PackageSurfaceArea spdDatabase,
- String pkgDirectory) throws Exception {
- String pkgGuid;
- LibraryClassDeclarations libClassDeclarations;
-
- pkgGuid = spdDatabase.getSpdHeader().getGuidValue();
- libClassDeclarations = spdDatabase.getLibraryClassDeclarations();
- if (libClassDeclarations != null) {
- Iterator<LibraryClass> itLibClass;
-
- itLibClass = libClassDeclarations.getLibraryClassList().iterator();
- while (itLibClass.hasNext()) {
- String libHeaderFile;
-
- libHeaderFile = pkgDirectory + File.separator
- + itLibClass.next().getIncludeHeader();
- libHeaderFile = convertToOsFilePath(libHeaderFile);
- try {
- collectLibHeaderFileInfo(libHeaderFile, pkgGuid);
- } catch (Exception e) {
- String errorMessage;
-
- errorMessage = "Error (" + e.getMessage()
- + ")occurs when parsing " + libHeaderFile;
- System.out.println(errorMessage);
- }
- }
- }
- }
-
- private final void collectGuidDatabase(PackageSurfaceArea spdDatabase)
- throws Exception {
- String pkgGuid;
- GuidDeclarations guidDeclarations;
-
- pkgGuid = spdDatabase.getSpdHeader().getGuidValue();
- guidDeclarations = spdDatabase.getGuidDeclarations();
- if (guidDeclarations != null) {
- Iterator<GuidDeclarations.Entry> itGuids;
-
- itGuids = guidDeclarations.getEntryList().iterator();
- while (itGuids.hasNext()) {
- hashDbGuids.put(itGuids.next().getCName(), pkgGuid);
- }
- }
-
- }
-
- private final void collectPpiDatabase(PackageSurfaceArea spdDatabase)
- throws Exception {
- String pkgGuid;
- PpiDeclarations ppiDeclarations;
-
- pkgGuid = spdDatabase.getSpdHeader().getGuidValue();
- ppiDeclarations = spdDatabase.getPpiDeclarations();
-
- if (ppiDeclarations != null) {
- Iterator<PpiDeclarations.Entry> itPpis;
-
- itPpis = ppiDeclarations.getEntryList().iterator();
- while (itPpis.hasNext()) {
- hashDbPpis.put(itPpis.next().getCName(), pkgGuid);
- }
- }
-
- }
-
- private final void collectProtocolDatabase(PackageSurfaceArea spdDatabase)
- throws Exception {
- String pkgGuid;
- ProtocolDeclarations protocolDeclarations;
-
- pkgGuid = spdDatabase.getSpdHeader().getGuidValue();
- protocolDeclarations = spdDatabase.getProtocolDeclarations();
-
- if (protocolDeclarations != null) {
- Iterator<ProtocolDeclarations.Entry> itProtocols;
-
- itProtocols = protocolDeclarations.getEntryList().iterator();
- while (itProtocols.hasNext()) {
- hashDbGuids.put(itProtocols.next().getCName(), pkgGuid);
- }
- }
-
- }
-
- private final void collectPackageDatabase(String packageFileName)
- throws Exception {
- XmlObject xmlPackage;
- PackageSurfaceArea spdDatabase;
- File pkgFile;
-
- pkgFile = new File(packageFileName);
- xmlPackage = XmlObject.Factory.parse(pkgFile);
- spdDatabase = ((PackageSurfaceAreaDocument) xmlPackage)
- .getPackageSurfaceArea();
-
- collectGuidDatabase(spdDatabase);
- collectProtocolDatabase(spdDatabase);
- collectPpiDatabase(spdDatabase);
- collectLibDataBase(spdDatabase, pkgFile.getParent());
-
- }
-
- public final void collectWorkSpaceDatabase() throws Exception {
- String databaseFileName;
- File databaseFile;
- XmlObject xmlDatabase;
- FrameworkDatabase frameworkDatabase;
- Iterator<DbPathAndFilename> packageFile;
-
- workspacePath = System.getenv("WORKSPACE");
-
- if (workspacePath == null) {
- String errorMessage = "Envivornment variable \"WORKSPACE\" is not set!";
- throw new Exception(errorMessage);
- }
- databaseFileName = workspacePath + File.separator + "Tools"
- + File.separator + "Conf" + File.separator
- + "FrameworkDatabase.db";
- System.out.println("Open " + databaseFileName);
- databaseFile = new File(databaseFileName);
- xmlDatabase = XmlObject.Factory.parse(databaseFile);
- frameworkDatabase = ((FrameworkDatabaseDocument) xmlDatabase)
- .getFrameworkDatabase();
- packageFile = frameworkDatabase.getPackageList().getFilenameList()
- .iterator();
-
- while (packageFile.hasNext()) {
- String packageFileName = packageFile.next().getStringValue();
- packageFileName = workspacePath + File.separator + packageFileName;
- packageFileName = convertToOsFilePath(packageFileName);
-
- System.out.println("Parsing: " + packageFileName);
- try {
- collectPackageDatabase(packageFileName);
- } catch (Exception e) {
- System.out.println("Error occured when opening "
- + packageFileName + e.getMessage());
- }
- }
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/FirstPanel.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
deleted file mode 100644
index 3e6dc9af9d..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/FirstPanel.java
+++ /dev/null
@@ -1,305 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.awt.GridBagConstraints;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.util.Set;
-
-import javax.swing.BoxLayout;
-import javax.swing.JButton;
-import javax.swing.JCheckBox;
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-import javax.swing.UIManager;
-
-public final class FirstPanel extends JPanel implements ActionListener,
- ItemListener, UI {
- /**
- * Define class Serial Version UID
- */
- private static final long serialVersionUID = 207759413522910399L;
-
- private static final FirstPanel INSTANCE = FirstPanel.init();
-
- private String startpath = null;
-
- private JButton moduleButton, goButton, msaEditorButton, criticButton,
- specifyCommentButton;
-
- private JTextField moduletext;
-
- private JTextArea log;
-
- private JFileChooser fc = new JFileChooser();
-
- private JCheckBox filebox, screenbox, mibox, criticbox, defaultpathbox;
-
- private boolean tofile = true, toscreen = true;
-
- private PrintWriter logfile;
-
- FirstPanel() {
- GridBagLayout gridbag = new GridBagLayout();
- setLayout(gridbag);
-
- GridBagConstraints cst = new GridBagConstraints();
-
- goButton = new JButton("Go");
- goButton.addActionListener(this);
- goButton.setActionCommand("go");
-
- moduleButton = new JButton("Choose ModulePath");
- moduleButton.addActionListener(this);
-
- msaEditorButton = new JButton("MsaEditor");
- msaEditorButton.addActionListener(this);
-
- criticButton = new JButton("Critic");
- criticButton.addActionListener(this);
-
- specifyCommentButton = new JButton("Comment Style");
- specifyCommentButton.addActionListener(this);
-
- moduletext = new JTextField(30);
-
- filebox = new JCheckBox("Output to logfile", true);
- filebox.addItemListener(this);
-
- screenbox = new JCheckBox("Specify logfile", false);
- screenbox.addItemListener(this);
-
- mibox = new JCheckBox("Print ModuleInfo", false);
- mibox.addItemListener(this);
- MigrationTool.printModuleInfo = false;
-
- criticbox = new JCheckBox("Run Critic", true);
- criticbox.addItemListener(this);
- MigrationTool.doCritic = true;
-
- defaultpathbox = new JCheckBox("Use Default Output Path", true);
- defaultpathbox.addItemListener(this);
- MigrationTool.defaultoutput = true;
-
- JPanel modulePanel = new JPanel();
- modulePanel.add(moduleButton);
- modulePanel.add(moduletext);
- modulePanel.add(goButton);
- // modulePanel.add(msaEditorButton);
- cst.gridx = 0;
- cst.gridy = 0;
- // cst.gridwidth = GridBagConstraints.REMAINDER;
- gridbag.setConstraints(modulePanel, cst);
- add(modulePanel);
-
- cst.gridx = 1;
- cst.gridy = 0;
- gridbag.setConstraints(specifyCommentButton, cst);
- add(specifyCommentButton);
- // gridbag.setConstraints(criticButton, cst);
- // add(criticButton);
-
- JPanel checkboxPanel = new JPanel();
- checkboxPanel.setLayout(new BoxLayout(checkboxPanel, BoxLayout.Y_AXIS));
- checkboxPanel.add(filebox);
- checkboxPanel.add(screenbox);
- checkboxPanel.add(mibox);
- checkboxPanel.add(criticbox);
- checkboxPanel.add(defaultpathbox);
- cst.gridx = 1;
- cst.gridy = 1;
- // cst.gridheight = 2;
- gridbag.setConstraints(checkboxPanel, cst);
- add(checkboxPanel);
-
- log = new JTextArea(10, 20);
- log.setMargin(new Insets(5, 5, 5, 5));
- log.setEditable(false);
- JScrollPane logScrollPane = new JScrollPane(log);
- cst.gridx = 0;
- cst.gridy = 1;
- cst.fill = GridBagConstraints.BOTH;
- gridbag.setConstraints(logScrollPane, cst);
- add(logScrollPane);
- }
-
- // ---------------------------------------------------------------------------------------//
-
- public boolean yesOrNo(String question) {
- return JOptionPane.showConfirmDialog(this, question, "Yes or No",
- JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION;
- }
-
- public void print(String message) {
- if (toscreen == true) {
- log.append(message);
- System.out.print(message);
- }
- if (tofile == true) {
- logfile.append(message);
- }
- }
-
- public void println(String message) {
- print(message + "\n");
- }
-
- public void println(Set<String> hash) {
- if (toscreen == true) {
- log.append(hash + "\n");
- System.out.println(hash);
- }
- if (tofile == true) {
- logfile.append(hash + "\n");
- }
- }
-
- public String choose(String message, Object[] choicelist) {
- return (String) JOptionPane.showInputDialog(this, message, "Choose",
- JOptionPane.PLAIN_MESSAGE, null, choicelist, choicelist[0]);
- }
-
- public String getInput(String message) {
- return (String) JOptionPane.showInputDialog(message);
- }
-
- // ---------------------------------------------------------------------------------------//
-
- public String getFilepath(String title, int mode) {
- fc.setDialogTitle(title);
- fc.setFileSelectionMode(mode);
- if (fc.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
- log.append(fc.getSelectedFile().getAbsolutePath() + "\n");
- return fc.getSelectedFile().getAbsolutePath();
- }
- return null;
- }
-
- // ---------------------------------------------------------------------------------------//
-
- public void actionPerformed(ActionEvent e) {
- if (e.getSource() == moduleButton) {
- startpath = getFilepath("Please choose a starting path",
- JFileChooser.DIRECTORIES_ONLY);
- moduletext.setText(startpath);
- }
- if (e.getSource() == goButton) {
- try {
- logfile = new PrintWriter(new BufferedWriter(new FileWriter(
- startpath.replaceAll(Common.STRSEPARATER, "$1")
- + File.separator + "migration.log")));
- MigrationTool.startMigrateAll(startpath);
- logfile.flush();
- logfile.close();
- } catch (Exception en) {
- println(en.getMessage());
- }
- }
- if (e.getSource() == msaEditorButton) {
- try {
- MsaTreeEditor.init();
- } catch (Exception en) {
- println(en.getMessage());
- }
- }
- if (e.getSource() == criticButton) {
- try {
- Critic.fireAt(startpath);
- } catch (Exception en) {
- println(en.getMessage());
- }
- }
- if (e.getSource() == specifyCommentButton) {
- try { // input examine is not imposed but should be added
- MigrationTool.MIGRATIONCOMMENT = getInput("Please type in wanted comment style used by the tool\nbe sure to start with '//', or you won't enjoy the result");
- // MsaWriter.parse("C:\\tianocore\\edk2\\MdePkg\\Library\\BaseLib\\BaseLib.msa");
- } catch (Exception en) {
- println(en.getMessage());
- }
- }
- }
-
- public void itemStateChanged(ItemEvent e) {
- if (e.getSource() == filebox) {
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- System.out.println("filebox DESELECTED");
- } else if (e.getStateChange() == ItemEvent.SELECTED) {
- System.out.println("filebox SELECTED");
- }
- } else if (e.getSource() == screenbox) {
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- System.out.println("screenbox DESELECTED");
- } else if (e.getStateChange() == ItemEvent.SELECTED) {
- System.out.println("screenbox SELECTED");
- }
- } else if (e.getSource() == mibox) {
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- MigrationTool.printModuleInfo = false;
- } else if (e.getStateChange() == ItemEvent.SELECTED) {
- MigrationTool.printModuleInfo = true;
- }
- } else if (e.getSource() == criticbox) {
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- MigrationTool.doCritic = false;
- } else if (e.getStateChange() == ItemEvent.SELECTED) {
- MigrationTool.doCritic = true;
- }
- } else if (e.getSource() == defaultpathbox) {
- if (e.getStateChange() == ItemEvent.DESELECTED) {
- MigrationTool.defaultoutput = false;
- } else if (e.getStateChange() == ItemEvent.SELECTED) {
- MigrationTool.defaultoutput = true;
- }
- }
- }
-
- // ---------------------------------------------------------------------------------------//
-
- private static final FirstPanel init() {
- try {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
- } catch (Exception e) {
- System.out.println(e.getMessage());
- }
-
- JFrame frame = new JFrame("MigrationTools");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
- FirstPanel fp = new FirstPanel();
- fp.setOpaque(true);
- frame.setContentPane(fp);
-
- frame.pack();
- frame.setVisible(true);
-
- return fp;
- }
-
- public static final FirstPanel getInstance() {
- return INSTANCE;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Func.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Func.java
deleted file mode 100644
index 3cebcba9fd..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Func.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class Func {
- Func(String r8func, String r8lib, String r9func, String r9lib) {
- r8funcname = r8func;
- r8libname = r8lib;
- r9funcname = r9func;
- r9libname = r9lib;
- }
-
- Func(String[] linecontext) {
- r8funcname = linecontext[1];
- r8libname = linecontext[0];
- r9funcname = linecontext[2];
- if (r9funcname.contains("n/a")) {
- r9funcname = "#error Unknown or missing library function in EDKII: "
- + r8funcname;
- }
- r9libname = linecontext[3];
- }
-
- public String r8funcname;
-
- public String r8libname;
-
- public String r9funcname;
-
- public String r9libname;
-
- public static Pattern ptnbrace = Pattern.compile("\\{[^\\{\\}]*\\}",
- Pattern.MULTILINE);
-
- public static Pattern ptnfuncc = Pattern.compile(
- "(?<!->)([a-zA-Z_]\\w*)\\s*\\(", Pattern.MULTILINE);
-
- public static Pattern ptnfuncd = Pattern.compile(
- "([a-zA-Z_]\\w*)\\s*\\([^\\)\\(]*\\)\\s*@", Pattern.MULTILINE);
-
- public static Pattern ptnlowcase = Pattern.compile("[a-z]"); // must be
- // removed
-
- private static String reservedwords = "if for pack while switch return sizeof";
-
- public static String register(Matcher mtr, ModuleInfo mi, Database db) {
- String temp = null;
-
- temp = mtr.group(1); // both changed and not changed funcc are
- // registered , for finding all the non-local
- // function calls
- Matcher mtrlowcase = ptnlowcase.matcher(temp); // must be removed , so
- // the two funcs can be
- // merged
- if (!reservedwords.contains(temp) && mtrlowcase.find()) {
- mi.hashfuncc.add(temp);
- }
- return temp;
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java
deleted file mode 100644
index e43b62aff4..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Guid.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.tianocore.UsageTypes;
-
-public class Guid {
- Guid(String r8, String t, String n, String r9, String gv, String p) {
- r8name = r8;
- type = t;
- name = n;
- r9name = r9;
- guidvalue = gv;
- pack = p;
- }
-
- Guid(String[] linecontext, String t) {
- r8name = linecontext[1];
- type = t;
- name = linecontext[0];
- r9name = linecontext[2];
- guidvalue = linecontext[3];
- pack = linecontext[4];
- }
-
- public String r8name;
-
- public String type;
-
- public String name;
-
- public String r9name;
-
- public String guidvalue;
-
- public String pack;
-
- public static Pattern ptnguid = Pattern.compile("g\\w*Guid");
-
- public static String register(Matcher mtr, ModuleInfo mi, Database db) {
- String type = null;
- String temp = null;
-
- temp = mtr.group();
- if (MigrationTool.db.hasGuid(temp)) { // only changed guids
- // registered, because both
- // changed and not changed guids
- // are included in database
- type = MigrationTool.db.getGuidType(temp);
- if (type.matches("Protocol")) {
- mi.addProtocol(temp, UsageTypes.ALWAYS_CONSUMED);
- // mi.protocols.add(temp);
- } else if (type.matches("Ppi")) {
- mi.addPpi(temp, UsageTypes.ALWAYS_CONSUMED);
- // mi.ppis.add(temp);
- } else if (type.matches("Guid")) {
- mi.addGuid(temp, UsageTypes.ALWAYS_CONSUMED);
- // mi.guids.add(temp);
- }
- return temp;
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Macro.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/Macro.java
deleted file mode 100644
index 91c878a1c8..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/Macro.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class Macro {
- Macro(String r8, String r9) {
- r8name = r8;
- r9name = r9;
- }
-
- Macro(String[] linecontext) {
- r8name = linecontext[0];
- r9name = linecontext[1];
- }
-
- public String r8name;
-
- public String r9name;
-
- public static Pattern ptntmacro = Pattern.compile("\\b\\w(\\w|\\d)*",
- Pattern.MULTILINE);
-
- private static String unmacro = "VOID UINTN BOOLEAN ASSERT OPTIONAL STATIC NULL TRUE IN OUT FALSE";
-
- public static String register(Matcher mtr, ModuleInfo mi, Database db) {
- String temp = null;
-
- temp = mtr.group();
- mi.hashmacro.add(temp);
- if (MigrationTool.db.hasMacro(temp)) { // only changed macros
- // registered, because the
- // database of macro has only
- // changed ones
- if (!unmacro.contains(temp)) {
- mi.hashnonlocalmacro.add(temp);
- }
- return temp;
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MigrationTool.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
deleted file mode 100644
index c65a425df4..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MigrationTool.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Set;
-
-import javax.swing.JFileChooser;
-
-/**
- * The class is used as the main class of the MigrationTool, maintains the main
- * work flow, and all the global variables and constants. It extends nothing.
- *
- */
-public class MigrationTool {
-
- //
- // These two objects are serves globally, it is always required, and only
- // one instance is ever allowed.
- //
- public static UI ui = null;
-
- public static Database db = null;
-
- //
- // The global constant for MigrationTool generated comments.
- //
- public static String MIGRATIONCOMMENT = "//@MT:";
-
- //
- // Global switches that are changed by user by the FirstPanel.
- //
- public static boolean printModuleInfo = false;
-
- public static boolean doCritic = false;
-
- public static boolean defaultoutput = false;
-
- //
- // A hashmap that associates the reference to a ModuleInfo with its
- // outputpath.
- //
- public static final HashMap<ModuleInfo, String> ModuleInfoMap = new HashMap<ModuleInfo, String>();
-
- //
- // The starting point of the MigrationTool.
- //
- private static String startpath = null;
-
- /**
- * This method defines the overall main work flow of the MigrationTool.
- *
- * @param mi
- * @throws Exception
- */
- private static final void mainFlow(ModuleInfo mi) throws Exception {
- ModuleReader.aimAt(mi);
- SourceFileReplacer.fireAt(mi); // some adding library actions are taken
- // here,so it must be put before
- // "MsaWriter"
-
- // show result
- if (MigrationTool.printModuleInfo) {
- MigrationTool.ui.println("\nModule Information : ");
- MigrationTool.ui.println("Entrypoint : " + mi.entrypoint);
- show(mi.protocols, "Protocol : ");
- show(mi.ppis, "Ppi : ");
- show(mi.guids, "Guid : ");
- show(mi.hashfuncc, "call : ");
- show(mi.hashfuncd, "def : ");
- show(mi.hashEFIcall, "EFIcall : ");
- show(mi.hashnonlocalmacro, "macro : ");
- show(mi.hashnonlocalfunc, "nonlocal : ");
- show(mi.hashr8only, "hashr8only : ");
- }
- new MsaWriter(mi).flush();
-
- // mi.getMsaOwner().flush(MigrationTool.ModuleInfoMap.get(mi) +
- // File.separator + "Migration_" + mi.modulename + File.separator +
- // mi.modulename + ".___");
-
- if (MigrationTool.doCritic) {
- Critic.fireAt(ModuleInfoMap.get(mi) + File.separator + "Migration_"
- + mi.modulename);
- }
-
- MigrationTool.ui.println("Errors Left : " + MigrationTool.db.error);
- MigrationTool.ui.println("Complete!");
- }
-
- /**
- * This method is specially written to print the message for ModuleInfo,
- * just for less code repeating.
- *
- * @param hash
- * @param show
- */
- private static final void show(Set<String> hash, String show) {
- MigrationTool.ui.println(show + hash.size());
- MigrationTool.ui.println(hash);
- }
-
- /**
- * This method designates the location of temp directory.
- *
- * @param modulepath
- * @return String
- */
- public static final String getTempDir(String modulepath) {
- return "C:" + File.separator + "MigrationTool_Temp"
- + modulepath.replace(startpath, "");
- }
-
- /**
- * This method is the default output path generating scheme.
- *
- * @param inputpath
- * @return String
- */
- private static final String assignOutPutPath(String inputpath) {
- if (MigrationTool.defaultoutput) {
- return inputpath.replaceAll(Common.STRSEPARATER, "$1");
- } else {
- return MigrationTool.ui.getFilepath(
- "Please choose where to place the output module",
- JFileChooser.DIRECTORIES_ONLY);
- }
- }
-
- /**
- * This function is called by main loop of the MigrationTool which
- * verifies whether a dir contains a module, thus generating a map
- * which shows the corresponding path for each module.
- *
- * @param filepath
- * @throws Exception
- */
- public static final void seekModule(String filepath) throws Exception {
- if (ModuleInfo.isModule(filepath)) {
- ModuleInfoMap.put(new ModuleInfo(filepath),
- assignOutPutPath(filepath));
- }
- }
-
- /**
- * This is the main loop of the tool.
- *
- * @param path
- * @throws Exception
- */
- public static final void startMigrateAll(String path) throws Exception {
- startpath = path;
- MigrationTool.ui.println("Project Migration");
- MigrationTool.ui.println("Copyright (c) 2006, Intel Corporation");
-
- if (new File("C:" + File.separator + "MigrationTool_Temp").exists()) {
- Common.deleteDir("C:" + File.separator + "MigrationTool_Temp");
- }
-
- Common.toDoAll(path, MigrationTool.class.getMethod("seekModule",
- String.class), null, null, Common.DIR);
-
- Iterator<ModuleInfo> miit = ModuleInfoMap.keySet().iterator();
- while (miit.hasNext()) {
- mainFlow(miit.next());
- }
-
- ModuleInfoMap.clear();
-
- Common.deleteDir("C:" + File.separator + "MigrationTool_Temp");
- }
-
- /**
- * This main method initializes the environment.
- *
- * @param args
- * @throws Exception
- */
- public static void main(String[] args) throws Exception {
- ui = FirstPanel.getInstance();
- db = Database.getInstance();
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
deleted file mode 100644
index 8f54d81b58..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleInfo.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.tianocore.UsageTypes;
-import org.tianocore.SupportedArchitectures.Enum;
-
-/*
- * Class ModuleInfo is built for scanning the source files, it contains all the
- * needed information and all the temporary data.
- */
-public final class ModuleInfo {
- ModuleInfo(String modulepath) throws Exception {
- this.modulepath = modulepath;
- this.temppath = MigrationTool.getTempDir(this.modulepath);
- }
-
- public final String modulepath;
-
- public final String temppath;
-
- private MsaOwner msaowner = MsaOwner.initNewMsaOwner();
-
- public boolean isLibrary = false;
-
- public String modulename = null;
-
- public String guidvalue = null;
-
- public String moduletype = null;
-
- public String entrypoint = null;
-
- public String license = null;
-
- public final Set<String> localmodulesources = new HashSet<String>(); // contains
- // both
- // .c
- // and
- // .h
-
- public final Set<String> preprocessedccodes = new HashSet<String>();
-
- public final Set<String> msaorinf = new HashSet<String>(); // only a
- // little, hash
- // may be too
- // big for this
-
- public final Set<String> infincludes = new HashSet<String>();
-
- public final Set<String> infsources = new HashSet<String>();
-
- public final Set<String> hashfuncc = new HashSet<String>();
-
- public final Set<String> hashfuncd = new HashSet<String>();
-
- public final Set<String> hashnonlocalfunc = new HashSet<String>();
-
- public final Set<String> hashnonlocalmacro = new HashSet<String>();
-
- public final Set<String> hashEFIcall = new HashSet<String>();
-
- public final Set<String> hashr8only = new HashSet<String>();
-
- public final Set<String> hashmacro = new HashSet<String>();
-
- public final Set<String> hashrequiredr9libs = new HashSet<String>(); // hashrequiredr9libs
- // is
- // now
- // all
- // added
- // in
- // SourceFileReplacer
-
- public final Set<String> guids = new HashSet<String>();
-
- public final Set<String> protocols = new HashSet<String>();
-
- public final Set<String> ppis = new HashSet<String>();
-
- // -----------------------------------------------------------------------------------//
-
- // addModuleType
- // addGuidValue
- // addModuleName
-
- public final boolean addSourceFile(String filename, Enum en) {
- localmodulesources.add(filename);
- return msaowner.addSourceFile(filename, en);
- }
-
- public final boolean addProtocol(String proname, UsageTypes.Enum usage) {
- protocols.add(proname);
- return msaowner.addProtocol(proname, usage);
- }
-
- public final boolean addPpi(String ppiname, UsageTypes.Enum usage) {
- ppis.add(ppiname);
- return msaowner.addPpi(ppiname, usage);
- }
-
- public final boolean addGuid(String guidname, UsageTypes.Enum usage) {
- guids.add(guidname);
- return msaowner.addGuid(guidname, usage);
- }
-
- public final boolean addLibraryClass(String name, UsageTypes.Enum usage) {
- //
- // This section is only for adding library classes, this functionality
- // should be inside MsaOwner!!!
- //
- // if (!hashrequiredr9libs.contains(name)) {
- msaowner.addLibraryClass(name, usage);
- // }
- //
- hashrequiredr9libs.add(name);
- return true;
- }
-
- // -----------------------------------------------------------------------------------//
-
- public final String getModuleType() {
- if (moduletype.contains("PEI")) {
- return "PEIM";
- } else {
- return "DXE_DRIVER";
- }
- }
-
- public final void enroll(String filepath) throws Exception {
- String temp = null;
- if (filepath.contains(".inf") || filepath.contains(".msa")) {
- temp = filepath.replace(modulepath + File.separator, "");
- if (!temp.contains(File.separator)) { // .inf in subdirectory is
- // not regarded
- msaorinf.add(temp);
- }
- } else if (filepath.contains(".c") || filepath.contains(".C")
- || filepath.contains(".h") || filepath.contains(".H")
- || filepath.contains(".dxs") || filepath.contains(".uni")
- || filepath.contains(".s") || filepath.contains(".S")
- || filepath.contains(".i") || filepath.contains(".asm")) {
- addSourceFile(filepath.replace(modulepath + File.separator, ""),
- null);
- }
- }
-
- public static final boolean isModule(String path) {
- String[] list = new File(path).list();
- for (int i = 0; i < list.length; i++) {
- if (!new File(list[i]).isDirectory()) {
- if (list[i].contains(".inf") || list[i].contains(".msa")) {
- return true;
- }
- }
- }
- return false;
- }
-
- public final MsaOwner getMsaOwner() {
- return msaowner;
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleReader.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleReader.java
deleted file mode 100644
index f3eb7069eb..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/ModuleReader.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.StringReader;
-import java.util.Iterator;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.tianocore.FilenameDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.SourceFilesDocument;
-
-public final class ModuleReader implements Common.ForDoAll {
- private static final ModuleReader modulereader = new ModuleReader();
-
- private ModuleInfo mi;
-
- private final CommentLaplace commentlaplace = new CommentLaplace();
-
- private static final Pattern ptninfequation = Pattern
- .compile("([^\\s]*)\\s*=\\s*([^\\s]*)");
-
- private static final Pattern ptnsection = Pattern.compile(
- "\\[([^\\[\\]]*)\\]([^\\[\\]]*)\\n", Pattern.MULTILINE);
-
- private static final Pattern ptnfilename = Pattern.compile("[^\\s]+");
-
- public final void ModuleScan() throws Exception {
- Common.toDoAll(mi.modulepath, ModuleInfo.class.getMethod("enroll",
- String.class), mi, null, Common.FILE);
-
- // inf&msa
- String filename = null;
- if (mi.msaorinf.isEmpty()) {
- MigrationTool.ui.println("No INF nor MSA file found!");
- System.exit(0);
- } else {
- if (mi.msaorinf.size() == 1) {
- filename = (String) mi.msaorinf.toArray()[0];
- } else {
- filename = MigrationTool.ui.choose(
- "Found .inf or .msa file for module\n" + mi.modulepath
- + "\nChoose one Please", mi.msaorinf.toArray());
- }
- }
-
- if (filename.contains(".inf")) {
- readInf(filename);
- } else if (filename.contains(".msa")) {
- readMsa(filename);
- }
- // inf&msa
-
- preProcessModule();
- }
-
- private final void readMsa(String name) throws Exception {
- ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory
- .parse(new File(mi.modulepath + File.separator + name));
- ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = msadoc
- .getModuleSurfaceArea();
- MsaHeaderDocument.MsaHeader msaheader = msa.getMsaHeader();
-
- mi.modulename = msaheader.getModuleName();
- mi.guidvalue = msaheader.getGuidValue();
- mi.moduletype = msaheader.getModuleType().toString(); // ???
-
- SourceFilesDocument.SourceFiles sourcefiles = msa.getSourceFiles();
-
- String temp;
- Iterator<FilenameDocument.Filename> li = sourcefiles.getFilenameList()
- .iterator();
- while (li.hasNext()) {
- if (!mi.localmodulesources.contains(temp = li.next().toString())) {
- System.out.println("Source File Missing! : " + temp);
- }
- }
- }
-
- private final String extractLicense(String wholeline) throws Exception {
- String tempLine;
- String license = null;
-
- BufferedReader rd = new BufferedReader(new StringReader(wholeline));
- while ((tempLine = rd.readLine()) != null) {
- if (tempLine.contains("#")) {
- if (tempLine.contains("Copyright")) {
- //
- // Find license info.
- //
- license = "";
- while ((tempLine = rd.readLine()) != null) {
- if (!tempLine.contains("#")
- || tempLine.contains("Module Name:")
- || tempLine.contains("Abstract:")) {
- //
- // We assume license ends here.
- //
- break;
- }
- license += " "
- + tempLine
- .replaceAll("\\s*[#]\\s*(.*)", "$1\n");
- }
- break;
- }
- }
- }
- return license;
- }
-
- private final void readInf(String name) throws Exception {
- System.out.println("\nParsing INF file: " + name);
- String wholeline;
- Matcher mtrinfequation;
- Matcher mtrsection;
- Matcher mtrfilename;
-
- wholeline = Common.file2string(mi.modulepath + File.separator + name);
- mi.license = extractLicense(wholeline);
- mtrsection = ptnsection.matcher(wholeline);
- while (mtrsection.find()) {
- if (mtrsection.group(1).matches("defines")) {
- mtrinfequation = ptninfequation.matcher(mtrsection.group(2));
- while (mtrinfequation.find()) {
- if (mtrinfequation.group(1).matches("BASE_NAME")) {
- mi.modulename = mtrinfequation.group(2);
- }
- if (mtrinfequation.group(1).matches("FILE_GUID")) {
- mi.guidvalue = mtrinfequation.group(2);
- }
- if (mtrinfequation.group(1).matches("COMPONENT_TYPE")) {
- mi.moduletype = mtrinfequation.group(2);
- if (mi.moduletype.matches("LIBRARY")) {
- mi.isLibrary = true;
- }
- }
- }
- }
- if (mtrsection.group(1).contains("nmake.")) {
- mtrinfequation = ptninfequation.matcher(mtrsection.group(2));
- while (mtrinfequation.find()) {
- if (mtrinfequation.group(1).matches("IMAGE_ENTRY_POINT")) {
- mi.entrypoint = mtrinfequation.group(2);
- }
- if (mtrinfequation.group(1).matches("DPX_SOURCE")) {
- if (!mi.localmodulesources.contains(mtrinfequation
- .group(2))) {
- MigrationTool.ui.println("DPX File Missing! : "
- + mtrinfequation.group(2));
- }
- }
- }
- }
- if (mtrsection.group(1).contains("sources.")) {
- mtrfilename = ptnfilename.matcher(mtrsection.group(2));
- while (mtrfilename.find()) {
- mi.infsources.add(mtrfilename.group());
- if (!mi.localmodulesources.contains(mtrfilename.group())) {
- MigrationTool.ui
- .println("Warn: Source File Missing! : "
- + mtrfilename.group());
- }
- }
- }
- if (mtrsection.group(1).matches("includes.")) {
- mtrfilename = ptnfilename.matcher(mtrsection.group(2));
- while (mtrfilename.find()) {
- mi.infincludes.add(mtrfilename.group());
- }
- }
- }
- }
-
- private final void preProcessModule() throws Exception {
- // according to .inf file, add extraordinary includes and sourcefiles
- Common.dirCopy(mi.modulepath, mi.temppath); // collect all
- // Laplace.namechange to
- // here???
-
- if (!mi.infincludes.isEmpty()) {
- Iterator<String> it = mi.infincludes.iterator();
- String tempincludename = null;
- while (it.hasNext()) {
- tempincludename = it.next();
- if (tempincludename.contains("..")) {
- Matcher mtr = Common.PTNSEPARATER.matcher(tempincludename);
- if (mtr.find() && !mtr.group(2).matches(".")) {
- Common.oneLevelDirCopy(mi.modulepath.replaceAll(
- Common.STRSEPARATER, "$1")
- + File.separator + mtr.group(2), mi.temppath,
- ".h");
- } else {
- Common.oneLevelDirCopy(mi.modulepath.replaceAll(
- Common.STRSEPARATER, "$1"), mi.temppath, ".h");
- }
- }
- }
- }
- if (!mi.infsources.isEmpty()) {
- Iterator<String> it = mi.infsources.iterator();
- String tempsourcename = null;
- while (it.hasNext()) {
- tempsourcename = it.next();
- if (tempsourcename.contains("..")) {
- Common.ensureDir(mi.temppath + File.separator
- + "MT_Parent_Sources");
- Matcher mtr = Common.PTNSEPARATER.matcher(tempsourcename);
- if (mtr.find()) {
- Common.fileCopy(mi.modulepath.replaceAll(
- Common.STRSEPARATER, "$1")
- + File.separator + mtr.group(2), mi.temppath
- + File.separator + "MT_Parent_Sources"
- + File.separator + mtr.group(2));
- }
- }
- }
- }
-
- Common.toDoAll(mi.temppath, this, Common.FILE);
-
- parsePreProcessedSourceCode();
-
- }
-
- private final void parsePreProcessedSourceCode() throws Exception {
- BufferedReader rd = null;
- String ifile = null;
- String line = null;
- String temp = null;
-
- Iterator<String> ii = mi.localmodulesources.iterator();
- while (ii.hasNext()) {
- temp = ii.next();
- if (temp.contains(".c") || temp.contains(".dxs")) {
- mi.preprocessedccodes.add(temp);
- }
- }
-
- ii = mi.preprocessedccodes.iterator();
-
- Pattern patefifuncc = Pattern.compile(
- "g?(BS|RT)\\s*->\\s*([a-zA-Z_]\\w*)", Pattern.MULTILINE);
- Matcher matguid;
- Matcher matfuncc;
- Matcher matfuncd;
- Matcher matenclosereplace;
- Matcher matefifuncc;
- Matcher matmacro;
-
- while (ii.hasNext()) {
- StringBuffer wholefile = new StringBuffer();
- ifile = ii.next();
- rd = new BufferedReader(new FileReader(mi.temppath + File.separator
- + ifile));
- while ((line = rd.readLine()) != null) {
- wholefile.append(line + '\n');
- }
- line = wholefile.toString();
-
- // find guid
- matguid = Guid.ptnguid.matcher(line); // several ways to implement
- // this , which one is
- // faster ? :
- while (matguid.find()) { // 1.currently , find once , then call
- // to identify which is it
- if ((temp = Guid.register(matguid, mi, MigrationTool.db)) != null) { // 2.use
- // 3
- // different
- // matchers
- // ,
- // search
- // 3
- // times
- // to
- // find
- // each
- // matguid.appendReplacement(result,
- // MigrationTool.db.getR9Guidname(temp)); // search the
- // database for all 3 kinds of guids , high cost
- }
- }
- // matguid.appendTail(result);
- // line = result.toString();
-
- // find EFI call in form of '->' , many
- // 'gUnicodeCollationInterface->' like things are not changed
- // This item is not simply replaced , special operation is required.
- matefifuncc = patefifuncc.matcher(line);
- while (matefifuncc.find()) {
- mi.hashEFIcall.add(matefifuncc.group(2));
- }
-
- // find function call
- matfuncc = Func.ptnfuncc.matcher(line);
- while (matfuncc.find()) {
- if ((temp = Func.register(matfuncc, mi, MigrationTool.db)) != null) {
- // MigrationTool.ui.println(ifile + " dofunc " + temp);
- // matfuncc.appendReplacement(result,
- // MigrationTool.db.getR9Func(temp));
- }
- }
- // matfuncc.appendTail(result);
- // line = result.toString();
-
- // find macro
- matmacro = Macro.ptntmacro.matcher(line);
- while (matmacro.find()) {
- if ((temp = Macro.register(matmacro, mi, MigrationTool.db)) != null) {
- }
- }
-
- // find function definition
- // replace all {} to @
- while ((matenclosereplace = Func.ptnbrace.matcher(line)).find()) {
- line = matenclosereplace.replaceAll("@");
- }
-
- matfuncd = Func.ptnfuncd.matcher(line);
- while (matfuncd.find()) {
- if ((temp = Func.register(matfuncd, mi, MigrationTool.db)) != null) {
- }
- }
- }
-
- // op on hash
- Iterator<String> funcci = mi.hashfuncc.iterator();
- while (funcci.hasNext()) {
- if (!mi.hashfuncd.contains(temp = funcci.next())
- && !mi.hashEFIcall.contains(temp)) {
- mi.hashnonlocalfunc.add(temp); // this set contains both
- // changed and not changed items
- }
- }
- }
-
- public class CommentLaplace extends Common.Laplace {
- public String operation(String wholeline) {
- StringBuffer wholebuffer = new StringBuffer();
- String templine = null;
- Pattern ptnincludefile = Pattern.compile("[\"<](.*[.]h)[\">]");
- Pattern ptninclude = Pattern.compile("#include\\s*(.*)");
- Matcher mtrinclude = ptninclude.matcher(wholeline);
- Matcher mtrincludefile = null;
- while (mtrinclude.find()) {
- mtrincludefile = ptnincludefile.matcher(mtrinclude.group(1));
- if (mtrincludefile.find()
- && mi.localmodulesources.contains(mtrincludefile
- .group(1))) {
- templine = mtrinclude.group();
- } else {
- String line = mtrinclude.group().toLowerCase();
- if (line.contains("pal.h")) {
- templine = "#include <IndustryStandard/Pal.h>\n";
- } else if (line.contains("sal.h")) {
- templine = "#include <IndustryStandard/Sal.h>\n";
- } else if (line.contains("pci22.h")) {
- templine = "#include <IndustryStandard/Pci22.h>\n";
- } else if (line.contains("pci23.h")) {
- templine = "#include <IndustryStandard/Pci23.h>\n";
- } else if (line.contains("pci30.h")) {
- templine = "#include <IndustryStandard/Pci30.h>\n";
- } else if (line.contains("pci.h")) {
- templine = "#include <IndustryStandard/Pci.h>\n";
- } else if (line.contains("acpi.h")) {
- templine = "#include <IndustryStandard/Acpi.h>\n";
- } else if (line.contains("scsi.h")) {
- templine = "#include <IndustryStandard/Scsi.h>\n";
- } else if (line.contains("usb.h")) {
- templine = "#include <IndustryStandard/Usb.h>\n";
- } else {
- templine = MigrationTool.MIGRATIONCOMMENT
- + mtrinclude.group();
- }
- }
- mtrinclude.appendReplacement(wholebuffer, templine);
- }
- mtrinclude.appendTail(wholebuffer);
- return wholebuffer.toString();
- }
-
- public boolean recognize(String filename) {
- return filename.contains(".c") || filename.contains(".h")
- || filename.contains(".dxs");
- }
-
- public String namechange(String oldname) {
- return oldname;
- }
- }
-
- // -----------------------------------ForDoAll-----------------------------------//
- public void run(String filepath) throws Exception {
- String name = mi.temppath + File.separator
- + filepath.replace(mi.temppath + File.separator, "");
- if (commentlaplace.recognize(name)) {
- commentlaplace.transform(name, name);
- }
- }
-
- public boolean filter(File dir) {
- return true;
- }
-
- // -----------------------------------ForDoAll-----------------------------------//
-
- public final void setModuleInfo(ModuleInfo m) {
- mi = m;
- }
-
- public static final void aimAt(ModuleInfo mi) throws Exception {
- modulereader.setModuleInfo(mi);
- modulereader.ModuleScan();
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
deleted file mode 100644
index 085a6ba111..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaOwner.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedWriter;
-import java.io.FileWriter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.apache.xmlbeans.XmlOptions;
-import org.tianocore.ExternsDocument;
-import org.tianocore.FilenameDocument;
-import org.tianocore.GuidsDocument;
-import org.tianocore.LibraryClassDefinitionsDocument;
-import org.tianocore.LibraryClassDocument;
-import org.tianocore.LicenseDocument;
-import org.tianocore.ModuleDefinitionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.PPIsDocument;
-import org.tianocore.PackageDependenciesDocument;
-import org.tianocore.ProtocolsDocument;
-import org.tianocore.SourceFilesDocument;
-import org.tianocore.SupportedArchitectures;
-import org.tianocore.UsageTypes;
-import org.tianocore.SupportedArchitectures.Enum;
-
-public class MsaOwner {
- public static final String COPYRIGHT = "Copyright (c) 2006, Intel Corporation";
-
- public static final String VERSION = "1.0";
-
- public static final String ABSTRACT = "Component name for module ";
-
- public static final String DESCRIPTION = "FIX ME!";
-
- public static final String LICENSE = "All rights reserved.\n"
- + " This software and associated documentation (if any) is furnished\n"
- + " under a license and may only be used or copied in accordance\n"
- + " with the terms of the license. Except as permitted by such\n"
- + " license, no part of this software or documentation may be\n"
- + " reproduced, stored in a retrieval system, or transmitted in any\n"
- + " form or by any means without the express written consent of\n"
- + " Intel Corporation.";
-
- public static final String SPECIFICATION = "FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052";
-
- public static final Enum IA32 = SupportedArchitectures.IA_32;
-
- public static final Enum X64 = SupportedArchitectures.X_64;
-
- public static final Enum IPF = SupportedArchitectures.IPF;
-
- public static final Enum EBC = SupportedArchitectures.EBC;
-
- private ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory
- .newInstance();
-
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = null;
-
- private MsaHeaderDocument.MsaHeader msaheader = null;
-
- private LicenseDocument.License license = null;
-
- private ModuleDefinitionsDocument.ModuleDefinitions moduledefinitions = null;
-
- private SourceFilesDocument.SourceFiles sourcefiles = null; // found local
- // .h files are
- // not written
-
- private GuidsDocument.Guids guids = null;
-
- private ProtocolsDocument.Protocols protocols = null;
-
- private PPIsDocument.PPIs ppis = null;
-
- private PackageDependenciesDocument.PackageDependencies packagedependencies = null;
-
- private LibraryClassDefinitionsDocument.LibraryClassDefinitions libclassdefs = null;
-
- private ExternsDocument.Externs externs = null;
-
- private List<Enum> listarch = new ArrayList<Enum>();
-
- // private Map<String, Enum> mapfilenames = new HashMap<String, Enum>();
- // //this need to be installed manually when msa is to be written
- // private Map<String, UsageTypes.Enum> mapprotocols = new HashMap<String,
- // UsageTypes.Enum>();
-
- // -----------------------------msaheader-------------------------------------//
-
- public final boolean addLibraryClass(String name, UsageTypes.Enum usage) {
- /*
- * if (!libclassdefs.getLibraryClassList().contains(name)) {
- * LibraryClassDocument.LibraryClass classname; classname =
- * libclassdefs.addNewLibraryClass(); classname.setKeyword(name);
- * classname.setUsage(usage); return true; } else { return false; }
- */
- if (name == null) {
- return false;
- } else {
- Iterator<LibraryClassDocument.LibraryClass> classit = libclassdefs
- .getLibraryClassList().iterator();
- while (classit.hasNext()) {
- if (classit.next().getKeyword().matches(name)) {
- // MigrationTool.ui.println ("Warning: Duplicate
- // LibraryClass");
- return false;
- }
- }
-
- LibraryClassDocument.LibraryClass classname;
- classname = libclassdefs.addNewLibraryClass();
- classname.setKeyword(name);
- classname.setUsage(usage);
- return true;
-
- }
- }
-
- public final boolean addGuid(String guidname, UsageTypes.Enum usage) {
- if (guids == null) {
- guids = msa.addNewGuids();
- }
-
- Iterator<GuidsDocument.Guids.GuidCNames> guidit = guids
- .getGuidCNamesList().iterator();
- while (guidit.hasNext()) {
- if (guidit.next().getGuidCName() == guidname) {
- // MigrationTool.ui.println ("Warning: Duplicate Guid");
- return false;
- }
- }
-
- GuidsDocument.Guids.GuidCNames guid;
- guid = guids.addNewGuidCNames();
- guid.setGuidCName(guidname);
- guid.setUsage(usage);
- return true;
- }
-
- public final boolean addPpi(String ppiname, UsageTypes.Enum usage) {
- if (ppis == null) {
- ppis = msa.addNewPPIs();
- }
-
- Iterator<PPIsDocument.PPIs.Ppi> ppiit = ppis.getPpiList().iterator();
- while (ppiit.hasNext()) {
- if (ppiit.next().getPpiCName() == ppiname) {
- // MigrationTool.ui.println ("Warning: Duplicate Ppi");
- return false;
- }
- }
-
- PPIsDocument.PPIs.Ppi ppi;
- ppi = ppis.addNewPpi();
- ppi.setPpiCName(ppiname);
- ppi.setUsage(usage);
- return true;
- }
-
- public final boolean addProtocol(String proname, UsageTypes.Enum usage) {
- if (protocols == null) {
- protocols = msa.addNewProtocols();
- }
-
- Iterator<ProtocolsDocument.Protocols.Protocol> proit = protocols
- .getProtocolList().iterator();
- while (proit.hasNext()) {
- if (proit.next().getProtocolCName() == proname) {
- // MigrationTool.ui.println ("Warning: Duplicate Protocol");
- return false;
- }
- }
-
- ProtocolsDocument.Protocols.Protocol protocol;
- protocol = protocols.addNewProtocol();
- protocol.setProtocolCName(proname);
- protocol.setUsage(usage);
- return true;
- }
-
- public final boolean addSourceFile(String name, Enum en) {
- Iterator<FilenameDocument.Filename> fileit = sourcefiles
- .getFilenameList().iterator();
- while (fileit.hasNext()) {
- if (fileit.next().getStringValue() == name) {
- MigrationTool.ui.println("Warning: Duplicate SourceFileName");
- return false;
- }
- }
-
- FilenameDocument.Filename filename;
- List<Enum> arch = new ArrayList<Enum>();
- filename = sourcefiles.addNewFilename();
- filename.setStringValue(name);
- arch.add(en);
- filename.setSupArchList(arch);
- return true;
- }
-
- // entry point todo
-
- public final boolean setupExternSpecification() {
- addExternSpecification("EFI_SPECIFICATION_VERSION 0x00020000");
- addExternSpecification("EDK_RELEASE_VERSION 0x00020000");
- return true;
- }
-
- public final boolean addExternSpecification(String specification) {
- if (externs.getSpecificationList().contains(specification)) {
- return false;
- } else {
- externs.addSpecification(specification);
- return true;
- }
- }
-
- public final boolean setupPackageDependencies() {
- Iterator<String> it;
- //
- // For now, simply add all package guids in the database.
- //
- it = MigrationTool.db.dumpAllPkgGuid();
- while (it.hasNext()) {
- packagedependencies.addNewPackage().setPackageGuid(it.next());
- }
- return true;
- }
-
- public final boolean addPackage(String guid) {
- if (packagedependencies.getPackageList().contains(guid)) {
- return false;
- } else {
- packagedependencies.addNewPackage().setPackageGuid(guid);
- return true;
- }
- }
-
- public final boolean setupModuleDefinitions() { // ????????? give this job
- // to moduleinfo
- moduledefinitions.setBinaryModule(false);
- moduledefinitions.setOutputFileBasename(msaheader.getModuleName());
- return true;
- }
-
- public final boolean addSupportedArchitectures(Enum arch) {
- if (listarch.contains(arch)) {
- return false;
- } else {
- listarch.add(arch);
- return true;
- }
- }
-
- public final boolean addSpecification(String specification) {
- if (msaheader.getSpecification() == null) {
- if (specification == null) {
- msaheader.setSpecification(SPECIFICATION);
- } else {
- msaheader.setSpecification(specification);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate Specification");
- return false;
- }
- }
-
- public final boolean addLicense(String licensecontent) {
- if (msaheader.getLicense() == null) {
- license = msaheader.addNewLicense();
- if (licensecontent == null) {
- license.setStringValue(LICENSE);
- } else {
- license.setStringValue(licensecontent);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate License");
- return false;
- }
- }
-
- public final boolean addDescription(String description) {
- if (msaheader.getDescription() == null) {
- if (description == null) {
- msaheader.setDescription(DESCRIPTION);
- } else {
- msaheader.setDescription(description);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate Description");
- return false;
- }
- }
-
- public final boolean addAbstract(String abs) {
- if (msaheader.getAbstract() == null) {
- if (abs == null) {
- msaheader.setAbstract(ABSTRACT + msaheader.getModuleName());
- } else {
- msaheader.setVersion(abs);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate Abstract");
- return false;
- }
- }
-
- public final boolean addVersion(String version) {
- if (msaheader.getVersion() == null) {
- if (version == null) {
- msaheader.setVersion(VERSION);
- } else {
- msaheader.setVersion(version);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate Version");
- return false;
- }
- }
-
- public final boolean addCopyRight(String copyright) {
- if (msaheader.getCopyright() == null) {
- if (copyright == null) {
- msaheader.setCopyright(COPYRIGHT);
- } else {
- msaheader.setCopyright(copyright);
- }
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate CopyRight");
- return false;
- }
- }
-
- public final boolean addModuleType(String moduletype) {
- if (msaheader.getModuleType() == null) {
- msaheader.setModuleType(ModuleTypeDef.Enum.forString(moduletype));
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate ModuleType");
- return false;
- }
- }
-
- public final boolean addGuidValue(String guidvalue) {
- if (msaheader.getGuidValue() == null) {
- msaheader.setGuidValue(guidvalue);
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate GuidValue");
- return false;
- }
- }
-
- public final boolean addModuleName(String modulename) {
- if (msaheader.getModuleName() == null) {
- msaheader.setModuleName(modulename);
- return true;
- } else {
- MigrationTool.ui.println("Warning: Duplicate ModuleName");
- return false;
- }
- }
-
- // -----------------------------msaheader-------------------------------------//
-
- private final void fullfill() throws Exception {
- addCopyRight(null);
- addVersion(null);
- addAbstract(null);
- addDescription(null);
- addLicense(null);
- addSpecification(null);
- }
-
- public final void flush(String outputpath) throws Exception {
- XmlOptions options = new XmlOptions();
-
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- options.setUseDefaultNamespace();
-
- BufferedWriter bw = new BufferedWriter(new FileWriter(outputpath));
- fullfill();
- msadoc.save(bw, options);
- bw.flush();
- bw.close();
- }
-
- private final MsaOwner init() {
- msa = msadoc.addNewModuleSurfaceArea();
- msaheader = msa.addNewMsaHeader();
- moduledefinitions = msa.addNewModuleDefinitions();
- moduledefinitions.setSupportedArchitectures(listarch);
-
- sourcefiles = msa.addNewSourceFiles();
- packagedependencies = msa.addNewPackageDependencies();
- libclassdefs = msa.addNewLibraryClassDefinitions();
- externs = msa.addNewExterns();
- return this;
- }
-
- public static final MsaOwner initNewMsaOwner() {
- return new MsaOwner().init();
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
deleted file mode 100644
index b2bce97d9f..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaTreeEditor.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package org.tianocore.migration;
-
-import java.awt.GridBagLayout;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-
-import javax.swing.JFileChooser;
-import javax.swing.JFrame;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.tree.DefaultMutableTreeNode;
-import javax.swing.tree.DefaultTreeModel;
-import javax.swing.tree.TreePath;
-import javax.swing.tree.TreeSelectionModel;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class MsaTreeEditor extends JPanel {
- /**
- * Define class Serial Version UID
- */
- private static final long serialVersionUID = 3169905938472150649L;
-
- MsaTreeEditor() throws Exception {
- rootNode = new DefaultMutableTreeNode("Root Node");
- treeModel = new DefaultTreeModel(rootNode);
-
- tree = new JTree(treeModel);
- tree.setEditable(true);
- tree.getSelectionModel().setSelectionMode(
- TreeSelectionModel.SINGLE_TREE_SELECTION);
- tree.setShowsRootHandles(false);
- tree.addMouseListener(mouseadapter);
-
- JScrollPane scrollPane = new JScrollPane(tree);
- // scrollPane.setSize(800, 600);
- add(scrollPane);
-
- popupmenu = new JPopupMenu();
- menuitemadd = new JMenuItem("Add Node");
- menuitemdel = new JMenuItem("Delete Node");
- menuitemedit = new JMenuItem("Edit Node");
- popupmenu.add(menuitemadd);
- popupmenu.add(menuitemdel);
- popupmenu.add(menuitemedit);
- menuitemadd.addActionListener(actionListener);
- menuitemdel.addActionListener(actionListener);
- menuitemedit.addActionListener(actionListener);
-
- genDomTree(MigrationTool.ui.getFilepath("Select a msa file",
- JFileChooser.FILES_AND_DIRECTORIES));
- }
-
- // private ModuleSurfaceAreaDocument msadoc;
-
- private JTree tree;
-
- private DefaultMutableTreeNode rootNode;
-
- private DefaultTreeModel treeModel;
-
- private JMenuItem menuitemadd, menuitemdel, menuitemedit;
-
- private JPopupMenu popupmenu;
-
- private MouseAdapter mouseadapter = new MouseAdapter() {
- public void mouseReleased(MouseEvent me) {
- if (me.getClickCount() == 1
- && SwingUtilities.isRightMouseButton(me)) {
- tree.setSelectionPath(tree.getPathForLocation(me.getX(), me
- .getY()));
- popupmenu.show(tree, me.getX(), me.getY());
- }
- }
- };
-
- private ActionListener actionListener = new ActionListener() {
- public void actionPerformed(ActionEvent ae) {
- if (ae.getSource() == menuitemadd) {
- addNode();
- } else if (ae.getSource() == menuitemdel) {
- delNode();
- } else if (ae.getSource() == menuitemedit) {
- editNode();
- }
- }
- };
-
- private void editNode() {
- DefaultMutableTreeNode node = (DefaultMutableTreeNode) (tree
- .getSelectionPath().getLastPathComponent());
- Element element = (Element) node.getUserObject();
- System.out.println(element.getTextContent());
- }
-
- private void delNode() {
- treeModel.removeNodeFromParent((DefaultMutableTreeNode) (tree
- .getSelectionPath().getLastPathComponent()));
- }
-
- private void addNode() {
- addNode((DefaultMutableTreeNode) (tree.getSelectionPath()
- .getLastPathComponent()), MigrationTool.ui
- .getInput("Input Node Name"));
- }
-
- private DefaultMutableTreeNode addNode(DefaultMutableTreeNode parentNode,
- Object child) {
- DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(child);
- treeModel.insertNodeInto(childNode, parentNode, parentNode
- .getChildCount());
- tree.scrollPathToVisible(new TreePath(childNode.getPath()));
- return childNode;
- }
-
- private final void handleNode(Node node, DefaultMutableTreeNode parentNode) {
- DefaultMutableTreeNode curNode = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- System.out.println("elem");
- curNode = addNode(parentNode, node);
- } else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- System.out.println("doc");
- curNode = addNode(parentNode, "MsaDocum"); // can Docum be with
- // Root Node?
- }
-
- NodeList nodelist = node.getChildNodes();
- for (int i = 0; i < nodelist.getLength(); i++) {
- handleNode(nodelist.item(i), curNode);
- }
- }
-
- private final void genDomTree(String filename) throws Exception {
- DocumentBuilder builder = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder();
- Document document = builder.parse(filename);
- handleNode(document, rootNode);
- }
-
- public static final void init() throws Exception {
- UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
-
- JFrame frame = new JFrame("MsaTreeEditor");
- frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
-
- MsaTreeEditor mte = new MsaTreeEditor();
- mte.setLayout(new GridBagLayout());
- mte.setOpaque(true);
- frame.setContentPane(mte);
-
- frame.pack();
- frame.setVisible(true);
- }
-} \ No newline at end of file
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
deleted file mode 100644
index deb0ae0b9c..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/MsaWriter.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.InputStreamReader;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlOptions;
-import org.tianocore.ExternsDocument;
-import org.tianocore.FilenameDocument;
-import org.tianocore.GuidsDocument;
-import org.tianocore.LibraryClassDefinitionsDocument;
-import org.tianocore.LibraryClassDocument;
-import org.tianocore.ModuleDefinitionsDocument;
-import org.tianocore.ModuleSurfaceAreaDocument;
-import org.tianocore.ModuleTypeDef;
-import org.tianocore.MsaHeaderDocument;
-import org.tianocore.PPIsDocument;
-import org.tianocore.PackageDependenciesDocument;
-import org.tianocore.ProtocolsDocument;
-import org.tianocore.SourceFilesDocument;
-import org.tianocore.SupportedArchitectures;
-import org.tianocore.UsageTypes;
-import org.tianocore.SupportedArchitectures.Enum;
-
-public class MsaWriter {
- MsaWriter(ModuleInfo moduleinfo) {
- mi = moduleinfo;
- }
-
- private ModuleInfo mi;
-
- private ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory
- .newInstance();
-
- private ModuleSurfaceAreaDocument.ModuleSurfaceArea msa = msadoc
- .addNewModuleSurfaceArea();
-
- private MsaHeaderDocument.MsaHeader msaheader = msa.addNewMsaHeader();
-
- private ModuleDefinitionsDocument.ModuleDefinitions md = msa
- .addNewModuleDefinitions();
-
- private SourceFilesDocument.SourceFiles sourcefiles = msa
- .addNewSourceFiles(); // found local .h files are not written
-
- private GuidsDocument.Guids guids;
-
- private ProtocolsDocument.Protocols protocols;
-
- private PPIsDocument.PPIs ppis;
-
- private PackageDependenciesDocument.PackageDependencies pd = msa
- .addNewPackageDependencies();
-
- private LibraryClassDefinitionsDocument.LibraryClassDefinitions libclassdefs = msa
- .addNewLibraryClassDefinitions();
-
- private ExternsDocument.Externs externs = msa.addNewExterns();
-
- private String Query(String requirement) throws Exception {
- String answer;
- BufferedReader rd = new BufferedReader(new InputStreamReader(System.in));
- System.out.println(requirement);
- while ((answer = rd.readLine()).length() == 0)
- ;
- return answer;
- }
-
- private void addSourceFiles(String name) { // furthur modification needed
- List<Enum> arch = new ArrayList<Enum>();
- FilenameDocument.Filename filename;
- filename = sourcefiles.addNewFilename();
- filename.setStringValue(name);
-
- if (name.contains("x64" + File.separator)) { // filename ???
- arch.add(SupportedArchitectures.X_64);
- System.out.println("x64" + File.separator);
- filename.setSupArchList(arch);
- } else if (name.contains("Ia32" + File.separator)) { // filename ???
- arch.add(SupportedArchitectures.IA_32);
- System.out.println("Ia32" + File.separator);
- filename.setSupArchList(arch);
- } else if (name.contains("Ipf" + File.separator)) { // filename ???
- arch.add(SupportedArchitectures.IPF);
- System.out.println("Ipf" + File.separator);
- filename.setSupArchList(arch);
- } else if (name.contains("Ebc" + File.separator)) { // filename ???
- arch.add(SupportedArchitectures.EBC);
- System.out.println("Ebc" + File.separator);
- filename.setSupArchList(arch);
- }
- }
-
- private void addWrapper() {
- XmlCursor cursor = msa.newCursor();
- String uri = "http://www.TianoCore.org/2006/Edk2.0";
- cursor.push();
- cursor.toNextToken();
- cursor.insertNamespace("", uri);
- cursor.insertNamespace("xsi",
- "http://www.w3.org/2001/XMLSchema-instance");
- cursor.pop();
- msa = (ModuleSurfaceAreaDocument.ModuleSurfaceArea) cursor.getObject();
- }
-
- private ModuleSurfaceAreaDocument fulfillMsadoc() throws Exception {
- Iterator<String> it;
- String temp;
-
- if (mi.modulename != null) {
- msaheader.setModuleName(mi.modulename);
- } else {
- msaheader
- .setModuleName(mi.modulename = Query("Module Name Not Found! Please Input ModuleName"));
- }
- if (mi.guidvalue == null) {
- mi.guidvalue = UUID.randomUUID().toString();
- MigrationTool.ui
- .println("Guid value can not be retrieved from inf file. Generate "
- + mi.guidvalue + " at random!");
- }
- msaheader.setGuidValue(mi.guidvalue);
- if (mi.moduletype != null) {
- msaheader.setModuleType(ModuleTypeDef.Enum.forString(mi
- .getModuleType()));
- } else {
- msaheader
- .setModuleType(ModuleTypeDef.Enum
- .forString(mi.moduletype = Query("Guid Value Not Found! Please Input Guid Value")));
- }
-
- msaheader
- .setCopyright("Copyright (c) 2007, Intel Corporation. All rights reserved.");
- msaheader.setVersion("1.0");
- msaheader.setAbstract("Component name for module " + mi.modulename);
- msaheader.setDescription("FIX ME!");
-
- if (mi.license == null) {
- mi.license = "FIX ME!";
- MigrationTool.ui
- .println("Fail to extract license info in inf file");
- }
- msaheader.addNewLicense().setStringValue(mi.license);
- msaheader
- .setSpecification("FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052");
-
- List<Enum> arch = new ArrayList<Enum>();
- arch.add(SupportedArchitectures.IA_32);
- arch.add(SupportedArchitectures.X_64);
- arch.add(SupportedArchitectures.IPF);
- arch.add(SupportedArchitectures.EBC);
- md.setSupportedArchitectures(arch);
- md.setBinaryModule(false);
- md.setOutputFileBasename(mi.modulename);
- //
- // For now, simply add all package guids in the database.
- //
- it = MigrationTool.db.dumpAllPkgGuid();
- while (it.hasNext()) {
- pd.addNewPackage().setPackageGuid(it.next());
- }
- externs.addNewSpecification().setStringValue(
- "EFI_SPECIFICATION_VERSION 0x00020000");
- externs.addNewSpecification().setStringValue(
- "EDK_RELEASE_VERSION 0x00020000");
- if (mi.entrypoint != null) {
- externs.addNewExtern().setModuleEntryPoint(mi.entrypoint);
- org.tianocore.ModuleTypeDef.Enum moduleType = msaheader
- .getModuleType();
- if (moduleType == ModuleTypeDef.PEIM) {
- mi.hashrequiredr9libs.add("PeimEntryPoint");
- } else {
- mi.hashrequiredr9libs.add("UefiDriverEntryPoint");
- }
- }
-
- it = mi.localmodulesources.iterator();
- while (it.hasNext()) {
- addSourceFiles(it.next());
- }
- if (!mi.protocols.isEmpty()) {
- protocols = msa.addNewProtocols();
- it = mi.protocols.iterator();
- while (it.hasNext()) {
- if ((temp = it.next()) != null) {
- ProtocolsDocument.Protocols.Protocol pr = protocols
- .addNewProtocol();
- pr.setProtocolCName(temp);
- pr.setUsage(UsageTypes.ALWAYS_CONSUMED);
- }
- }
- }
- if (!mi.ppis.isEmpty()) {
- ppis = msa.addNewPPIs();
- it = mi.ppis.iterator();
- while (it.hasNext()) {
- if ((temp = it.next()) != null) {
- PPIsDocument.PPIs.Ppi pp = ppis.addNewPpi();
- pp.setPpiCName(temp);
- pp.setUsage(UsageTypes.ALWAYS_CONSUMED);
- }
- }
- }
- if (!mi.guids.isEmpty()) {
- guids = msa.addNewGuids();
- it = mi.guids.iterator();
- while (it.hasNext()) {
- if ((temp = it.next()) != null) {
- GuidsDocument.Guids.GuidCNames gcn = guids
- .addNewGuidCNames();
- gcn.setGuidCName(temp);
- gcn.setUsage(UsageTypes.ALWAYS_CONSUMED);
- }
- }
- }
- if (mi.isLibrary) {
- LibraryClassDocument.LibraryClass lc = libclassdefs
- .addNewLibraryClass();
- lc.setKeyword(mi.modulename);
- lc.setUsage(UsageTypes.ALWAYS_PRODUCED);
- }
- it = mi.hashrequiredr9libs.iterator();
- while (it.hasNext()) {
- if ((temp = it.next()) != null && !temp.matches("%")
- && !temp.matches("n/a")) {
- LibraryClassDocument.LibraryClass lc = libclassdefs
- .addNewLibraryClass();
- lc.setKeyword(temp);
- lc.setUsage(UsageTypes.ALWAYS_CONSUMED);
- }
- }
- addWrapper();
- msadoc.setModuleSurfaceArea(msa);
- return msadoc;
- }
-
- public void flush() throws Exception {
- XmlOptions options = new XmlOptions();
-
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- options.setUseDefaultNamespace();
-
- BufferedWriter bw = new BufferedWriter(new FileWriter(
- MigrationTool.ModuleInfoMap.get(mi) + File.separator
- + "Migration_" + mi.modulename + File.separator
- + mi.modulename + ".msa"));
- fulfillMsadoc().save(bw, options);
- // MsaTreeEditor.init(mi, ui, msadoc);
- bw.flush();
- bw.close();
- }
-
- private static void flush(String path, ModuleSurfaceAreaDocument msadoc)
- throws Exception {
- XmlOptions options = new XmlOptions();
-
- options.setCharacterEncoding("UTF-8");
- options.setSavePrettyPrint();
- options.setSavePrettyPrintIndent(2);
- options.setUseDefaultNamespace();
-
- BufferedWriter bw = new BufferedWriter(new FileWriter(path));
- msadoc.save(bw, options);
- bw.flush();
- bw.close();
- }
-
- public static final void parse(String msafile) throws Exception {
- ModuleSurfaceAreaDocument msadoc = ModuleSurfaceAreaDocument.Factory
- .parse(msafile);
- flush("c:\\temp.msa", msadoc);
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/PathIterator.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/PathIterator.java
deleted file mode 100644
index 39f25db0d3..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/PathIterator.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Iterator;
-
-public final class PathIterator implements Common.ForDoAll {
- // this PathIterator is based on HashSet, an thread implementation is
- // required.
- PathIterator(String path, int md) throws Exception {
- startpath = path;
- mode = md;
- Common.toDoAll(startpath, this, mode);
- it = pathlist.iterator();
- }
-
- private String startpath = null;
-
- private int mode;
-
- private HashSet<String> pathlist = new HashSet<String>();
-
- private Iterator<String> it = null;
-
- public final void run(String path) throws Exception {
- pathlist.add(path);
- }
-
- public boolean filter(File dir) {
- return true;
- }
-
- public final String next() {
- return it.next();
- }
-
- public final boolean hasNext() {
- return it.hasNext();
- }
-
- public final String toString() {
- return pathlist.toString();
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
deleted file mode 100644
index 6bf0b24b53..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/SourceFileReplacer.java
+++ /dev/null
@@ -1,504 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.tianocore.UsageTypes;
-
-public final class SourceFileReplacer implements Common.ForDoAll {
- private static final SourceFileReplacer SFReplacer = new SourceFileReplacer();
-
- private ModuleInfo mi;
-
- private static final Set<Common.Laplace> Laplaces = new HashSet<Common.Laplace>();
-
- // these sets are used only for printing log of the changes in current file
- private static final Set<r8tor9> filefunc = new HashSet<r8tor9>();
-
- private static final Set<r8tor9> filemacro = new HashSet<r8tor9>();
-
- private static final Set<r8tor9> fileguid = new HashSet<r8tor9>();
-
- private static final Set<r8tor9> fileppi = new HashSet<r8tor9>();
-
- private static final Set<r8tor9> fileprotocol = new HashSet<r8tor9>();
-
- private static final Set<String> filer8only = new HashSet<String>();
-
- private static final String[] specialhoblibfunc = { "BuildModuleHob",
- "BuildResourceDescriptorHob", "BuildFvHob", "BuildCpuHob",
- "BuildGuidDataHob", "BuildStackHob", "BuildBspStoreHob",
- "BuildMemoryAllocationHob" };
-
- private static final String[] peiserviceslibfunc = { "InstallPpi",
- "ReInstallPpi", "LocatePpi", "NotifyPpi", "GetBootMode",
- "SetBootMode", "GetHobList", "CreateHob", "FfsFindNextVolume",
- "FfsFindNextFile", "FfsFindSectionData", "InstallPeiMemory",
- "AllocatePages", "AllocatePool", "PeiResetSystem" };
-
- // ---------------------------------------inner
- // classes---------------------------------------//
- private static class r8tor9 {
- r8tor9(String r8, String r9) {
- r8thing = r8;
- r9thing = r9;
- }
-
- public String r8thing;
-
- public String r9thing;
- }
-
- private class IdleLaplace extends Common.Laplace {
- public String operation(String wholeline) {
- return replaceLibrary(wholeline, mi.hashmacro);
- }
-
- public boolean recognize(String filename) {
- return filename.contains(".h") || filename.contains(".H")
- || filename.contains(".uni") || filename.contains(".s")
- || filename.contains(".S") || filename.contains(".asm")
- || (!filename.contains(".inf") && filename.contains(".i"));
- }
-
- public String namechange(String oldname) {
- if (oldname.contains(".H")) {
- return oldname.replaceFirst(".H", ".h");
- } else {
- return oldname;
- }
- }
- }
-
- private class DxsLaplace extends Common.Laplace {
- public String operation(String wholeline) {
- wholeline = replaceMacro(wholeline, mi.hashnonlocalmacro);
- if (mi.getModuleType().equals("PEIM")) {
- return addincludefile(wholeline, "\\<PeimDepex.h\\>");
- } else {
- return addincludefile(wholeline, "\\<DxeDepex.h\\>");
- }
- }
-
- public boolean recognize(String filename) {
- return filename.contains(".dxs");
- }
-
- public String namechange(String oldname) {
- return oldname;
- }
- }
-
- private class CLaplace extends Common.Laplace {
- public String operation(String wholeline) {
- // remove EFI_DRIVER_ENTRY_POINT
- wholeline = wholeline.replaceAll(
- "(EFI_[A-Z]+_ENTRY_POINT\\s*\\(\\s*\\w(\\w|\\d)*\\s*\\))",
- MigrationTool.MIGRATIONCOMMENT + " $1");
- // redefine module entry point for some self-relocated modules
- wholeline = wholeline.replaceAll(mi.entrypoint + "([^{]*?})",
- "_ModuleEntryPoint" + "$1");
- // remove R8 library contractor
- wholeline = wholeline.replaceAll(
- "(\\b(?:Efi|Dxe)InitializeDriverLib\\b)",
- MigrationTool.MIGRATIONCOMMENT + " $1");
- // Add Library Class for potential reference of gBS, gRT & gDS.
- if (Common.find(wholeline, "\\bg?BS\\b")) {
- mi.hashrequiredr9libs.add("UefiBootServicesTableLib");
- }
- if (Common.find(wholeline, "\\bg?RT\\b")) {
- mi.hashrequiredr9libs.add("UefiRuntimeServicesTableLib");
- }
- if (Common.find(wholeline, "\\bgDS\\b")) {
- mi.hashrequiredr9libs.add("DxeServicesTableLib");
- }
-
- wholeline = replaceLibrary(wholeline, mi.hashnonlocalfunc);
- wholeline = replaceLibrary(wholeline, mi.hashmacro);
- // Converting macro
- wholeline = replaceMacro(wholeline, mi.hashnonlocalmacro);
-
- // Converting guid
- replaceGuid(wholeline, mi.guids, "guid", fileguid);
- replaceGuid(wholeline, mi.ppis, "ppi", fileppi);
- replaceGuid(wholeline, mi.protocols, "protocol", fileprotocol);
-
- // Converting Pei
- if (mi.getModuleType().matches("PEIM")) {
- //
- // Try to remove PeiServicesTablePointer;
- //
- wholeline = dropPeiServicesPointer(wholeline);
- //
- // Drop the possible return Status of Hob building function.
- //
- wholeline = drophobLibReturnStatus(wholeline);
- }
- //
- // Expand obsolete R8 macro.
- //
- wholeline = replaceObsoleteMacro(wholeline);
-
- show(filefunc, "function");
- show(filemacro, "macro");
- show(fileguid, "guid");
- show(fileppi, "ppi");
- show(fileprotocol, "protocol");
- if (!filer8only.isEmpty()) {
- MigrationTool.ui.println("Converting r8only : " + filer8only);
- }
-
- filefunc.clear();
- filemacro.clear();
- fileguid.clear();
- fileppi.clear();
- fileprotocol.clear();
- filer8only.clear();
-
- return wholeline;
- }
-
- public boolean recognize(String filename) {
- return filename.contains(".c") || filename.contains(".C");
- }
-
- public String namechange(String oldname) {
- if (oldname.contains(".C")) {
- return oldname.replaceFirst(".C", ".c");
- } else {
- return oldname;
- }
- }
- }
-
- // ---------------------------------------inner
- // classes---------------------------------------//
-
- // -------------------------------------process
- // functions-------------------------------------//
- private static final String addincludefile(String wholeline, String hfile) {
- return wholeline.replaceFirst("(\\*/\\s)", "$1\n#include " + hfile
- + "\n");
- }
-
- private static final void show(Set<r8tor9> hash, String sh) {
- Iterator<r8tor9> it = hash.iterator();
- r8tor9 temp;
- if (!hash.isEmpty()) {
- MigrationTool.ui.print("Converting " + sh + " : ");
- while (it.hasNext()) {
- temp = it.next();
- MigrationTool.ui.print("[" + temp.r8thing + "->" + temp.r9thing
- + "] ");
- }
- MigrationTool.ui.println("");
- }
- }
-
- private static final void replaceGuid(String line, Set<String> hash,
- String kind, Set<r8tor9> filehash) {
- Iterator<String> it;
- String r8thing;
- String r9thing;
- it = hash.iterator();
- while (it.hasNext()) {
- r8thing = it.next();
- if ((r9thing = MigrationTool.db.getR9Guidname(r8thing)) != null) {
- if (!r8thing.equals(r9thing)) {
- if (line.contains(r8thing)) {
- line = line.replaceAll(r8thing, r9thing);
- filehash.add(new r8tor9(r8thing, r9thing));
- }
- }
- }
- }
- }
-
- private final String dropPeiServicesPointer(String wholeline) {
- String peiServicesTablePointer;
- String peiServicesTableCaller;
- String regPeiServices;
- Pattern ptnPei;
- Matcher mtrPei;
-
- peiServicesTablePointer = "\\w(?:\\w|[0-9]|->)*";
- peiServicesTableCaller = "\\(\\*\\*?\\s*(" + peiServicesTablePointer
- + ")\\s*\\)[.-]>?\\s*";
- for (int i = 0; i < peiserviceslibfunc.length; i++) {
- regPeiServices = peiServicesTableCaller + peiserviceslibfunc[i]
- + "\\s*\\(\\s*\\1\\s*,(\\t| )*";
- ptnPei = Pattern.compile(regPeiServices);
- mtrPei = ptnPei.matcher(wholeline);
- if (mtrPei.find()) {
- wholeline = mtrPei.replaceAll("PeiServices"
- + peiserviceslibfunc[i] + " (");
- mi.hashrequiredr9libs.add("PeiServicesLib");
- }
- }
- regPeiServices = peiServicesTableCaller + "(CopyMem|SetMem)"
- + "\\s*\\((\\t| )*";
- ptnPei = Pattern.compile(regPeiServices);
- mtrPei = ptnPei.matcher(wholeline);
- if (mtrPei.find()) {
- wholeline = mtrPei.replaceAll("$2 (");
- mi.hashrequiredr9libs.add("BaseMemoryLib");
- }
-
- ptnPei = Pattern.compile("#%+(\\s*\\(+\\s*)" + peiServicesTablePointer
- + "\\s*,\\s*", Pattern.MULTILINE);
- mtrPei = ptnPei.matcher(wholeline);
- while (mtrPei.find()) {
- wholeline = mtrPei.replaceAll("$1");
- }
-
- return wholeline;
- }
-
- private final String drophobLibReturnStatus(String wholeline) { // or use
- // regex to
- // find
- // pattern
- // "Status =
- // ..."
- Pattern ptnhobstatus;
- Matcher mtrhobstatus;
- String templine = wholeline;
- for (int i = 0; i < specialhoblibfunc.length; i++) {
- do {
- ptnhobstatus = Pattern.compile(
- "((?:\t| )*)(\\w(?:\\w|\\d)*)\\s*=\\s*"
- + specialhoblibfunc[i] + "(.*?;)",
- Pattern.DOTALL);
- mtrhobstatus = ptnhobstatus.matcher(templine);
- if (!mtrhobstatus.find()) {
- break;
- }
- String captureIndent = mtrhobstatus.group(1);
- String captureStatus = mtrhobstatus.group(2);
- String replaceString = captureIndent + specialhoblibfunc[i]
- + mtrhobstatus.group(3) + "\n";
- replaceString += captureIndent
- + MigrationTool.MIGRATIONCOMMENT
- + "R9 Hob-building library functions will assert if build failure.\n";
- replaceString += captureIndent + captureStatus
- + " = EFI_SUCCESS;";
- templine = mtrhobstatus.replaceFirst(replaceString);
- } while (true);
- }
- return templine;
- }
-
- private final String replaceMacro(String wholeline, Set<String> symbolSet) {
- String r8thing;
- String r9thing;
- Iterator<String> it;
-
- it = symbolSet.iterator();
- while (it.hasNext()) { // macros are all assumed MdePkg currently
- r8thing = it.next();
- // mi.hashrequiredr9libs.add(MigrationTool.db.getR9Lib(r8thing));
- if ((r9thing = MigrationTool.db.getR9Macro(r8thing)) != null) {
- if (wholeline.contains(r8thing)) {
- String findString = "(?<!(?:\\d|\\w))" + r8thing
- + "(?!(?:\\d|\\w))";
- wholeline = wholeline.replaceAll(findString, r9thing);
- filemacro.add(new r8tor9(r8thing, r9thing));
- }
- }
- }
- return wholeline;
- }
-
- private final String replaceLibrary(String wholeline, Set<String> symbolSet) {
- boolean addr8 = false;
- // start replacing names
- String r8thing;
- String r9thing;
- Iterator<String> it;
- // Converting non-locla function
- it = symbolSet.iterator();
- while (it.hasNext()) {
- r8thing = it.next();
- mi.addLibraryClass(MigrationTool.db.getR9Lib(r8thing),
- UsageTypes.ALWAYS_CONSUMED);
- // mi.hashrequiredr9libs.add(MigrationTool.db.getR9Lib(r8thing)); //
- // add a library here
-
- r8tor9 temp;
- if ((r9thing = MigrationTool.db.getR9Func(r8thing)) != null) {
- if (!r8thing.equals(r9thing)) {
- if (wholeline.contains(r8thing)) {
- String findString = "(?<!(?:\\d|\\w))" + r8thing
- + "(?!(?:\\d|\\w))";
- wholeline = wholeline.replaceAll(findString, r9thing);
- filefunc.add(new r8tor9(r8thing, r9thing));
- Iterator<r8tor9> rt = filefunc.iterator();
- while (rt.hasNext()) {
- temp = rt.next();
- if (MigrationTool.db.r8only.contains(temp.r8thing)) {
- filer8only.add(r8thing);
- mi.hashr8only.add(r8thing);
- addr8 = true;
- }
- }
- }
- }
- }
- } // is any of the guids changed?
- if (addr8 == true) {
- wholeline = addincludefile(wholeline, "\"R8Lib.h\"");
- }
- return wholeline;
- }
-
- private final String replaceObsoleteMacro(String wholeline) {
- Matcher mtrmac;
- mtrmac = Pattern.compile("EFI_IDIV_ROUND\\((.*), (.*)\\)").matcher(
- wholeline);
- if (mtrmac.find()) {
- wholeline = mtrmac
- .replaceAll("\\($1 \\/ $2 \\+ \\(\\(\\(2 \\* \\($1 \\% $2\\)\\) \\< $2\\) \\? 0 \\: 1\\)\\)");
- }
- mtrmac = Pattern.compile("EFI_MIN\\((.*), (.*)\\)").matcher(wholeline);
- if (mtrmac.find()) {
- wholeline = mtrmac
- .replaceAll("\\(\\($1 \\< $2\\) \\? $1 \\: $2\\)");
- }
- mtrmac = Pattern.compile("EFI_MAX\\((.*), (.*)\\)").matcher(wholeline);
- if (mtrmac.find()) {
- wholeline = mtrmac
- .replaceAll("\\(\\($1 \\> $2\\) \\? $1 \\: $2\\)");
- }
- mtrmac = Pattern.compile("EFI_UINTN_ALIGNED\\((.*)\\)").matcher(
- wholeline);
- if (mtrmac.find()) {
- wholeline = mtrmac
- .replaceAll("\\(\\(\\(UINTN\\) $1\\) \\& \\(sizeof \\(UINTN\\) \\- 1\\)\\)");
- }
- if (wholeline.contains("EFI_UINTN_ALIGN_MASK")) {
- wholeline = wholeline.replaceAll("EFI_UINTN_ALIGN_MASK",
- "(sizeof (UINTN) - 1)");
- }
- return wholeline;
- }
-
- private final void addr8only() throws Exception {
- String paragraph = null;
- String line = Common.file2string(MigrationTool.db.DatabasePath
- + File.separator + "R8Lib.c");
- PrintWriter outfile1 = new PrintWriter(new BufferedWriter(
- new FileWriter(MigrationTool.ModuleInfoMap.get(mi)
- + File.separator + "Migration_" + mi.modulename
- + File.separator + "R8Lib.c")));
- PrintWriter outfile2 = new PrintWriter(new BufferedWriter(
- new FileWriter(MigrationTool.ModuleInfoMap.get(mi)
- + File.separator + "Migration_" + mi.modulename
- + File.separator + "R8Lib.h")));
- Pattern ptnr8only = Pattern.compile(
- "////#?(\\w*)?(.*?R8_(\\w*).*?)////~", Pattern.DOTALL);
- Matcher mtrr8only = ptnr8only.matcher(line);
- Matcher mtrr8onlyhead;
-
- // add head comment
- if (mi.license != null) {
- String header = "/**@file\n Copyright (c) 2007, Intel Corporation\n\n" +
- mi.license.replace(" ", " ") + "**/\n\n";
- outfile1.append(header);
- outfile2.append(header);
- }
-
- // add functions body
- while (mtrr8only.find()) {
- if (mi.hashr8only.contains(mtrr8only.group(3))) {
- paragraph = mtrr8only.group(2);
- outfile1.append(paragraph + "\n\n");
- if (mtrr8only.group(1).length() != 0) {
- mi.hashrequiredr9libs.add(mtrr8only.group(1));
- }
- // generate R8lib.h
- while ((mtrr8onlyhead = Func.ptnbrace.matcher(paragraph))
- .find()) {
- paragraph = mtrr8onlyhead.replaceAll(";");
- }
- outfile2.append(paragraph + "\n\n");
- }
- }
- outfile1.flush();
- outfile1.close();
- outfile2.flush();
- outfile2.close();
-
- mi.localmodulesources.add("R8Lib.h");
- mi.localmodulesources.add("R8Lib.c");
- }
-
- // -------------------------------------process
- // functions-------------------------------------//
-
- // -----------------------------------ForDoAll-----------------------------------//
- public void run(String filepath) throws Exception {
- String inname = filepath.replace(mi.temppath + File.separator, "");
- String tempinpath = mi.temppath + File.separator;
- String tempoutpath = MigrationTool.ModuleInfoMap.get(mi)
- + File.separator + "Migration_" + mi.modulename
- + File.separator;
-
- Iterator<Common.Laplace> itLaplace = Laplaces.iterator();
- while (itLaplace.hasNext()) {
- Common.Laplace lap = itLaplace.next();
- if (lap.recognize(inname)) {
- MigrationTool.ui.println("\nHandling file: " + inname);
- lap.transform(tempinpath + inname, tempoutpath
- + lap.namechange(inname));
- }
- }
- }
-
- public boolean filter(File dir) {
- return true;
- }
-
- // -----------------------------------ForDoAll-----------------------------------//
-
- private final void setModuleInfo(ModuleInfo moduleinfo) {
- mi = moduleinfo;
- }
-
- private final void start() throws Exception {
- Laplaces.add(new DxsLaplace());
- Laplaces.add(new CLaplace());
- Laplaces.add(new IdleLaplace());
-
- Common.toDoAll(mi.temppath, this, Common.FILE);
-
- if (!mi.hashr8only.isEmpty()) {
- addr8only();
- }
-
- Laplaces.clear();
- }
-
- public static final void fireAt(ModuleInfo moduleinfo) throws Exception {
- SFReplacer.setModuleInfo(moduleinfo);
- SFReplacer.start();
- }
-}
diff --git a/Tools/Java/Source/MigrationTools/org/tianocore/migration/UI.java b/Tools/Java/Source/MigrationTools/org/tianocore/migration/UI.java
deleted file mode 100644
index ddbc85b847..0000000000
--- a/Tools/Java/Source/MigrationTools/org/tianocore/migration/UI.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/** @file
-
- 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.
-
- **/
-package org.tianocore.migration;
-
-import java.util.Set;
-
-public interface UI {
-
- public boolean yesOrNo(String question);
-
- public void print(String message);
-
- public void println(String message);
-
- public void println(Set<String> hash);
-
- public String choose(String message, Object[] choicelist);
-
- public String getInput(String message);
-
- public String getFilepath(String title, int mode); // necessary ?
-}
diff --git a/Tools/Java/Source/PcdTools/PcdTools.msa b/Tools/Java/Source/PcdTools/PcdTools.msa
deleted file mode 100644
index 11a68567ec..0000000000
--- a/Tools/Java/Source/PcdTools/PcdTools.msa
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>PcdTools</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>95506773-88f3-475a-91a1-14ce0c847353</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano PCD Tool Resources Module</Abstract>
- <Description>
- This Module provdes the entity, action and exception package for PCD
- tools, This package will be shared for building tools or wizard tools.
- </Description>
- <Copyright>Copyright 2005-2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- <Filename>org/tianocore/pcd/action/PlatformPcdPreprocessAction.java</Filename>
- <Filename>org/tianocore/pcd/action/BuildAction.java</Filename>
- <Filename>org/tianocore/pcd/entity/CommonDefinition.java</Filename>
- <Filename>org/tianocore/pcd/entity/DynamicTokenValue.java</Filename>
- <Filename>org/tianocore/pcd/entity/MemoryDatabaseManager.java</Filename>
- <Filename>org/tianocore/pcd/entity/ModulePcdInfoFromFpd.java</Filename>
- <Filename>org/tianocore/pcd/entity/SkuInstance.java</Filename>
- <Filename>org/tianocore/pcd/entity/Token.java</Filename>
- <Filename>org/tianocore/pcd/entity/UsageInstance.java</Filename>
- <Filename>org/tianocore/pcd/exception/BuildActionException.java</Filename>
- <Filename>org/tianocore/pcd/exception/EntityException.java</Filename>
- <Filename>org/tianocore/pcd/exception/PlatformPcdPreprocessException.java</Filename>
- <Filename>org/tianocore/pcd/exception/UIException.java</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/PcdTools/build.xml b/Tools/Java/Source/PcdTools/build.xml
deleted file mode 100644
index 4db07e0cf4..0000000000
--- a/Tools/Java/Source/PcdTools/build.xml
+++ /dev/null
@@ -1,54 +0,0 @@
-<?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="PcdTools" default="PcdTools" basedir=".">
-
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env"/>
- <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"/>
- <property name="installLocation" value="${WORKSPACE}/Tools/Jars"/>
- <target name="PcdTools" depends="install"/>
- <target name="source">
- <mkdir dir="${buildDir}"/>
- <javac srcdir="." destdir="${buildDir}">
- <classpath refid="classpath"/>
- <compilerarg value="-Xlint"/>
- </javac>
- </target>
- <target name="clean">
- <delete includeemptydirs="true" failonerror="false" quiet="true">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/PcdTools" includes="${buildDir}"/>
- </delete>
- </target>
- <target name="cleanall" depends="clean">
- <echo message="Removing Class Files and the Java Archive: PcdTools.jar"/>
- <delete file="${installLocation}/PcdTools.jar"/>
- <if>
- <available file="${installLocation}/PcdTools.jar"/>
- <then>
- <echo message="You must manually remove the file: ${installLocation}/PcdTools.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}/PcdTools.jar"
- basedir="${buildDir}"
- includes="**"
- />
- </target>
-</project>
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/BuildAction.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/BuildAction.java
deleted file mode 100644
index 9d30a76bdc..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/BuildAction.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/** @file
- BuildAction class.
-
- BuildAction is the parent class for all action related to ant Task. This class will
- define some common utility functionality, such as logMsg, warningMsg..etc.
-
-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.
-
-**/
-package org.tianocore.pcd.action;
-
-import org.apache.tools.ant.Task;
-import org.apache.tools.ant.Project;
-import org.tianocore.pcd.exception.BuildActionException;
-
-/** BuildAction is the parent class for all action related to ant Task. This class will
- define some common utility functionality, such as logMsg, warningMsg..etc.
-**/
-public abstract class BuildAction extends Task {
- ///
- /// Original message level before this action. This value will
- /// be restored when quit this action.
- ///
- private int originalMessageLevel;
-
- /**
- checkParameter function check all parameter valid.
-
- This function will be overrided by child class.
- **/
- public abstract void checkParameter() throws BuildActionException;
-
- /**
- performAction is to execute the detail action.
-
- This function will be overrided by child class.
- **/
- public abstract void performAction() throws BuildActionException;
-
- /**
- execute function is the main flow for all build action class.
-
- This workflow will be:
- 1) Check paramet of this action.
- 2) Perform the child class action function.
- 3) Restore the message level.
-
- @throws BuildActionException
- **/
- public void execute() throws BuildActionException {
- checkParameter();
- performAction();
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java
deleted file mode 100644
index ee91f2a8e8..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/action/PlatformPcdPreprocessAction.java
+++ /dev/null
@@ -1,992 +0,0 @@
-/** @file
- PlatformPcdPreprocessAction class.
-
- The abstract parent class PlatformPcdPreprocessAction, This class is to collect platform's
- pcd build information from fpd file.
- This class will be extended by building tools and wizard tools.
-
-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.
-
-**/
-package org.tianocore.pcd.action;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.UUID;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-import org.tianocore.DynamicPcdBuildDefinitionsDocument.DynamicPcdBuildDefinitions;
-import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;
-import org.tianocore.pcd.entity.*;
-import org.tianocore.pcd.entity.Token;
-import org.tianocore.pcd.entity.MemoryDatabaseManager;
-import org.tianocore.pcd.exception.PlatformPcdPreprocessException;
-
-/**
- The abstract parent class PlatformPcdPreprocessAction, This class is to collect platform's
- pcd build information from fpd file.
- This class will be extended by building tools and wizard tools.
-
-**/
-public abstract class PlatformPcdPreprocessAction {
- ///
- /// PCD memory database
- ///
- private MemoryDatabaseManager pcdDbManager;
-
- ///
- /// Errors string when perform preprocess
- ///
- private String errorString;
-
- ///
- /// the count of errors when perform preprocess
- ///
- private int errorCount;
-
- /**
- Default contructor function
- **/
- public PlatformPcdPreprocessAction() {
- pcdDbManager = null;
- errorString = null;
- errorCount = 0;
- }
-
- /**
- Set parameter pcdDbManager
-
- @param pcdDbManager
- **/
- public void setPcdDbManager(MemoryDatabaseManager pcdDbManager) {
- this.pcdDbManager = pcdDbManager;
- }
-
- /**
- Get parameter pcdDbManager
-
- @return MemoryDatabaseManager
- **/
- public MemoryDatabaseManager getPcdDbManager() {
- return pcdDbManager;
- }
-
- /**
- Abstract function: retrieve module information from FPD file.
-
- In building environement, this function will be implementated by FpdParserTask.
-
- @return List<ModulePcdInfoFromFpd> the component array.
- @throws PlatformPcdPreprocessException get all modules in <ModuleSA> in FPD file.
-
- **/
- public abstract List<ModulePcdInfoFromFpd> getComponentsFromFpd()
- throws PlatformPcdPreprocessException;
-
- /**
- Abstract function to get GUID string from SPD file.
-
- In building evnironment, this function will be implementated by GlobaData.
-
- @param guidCName the CName of GUID
-
- @return String Guid information from SPD file.
- @throws PlatformPcdPreprocessException
- Fail to get Guid information from SPD file.
- **/
- public abstract String getGuidInfoFromSpd(String guidCName) throws PlatformPcdPreprocessException;
-
- /**
- Abstract function: Verification the PCD data.
-
- In different environment, such as building environment and wizard environment,
- it has different implementation according to optimization.
-
- @param cName The token name
- @param moduleName The module who use this PCD token
- @param datum The PCD's datum
- @param datumType The PCD's datum type
- @param maxDatumSize The max size for PCD's Datum.
-
- @return String exception strings.
-
- **/
- public abstract String verifyDatum(String cName, String moduleName, String datum,
- Token.DATUM_TYPE datumType, int maxDatumSize);
-
- /**
- Abstract function: Get dynamic information for a token
-
- @param token
- @param moduleName
-
- @return DynamicPcdBuildDefinitions.PcdBuildData
- **/
- public abstract DynamicPcdBuildDefinitions.PcdBuildData
- getDynamicInfoFromFpd(Token token,
- String moduleName)
- throws PlatformPcdPreprocessException;
-
- /**
- Abstract function: Get all dynamic PCD information from FPD file.
-
- @return List<DynamicPcdBuildDefinitions.PcdBuildData> All DYNAMIC PCD list in <DynamicPcdBuildDefinitions> in FPD file.
- @throws PlatformPcdPreprocessBuildException Failure to get dynamic information list.
-
- **/
- public abstract List<DynamicPcdBuildDefinitions.PcdBuildData>
- getAllDynamicPcdInfoFromFpd()
- throws PlatformPcdPreprocessException;
-
- /**
- Return the error string after preprocess
-
- @return String error string
- **/
- public String getErrorString() {
- return errorString;
- }
-
- public void putError(String error) {
- if (errorString == null) {
- errorString = "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n";
- } else {
- errorString += "### ERROR[" + errorCount + "] ###\r\n" + error + "\r\n";
- }
-
- errorCount++;
- }
-
- /**
- Collect all PCD information from FPD file into PCD memory database.
-
- **/
- public void initPcdMemoryDbWithPlatformInfo()
- throws PlatformPcdPreprocessException {
- int index;
- int pcdIndex;
- List<PcdBuildDefinition.PcdData> pcdBuildDataArray = new ArrayList<PcdBuildDefinition.PcdData>();
- PcdBuildDefinition.PcdData pcdBuildData;
- Token token = null;
- List<ModulePcdInfoFromFpd> modules;
- String primaryKey;
- String exceptionString;
- UsageInstance usageInstance;
- Token.PCD_TYPE pcdType = Token.PCD_TYPE.UNKNOWN;
- Token.DATUM_TYPE datumType = Token.DATUM_TYPE.UNKNOWN;
- long tokenNumber;
- String moduleName;
- String datum;
- int maxDatumSize;
- String tokenSpaceStrRet;
- ModulePcdInfoFromFpd curModule;
-
- //
- // ----------------------------------------------
- // 1), Get all <ModuleSA> from FPD file.
- // ----------------------------------------------
- //
- modules = getComponentsFromFpd();
-
- if (modules == null) {
- throw new PlatformPcdPreprocessException(
- "No modules found in the FPD file.\nPlease check whether there are elements in <FrameworkModules> in the FPD file!");
- }
-
- //
- // -------------------------------------------------------------------
- // 2), Loop all modules to process <PcdBuildDeclarations> for each module.
- // -------------------------------------------------------------------
- //
- for (index = 0; index < modules.size(); index++) {
- curModule = modules.get(index);
-
- //
- // It is legal for a module does not contains ANY pcd build definitions.
- //
- if (curModule.pcdBuildDefinition == null) {
- continue;
- }
-
- pcdBuildDataArray = curModule.pcdBuildDefinition.getPcdDataList();
- moduleName = curModule.usageId.moduleName;
-
- //
- // ----------------------------------------------------------------------
- // 2.1), Loop all Pcd entry for a module and add it into memory database.
- // ----------------------------------------------------------------------
- //
- for (pcdIndex = 0; pcdIndex < pcdBuildDataArray.size(); pcdIndex++) {
- pcdBuildData = pcdBuildDataArray.get(pcdIndex);
-
- tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
-
- if (tokenSpaceStrRet == null) {
- putError("Failed to get Token Space Guid for token " + pcdBuildData.getCName() +
- " from any SPD file. You must have an <GuidDeclaration> for this Token Space Guid!");
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(), tokenSpaceStrRet);
- pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());
- datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
- tokenNumber = Long.decode(pcdBuildData.getToken().toString());
- if (pcdBuildData.getValue() != null) {
- datum = pcdBuildData.getValue().toString();
- } else {
- datum = null;
- }
- maxDatumSize = pcdBuildData.getMaxDatumSize();
-
- if ((pcdType == Token.PCD_TYPE.FEATURE_FLAG) &&
- (datumType != Token.DATUM_TYPE.BOOLEAN)){
- exceptionString = String.format("In FPD file, for PCD %s in module %s, the PCD type is FEATURE_FLAG but "+
- "datum type for this PCD entry is not BOOLEAN!",
- pcdBuildData.getCName(),
- moduleName);
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- //
- // -------------------------------------------------------------------------------------------
- // 2.1.1), Do some necessary checking work for FixedAtBuild, FeatureFlag and PatchableInModule
- // -------------------------------------------------------------------------------------------
- //
- if (!Token.isDynamic(pcdType)) {
- //
- // Value is required.
- //
- if (datum == null) {
- exceptionString = String.format("In the FPD file, there is no value for PCD entry %s in module %s!",
- pcdBuildData.getCName(),
- moduleName);
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- //
- // Check whether the datum size is matched datum type.
- //
- if ((exceptionString = verifyDatum(pcdBuildData.getCName(),
- moduleName,
- datum,
- datumType,
- maxDatumSize)) != null) {
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
- }
-
- //
- // ---------------------------------------------------------------------------------
- // 2.1.2), Create token or update token information for current anaylized PCD data.
- // ---------------------------------------------------------------------------------
- //
- if (pcdDbManager.isTokenInDatabase(primaryKey)) {
- //
- // If the token is already exist in database, do some necessary checking
- // and add a usage instance into this token in database
- //
- token = pcdDbManager.getTokenByKey(primaryKey);
-
- //
- // checking for DatumType, DatumType should be unique for one PCD used in different
- // modules.
- //
- if (token.datumType != datumType) {
- exceptionString = String.format("In the FPD file, the datum type of the PCD entry %s is %s, which is different from %s which was previously defined!",
- pcdBuildData.getCName(),
- pcdBuildData.getDatumType().toString(),
- Token.getStringOfdatumType(token.datumType));
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- //
- // Check token number is valid
- //
- if (tokenNumber != token.tokenNumber) {
- exceptionString = String.format("In the FPD file, the token number of PCD entry %s in module %s is different from the same PCD entry in other modules!",
- pcdBuildData.getCName(),
- moduleName);
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- //
- // For same PCD used in different modules, the PCD type should all be dynamic or non-dynamic.
- //
- if (token.isDynamicPCD != Token.isDynamic(pcdType)) {
- exceptionString = String.format("In the FPD file, for PCD entry %s in module %s, you defined dynamic or non-dynamic PCD type which"+
- " is different from other module's definition.",
- token.cName,
- moduleName);
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- if (token.isDynamicPCD) {
- if ((maxDatumSize != 0) &&
- (maxDatumSize != token.datumSize)){
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in module %s, the max datum size is %d which "+
- "is different than <MaxDatumSize> %d defined in <DynamicPcdBuildDefinitions>!",
- token.cName,
- moduleName,
- maxDatumSize,
- token.datumSize);
- putError(exceptionString);
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
- }
-
- } else {
- //
- // If the token is not in database, create a new token instance and add
- // a usage instance into this token in database.
- //
- tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
-
- if (tokenSpaceStrRet == null) {
- putError("Failed to get the Token Space Guid for token" + token.cName +
- " from any SPD file. You must have a <GuidDeclaration> for this Token Space Guid!");
- //
- // Do not break preprocess, continues to analysis.
- // All errors will be summary to be shown.
- //
- continue;
- }
-
- token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
-
- token.datumType = datumType;
- token.tokenNumber = tokenNumber;
- token.isDynamicPCD = Token.isDynamic(pcdType);
- token.datumSize = maxDatumSize;
-
- if (token.isDynamicPCD) {
- //
- // For Dynamic and Dynamic Ex type, need find the dynamic information
- // in <DynamicPcdBuildDefinition> section in FPD file.
- //
- if (null == updateDynamicInformation(moduleName,
- token,
- datum,
- maxDatumSize)) {
- continue;
- }
- }
-
- pcdDbManager.addTokenToDatabase(primaryKey, token);
- }
-
- //
- // -----------------------------------------------------------------------------------
- // 2.1.3), Add the PcdType in current module into this Pcd token's supported PCD type.
- // -----------------------------------------------------------------------------------
- //
- token.updateSupportPcdType(pcdType);
-
- //
- // ------------------------------------------------
- // 2.1.4), Create an usage instance for this token.
- // ------------------------------------------------
- //
- usageInstance = new UsageInstance(token,
- curModule.usageId,
- pcdType,
- datum,
- maxDatumSize);
- if (!token.addUsageInstance(usageInstance)) {
- putError(String.format("PCD %s for module %s(%s) already exists in the database.\nPlease check all PCD build entries "+
- "in the %s module's <ModuleSA> section to make sure there are no duplicated definitions in the FPD file!",
- token.cName,
- curModule.usageId.moduleGuid,
- moduleName,
- moduleName));
- continue;
- }
- }
- }
-
- //
- // ------------------------------------------------
- // 3), Add unreference dynamic_Ex pcd token into Pcd database.
- // ------------------------------------------------
- //
- List<Token> tokenArray = getUnreferencedDynamicPcd();
- if (tokenArray != null) {
- for (index = 0; index < tokenArray.size(); index++) {
- pcdDbManager.addTokenToDatabase(tokenArray.get(index).getPrimaryKeyString(),
- tokenArray.get(index));
- }
- }
- }
-
- /**
- Update dynamic information for PCD entry.
-
- Dynamic information is retrieved from <PcdDynamicBuildDeclarations> in
- FPD file.
-
- @param moduleName The name of the module who use this PCD
- @param token The token instance
- @param datum The <datum> in module's PCD information
- @param maxDatumSize The <maxDatumSize> in module's PCD information
-
- @return Token
- */
- private Token updateDynamicInformation(String moduleName,
- Token token,
- String datum,
- int maxDatumSize)
- throws PlatformPcdPreprocessException {
- int index = 0;
- int offset;
- String exceptionString = null;
- SkuInstance skuInstance = null;
- String temp;
- boolean hasSkuId0 = false;
- long tokenNumber = 0;
- String hiiDefaultValue = null;
- String variableGuidString = null;
-
- List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> skuInfoList = null;
- DynamicPcdBuildDefinitions.PcdBuildData dynamicInfo = null;
-
- dynamicInfo = getDynamicInfoFromFpd(token, moduleName);
- if (dynamicInfo == null) {
- exceptionString = String.format("In the FPD file, the Dynamic PCD %s is used by module %s.\n" +
- "However, there is no dynamic information in the <DynamicPcdBuildDefinitions> " +
- "section of the FPD file. This section is required!",
- token.cName,
- moduleName);
- putError(exceptionString);
- return null;
- }
-
- token.datumSize = dynamicInfo.getMaxDatumSize();
-
- exceptionString = verifyDatum(token.cName,
- moduleName,
- null,
- token.datumType,
- token.datumSize);
- if (exceptionString != null) {
- throw new PlatformPcdPreprocessException(exceptionString);
- }
-
- if ((maxDatumSize != 0) &&
- (maxDatumSize != token.datumSize)) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the datum size in module %s is %d, but "+
- "the datum size in <DynamicPcdBuildDefinitions> is %d, they do not match!",
- token.cName,
- moduleName,
- maxDatumSize,
- dynamicInfo.getMaxDatumSize());
- putError(exceptionString);
- return null;
- }
- tokenNumber = Long.decode(dynamicInfo.getToken().toString());
- if (tokenNumber != token.tokenNumber) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the token number in module %s is 0x%x, but "+
- "in the <DynamicPcdBuildDefinictions> section, the token number is 0x%x, they do not match!",
- token.cName,
- moduleName,
- token.tokenNumber,
- tokenNumber);
- putError(exceptionString);
- return null;
- }
-
- token.dynamicExTokenNumber = tokenNumber;
-
- skuInfoList = dynamicInfo.getSkuInfoList();
-
- //
- // Loop all sku data
- //
- for (index = 0; index < skuInfoList.size(); index++) {
- skuInstance = new SkuInstance();
- //
- // Although SkuId in schema is BigInteger, but in fact, sku id is 32 bit value.
- //
- temp = skuInfoList.get(index).getSkuId().toString();
- skuInstance.id = Integer.decode(temp);
- if (skuInstance.id == 0) {
- hasSkuId0 = true;
- }
- //
- // Judge whether is DefaultGroup at first, because most case is DefautlGroup.
- //
- if (skuInfoList.get(index).getValue() != null) {
- skuInstance.value.setValue(skuInfoList.get(index).getValue().toString());
- if ((exceptionString = verifyDatum(token.cName,
- null,
- skuInfoList.get(index).getValue().toString(),
- token.datumType,
- token.datumSize)) != null) {
- putError(exceptionString);
- return null;
- }
-
- token.skuData.add(skuInstance);
-
- continue;
- }
-
- //
- // Judge whether is HII group case.
- //
- if (skuInfoList.get(index).getVariableName() != null) {
- exceptionString = null;
- if (skuInfoList.get(index).getVariableGuid() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in <DynamicPcdBuildDefinitions> section in FPD "+
- "file, use of HII was defined, but there is no <VariableGuid> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- return null;
- }
-
- if (skuInfoList.get(index).getVariableOffset() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in <DynamicPcdBuildDefinitions> section in FPD "+
- "file, use of HII was defined, but there is no <VariableOffset> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- return null;
- }
-
- if (skuInfoList.get(index).getHiiDefaultValue() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in <DynamicPcdBuildDefinitions> section in FPD "+
- "file, use of HII was defined, but there is no <HiiDefaultValue> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- return null;
- }
-
- if (skuInfoList.get(index).getHiiDefaultValue() != null) {
- hiiDefaultValue = skuInfoList.get(index).getHiiDefaultValue().toString();
- } else {
- hiiDefaultValue = null;
- }
-
- if ((exceptionString = verifyDatum(token.cName,
- null,
- hiiDefaultValue,
- token.datumType,
- token.datumSize)) != null) {
- throw new PlatformPcdPreprocessException(exceptionString);
- }
-
- offset = Integer.decode(skuInfoList.get(index).getVariableOffset());
- if (offset > 0xFFFF) {
- putError(String.format("In the FPD file, for dynamic PCD %s, the variable offset defined in SKU %d data "+
- "exceeds 64K, which is not allowed!",
- token.cName,
- index));
- return null;
- }
-
- //
- // Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
- //
- variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
- if (variableGuidString == null) {
- putError(String.format("In the FPD file, for dynamic PCD %s, the variable guid: %s cannot be found in any SPD file!",
- token.cName,
- skuInfoList.get(index).getVariableGuid().toString()));
- return null;
- }
- String variableStr = skuInfoList.get(index).getVariableName();
- Pattern pattern = Pattern.compile("0x([a-fA-F0-9]){4}");
- Matcher matcher = pattern.matcher(variableStr);
- List<String> varNameList = new ArrayList<String>();
- while (matcher.find()){
- String str = variableStr.substring(matcher.start(),matcher.end());
- varNameList.add(str);
- }
-
- skuInstance.value.setHiiData(varNameList,
- translateSchemaStringToUUID(variableGuidString),
- skuInfoList.get(index).getVariableOffset(),
- skuInfoList.get(index).getHiiDefaultValue().toString());
- token.skuData.add(skuInstance);
- continue;
- }
-
- if (skuInfoList.get(index).getVpdOffset() != null) {
- skuInstance.value.setVpdData(skuInfoList.get(index).getVpdOffset());
- token.skuData.add(skuInstance);
- continue;
- }
-
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the dynamic info must "+
- "be one of: 'DefaultGroup', 'HIIGroup', 'VpdGroup'.",
- token.cName);
- putError(exceptionString);
- return null;
- }
-
- if (!hasSkuId0) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in <DynamicPcdBuildDefinitions>, there is "+
- "no SKU ID = 0 data, which is required for every dynamic PCD",
- token.cName);
- putError(exceptionString);
- return null;
- }
-
- return token;
- }
-
- /**
- Get all dynamic PCD defined in <DynamicPcdBuildDefinitions> which unreferenced by
- any <ModuleSA> in FPD file.
-
- @return List<Token> Return PCD token
- **/
- private List<Token> getUnreferencedDynamicPcd () throws PlatformPcdPreprocessException {
- List<Token> tokenArray = new ArrayList<Token>();
- Token token = null;
- List<DynamicPcdBuildDefinitions.PcdBuildData> dynamicPcdBuildDataArray = null;
- DynamicPcdBuildDefinitions.PcdBuildData pcdBuildData = null;
- List<DynamicPcdBuildDefinitions.PcdBuildData.SkuInfo> skuInfoList = null;
- Token.PCD_TYPE pcdType;
- SkuInstance skuInstance = null;
- String primaryKey = null;
- boolean hasSkuId0 = false;
- int index, offset, index2;
- String temp;
- String exceptionString;
- String hiiDefaultValue;
- String tokenSpaceStrRet;
- String variableGuidString;
-
- dynamicPcdBuildDataArray = getAllDynamicPcdInfoFromFpd();
- if (dynamicPcdBuildDataArray == null) {
- return null;
- }
-
- for (index2 = 0; index2 < dynamicPcdBuildDataArray.size(); index2++) {
- pcdBuildData = dynamicPcdBuildDataArray.get(index2);
- tokenSpaceStrRet = getGuidInfoFromSpd(pcdBuildData.getTokenSpaceGuidCName());
-
- if (tokenSpaceStrRet == null) {
- putError("Failed to get the Token Space Guid for token" + pcdBuildData.getCName());
- continue;
- }
-
- primaryKey = Token.getPrimaryKeyString(pcdBuildData.getCName(),
- tokenSpaceStrRet);
-
- if (pcdDbManager.isTokenInDatabase(primaryKey)) {
- continue;
- }
-
- pcdType = Token.getPcdTypeFromString(pcdBuildData.getItemType().toString());
- if (pcdType != Token.PCD_TYPE.DYNAMIC_EX) {
- putError(String.format("In the FPD file, it not allowed to define DYNAMIC PCD %s that is not used by any module",
- pcdBuildData.getCName()));
- continue;
- }
-
- //
- // Create new token for unreference dynamic PCD token
- //
- token = new Token(pcdBuildData.getCName(), tokenSpaceStrRet);
- token.datumSize = pcdBuildData.getMaxDatumSize();
-
-
- token.datumType = Token.getdatumTypeFromString(pcdBuildData.getDatumType().toString());
- token.tokenNumber = Long.decode(pcdBuildData.getToken().toString());
- token.dynamicExTokenNumber = token.tokenNumber;
- token.isDynamicPCD = true;
- token.updateSupportPcdType(pcdType);
-
- exceptionString = verifyDatum(token.cName,
- null,
- null,
- token.datumType,
- token.datumSize);
- if (exceptionString != null) {
- putError(exceptionString);
- continue;
- }
-
- skuInfoList = pcdBuildData.getSkuInfoList();
-
- //
- // Loop all sku data
- //
- for (index = 0; index < skuInfoList.size(); index++) {
- skuInstance = new SkuInstance();
- //
- // Although SkuId in schema is BigInteger, but in fact, sku id is 32 bit value.
- //
- temp = skuInfoList.get(index).getSkuId().toString();
- skuInstance.id = Integer.decode(temp);
- if (skuInstance.id == 0) {
- hasSkuId0 = true;
- }
- //
- // Judge whether is DefaultGroup at first, because most case is DefautlGroup.
- //
- if (skuInfoList.get(index).getValue() != null) {
- skuInstance.value.setValue(skuInfoList.get(index).getValue().toString());
- if ((exceptionString = verifyDatum(token.cName,
- null,
- skuInfoList.get(index).getValue().toString(),
- token.datumType,
- token.datumSize)) != null) {
- putError(exceptionString);
- continue;
- }
-
- token.skuData.add(skuInstance);
-
- continue;
- }
-
- //
- // Judge whether is HII group case.
- //
- if (skuInfoList.get(index).getVariableName() != null) {
- exceptionString = null;
- if (skuInfoList.get(index).getVariableGuid() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in the <DynamicPcdBuildDefinitions> section of the FPD "+
- "file, use of HII is defined, but there is no <VariableGuid> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- continue;
- }
-
- if (skuInfoList.get(index).getVariableOffset() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in the <DynamicPcdBuildDefinitions> section of the FPD "+
- "file, use of HII is defined, but there is no <VariableOffset> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- continue;
- }
-
- if (skuInfoList.get(index).getHiiDefaultValue() == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in the <DynamicPcdBuildDefinitions> section of the FPD "+
- "file, use of HII is defined, but there is no <HiiDefaultValue> defined for SKU %d data!",
- token.cName,
- index);
- putError(exceptionString);
- continue;
- }
-
- if (skuInfoList.get(index).getHiiDefaultValue() != null) {
- hiiDefaultValue = skuInfoList.get(index).getHiiDefaultValue().toString();
- } else {
- hiiDefaultValue = null;
- }
-
- if ((exceptionString = verifyDatum(token.cName,
- null,
- hiiDefaultValue,
- token.datumType,
- token.datumSize)) != null) {
- putError(exceptionString);
- continue;
- }
-
- offset = Integer.decode(skuInfoList.get(index).getVariableOffset());
- if (offset > 0xFFFF) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the variable offset defined in SKU %d data "+
- "exceeds 64K, which is not allowed!",
- token.cName,
- index);
- putError(exceptionString);
- continue;
- }
-
- //
- // Get variable guid string according to the name of guid which will be mapped into a GUID in SPD file.
- //
- variableGuidString = getGuidInfoFromSpd(skuInfoList.get(index).getVariableGuid().toString());
- if (variableGuidString == null) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the variable guid %s cannot be found in any SPD file!",
- token.cName,
- skuInfoList.get(index).getVariableGuid().toString());
- putError(exceptionString);
- continue;
- }
- String variableStr = skuInfoList.get(index).getVariableName();
- Pattern pattern = Pattern.compile("0x([a-fA-F0-9]){4}");
- Matcher matcher = pattern.matcher(variableStr);
- List<String> varNameList = new ArrayList<String>();
- while (matcher.find()){
- String str = variableStr.substring(matcher.start(),matcher.end());
- varNameList.add(str);
- }
-
- skuInstance.value.setHiiData(varNameList,
- translateSchemaStringToUUID(variableGuidString),
- skuInfoList.get(index).getVariableOffset(),
- skuInfoList.get(index).getHiiDefaultValue().toString());
- token.skuData.add(skuInstance);
- continue;
- }
-
- if (skuInfoList.get(index).getVpdOffset() != null) {
- skuInstance.value.setVpdData(skuInfoList.get(index).getVpdOffset());
- token.skuData.add(skuInstance);
- continue;
- }
-
- exceptionString = String.format("In the FPD file, for dynamic PCD %s, the dynamic info must "+
- "be one of 'DefaultGroup', 'HIIGroup', 'VpdGroup'.",
- token.cName);
- putError(exceptionString);
- }
-
- if (!hasSkuId0) {
- exceptionString = String.format("In the FPD file, for dynamic PCD %s in <DynamicPcdBuildDefinitions>, there is "+
- "no SKU ID = 0 data, which is required for every dynamic PCD",
- token.cName);
- putError(exceptionString);
- continue;
- }
-
- tokenArray.add(token);
- }
-
- return tokenArray;
- }
-
- /**
- Translate the schema string to UUID instance.
-
- In schema, the string of UUID is defined as following two types string:
- 1) GuidArrayType: pattern = 0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},(
- )*0x[a-fA-F0-9]{1,4}(,( )*\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\})?
-
- 2) GuidNamingConvention: pattern =
- [a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}
-
- This function will convert string and create uuid instance.
-
- @param uuidString UUID string in XML file
-
- @return UUID UUID instance
- **/
- private UUID translateSchemaStringToUUID(String uuidString)
- throws PlatformPcdPreprocessException {
- String temp;
- String[] splitStringArray;
- int index;
- int chIndex;
- int chLen;
-
- if (uuidString == null) {
- return null;
- }
-
- if (uuidString.length() == 0) {
- return null;
- }
-
- if (uuidString.equals("0") ||
- uuidString.equalsIgnoreCase("0x0")) {
- return new UUID(0, 0);
- }
-
- uuidString = uuidString.replaceAll("\\{", "");
- uuidString = uuidString.replaceAll("\\}", "");
-
- //
- // If the UUID schema string is GuidArrayType type then need translate
- // to GuidNamingConvention type at first.
- //
- if ((uuidString.charAt(0) == '0') && ((uuidString.charAt(1) == 'x') || (uuidString.charAt(1) == 'X'))) {
- splitStringArray = uuidString.split("," );
- if (splitStringArray.length != 11) {
- throw new PlatformPcdPreprocessException ("Wrong format for GUID string: " + uuidString);
- }
-
- //
- // Remove blank space from these string and remove header string "0x"
- //
- for (index = 0; index < 11; index++) {
- splitStringArray[index] = splitStringArray[index].trim();
- splitStringArray[index] = splitStringArray[index].substring(2, splitStringArray[index].length());
- }
-
- //
- // Add heading '0' to normalize the string length
- //
- for (index = 3; index < 11; index++) {
- chLen = splitStringArray[index].length();
- for (chIndex = 0; chIndex < 2 - chLen; chIndex++) {
- splitStringArray[index] = "0" + splitStringArray[index];
- }
- }
-
- //
- // construct the final GuidNamingConvention string
- //
- temp = String.format("%s-%s-%s-%s%s-%s%s%s%s%s%s",
- splitStringArray[0],
- splitStringArray[1],
- splitStringArray[2],
- splitStringArray[3],
- splitStringArray[4],
- splitStringArray[5],
- splitStringArray[6],
- splitStringArray[7],
- splitStringArray[8],
- splitStringArray[9],
- splitStringArray[10]);
- uuidString = temp;
- }
-
- return UUID.fromString(uuidString);
- }
-}
-
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/CommonDefinition.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/CommonDefinition.java
deleted file mode 100644
index 3cd272f719..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/CommonDefinition.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/** @file
- CommonDefinition class.
-
- This class is to define some common marcos and funcions, which used by AutoGen.
-
- 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.
-
- **/
-package org.tianocore.pcd.entity;
-
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.Set;
-
-/**
- CommonDefinition
-
- This class is to define some common marcos, which used by AutoGen.
-
-**/
-public class CommonDefinition {
- public final static String spdSuffix = ".spd";
- public final static String mbdSuffix = ".mbd";
- public final static String msaSuffix = ".msa";
- public final static String LibraryStr = "LIBRARY";
- public final static String autoGenHbegin = "extern int __make_me_compile_correctly;\r\n";
- public final static String include = "#include";
- public final static String autoGenCLine1 = "\r\n";
-
- public final static String autoGenCLine2 = "const UINT8 _gDebugPropertyMask "
- + "= DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED"
- + " | DEBUG_PROPERTY_DEBUG_PRINT_ENABLED"
- + " | DEBUG_PROPERTY_DEBUG_CODE_ENABLED;\r\n";
-
- public final static String autoGenCLine3 = "const UINTN _gModuleDefaultErrorLevel"
- + " = EFI_D_ERROR | EFI_D_LOAD;\r\n";
-
- public final static String autoGenHLine1 = "#define EFI_SPECIFICATION_VERSION 0x00020000\r\n";
- public final static String autoGenHVersionDefault = "#define EFI_SPECIFICATION_VERSION 0x00000000\r\n";
- public final static String autoGenHLine2 = "#define EDK_RELEASE_VERSION 0x00090000\r\n";
- public final static String autoGenHReleaseDefault = "#define EDK_RELEASE_VERSION 0x00000000\r\n";
-
- public final static String includeAutogenH = "#include <AutoGen.h>\r\n" ;
- public final static String marcDefineStr = "#define ";
-
- public final static String gEfi = "gEfi";
- public final static String protocolGuid = "ProtocolGuid";
- public final static String ppiGuid = "PpiGuid";
- public final static String guidGuid = "Guid";
-
- public final static String tianoR8FlashMapH = "TianoR8FlashMap.h";
- public final static String flashMapH = "FlashMap.h";
-
- //
- // AutoGen.h and AutoGen.c file's header
- //
- public final static String autogenHNotation =
- "/**\r\n" +
- " DO NOT EDIT\r\n" +
- " FILE auto-generated by GenBuild tasks\r\n" +
- " Module name:\r\n" +
- " AutoGen.h\r\n" +
- " Abstract:" +
- " Auto-generated AutoGen.h for building module or library.\r\n" +
- "**/\r\n\r\n";
-
- public final static String autogenCNotation =
- "/**\r\n" +
- " DO NOT EDIT\r\n" +
- " FILE auto-generated by GenBuild tasks\r\n" +
- " Module name:\r\n" +
- " AutoGen.c\r\n" +
- " Abstract:" +
- " Auto-generated AutoGen.c for building module or library.\r\n" +
- "**/\r\n\r\n";
-
- //
- // module type
- //
- public final static int ModuleTypeBase = 0;
- public final static int ModuleTypeSec = 1;
- public final static int ModuleTypePeiCore = 2;
- public final static int ModuleTypePeim = 3;
- public final static int ModuleTypeDxeCore = 4;
- public final static int ModuleTypeDxeDriver = 5;
- public final static int ModuleTypeDxeRuntimeDriver = 6;
- public final static int ModuleTypeDxeSmmDriver = 7;
- public final static int ModuleTypeDxeSalDriver = 8;
- public final static int ModuleTypeUefiDriver = 9;
- public final static int ModuleTypeUefiApplication = 10;
- public final static int ModuleTypeUnknown = 11;
-
-
- //
- // component type
- //
- public final static int ComponentTypeNull = 0;
- public final static int ComponentTypeApriori = 1;
- public final static int ComponentTypeSec = 2;
- public final static int ComponentTypeLibrary = 3;
- public final static int ComponentTypeFvImageFile = 4;
- public final static int ComponentTypeBsDriver = 5;
- public final static int ComponentTypeRtDriver = 6;
- public final static int ComponentTypeSalRtDriver =7;
- public final static int ComponentTypePe32Peim = 8;
- public final static int ComponentTypePicPeim =9;
- public final static int ComponentTypeCombinedPeimDriver =10;
- public final static int ComponentTypePeiCore = 11;
- public final static int ComponentTypeDxeCore = 12;
- public final static int ComponentTypeApplication = 13;
- public final static int ComponentTypeBsDriverEfi = 14;
- public final static int ComponentTypeShellApp = 15;
- public final static int ComponentTypeBinary =16;
- public final static int ComponentTypeLogo = 17;
- public final static int ComponentTypeCustomBuild = 18;
- public final static int ComponentTypeUnknown = 19;
-
-
- //
- // Usaged style
- //
- public final static String AlwaysConsumed = "ALWAYS_CONSUMED";
- public final static String AlwaysProduced = "ALWAYS_PRODUCED";
-
-
- public static class MyEnum {
- String moduleTypeStr;
- int type;
-
- MyEnum (String str, int type) {
- this.type = type;
- this.moduleTypeStr = str;
- }
-
- int ForInt(String str) {
- if (str.equals(this.moduleTypeStr)) {
- return this.type;
- } else
- return -1;
- }
- }
-
- //
- // Module type
- //
- public static final MyEnum[] moduleEnum = new MyEnum[] {
- new MyEnum("BASE", ModuleTypeBase),
- new MyEnum("SEC", ModuleTypeSec),
- new MyEnum("PEI_CORE", ModuleTypePeiCore),
- new MyEnum("PEIM", ModuleTypePeim),
- new MyEnum("DXE_CORE", ModuleTypeDxeCore),
- new MyEnum("DXE_DRIVER", ModuleTypeDxeDriver),
- new MyEnum("DXE_RUNTIME_DRIVER", ModuleTypeDxeRuntimeDriver),
- new MyEnum("DXE_SAL_DRIVER", ModuleTypeDxeSalDriver),
- new MyEnum("DXE_SMM_DRIVER", ModuleTypeDxeSmmDriver),
- new MyEnum("UEFI_DRIVER", ModuleTypeUefiDriver),
- new MyEnum("UEFI_APPLICATION", ModuleTypeUefiApplication) };
-
- //
- // Component type
- //
- public static final MyEnum[] componentEnum = new MyEnum[]{
- new MyEnum("APRIORI", ComponentTypeApriori),
- new MyEnum("SEC", ComponentTypeSec),
- new MyEnum("LIBRARY", ComponentTypeLibrary),
- new MyEnum("FV_IMAGE_FILE", ComponentTypeFvImageFile),
- new MyEnum("BS_DRIVER", ComponentTypeBsDriver),
- new MyEnum("RT_DRIVER", ComponentTypeRtDriver),
- new MyEnum("SAL_RT_DRIVER", ComponentTypeSalRtDriver),
- new MyEnum("PE32_PEIM", ComponentTypePe32Peim),
- new MyEnum("PIC_PEIM", ComponentTypePicPeim),
- new MyEnum("COMBINED_PEIM_DRIVER", ComponentTypeCombinedPeimDriver),
- new MyEnum("PEI_CORE", ComponentTypePeiCore),
- new MyEnum("DXE_CORE", ComponentTypeDxeCore),
- new MyEnum("APPLICATION", ComponentTypeApplication),
- new MyEnum("BS_DRIVER_EFI", ComponentTypeBsDriverEfi),
- new MyEnum("SHELLAPP", ComponentTypeShellApp),
- new MyEnum("BINARY", ComponentTypeBinary),
- new MyEnum("LOGO", ComponentTypeLogo),
- new MyEnum("CUSTOM_BUILD", ComponentTypeCustomBuild)
- };
-
- /**
- getModuleType
-
- This function get the module type value according module type string.
-
- @param moduleTypeStr String of modlue type.
- @return
- **/
- static public int getModuleType(String moduleTypeStr) {
- int returnValue = -1;
- for (int i = 0; i < CommonDefinition.moduleEnum.length; i++) {
- returnValue = CommonDefinition.moduleEnum[i].ForInt(moduleTypeStr);
- if (returnValue != -1) {
- return returnValue;
- }
- }
- return CommonDefinition.ModuleTypeUnknown;
- }
-
- /**
- getComponentType
-
- This function get the component type value according commponet type
- string.
-
- @param componentTypeStr String of component type.
- @return
- **/
- static public int getComponentType (String componentTypeStr){
- int returnValue = -1;
- for (int i = 0; i < CommonDefinition.componentEnum.length; i++) {
- returnValue = CommonDefinition.componentEnum[i].ForInt(componentTypeStr);
- if (returnValue != -1) {
- return returnValue;
- }
- }
- return CommonDefinition.ComponentTypeUnknown;
- }
-
- /**
- getComponentTypeString
-
- This function get the commponet type string according component type value.
-
- @param componentType Integer value of component type.
- @return
- **/
- static public String getComponentTypeString (int componentType) {
- if ((componentType > CommonDefinition.ComponentTypeUnknown) ||
- (componentType < CommonDefinition.ComponentTypeNull)) {
- return null;
- }
- for (int index = 0; index < CommonDefinition.componentEnum.length; index++) {
- if (componentType == CommonDefinition.componentEnum[index].type) {
- return CommonDefinition.componentEnum[index].moduleTypeStr;
- }
- }
- return null;
- }
-
- /**
- isLibraryComponent
-
- This function is to check does componet is library according to commponet
- type value.
-
- @param componentType Integer value of component type.
- @return
- **/
- static public boolean isLibraryComponent (int componentType) {
- if (ComponentTypeLibrary == componentType) {
- return true;
- }
- return false;
- }
-
- /**
- * formateGuidName
- *
- * This function is to formate GUID to ANSI c form.
- *
- * @param guidNameCon
- * String of GUID.
- * @return Formated GUID.
- */
- public static String formatGuidName(String guidNameConv) {
- String[] strList;
- String guid = "";
- int index = 0;
- if (guidNameConv
- .matches("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}")) {
- strList = guidNameConv.split("-");
- guid = "0x" + strList[0] + ", ";
- guid = guid + "0x" + strList[1] + ", ";
- guid = guid + "0x" + strList[2] + ", ";
- guid = guid + "{";
- guid = guid + "0x" + strList[3].substring(0, 2) + ", ";
- guid = guid + "0x" + strList[3].substring(2, 4);
-
- while (index < strList[4].length()) {
- guid = guid + ", ";
- guid = guid + "0x" + strList[4].substring(index, index + 2);
- index = index + 2;
- }
- guid = guid + "}";
- return guid;
- } else if (guidNameConv
- .matches("0x[a-fA-F0-9]{1,8},( )*0x[a-fA-F0-9]{1,4},( )*0x[a-fA-F0-9]{1,4}(,( )*\\{)?(,?( )*0x[a-fA-F0-9]{1,2}){8}( )*(\\})?")) {
- strList = guidNameConv.split(",");
-
- //
- // chang Microsoft specific form to ANSI c form
- //
- for (int i = 0; i < 3; i++) {
- guid = guid + strList[i] + ",";
- }
- guid = guid + "{";
-
- for (int i = 3; i < strList.length; i++) {
- if (i == strList.length - 1) {
- guid = guid + strList[i];
- } else {
- guid = guid + strList[i] + ",";
- }
- }
- guid = guid + "}";
- return guid;
- } else {
- System.out
- .println("Check GUID Value, it doesn't conform to the registry format specified by the schema!!!");
- return "0";
-
- }
- }
-
- /**
- * Remove deuplicat string in list
- *
- * This function is to duplicat string in list
- *
- * @param String[]
- * String list.
- * @return String[] String list which remove the duplicate string.
- */
- public static String[] remDupString (String[] orgList){
- Set<String> strList = new LinkedHashSet<String>();
- String[] desList ;
- if (orgList == null){
- return new String[0];
- }
- for (int i = 0; i < orgList.length; i++){
- strList.add(orgList[i]);
- }
- desList = new String[strList.size()];
- Iterator item = strList.iterator();
- int index = 0;
- while (item.hasNext()){
- desList[index] = (String)item.next();
- index++;
- }
- return desList;
- }
-
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java
deleted file mode 100644
index 15d003622c..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/DynamicTokenValue.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/** @file
- DynamicTokenValue class.
-
- This module contains the value type of a dynamic token.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-import java.util.List;
-import java.util.UUID;
-
-import org.tianocore.pcd.exception.EntityException;
-
-/**
- This class is to descript a value type of dynamic PCD.
- For a dynamic or dynamicEx type PCD data, the value type can be:
- 1) Hii type: the value of dynamic or dynamicEx is stored into a variable.
- 2) Vpd type: the value of dynamic or dynamicEx is stored into somewhere set
- by OEM.
- 3) Default type: the value of dynamic or dynamicEx is stored into PCD dynamic
- database.
-**/
-public class DynamicTokenValue {
- ///
- /// Enumeration macro defintion for value type.
- ///
- public static enum VALUE_TYPE {HII_TYPE, VPD_TYPE, DEFAULT_TYPE}
-
- ///
- /// The value type maybe:
- /// HII_TYPE: the value stored into variable area.
- /// VPD_TYPE: the value stored into OEM specific area.
- /// DEFAULT_TYPE: the value stored into PCD runtime database.
- ///
- public VALUE_TYPE type;
-
- ///
- /// ---------------------------------------------------------------------
- /// Following member is for HII case. The value of HII case will be put
- /// into variable area in flash.
- /// ---------------------------------------------------------------------
- ///
-
- ///
- /// variableName is valid only when this token support Hii functionality. variableName
- /// indicates the value of token is associated with what variable.
- /// variableName is defined in FPD.
- public List variableName;
-
- ///
- /// variableGuid is the GUID this token associated with.
- ///
- public UUID variableGuid;
-
- ///
- /// Variable offset indicate the associated variable's offset in NV storage.
- ///
- public String variableOffset;
-
- ///
- /// The default value for HII case.
- ///
- public String hiiDefaultValue;
-
- ///
- /// ---------------------------------------------------------------------
- /// Following member is for VPD case. The value of VPD case will be put into
- /// some flash position pointed by OEM.
- /// ---------------------------------------------------------------------
- ///
-
- public String vpdOffset;
-
- /// ---------------------------------------------------------------------
- /// Following member is for default case. The value of default type will
- /// be put into PCD runtime database.
- /// ---------------------------------------------------------------------
-
- ///
- /// The default value of this PCD in default case.
- ///
- public String value;
-
- /**
- Constructor function for DynamicTokenValue class.
-
- **/
- public DynamicTokenValue() {
- type = VALUE_TYPE.DEFAULT_TYPE;
- variableName = null;
- variableGuid = null;
- variableOffset = null;
- hiiDefaultValue = null;
- vpdOffset = null;
- value = null;
- }
-
- /**
- Set the HII case data.
-
- @param variableName The variable name
- @param variableGuid The variable guid
- @param variableOffset The offset of value in this variable
- @param hiiDefaultValue Default value for this PCD
- **/
- public void setHiiData(List variableName,
- UUID variableGuid,
- String variableOffset,
- String hiiDefaultValue) {
- this.type = VALUE_TYPE.HII_TYPE;
-
- this.variableName = variableName;
- this.variableGuid = variableGuid;
- this.variableOffset = variableOffset;
- this.hiiDefaultValue = hiiDefaultValue;
- }
-
- /**
- Get the variable Name.
-
- @return String
- **/
- public List getStringOfVariableName() {
- return variableName;
- }
-
- /**
- Set Vpd case data.
-
- @param vpdOffset the value offset the start address of OEM specific.
- **/
- public void setVpdData(String vpdOffset) {
- this.type = VALUE_TYPE.VPD_TYPE;
-
- this.vpdOffset = vpdOffset;
- }
-
- /**
- Set default case data.
-
- @param value
- **/
- public void setValue(String value) {
- this.type = VALUE_TYPE.DEFAULT_TYPE;
-
- this.value = value;
- }
-}
-
-
-
-
-
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/MemoryDatabaseManager.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/MemoryDatabaseManager.java
deleted file mode 100644
index f7c08f5330..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/MemoryDatabaseManager.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/** @file
- MemoryDatabaseManager class.
-
- Database hold all PCD information comes from SPD, MSA, FPD file in memory.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.tianocore.pcd.entity.UsageIdentification;
-import org.tianocore.pcd.exception.EntityException;
-
-/**
- Database hold all PCD information comes from SPD, MSA, FPD file in memory.
-**/
-public class MemoryDatabaseManager {
- ///
- /// Memory database. The string "cName + SpaceNameGuid" is primary key.
- /// memory database is in global scope, and it will be used for others PCD tools.
- ///
- private static Map<String, Token> memoryDatabase = null;
-
- ///
- /// Before build a module, the used libary will be build firstly, the PCD of these
- /// library is inheritted by the module, so stored module's PCD information as PCD
- /// context of building libary.
- ///
- public static List<UsageInstance> UsageInstanceContext = null;
-
- ///
- /// Current module name, if now is buiding library, this value indicate this library
- /// is for building what module.
- ///
- public static String CurrentModuleName = null;
-
- ///
- /// String for PCD PEIM and DXE autogen file
- ///
- public static String PcdPeimHString = "";
- public static String PcdPeimCString = "";
- public static String PcdDxeHString = "";
- public static String PcdDxeCString = "";
-
- /**
- Constructure function
- **/
- public MemoryDatabaseManager() {
- //
- // Allocate memory for new database in global scope.
- //
- if (memoryDatabase == null) {
- memoryDatabase = new HashMap<String, Token>();
- }
- }
-
- /**
- Judege whether token exists in memory database
-
- @param primaryKey the primaryKey for searching token
-
- @retval TRUE - token already exist in database.
- @retval FALSE - token does not exist in database.
- **/
- public boolean isTokenInDatabase(String primaryKey) {
- return (memoryDatabase.get(primaryKey) != null);
- }
-
- /**
- Add a pcd token into memory database.
-
- @param primaryKey the primary key for searching token
- @param token token instance
- **/
- public void addTokenToDatabase(String primaryKey, Token token) {
- memoryDatabase.put(primaryKey, token);
- }
-
- /**
- Get a token instance from memory database with primary key.
-
- @param primaryKey the primary key for searching token
-
- @return token instance.
- **/
- public Token getTokenByKey(String primaryKey) {
- return memoryDatabase.get(primaryKey);
- }
-
- /**
- Get the number of PCD token record in memory database.
-
- @return the number of PCD token record in memory database.
- **/
- public int getDBSize() {
- return memoryDatabase.size();
- }
-
- /**
- Get the token record array contained all PCD token in memory database.
-
- @return the token record array contained all PCD token in memory database.
- **/
- public Token[] getRecordArray() {
- Token[] tokenArray = null;
- Object[] dataArray = null;
- Map.Entry entry = null;
- int index = 0;
- int size = 0;
-
- if (memoryDatabase == null) {
- return null;
- }
- dataArray = memoryDatabase.entrySet().toArray();
- size = memoryDatabase.size();
- tokenArray = new Token[memoryDatabase.size()];
- for (index = 0; index < size; index++) {
- entry =(Map.Entry) dataArray [index];
- tokenArray[index] =(Token) entry.getValue();
- }
- return tokenArray;
- }
-
- /**
- Get record array only contains DYNAMIC or DYNAMIC_EX type PCD.
-
- @return ArrayList the array list contains all dynamic type PCD.
- **/
- private ArrayList getDynamicRecordArray() {
- Token[] tokenArray = getRecordArray();
- int index = 0;
- ArrayList<Token> al = new ArrayList<Token>();
-
- for (index = 0; index < tokenArray.length; index++) {
- if (tokenArray[index].isDynamicPCD) {
- al.add(tokenArray[index]);
- }
- }
-
- return al;
- }
-
-
- /**
- Get the token record array contained all PCD token referenced by PEI phase.
- The output array is sorted based on descending order of the size of alignment for each feilds.
-
- @return the token record array contained all PCD token referenced in PEI phase.
- @throws EntityException
- **/
- public void getTwoPhaseDynamicRecordArray(ArrayList<Token> pei, ArrayList<Token> dxe)
- throws EntityException {
- int usageInstanceIndex = 0;
- int index = 0;
- ArrayList tokenArrayList = getDynamicRecordArray();
- Object[] usageInstanceArray = null;
- UsageInstance usageInstance = null;
- int size = 0;
- int consumerSize = 0;
-
- size = tokenArrayList.size();
- for (index = 0; index < size; index++) {
- boolean found = false;
- Token token = (Token) tokenArrayList.get(index);
- if (token.consumers != null) {
- usageInstanceArray = token.consumers.entrySet().toArray();
- consumerSize = token.consumers.size();
- for (usageInstanceIndex = 0; usageInstanceIndex < consumerSize; usageInstanceIndex++) {
- usageInstance =(UsageInstance) (((Map.Entry)usageInstanceArray[usageInstanceIndex]).getValue());
- if (usageInstance.isPeiPhaseComponent()) {
- pei.add(token);
- found = true;
- break;
- }
- }
- }
-
- //
- // If no PEI components reference the PCD entry,
- // we check if it is referenced in DXE driver.
- //
- if (!found) {
- if (token.consumers != null) {
- usageInstanceArray = token.consumers.entrySet().toArray();
- consumerSize = token.consumers.size();
- for (usageInstanceIndex = 0; usageInstanceIndex < consumerSize; usageInstanceIndex++) {
- usageInstance =(UsageInstance) (((Map.Entry)usageInstanceArray[usageInstanceIndex]).getValue());
- if (usageInstance.isDxePhaseComponent()) {
- dxe.add(token);
- found = true;
- break;
- }
- }
- }
-
- if (!found) {
- if (token.isDynamicPCD && token.consumers.size() == 0) {
- dxe.add(token);
- } else {
- //
- // We only support Dynamice(EX) type for PEI and DXE phase.
- // If it is not referenced in either PEI or DXE, throw exception now.
- //
- throw new EntityException("[PCD Tool Internal Error] Dynamic(EX) PCD Entries are referenced in a module that is not used in either PEI or DXE phases.");
- }
- }
- }
- }
- }
-
- public void clearDatabase() {
- memoryDatabase.clear();
- }
-
- /**
- Get all PCD token for a usage instance according to primary key.
-
- @param primaryKey the primary key of usage instance.
-
- @return List<UsageInstance> the list contains all usage instances.
- **/
- public List<UsageInstance> getUsageInstanceArrayById(UsageIdentification usageId) {
- Token[] tokenArray = null;
- int recordIndex = 0;
- UsageInstance usageInstance = null;
- List<UsageInstance> returnArray = new ArrayList<UsageInstance>();
- String primaryKey = usageId.toString();
-
- tokenArray = getRecordArray();
-
- //
- // Loop to find all PCD record related to current module
- //
- for (recordIndex = 0; recordIndex < getDBSize(); recordIndex++) {
- if (tokenArray[recordIndex].consumers.size() != 0) {
- usageInstance = tokenArray[recordIndex].consumers.get(primaryKey);
- if (usageInstance != null) {
- returnArray.add(usageInstance);
- }
- }
- }
-
- return returnArray;
- }
-
- public List<Token> getPcdTokenListForModule(UsageIdentification usageId) {
- List<UsageInstance> usageList = getUsageInstanceArrayById(usageId);
- List<Token> tokenList = new ArrayList<Token>();
-
- if (usageList == null) {
- return null;
- }
-
- for (int usageIndex = 0; usageIndex < usageList.size(); usageIndex++) {
- tokenList.add(usageList.get(usageIndex).parentToken);
- }
-
- return tokenList;
- }
-
- /**
- Get all modules name who contains PCD information
-
- @return Array for usage's identification
- **/
- public List<UsageIdentification> getAllModuleArray()
- {
- int tokenIndex = 0;
- int usageIndex = 0;
- int moduleIndex = 0;
- Token[] tokenArray = null;
- Object[] usageInstanceArray = null;
- List<UsageIdentification> usageArray = new ArrayList<UsageIdentification>();
- UsageInstance usageInstance = null;
- boolean bFound = false;
- String primaryKey = null;
-
- tokenArray = getRecordArray();
- //
- // Find all consumer usage instance for retrieving module's name
- //
- for (tokenIndex = 0; tokenIndex < getDBSize(); tokenIndex++) {
- usageInstanceArray = tokenArray[tokenIndex].consumers.entrySet().toArray();
- for (usageIndex = 0; usageIndex < tokenArray[tokenIndex].consumers.size(); usageIndex++) {
- usageInstance = (UsageInstance)((Map.Entry)usageInstanceArray[usageIndex]).getValue();
- primaryKey = usageInstance.getPrimaryKey();
- bFound = false;
- for (moduleIndex = 0; moduleIndex < usageArray.size(); moduleIndex++) {
- if (usageArray.get(moduleIndex).toString().equalsIgnoreCase(primaryKey)) {
- bFound = true;
- break;
- }
- }
- if (!bFound) {
- usageArray.add(usageInstance.usageId);
- }
- }
- }
- return usageArray;
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/ModulePcdInfoFromFpd.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/ModulePcdInfoFromFpd.java
deleted file mode 100644
index fe9f7ecabc..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/ModulePcdInfoFromFpd.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/** @file
- ModulePcdInfoFromFpd class.
-
- The interface parameter from <ModuleSA>'s Pcd information got from global data.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-import org.tianocore.PcdBuildDefinitionDocument;
-import org.tianocore.PcdBuildDefinitionDocument.PcdBuildDefinition;
-import org.apache.xmlbeans.XmlObject;
-
-/**
- PCD build information in <ModuleSA> in FPD file.
-**/
-public class ModulePcdInfoFromFpd {
- ///
- /// Usage identification for a module
- ///
- public UsageIdentification usageId;
-
- ///
- /// <ModuleSA>'s <PcdBuildDefinition> information.
- ///
- public PcdBuildDefinition pcdBuildDefinition;
-
- /**
- Construct function.
-
- @param usageId The usage instance's identification
- @param pcdBuildDefinition The <PcdBuildDefinition> information in <ModuleSA> in FPD file.
-
- **/
- public ModulePcdInfoFromFpd(UsageIdentification usageId,
- PcdBuildDefinition pcdBuildDefinition) {
- this.usageId = usageId;
- this.pcdBuildDefinition = pcdBuildDefinition;
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/SkuInstance.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/SkuInstance.java
deleted file mode 100644
index 6e666ba84f..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/SkuInstance.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/** @file
- SkuInstance class.
-
- Sku instance contains ID and value, A pcd token maybe contains more than one Sku instance.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-/**
- Sku instance contains ID and value, A pcd token maybe contains more than one Sku instance.
-**/
-public class SkuInstance {
- ///
- /// The id number of this SKU instance
- ///
- public int id;
-
- ///
- /// The value of this SKU instance
- ///
- public DynamicTokenValue value;
-
- /**
- Constructure function
-
- @param id sku id
- @param value sku value for this id.
- **/
- public SkuInstance(int id, DynamicTokenValue value) {
- this.id = id;
- this.value = value;
- }
-
- /**
- Default constructor function.
- **/
- public SkuInstance() {
- this.id = 0;
- this.value = new DynamicTokenValue();
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/Token.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/Token.java
deleted file mode 100644
index 74f55ddec3..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/Token.java
+++ /dev/null
@@ -1,960 +0,0 @@
-/** @file
- Token class.
-
- This module contains all classes releted to PCD token.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-import java.math.BigInteger;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- This class is to descript a PCD token object. The information of a token mainly
- comes from MSA, SPD and setting produced by platform developer.
-**/
-public class Token {
- ///
- /// Enumeration macro defintion for PCD type.
- ///
- public static enum PCD_TYPE {FEATURE_FLAG, FIXED_AT_BUILD, PATCHABLE_IN_MODULE, DYNAMIC,
- DYNAMIC_EX, UNKNOWN}
-
- ///
- /// Enumeration macro definition for datum type. All type mainly comes from ProcessBind.h.
- /// Wizard maybe expand this type as "int, unsigned int, short, unsigned short etc" in
- /// prompt dialog.
- ///
- public static enum DATUM_TYPE {UINT8, UINT16, UINT32, UINT64, BOOLEAN, POINTER, UNKNOWN}
-
- ///
- /// Enumeration macor defintion for usage of PCD
- ///
- public static enum PCD_USAGE {ALWAYS_PRODUCED, ALWAYS_CONSUMED, SOMETIMES_PRODUCED,
- SOMETIMES_CONSUMED, UNKNOWN}
-
- ///
- /// cName is to identify a PCD entry and will be used for generating autogen.h/autogen.c.
- /// cName will be defined in MSA, SPD and FPD, can be regarded as primary key with token space guid.
- ///
- public String cName;
-
- ///
- /// Token space name is the guid defined by token itself in package or module level. This
- /// name mainly for DynamicEx type. For other PCD type token, his token space name is the
- /// assignedtokenSpaceName as follows.
- /// tokenSpaceName is defined in MSA, SPD, FPD, can be regarded as primary key with cName.
- ///
- public String tokenSpaceName;
-
- ///
- /// tokenNumber is allocated by platform. tokenNumber indicate an index for this token in
- /// platform token space. For Dynamic, dynamicEx type, this number will be re-adjust by
- /// PCD run-time database autogen tools.
- ///
- public long tokenNumber;
-
- ///
- /// This token number is retrieved from FPD file for DynamicEx type.
- ///
- public long dynamicExTokenNumber;
-
- ///
- /// All supported PCD type, this value can be retrieved from SPD
- /// Currently, only record all PCD type for this token in FPD file.
- ///
- public List<PCD_TYPE> supportedPcdType;
-
- ///
- /// If the token's item type is Dynamic or DynamicEx type, isDynamicPCD
- /// is true.
- ///
- public boolean isDynamicPCD;
-
- ///
- /// datumSize is to descript the fix size or max size for this token.
- /// datumSize is defined in SPD.
- ///
- public int datumSize;
-
- ///
- /// datum type is to descript what type can be expressed by a PCD token.
- /// For same PCD used in different module, the datum type should be unique.
- /// So it belong memeber to Token class.
- ///
- public DATUM_TYPE datumType;
-
- ///
- /// skuData contains all value for SkuNumber of token.
- /// This field is for Dynamic or DynamicEx type PCD,
- ///
- public List<SkuInstance> skuData;
-
- ///
- /// consumers array record all module private information who consume this PCD token.
- ///
- public Map<String, UsageInstance> consumers;
-
- /**
- Constructure function for Token class
-
- @param cName The name of token
- @param tokenSpaceName The name of token space, it is a guid string
- **/
- public Token(String cName, String tokenSpaceName) {
- this.cName = cName;
- this.tokenSpaceName = tokenSpaceName;
- this.tokenNumber = 0;
- this.datumType = DATUM_TYPE.UNKNOWN;
- this.datumSize = -1;
- this.skuData = new ArrayList<SkuInstance>();
-
- this.consumers = new HashMap<String, UsageInstance>();
- this.supportedPcdType = new ArrayList<PCD_TYPE>();
- }
-
- /**
- updateSupportPcdType
-
- SupportPcdType should be gotten from SPD file actually, but now it just
- record all PCD type for this token in FPD file.
-
- @param pcdType new PCD type found in FPD file for this token.
- **/
- public void updateSupportPcdType(PCD_TYPE pcdType) {
- int size = supportedPcdType.size();
- for (int index = 0; index < size; index++) {
- if (supportedPcdType.get(index) == pcdType) {
- return;
- }
- }
-
- //
- // If not found, add the pcd type to member variable supportedPcdType
- //
- supportedPcdType.add(pcdType);
- }
-
- /**
- Judge whether pcdType is belong to dynamic type. Dynamic type includes
- DYNAMIC and DYNAMIC_EX.
-
- @param pcdType the judged pcd type
-
- @return boolean
- **/
- public static boolean isDynamic(PCD_TYPE pcdType) {
- if ((pcdType == PCD_TYPE.DYNAMIC ) ||
- (pcdType == PCD_TYPE.DYNAMIC_EX)) {
- return true;
- }
-
- return false;
- }
-
- /**
- The pcd type is DynamicEx?
-
- @retval true Is DynamicEx type
- @retval false not DynamicEx type
- **/
- public boolean isDynamicEx() {
- int size = supportedPcdType.size();
- for (int i = 0; i < size; i++) {
- if (supportedPcdType.get(i) == PCD_TYPE.DYNAMIC_EX) {
- return true;
- }
- }
-
- return false;
- }
-
- /**
- Use "TokencName + "-" + SpaceTokenName" as primary key when adding token into database
-
- @param cName Token name.
- @param tokenSpaceName The token space guid string defined in MSA or SPD
-
- @retval primary key for this token in token database.
- **/
- public static String getPrimaryKeyString(String cName, String tokenSpaceName) {
- if (tokenSpaceName == null) {
- return cName + "_nullTokenSpaceGuid";
- } else {
- return cName + "_" + tokenSpaceName.toString().replace('-', '_').toLowerCase();
- }
- }
-
- /**
- If skudata list contains more than one data, then Sku mechanism is enable.
-
- @retval boolean if the number of sku data exceed to 1
- **/
- public boolean isSkuEnable() {
- if (this.skuData.size() > 1) {
- return true;
- }
- return false;
- }
-
- /**
- If Hii type for value of token
-
- @return boolean
- **/
- public boolean isHiiEnable() {
- if (getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.HII_TYPE) {
- return true;
- }
- return false;
- }
-
- /**
- If Vpd type for value of token
-
- @return boolean
- **/
- public boolean isVpdEnable() {
- if (getDefaultSku().type == DynamicTokenValue.VALUE_TYPE.VPD_TYPE) {
- return true;
- }
- return false;
- }
-
- /**
- Get the token primary key in token database.
-
- @return String
- **/
- public String getPrimaryKeyString () {
- return Token.getPrimaryKeyString(cName, tokenSpaceName);
- }
-
- /**
- Judge datumType is valid
-
- @param type The datumType want to be judged.
-
- @retval TRUE - The type is valid.
- @retval FALSE - The type is invalid.
- **/
- public static boolean isValiddatumType(DATUM_TYPE type) {
- if ((type.ordinal() < DATUM_TYPE.UINT8.ordinal() ) ||
- (type.ordinal() > DATUM_TYPE.POINTER.ordinal())) {
- return false;
- }
- return true;
- }
-
- /**
- Judge pcdType is valid
-
- @param type The PCdType want to be judged.
-
- @retval TRUE - The type is valid.
- @retval FALSE - The type is invalid.
- **/
- public static boolean isValidpcdType(PCD_TYPE type) {
- if ((type.ordinal() < PCD_TYPE.FEATURE_FLAG.ordinal() ) ||
- (type.ordinal() > PCD_TYPE.DYNAMIC_EX.ordinal())) {
- return false;
- }
- return true;
- }
-
- /**
- Add an usage instance for token
-
- @param usageInstance The usage instance
-
- @retval TRUE - Success to add usage instance.
- @retval FALSE - Fail to add usage instance
- **/
- public boolean addUsageInstance(UsageInstance usageInstance) {
- if (isUsageInstanceExist(usageInstance.usageId)) {
- return false;
- }
-
- //
- // Put usage instance into usage instance database of this PCD token.
- //
- consumers.put(usageInstance.getPrimaryKey(), usageInstance);
-
- return true;
- }
-
- /**
- Judge whether exist an usage instance for this token
-
- @param usageId The UsageInstance identification for usage instance
-
- @return boolean whether exist an usage instance for this token.
- **/
- public boolean isUsageInstanceExist(UsageIdentification usageId) {
- String keyStr = UsageInstance.getPrimaryKey(usageId);
-
- return (consumers.get(keyStr) != null);
- }
-
- /**
- Get the PCD_TYPE according to the string of PCD_TYPE
-
- @param pcdTypeStr The string of PCD_TYPE
-
- @return PCD_TYPE
- **/
- public static PCD_TYPE getPcdTypeFromString(String pcdTypeStr) {
- if (pcdTypeStr == null) {
- return PCD_TYPE.UNKNOWN;
- }
-
- if (pcdTypeStr.equalsIgnoreCase("FEATURE_FLAG")) {
- return PCD_TYPE.FEATURE_FLAG;
- } else if (pcdTypeStr.equalsIgnoreCase("FIXED_AT_BUILD")) {
- return PCD_TYPE.FIXED_AT_BUILD;
- } else if (pcdTypeStr.equalsIgnoreCase("PATCHABLE_IN_MODULE")) {
- return PCD_TYPE.PATCHABLE_IN_MODULE;
- } else if (pcdTypeStr.equalsIgnoreCase("DYNAMIC")) {
- return PCD_TYPE.DYNAMIC;
- } else if (pcdTypeStr.equalsIgnoreCase("DYNAMIC_EX")) {
- return PCD_TYPE.DYNAMIC_EX;
- } else {
- return PCD_TYPE.UNKNOWN;
- }
- }
-
- /**
- Get the string of given datumType. This string will be used for generating autogen files
-
- @param datumType Given datumType
-
- @return The string of datum type.
- **/
- public static String getStringOfdatumType(DATUM_TYPE datumType) {
- return datumType.toString();
- }
-
- /**
- Get the datumType according to a string.
-
- @param datumTypeStr The string of datumType
-
- @return DATUM_TYPE
- **/
- public static DATUM_TYPE getdatumTypeFromString(String datumTypeStr) {
- if (datumTypeStr.equalsIgnoreCase("UINT8")) {
- return DATUM_TYPE.UINT8;
- } else if (datumTypeStr.equalsIgnoreCase("UINT16")) {
- return DATUM_TYPE.UINT16;
- } else if (datumTypeStr.equalsIgnoreCase("UINT32")) {
- return DATUM_TYPE.UINT32;
- } else if (datumTypeStr.equalsIgnoreCase("UINT64")) {
- return DATUM_TYPE.UINT64;
- } else if (datumTypeStr.equalsIgnoreCase("VOID*")) {
- return DATUM_TYPE.POINTER;
- } else if (datumTypeStr.equalsIgnoreCase("BOOLEAN")) {
- return DATUM_TYPE.BOOLEAN;
- }
- return DATUM_TYPE.UNKNOWN;
- }
-
- /**
- Get string of given pcdType
-
- @param pcdType The given PcdType
-
- @return The string of PCD_TYPE.
- **/
- public static String getStringOfpcdType(PCD_TYPE pcdType) {
- return pcdType.toString();
- }
-
- /**
- Get the PCD_USAGE according to a string
-
- @param usageStr The string of PCD_USAGE
-
- @return The PCD_USAGE
- **/
- public static PCD_USAGE getUsageFromString(String usageStr) {
- if (usageStr == null) {
- return PCD_USAGE.UNKNOWN;
- }
-
- if (usageStr.equalsIgnoreCase("ALWAYS_PRODUCED")) {
- return PCD_USAGE.ALWAYS_PRODUCED;
- } else if (usageStr.equalsIgnoreCase("SOMETIMES_PRODUCED")) {
- return PCD_USAGE.SOMETIMES_PRODUCED;
- } else if (usageStr.equalsIgnoreCase("ALWAYS_CONSUMED")) {
- return PCD_USAGE.ALWAYS_CONSUMED;
- } else if (usageStr.equalsIgnoreCase("SOMETIMES_CONSUMED")) {
- return PCD_USAGE.SOMETIMES_CONSUMED;
- }
-
- return PCD_USAGE.UNKNOWN;
- }
-
- /**
- Get the string of given PCD_USAGE
-
- @param usage The given PCD_USAGE
-
- @return The string of PDC_USAGE.
- **/
- public static String getStringOfUsage(PCD_USAGE usage) {
- return usage.toString();
- }
-
- /**
- Get the Defined datumType string for autogen. The string is for generating some MACROs in Autogen.h
-
- @param datumType The given datumType
-
- @return string of datum type for autogen.
- **/
- public static String GetAutogenDefinedatumTypeString(DATUM_TYPE datumType) {
- switch (datumType) {
-
- case UINT8:
- return "8";
- case UINT16:
- return "16";
- case BOOLEAN:
- return "BOOL";
- case POINTER:
- return "PTR";
- case UINT32:
- return "32";
- case UINT64:
- return "64";
- default:
- return null;
- }
- }
-
- /**
- Get the datumType String for Autogen. This string will be used for generating defintions of PCD token in autogen
-
- @param datumType The given datumType
-
- @return string of datum type.
- **/
-
- public static String getAutogendatumTypeString(DATUM_TYPE datumType) {
- switch (datumType) {
- case UINT8:
- return "UINT8";
- case UINT16:
- return "UINT16";
- case UINT32:
- return "UINT32";
- case UINT64:
- return "UINT64";
- case POINTER:
- return "VOID*";
- case BOOLEAN:
- return "BOOLEAN";
- }
- return null;
- }
-
- /**
- Get the datumType string for generating some MACROs in autogen file of Library
-
- @param datumType The given datumType
-
- @return String of datum for genrating bit charater.
- **/
- public static String getAutogenLibrarydatumTypeString(DATUM_TYPE datumType) {
- switch (datumType) {
- case UINT8:
- return "8";
- case UINT16:
- return "16";
- case BOOLEAN:
- return "Bool";
- case POINTER:
- return "Ptr";
- case UINT32:
- return "32";
- case UINT64:
- return "64";
- default:
- return null;
- }
- }
-
- /**
- Get the sku data who id is 0.
-
- @retval DynamicTokenValue the value of this dyanmic token.
- **/
- public DynamicTokenValue getDefaultSku() {
- int index;
- int size = skuData.size();
- for (index = 0; index < size; index++) {
- if (skuData.get(index).id == 0) {
- return skuData.get(index).value;
- }
- }
-
- return null;
- }
-
- /**
- Get the number of Sku data for this token
-
- @retval int the number of sku data
- **/
- public int getSkuIdCount () {
- return this.skuData.size();
- }
-
- /**
- Get the size of PCD value, this PCD is POINTER type.
-
- @param str the string of the value
- @param al the array list for outer parameter.
- **/
- private void getCurrentSizeFromDefaultValue (String str, ArrayList<Integer> al) {
- if (isValidNullValue(str)) {
- al.add(new Integer(0));
- } else {
- //
- // isValidNullValue has already make sure that str here
- // always contain a valid default value of the following 3
- // cases:
- // 1) "Hello world" //Assci string
- // 2) L"Hello" //Unicode string
- // 3) {0x01, 0x02, 0x03} //Byte stream
- //
- if (str.startsWith("\"")) {
- al.add(new Integer(str.length() - 2));
- } else if (str.startsWith("L\"")){
- //
- // Unicode is 2 bytes each.
- //
- al.add(new Integer((str.length() - 3) * 2));
- } else if (str.startsWith("{")) {
- //
- // We count the number of "," in the string.
- // The number of byte is one plus the number of
- // comma.
- //
- String str2 = str;
-
- int cnt = 0;
- int pos = 0;
- pos = str2.indexOf(",", 0);
- while (pos != -1) {
- cnt++;
- pos++;
- pos = str2.indexOf(",", pos);
- }
- cnt++;
- al.add(new Integer(cnt));
- }
- }
- }
-
- /**
- This method can be used to get the MAX and current size
- for pointer type dynamic(ex) PCD entry
- **/
- public ArrayList<Integer> getPointerTypeSize () {
- ArrayList<Integer> al = new ArrayList<Integer>();
-
- //
- // For VPD_enabled and HII_enabled, we can only return the MAX size.
- // For the default DATA type dynamic PCD entry, we will return
- // the MAX size and current size for each SKU_ID.
- //
- al.add(new Integer(this.datumSize));
-
- if (!this.isVpdEnable()) {
- int idx;
- if (this.isHiiEnable()){
- for (idx = 0; idx < this.skuData.size(); idx++) {
- String str = this.skuData.get(idx).value.hiiDefaultValue;
- getCurrentSizeFromDefaultValue(str, al);
- }
- } else {
- for (idx = 0; idx < this.skuData.size(); idx++) {
- String str = this.skuData.get(idx).value.value;
- getCurrentSizeFromDefaultValue(str, al);
- }
- }
- }
-
- return al;
- }
-
- /**
- Get default value for a token, For HII type, HiiDefaultValue of default
- SKU 0 will be returned; For Default type, the defaultvalue of default SKU
- 0 will be returned.
-
- @return String get the default value for a DYNAMIC type PCD.
- **/
- public String getDynamicDefaultValue() {
- DynamicTokenValue dynamicData = getDefaultSku();
- if (hasDefaultValue()) {
- switch (dynamicData.type) {
- case DEFAULT_TYPE:
- return dynamicData.value;
- }
- }
-
- return null;
- }
-
- /**
- Judge whether a DYNAMIC PCD has default value.
-
- @return whether a DYNAMIC PCD has default value.
- **/
- public boolean hasDefaultValue () {
- DynamicTokenValue dynamicValue = null;
-
- if (isSkuEnable()) {
- return true;
- }
-
- if (this.isDynamicPCD) {
- dynamicValue = getDefaultSku();
- switch (dynamicValue.type) {
- case HII_TYPE:
- return true;
- case VPD_TYPE:
- return true;
- case DEFAULT_TYPE:
- return !isValidNullValue(dynamicValue.value);
- }
- }
-
- return false;
- }
-
- /**
- Judge the value is NULL value. NULL value means the value is uninitialized value
-
- @param judgedValue the want want to be judged
-
- @return boolean whether the value of PCD is NULL.
- **/
- public boolean isValidNullValue(String judgedValue) {
- String subStr;
- BigInteger bigIntValue;
-
- switch (datumType) {
- case UINT8:
- case UINT16:
- case UINT32:
- if (judgedValue.length() > 2) {
- if ((judgedValue.charAt(0) == '0') &&
- ((judgedValue.charAt(1) == 'x') || (judgedValue.charAt(1) == 'X'))){
- subStr = judgedValue.substring(2, judgedValue.length());
- bigIntValue = new BigInteger(subStr, 16);
- } else {
- bigIntValue = new BigInteger(judgedValue);
- }
- } else {
- bigIntValue = new BigInteger(judgedValue);
- }
- if (bigIntValue.bitCount() == 0) {
- return true;
- }
- break;
- case UINT64:
- if (judgedValue.length() > 2){
- if ((judgedValue.charAt(0) == '0') &&
- ((judgedValue.charAt(1) == 'x') ||
- (judgedValue.charAt(1) == 'X'))) {
- bigIntValue = new BigInteger(judgedValue.substring(2, judgedValue.length()), 16);
- if (bigIntValue.bitCount() == 0) {
- return true;
- }
- } else {
- bigIntValue = new BigInteger(judgedValue);
- if (bigIntValue.bitCount() == 0) {
- return true;
- }
- }
- } else {
- bigIntValue = new BigInteger(judgedValue);
- if (bigIntValue.bitCount() == 0) {
- return true;
- }
- }
- break;
- case BOOLEAN:
- if (judgedValue.equalsIgnoreCase("false")) {
- return true;
- }
- break;
- case POINTER:
- if (judgedValue.equalsIgnoreCase("\"\"") ||
- judgedValue.equalsIgnoreCase("L\"\"") ||
- (judgedValue.length() == 0)) {
- return true;
- } else if (judgedValue.trim().charAt(0) == '{') {
- int start = judgedValue.indexOf('{');
- int end = judgedValue.lastIndexOf('}');
- String[] strValueArray = judgedValue.substring(start + 1, end).split(",");
- if (strValueArray.length > 1) {
- return false;
- } else {
- if (strValueArray[0].matches("(0x)?(0X)?0*")) {
- return true;
- }
- }
- }
- }
- return false;
- }
-
- /**
- Is the string value in Unicode
-
- @return boolean the string value is UNICODE type string.
- **/
- public boolean isHiiDefaultValueUnicodeStringType() {
- DynamicTokenValue dynamicData = getDefaultSku();
-
- if (dynamicData == null)
- return false;
-
- return dynamicData.hiiDefaultValue.startsWith("L\"")
- && dynamicData.hiiDefaultValue.endsWith("\"");
- }
-
- /**
- Is the string value in ANSCI
-
- @return boolean whether the dfault value for HII case is string type.
- **/
- public boolean isHiiDefaultValueASCIIStringType() {
- DynamicTokenValue dynamicData = getDefaultSku();
-
- if (dynamicData == null)
- return false;
-
- return dynamicData.hiiDefaultValue.startsWith("\"")
- && dynamicData.hiiDefaultValue.endsWith("\"");
- }
-
- /**
- Judege whether current value is UNICODE string type.
-
- @return boolean whether the value is UNICODE string.
- **/
- public boolean isUnicodeStringType () {
- String str = getDynamicDefaultValue();
-
- if (str == null) {
- return false;
- }
-
- if (datumType == Token.DATUM_TYPE.POINTER &&
- str.startsWith("L\"") &&
- str.endsWith("\"")) {
- return true;
- }
-
- return false;
- }
-
- /**
- Judge whether the string type is ANSIC string.
-
- @return boolean whether the string type is ANSIC string
- **/
- public boolean isASCIIStringType () {
- String str = getDynamicDefaultValue();
-
- if (str == null) {
- return false;
- }
-
- if (datumType == Token.DATUM_TYPE.POINTER &&
- str.startsWith("\"") &&
- str.endsWith("\"")) {
- return true;
- }
-
- return false;
- }
-
- /**
- Judge whether the string value is byte array.
-
- @return boolean whether the string value is byte array.
-
- **/
- public boolean isByteStreamType () {
- String str = getDynamicDefaultValue();
-
- if (str == null) {
- return false;
- }
-
- if (datumType == Token.DATUM_TYPE.POINTER &&
- str.startsWith("{") &&
- str.endsWith("}")) {
- return true;
- }
-
- return false;
-
- }
-
- /**
- Get string value for ANSIC string type
-
- @return String the string value
- **/
- public String getStringTypeString () {
- return getDefaultSku().value.substring(2, getDefaultSku().value.length() - 1);
- }
-
- /**
- Judge whether a datum string is byte array.
-
- @param datum datum string
-
- @return boolean true - is byte array, false - not byte array
- **/
- public static boolean isByteArrayDatum(String datum) {
- if (datum == null) {
- return false;
- }
-
- String trimedStr = datum.trim();
-
- if (trimedStr.length() == 0) {
- return false;
- }
-
- if (trimedStr.startsWith("{") &&
- trimedStr.endsWith("}")) {
- return true;
- }
-
- return false;
- }
-
- /**
- Judge whether a datum string is unicode.
-
- @param datum datum string
-
- @return boolean true - is unicode, false - not unicode
- **/
- public static boolean isUnicodeDatum(String datum) {
- if (datum == null) {
- return false;
- }
-
- String trimedStr = datum.trim();
- if (trimedStr.length() == 0) {
- return false;
- }
-
- if (trimedStr.startsWith("L") &&
- trimedStr.charAt(1) == '"' &&
- trimedStr.endsWith("\"")) {
- return true;
- }
-
- return false;
- }
-
- /**
- Judge whether a datum string is ANSCI string.
-
- @param datum datum string
-
- @return boolean true - is ANSIC, false - not ANSIC
- **/
- public static boolean isAnsciDatum(String datum) {
- if (datum == null) {
- return false;
- }
-
- String trimedStr = datum.trim();
-
- if (trimedStr.length() == 0) {
- return false;
- }
-
- if (datum.startsWith("\"") &&
- datum.endsWith("\"")) {
- return true;
- }
-
- return false;
- }
-
- /**
- Get byte array string for POINTER type Datum.
-
- @param datum the datum whose type is POINTER
-
- @return String the byte array string
- **/
- public String getByteArrayForPointerDatum(String datum) {
- String byteArray = "{";
-
- if (datumType != Token.DATUM_TYPE.POINTER) {
- return null;
- }
-
- if (Token.isAnsciDatum(datum)) {
- String trimedStr = datum.trim();
- trimedStr = trimedStr.substring(1, trimedStr.length() - 1);
- char charArray[] = trimedStr.toCharArray();
- for (int index = 0; index < charArray.length; index++) {
- byteArray += String.format("0x%02x ", (byte)charArray[index]);
- if (index != (charArray.length - 1)) {
- byteArray += ",";
- }
- }
- } else if (Token.isUnicodeDatum(datum)) {
- String trimedStr = datum.trim();
- trimedStr = trimedStr.substring(2, trimedStr.length() - 1);
- for (int index = 0; index < trimedStr.length(); index++) {
- short unicodeVal = (short)trimedStr.codePointAt(index);
- byteArray += String.format("0x%02x, 0x%02x",
- (byte)unicodeVal,
- (byte)((unicodeVal & 0xFF00) >> 8));
- if (index != (trimedStr.length() - 1)) {
- byteArray += " ,";
- }
- }
- } else if (Token.isByteArrayDatum(datum)){
- return datum;
- } else {
- return null;
- }
-
- byteArray += "}";
-
- return byteArray;
- }
-}
-
-
-
-
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageIdentification.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageIdentification.java
deleted file mode 100644
index 0c54525661..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageIdentification.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/** @file
- UsageIdentification class.
-
- This class an identification for a PCD UsageInstance.
-
-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.
-
-**/
-
-package org.tianocore.pcd.entity;
-
-/**
- The identification for a UsageInstance.
- It should be extend from ModuleIdentification in future.
-
-**/
-public class UsageIdentification {
- ///
- /// The module CName: one key of Identification
- ///
- public String moduleName;
-
- ///
- /// The module Guid String: one key of Identification
- ///
- public String moduleGuid;
-
- ///
- /// The package CName: one key of Identification
- ///
- public String packageName;
-
- ///
- /// The package Guid: one key of Identification
- ///
- public String packageGuid;
-
- ///
- /// Module's Arch: one key of Identification
- ///
- public String arch;
-
- ///
- /// Module's version: one key of Identification
- ///
- public String version;
-
- ///
- /// Module's type
- ///
- public String moduleType;
-
- /**
- Constructor function for UsageIdentification class.
-
- @param moduleName The key of module's name
- @param moduleGuid The key of module's GUID string
- @param packageName The key of package's name
- @param packageGuid The key of package's Guid
- @param arch The architecture string
- @param version The version String
- @param moduleType The module type
- **/
- public UsageIdentification (String moduleName,
- String moduleGuid,
- String packageName,
- String packageGuid,
- String arch,
- String version,
- String moduleType) {
- this.moduleName = moduleName;
- this.moduleGuid = moduleGuid;
- this.packageName = packageName;
- this.packageGuid = packageGuid;
- this.arch = arch;
- this.version = version;
- this.moduleType = moduleType;
- }
-
- /**
- Generate the string for UsageIdentification
-
- @return the string value for UsageIdentification
- **/
- public String toString() {
- //
- // Because currently transition schema not require write moduleGuid, package Name, Packge GUID in
- // <ModuleSA> section, So currently no expect all paramter must be valid.
- // BUGBUG: Because currently we can not get version from MSA, So ignore verison.
- //
- return(moduleName + "_" +
- ((moduleGuid != null) ? moduleGuid.toLowerCase() : "NullModuleGuid") + "_" +
- ((packageName != null) ? packageName : "NullPackageName") + "_" +
- ((packageGuid != null) ? packageGuid.toLowerCase() : "NullPackageGuid") + "_" +
- ((arch != null) ? arch : "NullArch") + "_" +
- "NullVersion");
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java
deleted file mode 100644
index 2484453149..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/entity/UsageInstance.java
+++ /dev/null
@@ -1,512 +0,0 @@
-/** @file
- UsageInstance class.
-
- This class indicate an usage instance for a PCD token. This instance maybe a module
- or platform setting. When a module produce or cosume a PCD token, then this module
- is an usage instance for this PCD token.
-
-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.
-
-**/
-package org.tianocore.pcd.entity;
-
-import org.tianocore.pcd.entity.CommonDefinition;
-import org.tianocore.pcd.entity.UsageIdentification;
-
-/**
- This class indicate an usage instance for a PCD token. This instance maybe a module
- or platform setting. When a module produce or cosume a PCD token, then this module
- is an usage instance for this PCD token.
-**/
-public class UsageInstance {
- ///
- /// This parent that this usage instance belongs to.
- ///
- public Token parentToken;
-
- ///
- /// ModuleIdentification for Usage Instance
- ///
- public UsageIdentification usageId;
-
- ///
- /// Arch also is a key for a UsageInstance
- ///
- public String arch;
-
- ///
- /// The PCD type defined for module
- ///
- public Token.PCD_TYPE modulePcdType;
-
- ///
- /// The value of the PCD in this usage instance.
- ///
- public String datum;
-
- ///
- /// The maxDatumSize could be different for same PCD in different module
- /// But this case is allow for FeatureFlag, FixedAtBuild, PatchableInModule
- /// type.
- ///
- public int maxDatumSize;
-
- ///
- /// Autogen string for header file.
- ///
- public String hAutogenStr;
-
- ///
- /// Auotgen string for C code file.
- ///
- public String cAutogenStr;
-
- /**
- Constructure function for UsageInstance
-
- @param parentToken The token instance for this usgaInstance
- @param usageId The identification for usage instance
- @param modulePcdType The PCD type for this usage instance
- @param value The value of this PCD in this usage instance
- @param maxDatumSize The max datum size of this PCD in this usage
- instance.
- **/
- public UsageInstance(Token parentToken,
- UsageIdentification usageId,
- Token.PCD_TYPE modulePcdType,
- String value,
- int maxDatumSize) {
- this.parentToken = parentToken;
- this.usageId = usageId;
- this.modulePcdType = modulePcdType;
- this.datum = value;
- this.maxDatumSize = maxDatumSize;
- }
-
- /**
- Get the primary key for usage instance array for every token.
-
- @param usageId The identification of UsageInstance
-
- @retval String The primary key for this usage instance
- **/
- public static String getPrimaryKey(UsageIdentification usageId) {
- return usageId.toString();
- }
-
- /**
- Get primary key string for this usage instance
-
- @return String primary key string
- **/
- public String getPrimaryKey() {
- return UsageInstance.getPrimaryKey(usageId);
- }
-
- /**
- Judget whether current module is PEI driver
-
- @return boolean whether current module is PEI driver
- **/
- public boolean isPeiPhaseComponent() {
- int moduleType = CommonDefinition.getModuleType(usageId.moduleType);
-
- if ((moduleType == CommonDefinition.ModuleTypePeiCore) ||
- (moduleType == CommonDefinition.ModuleTypePeim)) {
- return true;
- }
- return false;
- }
-
- /**
- Judge whether current module is DXE driver.
-
- @return boolean whether current module is DXE driver
- **/
- public boolean isDxePhaseComponent() {
- int moduleType = CommonDefinition.getModuleType(usageId.moduleType);
-
- if ((moduleType == CommonDefinition.ModuleTypeDxeDriver) ||
- (moduleType == CommonDefinition.ModuleTypeDxeRuntimeDriver) ||
- (moduleType == CommonDefinition.ModuleTypeDxeSalDriver) ||
- (moduleType == CommonDefinition.ModuleTypeDxeSmmDriver) ||
- (moduleType == CommonDefinition.ModuleTypeUefiDriver) ||
- (moduleType == CommonDefinition.ModuleTypeUefiApplication)
- ) {
- return true;
- }
- return false;
- }
-
- /**
- Generate autogen string for header file and C code file.
-
- @param isBuildUsedLibrary whether the autogen is for library.
- **/
- public void generateAutoGen(boolean isBuildUsedLibrary) {
- String guidStringCName = null;
- boolean isByteArray = false;
- String printDatum = null;
- String tokenNumberString = null;
-
- hAutogenStr = "";
- cAutogenStr = "";
-
- if (this.modulePcdType == Token.PCD_TYPE.DYNAMIC_EX) {
- //
- // For DYNAMIC_EX type PCD, use original token number in SPD or FPD to generate autogen
- //
- tokenNumberString = Long.toString(parentToken.dynamicExTokenNumber, 16);
- } else {
- //
- // For Others type PCD, use autogenerated token number to generate autogen
- //
- tokenNumberString = Long.toString(parentToken.tokenNumber, 16);
- }
-
- hAutogenStr += String.format("#define _PCD_TOKEN_%s 0x%s\r\n", parentToken.cName, tokenNumberString);
-
- //
- // Judge the value of this PCD is byte array type
- //
- if (!isBuildUsedLibrary && !parentToken.isDynamicPCD) {
- if (datum.trim().charAt(0) == '{') {
- isByteArray = true;
- }
- }
-
- //
- // "ULL" should be added to value's tail for UINT64 value
- //
- if (parentToken.datumType == Token.DATUM_TYPE.UINT64) {
- printDatum = this.datum + "ULL";
- } else {
- printDatum = this.datum;
- }
-
- switch (modulePcdType) {
- case FEATURE_FLAG:
- //
- // Example autogen string for following generation:
- // "extern const BOOLEAN _gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("extern const BOOLEAN _gPcd_FixedAtBuild_%s;\r\n",
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken _gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s _gPcd_FixedAtBuild_%s\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "//#define _PCD_SET_MODE_8_PcdSampleToken ASSERT(FALSE) If is not allowed to set value...";
- //
- hAutogenStr += String.format("//#define _PCD_SET_MODE_%s_%s ASSERT(FALSE) If is not allowed to set value for a FEATURE_FLAG PCD\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName);
-
- if (!isBuildUsedLibrary) {
- //
- // Example autogen string for following generation:
- // "#define _PCD_VALUE_PcdSampleToken 0x1000"
- //
- hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
- parentToken.cName,
- printDatum);
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_PcdSampleToken = _PCD_VALUE_PcdSampleToken;"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const BOOLEAN _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",
- parentToken.cName,
- parentToken.cName);
- }
- break;
- case FIXED_AT_BUILD:
- if (isByteArray) {
- //
- // Example autogen string for following generation:
- // "extern const BOOLEAN _gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("extern const UINT8 _gPcd_FixedAtBuild_%s[];\r\n",
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken (VOID*)_gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s (VOID*)_gPcd_FixedAtBuild_%s\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- } else {
- //
- // Example autogen string for following generation:
- // "extern const UINT8 _gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("extern const %s _gPcd_FixedAtBuild_%s;\r\n",
- Token.getAutogendatumTypeString(parentToken.datumType),
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken _gPcd_FixedAtBuild_PcdSampleToken";
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s _gPcd_FixedAtBuild_%s\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- }
-
- //
- // Example autogen string for following generation:
- // "//#define _PCD_SET_MODE_8_PcdSampleToken ASSERT(FALSE) If is not allowed to set value...";
- //
- hAutogenStr += String.format("//#define _PCD_SET_MODE_%s_%s ASSERT(FALSE) // It is not allowed to set value for a FIXED_AT_BUILD PCD\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName);
- if (!isBuildUsedLibrary) {
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- if (isByteArray) {
- //
- // Example autogen string for following generation:
- // "#define _PCD_VALUE_PcdSampleToken (VOID*)_gPcd_FixedAtBuild_PcdSampleToken"
- //
- hAutogenStr += String.format("#define _PCD_VALUE_%s (VOID*)_gPcd_FixedAtBuild_%s\r\n",
- parentToken.cName,
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_PcdSampleToken[] = 'dfdf';"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_%s[] = %s;\r\n",
- parentToken.cName,
- printDatum);
- } else {
- //
- // Example autogen string for following generation:
- // "#define _PCD_VALUE_PcdSampleToken 0x222"
- //
- hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
- parentToken.cName,
- printDatum);
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_PcdSampleToken[] = _PCD_VALUE_PcdSampleToken;"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",
- Token.getAutogendatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- }
- } else {
- //
- // Example autogen string for following generation:
- // "#define _PCD_VALUE_PcdSampleToken 0x222"
- //
- hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
- parentToken.cName,
- printDatum);
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED const UINT8 _gPcd_FixedAtBuild_PcdSampleToken[] = _PCD_VALUE_PcdSampleToken;"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED const %s _gPcd_FixedAtBuild_%s = _PCD_VALUE_%s;\r\n",
- Token.getAutogendatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- }
- }
- break;
- case PATCHABLE_IN_MODULE:
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- //
- // Example autogen string for following generation:
- // "extern UINT8 _gPcd_BinaryPatch_PcdSampleToken[];"
- //
- hAutogenStr += String.format("extern UINT8 _gPcd_BinaryPatch_%s[];\r\n",
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken (VOID*)_gPcd_BinaryPatch_PcdSampleToken"
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s (VOID*)_gPcd_BinaryPatch_%s\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(SizeOfBuffer, Buffer) CopyMem (_gPcd_BinaryPatch_PcdSampleToken, (Buffer), (SizeOfBuffer))"
- //
- hAutogenStr += String.format("#define _PCD_PATCHABLE_%s_SIZE %d\r\n",
- parentToken.cName,
- parentToken.datumSize);
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(SizeOfBuffer, Buffer) "+
- "LibPatchPcdSetPtr (_gPcd_BinaryPatch_%s, (UINTN)_PCD_PATCHABLE_%s_SIZE, "+
- "(SizeOfBuffer), (Buffer))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName,
- parentToken.cName);
-
- } else {
- //
- // Example autogen string for following generation:
- // "extern UINT8 _gPcd_BinaryPatch_PcdSampleToken;"
- //
- hAutogenStr += String.format("extern %s _gPcd_BinaryPatch_%s;\r\n",
- Token.getAutogendatumTypeString(parentToken.datumType),
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken _gPcd_BinaryPatch_PcdSampleToken"
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s _gPcd_BinaryPatch_%s\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(Value) (_gPcd_BinaryPatch_PcdSampleToken = (Value))"
- //
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(Value) (_gPcd_BinaryPatch_%s = (Value))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- }
-
- if (!isBuildUsedLibrary) {
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- printDatum = parentToken.getByteArrayForPointerDatum(printDatum);
- }
- //
- // Example autogen string for following generation:
- // "#define _PCD_VALUE_PcdSampleToken 0x111"
- //
- hAutogenStr += String.format("#define _PCD_VALUE_%s %s\r\n",
- parentToken.cName,
- printDatum);
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_PcdSampleToken[] = _PCD_VALUE_PcdSampleToken;"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_%s[%d] = _PCD_VALUE_%s;\r\n",
- parentToken.cName,
- parentToken.datumSize,
- parentToken.cName);
- } else {
- //
- // Example autogen string for following generation:
- // "GLOBAL_REMOVE_IF_UNREFERENCED UINT8 _gPcd_BinaryPatch_PcdSampleToken[] = _PCD_VALUE_PcdSampleToken;"
- //
- cAutogenStr += String.format("GLOBAL_REMOVE_IF_UNREFERENCED %s _gPcd_BinaryPatch_%s = _PCD_VALUE_%s;\r\n",
- Token.getAutogendatumTypeString(parentToken.datumType),
- parentToken.cName,
- parentToken.cName);
- }
- }
-
- break;
- case DYNAMIC:
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken LibPcdGet%s(_PCD_TOKEN_PcdSampleToken)"
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s LibPcdGet%s(_PCD_TOKEN_%s)\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- parentToken.cName);
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(SizeOfBuffer, Buffer) LibPcdSet%s(_PCD_TOKEN_PcdSampleToken, (SizeOfBuffer), (Buffer))"
- //
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(SizeOfBuffer, Buffer) LibPcdSet%s(_PCD_TOKEN_%s, (SizeOfBuffer), (Buffer))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- parentToken.cName);
- } else {
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(Value) LibPcdSet%s(_PCD_TOKEN_PcdSampleToken, (Value))"
- //
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(Value) LibPcdSet%s(_PCD_TOKEN_%s, (Value))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- parentToken.cName);
- }
- break;
- case DYNAMIC_EX:
- guidStringCName = "_gPcd_TokenSpaceGuid_" +
- parentToken.tokenSpaceName.toString().replaceAll("-", "_");
-
- //
- // Example autogen string for following generation:
- // "#define _PCD_GET_MODE_8_PcdSampleToken LibPcdGetEx%s(&_gPcd_TokenSpaceGuid_00_00_00, _PCD_TOKEN_PcdSampleToken)"
- //
- hAutogenStr += String.format("#define _PCD_GET_MODE_%s_%s LibPcdGetEx%s(&%s, _PCD_TOKEN_%s)\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- guidStringCName,
- parentToken.cName);
-
- if (parentToken.datumType == Token.DATUM_TYPE.POINTER) {
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(SizeOfBuffer, Buffer) LibPcdSetEx%s(&_gPcd_TokenSpaceGuid_00_00_00, _PCD_TOKEN_PcdSampleToken, (SizeOfBuffer), (Buffer))"
- //
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(SizeOfBuffer, Buffer) LibPcdSetEx%s(&%s, _PCD_TOKEN_%s, (SizeOfBuffer), (Buffer))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- guidStringCName,
- parentToken.cName);
- } else {
- //
- // Example autogen string for following generation:
- // "#define _PCD_SET_MODE_8_PcdSampleToken(Value) LibPcdSetEx%s(&_gPcd_TokenSpaceGuid_00_00_00, _PCD_TOKEN_PcdSampleToken, (Value))"
- //
- hAutogenStr += String.format("#define _PCD_SET_MODE_%s_%s(Value) LibPcdSetEx%s(&%s, _PCD_TOKEN_%s, (Value))\r\n",
- Token.GetAutogenDefinedatumTypeString(parentToken.datumType),
- parentToken.cName,
- Token.getAutogenLibrarydatumTypeString(parentToken.datumType),
- guidStringCName,
- parentToken.cName);
-
- }
- break;
- }
- }
-
- /**
- Get the autogen string for header file.
-
- @return The string of header file.
- **/
- public String getHAutogenStr() {
- return hAutogenStr;
- }
-
- /**
- Get the autogen string for C code file.
-
- @return The string of C Code file.
- **/
- public String getCAutogenStr() {
- return cAutogenStr;
- }
-}
-
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/BuildActionException.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/BuildActionException.java
deleted file mode 100644
index 9cd4e63fef..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/BuildActionException.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/** @file
- BuildActionException class.
-
- BuildAction Exception deals with all build action exceptions.
-
-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.
-
-**/
-package org.tianocore.pcd.exception;
-
-import org.apache.tools.ant.BuildException;
-
-/**
- BuildAction Exception deals with all build action exceptions.
-**/
-public class BuildActionException extends BuildException {
- static final long serialVersionUID = -7034897190740066939L;
- /**
- Constructure function
-
- @param reason exception message string.
- **/
- public BuildActionException(String reason) {
- super(reason);
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/EntityException.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/EntityException.java
deleted file mode 100644
index 5316cba554..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/EntityException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/** @file
- EntityException class.
-
- The class handle the exception throwed by entity class.
-
-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.
-
-**/
-package org.tianocore.pcd.exception;
-
-/**
- The class handle the exception throwed by entity class.
-**/
-public class EntityException extends Exception {
- static final long serialVersionUID = -8034897190740066939L;
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public EntityException(String expStr) {
- super("[PCD Tool Internal Error]:" + expStr);
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/PlatformPcdPreprocessException.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/PlatformPcdPreprocessException.java
deleted file mode 100644
index 69b50c8f2f..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/PlatformPcdPreprocessException.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/** @file
- PlatformPcdPreprocessException class.
-
- The class handle the exception throwed by PlatformPcdPreprocessAction class.
-
-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.
-
-**/
-package org.tianocore.pcd.exception;
-
-public class PlatformPcdPreprocessException extends Exception {
- /**
- serial version ID
- **/
- private static final long serialVersionUID = 2858398552845888282L;
-
- /**
- Constructure function
-
- @param expStr exception message string.
- **/
- public PlatformPcdPreprocessException(String expStr) {
- super("\r\n[PlatformPcdPreprocess Failure] #############################\r\n" + expStr);
- }
-
- public PlatformPcdPreprocessException() {
- super();
- }
-}
diff --git a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/UIException.java b/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/UIException.java
deleted file mode 100644
index 377a8a4b1d..0000000000
--- a/Tools/Java/Source/PcdTools/org/tianocore/pcd/exception/UIException.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/** @file
- UIException class.
-
- The class handle the exception throwed by UI action class.
-
-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.
-
-**/
-package org.tianocore.pcd.exception;
-
-/**
- The class handle the exception throwed by UI action class.
-**/
-public class UIException extends Exception {
- static final long serialVersionUID = -7034897190740066930L;
- /**
- Constructure function
-
- @param reason exception message string.
- **/
- public UIException(String reason) {
- super(reason);
- }
-}
diff --git a/Tools/Java/Source/SurfaceArea/SurfaceArea.msa b/Tools/Java/Source/SurfaceArea/SurfaceArea.msa
deleted file mode 100644
index da51e90603..0000000000
--- a/Tools/Java/Source/SurfaceArea/SurfaceArea.msa
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ModuleSurfaceArea xmlns="http://www.TianoCore.org/2006/Edk2.0" >
- <MsaHeader>
- <ModuleName>Surface Area Build</ModuleName>
- <ModuleType>TOOL</ModuleType>
- <GuidValue>C21A4ED4-491E-4602-BF94-698EA54F254B</GuidValue>
- <Version>2.0</Version>
- <Abstract>This is the EFI/Tiano SurfaceArea Module</Abstract>
- <Description>
- This Module provides the EFI/Tiano Tools that are used to create EFI/Tiano
- Modules and Platform Binary Files (PBF)
- These tools require compilation only once if the Developer Workstation and
- the Developer's choice of HOST tool chain are stable. If the developer
- updates either the OS or the HOST tool chain, these tools should be rebuilt.
- </Description>
- <Copyright>Copyright 2006, Intel Corporation</Copyright>
- <License>
-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.
- </License>
- <Specification>FRAMEWORK_BUILD_PACKAGING_SPECIFICATION 0x00000052</Specification>
- </MsaHeader>
- <ModuleDefinitions>
- <SupportedArchitectures>IA32 X64 IPF EBC</SupportedArchitectures>
- <BinaryModule>false</BinaryModule>
- <OutputFileBasename>NULL</OutputFileBasename>
- </ModuleDefinitions>
- <SourceFiles>
- <Filename>build.xml</Filename>
- </SourceFiles>
-</ModuleSurfaceArea>
diff --git a/Tools/Java/Source/SurfaceArea/build.xml b/Tools/Java/Source/SurfaceArea/build.xml
deleted file mode 100644
index 6dd98cd9d1..0000000000
--- a/Tools/Java/Source/SurfaceArea/build.xml
+++ /dev/null
@@ -1,220 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-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 default="all" basedir="." name="SurfaceArea">
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
- <property environment="env" />
- <property name="WORKSPACE" value="${env.WORKSPACE}"/>
- <taskdef resource="net/sf/antcontrib/antlib.xml"/>
-
- <path id="classpath">
- <fileset dir="${WORKSPACE}/Tools/Jars">
- <include name="*.jar"/>
- </fileset>
- <fileset dir="${env.XMLBEANS_HOME}/lib">
- <include name="*.jar"/>
- </fileset>
- <pathelement path = "${env.CLASSPATH}"/>
- </path>
-
- <target name="init">
- <uptodate targetfile="${WORKSPACE}/Tools/Jars/SurfaceArea.jar" property="jar.newer">
- <srcfiles dir="${WORKSPACE}/Tools/XMLSchema" includes="*.xsd"/>
- </uptodate>
- </target>
-
- <!--
- Generate SurfaceArea.jar and source code
- -->
- <target name="SurfaceArea.jar" depends="init">
- <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler">
- <classpath refid="classpath"/>
- <arg value="-javasource"/>
- <arg value="1.5"/>
- <arg value="-dl"/>
- <arg value="-out"/>
- <arg value="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
- </java>
- </target>
-
- <target name="SurfaceArea.java" depends="init">
- <antcall target="SurfaceArea.java.clean"/>
- <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler">
- <classpath refid="classpath"/>
- <arg value="-javasource"/>
- <arg value="1.5"/>
- <arg value="-dl"/>
- <arg value="-srconly"/>
- <arg value="-src"/>
- <arg value="${WORKSPACE}/Tools/Java/Source/SurfaceArea"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
- </java>
- </target>
-
- <target name="SurfaceArea" depends="init" unless="jar.newer">
- <antcall target="SurfaceArea.java.clean"/>
- <java classname="org.apache.xmlbeans.impl.tool.SchemaCompiler" fork="true">
- <classpath refid="classpath"/>
- <arg value="-javasource"/>
- <arg value="1.5"/>
- <arg value="-dl"/>
- <arg value="-src"/>
- <arg value="${WORKSPACE}/Tools/Java/Source/SurfaceArea"/>
- <arg value="-out"/>
- <arg value="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/FarManifest.xsd"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsdconfig"/>
- </java>
- </target>
-
- <target name="SurfaceArea.java.clean">
- <delete includeemptydirs="true" failonerror="false">
- <fileset dir="${WORKSPACE}/Tools/Java/Source/SurfaceArea" includes="org"/>
- </delete>
- </target>
-
- <target name="SurfaceArea.jar.clean">
- </target>
-
- <!--
- Surface Area Description file validation
- -->
- <target name="validate">
- <echo message="Validating ... ${SURFACE_AREA_FILE}"/>
- <!--
- java -classpath %cp% org.apache.xmlbeans.impl.tool.InstanceValidator %*
- -->
- <copy file="${SURFACE_AREA_FILE}" tofile="${SURFACE_AREA_FILE}.xml"/>
- <java classname="org.apache.xmlbeans.impl.tool.InstanceValidator"
- outputproperty="XMLBEANS_OUTPUT"
- errorproperty="XMLBEANS_ERROR">
-
- <classpath refid="classpath"/>
- <arg value="-dl"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
- <arg value="${SURFACE_AREA_FILE}.xml"/>
-
- </java>
-
- <delete file="${SURFACE_AREA_FILE}.xml" quiet="true"/>
- <if>
- <or>
- <contains string="${XMLBEANS_OUTPUT}" substring="NOT valid"/>
- <contains string="${XMLBEANS_OUTPUT}" substring=": error:"/>
- <contains string="${XMLBEANS_ERROR}" substring="XmlException"/>
- <contains string="${XMLBEANS_ERROR}" substring=": error:"/>
- </or>
- <then>
- <echo message="Result ... ${XMLBEANS_OUTPUT}&#x0d;&#x0a;${XMLBEANS_ERROR}"/>
- <fail message="${SURFACE_AREA_FILE} is invalid!"/>
- </then>
- <else>
- <echo message="Result ... ${SURFACE_AREA_FILE} is valid"/>
- </else>
- </if>
- </target>
-
- <!--
- beautify xml file
- -->
- <target name="pretty">
- <echo message="Beautify ... ${SURFACE_AREA_FILE}"/>
- <!--
- java -classpath %cp% org.apache.xmlbeans.impl.tool.PrettyPrinter %*
- -->
- <java classname="org.apache.xmlbeans.impl.tool.PrettyPrinter"
- errorproperty="XMLBEANS_OUTPUT"
- output="${SURFACE_AREA_FILE}">
-
- <classpath refid="classpath"/>
- <arg value="-indent"/>
- <arg value="2"/>
- <arg value="${SURFACE_AREA_FILE}"/>
-
- </java>
-
- <if>
- <equals arg1="${XMLBEANS_OUTPUT}" arg2=""/>
- <then>
- <echo message="Result ... DONE"/>
- </then>
- <else>
- <echo message="Result ... ${XMLBEANS_OUTPUT}"/>
- </else>
- </if>
- </target>
-
- <!--
- generate Surface Area template file from schema
- -->
- <target name="generate">
- <echo message="Generating ... ${SURFACE_AREA_FILE}"/>
- <!--
- java -classpath %cp% org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator %*
- -->
- <java classname="org.apache.xmlbeans.impl.xsd2inst.SchemaInstanceGenerator" fork="true"
- errorproperty="XMLBEANS_OUTPUT"
- output="${SURFACE_AREA_FILE}.tmp">
-
- <classpath refid="classpath"/>
- <arg value="-dl"/>
- <arg value="${WORKSPACE}/Tools/XMLSchema/SurfaceArea.xsd"/>
- <arg value="-name"/>
- <arg value="${SURFACE_AREA_ELEMENT}"/>
-
- </java>
-
- <concat destfile="${SURFACE_AREA_FILE}">
- <header trimleading="yes" filtering="no"><![CDATA[<?xml version="1.0" encoding="UTF-8"?>]]>
- </header>
- <fileset file="${SURFACE_AREA_FILE}.tmp"/>
- </concat>
-
- <delete file="${SURFACE_AREA_FILE}.tmp" deleteonexit="true" quiet="true"/>
- <if>
- <equals arg1="${XMLBEANS_OUTPUT}" arg2=""/>
- <then>
- <echo message="Result ... DONE"/>
- </then>
- <else>
- <echo message="Result ... ${XMLBEANS_OUTPUT}"/>
- </else>
- </if>
- </target>
-
- <target name="clean" depends="SurfaceArea.java.clean">
- </target>
-
- <target name="cleanall" depends="SurfaceArea.jar.clean">
- <echo message="Removing Class Files and the Java Archive: SurfaceArea.jar"/>
- <delete file="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
- <if>
- <available file="${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
- <then>
- <echo message="You must manually remove the file: ${WORKSPACE}/Tools/Jars/SurfaceArea.jar"/>
- <echo message="Java has already loaded the file, and cannot remove it within ANT!"/>
- </then>
- </if>
- </target>
-
- <target name="all" depends="SurfaceArea">
- </target>
-
- <target name="install" depends="SurfaceArea.jar">
- </target>
-
-</project>