【发布时间】:2018-10-23 01:30:09
【问题描述】:
我的项目中有些参数需要在编译时传入。
所以我的build.gradle文件中有这样一个片段:
assemble {
description 'Check the necessary parameters and terminate compilation if they do not exist.'
if (!project.hasProperty('customArgs')) {
throw new RuntimeException("Parameter customArgs is not defined")
}
}
我编译的时候会使用命令gradle build -PcustomArgs=1234
在我将项目导入 Android Studio 之前一切都很好。
Gradle 项目同步总是失败。
也就是说,在项目同步的过程中,找不到可以设置参数的地方。
也就是说,如何在Android Studio中设置sync的参数?
【问题讨论】:
标签: android-studio gradle gradle-plugin