[JAVA] Add a project in any folder with Gradle

Introduction

Since it was an irregular folder structure in React Native's Android project, I will show you how to handle it well with Gradle. In case of subfolders or folders in the same hierarchy, it can be realized by Multi-project with Gradle.

Folder structure

myapp/
  android/★ root project
    build.gradle
    settings.gradle ★ Edit this
    app/★ App project
      build.gradle
library/
  android/★ Library project
    build.gradle

Setting

settings.gradle


include ':app'
//Add from here
include ':library'
project(':library').projectDir = file('../../library/android')
//Add up to here

Reference site

Recommended Posts

Add a project in any folder with Gradle
Build a Java project with Gradle
Configure a multi-project with subdirectories in Gradle
Add .gitignore when creating a project in Xcode
Add a local Swift Package to your project with Swift PM
In Ruby you can define a method with any name
Generate a single executable jar with dependent libraries in Gradle 4.9
Automatically specify version in gradle project
Add a search function in Rails.
[Rails] Creating a new project with rails new
Create a Maven project with a command
How to create a new Gradle + Java + Jar project in Intellij 2016.03
Add a time stamp to the JAR file name in Gradle
[Gradle] Build a Java project with a configuration different from the convention
Creating a project (and GitHub repository) using Java and Gradle in IntelliJ IDEA
Build a bulletin board API with authentication authorization in Rails # 13 Add authentication header
Split a string with ". (Dot)" in Java
Define a task to ZIP archive a set of project files in Gradle
Make the context root a project folder in an Eclipse dynamic web project
Add scripts to distributions created with gradle
Build a bulletin board API with authentication authorization in Rails # 17 Add administrator privileges
Create a website with Spring Boot + Gradle (jdk1.8.x)
Use static analysis tools in your Gradle project
Read a string in a PDF file with Java
Run a Spring Boot project in VS Code
Static code analysis with Checkstyle in Java + Gradle
Measure the size of a folder in Java
Add an item when logging in with devise
Run JUnit and Spock in a maven project
How to add a classpath in Spring Boot
Build Spring Boot project by environment with Gradle
[Jakarta EE 8 application development with Gradle] 2. Project creation
Run JVM-Math-Language as a Gradle project at hand
View the Gradle task in the Spring Boot project
Add packages to your project with Swift PM
Create a Java (Gradle) project with VS Code and develop it on a Docker container
Docker command to create Rails project with a single blow in environment without Ruby
How to create a Spring Boot project in IntelliJ
Add an external jar file in your IntelliJ project.
[Note] Build a Python3 environment with Docker in EC2
[How to insert a video in haml with Rails]
Quickly implement a singleton with an enum in Java
[Java] Get the file path in the folder with List
[Beginner] I stumbled upon launching a project with Rails6
Output true with if (a == 1 && a == 2 && a == 3) in Java (Invisible Identifier)
Check coverage with Codecov in Java + Gradle + Wercker configuration
Use Coveralls with GitHub Actions in a Ruby repository
Until you build a project described in scala with Maven and execute it with the scala command.