|
21 | 21 | </ItemGroup> |
22 | 22 |
|
23 | 23 | <Target Name="SetAssemblyVersion" BeforeTargets="GetAssemblyVersion"> |
24 | | - <Exec Command='pwsh -nol -noni -nop -c "& { Import-LocalizedData -BindingVariable m -FileName $(MSBuildProjectName); (gv m -va).ModuleVersion }"' |
25 | | - ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true"> |
| 24 | + <Exec Command='pwsh -noni -nop -c "Import-LocalizedData -BindingVariable m -FileName $(MSBuildProjectName); (gv m -va).ModuleVersion"' |
| 25 | + ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true"> |
26 | 26 | <Output TaskParameter="ConsoleOutput" PropertyName="Version" /> |
27 | 27 | </Exec> |
28 | 28 | </Target> |
|
31 | 31 |
|
32 | 32 | <Target Name="Documentation" DependsOnTargets="Publish"> |
33 | 33 | <Copy SourceFiles="$(OutputPath)\publish\FSharp.Core.dll" |
34 | | - DestinationFolder="$(OutputPath)" /> |
35 | | - <Exec Command='pwsh -nol -noni -nop -c "& { Import-Module (Resolve-Path $(OutputPath)*.psd1); New-MarkdownHelp -Module $(MSBuildProjectName) -OutputFolder ..\..\docs -ea 0; Update-MarkdownHelp ..\..\docs; New-ExternalHelp ..\..\docs -OutputPath . -Force }"' |
36 | | - IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" /> |
| 34 | + DestinationFolder="$(OutputPath)" /> |
| 35 | + <Exec Command='pwsh -noni -nop -c "Import-Module (Resolve-Path $(OutputPath)*.psd1); New-MarkdownHelp -Module $(MSBuildProjectName) -OutputFolder ..\..\docs -ea 0; Update-MarkdownHelp ..\..\docs; New-ExternalHelp ..\..\docs -OutputPath . -Force"' |
| 36 | + IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" /> |
37 | 37 | </Target> |
38 | 38 |
|
39 | 39 | <Target Name="test" DependsOnTargets="Pester" /> |
40 | 40 |
|
41 | 41 | <Target Name="Pester" DependsOnTargets="Publish" Condition="'$(Configuration)' == 'Debug'"> |
42 | 42 | <Copy SourceFiles="$(OutputPath)\publish\FSharp.Core.dll" |
43 | | - DestinationFolder="$(OutputPath)" /> |
44 | | - <Exec Command='pwsh -nol -noni -nop -c "& { cd ..\..; Invoke-Pester }"' |
45 | | - IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" /> |
| 43 | + DestinationFolder="$(OutputPath)" /> |
| 44 | + <Exec Command='pwsh -noni -nop -c "cd ..\..; Invoke-Pester"' |
| 45 | + IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" /> |
46 | 46 | </Target> |
47 | 47 |
|
48 | 48 | <ItemGroup> |
49 | 49 | <PSModulePath Include="$(PSModulePath)" Exclude="C:\Program Files\**;C:\Windows\**;C:\ProgramData\chocolatey\**" /> |
50 | 50 | </ItemGroup> |
51 | 51 |
|
52 | 52 | <Target Name="PublishModule" DependsOnTargets="Publish" Condition="'$(Configuration)' == 'Release'"> |
53 | | - <RemoveDir Directories="@(PSModulePath->'%(FullPath)\$(MSBuildProjectName)')" /> |
| 53 | + <RemoveDir Directories="@(PSModulePath->'%(FullPath)\$(MSBuildProjectName)')" /> |
54 | 54 | <Copy SourceFiles="$(OutputPath)\publish\FSharp.Core.dll" DestinationFolder="$(OutputPath)" /> |
55 | 55 | <ItemGroup><ModuleFiles Include="$(OutputPath)\*" /></ItemGroup> |
56 | | - <Copy SourceFiles="@(ModuleFiles)" DestinationFolder="@(PSModulePath->'%(FullPath)\$(MSBuildProjectName)\$(Version)')" /> |
57 | | - <Error Text="To publish, first run: (Get-Credential API-key -Message 'Enter your API key').Password |ConvertFrom-SecureString |Out-File .\.apikey utf8" |
58 | | - Condition="!Exists('..\..\.apikey')" /> |
59 | | - <Exec Command='pwsh -nol -noni -nop -c "& { (New-Object PSCredential apikey,(Get-Content ..\..\.apikey |ConvertTo-SecureString)).GetNetworkCredential().Password }"' |
60 | | - ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="Exists('..\..\.apikey')"> |
| 56 | + <Copy SourceFiles="@(ModuleFiles)" DestinationFolder="@(PSModulePath->'%(FullPath)\$(MSBuildProjectName)\$(Version)')" /> |
| 57 | + <Exec Command='pwsh -noni -nop -c "[bool](Get-SecretInfo $(MSBuildProjectName) -Vault PowerShellGallery)"' |
| 58 | + ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true"> |
| 59 | + <Output TaskParameter="ConsoleOutput" PropertyName="HasApiKey" /> |
| 60 | + </Exec> |
| 61 | + <Error Text="To publish, first run: .\Set-ApiKey.ps1" Condition="!$(HasApiKey)" /> |
| 62 | + <Exec Command='pwsh -nop -c "(New-Object PSCredential _,(Get-Secret $(MSBuildProjectName) -Vault PowerShellGallery)).GetNetworkCredential().Password"' |
| 63 | + ConsoleToMSBuild="true" IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="$(HasApiKey)"> |
61 | 64 | <Output TaskParameter="ConsoleOutput" PropertyName="ApiKey" /> |
62 | 65 | </Exec> |
63 | | - <Exec Command='pwsh -nol -noni -nop -c "& { Import-Module $(MSBuildProjectName); Publish-Module -Name $(MSBuildProjectName) -NuGetApiKey $(ApiKey) }"' |
64 | | - IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="Exists('..\..\.apikey')" /> |
| 66 | + <Exec Command='pwsh -noni -nop -c "Import-Module $(MSBuildProjectName); Publish-Module -Name $(MSBuildProjectName) -NuGetApiKey $(ApiKey)"' |
| 67 | + IgnoreExitCode="true" IgnoreStandardErrorWarningFormat="true" Condition="$(HasApiKey)" /> |
65 | 68 | </Target> |
66 | 69 |
|
67 | 70 | </Project> |
0 commit comments