加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
build.gradle 3.08 KB
一键复制 编辑 原始数据 按行查看 历史
山野羡民 提交于 2016-10-22 00:36 . update gradle scripts
//参考:https://raw.github.com/dm77/barcodescanner/master/build.gradle
//参考:https://raw.github.com/liungkejin/GradlePublish/master/java-bintray.gradle
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.5"
}
}
allprojects {
group = GROUP
version = VERSION_NAME
repositories {
jcenter() //bintray的maven库
mavenCentral() //sonatype的maven库
mavenLocal() //本地的maven库
maven {
url "https://www.jitpack.io" //jitpack的maven库
}
flatDir {
dirs 'libs' //本地aar文件
}
}
ext {
isLibrary = false
pomArtifactId = project.name
pomVersion = VERSION_NAME
pomDescription = 'This is library description'
}
}
subprojects {
afterEvaluate { Project project ->
ext.pluginContainer = project.getPlugins()
def hasAppPlugin = ext.pluginContainer.hasPlugin("com.android.application")
def hasLibPlugin = ext.pluginContainer.hasPlugin("com.android.library")
if (hasAppPlugin || hasLibPlugin) {
android {
compileSdkVersion COMPILE_SDK_VERSION as int
buildToolsVersion BUILD_TOOL_VERSION
defaultConfig {
minSdkVersion MIN_SDK_VERSION as int
targetSdkVersion TARGET_SDK_VERSION as int
versionCode VERSION_CODE as int
versionName VERSION_NAME
}
buildTypes {
release {
debuggable false
minifyEnabled false //实时构建库项目时若启用混淆,APP模块引用会造成部分方法找不到
}
debug {
debuggable true
minifyEnabled false
}
}
lintOptions {
abortOnError false
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'
exclude 'META-INF/ASL2.0'
}
}
dependencies {
compile "com.android.support:support-v4:${ANDROID_SUPPORT_VERSION}"
compile "com.android.support:support-annotations:${ANDROID_SUPPORT_VERSION}"
}
}
if (project.isLibrary) {
configure(project) {
apply from: "${rootDir}/publish.gradle" //调用发布脚本
}
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化