mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-08 01:15:37 +08:00
Chore
This commit is contained in:
@@ -14,6 +14,7 @@ use StaticPHP\Runtime\SystemTarget;
|
||||
use StaticPHP\Util\DependencyResolver;
|
||||
use StaticPHP\Util\DirDiff;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
use StaticPHP\Util\GlobalPathTrait;
|
||||
use StaticPHP\Util\SPCConfigUtil;
|
||||
|
||||
/**
|
||||
@@ -21,6 +22,8 @@ use StaticPHP\Util\SPCConfigUtil;
|
||||
*/
|
||||
class LibraryPackage extends Package
|
||||
{
|
||||
use GlobalPathTrait;
|
||||
|
||||
/**
|
||||
* Custom postinstall actions for this package.
|
||||
* @var array<array>
|
||||
@@ -369,41 +372,6 @@ class LibraryPackage extends Package
|
||||
return getenv($this->getSnakeCaseName() . '_LIBS') ?: '';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the build root path for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package build root path in the future.
|
||||
*/
|
||||
public function getBuildRootPath(): string
|
||||
{
|
||||
return BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the include directory for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package include directory in the future.
|
||||
*/
|
||||
public function getIncludeDir(): string
|
||||
{
|
||||
return BUILD_INCLUDE_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the library directory for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package library directory in the future.
|
||||
*/
|
||||
public function getLibDir(): string
|
||||
{
|
||||
return BUILD_LIB_PATH;
|
||||
}
|
||||
|
||||
public function getBinDir(): string
|
||||
{
|
||||
return BUILD_BIN_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get tar compress options from suffix
|
||||
*
|
||||
|
||||
@@ -11,11 +11,14 @@ use StaticPHP\Exception\WrongUsageException;
|
||||
use StaticPHP\Runtime\Shell\Shell;
|
||||
use StaticPHP\Runtime\SystemTarget;
|
||||
use StaticPHP\Util\FileSystem;
|
||||
use StaticPHP\Util\GlobalPathTrait;
|
||||
use StaticPHP\Util\InteractiveTerm;
|
||||
use StaticPHP\Util\System\LinuxUtil;
|
||||
|
||||
class PackageBuilder
|
||||
{
|
||||
use GlobalPathTrait;
|
||||
|
||||
/** @var int make jobs count */
|
||||
public readonly int $concurrency;
|
||||
|
||||
|
||||
43
src/StaticPHP/Util/GlobalPathTrait.php
Normal file
43
src/StaticPHP/Util/GlobalPathTrait.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace StaticPHP\Util;
|
||||
|
||||
trait GlobalPathTrait
|
||||
{
|
||||
/**
|
||||
* Get the build root path for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package build root path in the future.
|
||||
*/
|
||||
public function getBuildRootPath(): string
|
||||
{
|
||||
return BUILD_ROOT_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the include directory for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package include directory in the future.
|
||||
*/
|
||||
public function getIncludeDir(): string
|
||||
{
|
||||
return BUILD_INCLUDE_PATH;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the library directory for the package.
|
||||
*
|
||||
* TODO: Can be changed to support per-package library directory in the future.
|
||||
*/
|
||||
public function getLibDir(): string
|
||||
{
|
||||
return BUILD_LIB_PATH;
|
||||
}
|
||||
|
||||
public function getBinDir(): string
|
||||
{
|
||||
return BUILD_BIN_PATH;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user