Repositorio del curso CCOM4030 el semestre B91 del proyecto Artesanías con el Instituto de Cultura

create 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/usr/bin/env node
  2. /*
  3. Licensed to the Apache Software Foundation (ASF) under one
  4. or more contributor license agreements. See the NOTICE file
  5. distributed with this work for additional information
  6. regarding copyright ownership. The ASF licenses this file
  7. to you under the Apache License, Version 2.0 (the
  8. "License"); you may not use this file except in compliance
  9. with the License. You may obtain a copy of the License at
  10. http://www.apache.org/licenses/LICENSE-2.0
  11. Unless required by applicable law or agreed to in writing,
  12. software distributed under the License is distributed on an
  13. "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  14. KIND, either express or implied. See the License for the
  15. specific language governing permissions and limitations
  16. under the License.
  17. */
  18. var path = require('path');
  19. var ConfigParser = require('cordova-common').ConfigParser;
  20. var Api = require('./templates/cordova/Api');
  21. var argv = require('nopt')({
  22. 'help': Boolean,
  23. 'cli': Boolean,
  24. 'shared': Boolean,
  25. 'link': Boolean,
  26. 'activity-name': [String, undefined]
  27. }, { 'd': '--verbose' });
  28. if (argv.help || argv.argv.remain.length === 0) {
  29. console.log('Usage: ' + path.relative(process.cwd(), path.join(__dirname, 'create')) + ' <path_to_new_project> <package_name> <project_name> [<template_path>] [--activity-name <activity_name>] [--link]');
  30. console.log(' <path_to_new_project>: Path to your new Cordova Android project');
  31. console.log(' <package_name>: Package name, following reverse-domain style convention');
  32. console.log(' <project_name>: Project name');
  33. console.log(' <template_path>: Path to a custom application template to use');
  34. console.log(' --activity-name <activity_name>: Activity name');
  35. console.log(' --link will use the CordovaLib project directly instead of making a copy.');
  36. process.exit(1);
  37. }
  38. var config = new ConfigParser(path.resolve(__dirname, 'templates/project/res/xml/config.xml'));
  39. if (argv.argv.remain[1]) config.setPackageName(argv.argv.remain[1]);
  40. if (argv.argv.remain[2]) config.setName(argv.argv.remain[2]);
  41. if (argv['activity-name']) config.setName(argv['activity-name']);
  42. var options = {
  43. link: argv.link || argv.shared,
  44. customTemplate: argv.argv.remain[3],
  45. activityName: argv['activity-name']
  46. };
  47. require('./templates/cordova/loggingHelper').adjustLoggerLevel(argv);
  48. Api.createPlatform(argv.argv.remain[0], config, options).done();