简体   繁体   English

Android Studio中的旧项目结构

[英]Old project structure in Android Studio

I think the question says it all: Is it possible to use the old project structure in Android Studio? 我认为这个问题说明了一切:是否可以在Android Studio中使用旧项目结构? I wored for a long time with eclipse and was so used to it that the new file structure is now a bit confused to me. 我用eclipse担心了很长时间,已经习惯了,以至于新文件结构现在让我有些困惑。 So I really want to use Android Studio but with the old project structure. 因此,我真的想使用Android Studio但使用旧的项目结构。 Any ideas how I can reach that? 有什么想法可以实现吗?

You can change where Gradle looks for source files by manually specifying the sourceSets in build.gradle . 您可以通过在sourceSets中手动指定sourceSets来更改Gradle查找源文件的build.gradle In particular, you can set it to the 'old project structure' - add this to the android block of your build.gradle : 特别是,您可以将其设置为“旧项目结构”-将其添加到build.gradleandroid块中:

android {
    ...
    sourceSets {
        main {
            manifest.srcFile 'AndroidManifest.xml'
            java.srcDirs = ['src']
            resources.srcDirs = ['src']
            aidl.srcDirs = ['src']
            renderscript.srcDirs = ['src']
            res.srcDirs = ['res']
            assets.srcDirs = ['assets']
        }
    }
    ...
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM