问题描述
帮我建立comile依赖于Android的工作室的build.gradle。
我的意思是,他们不包括成最终的APK。
Help me to set up comile dependencies in Android Studio in build.gradle.I mean that they not include into final APK.
本的build.gradle工作正常,但我不需要
this build.gradle works fine but i don't need
龙目岛
库在运行时的apk;
library in apk in runtime;
apply plugin: 'android'
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
} }
dependencies {
compile 'com.android.support:appcompat-v7:+'
compile 'org.projectlombok:lombok:1.12.2' }
和可能是其可能对全球的build.gradle文件设置为所有项目?
And may be its possible to setup in global build.gradle file for all projects?
推荐答案
我在文件夹中的gradle改变 gradle-wrapper.properties
文件来解决这个问题。
现在看起来是这样的:
I resolve this issue by changing gradle-wrapper.properties
file in gradle folder.Now it looks like this:
#Sat Jan 25 02:59:06 EET 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=http\://services.gradle.org/distributions/gradle-1.10-all.zip
和主的build.gradle
文件我可以写本龙目岛
and in main build.gradle
file i can wrote this for lombok
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.8.+'
}
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'android'
buildscript {
repositories {
mavenCentral()
}
}
android {
compileSdkVersion 19
buildToolsVersion "19.0.0"
defaultConfig {
minSdkVersion 10
targetSdkVersion 16
versionCode 1
versionName "1.0"
}
buildTypes {
release {
runProguard false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:+'
provided 'org.projectlombok:lombok:1.12.2'
}
}
现在的子项目我不需要编写插件或仓库,并提供方法很多PARAMS工作pretty罚款。
Now in sub projects i don't need write many params for plugins or repositories and provided method works pretty fine.
这篇关于如何设置在Android Studio中编译库。 LOMBOK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!