build.gradle(Project:My-app)
Tüm alt projeler / modüller için ortak olan yapılandırma seçeneklerini ekleyebileceğiniz üst düzey yapı dosyası.
Her proje birtop-level gradle file . Genellikle common configshepsini içerir modules. Buna ne dahil olursa olsun, top-level gradlehepsini etkileyecektir modules.
ör .:
// 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-alpha3'
//Maven plugin
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.gradle(Module:app)
Belirli modülünüzün dosyasını oluşturun (bağımlılıklarınızı eklediğiniz, yapılandırmaları imzaladığınız, yapı türleri, tatlar vb.)
Hepsinin modulesbelirli bir gradledosyası var . Bu gradledosyada ne varsa, yalnızca içinde bulunanları etkileyecektir module.
ör .:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "com.hrskrs.gesturefun"
minSdkVersion 10
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
zipAlignEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':gesture-fun')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.1.1'
compile 'com.android.support:design:23.1.1'
compile 'com.jakewharton:butterknife:7.0.1'
}
build.gradle(Modules:app)veya oraya gitmelisinizFile -> Project Structure -> Modules -> (Choose project you want to add library) -> Dependencies, buModule Dependency