Skip to content

Commit

Permalink
fix + in paket.template
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Apr 22, 2016
1 parent b677d08 commit 0d22510
Show file tree
Hide file tree
Showing 14 changed files with 165 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
@@ -1,3 +1,6 @@
#### 2.62.7 - 22.04.2016
* BUGFIX: allow directory names with + in paket.template

#### 2.62.6 - 20.04.2016
* Added support for MonoAndroid22 and MonoAndroid23 - https://github.com/fsprojects/Paket/pull/1628
* EXPERIMENTAL: paket resolves runtime dependency libs - https://github.com/fsprojects/Paket/pull/1626
Expand Down
18 changes: 18 additions & 0 deletions integrationtests/Paket.IntegrationTests/PackSpecs.fs
Expand Up @@ -68,6 +68,24 @@ let ``#1376 fail template``() =

File.Delete(Path.Combine(scenarioTempPath "i001376-pack-template","PaketBug","paket.template"))

[<Test>]
let ``#1376 template with plus``() =
let outPath = Path.Combine(scenarioTempPath "i001376-pack-template-plus","out")
let templatePath = Path.Combine(scenarioTempPath "i001376-pack-template-plus","PaketBug", "paket.template")
paket ("pack -v output \"" + outPath + "\" templatefile " + templatePath) "i001376-pack-template-plus" |> ignore
let fileInfo = FileInfo(Path.Combine(outPath, "PaketBug.1.0.0.0.nupkg"))
let (expectedFileSize: int64) = int64(1542)
fileInfo.Length |> shouldBeGreaterThan expectedFileSize

ZipFile.ExtractToDirectory(fileInfo.FullName, outPath)

let expectedFile = Path.Combine(outPath, "content", "net45+net451", "paket.references")

File.Exists expectedFile |> shouldEqual true
File.Delete(templatePath)

File.Delete(Path.Combine(scenarioTempPath "i001376-pack-template-plus","PaketBug","paket.template"))

[<Test>]
let ``#1429 pack deps from template``() =
let outPath = Path.Combine(scenarioTempPath "i001429-pack-deps","out")
Expand Down
Binary file not shown.
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.23107.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PaketBug", "PaketBug\PaketBug.csproj", "{5B41A984-0C88-41C7-8669-41D298D0E450}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5B41A984-0C88-41C7-8669-41D298D0E450}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5B41A984-0C88-41C7-8669-41D298D0E450}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5B41A984-0C88-41C7-8669-41D298D0E450}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5B41A984-0C88-41C7-8669-41D298D0E450}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
@@ -0,0 +1,12 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PaketBug
{
public class Class1
{
}
}
@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.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>
<ProjectGuid>{5B41A984-0C88-41C7-8669-41D298D0E450}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PaketBug</RootNamespace>
<AssemblyName>
</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="Class1.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -0,0 +1,36 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("PaketBug")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PaketBug")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("5b41a984-0c88-41c7-8669-41d298d0e450")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
Binary file not shown.
@@ -0,0 +1 @@
MySql.Data
@@ -0,0 +1,6 @@
type project
id PaketBug
description
Silly empty demo project
files
paket.references => content/net45+net451
@@ -0,0 +1,3 @@
source https://nuget.org/api/v2

nuget MySql.Data 6.9.8
@@ -0,0 +1,4 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
MySql.Data (6.9.8)
2 changes: 1 addition & 1 deletion src/Paket.Core/NupkgWriter.fs
Expand Up @@ -236,7 +236,7 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =
//
// Ref: https://msdn.microsoft.com/en-us/library/system.uri.escapedatastring(v=vs.110).aspx#Anchor_2
// http://tools.ietf.org/html/rfc2396#section-2
let problemChars = ["@","~~at~~"]
let problemChars = ["@","~~at~~"; "+","~~plus~~"]

let fakeEscapeProblemChars (source:string) =
problemChars
Expand Down
5 changes: 4 additions & 1 deletion src/Paket.Core/TemplateFile.fs
Expand Up @@ -297,7 +297,10 @@ module internal TemplateFile =
d.Split '\n'
|> Array.filter (fun s -> (isExclude.IsMatch>>not) s && (isComment.IsMatch>>not) s)
|> Seq.map (fun (line:string) ->
let splitted = line.Split([|"==>"|],StringSplitOptions.None) |> Array.map String.trim
let splitted =
line.Split([|"==>"|],StringSplitOptions.None)
|> Array.collect (fun line -> line.Split([|"=>"|],StringSplitOptions.None))
|> Array.map String.trim
let target = if splitted.Length < 2 then "lib" else splitted.[1]
splitted.[0],target)
|> List.ofSeq
Expand Down

0 comments on commit 0d22510

Please sign in to comment.