title: Gradle: Using includeFlat to let project depend on local project
body: <p>I've got the following setup, with workspace being a normal directory containing my programs and Lib/App being Gradle projects created with the <code>gradle init</code> wizard.</p>
  <pre><code>\-- workspace
      +-- Lib
          +-- settings.gradle
          \-- lib
              +-- src\main\java\com\msgprograms\lib
                  \-- Library.java
              \-- build.gradle
      \-- App
          +-- settings.gradle
          \-- app 
              +-- src\main\java\com\msgprograms\app
                  \-- App.java
              \-- build.gradle
  </code></pre>
  <p>I'm now trying to get <code>App</code> to use <code>Lib</code> as a library, but after about two hours of research I still can't get it to do so. As I plan to use <code>Lib</code> in a number of other projects in the future, I don't want to make it a part of <code>App</code> in any form. It wouldn't make sense to do that for me and it makes it easier to find the library in my workspace this way. I've tried the solutions detailed <a href="https://stackoverflow.com/questions/36479097/gradle-local-project-dependency">here</a>, as they seemed the most promising, but to no avail.</p>
  <p>Here are the build and settings files.</p>
  <pre><code>//////////////////////
  // App\app\build.gradle
  
  plugins {
      id 'application'
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
      implementation 'com.google.guava:guava:31.0.1-jre'
  }
  
  application {
      mainClass = 'com.msgprograms.app.App'
  }
  
  tasks.named('test') {
      useJUnitPlatform()
  }
  
  //////////////////////
  // App\settings.gradle
  
  rootProject.name = 'Appl'
  include('app')
  </code></pre>
  <pre><code>//////////////////////
  // Lib\lib\build.gradle
  
  plugins {
      id 'java-library'
  }
  
  repositories {
      mavenCentral()
  }
  
  dependencies {
      testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2'
      api 'org.apache.commons:commons-math3:3.6.1'
      implementation 'com.google.guava:guava:31.0.1-jre'
  }
  
  tasks.named('test') {
      useJUnitPlatform()
  }
  
  
  //////////////////////
  // Lib\settings.gradle
  
  rootProject.name = 'Libr'
  include('lib')
  </code></pre>
  <p>...and here are the sources:</p>
  <pre><code>// App\app\src\main\java\com\msgprograms\app\App.java
  package com.msgprograms.app;
  
  public class App {
      public String getGreeting() {
          return &quot;Hello World!&quot;;
      }
  
      public static void main(String[] args) {
          System.out.println(new App().getGreeting());
          System.out.println(Library.someLibraryFunction());
      }
  }
  </code></pre>
  <pre><code>// Lib\lib\src\main\java\com\msgprograms\lib\Library.java
  package com.msgprograms.lib;
  
  public class Library {
      public boolean someLibraryMethod() {
          return true;
      }
  }
  
  </code></pre>
  <p>While adding <code>includeFlat 'Libr'</code> to<code>App\settings.gradle</code> seems like the thing to use, I cannot for the life of me figure out how to <code>import com.msgprograms.lib.Library</code> successfully. The relevant answer doesn't go into enough detail to be of use, the linked docs are not helping and the other answers to the post linked above aren't helpful either.</p>
  <p>How do I let gradle projects depend on another local library-type project?</p>