Gradle 系统 属性 in gradle.properies 没有被使用吗? (javacpp,intellij)

Is Gradle system property in gradle.properies not being used? (javacpp, intellij)

根据JavaCPP文档,如果我们设置系统属性:javacpp.platform=linux-x86_64它不应该下载其他平台:

本文来自javacpp:

... This downloads binaries for all platforms, but to get binaries for only one platform we can set the javacpp.platform system property (via the -D command line option) to something like android-arm, linux-x86_64, macosx-x86_64, windows-x86_64, etc.

Gradle中设置系统属性的方法:

Using the -D command-line option, you can pass a system property to the JVM which runs Gradle. The -D option of the gradle command has the same effect as the -D option of the java command.

You can also set system properties in gradle.properties files with the prefix systemProp.

但是它会下载所有平台。我尝试了不同的方法来设置 属性 没有任何区别:

在gradle.properties中:

systemProp.javacpp.platform=linux-x86_64    
systemProp.gradle.javacpp.platform=linux-x86_64
systemProp.system.javacpp.platform=linux-x86_64
sysProp.javacpp.platform=linux-x86_64
gradlePropertiesProp.javacpp.platform=linux-x86_64

或在 build.gradle 中:(依赖项下)

System.setProperty("javacpp.platform","linux-x86_64")

在build.gradle我有:

compile "org.bytedeco:javacv-platform:1.4.2"

它应该如何工作?

Gradle 不支持 Maven 配置文件,我们需要它才能正常工作。我们需要创建一个插件,例如 sbt-javacpp 实现与 Gradle 相似的功能。