Skip to content

Commit

Permalink
Create runtime kit and adjust devkit (#9)
Browse files Browse the repository at this point in the history
* create runtime kit and adjust devkit

* bump version

* make setup.ps1 reusable

* add FNMPAPI PDB to devkit
  • Loading branch information
mtfriesen authored Nov 20, 2023
1 parent 04cc720 commit edbd19e
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 19 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ jobs:
- name: Create Dev Kit
shell: PowerShell
run: tools/create-devkit.ps1 -Config ${{ matrix.configuration }} -Platform ${{ matrix.platform }}
- name: Create Runtime Kit
shell: PowerShell
run: tools/create-runtimekit.ps1 -Config ${{ matrix.configuration }} -Platform ${{ matrix.platform }}
- name: Upload Release Artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32
with:
Expand Down
2 changes: 1 addition & 1 deletion src/fnmp.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<!-- Defines the project version numbers -->
<MajorVersion>0</MajorVersion>
<MinorVersion>1</MinorVersion>
<PatchVersion>0</PatchVersion>
<PatchVersion>1</PatchVersion>
</PropertyGroup>
<!-- The set of (eventually?) supported configurations -->
<ItemGroup Label="ProjectConfigurations">
Expand Down
15 changes: 2 additions & 13 deletions tools/create-devkit.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,11 @@ $DstPath = "artifacts\kit\$Name"
Remove-Item $DstPath -Recurse -ErrorAction Ignore
New-Item -Path $DstPath -ItemType Directory > $null

New-Item -Path $DstPath\symbols -ItemType Directory > $null
copy "artifacts\bin\$($Platform)_$($Config)\fnmp.pdb" $DstPath\symbols
copy "artifacts\bin\$($Platform)_$($Config)\fnmpapi.pdb" $DstPath\symbols

New-Item -Path $DstPath\include -ItemType Directory > $null
copy -Recurse inc\* $DstPath\include

New-Item -Path $DstPath\lib -ItemType Directory > $null
copy "artifacts\bin\$($Platform)_$($Config)\fnmpapi.lib" $DstPath\lib
copy "artifacts\bin\$($Platform)_$($Config)\fnmpapi.pdb" $DstPath\lib

$VersionString = Get-ProjectBuildVersionString

if (!(Is-ReleaseBuild)) {
$VersionString += "-prerelease+" + (git.exe describe --long --always --dirty --exclude=* --abbrev=8)

copy "artifacts\bin\$($Platform)_$($Config)\CoreNetSignRoot.cer" $DstPath\bin
}

Compress-Archive -DestinationPath "$DstPath\$Name-$VersionString.zip" -Path $DstPath\*
Compress-Archive -DestinationPath "$DstPath\$Name.zip" -Path $DstPath\*
42 changes: 42 additions & 0 deletions tools/create-runtimekit.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#
# Assembles a runtime kit for FNMP execution.
# Code must be built before running this script.
#

param (
[ValidateSet("x64")]
[Parameter(Mandatory=$false)]
[string]$Platform = "x64",

[ValidateSet("Debug", "Release")]
[Parameter(Mandatory=$false)]
[string]$Config = "Debug"
)

Set-StrictMode -Version 'Latest'
$ErrorActionPreference = 'Stop'

$RootDir = Split-Path $PSScriptRoot -Parent
. $RootDir\tools\common.ps1

$Name = "fnmp-runtime-$Platform"
if ($Config -eq "Debug") {
$Name += "-debug"
}
$DstPath = "artifacts\kit\$Name"

Remove-Item $DstPath -Recurse -ErrorAction Ignore
New-Item -Path $DstPath -ItemType Directory > $null

New-Item -Path $DstPath\bin -ItemType Directory > $null
copy -Recurse "artifacts\bin\$($Platform)_$($Config)\fnmp\" $DstPath\bin

New-Item -Path $DstPath\symbols -ItemType Directory > $null
copy "artifacts\bin\$($Platform)_$($Config)\fnmp.pdb" $DstPath\symbols

New-Item -Path $DstPath\tools -ItemType Directory > $null
copy ".\tools\common.ps1" $DstPath\tools
copy ".\tools\prepare-machine.ps1" $DstPath\tools
copy ".\tools\setup.ps1" $DstPath\tools

Compress-Archive -DestinationPath "$DstPath\$Name.zip" -Path $DstPath\*
5 changes: 3 additions & 2 deletions tools/prepare-machine.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,12 @@ if ($Cleanup) {
reg.exe add HKLM\System\CurrentControlSet\Control\CrashControl /v CrashDumpEnabled /d 1 /t REG_DWORD /f
$Reboot = $true
}
}

if ($ForTest) {
Setup-VcRuntime
Setup-VsTest
}

if ($ForTest) {
Download-CoreNet-Deps
Setup-TestSigning
Install-Certs
Expand Down
22 changes: 19 additions & 3 deletions tools/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ This script installs or uninstalls various FNMP components.
.PARAMETER Uninstall
Attempts to uninstall all FNMP components.
.PARAMETER ArtifactsDir
Supplies an optional directory containing FNMP component artifacts.
.PARAMETER LogsDir
Supplies an optional directory to output logs.
#>

param (
Expand All @@ -32,7 +38,13 @@ param (

[Parameter(Mandatory = $false)]
[ValidateSet("", "fnmp")]
[string]$Uninstall = ""
[string]$Uninstall = "",

[Parameter(Mandatory = $false)]
[string]$ArtifactsDir = "",

[Parameter(Mandatory = $false)]
[string]$LogsDir = ""
)

Set-StrictMode -Version 'Latest'
Expand All @@ -43,8 +55,12 @@ $RootDir = Split-Path $PSScriptRoot -Parent
. $RootDir\tools\common.ps1

# Important paths.
$ArtifactsDir = "$RootDir\artifacts\bin\$($Arch)_$($Config)"
$LogsDir = "$RootDir\artifacts\logs"
if ([string]::IsNullOrEmpty($ArtifactsDir)) {
$ArtifactsDir = "$RootDir\artifacts\bin\$($Arch)_$($Config)"
}
if ([string]::IsNullOrEmpty($LogsDir)) {
$LogsDir = "$RootDir\artifacts\logs"
}
$DevCon = Get-CoreNetCiArtifactPath -Name "devcon.exe"
$DswDevice = Get-CoreNetCiArtifactPath -Name "dswdevice.exe"

Expand Down

0 comments on commit edbd19e

Please sign in to comment.