// Top-level build file where you can add configuration options common to all sub-projects/modules.
// 設置腳本的運行環境
buildscript {
/**
* 支持java 依賴庫管理(maven/ivy),用於項目的依賴
* */
repositories {
jcenter()
}
/** 依賴包的定義。
* 支持maven/ivy,遠程,本地庫,也支持單文件,
* 如果前面定義了repositories{}maven 庫,
* 使用maven的依賴(我沒接觸過ivy。。)的時候只需要按照用類似於com.android.tools.build:gradle:0.4,
* gradle 就會自動的往遠程庫下載相應的依賴。
* */
dependencies {
classpath "com.android.tools.build:gradle:1.0.0"
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
allprojects {
repositories {
jcenter()
}
}
apply plugin: 'android'
apply plugin: 'android-apt'
def AndroidAnnotationVersion = '3.2'
def AppPackageName = "com.xxx.yyy"
def AppVersionCode = 1
def AppVersionName = "1.0.0"
/**
* 設置編譯android項目的參數
*/
android {
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.hequ.merchant"
minSdkVersion 14
targetSdkVersion 21
versionName AppVersionName
signingConfig signingConfigs.hequ
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
configurations {
apt
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
//AndroidAnnotation
apt files('compile-libs/androidannotations-3.2.jar')
//apt "org.androidannotations:androidannotations:$AndroidAnnotationVersion"
//compile "org.androidannotations:androidannotations-api:$AndroidAnnotationVersion"
compile 'com.android.support:appcompat-v7:21.0.3'
compile 'com.android.support:support-v4:21.0.3'
compile project(':imeth')
}
apt {
arguments {
androidManifestFile variant.<span style="background-color: rgb(255, 102, 102);">outputs[0]</span>.processResources.manifestFile
resourcePackageName AppPackageName
}
}
注意 紅色區 網上很多教程都不是這樣的..