将abiFilters添加到gradle属性 [英] Add abiFilters to gradle properties

查看:355
本文介绍了将abiFilters添加到gradle属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在gradle.properties文件中添加ndk.abiFilters属性.现在,我在build.gradle中具有此属性. 这是我的build.gradle

I want to add ndk.abiFilters property in gradle.properties file. Now I've this property inside build.gradle. Here is part of my build.gradle

buildTypes {
  debug { 
     ndk {
       abiFilters "x86", "armeabi-v7a", "armeabi"
       //abiFilters ABI_FILTERS
     }
   }
}

这是我的gradle.properties文件的一部分

Here's part of my gradle.properties file

ABI_FILTERS = "x86", "armeabi-v7a", "armeabi"

问题是gradle.properties中的String没有正确转换为与abiFilters一起使用.我尝试了许多变体,但没有运气.正确执行此操作的正确方法是什么?谢谢您的帮助.

Problem is that String from gradle.properties is not correctly converted for use with abiFilters. I tried many variants but with no luck. What is the correct way how to do this correctly? Thank you for help.

推荐答案

在gradle.properties中,例如:

In gradle.properties you can have for example:

ABI_FILTERS=armeabi-v7a;x86 //delimiter can be anything (change below)

然后在build.gradle中(例如,在debug buildType部分中):

Then in build.gradle there is (for example in debug buildType section):

ndk {
  abiFilters = []
  abiFilters.addAll(ABI_FILTERS.split(';').collect{it as String})
}

现在,每个开发人员都可以为其当前的测试设备独立选择abi(gradle.properties位于.gitignore中).

Now each developer can choose independetly abi for his current testing device (gradle.properties is in .gitignore).

感谢Igor Ganapolsky的启动提示.

Thanks Igor Ganapolsky for starting hint.

这篇关于将abiFilters添加到gradle属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