X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Tools%2FSource%2FGenBuild%2Forg%2Ftianocore%2Fbuild%2Fid%2FPlatformIdentification.java;h=7c669652b8750dce94a0d6f691b77743f41705ae;hp=8ee6cf04f30aa77d9f6b6be73012da4834560f4e;hb=01413f0ccb4e678f633c42d300a1eced780a22d5;hpb=a29c47e01d9689fad735bbeccfaef67676a425d1 diff --git a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java index 8ee6cf04f3..7c669652b8 100644 --- a/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java +++ b/Tools/Source/GenBuild/org/tianocore/build/id/PlatformIdentification.java @@ -1,25 +1,67 @@ +/** @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; @@ -29,15 +71,43 @@ public class PlatformIdentification extends Identification{ 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(){ - return fpdFile.getParent().substring(GlobalData.getWorkspacePath().length()); + 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