Junit5 with ant - ant

I am new in ant and junit5. I went through several examples ant/junit4. But I did not find a normal example with a pair of ant with junit5. With a pair of ant with junit4 everything works fine. I downloaded the files from the official site of the junit5 https://junit.org/junit5/docs/current/user-guide/ (For Ant, check out the junit5-jupiter-starter-ant project.), but even they give an error at the very beginning(screen attached) I will try to fix them one by one, but I don't think that official repo committed with errors. Maybe I'm doing something wrong. Or maybe gurus suggest some other simple sample with ant/junit5.
Thank you in advance.
I try to run the original sources from https://github.com/junit-team/junit5-samples and expected to at least compile them. But I get plenty of errors.

So this post has 2 questions:
errors on the screenshot
ant+juni5 integration in general
To reproduce the exact issues one should have the same environment, which is at least the OS, Java version & Ant version. The example itself seems to be using the Junit5 ConsoleLauncher, which is one of the way to run the tests. Looking at the errors it looks like the issue is in the project itself, because if it cannot find the 'symbol' #Test then the Junit(5?) is simply not present on the classpath. Maybe this can be a hint to the author to trty to dig a bit more into the issue, particularly looking into the dependencies (jars) included.
Now going back to how to run Junit5 test with Ant, I can recall the "JUnitLauncher" that apache suggests: https://ant.apache.org/manual/Tasks/junitlauncher.html . Note that you should be attentive on the dependencies here as well, there are number of Jars to be included (opentest4j, junit-platform-xyz). Note that this also depends on the installation of Ant in the environment, so for example if you get a NoClassDefFound for JUnitLauncher, this can be solved by using the 'up-to-date' version of Ant: https://ant.apache.org/bindownload.cgi . In case of Linux you can place these Jars in home/your_username/.ant/lib directory, where it will be automatically picked up.

Related

java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path

I started using the 1.0.0-beta2 version of deeplearning4j and I am getting the following error when attempting to start:
java.lang.UnsatisfiedLinkError: no jnind4jcpu in java.library.path
In looking around, I came across this issue: https://github.com/deeplearning4j/nd4j/issues/1687
where the solution seemed to be an incomplete set of packages. I have confirmed that I have nd4j-native-platform-1.0.0-beta2.jar, but this jar file contains no libraries as what seemed to be the problem in the issue mentioned above.
I have looked at the maven repository and things are strange there as well:
For https://mvnrepository.com/artifact/org.nd4j/nd4j-native-platform, the list of files under "View All" seems incomplete for the 1.0.0-beta2 version and the existing jar files under older versons also don't seem to contain any binaries so I am unsure as to where the binaries are supposed to be.
Thanks,
Jason
Do you have a specific OS you are trying? It should work out of the box if you just use platform. Platform includes numerous dependencies. I'm not sure what "incomplete" might be, but if you browse the real maven central (not this website, please do not use it):
https://repo1.maven.org/maven2/org/nd4j/nd4j-native/1.0.0-beta2/
You'll see jars for everything here. We have pretty good coverage publishing for every OS all the way to android and IOS.

Ant, can't compile The JBoss Transactions JTA 4.2.3.SP7 from jboss.org

I have downloaded The JBoss Transactions JTA 4.2.3.SP7 from jboss.org http://www.jboss.org/jbosstm/downloads/4-2-3-SP7 , it's a first link. It is written using ant, when I try to run this I have multiple error about lacking files, etc. I have suplemmented all of them, but I get another errors about lacking variables in files, etc. Maybe it wasn't the best way to repair it so I've left it.
So, after downloading this package what should I do to run this? Thanks in advance.
So.. the solution is to compile it with ant 1.7.x. Greets.

how to build eclipse rcp application from .product with ant on jenkins

