gn2bp: Update not to change Android.bp.swp every run

Order of set iteration is not the same everytime.
Sort before the iteration to make Android.bp.swp same every time we run
update_result.sh

Test: ./update_result.sh

Change-Id: Ie6495db1b2ad62113ba4fccb5d76d6590a91a5ba
diff --git a/tools/gn2bp/Android.bp.swp b/tools/gn2bp/Android.bp.swp
index 42de957..68a2444 100644
--- a/tools/gn2bp/Android.bp.swp
+++ b/tools/gn2bp/Android.bp.swp
@@ -3092,32 +3092,32 @@
 genrule {
     name: "cronet_aml_net_base_registry_controlled_domains_registry_controlled_domains",
     cmd: "$(location net/tools/dafsa/make_dafsa.py) --reverse " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest5.gperf) " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest5-reversed-inc.cc) " +
-         "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
-         "--reverse " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest2.gperf) " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest2-reversed-inc.cc) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names.gperf) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names-reversed-inc.cc) " +
          "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
          "--reverse " +
          "$(location net/base/registry_controlled_domains/effective_tld_names_unittest1.gperf) " +
          "$(location net/base/registry_controlled_domains/effective_tld_names_unittest1-reversed-inc.cc) " +
          "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
          "--reverse " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest6.gperf) " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest6-reversed-inc.cc) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest2.gperf) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest2-reversed-inc.cc) " +
          "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
          "--reverse " +
          "$(location net/base/registry_controlled_domains/effective_tld_names_unittest3.gperf) " +
          "$(location net/base/registry_controlled_domains/effective_tld_names_unittest3-reversed-inc.cc) " +
          "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
          "--reverse " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names.gperf) " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names-reversed-inc.cc) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest4.gperf) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest4-reversed-inc.cc) " +
          "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
          "--reverse " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest4.gperf) " +
-         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest4-reversed-inc.cc)",
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest5.gperf) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest5-reversed-inc.cc) " +
+         "&& python3 $(location net/tools/dafsa/make_dafsa.py) " +
+         "--reverse " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest6.gperf) " +
+         "$(location net/base/registry_controlled_domains/effective_tld_names_unittest6-reversed-inc.cc)",
     out: [
         "net/base/registry_controlled_domains/effective_tld_names-reversed-inc.cc",
         "net/base/registry_controlled_domains/effective_tld_names_unittest1-reversed-inc.cc",
diff --git a/tools/gn2bp/gen_android_bp b/tools/gn2bp/gen_android_bp
index 7487287..b616db1 100755
--- a/tools/gn2bp/gen_android_bp
+++ b/tools/gn2bp/gen_android_bp
@@ -706,7 +706,7 @@
   So each source file will generate an output whose name is the {source_name-reversed-inc.cc}
   """
   new_args = []
-  for i, src in enumerate(target.sources):
+  for i, src in enumerate(sorted(target.sources)):
     # don't add script arg for the first source -- create_action_module
     # already does this.
     if i != 0: