如何在 Gradle 中使用 Renderscript 支持库 [英] How to use the Renderscript Support Library with Gradle

查看:35
本文介绍了如何在 Gradle 中使用 Renderscript 支持库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以使用支持Renderscript库 与 Gradle?如果是这样,您如何将其包含在您的项目中?

Is it possible to use the Support Renderscript Library with Gradle? If so, how do you include it in your project?

推荐答案

Gradle for Android 现在支持 Renderscript v8,构建脚本中只有 2 行.请参阅Austyn Mahoney 的回答.出于历史目的保留原始答案.

Gradle for Android has now Renderscript v8 support with only 2 lines in your build script. See answer by Austyn Mahoney. Keeping the original answer for historical purpose.

旧答案:

Gradle 支持原生 RS 编译,但不支持 RS 支持库.原因是 RS 支持库与任何其他支持库相比非常复杂.RS 支持库实际上是一个 Java 支持库、一组支持该 Java 库的本机库、用于您编译的每个脚本的附加本机库,以及用于为您的脚本生成标准 LLVM 位代码和本机库的备用工具链.目前,只有 ADT 和 Ant 支持;Gradle 还没有出现.

Gradle supports native RS compilation, but not the RS support library. The reason is that the RS support library is hugely complicated compared to any other support library. The RS support library is actually a Java support library, a set of native libraries backing that Java lib, additional native libraries for every script you compile, and an alternate toolchain for generating both the standard LLVM bitcode and the native libraries for your scripts. Right now, only ADT and Ant support that; Gradle isn't there yet.

但是,已经可以使用 Gradle 的 RS 支持库的某些部分.如果要使用 RS 内在函数,可以链接支持库的 Java 部分 (sdk/build-tools/android-4.3/lib/renderscript/renderscript-v8.jar) 和本机组件 (sdk/build-tools/android-4.3/lib/renderscript/packaged/< arch >/*.so),然后就可以设置了.

However, it's possible to use some parts of the RS support library from Gradle already. If you want to use the RS intrinsics, you can link the Java part of the support library (sdk/build-tools/android-4.3/lib/renderscript/renderscript-v8.jar) and the native components (sdk/build-tools/android-4.3/lib/renderscript/packaged/< arch >/*.so), and then you'll be set.

我知道在不久的将来,Gradle 会支持支持库,但我没有可以分享的确定的 ETA.

I know Gradle support for the support library is coming at some point in the not too distant future, but I don't have a firm ETA that I can share.

这篇关于如何在 Gradle 中使用 Renderscript 支持库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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