How to add a linked source folder in Android Studio?

前端 未结 6 1828
野的像风
野的像风 2020-11-28 05:38

In Eclipse I can add a source folder to my android project as a \"linked source folder\". How do I achieve the same thing in Android Studio?

Or is it possible to ad

6条回答
  •  我在风中等你
    2020-11-28 06:06

    Just in case anyone is interested, heres a complete Java module gradle file that correctly generates and references the built artefacts within an Android multi module application

    buildscript {
        repositories {
            maven {
                url "https://plugins.gradle.org/m2/"
            }
        }
        dependencies {
            classpath "net.ltgt.gradle:gradle-apt-plugin:0.15"
        }
    }
    
    apply plugin: "net.ltgt.apt"
    apply plugin: "java-library"
    apply plugin: "idea"
    
    idea {
        module {
            sourceDirs += file("$buildDir/generated/source/apt/main")
            testSourceDirs += file("$buildDir/generated/source/apt/test")
        }
    }
    
    dependencies {
    
        // Dagger 2 and Compiler
        compile "com.google.dagger:dagger:2.15"
        apt "com.google.dagger:dagger-compiler:2.15"
        compile "com.google.guava:guava:24.1-jre"
    
    }
    
    sourceCompatibility = "1.8"
    targetCompatibility = "1.8"
    

提交回复
热议问题