【发布时间】:2017-04-26 19:36:01
【问题描述】:
我读到 gradle 是用 groovy 编写的。
但是我的 build.gradle 文件看起来不像 groovy。
事实上,它看起来根本不像一种语言。
这是我的 build.gradle 文件:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.israelkariti.location2_1"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
compile 'com.google.android.gms:play-services-maps:10.2.1'
testCompile 'junit:junit:4.12'
}
谁能给我解释一下这个语法是怎么回事。
该语法如何是 Groovy 代码?
如果我遗漏了一些重要的东西,请详细说明这件事是如何工作的。
谢谢
【问题讨论】:
-
Gradle 不是用 groovy 编写的。 Gradle 构建脚本是一个 groovy DSL。但你还在为哪一个而苦苦挣扎?
-
如果你包含插件和测试就足够了。主要核心是 Java 虽然github.com/gradle/gradle/tree/master/subprojects/core/src/main
标签: android android-studio gradle groovy