private void PrepareNativePlugin(PostProcessorContext context, string assetPath, string pluginTargetCPU)
        {
            string[]            textArray1;
            string              str;
            AndroidTargetDevice device = context.Get <AndroidTargetDevice>("TargetDevice");

            if ((device == AndroidTargetDevice.FAT) || device.ToString().Equals(pluginTargetCPU))
            {
                str = "";
                if (pluginTargetCPU != null)
                {
                    if (pluginTargetCPU != "ARMv7")
                    {
                        if (pluginTargetCPU == "x86")
                        {
                            str = "x86";
                            goto Label_0088;
                        }
                    }
                    else
                    {
                        str = "armeabi-v7a";
                        goto Label_0088;
                    }
                }
                Debug.LogWarning($"Unknown cpu architecture for .so library ({assetPath})");
            }
            return;

Label_0088:
            textArray1 = new string[] { this._stagingArea, "libs", str };
            string path = Paths.Combine(textArray1);

            Directory.CreateDirectory(path);
            FileUtil.UnityFileCopy(assetPath, Path.Combine(path, Path.GetFileName(assetPath)));
        }
Beispiel #2
0
        /// <summary>
        /// Build project for Android with specified AndroidTargetDevice.
        /// This function change PlayerSettings and restore it after build.
        /// Different devices will get different bundle version code.
        /// See: <see cref="BuildHelperStrings.GenBundleNumber(UnityEditor.AndroidTargetDevice)"/>
        /// </summary>
        /// <param name="device">Android target device</param>
        /// <param name="buildVersion">Build version wich will be available by <i>Application.version</i></param>
        /// <param name="options">Build player options</param>
        /// <returns>Build path</returns>
        private static string BuildAndroidForDevice(AndroidTargetDevice device, string buildVersion, BuildPlayerOptions options)
        {
            BuildTime.SaveSettingsToRestore();
            PlayerSettings.Android.targetDevice      = device;
            PlayerSettings.Android.bundleVersionCode = BuildHelperStrings.GenBundleNumber(device);
            var buildPath = BuildHelperStrings.GetBuildPath(BuildTarget.Android, buildVersion, specifyName: device.ToString());

            options.locationPathName = buildPath;
            BuildTime.Build(options);
            return(buildPath);
        }