private void RunAssemblyConverter() { StringBuilder modifyAppXPackage = this.templateBuilder.ModifyAppXPackage; string[] textArray1 = new string[] { " <PropertyGroup Condition=\" '$(Configuration)' == 'Master' \">", " <RemoveDebuggableAttribute>True</RemoveDebuggableAttribute>", " </PropertyGroup>", " <PropertyGroup Condition=\" '$(Configuration)' != 'Master' \">", " <RemoveDebuggableAttribute>False</RemoveDebuggableAttribute>", " </PropertyGroup>" }; modifyAppXPackage.AppendLine(string.Join("\r\n", textArray1)); modifyAppXPackage.AppendLineWithPrefix("<Message Importance=\"high\" Text=\"Running AssemblyConverter...\" />", new object[0]); modifyAppXPackage.Append(" <Exec Command=\""$(UnityWSAToolsDir)AssemblyConverter.exe" -platform="); modifyAppXPackage.Append(MetroVisualStudioSolutionHelper._assemblyConverterPlatform[this.wsaSDK]); if (this.wsaSDK == WSASDK.UWP) { modifyAppXPackage.Append(" -lock="$(ProjectDir)project.lock.json" -bits=$(UnityBits) -configuration=$(Configuration) -removeDebuggableAttribute=$(RemoveDebuggableAttribute) -uwpsdk=$(TargetPlatformVersion)"); } string playersRootPath = MetroVisualStudioSolutionHelper.GetPlayersRootPath(this.wsaSDK, this.sourceBuild); modifyAppXPackage.Append(" -path="." -path=""); modifyAppXPackage.Append(playersRootPath); modifyAppXPackage.Append("""); if (this.useAssemblyCSharpProjects) { modifyAppXPackage.Append(" ""); modifyAppXPackage.Append(this.assemblyCSharpDllDestPath); modifyAppXPackage.Append("" ""); modifyAppXPackage.Append(this.assemblyCSharpFirstpassDllDestPath); modifyAppXPackage.Append("""); } foreach (string str2 in this.assemblies) { modifyAppXPackage.Append(" "$(ProjectDir)"); modifyAppXPackage.Append(Path.GetFileName(str2)); modifyAppXPackage.Append("""); } modifyAppXPackage.AppendLine("\" />"); modifyAppXPackage.AppendLineWithPrefix("<Message Importance=\"high\" Text=\"AssemblyConverter done.\" />", new object[0]); }
public override void CreateVisualStudioSolution() { string path = Utility.CombinePath(base.InstallPath, base.VisualStudioName + "v11.suo"); if (File.Exists(path)) { File.Delete(path); } Dictionary <WSASDK, LibraryCollection> dictionary = this.TEMP_GetLibraryCollections(); MetroCSharpVisualStudioSolutionCreator creator = new MetroCSharpVisualStudioSolutionCreator(base.VisualStudioName, base.StagingArea, base.InstallPath, base.PlayerPackage) { SourceBuild = base.SourceBuild, DontOverwriteFiles = MetroVisualStudioSolutionHelper.GetDontOverwriteFilesCSharp(), LibraryCollections = dictionary }; if (base.AutoRunPlayer) { IEnumerator enumerator = Enum.GetValues(typeof(WSABuildType)).GetEnumerator(); try { while (enumerator.MoveNext()) { object current = enumerator.Current; creator.EnableDotNetNative[(WSABuildType)current] = false; } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } } else { IEnumerator enumerator2 = Enum.GetValues(typeof(WSABuildType)).GetEnumerator(); try { while (enumerator2.MoveNext()) { object obj3 = enumerator2.Current; creator.EnableDotNetNative[(WSABuildType)obj3] = EditorUserBuildSettings.GetWSADotNetNative((WSABuildType)obj3); } } finally { IDisposable disposable2 = enumerator2 as IDisposable; if (disposable2 != null) { disposable2.Dispose(); } } } creator.CreateSolutionFileFrom(); MetroVisualStudioSolutionHelper.WriteUnityCommonProps(Path.Combine(base.InstallPath, "UnityCommon.props"), base.PlayerPackage, base.InstallPath, base.SourceBuild); if (!base.SourceBuild) { this.CopyUnityTools(); } }
public static void CreateAssemblyCSharp(CSharpProject project, string playerPackage, string assemblyName, LibraryCollection libraryCollection, WSASDK wsaSDK, CSharpProject[] additionalProjectReferences) { string relativeFinalProjectDirectory = GetRelativeFinalProjectDirectory(wsaSDK); List <AssemblyCSharpPlugin> plugins = new List <AssemblyCSharpPlugin>(); bool includeUnet = false; foreach (Library library in libraryCollection) { if ((!library.Native || library.WinMd) && (!string.Equals(library.Name, Utility.AssemblyCSharpName, StringComparison.InvariantCultureIgnoreCase) && !string.Equals(library.Name, Utility.AssemblyCSharpFirstPassName, StringComparison.InvariantCultureIgnoreCase))) { if (string.Equals(library.Name, "UnityEngine.Networking", StringComparison.InvariantCultureIgnoreCase)) { includeUnet = true; } string reference = library.Reference; string str3 = @"Unprocessed\"; if (library.WinMd && library.Native) { str3 = ""; } if (!reference.StartsWith(@"Plugins\", StringComparison.InvariantCultureIgnoreCase)) { reference = str3 + library.Reference; } reference = Utility.CombinePath(relativeFinalProjectDirectory, reference); AssemblyCSharpPlugin item = new AssemblyCSharpPlugin { Name = library.Name, HintPath = reference }; plugins.Add(item); } } StringBuilder builder = new StringBuilder(); string str4 = "$(UnityProjectDir)Assets"; string[] strArray = new string[] { "Plugins", "Standard Assets", "Standard Assets (Mobile)", "Pro Standard Assets" }; string additionalReferencePath = ""; if (additionalProjectReferences != null) { builder.AppendFormat(" <Compile Include=\"{0}\\**\\*.cs\" Exclude=\"{0}\\**\\Editor\\**\\*.cs", str4); foreach (string str6 in strArray) { builder.AppendFormat(@";{0}\{1}\**\*.cs", str4, str6); } builder.AppendLine("\">"); builder.AppendFormat(" <Link>%(RecursiveDir)%(Filename)%(Extension)</Link>", new object[0]); builder.AppendLine(); builder.AppendLine(" </Compile>"); additionalReferencePath = $"-additionalAssemblyPath=" { MetroVisualStudioSolutionHelper.GetAssemblyCSharpFirstpassDllDir(wsaSDK) } ""; } else { foreach (string str7 in strArray) { builder.AppendFormat(" <Compile Include=\"{0}\\{1}\\**\\*.cs\" Exclude=\"{0}\\{1}\\**\\Editor\\**\\*.cs\">", str4, str7); builder.AppendLine(); builder.AppendFormat(@" <Link>{0}\%(RecursiveDir)%(Filename)%(Extension)</Link>", str7); builder.AppendLine(); builder.AppendLine(" </Compile>"); } } if (< > f__am$cache0 == null) {