<commit_before>﻿// Copyright (c) 2017, 2020 Ubisoft Entertainment
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Collections.Generic;

namespace Sharpmake.Generators.Apple
{
    public partial class XCodeProj
    {
        private static class Template
        {
            public static string GlobalHeader =
@"// !$*UTF8*$!
{
	archiveVersion = [archiveVersion];
	classes = {
	};
	objectVersion = [objectVersion];
	objects = {

";
            public static string GlobalFooter =
@"	};
	rootObject = [RootObject.Uid] /* Project object */;
}
";

            public static string SectionBegin = @"/* Begin [item.SectionString] section */
";
            public static string SectionEnd = @"/* End [item.SectionString] section */

";

            public static string SectionSubItem =
@"				[item.Uid] /* [item.Identifier] */,
";
            public static string ProjectReferenceSubItem =
@"				{
					ProductGroup = [group.Uid] /* Products */;
					ProjectRef = [project.Uid] /* [project.Name] */;
				},
";
            public static string ProjectTargetAttribute =
@"					[item.Uid] /* [item.Identifier] */ = {
						DevelopmentTeam = [project.DevelopmentTeam];
						ProvisioningStyle = [project.ProvisioningStyle];
						SystemCapabilities = {
							com.apple.iCloud = {
								enabled = [project.ICloudSupport];
							};
						};
					};
";

