summaryrefslogtreecommitdiff
path: root/Tools/Java/Source/GenBuild/org/tianocore/build/id
diff options
context:
space:
mode:
Diffstat (limited to 'Tools/Java/Source/GenBuild/org/tianocore/build/id')
-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
5 files changed, 0 insertions, 740 deletions
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