]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
2 This file is to define PackageIdentification class.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 package org
.tianocore
.build
.id
;
17 import org
.tianocore
.build
.global
.GlobalData
;
20 This class is used to identify a package.
24 public class PackageIdentification
extends Identification
{
33 @param version Version
35 public PackageIdentification(String guid
, String version
){
42 @param version Version
44 public PackageIdentification(String name
, String guid
, String version
){
45 super(name
, guid
, version
);
51 @param version Version
52 @param spdFilename SPD file name
54 public PackageIdentification(String name
, String guid
, String version
, String spdFilename
){
55 super(name
, guid
, version
);
56 this.spdFile
= new File(spdFilename
);
62 @param version Version
63 @param spdFile SPD file
65 public PackageIdentification(String name
, String guid
, String version
, File spdFile
){
66 super(name
, guid
, version
);
67 this.spdFile
= spdFile
;
72 @param spdFile SPD file
74 public void setSpdFile(File spdFile
) {
75 this.spdFile
= spdFile
;
82 public File
getSpdFile() {
86 public String
toString(){
87 if (version
== null || version
.trim().equalsIgnoreCase("")) {
88 return "package [" + name
+ "]";
91 return "package [" + name
+ " " + version
+ "]";
97 @return Package Directory
99 public String
getPackageDir(){
100 return spdFile
.getParent();
104 get package relative directory.
105 @return package relative directory
107 public String
getPackageRelativeDir(){
108 String relativeDir
=spdFile
.getParent().substring(GlobalData
.getWorkspacePath().length());
109 if(relativeDir
.startsWith("\\") || relativeDir
.startsWith("/")) {
110 relativeDir
= relativeDir
.substring(1);
115 public String
getName() {