I have a Java project which has 3rd party source code built via an ANT script. My goal is to avoid messing with any of that. My project is dependent on the jar files generated from the 3rd party project.
I’m looking to port my project into gradle which is currently also built via ant script, but I can’t seem to get the dependency and build order correct. The following works if I build 3rdParty via ./gradlew 3rdParty:build first, then build everything. I cant seem to force the ANT scrip to run, then check dependencies for available jars. Any suggestions welcome.
Directory Structure:
/3rdParty
- build.xml
/src
/main
/java
/src
-Hello.java
build.gradle:
apply plugin 'java'
project(":3rdParty") {
ant.importBuild 'build.xml'
}
dependencies {
compile fileTree(dir: '3rdParty/', include: ['*.jar'])
}
jar {
baseName = 'Gradle'
version = '1'
}
apply plugin: 'application'
mainClassName = 'src.Hello'
run {
if (project.hasProperty("appArgs") ){
args Eval.me(appArgs)
}
}