comparison gui_ze/gui_ze.bzl @ 15:2b9e75756825

[GuiZe] Updated to handle bundling and created a shee l script for pushing.
author June Park <parkjune1995@gmail.com>
date Fri, 03 Oct 2025 06:50:33 -0700
parents de54585a40f1
children 7d3fa1a7a854
comparison
equal deleted inserted replaced
14:0570ada19343 15:2b9e75756825
26 copy_cmd.append("mkdir -p {}".format(out_dir.path)) 26 copy_cmd.append("mkdir -p {}".format(out_dir.path))
27 27
28 for f in runfiles_files: 28 for f in runfiles_files:
29 if f.path == binary.path: 29 if f.path == binary.path:
30 continue 30 continue
31
32 start = 0
33 for directory in f.path.split("/"):
34 if directory == binary.short_path.split("/")[0]:
35 break
36 print("\n\n equals: ", directory, binary.short_path.split("/")[0]);
37 start += 1
38
31 # Remove the first folder (output) and last file (actaul files that needed to be copied) 39 # Remove the first folder (output) and last file (actaul files that needed to be copied)
32 paths = "/".join(f.path.split("/")[:-1]) 40 paths = "/".join(f.path.split("/")[start:-1])
33 full_path = "{}/{}".format(out_dir.path, paths) 41 full_path = "{}/{}".format(out_dir.path, paths)
34 copy_cmd.append("mkdir -p {}".format(full_path)) 42 copy_cmd.append("mkdir -p {}".format(full_path))
35 copy_cmd.append("cp {} {}".format(f.path, full_path)) 43 copy_cmd.append("cp {} {}".format(f.path, full_path))
36 44
37 copy_cmd.append("cp {} {}".format(binary.path, out_dir.path)) 45 copy_cmd.append("cp {} {}".format(binary.path, out_dir.path))
87 }, 95 },
88 executable = True, 96 executable = True,
89 ) 97 )
90 98
91 def _bun_build_impl(ctx): 99 def _bun_build_impl(ctx):
100 """
101 Run bun build on the folder
102
103 This sucks because you need to either copy node module into the root folder where main.ts file
104 exists or copy everything outwards. I chose to do it in this way.
105
106 TODO: If possible, maybe create a node_module inside of the main target path and create a symlink,
107 but I couldn't get it to work lol.
108 """
92 out = ctx.actions.declare_file(ctx.label.name + ".js") 109 out = ctx.actions.declare_file(ctx.label.name + ".js")
93 inputs = [ctx.file.src] + ctx.files.data 110 inputs = [ctx.file.src] + ctx.files.data
94 111
95 ctx.actions.run_shell( 112 ctx.actions.run_shell(
96 inputs = inputs, 113 inputs = inputs,