Example #1
0
        // NOTE: Returns null on failure
        public static IEnumerator LookupPackagesListAsync()
        {
            var runner = PrjInterface.RunPrjAsync(PrjInterface.CreatePrjRequest("listPackages"));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            var response = (PrjResponse)runner.Current;

            if (response.Succeeded)
            {
                var docs = response.Output
                           .Split(new string[] { "---" }, StringSplitOptions.None);

                yield return(PrjHelperResponse.Success(
                                 docs
                                 .Select(x => PrjSerializer.DeserializePackageFolderInfo(x))
                                 .Where(x => x != null).ToList()));
            }
            else
            {
                yield return(PrjHelperResponse.Error(response.ErrorMessage));
            }
        }
Example #2
0
        public static IEnumerator DeletePackagesAsync(List <PackageInfo> infos)
        {
            foreach (var info in infos)
            {
                Log.Debug("Deleting package '{0}'".Fmt(info.Name));

                var req = PrjInterface.CreatePrjRequest("deletePackage");

                req.Param1 = info.Name;

                var runner = PrjInterface.RunPrjAsync(req);

                while (runner.MoveNext() && !(runner.Current is PrjResponse))
                {
                    yield return(runner.Current);
                }

                var response = (PrjResponse)runner.Current;

                if (response.Succeeded)
                {
                    Log.Info("Deleted package '{0}'".Fmt(info.Name));
                }
                else
                {
                    yield return(PrjHelperResponse.Error(response.ErrorMessage));

                    yield break;
                }
            }

            yield return(PrjHelperResponse.Success());
        }
Example #3
0
        // NOTE: It's up to the calling code to update the solution first
        public static IEnumerator OpenCustomSolutionAsync()
        {
            var runner = PrjInterface.RunPrjAsync(PrjInterface.CreatePrjRequest("openCustomSolution"));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #4
0
        static IEnumerator UpdateLinksAsyncInternal(PrjRequest req)
        {
            var runner = PrjInterface.RunPrjAsync(req);

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #5
0
        public static IEnumerator OpenUnityForProjectAsync(string projectName)
        {
            var runner = PrjInterface.RunPrjAsync(
                PrjInterface.CreatePrjRequestForProject("openUnity", projectName));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #6
0
        public static IEnumerator OpenPackagesFolderInExplorer()
        {
            var runner = PrjInterface.RunPrjAsync(
                PrjInterface.CreatePrjRequest("openPackagesFolder"));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #7
0
        public static IEnumerator UpdateCustomSolutionAsync()
        {
            // Need the unity solution for defines and references
            ProjenyEditorUtil.ForceGenerateUnitySolution();

            var runner = PrjInterface.RunPrjAsync(PrjInterface.CreatePrjRequest("updateCustomSolution"));

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #8
0
        public static IEnumerator CreatePackageAsync(string name)
        {
            var req = PrjInterface.CreatePrjRequest("createPackage");

            req.Param1 = name;

            var runner = PrjInterface.RunPrjAsync(req);

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #9
0
        public static IEnumerator CreateProjectAsync(string projectName, bool duplicateSettings)
        {
            var request = PrjInterface.CreatePrjRequest("createProject");

            request.Param1 = projectName;
            request.Param2 = duplicateSettings.ToString();

            var runner = PrjInterface.RunPrjAsync(request);

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }
Example #10
0
        public static IEnumerator InstallReleaseAsync(ReleaseInfo info)
        {
            var req = PrjInterface.CreatePrjRequest("installRelease");

            req.Param1 = info.Id;

            if (info.HasVersionCode)
            {
                req.Param2 = info.VersionCode.ToString();
            }

            var runner = PrjInterface.RunPrjAsync(req);

            while (runner.MoveNext() && !(runner.Current is PrjResponse))
            {
                yield return(runner.Current);
            }

            yield return(CreateStandardResponse((PrjResponse)runner.Current));
        }