I am trying to compile and build a Java project for the very first time in Gradle and I am not able to achieve a few things.
Initially, I wrote an Ant xml to do the Jar creation for my project but I would now shift to Gradle. And I would like to know how to provide the following Ant functionalities in Gradle:
// build.xml from Ant
<project >
<property environment="env"/>
<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
<target name="make">
<javac>
// defines srcs and other related arguments
<classpath>
<fileset dir="/data/products/libs/">
<include name="**/*.jar"/>
</fileset>
</classpath>
<compilerarg compiler="org.eclipse.jdt.core.JDTCompilerAdapter" line="-1.8"/>
</javac>
</target>
Next is the build.gradle file
//build.gradle
apply plugin: 'java'
sourceSets {
define the sources
}
dependencies {
compile files ('/data/products/libs/**/*.jar')
}
sourceCompatibility = 1.8
targetCompatibility = 1.8
jar {
baseName = 'nsvf'
}
I am not sure how I can set the compiler args in Gradle like how I did in Ant. Thanks in advance for the help!