我有一个带有任务的以下简单构建配置:
apply plugin: 'android' android { compileSdkVersion 19 buildToolsVersion "19.0.0" defaultConfig { minSdkVersion 15 targetSdkVersion 19 versionCode 1 versionName "1.0" } buildTypes { release { runProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt' } } task compileSass(type:Exec) { commandLine 'sass', "src/main/theme/default.scss", "src/main/assets/default.css" } project.afterEvaluate{ preBuild.dependsOn("compileSass") } }
从命令行运行时,构建运行正常gradle installDebug
但在从Android Studio运行时运行失败,并出现以下错误:
FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':PixateTest:compileSass'. > A problem occurred starting process 'command 'sass'' * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
如何将参数(例如--stacktrace)从Android Studio传递给Gradle,以便我可以调试任务失败的原因?
在OSX上:Android Studio - >首选项 - >编译器 - > Gradle - >命令行选项