Skip to content

Commit

Permalink
Added timers
Browse files Browse the repository at this point in the history
  • Loading branch information
britzl committed Oct 2, 2023
1 parent 8ac9e29 commit e1f5918
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,13 @@ public void build(Task<Void> task) throws CompileExceptionError, IOException {
// create the resource graphs
// the full graph contains all resources in the project
// the live update graph contains each resource only once per collection proxy
logger.info("Generating the resource graph");
long tstart = System.currentTimeMillis();
ResourceGraphs resourceGraphs = createResourceGraphs(project);
ResourceGraph fullGraph = resourceGraphs.getFullGraph();
ResourceGraph liveUpdateGraph = resourceGraphs.getLiveUpdateGraph();
long tend = System.currentTimeMillis();
logger.info("Generating the resource graph took %f s", (tend-tstart)/1000.0);

// create full list of resources including the custom resources
// make sure to not archive the .arci, .arcd, .projectc, .dmanifest, .resourcepack.zip, .public.der
Expand Down Expand Up @@ -478,8 +482,12 @@ public void build(Task<Void> task) throws CompileExceptionError, IOException {

// game.graph.json
fullGraph.setHexDigests(archiveBuilder.getCachedHexDigests());
logger.info("Writing the resource graph to json");
tstart = System.currentTimeMillis();
String fullGraphJSON = fullGraph.getRootNode().toJSON();
task.getOutputs().get(5).setContent(fullGraphJSON.getBytes());
tend = System.currentTimeMillis();
logger.info("Writing the resource graph to json took %f s", (tend-tstart)/1000.0);

// Add copy of game.dmanifest to be published with liveupdate resources
File manifestFileHandle = new File(task.getOutputs().get(3).getAbsPath());
Expand Down

0 comments on commit e1f5918

Please sign in to comment.