Browse Source

PR feedback

pull/195/head
Ryan Nowak 7 years ago
parent
commit
8e809449f5
  1. 6
      src/Microsoft.Tye.Core/DockerContainerBuilder.cs
  2. 9
      src/Microsoft.Tye.Core/ProjectReader.cs
  3. 3
      src/Microsoft.Tye.Core/ProjectServiceBuilder.cs

6
src/Microsoft.Tye.Core/DockerContainerBuilder.cs

@ -59,8 +59,8 @@ namespace Microsoft.Tye
else
{
// We need to write the file, let's stick it under obj.
Directory.CreateDirectory(Path.Combine(project.ProjectFile.DirectoryName, "obj"));
dockerFilePath = Path.Combine(project.ProjectFile.DirectoryName, "obj", "Dockerfile");
Directory.CreateDirectory(project.IntermediateOutputPath);
dockerFilePath = Path.Combine(project.IntermediateOutputPath, "Dockerfile");
// Clean up file when done building image
tempFile = new TempFile(dockerFilePath);
@ -83,7 +83,7 @@ namespace Microsoft.Tye
// Clean up directory when done building image
tempDirectory = new TempDirectory(publishOutput.Directory);
if (File.Exists(dockerFilePath) & container.UseMultiphaseDockerfile == false)
if (File.Exists(dockerFilePath))
{
output.WriteDebugLine($"Using existing Dockerfile '{dockerFilePath}'.");
File.Copy(dockerFilePath, Path.Combine(contextDirectory, "Dockerfile"));

9
src/Microsoft.Tye.Core/ProjectReader.cs

@ -201,12 +201,21 @@ namespace Microsoft.Tye
project.TargetPath = projectInstance.GetPropertyValue("TargetPath");
project.PublishDir = projectInstance.GetPropertyValue("PublishDir");
project.AssemblyName = projectInstance.GetPropertyValue("AssemblyName");
project.IntermediateOutputPath = projectInstance.GetPropertyValue("AssemblyName");
output.WriteDebugLine($"RunCommand={project.RunCommand}");
output.WriteDebugLine($"RunArguments={project.RunArguments}");
output.WriteDebugLine($"TargetPath={project.TargetPath}");
output.WriteDebugLine($"PublishDir={project.PublishDir}");
output.WriteDebugLine($"AssemblyName={project.AssemblyName}");
output.WriteDebugLine($"IntermediateOutputPath={project.IntermediateOutputPath}");
if (!Path.IsPathRooted(project.IntermediateOutputPath))
{
project.IntermediateOutputPath = Path.Combine(project.ProjectFile.DirectoryName, project.IntermediateOutputPath);
}
var targetFramework = projectInstance.GetPropertyValue("TargetFramework");
project.TargetFramework = targetFramework;

3
src/Microsoft.Tye.Core/ProjectServiceBuilder.cs

@ -50,6 +50,9 @@ namespace Microsoft.Tye
// This is always set on the ApplicationFactory codepath.
public string PublishDir { get; set; } = default!;
// This is always set on the ApplicationFactory codepath.
public string IntermediateOutputPath { get; set; } = default!;
// Data used for building containers
public ContainerInfo? ContainerInfo { get; set; }

Loading…
Cancel
Save