React to kpm subcommand renaming
This commit is contained in:
parent
eabe6b1aa7
commit
117c910f3b
|
|
@ -6,7 +6,7 @@
|
||||||
"node_modules",
|
"node_modules",
|
||||||
"grunt"
|
"grunt"
|
||||||
],
|
],
|
||||||
"packExclude": [
|
"bundleExclude": [
|
||||||
"bower.json",
|
"bower.json",
|
||||||
"package.json",
|
"package.json",
|
||||||
"gruntfile.js",
|
"gruntfile.js",
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
"**/*.cs",
|
"**/*.cs",
|
||||||
"../../test/E2ETests/compiler/shared/**/*.cs" // This code is for testing only.
|
"../../test/E2ETests/compiler/shared/**/*.cs" // This code is for testing only.
|
||||||
],
|
],
|
||||||
"packExclude": "*.cmd",
|
"bundleExclude": "*.cmd",
|
||||||
"webroot": "wwwroot",
|
"webroot": "wwwroot",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"EntityFramework.SqlServer": "7.0.0-*",
|
"EntityFramework.SqlServer": "7.0.0-*",
|
||||||
|
|
|
||||||
|
|
@ -81,8 +81,8 @@ namespace E2ETests
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Cannot override with environment in case of IIS. Pack and write a Microsoft.AspNet.Hosting.ini file.
|
// Cannot override with environment in case of IIS. Bundle and write a Microsoft.AspNet.Hosting.ini file.
|
||||||
startParameters.PackApplicationBeforeStart = true;
|
startParameters.BundleApplicationBeforeStart = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,13 +98,13 @@ namespace E2ETests
|
||||||
startParameters.Dotnet = SwitchPathToDotnetFlavor(startParameters.DotnetFlavor, startParameters.DotnetArchitecture, logger);
|
startParameters.Dotnet = SwitchPathToDotnetFlavor(startParameters.DotnetFlavor, startParameters.DotnetArchitecture, logger);
|
||||||
|
|
||||||
//Reason to do pack here instead of in a common place is use the right Dotnet to do the packing. Previous line switches to use the right Dotnet.
|
//Reason to do pack here instead of in a common place is use the right Dotnet to do the packing. Previous line switches to use the right Dotnet.
|
||||||
if (startParameters.PackApplicationBeforeStart)
|
if (startParameters.BundleApplicationBeforeStart)
|
||||||
{
|
{
|
||||||
if (startParameters.ServerType == ServerType.IISNativeModule ||
|
if (startParameters.ServerType == ServerType.IISNativeModule ||
|
||||||
startParameters.ServerType == ServerType.IIS)
|
startParameters.ServerType == ServerType.IIS)
|
||||||
{
|
{
|
||||||
// Pack to IIS root\application folder.
|
// Bundle to IIS root\application folder.
|
||||||
KpmPack(startParameters, logger, Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + @"\", @"inetpub\wwwroot"));
|
KpmBundle(startParameters, logger, Path.Combine(Environment.GetEnvironmentVariable("SystemDrive") + @"\", @"inetpub\wwwroot"));
|
||||||
|
|
||||||
// Drop a Microsoft.AspNet.Hosting.ini with ASPNET_ENV information.
|
// Drop a Microsoft.AspNet.Hosting.ini with ASPNET_ENV information.
|
||||||
logger.WriteInformation("Creating Microsoft.AspNet.Hosting.ini file with ASPNET_ENV.");
|
logger.WriteInformation("Creating Microsoft.AspNet.Hosting.ini file with ASPNET_ENV.");
|
||||||
|
|
@ -142,7 +142,7 @@ namespace E2ETests
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KpmPack(startParameters, logger);
|
KpmBundle(startParameters, logger);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -179,11 +179,11 @@ namespace E2ETests
|
||||||
throw new Exception("Dotnet not detected on the machine.");
|
throw new Exception("Dotnet not detected on the machine.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startParameters.PackApplicationBeforeStart)
|
if (startParameters.BundleApplicationBeforeStart)
|
||||||
{
|
{
|
||||||
// We use full path to Dotnet to pack.
|
// We use full path to Dotnet to pack.
|
||||||
startParameters.Dotnet = new DirectoryInfo(dotnetBin).Parent.FullName;
|
startParameters.Dotnet = new DirectoryInfo(dotnetBin).Parent.FullName;
|
||||||
KpmPack(startParameters, logger);
|
KpmBundle(startParameters, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mono now supports --appbase
|
//Mono now supports --appbase
|
||||||
|
|
@ -317,11 +317,11 @@ namespace E2ETests
|
||||||
return dotnetName;
|
return dotnetName;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void KpmPack(StartParameters startParameters, ILogger logger, string packRoot = null)
|
private static void KpmBundle(StartParameters startParameters, ILogger logger, string bundleRoot = null)
|
||||||
{
|
{
|
||||||
startParameters.PackedApplicationRootPath = Path.Combine(packRoot ?? Path.GetTempPath(), Guid.NewGuid().ToString());
|
startParameters.BundledApplicationRootPath = Path.Combine(bundleRoot ?? Path.GetTempPath(), Guid.NewGuid().ToString());
|
||||||
|
|
||||||
var parameters = string.Format("pack {0} -o {1} --runtime {2}", startParameters.ApplicationPath, startParameters.PackedApplicationRootPath, startParameters.Dotnet);
|
var parameters = string.Format("bundle {0} -o {1} --runtime {2}", startParameters.ApplicationPath, startParameters.BundledApplicationRootPath, startParameters.Dotnet);
|
||||||
logger.WriteInformation("Executing command kpm {0}", parameters);
|
logger.WriteInformation("Executing command kpm {0}", parameters);
|
||||||
|
|
||||||
var startInfo = new ProcessStartInfo
|
var startInfo = new ProcessStartInfo
|
||||||
|
|
@ -339,10 +339,10 @@ namespace E2ETests
|
||||||
(startParameters.ServerType == ServerType.IISExpress ||
|
(startParameters.ServerType == ServerType.IISExpress ||
|
||||||
startParameters.ServerType == ServerType.IISNativeModule ||
|
startParameters.ServerType == ServerType.IISNativeModule ||
|
||||||
startParameters.ServerType == ServerType.IIS) ?
|
startParameters.ServerType == ServerType.IIS) ?
|
||||||
Path.Combine(startParameters.PackedApplicationRootPath, "wwwroot") :
|
Path.Combine(startParameters.BundledApplicationRootPath, "wwwroot") :
|
||||||
Path.Combine(startParameters.PackedApplicationRootPath, "approot", "src", "MusicStore");
|
Path.Combine(startParameters.BundledApplicationRootPath, "approot", "src", "MusicStore");
|
||||||
|
|
||||||
logger.WriteInformation("kpm pack finished with exit code : {0}", hostProcess.ExitCode);
|
logger.WriteInformation("kpm bundle finished with exit code : {0}", hostProcess.ExitCode);
|
||||||
}
|
}
|
||||||
|
|
||||||
//In case of self-host application activation happens immediately unlike iis where activation happens on first request.
|
//In case of self-host application activation happens immediately unlike iis where activation happens on first request.
|
||||||
|
|
@ -442,12 +442,12 @@ namespace E2ETests
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (startParameters.PackApplicationBeforeStart)
|
if (startParameters.BundleApplicationBeforeStart)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
//We've originally packed the application in a temp folder. We need to delete it.
|
//We've originally bundled the application in a temp folder. We need to delete it.
|
||||||
Directory.Delete(startParameters.PackedApplicationRootPath, true);
|
Directory.Delete(startParameters.BundledApplicationRootPath, true);
|
||||||
}
|
}
|
||||||
catch (Exception exception)
|
catch (Exception exception)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
|
|
||||||
public string ApplicationPath { get; set; }
|
public string ApplicationPath { get; set; }
|
||||||
|
|
||||||
public bool PackApplicationBeforeStart { get; set; }
|
public bool BundleApplicationBeforeStart { get; set; }
|
||||||
|
|
||||||
public string PackedApplicationRootPath { get; set; }
|
public string BundledApplicationRootPath { get; set; }
|
||||||
|
|
||||||
public string Dotnet { get; set; }
|
public string Dotnet { get; set; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ namespace E2ETests
|
||||||
ServerType = serverType,
|
ServerType = serverType,
|
||||||
DotnetFlavor = dotnetFlavor,
|
DotnetFlavor = dotnetFlavor,
|
||||||
DotnetArchitecture = architecture,
|
DotnetArchitecture = architecture,
|
||||||
PackApplicationBeforeStart = true
|
BundleApplicationBeforeStart = true
|
||||||
};
|
};
|
||||||
|
|
||||||
var testStartTime = DateTime.Now;
|
var testStartTime = DateTime.Now;
|
||||||
|
|
@ -95,7 +95,7 @@ namespace E2ETests
|
||||||
{
|
{
|
||||||
if (Directory.GetFiles(_startParameters.ApplicationPath, "*.cmd", SearchOption.TopDirectoryOnly).Length > 0)
|
if (Directory.GetFiles(_startParameters.ApplicationPath, "*.cmd", SearchOption.TopDirectoryOnly).Length > 0)
|
||||||
{
|
{
|
||||||
throw new Exception("packExclude parameter values are not honored.");
|
throw new Exception("bundleExclude parameter values are not honored.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue