Hi. I have another project (currently in Maven) which makes use of the SWT libraries.
The particular thing about the SWT libraries of course is that they are platform specific. So In short, how can I tell Gradle to use a certain version of the SWT jars when I’m working on the code base in, say, Windows or Linux?
One way to do this in Maven is:
<profiles>
<profile>
<id>windows_amd64</id>
<activation>
<os>
<family>Windows</family>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>swt-win32-win32-x86_64</artifactId>
<version>4.2.1</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>linux_x86_gtk2</id>
<activation>
<os>
<family>linux</family>
<arch>x86</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>swt-gtk-linux-x86</artifactId>
<version>4.2.1</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>linux_amd64_gtk2</id>
<activation>
<os>
<family>linux</family>
<arch>amd64</arch>
</os>
</activation>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>swt-gtk-linux-x86_64</artifactId>
<version>4.2.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
With this approach, the Maven project and Eclipse know what version of the SWT Jar they should use depending on the information reported by the Operating System.
Can I say the same in Gradle?
Thanks again for your time and help!