How to compile the code using clover open version 4.2.0 - clover

i was able to compile my source code and generate the instrument classes(including xxx-clover.war) using mvn clover2:instrument command using clover 4.0.6 maven plugin.
When I tried with clover open source 4.2.0, I wasn't able to execute any clover goals like instrument, clover, setup.
can you someone please tell me how do I compile my project using clover open source 4.2.0 version.

you should use clover:XXX goals (note there's no 2 in clover)
You may also need to update your ~/.m2/settings.xml file and replace the following
<pluginGroups>
<pluginGroup>com.atlassian.maven.plugins</pluginGroup>
</pluginGroups>
with:
<pluginGroups>
<pluginGroup>org.openclover</pluginGroup>
</pluginGroups>
There's complete migration tutorial available on OpenClover pages

Related

download specific version of serenity-cli jar in package.json protractor project

Is there a way I can download specific version of serenity-cli jar.
senario: I want to use the specific version of old jar of cli, where do I mention the version of the jar in the package.json .
TIA
To see the command line options of serenity-bdd update command run:
./node_modules/.bin/serenity-bdd --help update
To use a specific version of the jar, run:
serenity-bdd update --artifact net.serenity-bdd:serenity-cli:jar:all:2.1.12

IDE open project based on catkin_tools

I am now reading a ROS package built on catkin_tools. It is complicated so I need to import this project into an IDE (like Clion, QT Creator, etc). Although the official doc of catkin-tools says you can't rely on CMake's IDE integration (http://catkin-tools.readthedocs.io/en/latest/migration.html?highlight=IDE), I still have some hope on this. So does anyone has such experience?
PS: I also found the author of ros_qtc_plugin claimed he has added the function of catkin_tools, but I still could not find how to do this.
Note: The following solution works for catkin build, but not for catkin_make. If you are using catkin_make, please visit:
https://stackoverflow.com/a/35143865/2422098
https://www.jetbrains.com/help/clion/2020.2/ros-setup-tutorial.html#set-build-paths
CLion configuration for catkin_tools workspaces (catkin build)
Please excuse me for digging up an old question, but I just came across this problem and found a solution for CLion and catkin_tools (i.e., when building with catkin build).
I tested the proposed solution on 20.04 with ROS Noetic and CLion 2020.2.4.
According to the docs, catkin_tools uses an individual devel workspace path for each ROS package:
https://catkin-tools.readthedocs.io/en/latest/advanced/linked_develspace.html
The devel prefix path for a package:
-DCATKIN_DEVEL_PREFIX:PATH=/home/<user-name>/catkin_ws/devel/.private/<package-name>
The build directory for a package:
/home/<user-name>/catkin_ws/build/<package-name>
To open and edit a ROS package in CLion, please follow these steps:
run catkin build in the workspace
Source /opt/ros/$ROS_DISTRO/setup.bash and your workspace setup.bash in the devel folder
After that, start CLion from the command line, so that it inherits the environment variables
In CLion's Open Project wizard, navigate to the ROS package, and select the
CMakeLists.txt. When prompted, click Open as Project
Open the Settings Window (usually Ctrl+Alt+S)
Navigate to "Build, Execution, Deployment" > "CMake"
Under "CMake options", specify the devel prefix as mentioned above, and under "Build directory", specifiy the build directory as mentioned above:
Explanation:
When configured in the aforementioned way, the generated CMake files and build files that catkin build creates are reused by CLion.
By default, when not configuring it to reuse the build files, CLion would create its own cmake-build-debug/ generation directory. I experienced the following issues with this dedicated generation/build directory:
Problems when CLion is not configured as described in the above steps:
The nodes/libraries are built twice (CLion, catkin build), which increase development time.
Libraries are built twice, but the CLion build links with ~/catkin_ws/devel .so-files and not the cmake-build-debug/ .so-files. This is confusing when working on a ROS package with at least one library, since building the library in CLion is a dead-end and the .so-output is never used.
Since executables are built twice, rosrun has an ambiguity problem as it finds two executables for the specified node. An executable selection prompt appears each time rosrun is used.
I have had success using Eclipse to work with ROS in the past. See: http://wiki.ros.org/IDEs#Creating_the_Eclipse_project_files for setup details.
If you want something that works right out of the box, you can try a free IDE called RoboWare that is specifically built for and integrates with ROS very well.
http://www.roboware.me/#/home

How do I create an uber jar in Ceylon

I have a Ceylon project. I would like to distribute it in an uber jar that includes all dependencies, so that it can be executed with simple
java -jar myproject.jar
Is this possible in Ceylon?
The upcoming Ceylon 1.2.3 has the fat-jar subcommand. See https://github.com/ceylon/ceylon/issues/5932 which tracks this feature. To use it now, you need to download a nightly build from http://ceylon-lang.org/download/ or build Ceylon yourself.
With Ceylon 1.2.3, assuming your module is called myproject, you can do
ceylon-1.2.3/bin/ceylon fat-jar myproject
java -jar myproject-1.0.0.jar
This executes code in function run() in file source/myproject/run.ceylon.
The uberjar for a simple hello world program has currently 2.4 MiB.
The Ceylon Gradle Plugin can do it for you, just use the createJavaRuntime task:
gradle createJava
Run the application with:
bash build/java-runtime/run.sh
or the equivalent in your OS.
If you copy the java-runtime directory to a machine that has no Ceylon installed, only the JVM, it will work.
It's not a fat jar, but you can distribute this as a zip and get most of the same benefits.

Packaging a Jython program in an executable jar

I am trying to package a jython program into an executable jar which the user can simply double-click to run without installing jython ahead of time. Ultimately, I would like to include an additional library which I wrote with the jar, but at the moment I am just trying to package a simple program and have it run from the jar.
I have tried following the jar instructions in the "Using the Jar Method" section here: Jython FAQ: Using the Jar Method
I have also looked at slides 25-28 here: Jython Update 2012 slides
And finally here:
stackoverflow Question: Distributing My Python Scripts as Jars with Jython
I have installed jython 2.5.3, jvm 1.6, and python 2.7.3 on my mac which is running OS X 10.8.3.
These are the steps I go through to create the jar and run it:
Create a copy of jython.jar from my jython installation directory.
zip -r jython_copy.jar Lib (where Lib is the folder in the jython installation directory)
cp myJythonProgram.py __run__.py (myJythonProgram.py does not include an 'if name == main' line)
zip jython_copy.jar __run__.py
export CLASSPATH=/path/to/my/app/jython_copy.jar:$CLASSPATH
I have tried running the jar using all three of these methods:
java org.python.util.jython -jar myapp.jar
java -cp myapp.jar org.python.util.jython -jar myapp.jar
java -jar myapp.jar -jar myapp.jar
This works if my program doesn't use any import statements.
However I am running into an issue where some python packages are not able to be found when I run the jar. For instance, I get the error "ImportError: No module named random" when I include the line from random import random in my program. No errors occur on lines in the program when I import from javax.swing, java.awt, time, or math.
Additionally, I tried to package a jar with my library and a jython program which imports my library using the previous steps as well as the following additional steps:
zip jython_copy.jar myLibrary.jar
jar ufm jython_copy.jar othermanifest.mf
othermanifest.mf only contains the line Class-Path: ./myLibrary.jar.
This too gives the error "ImportError: No module named myLibrary"
I would appreciate any insight into what I am doing incorrectly or other steps I should take.
Thanks!
I realized what the problem was and I wanted to document it in case anyone else has the same problems.
I was using the jython.jar file that came in the standard installation of Jython, and NOT the standalone jython.jar (the instructions at Using the Jar Method mentions this, but the instructions at Building Jars do not). I am still unsure why copying the Lib/ folder of the standard installation into the jython.jar that came with that installation didn't work on my system. However, once I used the standalone jar, things started to work more smoothly.
Additionally, I was able to get my library to work with the packaged file by doing three things in addition to the steps I laid out in my question:
Exploding the standalone jython.jar and copying the folder with all of my library files into Lib, then create a new jar. This seemed to be the easiest way to include my library and allows me to package everything into a single jar.
I discovered after reading Frank Wierzbicki's answer in Why does Jython refuse to find my Java package? that because I am now using the standalone jar, I could no longer use imports of the style from java.awt import *, instead I needed to fully specify each thing I was importing, for example from java.awt.Font import PLAIN, BOLD, ITALIC. So I went through the library's imports and fixed the few that were of the wrong style.
Now that I am adding my Library directly to the Jar's Lib folder, instead of writing Class-Path: ./myLibrary.jar in othermanifest.mf, I put Main-Class: org.python.util.JarRunner as per Frank Wierzbicki's answer in the post I mentioned in my question: Distributing my Python scripts as JAR files with Jython?
This allowed me to create a double-clickable executable jar containing my library and jython file that I wanted to run.
There are two solutions. They both work, but one better than the other.
I believe you can rename your python script as __run__.py, place that file inside the .jar file, and pass the .jar file through a python interpreter. See https://wiki.python.org/jython/UserGuide#invoking-the-jython-interpreter for more.
Multiple methods to run Jython from the java code while running through JVM are described here, at the Jython documentation.
EDIT:
You can execute a command line code that runs the python file you want.
Link to an example of running command line code from java here.

How do you set up Gradle properly and create a new Gradle project for IntelliJ IDEA?

So, I downloaded Gradle but I don't know how to set it up correctly. After I unzipped the zip file, what do I do next? I want to use Gradle in IntelliJ IDEA. From a livestream I've seen I know that there's a settings.gradle and a build.gradle file in the project folder in IntelliJ.
Also, I've seen that they used the windows console.
First of all, how do I access gradle through the windows console and tell it to generate a new project for IntelliJ?
As you can see, I don't have any experience with Gradle. Unfortunately I can't really find out how to use it.
I want the IntelliJ project then to have LWJGL and Slick.
Additionally, I know what it says in the build.gradle file I've seen on the livestream (I only want to create my project with the same structure like theirs).
Can anybody give a detailed description of what to do to achieve all this?
Lets' say you unpacked gradle to d:\tools\gradle.
To add its bin directory it to the PATH in a console window, execute the following command:
set PATH=d:\tools\gradle\bin;%PATH%
The above prepends the bin path to the current value of the PATH environment variable. This will only change the path for this specific command window.
If you want to add it to the PATH globally, then go to your control panel and choose System, then Advanced parameters (it might be something a little bit different: I'm translating from my French version of Windows). Then in the Advanced system parameters tab, click the button Environment variables.... Find the Path environment variable in the list, and add the directory, separated from the others using a semicolon (;).
Note: you can also define a new environment variable called GRADLE_HOME:
set GRADLE_HOME=d:\tools\gradle
or globally, as explained above, and reference it inside the PATH variable:
set PATH=%GRADLE_HOME%\bin;%PATH%
Just intall homebrew.
Then you can just open the terminal and install easy like:
brew install gradle
Done! It's installed!
For test just type in your terminal:
gradle -v
And you'll have something like this:
------------------------------------------------------------
Gradle 2.7
------------------------------------------------------------
Build time: 2015-09-14 07:26:16 UTC
Build number: none
Revision: xxxxxxxxxxxxxxxxxxxxxxxxxx
Groovy: 2.3.10
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_60 (Oracle Corporation 25.60-b23)
OS: Mac OS X 10.11.1 x86_64
Then, open your IntelliJ and create a new gradle project as normal, just setting the gradle's path when necessary (normally in /usr/local/Cellar when installed with homebrew or /opt when installed other ways).
Good luck!
For linux Users,
User SDK Man to easily manage your gradle installation and path settings for development as well as gradle update
GET SDK MAN HERE
(for mac os users) Let's assume, you unpacked zip file into /Users/onuryilmaz/gradle-3.3 folder. Then open terminal and define a new environment variable called GRADLE_HOME:
export GRADLE_HOME=/Users/onuryilmaz/gradle-3.3
After that reference it inside the PATH variable:
export PATH=$PATH:$GRADLE_HOME/bin
just update the brew and install and set path that's all
brew update && brew install gradle
export PATH=$PATH:/opt/gradle/gradle-5.1.1/bin
https://gradle.org/install/