Пример #1
0
 public void Execute(PostProcessorContext context)
 {
     if (((ScriptingImplementation)context.Get <ScriptingImplementation>("ScriptingBackend")) == ScriptingImplementation.IL2CPP)
     {
         if (this.OnProgress != null)
         {
             this.OnProgress(this, "Generating native assemblies");
         }
         BuildTarget target          = context.Get <BuildTarget>("BuildTarget");
         string      str             = context.Get <string>("StagingArea");
         string[]    components      = new string[] { str, "assets", "bin", "Data" };
         string      stagingAreaData = Paths.Combine(components);
         string[]    textArray2      = new string[] { BuildPipeline.GetBuildToolsDirectory(target), "AndroidNativeLink.xml" };
         string[]    textArray3      = new string[] { stagingAreaData, "platform_native_link.xml" };
         FileUtil.CopyFileOrDirectory(Paths.Combine(textArray2), Paths.Combine(textArray3));
         AndroidTargetDevice     device     = context.Get <AndroidTargetDevice>("TargetDevice");
         AndroidTargetDeviceType deviceType = new AndroidTargetDeviceARMv7();
         if (device == AndroidTargetDevice.x86)
         {
             deviceType = new AndroidTargetDevicex86();
         }
         if (this.OnProgress != null)
         {
             this.OnProgress(this, "Compiling native assemblies for " + deviceType.Architecture);
         }
         string tempFolder         = Path.Combine(str, "Il2Cpp");
         bool   isDevelopmentBuild = context.Get <bool>("DevelopmentPlayer");
         RuntimeClassRegistry          runtimeClassRegistry = context.Get <RuntimeClassRegistry>("UsedClassRegistry");
         AndroidIl2CppPlatformProvider platformProvider     = new AndroidIl2CppPlatformProvider(target, deviceType, isDevelopmentBuild);
         IL2CPPUtils.RunIl2Cpp(tempFolder, stagingAreaData, platformProvider, null, runtimeClassRegistry, isDevelopmentBuild);
         AndroidTargetDeviceType type2 = null;
         if (device == AndroidTargetDevice.FAT)
         {
             type2 = new AndroidTargetDevicex86();
             if (this.OnProgress != null)
             {
                 this.OnProgress(this, "Compiling native assemblies for " + type2.Architecture);
             }
             platformProvider = new AndroidIl2CppPlatformProvider(target, type2, isDevelopmentBuild);
             IL2CPPUtils.RunCompileAndLink(tempFolder, stagingAreaData, platformProvider, null, runtimeClassRegistry, false);
         }
         this.FinalizeAndCleanup(str, stagingAreaData, tempFolder);
         this.CopySymbolMap(str, stagingAreaData, deviceType);
         if (type2 != null)
         {
             this.CopySymbolMap(str, stagingAreaData, type2);
         }
     }
 }