Bundle deps.json files in tools packages
This commit is contained in:
parent
975e22ad06
commit
b4027529a7
|
|
@ -23,8 +23,9 @@
|
|||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-watch.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-watch.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-watch.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-watch.deps.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-watch.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="tools/*.targets" target="tools\" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
@ -23,6 +23,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"tools/*.targets"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
||||
|
|
|
|||
|
|
@ -23,7 +23,8 @@
|
|||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-sql-cache.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-sql-cache.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-sql-cache.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-sql-cache.deps.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-sql-cache.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
@ -26,7 +26,8 @@
|
|||
</metadata>
|
||||
<files>
|
||||
<file src="FindUserSecretsProperty.targets" target="tools\" />
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-user-secrets.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-user-secrets.runtimeconfig.json" target="lib/netcoreapp1.0\" />
|
||||
<file src="dotnet-user-secrets.dll" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-user-secrets.deps.json" target="lib\netcoreapp1.0\" />
|
||||
<file src="dotnet-user-secrets.runtimeconfig.json" target="lib/netcoreapp1.0\" />
|
||||
</files>
|
||||
</package>
|
||||
|
|
@ -29,6 +29,11 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"publishOptions": {
|
||||
"include": [
|
||||
"*.targets"
|
||||
]
|
||||
},
|
||||
"dependencies": {
|
||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
||||
|
|
|
|||
|
|
@ -29,15 +29,31 @@ namespace NuGetPackager
|
|||
public async Task PackAsync(string nuspec, string config, string outputDir)
|
||||
{
|
||||
var project = ProjectContext.Create(Path.GetDirectoryName(nuspec), FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
||||
var props = "configuration=" + config;
|
||||
var idx = 0;
|
||||
var props = "";
|
||||
var first = false;
|
||||
foreach (var depVersion in GetDependencies(project).OrderBy(p => p.Item1).Select(p => p.Item2))
|
||||
{
|
||||
props += $";dep_{++idx}={depVersion}";
|
||||
}
|
||||
if (first)
|
||||
{
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
props += ";";
|
||||
}
|
||||
|
||||
var buildCommand = Command.CreateDotNet("build",
|
||||
new[] { project.ProjectFile.ProjectFilePath, "--configuration", config },
|
||||
props += $"dep_{++idx}={depVersion}";
|
||||
}
|
||||
var publishDir = Path.Combine(Directory.GetCurrentDirectory(), "artifacts/build", project.ProjectFile.Name);
|
||||
if (Directory.Exists(publishDir))
|
||||
{
|
||||
Directory.Delete(publishDir, recursive: true);
|
||||
}
|
||||
Directory.CreateDirectory(publishDir);
|
||||
|
||||
var buildCommand = Command.CreateDotNet("publish",
|
||||
new[] { project.ProjectFile.ProjectFilePath, "--configuration", config, "--output", publishDir },
|
||||
configuration: config);
|
||||
|
||||
if (buildCommand.Execute().ExitCode != 0)
|
||||
|
|
@ -53,7 +69,8 @@ namespace NuGetPackager
|
|||
"-Verbosity", "detailed",
|
||||
"-OutputDirectory", outputDir,
|
||||
"-Version", version,
|
||||
"-Properties", props);
|
||||
"-Properties", props,
|
||||
"-BasePath", publishDir);
|
||||
}
|
||||
|
||||
private IEnumerable<Tuple<string, string>> GetDependencies(ProjectContext context)
|
||||
|
|
@ -136,7 +153,7 @@ namespace NuGetPackager
|
|||
}
|
||||
|
||||
Console.WriteLine("log : Downloading nuget.exe 3.5.0-rc1".Bold().Black());
|
||||
|
||||
|
||||
var response = await new HttpClient().GetAsync("https://dist.nuget.org/win-x86-commandline/v3.5.0-rc1/NuGet.exe");
|
||||
using (var file = new FileStream(nugetPath, FileMode.CreateNew))
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue