Skip to content

Commit

Permalink
build: update extern
Browse files Browse the repository at this point in the history
  • Loading branch information
gottyduke committed Aug 21, 2023
1 parent 6cb4d0e commit 8a13b93
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 18 deletions.
13 changes: 7 additions & 6 deletions !Update.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

# args
param (
[Parameter(Mandatory)][ValidateSet('SOURCEGEN', 'DISTRIBUTE')][string]$Mode,
[Parameter(Mandatory)][ValidateSet('SOURCEGEN', 'DISTRIBUTE')][string]$Mode = 'SOURCEGEN',
[string]$Version,
[string]$Path,
[string]$Project
[string]$Binary
)


$ErrorActionPreference = "Stop"

$Folder = $PSScriptRoot | Split-Path -Leaf
$SourceExt = @('.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', '.inl', 'inc', '.ixx')
$ConfigExt = @('.ini', '.json', '.toml')
$SourceExt = @('.asm', '.c', '.cc', '.cpp', '.cxx', '.h', '.hpp', '.hxx', 'inc', '.inl', '.ixx')
$ConfigExt = @('.ini', '.json', '.toml', '.xml')
$DocsExt = @('.md')
$env:ScriptCulture = (Get-Culture).Name -eq 'zh-CN'

Expand Down Expand Up @@ -101,9 +101,10 @@ if ($Mode -eq 'SOURCEGEN') {
# @@DISTRIBUTE
if ($Mode -eq 'DISTRIBUTE') {
# update script to every project
Get-ChildItem "$PSScriptRoot/*/*" -Directory | Where-Object {
Get-ChildItem "$PSScriptRoot/$Path" -Directory -Recurse | Where-Object {
$_.Name -notin @('vcpkg', 'Build', '.git', '.vs') -and
(Test-Path "$_/CMakeLists.txt" -PathType Leaf)
(Test-Path "$_/CMakeLists.txt" -PathType Leaf) -and
(Test-Path "$_/vcpkg.json" -PathType Leaf)
} | ForEach-Object {
Write-Host "`tUpdated <$_>"
Robocopy.exe "$PSScriptRoot" "$_" '!Update.ps1' /MT /NJS /NFL /NDL /NJH | Out-Null
Expand Down
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

- [CMake](https://cmake.org/)
- Add this to your `PATH`
- [DKUtil](https://github.com/gottyduke/DKUtil)
- Init & update with git submodule
- [PowerShell](https://github.com/PowerShell/PowerShell/releases/latest)
- [Vcpkg](https://github.com/microsoft/vcpkg)
- Add the environment variable `VCPKG_ROOT` with the value as the path to the folder containing vcpkg
Expand All @@ -25,7 +27,7 @@
git clone https://github.com/gottyduke/BG3_PluginTemplate.git
cd BG3_PluginTemplate
git submodule init
git submodule update
git submodule update --remote
.\build-release.ps1
```

Expand All @@ -49,6 +51,8 @@ git submodule update

- [CMake](https://cmake.org/)
- 把这个添加到你的`PATH`
- [DKUtil](https://github.com/gottyduke/DKUtil)
- 通过git子模块初始化并更新
- [PowerShell](https://github.com/PowerShell/PowerShell/releases/latest)
- [Vcpkg](https://github.com/microsoft/vcpkg)
-`VCPKG_ROOT`设置环境变量,并把包含vcpkg的文件夹路径作为值
Expand All @@ -69,7 +73,7 @@ git submodule update
git clone https://github.com/gottyduke/BG3_PluginTemplate.git
cd BG3_PluginTemplate
git submodule init
git submodule update
git submodule update --remote
.\build-release.ps1
```

Expand Down
10 changes: 1 addition & 9 deletions generate-sln.ps1
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
Remove-Item $PSScriptRoot/build -Recurse -Force -ErrorAction:SilentlyContinue -Confirm:$False | Out-Null
Push-Location $PSScriptRoot
try {
& git submodule init
& git submodule update
& cmake -B $PSScriptRoot/build -S $PSScriptRoot --preset=REL -DPLUGIN_MODE:BOOL=TRUE
}
finally {
Pop-Location
}
& cmake -B $PSScriptRoot/build -S $PSScriptRoot --preset=REL -DPLUGIN_MODE:BOOL=TRUE

0 comments on commit 8a13b93

Please sign in to comment.