示例#1
0
        /// <summary>
        /// Generate the AndroidManifest XDocument based on the ARCoreProjectSettings.
        /// This function would be used in Tests.
        /// </summary>
        /// <param name="settings">ARCore Project Settings.</param>
        /// <returns>The XDocument of the final AndroidManifest.</returns>
        public static XDocument GenerateCustomizedAndroidManifest(
            ARCoreProjectSettings settings)
        {
            XElement mergedRoot = GetDefaultAndroidManifest().Root;
            List <IDependentModule> featureModules = DependentModulesManager.GetModules();

            foreach (IDependentModule module in featureModules)
            {
                if (module.IsEnabled(settings))
                {
                    XDocument xDocument =
                        AndroidManifestMerger.TransferToXDocument(
                            module.GetAndroidManifestSnippet(settings));
                    mergedRoot = AndroidManifestMerger.MergeXElement(
                        mergedRoot, xDocument.Root);
                }
            }

            return(new XDocument(mergedRoot));
        }
示例#2
0
        private static void CheckCompatibilityWithAllSesssionConfigs(
            ARCoreProjectSettings settings,
            Dictionary <ARCoreSessionConfig, string> sessionToSceneMap)
        {
            List <IDependentModule> featureModules = DependentModulesManager.GetModules();

            foreach (IDependentModule module in featureModules)
            {
                foreach (var entry in sessionToSceneMap)
                {
                    if (!module.IsCompatibleWithSessionConfig(
                            settings, entry.Key))
                    {
                        throw new BuildFailedException(
                                  string.Format(
                                      "Module {0} isn't compatible with the setting in {1}",
                                      module.GetType().Name, entry.Value));
                    }
                }
            }
        }