Sign in Join
FPDoc Onlineexperiment

TPackage class

In unit fpMkUnit

Central class for package management and building

Declaration

pascal
TPackage = class(TNamedItem)

Inheritance

  1. TPackage
  2. TNamedItem
  3. TCollectionItem
  4. TPersistent
  5. TObject

Description

TPackage is the central class in the fpmake build system that represents a complete package. A package contains build targets, dependencies, installation files, and all configuration needed for compilation and deployment.

Each package can contain multiple targets such as units, programs, and libraries. The package manages compilation options, search paths, dependencies on other packages, and installation procedures. It supports cross-platform compilation with CPU and OS-specific settings.

It handles the following aspects:

  • Management of TTarget build targets
  • Dependency tracking through TDependency objects
  • Cross-platform compilation support
  • Package variants for different build configurations
  • Custom installation and archiving procedures

See also

Properties

Dictionaryprotected
PackageVariantsListprotected
VersionpublicVersion string of the package
FileNamepublicFilename of the package definition file
ShortNamepublicShort name identifier for the package
HomepageURLpublicURL of the package homepage
DownloadURLpublicURL for downloading the package
EmailpublicContact email address for the package
AuthorpublicAuthor or maintainer of the package
LicensepublicLicense terms for the package
DirectorypublicBase directory path of the package
DescriptionpublicDescriptive text about the package
DescriptionFilepublicFile containing package description text
InstalledChecksumpublicChecksum of installed package files
IsFPMakeAddInpublicWhether this package is an FPMake add-in
SupportBuildModespublicWhether package supports different build modes
BuildModepublicDefault build mode configuration for the package
FlagspublicPackage flags and behavior settings
PackageVersionpublicVersion information for the package
TransmitOptionspublicOptions transmitted to dependent packages
OSespublicSupported operating systems for the package
CPUspublicSupported CPU architectures for the package
SubTargetspublicSubtarget configurations for the package
NeedLibCpublicWhether package requires C library linkage
OptionspublicCompiler options for the package
UnitPathpublicSearch paths for unit files
ObjectPathpublicSearch paths for object files
IncludePathpublicSearch paths for include files
SourcePathpublicSearch paths for source files
ExamplePathpublicSearch paths for example files
TestPathpublicSearch paths for test files
FPDocFormatpublicOutput format for FPDoc documentation
InstallFilespublicCollection of files to be installed
CleanFilespublicCollection of files to be cleaned
DependenciespublicCollection of package dependencies
CommandspublicCollection of custom build commands
StatepublicCurrent build state of the package
TargetspublicCollection of build targets
SourcespublicCollection of source files
UnitDirpublicDirectory for compiled unit files
UnitConfigFileNamepublicFilename for unit configuration file
NamespaceMappublicMapping of unit names to namespaces
BeforeCompilepublicEvent handler executed before package compilation
BeforeCompileProcpublicProcedural event handler before compilation
AfterCompilepublicEvent handler executed after package compilation
AfterCompileProcpublicProcedural event handler after compilation
BeforeInstallpublicEvent handler executed before package installation
BeforeInstallProcpublicProcedural event handler before installation
AfterInstallpublicEvent handler executed after package installation
AfterInstallProcpublicProcedural event handler after installation
BeforeCleanpublicEvent handler executed before package cleanup
BeforeCleanProcpublicProcedural event handler before cleanup
AfterCleanpublicEvent handler executed after package cleanup
AfterCleanProcpublicProcedural event handler after cleanup
BeforeArchivepublicEvent handler executed before package archiving
BeforeArchiveProcpublicProcedural event handler before archiving
AfterArchivepublicEvent handler executed after package archiving
AfterArchiveProcpublicProcedural event handler after archiving
BeforeManifestpublicEvent handler executed before manifest creation
BeforeManifestProcpublicProcedural event handler before manifest creation
AfterManifestpublicEvent handler executed after manifest creation
AfterManifestProcpublicProcedural event handler after manifest creation
BeforePkgListpublicEvent handler executed before package listing
BeforePkgListProcpublicProcedural event handler before package listing
AfterPkgListpublicEvent handler executed after package listing
AfterPkgListProcpublicProcedural event handler after package listing

Methods

SetNameprotected
SaveUnitConfigToStringListprotected
CreatepublicCreates a new package instance
destroypublicDestroys the package instance and frees resources
HaveOptionspublicChecks if package has global compilation options
GetUnitsOutputDirpublicReturns the output directory for compiled units
GetUnitConfigOutputFilenamepublicGets output filename for unit configuration file
GetBinOutputDirpublicReturns the output directory for binary files
GetCleanFilespublicGets list of files to be cleaned for the package
GetArchiveFilespublicGets list of files to include in package archive
InheritPackageVariantsFromDependencypublicInherits package variants from a dependency package
GetPackageVariantsByNamepublicGets package variants collection by name
SetUnitsOutputDirpublicSets the output directory for compiled units
GetPackageUnitInstallDirpublicGets installation directory for package units
SetPackageUnitInstallDirpublicSets installation directory for package units
GetInstallFilespublicGets list of files to be installed for the package
GetInstallSourceFilespublicGets list of source files to be installed
GetArchiveSourceFilespublicGets list of source files for package archive
GetManifestpublicGets package manifest information
ListPackagepublicLists package information to a string list
AddPackageVariantpublicAdds a package variant to the package
ApplyPackageVariantToCompilerOptionspublicApplies package variant settings to compiler options
SetDefaultPackageVariantpublicSets the default package variant for the package
LoadUnitConfigFromFilepublicLoads unit configuration from a file
SaveUnitConfigToFilepublicSaves unit configuration to a file
EnterResolveDirsCSpublicEnters critical section for directory resolution
LeaveResolveDirsCSpublicLeaves critical section for directory resolution
AddTargetsFromDirpublic
ApplyNameSpacespublicApplies namespace settings to a filename
SubTargetAllowedpublicChecks if a subtarget is allowed for the package

Inherited

From TNamedItem (1)

Name

From TCollectionItem (11)

Changed Collection DisplayName GetDisplayName GetNamePath GetOwner ID Index SetCollection SetDisplayName SetIndex

From TPersistent (6)

Assign AssignTo DefineProperties FPOAttachObserver FPODetachObserver FPONotifyObservers

From TObject (40)

AfterConstruction BeforeDestruction CheckDisposed ClassInfo ClassName ClassNameIs ClassParent ClassType CleanupInstance DefaultHandler DefaultHandlerStr Dispatch DispatchStr Disposed DisposeOf Equals FieldAddress Free FreeInstance GetDisposed GetHashCode GetInterface GetInterfaceByStr GetInterfaceEntry GetInterfaceEntryByStr GetInterfaceTable GetInterfaceWeak GetLastCastErrorInfo InheritsFrom InitInstance InstanceSize MethodAddress MethodName newinstance QualifiedClassName SafeCallException StringMessageTable SystemHasExtendedRTTI ToString UnitName

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.