android gradle 经验

```groovy
buildscript {
repositories {
// add custom url
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'

<pre class="prism-highlight line-numbers" data-start="1"><code class="language-null">}
</code></pre>

}
allprojects {
repositories {
maven {
url "http://xxx.com/xxxx" //custom url
}
}
gradle.projectsEvaluated {
tasks.withType(JavaCompile) {
options.compilerArgs << "-Xmaxerrs" << "1000"
}
}

}
apply plugin: 'com.android.application'

android {
signingConfigs {
sample1 {
keyAlias 'android'
keyPassword 'android'
storeFile file('/data/sign/xxx.keystore')
storePassword 'android'
}
}
compileSdkVersion 924
buildToolsVersion '23.0.0'
defaultConfig {
applicationId "com.tcl.ota"
minSdkVersion 21
targetSdkVersion 23
versionCode Integer.valueOf("0517010303")
versionName "v5.2.4.1.0519.8"

<pre class="prism-highlight line-numbers" data-start="1"><code class="language-null">}
lintOptions {
abortOnError false
}
buildTypes {
debug{
signingConfig signingConfigs.sample1
}
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
repositories {
flatDir {
dirs 'libs'
}
}
</code></pre>

ndk {
moduleName "hello-jni"
cFlags cFlags + " -mtune=atom -mssse3 -mfpmath=sse"
abiFilter "x86"
}
}

task listConfigs {
doLast {
configurations.compile.each { println it.name } //print depences detail
}
}

dependencies {
compile 'com.android.support:cardview-v7:24.+'
compile 'pkg_path:path:latest.release@aar'
compile fileTree(dir: 'libs', include: '*.jar')
compile files('libs/foo.jar')
compile project(':zxing')
}```

发表评论

电子邮件地址不会被公开。 必填项已用*标注