Skip to content

Commit

Permalink
added wpath key to define working directory
Browse files Browse the repository at this point in the history
+ .compressor: UTF8 encoding without BOM
  • Loading branch information
3F committed Jun 27, 2016
1 parent b1cbeba commit 176c9e8
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 11 deletions.
4 changes: 2 additions & 2 deletions compact/.compressor
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) 2015 Denis Kuzmin (reg) [ [email protected] ]
Copyright (c) 2015-2016 Denis Kuzmin (reg) [ [email protected] ]
Distributed under the GetNuTool license
https://github.com/3F/GetNuTool
Expand Down Expand Up @@ -113,7 +113,7 @@
return strings[uint.Parse(m.Groups[1].Value)];
});
using(TextWriter writer = new StreamWriter(output, false, System.Text.Encoding.UTF8)) {
using(TextWriter writer = new StreamWriter(output, false, new UTF8Encoding(false))) {
writer.Write(content);
}
Console.WriteLine("Compact version of `{0}` has been created -> `{1}`", core, output);
Expand Down
23 changes: 17 additions & 6 deletions gnt.core
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@

<!-- Entry points -->
<Target Name="get" BeforeTargets="Build" DependsOnTargets="header">
<PrepareList config="$(ngconfig)" plist="$(ngpackages)">
<PrepareList config="$(ngconfig)" plist="$(ngpackages)" wpath="$(wpath)">
<Output PropertyName="plist" TaskParameter="Result" />
</PrepareList>
<NGDownload plist="$(plist)" url="$(ngserver)" defpath="$(ngpath)" debug="$(debug)" />
<NGDownload plist="$(plist)" url="$(ngserver)" wpath="$(wpath)" defpath="$(ngpath)" debug="$(debug)" />
</Target>
<Target Name="pack" DependsOnTargets="header">
<NGPack dir="$(ngin)" dout="$(ngout)" vtool="$(GetNuTool)" debug="$(debug)" />
<NGPack dir="$(ngin)" dout="$(ngout)" wpath="$(wpath)" vtool="$(GetNuTool)" debug="$(debug)" />
</Target>

<!-- Tasks settings -->
Expand All @@ -45,6 +45,7 @@
<ParameterGroup>
<config ParameterType="System.String" Required="true" />
<plist ParameterType="System.String" />
<wpath ParameterType="System.String" />
<Result ParameterType="System.String" Output="true" />
</ParameterGroup>

Expand Down Expand Up @@ -89,8 +90,9 @@
var ret = new Queue<string>();
foreach(var cfg in config.Split('|')) {
if(File.Exists(cfg)) {
h(cfg, ret);
var lcfg = Path.Combine(wpath, cfg ?? "");
if(File.Exists(lcfg)) {
h(lcfg, ret);
}
}
Expand All @@ -109,6 +111,7 @@
<ParameterGroup>
<plist ParameterType="System.String" Required="true" />
<url ParameterType="System.String" Required="true" />
<wpath ParameterType="System.String" />
<defpath ParameterType="System.String" />
<debug ParameterType="System.Boolean" />
</ParameterGroup>
Expand All @@ -129,10 +132,14 @@
Console.WriteLine(s, p);
}
};
Func<string, string> loc = delegate(string p) {
return Path.Combine(wpath, p ?? "");
};
Action<string, string, string> get = delegate(string link, string name, string path)
{
string output = Path.GetFullPath(path ?? name);
string output = Path.GetFullPath(loc(path ?? name));
if(Directory.Exists(output)) {
Console.WriteLine("The `{0}` is already exists. /pass -> `{1}`", name, output);
return;
Expand Down Expand Up @@ -196,6 +203,7 @@
<ParameterGroup>
<dir ParameterType="System.String" Required="true" />
<dout ParameterType="System.String" />
<wpath ParameterType="System.String" />
<vtool ParameterType="System.String" Required="true" />
<debug ParameterType="System.Boolean" />
</ParameterGroup>
Expand Down Expand Up @@ -229,6 +237,9 @@
}
};
dir = Path.Combine(wpath, dir);
dout = Path.Combine(wpath, dout ?? "");
// Get metadata
var nuspec = Directory.GetFiles(dir, "*" + EXT_NUSPEC, SearchOption.TopDirectoryOnly).FirstOrDefault();
Expand Down
4 changes: 2 additions & 2 deletions wrapper/.packer
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<PropertyGroup>
<core Condition="'$(core)' == ''">..\gnt.core</core>
<output Condition="'$(output)' == ''">gnt.bat</output>
<maxline Condition="'$(maxline)' == ''">1024</maxline> <!-- length of line / max 2047 or 8191 characters https://support.microsoft.com/en-us/kb/830473 -->
<maxline Condition="'$(maxline)' == ''">1400</maxline> <!-- length of line / max 2047 or 8191 characters https://support.microsoft.com/en-us/kb/830473 -->
</PropertyGroup>

<!-- Entry point -->
Expand Down Expand Up @@ -139,7 +139,7 @@
// Now we can define, how it should be written into external file
const string corevar = "gntcore";
const string corevar = "tgnt";
content = String.Empty;
foreach(var line in lines) {
Expand Down
2 changes: 1 addition & 1 deletion wrapper/exec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ goto exit
$gnt.core.logic$


%msbuild% %$tpl.corevar$% %* /nologo /verbosity:m
%msbuild% %$tpl.corevar$% %* /nologo /verbosity:m /p:wpath="%~dp0/"


:exit

0 comments on commit 176c9e8

Please sign in to comment.