private void AddSupportedBuildPlatformPair(ICSharpProjectExporter exporter, UnityConfigurationType configuration, IReadOnlyDictionary <BuildTarget, CompilationPlatformInfo> platforms) { // Set supported build platforms foreach (KeyValuePair <BuildTarget, CompilationPlatformInfo> platform in platforms) { exporter.SupportedBuildPlatforms.Add(new ConfigurationPlatformPair(UnityConfigurationType.InEditor, platform.Value.Name)); } }
public void ExportProjects(IUnityProjectExporter unityProjectExporter, DirectoryInfo generatedProjectFolder) { foreach (KeyValuePair <string, CSProjectInfo> project in CSProjects) { bool isGenerated = project.Value.AssemblyDefinitionInfo.AssetLocation != AssetLocation.Package && project.Value.AssemblyDefinitionInfo.AssetLocation != AssetLocation.Project; ICSharpProjectExporter exporter = unityProjectExporter.CreateCSharpProjectExporter(MSBuildUnityProjectExporter.GetProjectPath(project.Value, generatedProjectFolder), generatedProjectFolder, isGenerated); exporter.DefaultPlatform = CurrentPlayerPlatform.Name; exporter.LanguageVersion = MSBuildTools.CSharpVersion; exporter.IsGenerated = isGenerated; foreach (CompilationPlatformInfo platform in AvailablePlatforms) { exporter.SupportedPlatforms.Add(platform.Name); } project.Value.Export(exporter, generatedProjectFolder); exporter.Write(); } }
public void Export(ICSharpProjectExporter exporter, DirectoryInfo generatedProjectDirectory) { exporter.Guid = Guid; exporter.AllowUnsafe = AssemblyDefinitionInfo.allowUnsafeCode; exporter.IsEditorOnlyProject = ProjectType == ProjectType.EditorAsmDef || ProjectType == ProjectType.PredefinedEditorAssembly; exporter.ProjectName = Name; exporter.SourceIncludePath = AssemblyDefinitionInfo.Directory; foreach (AssemblyDefinitionInfo nestedAsmDef in AssemblyDefinitionInfo.NestedAssemblyDefinitionFiles) { exporter.SourceExcludePaths.Add(nestedAsmDef.Directory); } // Set all of the references ProcessDepedencies(exporter.PluginReferences, PluginDependencies, exporter.AssemblySearchPaths, (i, c) => new PluginReference(i.Name, i.ReferencePath, c), i => i.ReferencePath.LocalPath); ProcessDepedencies(exporter.PluginReferences, WinMDDependencies, exporter.AssemblySearchPaths, (i, c) => new PluginReference(i.Name, i.ReferencePath, c), i => i.ReferencePath.LocalPath); ProcessDepedencies(exporter.ProjectReferences, ProjectDependencies, exporter.AssemblySearchPaths, (i, c) => new ProjectReference(new Uri(MSBuildUnityProjectExporter.GetProjectPath(i, generatedProjectDirectory).FullName), c, true)); AddSupportedBuildPlatformPair(exporter, UnityConfigurationType.InEditor, InEditorPlatforms); AddSupportedBuildPlatformPair(exporter, UnityConfigurationType.Player, PlayerPlatforms); }