Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,7 @@ FakesAssemblies/
# Visual Studio 6 workspace options file
*.opt

*.DS_Store
*.DS_Store

# Compresed files
*.lz4
44 changes: 26 additions & 18 deletions build/add-externals.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,37 @@ function DownloadElasticsearch {
function DownloadJre{
$ErrorActionPreference = "Stop"


$doc = New-Object HtmlAgilityPack.HtmlDocument
$WebResponse = Invoke-WebRequest "http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html"
$doc.LoadHtml($WebResponse.Content)
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

#$doc = New-Object HtmlAgilityPack.HtmlDocument
#$WebResponse = Invoke-WebRequest "http://www.oracle.com/technetwork/java/javase/downloads/jre8-downloads-2133155.html"
#$doc.LoadHtml($WebResponse.Content)

$lines = $doc.DocumentNode.InnerText -split '\r\n?|\n\r?'
#$lines = $doc.DocumentNode.InnerText -split '\r\n?|\n\r?'

$jreLine = $lines| Where { $_.Contains("windows-x64.tar.gz") } | Select -First 1
#$jreLine = $lines| Where { $_.Contains("windows-x64.tar.gz") } | Select -First 1

$jreLine = $jreLine.Substring($jreLine.IndexOf("http"), ($jreLine.LastIndexOf(".tar.gz")+7)-$jreLine.IndexOf("http"))
#$jreLine = $jreLine.Substring($jreLine.IndexOf("http"), ($jreLine.LastIndexOf(".tar.gz")+7)-$jreLine.IndexOf("http"))

$downloadUrl = New-Object System.Uri -ArgumentList @($jreLine)
#$downloadUrl = New-Object System.Uri -ArgumentList @($jreLine)

Write-Host "Downloading " $downloadUrl

$downloadPage = 'http://www.oracle.com/'

$bak = $ProgressPreference
$ProgressPreference = "SilentlyContinue"
Invoke-WebRequest $downloadPage -UseBasicParsing -UseDefaultCredentials -SessionVariable s | Out-Null
$c = New-Object System.Net.Cookie("oraclelicense", "accept-securebackup-cookie", "/", ".oracle.com")
$s.Cookies.Add($downloadPage, $c)
Invoke-WebRequest $downloadUrl -UseBasicParsing -UseDefaultCredentials -WebSession $s -OutFile .\temp\jre.tgz
#Write-Host "Downloading " $downloadUrl

#$downloadPage = 'http://www.oracle.com/'

#$bak = $ProgressPreference
#$ProgressPreference = "SilentlyContinue"
#Invoke-WebRequest $downloadPage -UseBasicParsing -UseDefaultCredentials -SessionVariable s | Out-Null
#$c = New-Object System.Net.Cookie("oraclelicense", "accept-securebackup-cookie", "/", ".oracle.com")
#$s.Cookies.Add($downloadPage, $c)
#Invoke-WebRequest $downloadUrl -UseBasicParsing -UseDefaultCredentials -WebSession $s -OutFile .\temp\jre.tgz

# Added download from third party repository because not able to download from oracle.com
$downloadUrl = "https://github.com/frekele/oracle-java/releases/download/8u212-b10/jre-8u212-windows-x64.tar.gz"
Write-Host "Downloading " $downloadUrl
Invoke-WebRequest $downloadUrl -OutFile .\temp\jre.tgz
Write-Host "done." -ForegroundColor Green

$ProgressPreference = $bak
Write-Host "done." -ForegroundColor Green

Expand Down
Binary file added build/tools/K4os.Compression.LZ4.Streams.dll
Binary file not shown.
296 changes: 296 additions & 0 deletions build/tools/K4os.Compression.LZ4.Streams.xml

Large diffs are not rendered by default.

Binary file added build/tools/K4os.Compression.LZ4.dll
Binary file not shown.
794 changes: 794 additions & 0 deletions build/tools/K4os.Compression.LZ4.xml

Large diffs are not rendered by default.

Binary file added build/tools/K4os.Hash.xxHash.dll
Binary file not shown.
163 changes: 163 additions & 0 deletions build/tools/K4os.Hash.xxHash.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions build/tools/LZ4-encoder/LZ4Encoder/App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
</startup>
</configuration>
</configuration>
53 changes: 50 additions & 3 deletions build/tools/LZ4-encoder/LZ4Encoder/LZ4Encoder.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,27 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>LZ4Encoder</RootNamespace>
<AssemblyName>LZ4Encoder</AssemblyName>
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\source\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand All @@ -35,13 +51,32 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="LZ4PCL">
<HintPath>..\..\..\..\source\packages\LZ4PCL.1.0.0\lib\portable-net4+netcore45+wpa81+MonoAndroid1+MonoTouch1\LZ4PCL.dll</HintPath>
<Reference Include="K4os.Compression.LZ4, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.1.1.11\lib\net46\K4os.Compression.LZ4.dll</HintPath>
</Reference>
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.1.11.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
<HintPath>packages\K4os.Compression.LZ4.Streams.1.1.11\lib\net46\K4os.Compression.LZ4.Streams.dll</HintPath>
</Reference>
<Reference Include="K4os.Hash.xxHash, Version=1.0.6.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
<HintPath>packages\K4os.Hash.xxHash.1.0.6\lib\net46\K4os.Hash.xxHash.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Buffers, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Buffers.4.4.0\lib\netstandard2.0\System.Buffers.dll</HintPath>
</Reference>
<Reference Include="System.Core" />
<Reference Include="System.IO.Compression" />
<Reference Include="System.IO.Compression.FileSystem" />
<Reference Include="System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll</HintPath>
</Reference>
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors, Version=4.1.3.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
</Reference>
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>packages\System.Runtime.CompilerServices.Unsafe.4.5.2\lib\netstandard2.0\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
Expand All @@ -57,6 +92,18 @@
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.7.2">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.7.2 %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
Expand Down
28 changes: 20 additions & 8 deletions build/tools/LZ4-encoder/LZ4Encoder/Program.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
using System;
using System.IO;
using System.IO.Compression;
using K4os.Compression.LZ4.Streams;
using LZ4Encoder.Utilities;
using LZ4PCL;
using CompressionMode = LZ4PCL.CompressionMode;

namespace LZ4Encoder
{
Expand All @@ -24,16 +23,29 @@ static void Main(string[] args)
if (destination.Exists)
throw new ApplicationException("Destination already exists");

/*
using (var source = File.OpenRead(filename))
using (var target = LZ4Stream.Encode(File.Create(filename + ".lz4")))
{
source.CopyTo(target);
}
*/

// mem-stream needs to be here for this to work?
using (var destinationStream = destination.OpenWrite())
using (var memStream = new MemoryStream())
using (var lz4Stream = new LZ4Stream(destinationStream, CompressionMode.Compress, true, true))
{
using (var archiveWriter = new ArchiveWriter(memStream, true))
archiveWriter.AddFiles(source);
using (var memStream = new MemoryStream())
{
//using (var lz4Stream = new LZ4Stream(destinationStream, CompressionMode.Compress, true, true))
using (var lz4Stream = LZ4Stream.Encode(destinationStream))
{
using (var archiveWriter = new ArchiveWriter(memStream, true))
archiveWriter.AddFiles(source);

memStream.Position = 0;
memStream.CopyTo(lz4Stream);
memStream.Position = 0;
memStream.CopyTo(lz4Stream);
}
}
}
}

Expand Down
8 changes: 7 additions & 1 deletion build/tools/LZ4-encoder/LZ4Encoder/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="LZ4PCL" version="1.0.0" targetFramework="net451" />
<package id="K4os.Compression.LZ4" version="1.1.11" targetFramework="net472" />
<package id="K4os.Compression.LZ4.Streams" version="1.1.11" targetFramework="net472" />
<package id="K4os.Hash.xxHash" version="1.0.6" targetFramework="net472" />
<package id="System.Buffers" version="4.4.0" targetFramework="net472" />
<package id="System.Memory" version="4.5.3" targetFramework="net472" />
<package id="System.Numerics.Vectors" version="4.4.0" targetFramework="net472" />
<package id="System.Runtime.CompilerServices.Unsafe" version="4.5.2" targetFramework="net472" />
</packages>
Binary file modified build/tools/LZ4Encoder.exe
Binary file not shown.
Binary file added build/tools/System.Buffers.dll
Binary file not shown.
Loading