Skip to content

Commit

Permalink
Fix zip functions
Browse files Browse the repository at this point in the history
  • Loading branch information
forki committed Mar 28, 2015
1 parent e7ba758 commit 3ad3d4b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 22 deletions.
4 changes: 4 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 0.38.0-alpha001 - 28.03.2015
* Upgrading to .NET 4.5
* Removing DotNetZip and using the .NET 4.5 Zip APIs instead - https://github.com/fsprojects/Paket/pull/732

#### 0.37.0 - 28.03.2015
* Fallback to NuGet.exe if the bootstrapper fails to download from GitHub - https://github.com/fsprojects/Paket/pull/733
* COSMETICS: Display the file name if Paket crashes on some invalid file - https://github.com/fsprojects/Paket/pull/730
Expand Down
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("0.37.0")]
[assembly: AssemblyFileVersionAttribute("0.37.0")]
[assembly: AssemblyInformationalVersionAttribute("0.37.0")]
[assembly: AssemblyVersionAttribute("0.38.0")]
[assembly: AssemblyFileVersionAttribute("0.38.0")]
[assembly: AssemblyInformationalVersionAttribute("0.38.0-apha001")]
namespace System {
internal static class AssemblyVersionInformation {
internal const string Version = "0.37.0";
internal const string Version = "0.38.0";
}
}
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("0.37.0")>]
[<assembly: AssemblyFileVersionAttribute("0.37.0")>]
[<assembly: AssemblyInformationalVersionAttribute("0.37.0")>]
[<assembly: AssemblyVersionAttribute("0.38.0")>]
[<assembly: AssemblyFileVersionAttribute("0.38.0")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.0-apha001")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.37.0"
let [<Literal>] Version = "0.38.0"
20 changes: 12 additions & 8 deletions src/Paket.Core/NupkgWriter.fs
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,11 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =
File.Delete outputPath

use zipFile = ZipFile.Open(outputPath,ZipArchiveMode.Create)

let entries = System.Collections.Generic.List<_>()

let addEntry (zipFile : ZipArchive) path writerF =
entries.Add path |> ignore
let entry = zipFile.CreateEntry(path)
use stream = entry.Open()
writerF stream
Expand All @@ -190,7 +193,9 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =
let rec addDir source target =
for file in Directory.EnumerateFiles(source,"*.*",SearchOption.TopDirectoryOnly) do
let fi = FileInfo file
zipFile.CreateEntryFromFile(fi.FullName,Path.Combine(target,fi.Name)) |> ignore
let path = Path.Combine(target,fi.Name)
entries.Add path |> ignore
zipFile.CreateEntryFromFile(fi.FullName,path) |> ignore

for dir in Directory.EnumerateDirectories(source,"*",SearchOption.TopDirectoryOnly) do
let di = DirectoryInfo dir
Expand All @@ -204,18 +209,17 @@ let Write (core : CompleteCoreInfo) optional workingDir outputDir =
addDir source targetFileName
else
if File.Exists source then
zipFile.CreateEntryFromFile(source, targetFileName) |> ignore
let fi = FileInfo(source)
let path = Path.Combine(targetFileName,fi.Name)
entries.Add path |> ignore
zipFile.CreateEntryFromFile(source, path) |> ignore
else
failwithf "Could not find source file %s" source

// add metadata
for path, writer in writeNupkg core optional do
addEntry zipFile path writer

let fileList =
zipFile.Entries
|> Seq.map (fun e -> e.FullName)

contentTypeDoc fileList
contentTypeDoc (Seq.toList entries)
|> xDocWriter
|> addEntry zipFile contentTypePath
|> addEntry zipFile contentTypePath
8 changes: 4 additions & 4 deletions src/Paket/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("0.37.0")>]
[<assembly: AssemblyFileVersionAttribute("0.37.0")>]
[<assembly: AssemblyInformationalVersionAttribute("0.37.0")>]
[<assembly: AssemblyVersionAttribute("0.38.0")>]
[<assembly: AssemblyFileVersionAttribute("0.38.0")>]
[<assembly: AssemblyInformationalVersionAttribute("0.38.0-apha001")>]
do ()

module internal AssemblyVersionInformation =
let [<Literal>] Version = "0.37.0"
let [<Literal>] Version = "0.38.0"
6 changes: 4 additions & 2 deletions src/Paket/Paket.fsproj
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@
<WarningLevel>3</WarningLevel>
<DocumentationFile>
</DocumentationFile>
<StartArguments>install -v</StartArguments>
<StartArguments>pack output ./temp version 0.37.0 releaseNotes "Fallback
to NuGet.exe if the bootstrapper fails to download from GitHub - https://github.com/fsprojects/Paket/pull/733
COSMETICS: Display the file name if Paket crashes on some invalid file - https://github.com/fsprojects/Paket/pull/730"</StartArguments>
<StartAction>Project</StartAction>
<StartProgram>paket.exe</StartProgram>
<StartWorkingDirectory>D:\code\Paket.Repros</StartWorkingDirectory>
<StartWorkingDirectory>D:\code\Paket</StartWorkingDirectory>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
Expand Down

0 comments on commit 3ad3d4b

Please sign in to comment.