1

According to the JavaCPP documentation, if we set the system property: javacpp.platform=linux-x86_64 it should not download the other platforms:

This is from 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.

The way to set system properties in 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.

However it downloads all platforms. I have tried different ways to set that property without any difference:

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

or in build.gradle: (under dependencies)

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

In build.gradle I have:

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

How it is supposed to work?

lepe
  • 24,677
  • 9
  • 99
  • 108
  • To be honest, I never heard that some third-party system properties interfere in any way with Gradle resolving dependencies. Checking out this [issue](https://github.com/bytedeco/javacpp-presets/issues/216) and the [linked example](https://github.com/bytedeco/javacv/wiki/Configuring-Proguard-for-JavaCV#gradle-settings), I'm pretty sure the system property only works for Maven. – Lukas Körfer Aug 21 '18 at 00:45

1 Answers1

0

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.

Samuel Audet
  • 4,964
  • 1
  • 26
  • 33