<commit_before>/*
	trimCsProjCs.exe [/D | \[VfBNg]
*/

#include "C:\Factory\Common\all.h"

int main(int argc, char **argv)
{
	// TODO


	// \40\40\40\40<Compile Include="BatchServer.cs" />   --   isFairRelPath -- z̑΃pX


}<commit_msg>daily<commit_after>/*
	trimCsProjCs.exe [/D | \[VfBNg]
*/

#include "C:\Factory\Common\all.h"

#define Clean() \
	(coExecute("qq -f"))

#define Build() \
	(coExecute("cx *"))

static char *SlnFile;
static char *ProjFile;
static char *ProjDir;
static char *OutFile;

static void ProcProj(int checkOnly)
{
	cout("checkOnly: %d\n", checkOnly);
	cout("ProjFile: %s\n", ProjFile);

	ProjDir = getParent(ProjFile);

	cout("ProjDir: %s\n", ProjDir);

	Clean();
	Build();

	{
		autoList_t *files = lssFiles(ProjDir);
		char *file;
		uint index;

		foreach(files, file, index)
			if(!mbs_stristr(file, "bin\\Release") || _stricmp(getExt(file), "exe")) // DLL ͑ΏۊO
				file[0] = '\0';

		trimLines(files);

		errorCase_m(getCount(files) != 1, "o̓t@CPɍi܂B");

		OutFile = getLine(files, 0);
		releaseAutoList(files);
	}

	cout("OutFile: %s\n", OutFile);

	Clean();

	errorCase_m(existFile(OutFile), "N[AbvĂo̓t@C폜܂B");

	if(checkOnly)
		goto checkOnlyEnd;

	LOGPOS();



	LOGPOS();

checkOnlyEnd:
	memFree(ProjDir);
	memFree(OutFile);
	ProjDir = NULL;
	OutFile = NULL;

	LOGPOS();
}
static void TrimCsProjCs(void)
{
	// set SlnFile
	{
		autoList_t *files = lsFiles(".");
		char *file;
		uint index;

		foreach(files, file, index)
			if(_stricmp(getExt(file), "sln"))
				file[0] = '\0';

		trimLines(files);

		errorCase_m(getCount(files) != 1, "\[VPɍi܂B");

		SlnFile = getLine(files, 0);
		releaseAutoList(files);
	}

	// set ProjFile + call (CheckProj, ProcProj)
	{
		autoList_t *files = lssFiles(".");
		char *file;
		uint index;

		foreach(files, file, index)
			if(_stricmp(getExt(file), "csproj"))
				file[0] = '\0';

		trimLines(files);

		errorCase_m(!getCount(files), "vWFNgPL܂B");

		foreach(files, file, index)
		{
			ProjFile = file;
			ProcProj(1);
			ProjFile = NULL;
		}
		foreach(files, file, index)
		{
			ProjFile = file;
			ProcProj(0);
			ProjFile = NULL;
		}
		releaseDim(files, 1);
	}

	memFree(SlnFile);
	SlnFile = NULL;
}
int main(int argc, char **argv)
{
	if(argIs("/D"))
	{
		char *slnDir = c_dropDir();

		addCwd(slnDir);
		{
			TrimCsProjCs();
		}
		unaddCwd();
	}
	else if(hasArgs(1))
	{
		char *slnDir = nextArg();

		addCwd(slnDir);
		{
			TrimCsProjCs();
		}
		unaddCwd();
	}
	else
	{
		TrimCsProjCs();
	}
}
{'fraction_non_alphanumeric': 0.19018653690186538, 'fraction_numerical': 0.008921330089213302, 'mean_word_length': 3.681214421252372, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '6923410', 'n_tokens_mistral': 1225, 'n_tokens_neox': 1088, 'n_words': 195}