No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

crashlytics-mappingfile-generateid.js 1.4KB

1234567891011121314151617181920212223242526
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.command = void 0;
  4. const command_1 = require("../command");
  5. const utils = require("../utils");
  6. const buildToolsJarHelper_1 = require("../crashlytics/buildToolsJarHelper");
  7. const error_1 = require("../error");
  8. exports.command = new command_1.Command("crashlytics:mappingfile:generateid")
  9. .description("generate a mapping file id and write it to an Android resource file, which will be built into the app")
  10. .option("--resource-file <resourceFile>", "path to the Android resource XML file that will be created or updated.")
  11. .action(async (options) => {
  12. const debug = !!options.debug;
  13. const resourceFilePath = options.resourceFile;
  14. if (!resourceFilePath) {
  15. throw new error_1.FirebaseError("set --resource-file <resourceFile> to an Android resource file path, e.g. app/src/main/res/values/crashlytics.xml");
  16. }
  17. const jarFile = await (0, buildToolsJarHelper_1.fetchBuildtoolsJar)();
  18. const jarOptions = { resourceFilePath };
  19. utils.logBullet(`Updating resource file: ${resourceFilePath}`);
  20. const generateIdArgs = buildArgs(jarOptions);
  21. (0, buildToolsJarHelper_1.runBuildtoolsCommand)(jarFile, generateIdArgs, debug);
  22. utils.logBullet("Successfully updated mapping file id");
  23. });
  24. function buildArgs(options) {
  25. return ["-injectMappingFileIdIntoResource", options.resourceFilePath, "-verbose"];
  26. }