Skip to content
This repository was archived by the owner on Aug 2, 2019. It is now read-only.
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
16 changes: 10 additions & 6 deletions PdfiumBuild/Env.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,16 @@
using System.Net;
using System.Text;
using ICSharpCode.SharpZipLib.Zip;
using NLog;

namespace PdfiumBuild
{
internal class Env
{
private readonly string _build;
private static Logger logger = LogManager.GetCurrentClassLogger();


private readonly string _build;
private readonly Dictionary<string, string> _environmentVariables = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
private string _depotTools;
private string _repo;
Expand All @@ -35,7 +39,7 @@ public Env(Arguments arguments)
_environmentVariables.Add((string)entry.Key, (string)entry.Value);
}

Console.WriteLine("Detecting Windows 10 SDK");
logger.Info("Detecting Windows 10 SDK");

string sdkDirectory = @"C:\Program Files (x86)\Windows Kits\10";
string cdb = Path.Combine(sdkDirectory, "Debuggers", "x64", "cdb.exe");
Expand All @@ -57,7 +61,7 @@ public void Setup()

private void ClonePdfium()
{
Console.WriteLine("Getting Pdfium");
logger.Info("Getting Pdfium");

_repo = Path.Combine(_build, "repo");

Expand All @@ -80,7 +84,7 @@ private void SetupDepotTools()

const string url = "https://storage.googleapis.com/chrome-infra/depot_tools.zip";

Console.WriteLine("Downloading and extracting " + url);
logger.Info("Downloading and extracting " + url);

string target = Path.Combine(_build, "depot_tools.zip");

Expand All @@ -99,7 +103,7 @@ private void SetupDepotTools()

private void CreateBuildDirectory()
{
Console.WriteLine($"Creating build directory at {_build}");
logger.Info($"Creating build directory at {_build}");

if (Directory.Exists(_build))
DirectoryEx.DeleteAll(_build, true);
Expand Down Expand Up @@ -128,7 +132,7 @@ public void RunCommand(string exe, params object[] args)
startInfo.EnvironmentVariables[entry.Key] = entry.Value;
}

Console.WriteLine($"Running {startInfo.FileName} {BuildArguments(args, false)}");
logger.Info($"Running {startInfo.FileName} {BuildArguments(args, false)}");

var process = new Process
{
Expand Down
27 changes: 27 additions & 0 deletions PdfiumBuild/NLog.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8" ?>
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.nlog-project.org/schemas/NLog.xsd NLog.xsd"
autoReload="true"
throwExceptions="false"
internalLogLevel="Off"
internalLogFile="nlog-internal.log">


<targets>

<target xsi:type="File"
name="f"
fileName="${basedir}/logs/${shortdate}.log"
layout="${longdate} ${uppercase:${level}} ${message}" />

</targets>

<rules>

<logger name="*"
minlevel="Debug"
writeTo="f" />

</rules>
</nlog>
Loading