Permalink
Browse files

Some private->internal refactoring.

  • Loading branch information...
1 parent c750b2a commit 9822d09146957f0031420d588fbf97e58886f2d2 Amit Apple committed Jan 16, 2013
Showing with 23 additions and 32 deletions.
  1. +10 −21 Kudu.Core/Deployment/CustomBuilder.cs
  2. +13 −11 Kudu.Core/Deployment/Generator/ExternalCommandBuilder.cs
@@ -18,17 +18,6 @@ public class CustomBuilder : ISiteBuilder
private readonly IBuildPropertyProvider _propertyProvider;
private readonly IDeploymentSettingsManager _settings;
- private const string SourcePath = "DEPLOYMENT_SOURCE";
- private const string TargetPath = "DEPLOYMENT_TARGET";
- private const string BuildTempPath = "DEPLOYMENT_TEMP";
- private const string PreviousManifestPath = "PREVIOUS_MANIFEST_PATH";
- private const string NextManifestPath = "NEXT_MANIFEST_PATH";
- private const string MSBuildPath = "MSBUILD_PATH";
- private const string KuduSyncCommandKey = "KUDU_SYNC_COMMAND";
- private const string SelectNodeVersionCommandKey = "KUDU_SELECT_NODE_VERSION_COMMAND";
- private const string NpmJsPathKey = "NPM_JS_PATH";
- private const string StarterScriptName = "starter.cmd";
-
public CustomBuilder(string repositoryPath, string tempPath, string command, IBuildPropertyProvider propertyProvider, string homePath, string scriptPath, IDeploymentSettingsManager settings)
{
_repositoryPath = repositoryPath;
@@ -50,22 +39,22 @@ public Task Build(DeploymentContext context)
// the repository root
var exe = new Executable(StarterScriptPath, _repositoryPath, _settings.GetCommandIdleTimeout());
exe.AddDeploymentSettingsAsEnvironmentVariables(_settings);
- exe.EnvironmentVariables[SourcePath] = _repositoryPath;
- exe.EnvironmentVariables[TargetPath] = context.OutputPath;
- exe.EnvironmentVariables[PreviousManifestPath] = (context.PreviousManifest != null) ? context.PreviousManifest.ManifestFilePath : String.Empty;
- exe.EnvironmentVariables[NextManifestPath] = context.ManifestWriter.ManifestFilePath;
- exe.EnvironmentVariables[MSBuildPath] = PathUtility.ResolveMSBuildPath();
- exe.EnvironmentVariables[KuduSyncCommandKey] = KuduSyncCommand;
- exe.EnvironmentVariables[SelectNodeVersionCommandKey] = SelectNodeVersionCommand;
- exe.EnvironmentVariables[NpmJsPathKey] = PathUtility.ResolveNpmJsPath();
+ exe.EnvironmentVariables[ExternalCommandBuilder.SourcePath] = _repositoryPath;
+ exe.EnvironmentVariables[ExternalCommandBuilder.TargetPath] = context.OutputPath;
+ exe.EnvironmentVariables[ExternalCommandBuilder.PreviousManifestPath] = (context.PreviousManifest != null) ? context.PreviousManifest.ManifestFilePath : String.Empty;
+ exe.EnvironmentVariables[ExternalCommandBuilder.NextManifestPath] = context.ManifestWriter.ManifestFilePath;
+ exe.EnvironmentVariables[ExternalCommandBuilder.MSBuildPath] = PathUtility.ResolveMSBuildPath();
+ exe.EnvironmentVariables[ExternalCommandBuilder.KuduSyncCommandKey] = KuduSyncCommand;
+ exe.EnvironmentVariables[ExternalCommandBuilder.SelectNodeVersionCommandKey] = SelectNodeVersionCommand;
+ exe.EnvironmentVariables[ExternalCommandBuilder.NpmJsPathKey] = PathUtility.ResolveNpmJsPath();
exe.EnvironmentVariables[WellKnownEnvironmentVariables.NuGetPackageRestoreKey] = "true";
exe.SetHomePath(_homePath);
// Create a directory for the script output temporary artifacts
string buildTempPath = Path.Combine(_tempPath, Guid.NewGuid().ToString());
FileSystemHelpers.EnsureDirectory(buildTempPath);
- exe.EnvironmentVariables[BuildTempPath] = buildTempPath;
+ exe.EnvironmentVariables[ExternalCommandBuilder.BuildTempPath] = buildTempPath;
// Populate the enviornment with the build propeties
foreach (var property in _propertyProvider.GetProperties())
@@ -135,7 +124,7 @@ private string StarterScriptPath
{
get
{
- return Path.Combine(_scriptPath, StarterScriptName);
+ return Path.Combine(_scriptPath, ExternalCommandBuilder.StarterScriptName);
}
}
}
@@ -9,17 +9,19 @@ namespace Kudu.Core.Deployment.Generator
{
public abstract class ExternalCommandBuilder : ISiteBuilder
{
- private const string SourcePath = "DEPLOYMENT_SOURCE";
- private const string TargetPath = "DEPLOYMENT_TARGET";
- private const string BuildTempPath = "DEPLOYMENT_TEMP";
- private const string ManifestPath = "MANIFEST_PATH";
- private const string MSBuildPath = "MSBUILD_PATH";
- private const string PreviousManifestPath = "PREVIOUS_MANIFEST_PATH";
- private const string NextManifestPath = "NEXT_MANIFEST_PATH";
- private const string KuduSyncCommandKey = "KUDU_SYNC_COMMAND";
- private const string SelectNodeVersionCommandKey = "KUDU_SELECT_NODE_VERSION_COMMAND";
- private const string NpmJsPathKey = "NPM_JS_PATH";
- private const string StarterScriptName = "starter.cmd";
+ // TODO: Once CustomBuilder is removed, change all internals back to privates
+
+ internal const string SourcePath = "DEPLOYMENT_SOURCE";
+ internal const string TargetPath = "DEPLOYMENT_TARGET";
+ internal const string BuildTempPath = "DEPLOYMENT_TEMP";
+ internal const string ManifestPath = "MANIFEST_PATH";
+ internal const string MSBuildPath = "MSBUILD_PATH";
+ internal const string PreviousManifestPath = "PREVIOUS_MANIFEST_PATH";
+ internal const string NextManifestPath = "NEXT_MANIFEST_PATH";
+ internal const string KuduSyncCommandKey = "KUDU_SYNC_COMMAND";
+ internal const string SelectNodeVersionCommandKey = "KUDU_SELECT_NODE_VERSION_COMMAND";
+ internal const string NpmJsPathKey = "NPM_JS_PATH";
+ internal const string StarterScriptName = "starter.cmd";
public ExternalCommandBuilder(IEnvironment environment, IDeploymentSettingsManager settings, IBuildPropertyProvider propertyProvider, string repositoryPath)
{

0 comments on commit 9822d09

Please sign in to comment.