add library, extension patch methods base

This commit is contained in:
crazywhalecc
2023-07-28 23:45:39 +08:00
committed by Jerry Ma
parent aaf712be3c
commit e909dd15b0
6 changed files with 78 additions and 154 deletions

View File

@@ -135,6 +135,7 @@ abstract class LibraryBase
// 传入 true表明直接编译
if ($force_build) {
logger()->info('Building required library [' . static::NAME . ']');
$this->patchBeforeBuild();
$this->build();
return BUILD_STATUS_OK;
}
@@ -162,6 +163,14 @@ abstract class LibraryBase
return BUILD_STATUS_ALREADY;
}
/**
* Patch before build, overwrite this and return true to patch libs
*/
public function patchBeforeBuild(): bool
{
return false;
}
/**
* 获取构建当前 lib 的 Builder 对象
*/