Ejemplo n.º 1
0
        internal PackageUploadHandle PublishAsync(Package package, IEnumerable <string> files, bool isNewVersion)
        {
            var packageUploadHandle = new PackageUploadHandle(PackageUploadBuilder.NewRequestBody(package));

            Task.Factory.StartNew(() =>
            {
                Publish(package, files, isNewVersion, packageUploadHandle);
            });

            return(packageUploadHandle);
        }
Ejemplo n.º 2
0
 public Package(string directory, string name, string versionName, string license)
 {
     RootDirectory     = directory;
     Name              = name;
     License           = license;
     VersionName       = versionName;
     LoadedTypes       = new ObservableCollection <Type>();
     LoadedAssemblies  = new ObservableCollection <PackageAssembly>();
     Dependencies      = new ObservableCollection <PackageDependency>();
     LoadedCustomNodes = new ObservableCollection <CustomNodeInfo>();
     AdditionalFiles   = new ObservableCollection <PackageFileInfo>();
     Header            = PackageUploadBuilder.NewRequestBody(this);
 }
Ejemplo n.º 3
0
        private void WritePackageHeader(Package package, IDirectoryInfo rootDir)
        {
            var pkgHeader = PackageUploadBuilder.NewRequestBody(package);

            // build the package header json, which will be stored with the pkg
            var jsSer        = new JsonSerializer();
            var pkgHeaderStr = jsSer.Serialize(pkgHeader);

            // write the pkg header to the root directory of the pkg
            var headerPath = Path.Combine(rootDir.FullName, PackageJsonName);

            if (fileSystem.FileExists(headerPath))
            {
                fileSystem.DeleteFile(headerPath);
            }

            fileSystem.WriteAllText(headerPath, pkgHeaderStr);
        }