Add support for creating new extensions sdks

Add a new action 'new_sdk' that can be used to create a new extension
sdk level with a given set of module requirements.

Also add a test that we can re-create the test database correctly.

Bug: 173188089
Test: atest gen_sdk_test
Change-Id: I91b97c9638958ff39ffb6c52470a70bad0ea6697
diff --git a/gen_sdk/gen_sdk_test.sh b/gen_sdk/gen_sdk_test.sh
index adb76e0..80e21ca 100644
--- a/gen_sdk/gen_sdk_test.sh
+++ b/gen_sdk/gen_sdk_test.sh
@@ -30,3 +30,15 @@
   diff golden_binary <(gen_sdk --action print_binary --database testdata/test_extensions_db.textpb | xxd -p)
 }
 test_print_binary
+
+# Verifies the tool is able to re-create the test DB correctly.
+function test_new_sdk() {
+  rm -f extensions_db.textpb && touch extensions_db.textpb
+  gen_sdk --action new_sdk --sdk 1 --modules MEDIA_PROVIDER
+  gen_sdk --action new_sdk --sdk 2 --modules MEDIA,IPSEC
+  gen_sdk --action new_sdk --sdk 3 --modules MEDIA_PROVIDER
+  gen_sdk --action new_sdk --sdk 4 --modules SDK_EXTENSIONS,IPSEC
+
+  diff -u0 testdata/test_extensions_db.textpb extensions_db.textpb
+}
+test_new_sdk