Last active
April 17, 2020 08:01
-
-
Save alistairjevans/344db3fc54e011b3211334bfc30f4d6c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// <summary> | |
/// Represents the configuration for a single extension to install. | |
/// </summary> | |
public class ExtensionConfiguration | |
{ | |
public string Package { get; set; } | |
public string Version { get; set; } | |
public bool PreRelease { get; set; } | |
} | |
public static void Main(string[] args) | |
{ | |
// Define a source provider, with my own feed. | |
var sourceProvider = new PackageSourceProvider(NullSettings.Instance, new [] | |
{ | |
new PackageSource("https://f.feedz.io/autostep/ci/nuget/index.json") | |
}); | |
// Establish the source repository provider; the available providers come from our custom settings. | |
var sourceRepositoryProvider = new SourceRepositoryProvider(sourceProvider, Repository.Provider.GetCoreV3()); | |
// Get the list of repositories. | |
var repositories = sourceRepositoryProvider.GetRepositories(); | |
// Disposable source cache. | |
using var sourceCacheContext = new SourceCacheContext(); | |
// You should use an actual logger here, this is a NuGet ILogger instance. | |
var logger = new NullLogger(); | |
// My extension configuration: | |
var extensions = new[] { new ExtensionConfiguration | |
{ | |
Package = "AutoStep.Web", | |
PreRelease = true // Allow pre-release versions. | |
}}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment