Skip to content
This repository was archived by the owner on Dec 18, 2017. It is now read-only.

Commit 050fa03

Browse files
committed
Merge branch 'release' into dev
2 parents 3de7bcb + a0a1783 commit 050fa03

File tree

5 files changed

+35
-35
lines changed

5 files changed

+35
-35
lines changed
Binary file not shown.

src/Microsoft.Dnx.Tooling/Publish/PublishProject.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -554,7 +554,7 @@ private bool GenerateWebConfigFileForWwwRootOut(PublishRoot root, Runtime.Projec
554554
<handlers>
555555
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
556556
</handlers>
557-
<httpPlatform processPath=""..\{command}.cmd""
557+
<httpPlatform processPath=""..\approot\{command}.cmd""
558558
arguments=""""
559559
stdoutLogEnabled=""true""
560560
stdoutLogFile=""..\logs\stdout.log"">

src/Microsoft.Dnx.Tooling/Publish/PublishRoot.cs

+8-8
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ private void GenerateBatchFiles()
9999
string relativeAppBase;
100100
if (NoSource)
101101
{
102-
relativeAppBase = $@"{AppRootName}\packages\{_project.Name}\{_project.Version}\root";
102+
relativeAppBase = $@"packages\{_project.Name}\{_project.Version}\root";
103103
}
104104
else
105105
{
106-
relativeAppBase = $@"{AppRootName}\src\{_project.Name}";
106+
relativeAppBase = $@"src\{_project.Name}";
107107
}
108108

109109
foreach (var commandName in _project.Commands.Keys)
@@ -114,11 +114,11 @@ private void GenerateBatchFiles()
114114
runtimeFolder = Runtimes.First().Name;
115115
}
116116

117-
var cmdPath = Path.Combine(OutputPath, commandName + ".cmd");
117+
var cmdPath = Path.Combine(OutputPath, AppRootName, commandName + ".cmd");
118118
var cmdScript = $@"
119119
@echo off
120120
SET DNX_FOLDER={runtimeFolder}
121-
SET ""LOCAL_DNX=%~dp0{AppRootName}\runtimes\%DNX_FOLDER%\bin\{Runtime.Constants.BootstrapperExeName}.exe""
121+
SET ""LOCAL_DNX=%~dp0runtimes\%DNX_FOLDER%\bin\{Runtime.Constants.BootstrapperExeName}.exe""
122122
123123
IF EXIST %LOCAL_DNX% (
124124
SET ""DNX_PATH=%LOCAL_DNX%""
@@ -152,11 +152,11 @@ private void GenerateBashScripts()
152152
string relativeAppBase;
153153
if (NoSource)
154154
{
155-
relativeAppBase = $"{AppRootName}/packages/{_project.Name}/{_project.Version}/root";
155+
relativeAppBase = $"packages/{_project.Name}/{_project.Version}/root";
156156
}
157157
else
158158
{
159-
relativeAppBase = $"{AppRootName}/src/{_project.Name}";
159+
relativeAppBase = $"src/{_project.Name}";
160160
}
161161

162162
foreach (var commandName in _project.Commands.Keys)
@@ -165,10 +165,10 @@ private void GenerateBashScripts()
165165
if (Runtimes.Any())
166166
{
167167
var runtime = Runtimes.First().Name;
168-
runtimeFolder = $@"$DIR/{AppRootName}/runtimes/{runtime}/bin/";
168+
runtimeFolder = $@"$DIR/runtimes/{runtime}/bin/";
169169
}
170170

171-
var scriptPath = Path.Combine(OutputPath, commandName);
171+
var scriptPath = Path.Combine(OutputPath, AppRootName, commandName);
172172
var scriptContents = $@"#!/usr/bin/env bash
173173
174174
SOURCE=""${{BASH_SOURCE[0]}}""

test/Microsoft.Dnx.Tooling.FunctionalTests/DnuPublishTests.cs

+22-22
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public class DnuPublishTests
2424
private static readonly string BatchFileTemplate = @"
2525
@echo off
2626
SET DNX_FOLDER={0}
27-
SET ""LOCAL_DNX=%~dp0approot\runtimes\%DNX_FOLDER%\bin\{1}.exe""
27+
SET ""LOCAL_DNX=%~dp0runtimes\%DNX_FOLDER%\bin\{1}.exe""
2828
2929
IF EXIST %LOCAL_DNX% (
3030
SET ""DNX_PATH=%LOCAL_DNX%""
@@ -47,7 +47,7 @@ @echo off
4747
SET ""DNX_PATH={1}.exe""
4848
)
4949
50-
@""%DNX_PATH%"" --project ""%~dp0approot\src\{2}"" --configuration {3} {4} %*
50+
@""%DNX_PATH%"" --project ""%~dp0src\{2}"" --configuration {3} {4} %*
5151
";
5252

5353
private static readonly string BashScriptTemplate = @"#!/usr/bin/env bash
@@ -60,7 +60,7 @@ @echo off
6060
done
6161
DIR=""$( cd -P ""$( dirname ""$SOURCE"" )"" && pwd )""
6262
63-
exec ""{1}{2}"" --project ""$DIR/approot/src/{0}"" --configuration {3} {4} ""$@""".Replace("\r\n", "\n");
63+
exec ""{1}{2}"" --project ""$DIR/src/{0}"" --configuration {3} {4} ""$@""".Replace("\r\n", "\n");
6464

6565
private static readonly string BasicLockFileTemplate = @"{
6666
""locked"": false,
@@ -169,7 +169,7 @@ public void DnuPublishWebApp_RootAsPublicFolder(string flavor, string os, string
169169
<handlers>
170170
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
171171
</handlers>
172-
<httpPlatform processPath=""..\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
172+
<httpPlatform processPath=""..\approot\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
173173
</system.webServer>
174174
</configuration>";
175175

@@ -277,7 +277,7 @@ public void DnuPublishWebApp_SubfolderAsPublicFolder(string flavor, string os, s
277277
<handlers>
278278
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
279279
</handlers>
280-
<httpPlatform processPath=""..\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
280+
<httpPlatform processPath=""..\approot\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
281281
</system.webServer>
282282
</configuration>";
283283

@@ -1261,7 +1261,7 @@ public void DnuPublishWebApp_CopyExistingWebConfig(string flavor, string os, str
12611261
<handlers>
12621262
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
12631263
</handlers>
1264-
<httpPlatform processPath=""..\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
1264+
<httpPlatform processPath=""..\approot\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
12651265
</system.webServer>
12661266
</configuration>";
12671267

@@ -1353,7 +1353,7 @@ public void DnuPublishWebApp_UpdateExistingWebConfig(string flavor, string os, s
13531353
<handlers>
13541354
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
13551355
</handlers>
1356-
<httpPlatform processPath=""..\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log"" rapidFailsPerMinute=""5""></httpPlatform>
1356+
<httpPlatform processPath=""..\approot\web.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log"" rapidFailsPerMinute=""5""></httpPlatform>
13571357
</system.webServer>
13581358
</configuration>";
13591359

@@ -1415,8 +1415,8 @@ public void GenerateBatchFilesAndBashScriptsWithoutPublishedRuntime(string flavo
14151415
'packages': {}
14161416
}";
14171417
var expectedOutputStructure = @"{
1418-
'.': ['run.cmd', 'run', 'kestrel.cmd', 'kestrel'],
14191418
'approot': {
1419+
'.' : ['run.cmd', 'run', 'kestrel.cmd', 'kestrel'],
14201420
'global.json': '',
14211421
'src': {
14221422
'PROJECT_NAME': {
@@ -1496,11 +1496,11 @@ public void GenerateBatchFilesAndBashScriptsWithoutPublishedRuntime(string flavo
14961496
],
14971497
""packages"": ""packages""
14981498
}")
1499-
.WithFileContents("run.cmd", BatchFileTemplate, string.Empty, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "run")
1500-
.WithFileContents("kestrel.cmd", BatchFileTemplate, string.Empty, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "kestrel")
1501-
.WithFileContents("run",
1499+
.WithFileContents(Path.Combine("approot", "run.cmd"), BatchFileTemplate, string.Empty, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "run")
1500+
.WithFileContents(Path.Combine("approot", "kestrel.cmd"), BatchFileTemplate, string.Empty, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "kestrel")
1501+
.WithFileContents(Path.Combine("approot", "run"),
15021502
BashScriptTemplate, testEnv.ProjectName, string.Empty, Constants.BootstrapperExeName, configuration, "run")
1503-
.WithFileContents("kestrel",
1503+
.WithFileContents(Path.Combine("approot", "kestrel"),
15041504
BashScriptTemplate, testEnv.ProjectName, string.Empty, Constants.BootstrapperExeName, configuration, "kestrel");
15051505

15061506
Assert.True(expectedOutputDir.MatchDirectoryOnDisk(testEnv.PublishOutputDirPath,
@@ -1523,8 +1523,8 @@ public void GenerateBatchFilesAndBashScriptsWithPublishedRuntime(string flavor,
15231523
'packages': {}
15241524
}";
15251525
var expectedOutputStructure = @"{
1526-
'.': ['run.cmd', 'run', 'kestrel.cmd', 'kestrel'],
15271526
'approot': {
1527+
'.': ['run.cmd', 'run', 'kestrel.cmd', 'kestrel'],
15281528
'global.json': '',
15291529
'src': {
15301530
'PROJECT_NAME': {
@@ -1583,8 +1583,8 @@ public void GenerateBatchFilesAndBashScriptsWithPublishedRuntime(string flavor,
15831583
.RemoveFile(Path.Combine("bin", "lib", "Microsoft.Dnx.Tooling",
15841584
"bin", "profile", "startup.prof"));
15851585

1586-
var batchFileBinPath = string.Format(@"%~dp0approot\runtimes\{0}\bin\", runtimeName);
1587-
var bashScriptBinPath = string.Format("$DIR/approot/runtimes/{0}/bin/", runtimeName);
1586+
var batchFileBinPath = string.Format(@"%~dp0runtimes\{0}\bin\", runtimeName);
1587+
var bashScriptBinPath = string.Format("$DIR/runtimes/{0}/bin/", runtimeName);
15881588

15891589
var expectedOutputDir = DirTree.CreateFromJson(expectedOutputStructure)
15901590
.WithFileContents(Path.Combine("approot", "src", testEnv.ProjectName, "project.json"), @"{
@@ -1617,11 +1617,11 @@ public void GenerateBatchFilesAndBashScriptsWithPublishedRuntime(string flavor,
16171617
],
16181618
""packages"": ""packages""
16191619
}")
1620-
.WithFileContents("run.cmd", BatchFileTemplate, runtimeName, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "run")
1621-
.WithFileContents("kestrel.cmd", BatchFileTemplate, runtimeName, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "kestrel")
1622-
.WithFileContents("run",
1620+
.WithFileContents(Path.Combine("approot", "run.cmd"), BatchFileTemplate, runtimeName, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "run")
1621+
.WithFileContents(Path.Combine("approot", "kestrel.cmd"), BatchFileTemplate, runtimeName, Constants.BootstrapperExeName, testEnv.ProjectName, configuration, "kestrel")
1622+
.WithFileContents(Path.Combine("approot", "run"),
16231623
BashScriptTemplate, testEnv.ProjectName, bashScriptBinPath, Constants.BootstrapperExeName, configuration, "run")
1624-
.WithFileContents("kestrel",
1624+
.WithFileContents(Path.Combine("approot", "kestrel"),
16251625
BashScriptTemplate, testEnv.ProjectName, bashScriptBinPath, Constants.BootstrapperExeName, configuration, "kestrel")
16261626
.WithSubDir(Path.Combine("approot", "runtimes", runtimeName), runtimeSubDir);
16271627

@@ -1636,8 +1636,8 @@ public void PublishWithNoSourceOptionGeneratesLockFileOnClr(string flavor, strin
16361636
{
16371637
const string testApp = "NoDependencies";
16381638
string expectedOutputStructure = @"{
1639-
'.': ['hello', 'hello.cmd'],
16401639
'approot': {
1640+
'.': ['hello', 'hello.cmd'],
16411641
'global.json': '',
16421642
'packages': {
16431643
'NoDependencies': {
@@ -1740,8 +1740,8 @@ public void PublishWithNoSourceOptionUpdatesLockFileOnClr(string flavor, string
17401740
{
17411741
const string testApp = "NoDependencies";
17421742
string expectedOutputStructure = @"{
1743-
'.': ['hello', 'hello.cmd'],
17441743
'approot': {
1744+
'.': ['hello', 'hello.cmd'],
17451745
'global.json': '',
17461746
'packages': {
17471747
'NoDependencies': {
@@ -1853,8 +1853,8 @@ public void PublishWithIncludeSymbolsOptionIncludesSymbolsAndSourceCode(string f
18531853
{
18541854
const string testApp = "NoDependencies";
18551855
string expectedOutputStructure = @"{
1856-
'.': ['hello', 'hello.cmd'],
18571856
'approot': {
1857+
'.': ['hello', 'hello.cmd'],
18581858
'global.json': '',
18591859
'packages': {
18601860
'NoDependencies': {

test/Microsoft.Dnx.Tooling.FunctionalTests/DnuPublishTests2.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public void PublishedAppRunsFromSource(DnxSdk sdk)
131131
sdk.Dnu.Restore(project).EnsureSuccess();
132132
sdk.Dnu.Publish(project.ProjectDirectory, outputPath).EnsureSuccess();
133133

134-
var executable = Path.Combine(outputPath, "HelloWorld");
134+
var executable = Path.Combine(outputPath, "approot", "HelloWorld");
135135

136136
// Assert
137137
var result = Exec.RunScript(executable, env =>
@@ -155,7 +155,7 @@ public void PublishedAppRunsNoSource(DnxSdk sdk)
155155
sdk.Dnu.Restore(project).EnsureSuccess();
156156
sdk.Dnu.Publish(project.ProjectDirectory, outputPath, "--no-source").EnsureSuccess();
157157

158-
var executable = Path.Combine(outputPath, "HelloWorld");
158+
var executable = Path.Combine(outputPath, "approot", "HelloWorld");
159159

160160
// Assert
161161
var result = Exec.RunScript(executable, env =>
@@ -180,7 +180,7 @@ public void PublishedAppRunsNoSourceAndRT(DnxSdk sdk)
180180
sdk.Dnu.Restore(project).EnsureSuccess();
181181
sdk.Dnu.Publish(project.ProjectDirectory, outputPath, $"--no-source --runtime {sdk.Location}").EnsureSuccess();
182182

183-
var executable = Path.Combine(outputPath, "HelloWorld");
183+
var executable = Path.Combine(outputPath, "approot", "HelloWorld");
184184

185185
// Assert
186186
var result = Exec.RunScript(executable, env =>
@@ -227,7 +227,7 @@ public void PublishedAppWithWebRootDefaults(DnxSdk sdk)
227227
<handlers>
228228
<add name=""httpplatformhandler"" path=""*"" verb=""*"" modules=""httpPlatformHandler"" resourceType=""Unspecified"" />
229229
</handlers>
230-
<httpPlatform processPath=""..\HelloWorld.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
230+
<httpPlatform processPath=""..\approot\HelloWorld.cmd"" arguments="""" stdoutLogEnabled=""true"" stdoutLogFile=""..\logs\stdout.log""></httpPlatform>
231231
</system.webServer>
232232
</configuration>";
233233

0 commit comments

Comments
 (0)