<commit_before>//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Define directories.
var unityBuildProjectWebData = "./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity/Scratchity.data";
var unityBuildProjectDllDir = Directory("./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity");

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
    .Does(() =>
{
    CleanDirectory(Directory("./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity"));
    DeleteFiles("../bin/*.unitypackage");
    CleanDirectory(Directory("./temp"));
    CleanDirectory(Directory("./temp/web"));
});


Task("BuildDll")
    .IsDependentOn("Clean")
    .Does(() =>
{
  // Use MSBuild
  Information("-- begin -- Scratchity Dll Build");
  MSBuild("./BuildCSharpCode/ScratchityBuild/ScratchityBuild.csproj", settings =>
     settings.SetConfiguration(configuration).WithTarget("Clean").WithTarget("Build"));
  Information("-- end -- Scratchity Dll Build");
  
  // Copy Dll files
  CopyFiles("../src/unity-project/Assets/Editor Default Resources/Editor/ScratchitySource/Lib/*.dll", unityBuildProjectDllDir);
  CopyFiles("./BuildCSharpCode/ScratchityBuild/bin/Release/Scratchity.dll", unityBuildProjectDllDir);
});

Task("BuildJS")
    .IsDependentOn("Clean")
    .Does(() =>
{
  Information("-- begin -- Blockly Build");
  var exitCodeWithArgument = StartProcess(".\\build_blockly.bat");
  // This should output 0 as valid arguments supplied
  Information("-- end -- Blockly Build");
  
  // Copy files
  CopyDirectory("../src/web/blockly/media", "./temp/web/media");
  CopyDirectory("../src/web/bootstrap/fonts", "./temp/web/fonts");
  CopyFileToDirectory("../src/web/toolbox.xml", Directory("./temp/web"));
  
  // JS files still go through some other process => see "MergeJSandHTML"
});

Task("BuildAppJS")
    .IsDependentOn("BuildJS")<commit_msg>Build process bugfix: file icon is not bundled in installer<commit_after>//////////////////////////////////////////////////////////////////////
// ARGUMENTS
//////////////////////////////////////////////////////////////////////

var target = Argument("target", "Default");
var configuration = Argument("configuration", "Release");

//////////////////////////////////////////////////////////////////////
// PREPARATION
//////////////////////////////////////////////////////////////////////

// Define directories.
var unityBuildProjectWebData = "./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity/Scratchity.data";
var unityBuildProjectDllDir = Directory("./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity");

//////////////////////////////////////////////////////////////////////
// TASKS
//////////////////////////////////////////////////////////////////////

Task("Clean")
    .Does(() =>
{
    CleanDirectory(Directory("./unity-project-auto-package-build/Assets/Editor Default Resources/Editor/Scratchity"));
    DeleteFiles("../bin/*.unitypackage");
    CleanDirectory(Directory("./temp"));
    CleanDirectory(Directory("./temp/web"));
});


Task("BuildDll")
    .IsDependentOn("Clean")
    .Does(() =>
{
  // Use MSBuild
  Information("-- begin -- Scratchity Dll Build");
  MSBuild("./BuildCSharpCode/ScratchityBuild/ScratchityBuild.csproj", settings =>
     settings.SetConfiguration(configuration).WithTarget("Clean").WithTarget("Build"));
  Information("-- end -- Scratchity Dll Build");
  
  // Copy Dll files
  CopyFiles("../src/unity-project/Assets/Editor Default Resources/Editor/ScratchitySource/Lib/*.dll", unityBuildProjectDllDir);
  CopyFiles("./BuildCSharpCode/ScratchityBuild/bin/Release/Scratchity.dll", unityBuildProjectDllDir);
  
  // Copy Icon
  CopyFiles("../src/unity-project/Assets/Editor Default Resources/Editor/Scratchity/*", unityBuildProjectDllDir);
});

Task("BuildJS")
    .IsDependentOn("Clean")
    .Does(() =>
{
  Information("-- begin -- Blockly Build");
  var exitCodeWithArgument = StartProcess(".\\build_blockly.bat");
  // This should output 0 as valid arguments supplied
  Information("-- end -- Blockly Build");
  
  // Copy files
  CopyDirectory("../src/web/blockly/media", "./temp/web/media");
  CopyDirectory("../src/web/bootstrap/fonts", "./temp/web/fonts");
  CopyFileToDirectory("../src/web/toolbox.xml", Directory("./temp/web"));
  
  // JS files still go through some other process => see "MergeJSandHTML"
});

Task("BuildAppJS")
    .IsDependentOn("BuildJS")
{'fraction_non_alphanumeric': 0.3104417670682731, 'fraction_numerical': 0.00040160642570281126, 'mean_word_length': 2.0746913580246913, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4856529', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1272, 'n_words': 216}