Example #1
0
 internal SnapReleaseBuilder WithSnapReleaseBuilder(DisposableDirectory disposableDirectory, [NotNull] SnapAppsReleases snapAppsReleases, [NotNull] SnapApp snapApp, [NotNull] SnapReleaseBuilderContext builderContext)
 {
     if (snapAppsReleases == null)
     {
         throw new ArgumentNullException(nameof(snapAppsReleases));
     }
     if (snapApp == null)
     {
         throw new ArgumentNullException(nameof(snapApp));
     }
     if (builderContext == null)
     {
         throw new ArgumentNullException(nameof(builderContext));
     }
     return(new SnapReleaseBuilder(disposableDirectory, snapAppsReleases, snapApp, builderContext));
 }
Example #2
0
        public SnapReleaseBuilder([NotNull] DisposableDirectory disposableDirectory, SnapAppsReleases snapAppsReleases, [NotNull] SnapApp snapApp, [NotNull] SnapReleaseBuilderContext builderContext)
        {
            if (builderContext == null)
            {
                throw new ArgumentNullException(nameof(builderContext));
            }

            _nuspec = new Dictionary <string, IDisposable>();

            SnapFilesystem        = builderContext.SnapFilesystem ?? throw new ArgumentNullException(nameof(builderContext.SnapFilesystem));
            SnapAppsReleases      = snapAppsReleases ?? throw new ArgumentNullException(nameof(snapAppsReleases));
            SnapApp               = snapApp ?? throw new ArgumentNullException(nameof(snapApp));
            CoreRunLib            = builderContext.CoreRunLib ?? throw new ArgumentNullException(nameof(builderContext.CoreRunLib));
            SnapCryptoProvider    = builderContext.SnapCryptoProvider ?? throw new ArgumentNullException(nameof(builderContext.SnapCryptoProvider));
            SnapEmbeddedResources = builderContext.SnapEmbeddedResources ?? throw new ArgumentNullException(nameof(builderContext.SnapEmbeddedResources));
            SnapPack              = builderContext.SnapPack ?? throw new ArgumentNullException(nameof(builderContext.SnapPack));

            BaseDirectory            = disposableDirectory ?? throw new ArgumentNullException(nameof(disposableDirectory));
            NugetPackagingDirectory  = SnapFilesystem.PathCombine(BaseDirectory.WorkingDirectory, "nuget", $"app-{snapApp.Version}");
            SnapAppBaseDirectory     = SnapFilesystem.PathCombine(BaseDirectory.WorkingDirectory, snapApp.Id);
            SnapAppInstallDirectory  = SnapFilesystem.PathCombine(SnapAppBaseDirectory, $"app-{snapApp.Version}");
            SnapAppPackagesDirectory = SnapFilesystem.PathCombine(SnapAppBaseDirectory, "packages");

            SnapFilesystem.DirectoryCreateIfNotExists(NugetPackagingDirectory);
            SnapFilesystem.DirectoryCreateIfNotExists(SnapAppPackagesDirectory);
            SnapFilesystem.DirectoryCreateIfNotExists(SnapAppInstallDirectory);
        }