give args to pom2mk in the right order

Bug: 76088091
Test: ./update_current.py -s 4675010

Change-Id: Ib8a1a04a3b4f6fa64dcb254c0abe2e708de9b088
diff --git a/update_current/update_current.py b/update_current/update_current.py
index 150279f..4fb9f39 100755
--- a/update_current/update_current.py
+++ b/update_current/update_current.py
@@ -338,9 +338,10 @@
     makefile = os.path.join(working_dir, 'Android.mk')
     with open(makefile, 'w') as f:
         args = ["pom2mk", "-static-deps", "-sdk-version", "current"]
-        args.extend(["-rewrite=^" + name + "$=" + maven_to_make[name][0] for name in maven_to_make])
-        args.extend(["."])
+        rewriteNames = [name for name in maven_to_make if ":" in name] + [name for name in maven_to_make if ":" not in name]
+        args.extend(["-rewrite=^" + name + "$=" + maven_to_make[name][0] for name in rewriteNames])
         args.extend(["-extra-deps=android-support-car=prebuilt-android.car-stubs"])
+        args.extend(["."])
         subprocess.check_call(args, stdout=f, cwd=working_dir)
 
     global rerun_extract_deps