-
Notifications
You must be signed in to change notification settings - Fork 0
/
check_nuspec_is_valid.ps1
60 lines (41 loc) · 1.5 KB
/
check_nuspec_is_valid.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#not finished yet
#purpose was to check if a nuspec file references certain dlls which aren't listed in it's dependencies
function GetNuSpecFiles {
param (
[string] $folder
)
Get-ChildItem -Path $folder -Filter *.nuspec -Recurse
}
function GetAfcModules {
param (
[string] $folder
)
Get-ChildItem -Path $folder -Recurse -Directory -Filter AFC-*
}
function GetDllPathsFromNuSpec{
param (
[string] $nuspecPath
)
[xml] $xml = Get-Content $nuspecPath
$srcs = $xml.package.files.file.src | where { $_ -like "*.dll" }
$srcs = $srcs |% { $_ -replace '\$Configuration\$', 'Debug' }
$srcs
#Write-host blqh
$nuspecDirectory = (Get-Item $nuspecPath).DirectoryName
$absolutePaths = $srcs |% { [System.io.path]::Combine($nuspecDirectory, $_) }
$absolutePaths
}
. .\manage_assembly.ps1
function GetDllPathsFromNuSpec{
param (
[string] $nuspecPath
)
$dllPaths = GetDllPathsFromNuSpec -nuspecPath $_.FullName
$referencedAssemblies = $dllPaths |% {GetReferencedAssemblies -AssemblyFile $_}
$referencedAssemblies
}
#$baseFolder = "C:\git"
#$moduleFolders = GetAfcModules -Folder $baseFolder
#$nuspecFilesForModuleFolders = $moduleFolders |% { GetNuSpecFiles -folder $_.FullName }
$nuspecFilesForModuleFolders |% { GetDllPathsFromNuSpec -nuspecPath $_.FullName }
#$moduleInfos = $moduleFolders |% { GetPackageInfo -Folder $_.FFullName}