Example #1
0
        internal static void Pack(PackageManifest manifest)
        {
            try
            {
                // Make sure the version information is updated before publishing
                VersionMaintainer.UpdateVersionInformation(true);

                CopySamples(manifest);
                manifest.OnAfterDeserialize();
                string packageFolder = Path.Combine(AssetDatabaseUtilities.GetRelativeToProjectRoot(Paths.PackagesFolder), manifest.package_name);


                string folder = FileUtil.GetUniqueTempPathInProject();


                try
                {
                    string tarballPath = PackageTarball.Create(packageFolder, folder);
                    EditorUtility.RevealInFinder(tarballPath);
                }
                catch (Exception e)
                {
                    EditorUtility.DisplayDialog("Failure", e.Message, "OK");
                }
            }
            finally
            {
                EmptySamplesDirectory(manifest);
            }
        }
Example #2
0
        internal static List <PackageManifest> LoadPackages()
        {
            DirectoryInfo packageDirectory = new DirectoryInfo(AssetDatabaseUtilities.GetRelativeToProjectRoot(Paths.PackagesFolder));

            List <PackageManifest> packages = new List <PackageManifest>();

            foreach (DirectoryInfo directory in packageDirectory.EnumerateDirectories())
            {
                string manifestPath = Path.Combine(packageDirectory.ToString(), directory.Name);
                if (File.Exists(Path.Combine(manifestPath, Paths.PackageManifest)))
                {
                    string halodiPackage = AssetDatabaseUtilities.ReadTextFile(manifestPath, Paths.PackageManifest);

                    if (halodiPackage == null)
                    {
                        continue;
                    }
                    else
                    {
                        PackageManifest manifest = JsonUtility.FromJson <PackageManifest>(halodiPackage);
                        manifest.OnAfterDeserialize();
                        manifest.filesystem_location = manifestPath;
                        packages.Add(manifest);
                    }
                }
            }

            return(packages);
        }
Example #3
0
        internal static void Publish(PackageManifest manifest, string registry)
        {
            try
            {
                CopySamples(manifest);

                manifest.OnAfterDeserialize();
                string PackageFolder = Path.Combine(AssetDatabaseUtilities.GetRelativeToProjectRoot(Paths.PackagesFolder), manifest.package_name);

                NPMPublish.Publish(PackageFolder, registry);
            }
            finally
            {
                EmptySamplesDirectory(manifest);
            }
        }