internal static void Configure(CASEditorSettings settings)
        {
            bool          baseGradleChanged = false;
            List <string> baseGradle        = null;
            List <string> launcherGradle    = null;

#if UNITY_2019_3_OR_NEWER
            const string baseGradlePath     = Utils.projectGradlePath;
            const string launcherGradlePath = Utils.launcherGradlePath;

            baseGradle = ReadGradleFile("Base Gradle", baseGradlePath);

            if (settings.multiDexEnabled || settings.exoPlayerIncluded)
            {
                launcherGradle = ReadGradleFile("Launcher Gradle", launcherGradlePath);
            }
#else
            const string baseGradlePath     = Utils.mainGradlePath;
            const string launcherGradlePath = Utils.mainGradlePath;

            baseGradle     = ReadGradleFile("Gradle", baseGradlePath);
            launcherGradle = baseGradle;
#endif

            if (settings.updateGradlePluginVersion &&
                UpdateGradlePluginVersion(baseGradle, baseGradlePath))
            {
                baseGradleChanged = true;
            }

#if ReplaceJCenterToMavenCentral
            if (UpdateBaseGradleRepositories(baseGradle, baseGradlePath))
            {
                baseGradleChanged = true;
            }
#endif

            // Enabled by default Dexing artifact transform causes issues for ExoPlayer with Gradle plugin 3.5.0+
            var dexingArtifactProp = new GradleProperty(
                "android.enableDexingArtifactTransform", "false", !settings.exoPlayerIncluded);

            GradleProperty[] gradleProps = null;
            if (Utils.GetAndroidResolverSetting <bool>("UseJetifier"))
            {
                gradleProps = new[] { dexingArtifactProp };
            }
            else
            {
                gradleProps = new[]
                {
                    dexingArtifactProp,
                    new GradleProperty("android.useAndroidX", "true"),
                    new GradleProperty("android.enableJetifier", "true")
                };
            }

#if UNITY_2019_3_OR_NEWER
            List <string> propsFile = ReadGradleFile("Gradle Properties", Utils.propertiesGradlePath);

            if (UpdateGradlePropertiesFile(propsFile, gradleProps))
            {
                File.WriteAllLines(Utils.propertiesGradlePath, propsFile.ToArray());
            }
#else
            // Unity below version 2019.3 does not have a Gradle Properties file
            // and changes are applied to the base Gradle file.
            if (UpdateGradlePropertiesInMainFile(baseGradle, gradleProps, baseGradlePath))
            {
                baseGradleChanged = true;
            }


            if (FixGradleCompatibilityUnity2018(baseGradle, baseGradlePath))
            {
                baseGradleChanged = true;
            }
#endif

            if (launcherGradle != null)
            {
                if (UpdateLauncherGradleFile(launcherGradle, settings, launcherGradlePath))
                {
#if UNITY_2019_3_OR_NEWER
                    File.WriteAllLines(launcherGradlePath, launcherGradle.ToArray());
                    AssetDatabase.ImportAsset(launcherGradlePath);
#else
                    // Unity below version 2019.3 does not have a Gradle Launcher file
                    // and changes are applied to the base Gradle file.
                    baseGradleChanged = true;
#endif
                }
            }

            if (baseGradleChanged)
            {
                File.WriteAllLines(baseGradlePath, baseGradle.ToArray());
                AssetDatabase.ImportAsset(baseGradlePath);
            }
        }