I'd like to build an Eclipse RCP application.
I have a Product configuration file and a target platform with lots of third party plugins. The export from the Eclipse IDE works flawlessly. But that is hardly professional. So I'd like to get it to work on Jenkins, too. The build server gets the files from SVN, doesn't have Eclipse and should do it all headlessly anyway.
I do not want to use Maven/Tycho or Buckminster. I'd like to do it a simple as possible. Since I know a bit about ant already, I would like to do it all with ant. I have an ant script with which I can build all my plugins. All I need right now, is to assemble them all into the product with a launcher (.exe) and such. Like the export wizard does. But without the Eclipse IDE.
I've been googling my fingers off, but somehow it appears as if I'm the only one who wants do build an Eclipse RCP product with ant. I only find tutorials that are from 2005 or that go so much in depth, a newbie (like me) doesn't get past the first paragraph.
Please help!
If you really want ant, check PDE build.
However, I really recommend using Tycho instead. It makes building an Eclipse RCP a lot easier.
I've been down this road you are on. Trust me... you will end up with something incredibly more complicated with Ant than you would if you just use Tycho/Maven. You said you want it simple as possible, and IMHO, Tycho is it.
There are examples here... http://wiki.eclipse.org/Tycho/Packaging_Types
I also suggest to check out tycho from git and look around the tycho-demo location. They have great examples there too.
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/tree/tycho-demo/itp04-rcp
Plus, Jenkins is super easy when dealing with Maven builds.
The current version of Tycho is 0.13.0. It's pretty early in it's life, and under active development, so it's getting better every day.

Create Debian package using Apache Ant

Is there anywhere that can give you a tutorial or anything on creating a Debian package using Ant?
I'm being told its already a part of Ant but I've never seen any functions even remotely associated with it.
I don't want to use ant-deb-task either seeing as its not actually part of Ant.
There is no task for this in the core Ant distribution.
There are examples for ant-deb-task available in the examples file on the download page.
Another option is jdeb which also provides documentation.

How can I build PDF LaTeX documents with ANT (or some other build system if you prefer)?

The team I work for manages a large collection of technical documentation which is written in LaTeX.
Currently all the documentation we have is manually built by the editors and then checked into a version control system. Sometimes people forget to compile their documents so we have a situation where the PDF and .tex files are often out of step. Unfortunately when this happens our users find themselves reading old versions of our document.
I've managed to hack a simple script to build PDFs using Make - it's rather clumsy.
I was wondering if there was a better way to do it? Most people in our department use Eclipse + Pydev for a Python project which means we are all very familiar with this IDE. I know that Ant plays nicely with Eclipse, so might we be able to use this tool for our doc building?
So what's the best way of doing this? I hope I will not have to learn everything there is to know about a new build-system in order to automate the building of some quite simple docs.
There is an external Ant task for LaTeX PDF generation, though the site is in German.
To use it, download the jar to a location on your machine, then define a taskdef as follows:
<taskdef name="latex" classname="de.dokutransdata.antlatex.LaTeX"
classpath="/path/to/ant/lib/ant_latex.jar"/>
Then to use it, define a target like this:
<target name="doLaTeX">
<latex
latexfile="${ltx2.file}"
verbose="on"
clean="on"
pdftex="off"
workingDir="${basedir}"
/>
</target>
Where ltx2.file is the file to process.
This is a link to the howto page listing the parameters. If you need any more options, my German is just about passable enough to explain, maybe.
There is also a maven plugin for LaTeX, but I can't find any documentation.
Haven't tried it, but I remember seeing a blog post about it.
If you know python, this blog post might be interesting
EDIT: Also, I would assume that you're using some kind of version control system, and I can't say for sure, but I use git to manage all my latex docs, and it might be possible to use some kind of post-commit hook to execute a script to rebuild the document. This would depend on how your repository is structured... just thinking out loud, so to speak.
I went into great detail on a large number of build systems for latex in this question, but its slightly different in your case. I think you want rubber or latexmk. The latex-makefile seems a good idea, but only supports building via postscript, which might not be your build process.
In general, its a good idea to keep generated files outside of version control for just this reason. A good exception is when specialist build tools are not widely available, and your situation sounds similar. You might do better with a commit-hook to build automatically upon commit.
I guess I should also point out that committing something without first building it and checking it is a deadly sin, so a better solution might be to stamp that out.
Maven is a better alternative as build system compared to Ant. So I would recommend a maven-plugin to generate PDF from LaTeX sources. Have a look at mathan-latex-maven-plugin

Resources