Skip to content

Commit

Permalink
Merge pull request #839 from ctaggart/powershell
Browse files Browse the repository at this point in the history
Paket.PowerShell
  • Loading branch information
forki committed Jun 12, 2015
2 parents 4a30f5d + 6833cf0 commit eec6ec8
Show file tree
Hide file tree
Showing 17 changed files with 654 additions and 14 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,5 @@ docs/content/license.md
docs/content/release-notes.md
_NCrunch_Paket
docs/content/paket-*.md
*.bak
*.bak
System.Management.Automation.dll
27 changes: 27 additions & 0 deletions Paket.PowerShell.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.22823.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "project", "project", "{BF60BC93-E09B-4E5F-9D85-95A519479D54}"
ProjectSection(SolutionItems) = preProject
build.cmd = build.cmd
build.fsx = build.fsx
EndProjectSection
EndProject
Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Paket.PowerShell", "src\Paket.PowerShell\Paket.PowerShell.fsproj", "{1F1581C1-6416-470E-BC48-92C6D4AAC785}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{1F1581C1-6416-470E-BC48-92C6D4AAC785}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1F1581C1-6416-470E-BC48-92C6D4AAC785}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1F1581C1-6416-470E-BC48-92C6D4AAC785}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1F1581C1-6416-470E-BC48-92C6D4AAC785}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
18 changes: 18 additions & 0 deletions build.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ let tags = "nuget, bundler, F#"

// File system information
let solutionFile = "Paket.sln"
let solutionFilePowerShell = "Paket.PowerShell.sln"

// Pattern specifying assemblies to be tested using NUnit
let testAssemblies = "tests/**/bin/Release/*Tests*.dll"
Expand Down Expand Up @@ -131,6 +132,22 @@ Target "Build" (fun _ ->
|> ignore
)

// --------------------------------------------------------------------------------------
// Build PowerShell project

Target "BuildPowerShell" (fun _ ->
if File.Exists "src/Paket.PowerShell/System.Management.Automation.dll" = false then
let result =
ExecProcess (fun info ->
info.FileName <- Path.Combine(Environment.SystemDirectory, @"WindowsPowerShell\v1.0\powershell.exe")
info.Arguments <- "src/Paket.PowerShell/System.Management.Automation.ps1") System.TimeSpan.MaxValue
if result <> 0 then failwithf "Error copying System.Management.Automation.dll"

!! solutionFilePowerShell
|> MSBuildRelease "" "Rebuild"
|> ignore
)

// --------------------------------------------------------------------------------------
// Run the unit tests using test runner

