public CKSetupStoreTestHelperConfigFile( GitFolder f, SolutionDriver solutionDriver, SolutionSpec settings, IEnvLocalFeedProvider localFeedProvider, NormalizedPath branchPath) : base(f, branchPath, branchPath.AppendPart("RemoteStore.TestHelper.config")) { _solutionSpec = settings; _solutionDriver = solutionDriver; _localFeedProvider = localFeedProvider; // Always monitor branch change even if _settings.ProduceCKSetupComponents is false // so that we delete the test file on leaving local if it happens to exist. if (PluginBranch == StandardGitStatus.Local) { f.OnLocalBranchEntered += OnLocalBranchEntered; f.OnLocalBranchLeaving += OnLocalBranchLeaving; } // If the settings states that CKSetup is not used, there is no need to react to builds. if (_solutionSpec.UseCKSetup) { _solutionDriver.OnStartBuild += OnStartBuild; _solutionDriver.OnEndBuild += OnEndBuild; } }
public AppveyorFile(GitFolder f, SolutionDriver driver, SolutionSpec settings, SecretKeyStore keyStore, SharedWorldState sharedState, NormalizedPath branchPath) : base(f, branchPath, branchPath.AppendPart("appveyor.yml")) { _driver = driver; _solutionSpec = settings; _keyStore = keyStore; _sharedState = sharedState; }
public CSProjFile( GitFolder f, NormalizedPath branchPath, SolutionDriver solutionDriver) : base(f, branchPath) { _solutionDriver = solutionDriver; }
public NPMProjectsDriver(GitFolder f, NormalizedPath branchPath, SolutionDriver driver, SolutionSpec spec) : base(f, branchPath) { _driver = driver; _spec = spec; _driver.OnSolutionConfiguration += OnSolutionConfiguration; _driver.OnUpdatePackageDependency += OnUpdatePackageDependency; }
public XmlFilePluginBase(GitFolder f, NormalizedPath branchPath, NormalizedPath filePath, Encoding encoding) : base(f.FileSystem, filePath, encoding) { if (!filePath.StartsWith(branchPath)) { throw new ArgumentException($"Path {filePath} must start with folder {f.SubPath}."); } _pluginImpl = new GitBranchPluginImpl(f, branchPath); }
public NPMRCFiles(GitFolder f, NPMProjectsDriver driver, SolutionDriver solutionDriver, SecretKeyStore secretStore, SolutionSpec solutionSpec, NormalizedPath branchPath) : base(f, branchPath) { _solutionDriver = solutionDriver; _solutionSpec = solutionSpec; _driver = driver; _secretStore = secretStore; _solutionDriver.OnSolutionConfiguration += OnSolutionConfiguration; }
public RepositoryXmlFile(GitFolder f, NormalizedPath branchPath, SolutionDriver driver) : base(f, branchPath, branchPath.AppendPart("RepositoryInfo.xml"), null) { if (PluginBranch == StandardGitStatus.Local) { f.OnLocalBranchEntered += OnLocalBranchEntered; f.OnLocalBranchLeaving += OnLocalBranchLeaving; } _driver = driver; _driver.OnStartBuild += OnStartBuild; _driver.OnEndBuild += OnEndBuild; }
/// <summary> /// Gets a <see cref="IFileInfo"/> in the <see cref="CurrentBranchName"/>. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="fileName">The path and file name (root based).</param> /// <returns>The file info (null if it doesn't exist on the file system) and its path.</returns> public static (IFileInfo FileInfo, NormalizedPath Path) GetFileInfo(this GitFolder @this, string fileName) { var path = @this.SubPath .AppendPart("branches").AppendPart(@this.CurrentBranchName) .Combine(fileName); var fileInfo = @this.FileSystem.GetFileInfo(path); if (!fileInfo.Exists || fileInfo.IsDirectory || fileInfo.PhysicalPath == null) { return(null, path); } return(fileInfo, path); }
public CKSetupCodeCakeBuilderFolder( GitFolder f, SolutionDriver driver, CodeCakeBuilderKeyVaultFile keyVaultFile, SolutionSpec solutionSpec, NormalizedPath branchPath) : base(f, branchPath, "CodeCakeBuilder", "CKSetup/Res") { _driver = driver; _solutionSpec = solutionSpec; _keyVaultFile = keyVaultFile; _driver.OnSolutionConfiguration += OnSolutionConfiguration; _keyVaultFile.Updating += KeyVaultFileUpdating; }
public NugetConfigFile(GitFolder f, SolutionDriver driver, IEnvLocalFeedProvider localFeedProvider, SecretKeyStore secretStore, SolutionSpec s, NormalizedPath branchPath) : base(f, branchPath, branchPath.AppendPart("NuGet.config"), null) { _localFeedProvider = localFeedProvider; _solutionSpec = s; _solutionDriver = driver; _secretStore = secretStore; if (IsOnLocalBranch) { f.OnLocalBranchEntered += OnLocalBranchEntered; f.OnLocalBranchLeaving += OnLocalBranchLeaving; } _solutionDriver.OnStartBuild += OnStartBuild; _solutionDriver.OnZeroBuildProject += OnZeroBuildProject; _solutionDriver.OnSolutionConfiguration += OnSolutionConfiguration; }
/// <summary> /// Initializes a new <see cref="PluginFolderBase"/> on a folder path inside a branch path. /// </summary> /// <param name="f">The folder.</param> /// <param name="branchPath">The actual branch path (relative to the <see cref="FileSystem"/>).</param> /// <param name="folderPath"> /// The actual sub folder path (ie. 'CodeCakeBuilder') where resources must be updated.</param> /// <param name="resourcePrefix"> /// Optional resource prfix that defaults to <paramref name="resourceHolder"/>.Namespace + ".Res.". /// When not null, this path prefix is combined withe the namespace of the resourceHolder. /// </param> /// <param name="resourceHolder"> /// Optional type used to locate resources. /// By default it is the actual type of this folder object: the defining assembly and namespace are used. /// </param> public PluginFolderBase(GitFolder f, NormalizedPath branchPath, NormalizedPath subFolderPath, NormalizedPath?resourcePrefix = null, Type resourceHolder = null) : base(f, branchPath) { FolderPath = branchPath.Combine(subFolderPath).ResolveDots(branchPath.Parts.Count); if (resourceHolder == null) { resourceHolder = GetType(); } _resourceAssembly = resourceHolder.Assembly; if (!resourcePrefix.HasValue) { _resourcePrefix = resourceHolder.Namespace + ".Res."; } else { NormalizedPath p = resourceHolder.Namespace.Replace('.', '/'); _resourcePrefix = p.Combine(resourcePrefix.Value).ResolveDots().Path.Replace('/', '.') + '.'; } _csResourcePrefix = _csProtocol + _resourcePrefix; _csResourcePrefixSlash = _csProtocolSlash + _resourcePrefix; }
public CommonFolder(GitFolder f, SolutionDriver driver, SolutionSpec settings, NormalizedPath branchPath) : base(f, branchPath, "Common", "Basics/Res") { _driver = driver; _settings = settings; }
public CodeCakeBuilderFolder(GitFolder f, SolutionDriver driver, NormalizedPath branchPath) : base(f, branchPath, "CodeCakeBuilder", "Basics/Res") { _driver = driver; }
public GlobalJsonFile(GitFolder f, NormalizedPath branchPath, SolutionSpec solutionSpec) : base(f, branchPath, branchPath.AppendPart("global.json")) { _solutionSpec = solutionSpec; }
public GitIgnoreFile(GitFolder f, SolutionSpec solutionSpec, NormalizedPath branchPath) : base(f, branchPath, branchPath.AppendPart(".gitignore")) { _solutionSpec = solutionSpec; }
public SolutionFolder(GitFolder f, SolutionDriver driver, SolutionSpec solutionSpec, NormalizedPath branchPath) : base(f, branchPath, subFolderPath: String.Empty, "Basics/Res") { _driver = driver; _solutionSpec = solutionSpec; }
/// <summary> /// Reads a Xml document file in the <see cref="CurrentBranchName"/>. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="fileName">The path and file name (root based).</param> /// <returns>The document and its path. Document is null if it can't be read and a fatal error is logged.</returns> public static (XDocument Doc, NormalizedPath Path) GetXmlDocument(this GitFolder @this, IActivityMonitor m, string fileName) { var(FileInfo, Path) = GetFileInfo(@this, fileName); return(FileInfo?.ReadAsXDocument(), Path); }
public GitLabFile(GitFolder f, NormalizedPath branchPath) : base(f, branchPath, branchPath.AppendPart(".gitlab-ci.yml")) { }
/// <summary> /// Reads a <see cref="ITextFileInfo"/> the <see cref="CurrentBranchName"/>. /// </summary> /// <param name="m">The monitor to use.</param> /// <param name="fileName">The path and file name (root based).</param> /// <returns>The text file info (null if it can't be read) and its path.</returns> public static (ITextFileInfo, NormalizedPath Path) GetTextFileInfo(this GitFolder @this, IActivityMonitor m, string fileName) { var(FileInfo, Path) = GetFileInfo(@this, fileName); return(FileInfo?.AsTextFileInfo(ignoreExtension: true), Path); }
public NPMCodeCakeBuilderFolder(GitFolder f, NPMProjectsDriver npmDriver, SolutionDriver driver, NormalizedPath branchPath) : base(f, branchPath, "CodeCakeBuilder", "NPM/Res") { _npmDriver = npmDriver; _driver = driver; }