#-------------------------------------------------------------------------------------------------------
# Copyright (C) Microsoft. All rights reserved.
# Copyright (c) ChakraCore Project Contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
#-------------------------------------------------------------------------------------------------------

param($installPath, $toolsPath, $package, $project)

if ($project.Type -eq 'Web Site') {
    $projectDir = $project.Properties.Item('FullPath').Value
    $assemblySourceFiles = Join-Path $installPath 'runtimes/{{{runtimeIdentifier}}}/native/*.*'

    foreach ($assemblySourceFileInfo in Get-Item($assemblySourceFiles)) {
        $assemblyFile = Join-Path $projectDir "bin/{{{platformArchitecture}}}/$($assemblySourceFileInfo.Name)"
        if (Test-Path $assemblyFile) {
            Remove-Item $assemblyFile -Force
        }
    }
}
