3

I'm trying to create a Bash script to automate the creation of some projects and modules to be used by Android Studio later. However, I can only find how to create projects using the command line, not modules:

android create project --gradle --gradle-version 1.5.0 --target "${BASE_API}" --name "${PROJECT_NAME}" --path "${PROJECT_NAME}" --activity DummyActivity --package it.doesnt.matter

How can I create a module inside the project created above using a Bash command?

2
  • gradle is the one that creates the module, you need to run the gradle task that is used to create modules. Just create a moudle in android studio using GUI, then check the gradle console to see the tasks being run Commented Dec 4, 2015 at 12:31
  • Gradle is the one that assembles the module, so try invoking gradlew from the command line? Perhaps this link (developer.android.com/intl/zh-tw/tools/building/…) can help you. Commented Dec 4, 2015 at 12:35

1 Answer 1

3

A module is mostly just a directory of files. So:

  1. Create a directory (mkdir yourModule)

  2. Put whatever files you want in this directory, such as build.gradle

  3. Script a solution to edit the settings.gradle file and add your module to the list of modules

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.