<commit_before>---
-- xcode/xcode4_project.lua
-- Generate an Xcode project file.
-- Author <NAME>
-- Modified by <NAME>
-- Copyright (c) 2009-2015 <NAME> and the Premake project
---

	local p = premake
	local m = p.modules.xcode

	local xcode = p.modules.xcode
    local project = p.project
    local config = p.config
	local fileconfig = p.fileconfig
	local tree = p.tree

--
-- Create a tree corresponding to what is shown in the Xcode project browser
-- pane, with nodes for files and folders, resources, frameworks, and products.
--
-- @param prj
--    The project being generated.
-- @returns
--    A tree, loaded with metadata, which mirrors Xcode's view of the project.
--

	function xcode.buildprjtree(prj)
		local tr = project.getsourcetree(prj, nil , false)
		tr.project = prj

		-- create a list of build configurations and assign IDs
		tr.configs = {}

		for cfg in project.eachconfig(prj) do
			cfg.xcode = {}
			cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode.name, cfg.buildcfg)
			cfg.xcode.projectid = xcode.newid(tr.name, cfg.buildcfg)
			table.insert(tr.configs, cfg)
		end

        -- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
		-- to Xcode's display layout (MainMenu.xib/English).
		 tree.traverse(tr, {
		 	onbranch = function(node)
		 		if path.getextension(node.name) == ".lproj" then
		 			local lang = path.getbasename(node.name)  -- "English", "French", etc.

		 			-- create a new language group for each file it contains
		 			for _, filenode in ipairs(node.children) do
		 				local grpnode = node.parent.children[filenode.name]
		 				if not grpnode then
		 					grpnode = tree.insert(node.parent, tree.new(filenode.name))<commit_msg>fix: project guids are not unique if project name and target name are the same (which is the default behavior) causing xcode to crash.<commit_after>---
-- xcode/xcode4_project.lua
-- Generate an Xcode project file.
-- Author <NAME>
-- Modified by <NAME>
-- Copyright (c) 2009-2015 <NAME> and the Premake project
---

	local p = premake
	local m = p.modules.xcode

	local xcode = p.modules.xcode
	local project = p.project
	local config = p.config
	local fileconfig = p.fileconfig
	local tree = p.tree

--
-- Create a tree corresponding to what is shown in the Xcode project browser
-- pane, with nodes for files and folders, resources, frameworks, and products.
--
-- @param prj
--    The project being generated.
-- @returns
--    A tree, loaded with metadata, which mirrors Xcode's view of the project.
--

	function xcode.buildprjtree(prj)
		local tr = project.getsourcetree(prj, nil , false)
		tr.project = prj

		-- create a list of build configurations and assign IDs
		tr.configs = {}

		for cfg in project.eachconfig(prj) do
			cfg.xcode = {}
			cfg.xcode.targetid = xcode.newid(prj.xcode.projectnode.name, cfg.buildcfg, "target")
			cfg.xcode.projectid = xcode.newid(tr.name, cfg.buildcfg)
			table.insert(tr.configs, cfg)
		end

        -- convert localized resources from their filesystem layout (English.lproj/MainMenu.xib)
		-- to Xcode's display layout (MainMenu.xib/English).
		 tree.traverse(tr, {
		 	onbranch = function(node)
		 		if path.getextension(node.name) == ".lproj" then
		 			local lang = path.getbasename(node.name)  -- "English", "French", etc.

		 			-- create a new language group for each file it contains
		 			for _, filenode in ipairs(node.children) do
		 				local grpnode = node.parent.children[filenode.name]
		 				if not grpnode then
		 					grpnode = tree.insert(node.parent, tree.new(filenode.name))
{'fraction_non_alphanumeric': 0.10986232087665075, 'fraction_numerical': 0.005057600449564484, 'mean_word_length': 3.0825688073394497, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6628303', 'n_tokens_mistral': 1286, 'n_tokens_neox': 1133, 'n_words': 361}