mirror of
https://github.com/aphrody-labs/PowerShell.git
synced 2026-10-17 04:36:39 +00:00
Move resgen artifacts from submodules into src subfolders
Submodule adds unnessesary complexity. This commit removes dependency on pre-generated C# bindings. Start-PsBuild -ResGen will call Start-ResGen. It also has auto-detect logic to simplify first time expirience.
This commit is contained in:
1 parent
209a30da00
commit
d92620dcf3
9 files changed
+19
-33
No files matched your search
+14
-3
@@ -26,6 +26,7 @@ function Start-PSBuild {
|
||||
[switch]$NoPath,
|
||||
[switch]$Restore,
|
||||
[string]$Output,
|
||||
[switch]$ResGen,
|
||||
|
||||
[Parameter(ParameterSetName='CoreCLR')]
|
||||
[switch]$Publish,
|
||||
@@ -143,6 +144,13 @@ function Start-PSBuild {
|
||||
Start-NativeExecution { dotnet restore $RestoreArguments }
|
||||
}
|
||||
|
||||
# handle ResGen
|
||||
if ($ResGen -or -not (Test-Path "$($Options.Top)/gen"))
|
||||
{
|
||||
log "Run ResGen (generating C# bindings for resx files)"
|
||||
Start-ResGen
|
||||
}
|
||||
|
||||
# Build native components
|
||||
if ($IsLinux -or $IsOSX) {
|
||||
$Ext = if ($IsLinux) {
|
||||
@@ -867,6 +875,9 @@ function Send-GitDiffToSd {
|
||||
|
||||
function Start-ResGen
|
||||
{
|
||||
[CmdletBinding()]
|
||||
param()
|
||||
|
||||
@("Microsoft.PowerShell.Commands.Management",
|
||||
"Microsoft.PowerShell.Commands.Utility",
|
||||
"Microsoft.PowerShell.ConsoleHost",
|
||||
@@ -890,9 +901,9 @@ function Start-ResGen
|
||||
}
|
||||
|
||||
$genSource = Get-StronglyTypeCsFileForResx -xml $xml -ModuleName $module -ClassName $className -NamespaceName $namespace
|
||||
$outPath = "$PSScriptRoot/src/windows-build/gen/$module/$fileName.cs"
|
||||
log "ResGen for $outPath"
|
||||
mkdir -ErrorAction SilentlyContinue (Split-Path $outPath) > $null
|
||||
$outPath = "$PSScriptRoot/src/$module/gen/$fileName.cs"
|
||||
Write-Verbose "ResGen for $outPath"
|
||||
New-Item -Type Directory -ErrorAction SilentlyContinue (Split-Path $outPath) > $null
|
||||
Set-Content -Encoding Ascii -Path $outPath -Value $genSource
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user