我尝试将Mosby 库添加到我的宠物项目中,但我不明白如何将其包含到项目中?我尝试通过添加为模块-> 添加为 Gradle 项目来添加 mosby,但它无法编译。
请给我链接一些教程,如何将项目(源代码)添加到我的项目中以及如何使用它(我的意思是从我的代码中访问库类)?
谢谢!
PS Project 存储在 K:\PetProject。莫斯比位于:K:\mosby。
settings.gradle(我的项目):
include ':app', ':mvp', ':sample-dagger2-rx', ':sample', ':mvp-common', ':viewstate', ':sample-kotlin', ':sample-flow', ':testing', ':sample-mail', ':sample-dagger1'
构建.gradle:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.0.0-beta7'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
myproject\app 中的 build.gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "net.simplevolk.mafiagm"
minSdkVersion 19
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { java.srcDirs = ['src/main/java', 'src/main/java/2'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
}