Merge "Sort arguments and apps by ignoring case in run_on_as_app"
diff --git a/tools/as_utils.py b/tools/as_utils.py
index 5f224a6..7a6528a 100644
--- a/tools/as_utils.py
+++ b/tools/as_utils.py
@@ -127,7 +127,7 @@
       if '-printconfiguration' not in line:
         f.write(line)
     # Check that there is a line-break at the end of the file or insert one.
-    if lines[-1].strip():
+    if len(lines) and lines[-1].strip():
       f.write('\n')
     f.write('-printconfiguration {}\n'.format(destination))
 
@@ -159,7 +159,7 @@
   Move(src, dst, quiet=quiet)
 
 def MoveFile(src, dst, quiet=False):
-  assert os.path.isfile(src)
+  assert os.path.isfile(src), "Expected a file to be present at " + src
   Move(src, dst, quiet=quiet)
 
 def MoveProfileReportTo(dest_dir, build_stdout, quiet=False):
diff --git a/tools/run_on_as_app.py b/tools/run_on_as_app.py
index a810b3a..a75886b 100755
--- a/tools/run_on_as_app.py
+++ b/tools/run_on_as_app.py
@@ -59,6 +59,10 @@
       'app_id': 'com.google.firebase.example.fireeats',
       'git_repo': 'https://github.com/christofferqa/friendlyeats-android.git'
   },
+  'Instabug-Android': {
+      'app_id': 'com.example.instabug',
+      'git_repo': 'https://github.com/christofferqa/Instabug-Android.git',
+  },
   'KISS': {
       'app_id': 'fr.neamar.kiss',
       'git_repo': 'https://github.com/christofferqa/KISS',
@@ -93,6 +97,14 @@
       'git_repo': 'https://github.com/christofferqa/Simple-Calendar',
       'signed-apk-name': 'calendar-release.apk'
   },
+  'sqldelight': {
+      'app_id': 'com.example.sqldelight.hockey',
+      'git_repo': 'https://github.com/christofferqa/sqldelight.git',
+      'app_module': 'sample/android',
+      'archives_base_name': 'android',
+      'min_sdk': 14,
+      'compile_sdk': 28,
+  },
   'tachiyomi': {
       'app_id': 'eu.kanade.tachiyomi',
       'git_repo': 'https://github.com/sgjesse/tachiyomi.git',
@@ -380,7 +392,7 @@
 
   releaseTarget = config.get('releaseTarget')
   if not releaseTarget:
-    releaseTarget = app_module + ':' + 'assemble' + (
+    releaseTarget = app_module.replace('/', ':') + ':' + 'assemble' + (
         flavor.capitalize() if flavor else '') + 'Release'
 
   # Value for property android.enableR8.