Skip to content

Commit

Permalink
Fix #1128: Switch to embedded symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
tom-englert committed Feb 25, 2024
1 parent 8aee376 commit 99a8fd1
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
3 changes: 3 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup>
<DebugType>embedded</DebugType>
</PropertyGroup>
<ItemGroup>
<None Include="$(MSBuildThisFileDirectory)docs/banner.png" Visible="false" Pack="true" PackagePath="docs/" />
<None Include="$(MSBuildThisFileDirectory)docs/logo.png" Visible="false" Pack="true" PackagePath="docs/" />
Expand Down
7 changes: 2 additions & 5 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ Task("Build")
Verbosity = param.Verbosity,
NoRestore = true,
ArgumentCustomization = args => args
.Append($"/p:ContinuousIntegrationBuild=true")
});
});

Expand Down Expand Up @@ -130,12 +131,8 @@ Task("Create-NuGet-Packages")
Verbosity = param.Verbosity,
NoRestore = true,
NoBuild = true,
IncludeSymbols = true,
SymbolPackageFormat = "snupkg",
OutputDirectory = param.Paths.Directories.NuGetDirectoryPath,
ArgumentCustomization = args => args
.Append("/p:ContinuousIntegrationBuild=true")
.Append("/p:EmbedUntrackedSources=true")
.Append($"/p:Version={param.Version}")
});
});
Expand All @@ -160,7 +157,7 @@ Task("Publish-NuGet-Packages")
.WithCriteria(() => param.ShouldPublish)
.Does(() =>
{
foreach(var package in GetFiles($"{param.Paths.Directories.NuGetDirectoryPath}/*.(nupkg|snupkgs)"))
foreach (var package in GetFiles($"{param.Paths.Directories.NuGetDirectoryPath}/*.nupkg"))
{
DotNetNuGetPush(package.FullPath, new DotNetNuGetPushSettings
{
Expand Down
8 changes: 4 additions & 4 deletions src/Testcontainers/Builders/CommonDirectoryPath.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ public static CommonDirectoryPath GetCallerFileDirectory([CallerFilePath, NotNul

private static string GetDirectoryPath(string path, string searchPattern)
{
return GetDirectoryPath(Directory.Exists(path) ? new DirectoryInfo(path) : null, searchPattern);
return GetDirectoryPath(Directory.Exists(path) ? new DirectoryInfo(path) : null, searchPattern, path);
}

private static string GetDirectoryPath(DirectoryInfo path, string searchPattern)
private static string GetDirectoryPath(DirectoryInfo path, string searchPattern, string originalPath)
{
if (path != null)
{
return path.EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly).Any() ? path.FullName : GetDirectoryPath(path.Parent, searchPattern);
return path.EnumerateFileSystemInfos(searchPattern, SearchOption.TopDirectoryOnly).Any() ? path.FullName : GetDirectoryPath(path.Parent, searchPattern, originalPath);
}

var message = $"Cannot find '{searchPattern}' and resolve the base directory in the directory tree.";
var message = $"Cannot find '{searchPattern}' and resolve the base directory in the directory tree of '{originalPath}'.";
throw new DirectoryNotFoundException(message);
}
}
Expand Down
4 changes: 4 additions & 0 deletions tests/Testcontainers.Tests/Testcontainers.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<EnableSourceLink>false</EnableSourceLink>
<Deterministic>false</Deterministic>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk"/>
<PackageReference Include="coverlet.collector"/>
Expand Down

0 comments on commit 99a8fd1

Please sign in to comment.