            public static Dictionary<ItemSection, string> Section = new Dictionary<ItemSection, string>
            {
                { ItemSection.PBXBuildFile,
@"		[item.Uid] /* [item.File.Name] in [item.File.Type] */ = {
			isa = PBXBuildFile;
			fileRef = [item.File.Uid] /* [item.File.Name] */;
		};
"               },

                { ItemSection.PBXContainerItemProxy,
@"		[item.Uid] /* PBXContainerItemProxy */ = {
			isa = PBXContainerItemProxy;
			containerPortal = [item.ProjectReference.Uid];
			proxyType = [item.ProxyType];
			remoteGlobalIDString = [item.ProxyItem.Uid];
			remoteInfo = [item.ProjectReference.ProjectName];
		};
"               },

                { ItemSection.PBXFileReference,
@"		[item.Uid] /* [item.Name] */ = {
			isa = PBXFileReference;
			explicitFileType = [item.ExplicitFileType];
			lastKnownFileType = [item.FileType];
			includeInIndex = [item.IncludeInIndex];
			name = ""[item.Name]"";
			path = ""[item.Path]"";
			sourceTree = [item.SourceTree];
		};
"               },

                { ItemSection.PBXFrameworksBuildPhase,
@"		[item.Uid] /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = [item.BuildActionMask];
			files = (
[itemChildren]
			);
			runOnlyForDeploymentPostprocessing = [item.RunOnlyForDeploymentPostprocessing];
		};
"               },

                {ItemSection.PBXShellScriptBuildPhase,
@"		[item.Uid] /* Scripts */ =
		{
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = ();
			inputFileListPaths = ();
			inputPaths = ();
			outputFileListPaths = ();
			outputPaths = ();
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = ""[item.script]"";
		};
"
                },

                { ItemSection.PBXGroup,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXGroup;
			children = (
[itemChildren]
			);
			name = ""[item.Name]"";
			path = ""[item.Path]"";
			sourceTree = [item.SourceTree];
		};
"               },

                { ItemSection.PBXNativeTarget,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = [item.ConfigurationList.Uid] /* Build configuration list for PBXNativeTarget ""[item.Identifier]"" */;
			buildPhases = (
				[item.ShellScriptPreBuildPhaseUIDs] /* ShellScripts */,
				[item.ResourcesBuildPhase.Uid] /* Resources */,
				[item.SourceBuildPhaseUID] /* Sources */,
				[item.FrameworksBuildPhase.Uid] /* Frameworks */,
				[item.ShellScriptPostBuildPhaseUIDs] /* ShellScripts */,
			);
			buildRules = (
			);
			dependencies = (
[itemChildren]
			);
			name = ""[item.Identifier]"";
			productInstallPath = ""[item.ProductInstallPath]"";
			productName = ""[item.Identifier]"";
			productReference = [item.OutputFile.Uid] /* [item.OutputFile.Name] */;
			productType = ""[item.ProductType]"";
		};
"               },

                { ItemSection.PBXLegacyTarget,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXLegacyTarget;
			buildArgumentsString = ""[item.BuildArgumentsString]"";
			buildConfigurationList = [item.ConfigurationList.Uid] /* Build configuration list for PBXNativeTarget ""[item.Identifier]"" */;
			buildPhases = (
			);
			buildToolPath = ""[item.BuildToolPath]"";
			buildWorkingDirectory = ""[item.BuildWorkingDirectory]"";
			dependencies = (
			);
			name = ""[item.Identifier]"";
			passBuildSettingsInEnvironment = 1;
			productName = ""[item.Identifier]"";
			productType = ""[item.ProductType]"";
		};
"               },

                { ItemSection.PBXProject,
@"		[item.Uid] /* Project object */ = {
			isa = PBXProject;<commit_msg>[XCode] Fix typo in template, native was written instead of legacy<commit_after>﻿// Copyright (c) 2017, 2020 Ubisoft Entertainment
// 
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// 
//     http://www.apache.org/licenses/LICENSE-2.0
// 
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

using System.Collections.Generic;

namespace Sharpmake.Generators.Apple
{
    public partial class XCodeProj
    {
        private static class Template
        {
            public static string GlobalHeader =
@"// !$*UTF8*$!
{
	archiveVersion = [archiveVersion];
	classes = {
	};
	objectVersion = [objectVersion];
	objects = {

";
            public static string GlobalFooter =
@"	};
	rootObject = [RootObject.Uid] /* Project object */;
}
";

            public static string SectionBegin = @"/* Begin [item.SectionString] section */
";
            public static string SectionEnd = @"/* End [item.SectionString] section */

";

            public static string SectionSubItem =
@"				[item.Uid] /* [item.Identifier] */,
";
            public static string ProjectReferenceSubItem =
@"				{
					ProductGroup = [group.Uid] /* Products */;
					ProjectRef = [project.Uid] /* [project.Name] */;
				},
";
            public static string ProjectTargetAttribute =
@"					[item.Uid] /* [item.Identifier] */ = {
						DevelopmentTeam = [project.DevelopmentTeam];
						ProvisioningStyle = [project.ProvisioningStyle];
						SystemCapabilities = {
							com.apple.iCloud = {
								enabled = [project.ICloudSupport];
							};
						};
					};
";

            public static Dictionary<ItemSection, string> Section = new Dictionary<ItemSection, string>
            {
                { ItemSection.PBXBuildFile,
@"		[item.Uid] /* [item.File.Name] in [item.File.Type] */ = {
			isa = PBXBuildFile;
			fileRef = [item.File.Uid] /* [item.File.Name] */;
		};
"               },

                { ItemSection.PBXContainerItemProxy,
@"		[item.Uid] /* PBXContainerItemProxy */ = {
			isa = PBXContainerItemProxy;
			containerPortal = [item.ProjectReference.Uid];
			proxyType = [item.ProxyType];
			remoteGlobalIDString = [item.ProxyItem.Uid];
			remoteInfo = [item.ProjectReference.ProjectName];
		};
"               },

                { ItemSection.PBXFileReference,
@"		[item.Uid] /* [item.Name] */ = {
			isa = PBXFileReference;
			explicitFileType = [item.ExplicitFileType];
			lastKnownFileType = [item.FileType];
			includeInIndex = [item.IncludeInIndex];
			name = ""[item.Name]"";
			path = ""[item.Path]"";
			sourceTree = [item.SourceTree];
		};
"               },

                { ItemSection.PBXFrameworksBuildPhase,
@"		[item.Uid] /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = [item.BuildActionMask];
			files = (
[itemChildren]
			);
			runOnlyForDeploymentPostprocessing = [item.RunOnlyForDeploymentPostprocessing];
		};
"               },

                {ItemSection.PBXShellScriptBuildPhase,
@"		[item.Uid] /* Scripts */ =
		{
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = ();
			inputFileListPaths = ();
			inputPaths = ();
			outputFileListPaths = ();
			outputPaths = ();
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = ""[item.script]"";
		};
"
                },

                { ItemSection.PBXGroup,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXGroup;
			children = (
[itemChildren]
			);
			name = ""[item.Name]"";
			path = ""[item.Path]"";
			sourceTree = [item.SourceTree];
		};
"               },

                { ItemSection.PBXNativeTarget,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = [item.ConfigurationList.Uid] /* Build configuration list for PBXNativeTarget ""[item.Identifier]"" */;
			buildPhases = (
				[item.ShellScriptPreBuildPhaseUIDs] /* ShellScripts */,
				[item.ResourcesBuildPhase.Uid] /* Resources */,
				[item.SourceBuildPhaseUID] /* Sources */,
				[item.FrameworksBuildPhase.Uid] /* Frameworks */,
				[item.ShellScriptPostBuildPhaseUIDs] /* ShellScripts */,
			);
			buildRules = (
			);
			dependencies = (
[itemChildren]
			);
			name = ""[item.Identifier]"";
			productInstallPath = ""[item.ProductInstallPath]"";
			productName = ""[item.Identifier]"";
			productReference = [item.OutputFile.Uid] /* [item.OutputFile.Name] */;
			productType = ""[item.ProductType]"";
		};
"               },

                { ItemSection.PBXLegacyTarget,
@"		[item.Uid] /* [item.Identifier] */ = {
			isa = PBXLegacyTarget;
			buildArgumentsString = ""[item.BuildArgumentsString]"";
			buildConfigurationList = [item.ConfigurationList.Uid] /* Build configuration list for PBXLegacyTarget ""[item.Identifier]"" */;
			buildPhases = (
			);
			buildToolPath = ""[item.BuildToolPath]"";
			buildWorkingDirectory = ""[item.BuildWorkingDirectory]"";
			dependencies = (
			);
			name = ""[item.Identifier]"";
			passBuildSettingsInEnvironment = 1;
			productName = ""[item.Identifier]"";
			productType = ""[item.ProductType]"";
		};
"               },

                { ItemSection.PBXProject,
@"		[item.Uid] /* Project object */ = {
			isa = PBXProject;
{'fraction_non_alphanumeric': 0.14440923494794025, 'fraction_numerical': 0.004526935264825713, 'mean_word_length': 2.715438950554995, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1782481', 'n_tokens_mistral': 3899, 'n_tokens_neox': 3258, 'n_words': 655}