diff --git a/.flowconfig b/.flowconfig index 43acd4c9d34a5f..16132121252f0c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,7 +1,7 @@ [ignore] # We fork some components by platform. -.*/*.android.js +.*/*[.]android.js # Ignore templates with `@flow` in header .*/local-cli/generator.* diff --git a/local-cli/android/android.js b/local-cli/android/android.js new file mode 100644 index 00000000000000..016389824022f4 --- /dev/null +++ b/local-cli/android/android.js @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2015-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ +'use strict'; + +var generate = require('../generate/generate'); +var fs = require('fs'); + +function android(argv, config, args) { + return generate([ + '--platform', 'android', + '--project-path', process.cwd(), + '--project-name', args.projectName, + ], config); +} + +module.exports = { + name: 'android', + description: 'creates an empty android project', + func: android, + options: [{ + command: '--project-name [name]', + default: () => JSON.parse( + fs.readFileSync('package.json', 'utf8') + ).name, + }], +}; diff --git a/local-cli/commands.js b/local-cli/commands.js index 1bb6a31b63b083..5d7e78389ee43b 100644 --- a/local-cli/commands.js +++ b/local-cli/commands.js @@ -31,6 +31,7 @@ export type Command = { }; const documentedCommands = [ + require('./android/android'), require('./server/server'), require('./runIOS/runIOS'), require('./runAndroid/runAndroid'),