Generate lzma nuget.config when needed
This commit is contained in:
parent
b31b2f429d
commit
131c63ae27
3 changed files with 30 additions and 2 deletions
|
@ -3,7 +3,6 @@
|
||||||
<packageSources>
|
<packageSources>
|
||||||
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
<!--To inherit the global NuGet package sources remove the <clear/> line below -->
|
||||||
<clear />
|
<clear />
|
||||||
<add key="configurable.source" value="%CLI_PACKAGE_SOURCE%" />
|
|
||||||
<add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" />
|
<add key="templating" value="https://dotnet.myget.org/F/templating/api/v3/index.json" />
|
||||||
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
<add key="dotnet-core" value="https://dotnet.myget.org/F/dotnet-core/api/v3/index.json" />
|
||||||
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
|
<add key="cli-deps" value="https://dotnet.myget.org/F/cli-deps/api/v3/index.json" />
|
||||||
|
|
|
@ -67,15 +67,31 @@
|
||||||
<NuGetPackagesArchiveDirectory Include="$(NuGetPackagesArchiveFolder)" />
|
<NuGetPackagesArchiveDirectory Include="$(NuGetPackagesArchiveFolder)" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<NuGetConfigContent>
|
||||||
|
<configuration>
|
||||||
|
<packageSources>
|
||||||
|
<add key="configurable.source" value="%CLI_LZMA_PACKAGE_SOURCE%" />
|
||||||
|
</packageSources>
|
||||||
|
</configuration>
|
||||||
|
</NuGetConfigContent>
|
||||||
|
<LZMANuGetConfigFilePath>$(NuGetPackagesArchiveProject)/Nuget.config</LZMANuGetConfigFilePath>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
<Delete Files="@(FilesToClean)" />
|
<Delete Files="@(FilesToClean)" />
|
||||||
<RemoveDir Directories="@(NuGetPackagesArchiveDirectory)" />
|
<RemoveDir Directories="@(NuGetPackagesArchiveDirectory)" />
|
||||||
<MakeDir Directories="@(NuGetPackagesArchiveDirectory)"/>
|
<MakeDir Directories="@(NuGetPackagesArchiveDirectory)"/>
|
||||||
|
|
||||||
|
<WriteLinesToFile Condition=" 'CLI_LZMA_PACKAGE_SOURCE' != '' "
|
||||||
|
File="$(LZMANuGetConfigFilePath)"
|
||||||
|
Lines="$(NuGetConfigContent)" />
|
||||||
|
|
||||||
<DotNetNew ToolPath="$(Stage2Directory)"
|
<DotNetNew ToolPath="$(Stage2Directory)"
|
||||||
TemplateType="Web"
|
TemplateType="Web"
|
||||||
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web" />
|
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web" />
|
||||||
|
|
||||||
<DotNetRestore ToolPath="$(Stage2Directory)"
|
<DotNetRestore ToolPath="$(Stage2Directory)"
|
||||||
|
IgnoreMissingSources="True"
|
||||||
Packages="$(NuGetPackagesArchiveFolder)"
|
Packages="$(NuGetPackagesArchiveFolder)"
|
||||||
SkipInvalidConfigurations="True"
|
SkipInvalidConfigurations="True"
|
||||||
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web" />
|
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web" />
|
||||||
|
@ -85,6 +101,7 @@
|
||||||
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
|
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
|
||||||
|
|
||||||
<DotNetRestore ToolPath="$(Stage2Directory)"
|
<DotNetRestore ToolPath="$(Stage2Directory)"
|
||||||
|
IgnoreMissingSources="True"
|
||||||
Packages="$(NuGetPackagesArchiveFolder)"
|
Packages="$(NuGetPackagesArchiveFolder)"
|
||||||
SkipInvalidConfigurations="True"
|
SkipInvalidConfigurations="True"
|
||||||
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
|
WorkingDirectory="$(NuGetPackagesArchiveProject)/Web1.1" />
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
protected override string Args
|
protected override string Args
|
||||||
{
|
{
|
||||||
get { return $"{GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
|
get { return $"{GetProjectPath()} {GetConfigFile()} {GetSource()} {GetPackages()} {GetIgnoreMissingSources()} {GetSkipInvalidConfigurations()} {GetRuntime()} {GetAdditionalParameters()}"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public string ConfigFile { get; set; }
|
public string ConfigFile { get; set; }
|
||||||
|
@ -26,6 +26,8 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
public string Packages { get; set; }
|
public string Packages { get; set; }
|
||||||
|
|
||||||
public bool SkipInvalidConfigurations { get; set; }
|
public bool SkipInvalidConfigurations { get; set; }
|
||||||
|
|
||||||
|
public bool IgnoreMissingSources { get; set; }
|
||||||
|
|
||||||
public string Runtime { get; set; }
|
public string Runtime { get; set; }
|
||||||
|
|
||||||
|
@ -78,6 +80,16 @@ namespace Microsoft.DotNet.Cli.Build
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string GetIgnoreMissingSources()
|
||||||
|
{
|
||||||
|
if (IgnoreMissingSources)
|
||||||
|
{
|
||||||
|
return "--ignore-failed-sources";
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
private string GetRuntime()
|
private string GetRuntime()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue