Skip to content

Commit 56e4557

Browse files
authored
Add support for slnx (#403)
1 parent 474ae6b commit 56e4557

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"Projects": [
3+
{
4+
"Name": "Amazon.Lambda.Tools",
5+
"Type": "Patch",
6+
"ChangelogMessages": [
7+
"Add support for solutions migrated to slnx"
8+
]
9+
}
10+
]
11+
}

src/Amazon.Common.DotNetCli.Tools/Commands/BasePushDockerImageCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ public static DockerDetails InspectDockerFile(IToolLogger logger, string project
409409
{
410410
var noSpaceLine = line.Replace(" ", "");
411411

412-
if (noSpaceLine.StartsWith("COPY") && (noSpaceLine.EndsWith(".sln./") || (projectFilename != null && noSpaceLine.Contains("/" + projectFilename))))
412+
if (noSpaceLine.StartsWith("COPY") && (noSpaceLine.EndsWith(".sln./") || noSpaceLine.EndsWith(".slnx./") || (projectFilename != null && noSpaceLine.Contains("/" + projectFilename))))
413413
{
414414
details.BuildFromSolutionDirectory = true;
415415
logger?.WriteLine("... Determined that docker build needs to be run from solution folder.");
@@ -437,6 +437,9 @@ public static string DetermineSolutionDirectory(string projectLocation)
437437
{
438438
if (Directory.GetFiles(projectLocation, "*.sln", SearchOption.TopDirectoryOnly).Length != 0)
439439
return projectLocation;
440+
441+
if (Directory.GetFiles(projectLocation, "*.slnx", SearchOption.TopDirectoryOnly).Length != 0)
442+
return projectLocation;
440443

441444
var parent = Directory.GetParent(projectLocation)?.FullName;
442445
if (parent == null)

src/Amazon.Common.DotNetCli.Tools/Utilities.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,11 @@ public static string GetSolutionDirectoryFullPath(string workingDirectory, strin
175175
return currentDirectory.TrimEnd('\\', '/');
176176
}
177177

178+
if (Directory.EnumerateFiles(currentDirectory).Any(x => x.EndsWith(".slnx", StringComparison.OrdinalIgnoreCase)))
179+
{
180+
return currentDirectory.TrimEnd('\\', '/');
181+
}
182+
178183
DirectoryInfo dirInfo = Directory.GetParent(currentDirectory);
179184
if ((dirInfo == null) || !dirInfo.Exists)
180185
{

0 commit comments

Comments
 (0)