Esempio n. 1
0
        public static void Postprocess(BuildTargetGroup targetGroup, BuildTarget target, string installPath, string companyName, string productName, int width, int height, BuildOptions options, RuntimeClassRegistry usedClassRegistry, BuildReport report)
        {
            string stagingArea             = "Temp/StagingArea";
            string stagingAreaData         = "Temp/StagingArea/Data";
            string stagingAreaDataManaged  = "Temp/StagingArea/Data/Managed";
            string playbackEngineDirectory = BuildPipeline.GetPlaybackEngineDirectory(target, options);
            bool   flag = (options & BuildOptions.InstallInBuildFolder) != BuildOptions.None && PostprocessBuildPlayer.SupportsInstallInBuildFolder(targetGroup, target);

            if (installPath == string.Empty && !flag)
            {
                throw new Exception(installPath + " must not be an empty string");
            }
            IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(targetGroup, target);

            if (buildPostProcessor != null)
            {
                BuildPostProcessArgs args;
                args.target                 = target;
                args.stagingAreaData        = stagingAreaData;
                args.stagingArea            = stagingArea;
                args.stagingAreaDataManaged = stagingAreaDataManaged;
                args.playerPackage          = playbackEngineDirectory;
                args.installPath            = installPath;
                args.companyName            = companyName;
                args.productName            = productName;
                args.productGUID            = PlayerSettings.productGUID;
                args.options                = options;
                args.usedClassRegistry      = usedClassRegistry;
                args.report                 = report;
                buildPostProcessor.PostProcess(args);
                return;
            }
            throw new UnityException(string.Format("Build target '{0}' not supported", target));
        }
        public static void Postprocess(BuildTarget target, string installPath, string companyName, string productName, int width, int height, string downloadWebplayerUrl, string manualDownloadWebplayerUrl, BuildOptions options, RuntimeClassRegistry usedClassRegistry, BuildReport report)
        {
            BuildPostProcessArgs args;
            string str  = "Temp/StagingArea";
            string str2 = "Temp/StagingArea/Data";
            string str3 = "Temp/StagingArea/Data/Managed";
            string playbackEngineDirectory = BuildPipeline.GetPlaybackEngineDirectory(target, options);
            bool   flag = ((options & BuildOptions.InstallInBuildFolder) != BuildOptions.CompressTextures) && SupportsInstallInBuildFolder(target);

            if ((installPath == string.Empty) && !flag)
            {
                throw new Exception(installPath + " must not be an empty string");
            }
            IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(target);

            if (buildPostProcessor == null)
            {
                throw new UnityException($"Build target '{target}' not supported");
            }
            args.target                 = target;
            args.stagingAreaData        = str2;
            args.stagingArea            = str;
            args.stagingAreaDataManaged = str3;
            args.playerPackage          = playbackEngineDirectory;
            args.installPath            = installPath;
            args.companyName            = companyName;
            args.productName            = productName;
            args.productGUID            = PlayerSettings.productGUID;
            args.options                = options;
            args.usedClassRegistry      = usedClassRegistry;
            args.report                 = report;
            buildPostProcessor.PostProcess(args);
        }
        static public void Postprocess(BuildTargetGroup targetGroup, BuildTarget target, int subtarget, string installPath, string companyName, string productName,
                                       int width, int height, BuildOptions options,
                                       RuntimeClassRegistry usedClassRegistry, BuildReport report)
        {
            string stagingArea            = "Temp/StagingArea";
            string stagingAreaData        = "Temp/StagingArea/Data";
            string stagingAreaDataManaged = "Temp/StagingArea/Data/Managed";
            string playerPackage          = BuildPipeline.GetPlaybackEngineDirectory(target, options);

            // Disallow providing an empty string as the installPath
            bool willInstallInBuildFolder = (options & BuildOptions.InstallInBuildFolder) != 0 && SupportsInstallInBuildFolder(targetGroup, target);

            if (installPath == String.Empty && !willInstallInBuildFolder)
            {
                throw new Exception(installPath + " must not be an empty string");
            }

            IBuildPostprocessor postprocessor = ModuleManager.GetBuildPostProcessor(targetGroup, target);

            if (postprocessor != null)
            {
                BuildPostProcessArgs args;
                args.target                 = target;
                args.subtarget              = subtarget;
                args.stagingAreaData        = stagingAreaData;
                args.stagingArea            = stagingArea;
                args.stagingAreaDataManaged = stagingAreaDataManaged;
                args.playerPackage          = playerPackage;
                args.installPath            = installPath;
                args.companyName            = companyName;
                args.productName            = productName;
                args.productGUID            = PlayerSettings.productGUID;
                args.options                = options;
                args.usedClassRegistry      = usedClassRegistry;
                args.report                 = report;

                BuildProperties props;
                try
                {
                    postprocessor.PostProcess(args, out props);
                }
                catch (System.Exception e)
                {
                    // Rethrow exceptions during build postprocessing as BuildFailedException, so we don't pretend the build was fine.
                    throw new UnityEditor.Build.BuildFailedException(e);
                }
                report.AddAppendix(props);

                return;
            }

            // If postprocessor is not provided, build target is not supported
            throw new UnityException(string.Format("Build target '{0}' not supported", target));
        }
Esempio n. 4
0
        public static void Postprocess(BuildTarget target, string installPath, string companyName, string productName, int width, int height, string downloadWebplayerUrl, string manualDownloadWebplayerUrl, BuildOptions options, RuntimeClassRegistry usedClassRegistry)
        {
            string str1 = "Temp/StagingArea";
            string str2 = "Temp/StagingArea/Data";
            string str3 = "Temp/StagingArea/Data/Managed";
            string playbackEngineDirectory = BuildPipeline.GetPlaybackEngineDirectory(target, options);
            bool   flag = (options & BuildOptions.InstallInBuildFolder) != BuildOptions.None && PostprocessBuildPlayer.SupportsInstallInBuildFolder(target);

            if (installPath == string.Empty && !flag)
            {
                throw new Exception(installPath + " must not be an empty string");
            }
            IBuildPostprocessor buildPostProcessor = ModuleManager.GetBuildPostProcessor(target);

            if (buildPostProcessor != null)
            {
                BuildPostProcessArgs args;
                args.target                 = target;
                args.stagingAreaData        = str2;
                args.stagingArea            = str1;
                args.stagingAreaDataManaged = str3;
                args.playerPackage          = playbackEngineDirectory;
                args.installPath            = installPath;
                args.companyName            = companyName;
                args.productName            = productName;
                args.productGUID            = PlayerSettings.productGUID;
                args.options                = options;
                args.usedClassRegistry      = usedClassRegistry;
                buildPostProcessor.PostProcess(args);
            }
            else
            {
                switch (target)
                {
                case BuildTarget.WebPlayer:
                case BuildTarget.WebPlayerStreamed:
                    PostProcessWebPlayer.PostProcess(options, installPath, downloadWebplayerUrl, width, height);
                    break;

                default:
                    throw new UnityException(string.Format("Build target '{0}' not supported", (object)target));
                }
            }
        }