Skip to content

Commit fb90b66

Browse files
authored
NuGet: Add to platform-specific packages a PowerShell scripts that are responsible for deploying assemblies on ASP.NET 4.X websites (#6744)
1 parent facb0f8 commit fb90b66

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#-------------------------------------------------------------------------------------------------------
2+
# Copyright (C) Microsoft. All rights reserved.
3+
# Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
4+
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
5+
#-------------------------------------------------------------------------------------------------------
6+
7+
param($installPath, $toolsPath, $package, $project)
8+
9+
if ($project.Type -eq 'Web Site') {
10+
$projectDir = $project.Properties.Item('FullPath').Value
11+
12+
$assemblyDestDir = Join-Path $projectDir 'bin/{{{platformArchitecture}}}'
13+
if (!(Test-Path $assemblyDestDir)) {
14+
New-Item -ItemType Directory -Force -Path $assemblyDestDir
15+
}
16+
17+
$assemblySourceFiles = Join-Path $installPath 'runtimes/{{{runtimeIdentifier}}}/native/*.*'
18+
Copy-Item $assemblySourceFiles $assemblyDestDir -Force
19+
}

Build/NuGet/Windows.DotNet.Arch/Primary.nuspec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
</metadata>
1111
<files>
1212
<file src="Items.$platformArchitecture$.props" target="build\$id$.props" />
13+
<file src="Install.$platformArchitecture$.ps1" target="tools\Install.ps1" />
14+
<file src="Uninstall.$platformArchitecture$.ps1" target="tools\Uninstall.ps1" />
1315

1416
<file src="..\..\VcBuild\bin\$platformArchitecture$_release\ChakraCore.dll" target="runtimes\$runtimeIdentifier$\native" />
1517

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#-------------------------------------------------------------------------------------------------------
2+
# Copyright (C) Microsoft. All rights reserved.
3+
# Copyright (c) 2021 ChakraCore Project Contributors. All rights reserved.
4+
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
5+
#-------------------------------------------------------------------------------------------------------
6+
7+
param($installPath, $toolsPath, $package, $project)
8+
9+
if ($project.Type -eq 'Web Site') {
10+
$projectDir = $project.Properties.Item('FullPath').Value
11+
$assemblySourceFiles = Join-Path $installPath 'runtimes/{{{runtimeIdentifier}}}/native/*.*'
12+
13+
foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
14+
$assemblyFile = Join-Path $projectDir "bin/{{{platformArchitecture}}}/$($assemblySourceFileInfo.Name)"
15+
if (Test-Path $assemblyFile) {
16+
Remove-Item $assemblyFile -Force
17+
}
18+
}
19+
}

Build/NuGet/package-data.xml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@
3434
<preprocessableFiles>
3535
<file src="Windows.DotNet.Arch\Items.props.mustache"
3636
target="Windows.DotNet.Arch\Items.{{{platformArchitecture}}}.props" />
37+
<file src="Windows.DotNet.Arch\Install.ps1.mustache"
38+
target="Windows.DotNet.Arch\Install.{{{platformArchitecture}}}.ps1" />
39+
<file src="Windows.DotNet.Arch\Uninstall.ps1.mustache"
40+
target="Windows.DotNet.Arch\Uninstall.{{{platformArchitecture}}}.ps1" />
3741
</preprocessableFiles>
3842
</package>
3943
<package id="Microsoft.ChakraCore.win-x64" nuspecFile="Windows.DotNet.Arch\Primary.nuspec">
@@ -44,6 +48,10 @@
4448
<preprocessableFiles>
4549
<file src="Windows.DotNet.Arch\Items.props.mustache"
4650
target="Windows.DotNet.Arch\Items.{{{platformArchitecture}}}.props" />
51+
<file src="Windows.DotNet.Arch\Install.ps1.mustache"
52+
target="Windows.DotNet.Arch\Install.{{{platformArchitecture}}}.ps1" />
53+
<file src="Windows.DotNet.Arch\Uninstall.ps1.mustache"
54+
target="Windows.DotNet.Arch\Uninstall.{{{platformArchitecture}}}.ps1" />
4755
</preprocessableFiles>
4856
</package>
4957
<package id="Microsoft.ChakraCore.win-arm" nuspecFile="Windows.DotNet.Arch\Primary.nuspec">
@@ -54,6 +62,10 @@
5462
<preprocessableFiles>
5563
<file src="Windows.DotNet.Arch\Items.props.mustache"
5664
target="Windows.DotNet.Arch\Items.{{{platformArchitecture}}}.props" />
65+
<file src="Windows.DotNet.Arch\Install.ps1.mustache"
66+
target="Windows.DotNet.Arch\Install.{{{platformArchitecture}}}.ps1" />
67+
<file src="Windows.DotNet.Arch\Uninstall.ps1.mustache"
68+
target="Windows.DotNet.Arch\Uninstall.{{{platformArchitecture}}}.ps1" />
5769
</preprocessableFiles>
5870
</package>
5971
<package id="Microsoft.ChakraCore.vc140" nuspecFile="Windows.Cpp.All\Primary.nuspec">

0 commit comments

Comments
 (0)