Copy some build_utils helpers to a non-android location

Specifically, moves:
 * atomic_output
 * add_depfile_arg()
 * parse_gn_list()
 * write_depfile()

Into //build/action_helpers.py

This will remove some oddness of non-Android scripts importing a file
from //build/android.

I will remove the copies in build_utils.py in a follow-up.

Bug: 1428082
Change-Id: If7dfe5306a7907987417e345637758c716a75ab5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4382406
Commit-Queue: Andrew Grieve <[email protected]>
Reviewed-by: Sam Maier <[email protected]>
Auto-Submit: Andrew Grieve <[email protected]>
Owners-Override: Andrew Grieve <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1124347}
NOKEYCHECK=True
GitOrigin-RevId: 9d2a1ed6ee36f55b30031afaca939708c20410a5
diff --git a/generate_bash_script.py b/generate_bash_script.py
index 91cbc41..e80ef3b 100755
--- a/generate_bash_script.py
+++ b/generate_bash_script.py
@@ -10,8 +10,8 @@
 
 sys.path.append(
     os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir,
-                 'build', 'android', 'gyp'))
-from util import build_utils
+                 'build'))
+import action_helpers
 
 
 def _parse_args(args):
@@ -101,9 +101,9 @@
 def _main():
     args = _parse_args(sys.argv[1:])
 
-    # AtomicOutput will ensure we only write to the file on disk if what we give
-    # to write() is different than what's currently on disk.
-    with build_utils.AtomicOutput(args.script_path) as f:
+    # atomic_output will ensure we only write to the file on disk if what we
+    # give to write() is different than what's currently on disk.
+    with action_helpers.atomic_output(args.script_path) as f:
         f.write(_generate_script(args).encode())
 
     # chmod a+x