gradle.properies中的Gradle系统属性是否未使用? (javacpp,intellij)
根据JavaCPP文档,如果我们设置系统属性:javacpp.platform=linux-x86_64
,则不应下载其他平台:
According to the JavaCPP documentation, if we set the system property: javacpp.platform=linux-x86_64
it should not download the other platforms:
这来自 javacpp :
...这将下载所有平台的二进制文件,但要获取以下文件的二进制文件: 只有一个平台,我们可以设置javacpp.platform系统属性(通过 -D命令行选项),例如android-arm, linux-x86_64,macosx-x86_64,windows-x86_64等.
... 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 中设置系统属性的方法:
The way to set system properties in Gradle:
使用-D命令行选项,可以将系统属性传递给 运行Gradle的JVM. gradle命令的-D选项具有 与Java命令的-D选项具有相同的效果.
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.
您还可以使用以下命令在gradle.properties文件中设置系统属性: 前缀systemProp.
You can also set system properties in gradle.properties files with the prefix systemProp.
但是,它会下载所有平台.我尝试了各种方法来设置该属性而没有任何区别:
However it downloads all platforms. I have tried different ways to set that property without any difference:
在gradle.properties中:
in 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中:(在依赖项下)
or in build.gradle: (under dependencies)
System.setProperty("javacpp.platform","linux-x86_64")
在build.gradle中,我有:
In build.gradle I have:
compile "org.bytedeco:javacv-platform:1.4.2"
它应该如何工作?
Gradle不支持Maven配置文件,我们需要使用它来使其正常工作.我们需要创建一个插件,例如 sbt-javacpp 来实现与Gradle类似的功能.
Gradle doesn't support Maven profiles, which we need to get this working. We would need to create a plugin such as sbt-javacpp to implement similar functionality with Gradle.