Пример #1
0
 /// <summary>
 /// A callback before the build is started to manage the dependencies.
 /// </summary>
 /// <param name="report">A report containing information about the build.</param>
 public void OnPreprocessBuild(BuildReport report)
 {
     UnityEditor.BuildTarget buildTarget = report.summary.platform;
     if (buildTarget == UnityEditor.BuildTarget.Android)
     {
         ExternalDependencyResolverHelper.ClearDependencies();
         ManageAndroidDependencies(ARCoreExtensionsProjectSettings.Instance);
     }
     else if (buildTarget == UnityEditor.BuildTarget.iOS &&
              ARCoreExtensionsProjectSettings.Instance.IsIOSSupportEnabled)
     {
         ExternalDependencyResolverHelper.EnableDependencyResolver(
             ExternalDependencyResolverHelper.IOSResolverName);
     }
 }
Пример #2
0
        public static void OnPostprocessBuild(
            UnityEditor.BuildTarget target, string pathToBuiltProject)
        {
            if (!UnityEditorInternal.InternalEditorUtility.inBatchMode)
            {
                // Only clean up resolver in Batch Mode.
                return;
            }

            if (target == UnityEditor.BuildTarget.Android)
            {
                Debug.Log("ARCoreExtensions: Cleaning up Android library dependencies.");
                ExternalDependencyResolverHelper.ClearDependencies();
            }
        }
Пример #3
0
        private void ManageAndroidDependencies(ARCoreExtensionsProjectSettings settings)
        {
            List <IDependentModule> featureModules = DependentModulesManager.GetModules();

            foreach (IDependentModule module in featureModules)
            {
                if (!module.IsEnabled(settings, UnityEditor.BuildTarget.Android))
                {
                    continue;
                }

                JarArtifact[] dependencies = module.GetAndroidDependencies(settings);
                if (dependencies != null && dependencies.Length > 0)
                {
                    ExternalDependencyResolverHelper.RegisterAndroidDependencies(dependencies);
                }
            }
        }