Skip to content

Commit

Permalink
Adding bundling of external dlls and a new release binary
Browse files Browse the repository at this point in the history
  • Loading branch information
sverrirs committed Apr 13, 2016
1 parent 60bd700 commit 4d2f66e
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 0 deletions.
Binary file added releases/DnsHelper.exe
Binary file not shown.
Binary file removed releases/UnblockUs-DnsHelper.exe
Binary file not shown.
34 changes: 34 additions & 0 deletions releases/dns.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"title": "Unblock-Us",
"url": "https://www.unblock-us.com/",
"servers": [
{
"title": "Primary",
"dns1": "208.122.23.23",
"dns2": "208.122.23.22"
},
{
"title": "Secondary",
"dns1": "64.145.73.5",
"dns2": "209.107.219.5"
}
]
},
{
"title": "Unlocator",
"url": "https://unlocator.com",
"servers": [
{
"title": "Primary",
"dns1": "185.37.37.37",
"dns2": "185.37.39.39"
},
{
"title": "Beta",
"dns1": "209.177.145.30",
"dns2": "209.177.145.30"
}
]
}
]
47 changes: 47 additions & 0 deletions src/DnsHelperUI/DnsHelperUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<FileAlignment>512</FileAlignment>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
Expand Down Expand Up @@ -112,9 +114,54 @@
<EmbeddedResource Include="img\refresh-16.png" />
</ItemGroup>
<ItemGroup>
<Content Include="FodyWeavers.xml" />
<Content Include="img\icon.ico" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\Fody.1.28.3\build\Fody.targets" Condition="Exists('..\packages\Fody.1.28.3\build\Fody.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\packages\Fody.1.28.3\build\Fody.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Fody.1.28.3\build\Fody.targets'))" />
</Target>
<UsingTask TaskName="CosturaCleanup" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" TaskFactory="CodeTaskFactory">
<ParameterGroup>
<Config Output="false" Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem" />
<Files Output="false" Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
</ParameterGroup>
<Task Evaluate="true">
<Reference xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Include="System.Xml" />
<Reference xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Include="System.Xml.Linq" />
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System" />
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.IO" />
<Using xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Namespace="System.Xml.Linq" />
<Code xmlns="http://schemas.microsoft.com/developer/msbuild/2003" Type="Fragment" Language="cs">
<![CDATA[
var config = XElement.Load(Config.ItemSpec).Elements("Costura").FirstOrDefault();
if (config == null) return true;
var excludedAssemblies = new List<string>();
var attribute = config.Attribute("ExcludeAssemblies");
if (attribute != null)
foreach (var item in attribute.Value.Split('|').Select(x => x.Trim()).Where(x => x != string.Empty))
excludedAssemblies.Add(item);
var element = config.Element("ExcludeAssemblies");
if (element != null)
foreach (var item in element.Value.Split(new[] { "\r\n", "\n" }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).Where(x => x != string.Empty))
excludedAssemblies.Add(item);
var filesToCleanup = Files.Select(f => f.ItemSpec).Where(f => !excludedAssemblies.Contains(Path.GetFileNameWithoutExtension(f), StringComparer.InvariantCultureIgnoreCase));
foreach (var item in filesToCleanup)
File.Delete(item);
]]>
</Code></Task>
</UsingTask>
<Target Name="CleanReferenceCopyLocalPaths" AfterTargets="AfterBuild;NonWinFodyTarget">
<CosturaCleanup Config="FodyWeavers.xml" Files="@(ReferenceCopyLocalPaths->'$(OutDir)%(DestinationSubDirectory)%(Filename)%(Extension)')" />
</Target>
<!-- 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">
Expand Down
5 changes: 5 additions & 0 deletions src/DnsHelperUI/FodyWeavers.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Weavers>
<Costura/>

</Weavers>
2 changes: 2 additions & 0 deletions src/DnsHelperUI/packages.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Costura.Fody" version="1.3.3.0" targetFramework="net461" developmentDependency="true" />
<package id="Fody" version="1.28.3" targetFramework="net461" developmentDependency="true" />
<package id="Newtonsoft.Json" version="8.0.3" targetFramework="net461" />
</packages>

0 comments on commit 4d2f66e

Please sign in to comment.