diff --git a/src/chocolatey/chocolatey.csproj b/src/chocolatey/chocolatey.csproj index 09c652bd51..6b7786ad45 100644 --- a/src/chocolatey/chocolatey.csproj +++ b/src/chocolatey/chocolatey.csproj @@ -98,6 +98,7 @@ + @@ -159,7 +160,7 @@ - + diff --git a/src/chocolatey/infrastructure.app/domain/SpecialSourceType.cs b/src/chocolatey/infrastructure.app/domain/SourceType.cs similarity index 93% rename from src/chocolatey/infrastructure.app/domain/SpecialSourceType.cs rename to src/chocolatey/infrastructure.app/domain/SourceType.cs index 2ae07f5e69..6c193ef063 100644 --- a/src/chocolatey/infrastructure.app/domain/SpecialSourceType.cs +++ b/src/chocolatey/infrastructure.app/domain/SourceType.cs @@ -18,7 +18,7 @@ namespace chocolatey.infrastructure.app.domain /// /// Special source modifiers that use alternate sources for packages /// - public enum SpecialSourceType + public enum SourceType { //this is what it should be when it's not set normal, diff --git a/src/chocolatey/infrastructure.app/services/ISourceRunner.cs b/src/chocolatey/infrastructure.app/services/ISourceRunner.cs new file mode 100644 index 0000000000..9845c93aea --- /dev/null +++ b/src/chocolatey/infrastructure.app/services/ISourceRunner.cs @@ -0,0 +1,70 @@ +// Copyright © 2011 - Present RealDimensions Software, LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +namespace chocolatey.infrastructure.app.services +{ + using System; + using System.Collections.Concurrent; + using configuration; + using domain; + using results; + + public interface ISourceRunner + { + /// + /// Gets the source type the source runner implements + /// + /// + /// The type of the source. + /// + SourceType SourceType { get; } + + /// + /// Ensures the application that controls a source is installed + /// + /// The configuration. + /// The action to continue with as part of the install + void ensure_source_app_installed(ChocolateyConfiguration config, Action ensureAction); + + /// + /// Run list in noop mode + /// + /// The configuration. + void list_noop(ChocolateyConfiguration config); + + /// + /// Lists/searches for packages from the source feed + /// + /// The configuration. + /// Should results be logged? + /// + ConcurrentDictionary list_run(ChocolateyConfiguration config, bool logResults); + + /// + /// Run install in noop mode + /// + /// The configuration. + /// The action to continue with for each noop test install. + void install_noop(ChocolateyConfiguration config, Action continueAction); + + /// + /// Installs packages from the source feed + /// + /// The configuration. + /// The action to continue with when install is successful. + /// results of installs + ConcurrentDictionary install_run(ChocolateyConfiguration config, Action continueAction); + } +} \ No newline at end of file