2023-08-28 19:03:29 +00:00
|
|
|
package source; // Yeah, I know...
|
|
|
|
|
2024-03-03 04:49:27 +00:00
|
|
|
import sys.io.File;
|
|
|
|
|
2024-03-17 02:20:22 +00:00
|
|
|
/**
|
|
|
|
* A script which executes before the game is built.
|
|
|
|
*/
|
2023-08-28 19:03:29 +00:00
|
|
|
class Prebuild
|
|
|
|
{
|
2024-03-17 02:20:22 +00:00
|
|
|
static inline final BUILD_TIME_FILE:String = '.build_time';
|
2024-03-03 04:49:27 +00:00
|
|
|
|
2024-03-17 02:20:22 +00:00
|
|
|
static function main():Void
|
2023-08-28 19:03:29 +00:00
|
|
|
{
|
2025-06-06 21:33:04 +00:00
|
|
|
var start:Float = Sys.time();
|
2025-08-11 19:49:54 +00:00
|
|
|
// Sys.println('[INFO] Performing pre-build tasks...');
|
2024-11-01 03:25:34 +00:00
|
|
|
|
|
|
|
saveBuildTime();
|
|
|
|
|
2025-06-06 21:33:04 +00:00
|
|
|
var end:Float = Sys.time();
|
|
|
|
var duration:Float = end - start;
|
2025-08-11 19:49:54 +00:00
|
|
|
// Sys.println('[INFO] Finished pre-build tasks in $duration seconds.');
|
2024-03-03 04:49:27 +00:00
|
|
|
}
|
|
|
|
|
2024-03-17 02:20:22 +00:00
|
|
|
static function saveBuildTime():Void
|
2024-03-03 04:49:27 +00:00
|
|
|
{
|
2025-06-06 21:33:04 +00:00
|
|
|
// PostBuild.hx reads this file and computes the total build duration.
|
2024-03-17 02:20:22 +00:00
|
|
|
var fo:sys.io.FileOutput = File.write(BUILD_TIME_FILE);
|
|
|
|
var now:Float = Sys.time();
|
2024-03-03 04:49:27 +00:00
|
|
|
fo.writeDouble(now);
|
|
|
|
fo.close();
|
2023-08-28 19:03:29 +00:00
|
|
|
}
|
|
|
|
}
|