gpt4 book ai didi

android - 具有相同变量的多个元素的 ManifestPlaceholders

转载 作者:行者123 更新时间:2023-12-03 04:22:46 27 4
gpt4 key购买 nike

在我的 AndroidManifest.xml文件我有以下行:

<supports-gl-texture android:name="${supportedTexture}" />

我根据所选 flavor 在 gradle 文件中注入(inject)正确支持的纹理,例如:
productFlavors {
ETC1 {
manifestPlaceholders = [supportedTexture: "GL_OES_compressed_ETC1_RGB8_texture"]
}
}

但是,如果我想添加几个 supports-gl-texture,这不起作用 list 中的行。那么我应该如何编辑 AndroidManifest.xmlbuild.gradle文件,如果我想有多个这样的supportedTextures:
<supports-gl-texture android:name="GL_OES_compressed_ETC1_RGB8_texture" />
<supports-gl-texture android:name="GL_AMD_compressed_ATC_texture" />

是否可以在 gradle 文件中执行以下操作:
productFlavors {
ETC1 {
manifestPlaceholders = [supportedTexture: "GL_OES_compressed_ETC1_RGB8_texture"]
}
ETC1andATC {
//manifestPlaceHolders = ???
}
}

还是我唯一的选择是走出 gradle 并拥有例如多个 Manifest 文件,我根据 gradle 风格将这些文件复制到项目中?

最佳答案

如果您支持的纹理数量有限,那么您可以为所有这些纹理定义多个键并在 list 文件中使用。

productFlavors {
ETC1 {
manifestPlaceholders = [
supportedTexture1: "GL_OES_compressed_ETC1_RGB8_texture",
supportedTexture2: "GL_AMD_compressed_ATC_texture"]
}
}

然后在你的 list 中
<supports-gl-texture android:name="${supportedTexture1}" />
<supports-gl-texture android:name="${supportedTexture2}" />

关于android - 具有相同变量的多个元素的 ManifestPlaceholders,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49274348/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com