dependencies {
...
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
}
public void printFraction() {
System.out.println("Printing fraction " + Fraction.getFraction(5, 6));
}
printFraction()
I tried it step-by-step with your instructions and it worked after a little bit of tweaking! I should mention that I'm using Ubuntu 22.04 Linux as my distro and I had to add one step:
- In order to be able to compile/deploy my study I had to additionally copy the commons-lang3*.jar to the lib folder of my project (where also the mwave_sdk.jar resides)
- I also had to create the 'ext' directory inside 'MotiveWave Extensions' dir since there was only a 'dev' directory... not sure why
After that I was able to deploy and print the fraction.
Great work Shtick Hustler... you cracked the code 🥳 I will also try it with the nats libs... Thank you for your help 🙏
configurations {
externalLib.extendsFrom(implementation)
}
tasks.register('syncLibs', Sync) {
from configurations.externalLib {
into '~/libs'
// into '~/MotiveWave Extensions/ext'
exclude('mwave_sdk.jar')
}
}
thanks, this is really helpful!Here's a quick tutorial.
It uses your Ant targets as-is. I may post an update to write native gradle code to do the same tasks.
May also add section to enable Kotlin code (which is trivially simple).
Let me know how it works
I may post an update to write native gradle code to do the same tasks.
def srcDirName = "src/main/java/study_examples"
def destDir = "~/MotiveWave Extensions/dev"
def updateFiloToTouch = "${destDir}/.last_updated"
def propDir = "src/main/java/study_examples/nls"
def propDirName = "nls"
tasks.register('touchUpdateFile') {
delete updateFiloToTouch
outputs.files(updateFiloToTouch)
}
tasks.register('deployAsJar', Jar) {
dependsOn(build)
from(javaBuildDir) {
include "**/*" into srcDirName
}
from(propDir) {
include "**/*" into "${srcDirName}/${propDirName}"
}
archiveFileName = "examples.jar"
destinationDirectory = file(destDir)
}
// means 'deployAsJar' task calls 'touchUpdateFile' task as soon as it finishes building & deploying .jar file
deployAsJar.finalizedBy(touchUpdateFile)
Do you have it for Maven as well?
Thanks a lot!Sorry, never used Maven.
But, here's some info on converting to maven from gradle:
https://codexplo.wordpress.com/2014/07/20/gradle-to-maven-conversion-and-vice-versa/
for anyone following up here, Shtick Hustler's samples here use Groovy as the build language.. I am feeling my way forward here, but since I decided to ditch java for kotlin, I thought I would use kotlin as the DSL too.Here's a quick tutorial.
It uses your Ant targets as-is. I may post an update to write native gradle code to do the same tasks.
May also add section to enable Kotlin code (which is trivially simple).
Let me know how it works
I am feeling my way forward here, but since I decided to ditch java for kotlin, I thought I would use kotlin as the DSL too.