Expand Down Expand Up @@ -320,6 +337,7 @@ Target "All" DoNothing
"Clean"
==> "AssemblyInfo"
==> "Build"
=?> ("BuildPowerShell", not isMono)
==> "RunTests"
=?> ("GenerateReferenceDocs",isLocalBuild && not isMono)
=?> ("GenerateDocs",isLocalBuild && not isMono)
Expand Down
2 changes: 1 addition & 1 deletion nuget/paket.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ iconurl https://raw.githubusercontent.com/fsprojects/Paket/master/docs/files/img
tags
nuget, bundler, F#
files
../bin/merged/paket.exe ==> tools
../bin/merged/paket.exe ==> tools
8 changes: 4 additions & 4 deletions src/Paket.Bootstrapper/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
[assembly: AssemblyTitleAttribute("Paket.Bootstrapper")]
[assembly: AssemblyProductAttribute("Paket")]
[assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")]
[assembly: AssemblyVersionAttribute("1.13.0")]
[assembly: AssemblyFileVersionAttribute("1.13.0")]
[assembly: AssemblyInformationalVersionAttribute("1.13.0-alpha003")]
[assembly: AssemblyVersionAttribute("1.6.2")]
[assembly: AssemblyFileVersionAttribute("1.6.2")]
[assembly: AssemblyInformationalVersionAttribute("1.6.2")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "1.13.0";
internal const string Version = "1.6.2";
}
}
8 changes: 4 additions & 4 deletions src/Paket.Core/AssemblyInfo.fs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ open System.Reflection
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("1.13.0")>]
[<assembly: AssemblyFileVersionAttribute("1.13.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.13.0-alpha003")>]
[<assembly: AssemblyVersionAttribute("1.6.2")>]
[<assembly: AssemblyFileVersionAttribute("1.6.2")>]
[<assembly: AssemblyInformationalVersionAttribute("1.6.2")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.13.0"
let [<Literal>] Version = "1.6.2"
14 changes: 14 additions & 0 deletions src/Paket.PowerShell/AssemblyInfo.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace System
open System.Reflection

[<assembly: AssemblyTitleAttribute("Paket.PowerShell")>]
[<assembly: AssemblyProductAttribute("Paket")>]
[<assembly: AssemblyCompanyAttribute("Paket team")>]
[<assembly: AssemblyDescriptionAttribute("A package dependency manager for .NET with support for NuGet packages and GitHub repositories.")>]
[<assembly: AssemblyVersionAttribute("1.13.0")>]
[<assembly: AssemblyFileVersionAttribute("1.13.0")>]
[<assembly: AssemblyInformationalVersionAttribute("1.13.0-alpha003")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "1.13.0"
19 changes: 19 additions & 0 deletions src/Paket.PowerShell/CmdletExt.fs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[<AutoOpen>]
module Paket.PowerShell.CmdletExt

open System.Management.Automation

// add F# printf write extensions
type Cmdlet with

member x.WritefCommandDetail format =
Printf.ksprintf (fun s -> x.WriteCommandDetail s |> ignore) format

member x.WritefDebug format =
Printf.ksprintf (fun s -> x.WriteDebug s |> ignore) format

member x.WritefVebose format =
Printf.ksprintf (fun s -> x.WriteVerbose s |> ignore) format

member x.WritefWarning format =
Printf.ksprintf (fun s -> x.WriteWarning s |> ignore) format
147 changes: 147 additions & 0 deletions src/Paket.PowerShell/Paket.PowerShell.fsproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>1f1581c1-6416-470e-bc48-92c6d4aac785</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>Paket.PowerShell</RootNamespace>
<AssemblyName>Paket.PowerShell</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFSharpCoreVersion>4.3.1.0</TargetFSharpCoreVersion>
<Name>Paket.PowerShell</Name>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<Tailcalls>false</Tailcalls>
<OutputPath>..\..\bin</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<WarningLevel>3</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<Tailcalls>true</Tailcalls>
<OutputPath>..\..\bin</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<WarningLevel>5</WarningLevel>
<DocumentationFile>
</DocumentationFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\FSharp\Microsoft.FSharp.Targets" />
<ItemGroup>
<Compile Include="CmdletExt.fs" />
<Compile Include="UnionArgParserExt.fs" />
<Compile Include="PowerShell.fs" />
<None Include="init.ps1" />
<None Include="paket.references" />
<None Include="paket.template" />
<Compile Include="AssemblyInfo.fs" />
</ItemGroup>
<ItemGroup>
<Reference Include="mscorlib" />
<Reference Include="paket">
<HintPath>..\..\bin\paket.exe</HintPath>
</Reference>
<Reference Include="Paket.Core">
<HintPath>..\..\bin\Paket.Core.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation">
<HintPath>System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Xml" />
</ItemGroup>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\net40\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'MonoAndroid'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\MonoAndroid\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="$(TargetFrameworkIdentifier) == 'MonoTouch'">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\MonoTouch\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETCore') Or ($(TargetFrameworkProfile) == 'Profile7') Or ($(TargetFrameworkProfile) == 'Profile44')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+netcore45+MonoAndroid1+MonoTouch1\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'Silverlight' And $(TargetFrameworkVersion) == 'v5.0') Or ($(TargetFrameworkProfile) == 'Profile24') Or ($(TargetFrameworkProfile) == 'Profile47')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+sl5+netcore45+MonoAndroid1+MonoTouch1\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhone' And ($(TargetFrameworkVersion) == 'v8.0' Or $(TargetFrameworkVersion) == 'v8.1')) Or ($(TargetFrameworkProfile) == 'Profile31') Or ($(TargetFrameworkProfile) == 'Profile49') Or ($(TargetFrameworkProfile) == 'Profile78')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+netcore45+wp8+MonoAndroid1+MonoTouch1\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == 'WindowsPhoneApp') Or ($(TargetFrameworkProfile) == 'Profile32') Or ($(TargetFrameworkProfile) == 'Profile84') Or ($(TargetFrameworkProfile) == 'Profile111') Or ($(TargetFrameworkProfile) == 'Profile151') Or ($(TargetFrameworkProfile) == 'Profile157') Or ($(TargetFrameworkProfile) == 'Profile259')">
<ItemGroup>
<Reference Include="FSharp.Core">
<HintPath>..\..\packages\FSharp.Core\lib\portable-net45+netcore45+wpa81+wp8+MonoAndroid1+MonoTouch1\FSharp.Core.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
<Choose>
<When Condition="$(TargetFrameworkIdentifier) == '.NETFramework' And $(TargetFrameworkVersion) == 'v3.5'">
<ItemGroup>
<Reference Include="UnionArgParser">
<HintPath>..\..\packages\UnionArgParser\lib\net35\UnionArgParser.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
<When Condition="($(TargetFrameworkIdentifier) == '.NETFramework' And ($(TargetFrameworkVersion) == 'v4.0' Or $(TargetFrameworkVersion) == 'v4.5' Or $(TargetFrameworkVersion) == 'v4.5.1' Or $(TargetFrameworkVersion) == 'v4.5.2' Or $(TargetFrameworkVersion) == 'v4.5.3' Or $(TargetFrameworkVersion) == 'v4.6')) Or ($(TargetFrameworkIdentifier) == 'MonoAndroid') Or ($(TargetFrameworkIdentifier) == 'MonoTouch')">
<ItemGroup>
<Reference Include="UnionArgParser">
<HintPath>..\..\packages\UnionArgParser\lib\net40\UnionArgParser.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</When>
</Choose>
</Project>
Loading

0 comments on commit eec6ec8

Please sign in to comment.