[deploy] fix: coapp build

This commit is contained in:
Haibo 2023-09-27 23:09:16 +08:00
parent c438a797a5
commit 6f187cfc94
3 changed files with 76 additions and 44 deletions

View File

@ -1,5 +1,6 @@
. .\scripts\appveyor\appveyor_get_build.ps1
. .\scripts\appveyor\appveyor_get_artifacts.ps1
. .\scripts\appveyor\copy_recurse.ps1
# get job artifacts
Write-Host "Start to download artifacts from other jobs"
@ -25,6 +26,13 @@ Write-Host "Start to build nupkg files"
# This is the CoApp .autopkg file to create.
$autopkgFile = "scripts\coapp\kiwano.autopkg"
# Copy include files
Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.h"
Copy-Recurse -Path "src\" -Destination "include\" -Filter "*.hpp"
Remove-Item -Path "include\3rd-party" -Recurse
Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.h"
Copy-Recurse -Path "src\3rd-party\" -Destination "include\" -Filter "*.hpp"
# Create a copy of ".autopkg" file
Copy-Item -Path $autopkgFile -Destination ($autopkgFile + '.template')

View File

@ -0,0 +1,23 @@
function Copy-Recurse {
param(
[string]$Path,
[string]$Destination,
[string]$Filter
)
New-Item -ItemType Directory -Force -Path $Destination | Out-Null
Get-ChildItem -Recurse -Path $Path -Filter $Filter | ForEach-Object {
$relativePath = $_.FullName.Replace((Resolve-Path $Path).Path, "")
$targetFile = Join-Path -Path $Destination -ChildPath $relativePath
$targetFileDirectory = Split-Path -Path $targetFile -Parent
if (!(Test-Path $targetFileDirectory))
{
New-Item -ItemType Directory -Force -Path $targetFileDirectory | Out-Null
}
Copy-Item -Path $_.FullName -Destination $targetFile -Force
}
}

View File

@ -51,7 +51,7 @@ nuget {
// The nuspec file metadata.
nuspec {
id = Kiwano;
// "@appveyor_version" is replaced by the current Appveyor build number in the
// "appveyor_version" is replaced by the current Appveyor build number in the
// pre-deployment script.
version: @appveyor_version;
title: Kiwano Game Framework;
@ -86,13 +86,14 @@ nuget {
files {
#defines {
INCLUDE_ROOT = ..\..\include;
SRC_ROOT = ..\..\src;
OUTPUT_DIR = ..\..\projects\output;
}
include: {
${SRC_ROOT}\kiwano*\**\*.h, ${SRC_ROOT}\kiwano*\**\*.hpp,
${SRC_ROOT}\3rd-party\**\*.h, ${SRC_ROOT}\3rd-party\**\*.hpp,
${INCLUDE_ROOT}\**\*.h,
${INCLUDE_ROOT}\**\*.hpp,
};
// third patry