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
Configure a multi-project with subdirectories in Gradle
Generate a single executable jar with dependent libraries in Gradle 4.9
Create a Maven project with a command
[Gradle] Build a Java project with a configuration different from the convention
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
[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
Check coverage with Codecov in Java + Gradle + Wercker configuration