Fix dependency loader to properly handle relative local repositories
Fix .csproj to not include default configuration in nuget package
This commit is contained in:
parent
a0a9418bd0
commit
4d6d9d5cd7
@ -44,6 +44,9 @@
|
||||
<Pack>True</Pack>
|
||||
<PackagePath>\</PackagePath>
|
||||
</None>
|
||||
<Content Update="sys.json">
|
||||
<Pack>false</Pack>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="CopyPackages" AfterTargets="Pack">
|
||||
|
@ -159,7 +159,33 @@ public class DependencyLoader
|
||||
private IEnumerable<PackageSource> GetPackageSources(IEnumerable<string> sources)
|
||||
{
|
||||
foreach (var source in sources)
|
||||
yield return new PackageSource(source);
|
||||
{
|
||||
var packageSource = new PackageSource(source);
|
||||
|
||||
if (Uri.TryCreate(source, UriKind.RelativeOrAbsolute, out var sourceUri))
|
||||
{
|
||||
if (!sourceUri.IsAbsoluteUri)
|
||||
packageSource = new PackageSource(Path.GetFullPath(source));
|
||||
}
|
||||
|
||||
//if (packageSource.IsLocal || packageSource.TrySourceAsUri is null)
|
||||
//{
|
||||
// /*
|
||||
// * Suspected local, verify
|
||||
// */
|
||||
// var local = Directory.Exists(source);
|
||||
// if (local)
|
||||
// {
|
||||
// /*
|
||||
// * If it's a cache, add all folders to sources
|
||||
// */
|
||||
// foreach (var directorySource in GetPackageSources(Directory.GetDirectories(source)))
|
||||
// yield return directorySource;
|
||||
// }
|
||||
//}
|
||||
|
||||
yield return packageSource;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
Loading…
x
Reference in New Issue
Block a user