]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/GenBuild/org/tianocore/build/id/PackageIdentification.java
815fd445288155b235e745ee94864c26bbf02f1c
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
;
19 public class PackageIdentification
extends Identification
{
26 public PackageIdentification(String guid
, String version
){
30 public PackageIdentification(String name
, String guid
, String version
){
31 super(name
, guid
, version
);
34 public PackageIdentification(String name
, String guid
, String version
, String spdFilename
){
35 super(name
, guid
, version
);
36 this.spdFile
= new File(spdFilename
);
39 public PackageIdentification(String name
, String guid
, String version
, File spdFile
){
40 super(name
, guid
, version
);
41 this.spdFile
= spdFile
;
44 public void setSpdFile(File spdFile
) {
45 this.spdFile
= spdFile
;
48 public File
getSpdFile() {
52 public String
toString(){
54 GlobalData
.refreshPackageIdentification(this);
56 if (version
== null || version
.trim().equalsIgnoreCase("")) {
57 return "package [" + name
+ "]";
60 return "package [" + name
+ " " + version
+ "]";
64 public String
getPackageDir(){
66 return spdFile
.getParent();
69 public String
getPackageRelativeDir(){
71 String relativeDir
=spdFile
.getParent().substring(GlobalData
.getWorkspacePath().length());
72 if(relativeDir
.startsWith("\\") || relativeDir
.startsWith("/")) {
73 relativeDir
= relativeDir
.substring(1);
78 private void prepareSpdFile(){
79 if (spdFile
== null) {
80 GlobalData
.refreshPackageIdentification(this);
84 public String
getName() {
86 GlobalData
.refreshPackageIdentification(this);