Skip to content

Commit

Permalink
Merge pull request #1420 from fsprojects/fixtemplate
Browse files Browse the repository at this point in the history
Pack with concrete template file should work for type project
  • Loading branch information
forki committed Jan 20, 2016
2 parents 1f2b513 + e9cdeeb commit 844dcb8
Show file tree
Hide file tree
Showing 14 changed files with 164 additions and 6 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#### 2.46.2 - 20.01.2016
* BUGFIX: Pack with concrete template file should work for type project - https://github.com/fsprojects/Paket/issues/1414

#### 2.46.1 - 19.01.2016
* BUGFIX: Don't use symbol packages when using filesystem source with symbol package - https://github.com/fsprojects/Paket/issues/1413

Expand Down
11 changes: 11 additions & 0 deletions integrationtests/Paket.IntegrationTests/PackSpecs.fs
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,14 @@ let ``#1375 pack with projectUrl commandline``() =
paket ("pack -v output \"" + outPath + "\" project-url \"http://localhost\"") "i001375-pack-specific" |> ignore

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

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

File.Delete(Path.Combine(scenarioTempPath "i001376-pack-template","PaketBug","paket.template"))
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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
{
}
}
Original file line number Diff line number Diff line change
@@ -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>
Original file line number Diff line number Diff line change
@@ -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.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MySql.Data
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type project
id PaketBug
description
Silly empty demo project
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
source https://nuget.org/api/v2

nuget MySql.Data 6.9.8
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NUGET
remote: https://www.nuget.org/api/v2
specs:
MySql.Data (6.9.8)
10 changes: 7 additions & 3 deletions src/Paket.Core/PackageProcess.fs
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,7 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon

// load up project files and grab meta data
let projectTemplates =
match templateFile with
| Some template -> Map.empty
| None ->
let getAllProjectsFiles workingDir =
ProjectFile.FindAllProjects workingDir
|> Array.choose (fun projectFile ->
match ProjectFile.FindTemplatesFile(FileInfo(projectFile.FileName)) with
Expand All @@ -141,6 +139,12 @@ let Pack(workingDir,dependencies : DependenciesFile, packageOutputPath, buildCon
Path.GetFullPath projectFile.FileName |> normalizePath,(merged,projectFile))
|> Map.ofArray

match templateFile with
| Some template ->
getAllProjectsFiles (FileInfo(template).Directory.FullName)
|> Map.filter (fun p (t,_) -> normalizePath t.FileName = normalizePath template)
| None -> getAllProjectsFiles workingDir

// add dependencies
let allTemplates =
let optWithSymbols projectFile templateFile =
Expand Down
4 changes: 2 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
<StartArguments>pack output D:\code\paketbug\output</StartArguments>
<StartArguments>install</StartArguments>
<StartArguments>restore</StartArguments>
<StartArguments>update</StartArguments>
<StartArguments>pack -v output "D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp\out" templatefile "D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp\PaketBug\paket.template"</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>c:\code\Paketkopie</StartWorkingDirectory>
Expand All @@ -48,7 +48,7 @@
<StartWorkingDirectory>d:\code\paketrepro</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001270-net461\temp</StartWorkingDirectory>
<StartWorkingDirectory>C:\code\restore</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001387-nugetv3\temp</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket\integrationtests\scenarios\i001376-pack-template\temp</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@
<Name>Paket.Bootstrapper</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>

This comment has been minimized.

Copy link
@forki

forki Jan 20, 2016

Author Member

I still don't get where this is coming from. saw it a couple of times now

This comment has been minimized.

Copy link
@kerams
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Reference Include="nunit.framework">
<HintPath>..\..\packages\test\NUnit\lib\nunit.framework.dll</HintPath>
<Private>True</Private>
<Paket>True</Paket>
</Reference>
</ItemGroup>
</Project>
</Project>

0 comments on commit 844dcb8

Please sign in to comment.