Bundle deps.json files in tools packages
This commit is contained in:
parent
975e22ad06
commit
b4027529a7
|
|
@ -23,8 +23,9 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-watch.dll" target="lib\netcoreapp1.0\" />
|
<file src="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.deps.json" target="lib\netcoreapp1.0\" />
|
||||||
|
<file src="dotnet-watch.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||||
<file src="tools/*.targets" target="tools\" />
|
<file src="tools/*.targets" target="tools\" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
@ -23,6 +23,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"publishOptions": {
|
||||||
|
"include": [
|
||||||
|
"tools/*.targets"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||||
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,8 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-sql-cache.dll" target="lib\netcoreapp1.0\" />
|
<file src="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.deps.json" target="lib\netcoreapp1.0\" />
|
||||||
|
<file src="dotnet-sql-cache.runtimeconfig.json" target="lib\netcoreapp1.0\" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
@ -26,7 +26,8 @@
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
<file src="FindUserSecretsProperty.targets" target="tools\" />
|
<file src="FindUserSecretsProperty.targets" target="tools\" />
|
||||||
<file src="bin/$configuration$/netcoreapp1.0/dotnet-user-secrets.dll" target="lib\netcoreapp1.0\" />
|
<file src="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.deps.json" target="lib\netcoreapp1.0\" />
|
||||||
|
<file src="dotnet-user-secrets.runtimeconfig.json" target="lib/netcoreapp1.0\" />
|
||||||
</files>
|
</files>
|
||||||
</package>
|
</package>
|
||||||
|
|
@ -29,6 +29,11 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"publishOptions": {
|
||||||
|
"include": [
|
||||||
|
"*.targets"
|
||||||
|
]
|
||||||
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
"Microsoft.DotNet.Cli.Utils": "1.0.0-*",
|
||||||
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
"Microsoft.Extensions.CommandLineUtils": "1.1.0-*",
|
||||||
|
|
|
||||||
|
|
@ -29,15 +29,31 @@ namespace NuGetPackager
|
||||||
public async Task PackAsync(string nuspec, string config, string outputDir)
|
public async Task PackAsync(string nuspec, string config, string outputDir)
|
||||||
{
|
{
|
||||||
var project = ProjectContext.Create(Path.GetDirectoryName(nuspec), FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
var project = ProjectContext.Create(Path.GetDirectoryName(nuspec), FrameworkConstants.CommonFrameworks.NetCoreApp10);
|
||||||
var props = "configuration=" + config;
|
|
||||||
var idx = 0;
|
var idx = 0;
|
||||||
|
var props = "";
|
||||||
|
var first = false;
|
||||||
foreach (var depVersion in GetDependencies(project).OrderBy(p => p.Item1).Select(p => p.Item2))
|
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",
|
props += $"dep_{++idx}={depVersion}";
|
||||||
new[] { project.ProjectFile.ProjectFilePath, "--configuration", config },
|
}
|
||||||
|
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);
|
configuration: config);
|
||||||
|
|
||||||
if (buildCommand.Execute().ExitCode != 0)
|
if (buildCommand.Execute().ExitCode != 0)
|
||||||
|
|
@ -53,7 +69,8 @@ namespace NuGetPackager
|
||||||
"-Verbosity", "detailed",
|
"-Verbosity", "detailed",
|
||||||
"-OutputDirectory", outputDir,
|
"-OutputDirectory", outputDir,
|
||||||
"-Version", version,
|
"-Version", version,
|
||||||
"-Properties", props);
|
"-Properties", props,
|
||||||
|
"-BasePath", publishDir);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerable<Tuple<string, string>> GetDependencies(ProjectContext context)
|
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());
|
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");
|
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))
|
using (var file = new FileStream(nugetPath, FileMode.CreateNew))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue