How to compile clover(code coverage tool from atlassian) - java

clover is now open source source available here how to compile it locally and use it with eclipse
https://bitbucket.org/atlassian/clover
there are multiple projects like clover-core, clover-eclipse please tell me which project will i needed to compile locally and use clover in eclipse
screenshot of list of projects downloaded
can anyone please help in compiling and provide me clover jar

If you want to use Clover as an Eclipse plugin you'll need to compile clover-eclipse module. It uses internally clover-core so it should be compiled prior it, however ANT should handle this dependency well. Atlassian published official development tutorial describing how to compile Clover, you might want to take a look at it.

Related

How to integrate Gradle, IntelliJ, and SpotBugs?

I have a Gradle project with subprojects and a somewhat complicated build.gradle file. I imagine that running SpotBugs from Gradle will make it easier because then SpotBugs can pick up all the classpath configuration and whatnot from Gradle. It was very easy to add SpotBugs to Gradle, and now I can run the corresponding SpotBugs task from Gradle and it produces reports in XML files.
The missing piece is that I would like to view the resulting errors/warnings/problems in IntelliJ. There is a SpotBugs plugin for IntelliJ, but it doesn't seem to know anything about Gradle. When I ask the SpotBugs plugin to analyze a module, it says the module is not compiled and doesn't report any issues. (But there are classfiles under the build directory (created by Gradle I think) as well as under the out directory (created by IntelliJ).)
How to run SpotBugs with the configuration specified by Gradle, while viewing the results in a nice IntelliJ window?
Some background:
Different team members use different IDEs, and we would like to make sure that everyone fixes certain warnings to keep the code quality high. I've looked into configuring the IntelliJ "analysis" settings to match the Eclipse compiler warnings, but it's going to be a slog. (We also have different subprojects with different warning settings.). So I thought it would be helpful to have an external tool that everyone can run from Gradle, and if that tool says green, then it's green. Each developer can then configure their IDE settings to their liking, but it will be easy for them to run their code through this external tool (here: SpotBugs) to confirm that all is well.

Including dependencies in Java project on Intellij/Maven?

This sounds dumb but is there anyway for me to specify dependencies for my Java project like how I would in a package.json file so that someone else who was to download the project code from my GitHub repo, would be able to run it without any errors or missing libraries?
I have never tried using external Java libraries before, such as apache commons. The most I ever used was JavaFX but on a personal project level. My main concern is that if I were to push my code up to the repo and have someone else clone it. It might not run properly as the imported libraries are not downloaded.
Is there something similar to package.json dependencies where the person who runs the code would automatically download all dependency libraries and have it run on their system?
You can use Maven or Gradle for this purpose. Maven has pom.xml where you can specify all your dependencies. Similarly gradle has build.gradle which does the same job.

How to debug third-party Intellij IDEA plugin?

So, I am using a plugin from the Intellij IDEA Marketplace and I'd like to modify it to my needs. The plugin is Open Source(Apache License) but I couldn't find its source code on the internet. I know that plugins are located under Users directory in Windows, so I could decompile the jar and see the source code. But the problem is that this plugin contains some dll files as well.
Is there an easy way to debug the plugin and set breakpoints etc. to see where I will need to modify the code(the other option would be to include the decompiled java source files in a new plugin build but I don't know what to do with the existing dll files).
Thank you.
Intellij Idea plugin development requires a project structure and it requires gradle-intellij-plugin. If you are able to compile the source code, you have to create gradle project with gradle-intellij-plugin. First of all follow the links to create a small plugin to understand how to create a plugin.
https://www.jetbrains.org/intellij/sdk/docs/tutorials/build_system.html
As a sample project, you can refer below the github project.
https://github.com/debjava/ddlab-gitpusher-idea

IntelliJ plugin: maven, gradle and travis-ci

Currently, my built structure for a plugin in is a bit messy: I'm using the normal IDEA project file to build the plugin locally. When I push it to the repo and travis-ci is building it, it uses the maven pom.xml because for travis to work, it always has to download the complete IDEA sources.
Although this works, this has several drawbacks:
I need to keep two built mechanisms up to date. This is
When a new IDEA version is out (every few weeks), I need to change the SDK in maven and in my IDEA settings
When I add a new library, change resources, etc. I need to do this for two the two settings as well
I ran into problems when I kept the IDEA Maven plugin turned on because it saw the pom.xml and interfered with my local built. Turning it off means, I cannot download libraries with Maven which has the feature of tracking dependencies.
I saw that Gradle has an 'idea' plugin and after googling, I got the impression that Gradle is the preferred choice these days. I have seen Best way to add Gradle support to IntelliJ IDEA and I'm sure I can use the answers there to turn my pom.xml into a valid build.gradle.
However, maybe someone else has already done this or can provide a better approach. What I'm looking for is a unified way to build my plugin locally and on Travis-CI.
Some Details
For compiling an IDEA plugin, you need its SDK which you can access through an installation of IDEA or a download of the complete package. Locally, I'm using my installation for the SDK. With Travis, my maven built has the rule to download the tar.gz and extract it.
It turns out that in particular for building an IntelliJ plugin, Gradle seems to have many advantages. This is mainly due to the great IntelliJ plugin for Gradle which makes compiling plugins so much easier. With Gradle, I could turn my >220 lines of Maven build into a few lines of easily readable Gradle code. The main advantages are that
It takes care of downloading and using the correct IDEA SDK while you only have to specify the IDEA version.
It can publish your plugin to your Jetbrains repository and make it instantly available to all users
It fixes items in your plugin.xml, e.g. you can use one central version number in gradle.build and it will keep plugin.xml up-to-date or it can include change-notes
It seamlessly integrates with Travis-CI
How to use Gradle with an existing IDEA plugin
Do it manually. It's much easier.
Create an empty build.gradle file
Look at an example and read through the README (there are many build.gradle of projects at the end) to see what each intellij property does.
Adapt it to your plugin by
Setting the intellij.version you want to build against
Setting your intellij.pluginName
Define where your sources and resources are
Define your plugin version
Define a Gradle wrapper that enables people (and Travis) to build your plugin without having Gradle
Create the gradle wrapper scripts with gradle wrapper
Test and fix your build process locally with ./gradlew assemble
If everything works well, you can push build.gradle, gradlew, gradlew.bat and the gradle-folder to your repo.
Building with Travis-CI
For Travis you want to use the gradlew script for building. To do so, you need to make it executable in the travis run. An example can be found here.

How to compile only changed file using gradle build in java projects

I am using gradle to build a java project.
I see that whenever there is a change in one java file entire projects gets rebuilt. Is there a way to compile only affected java files instead of all the files.
Gradle now supports compile avoidance, and has support for incremental compilation since earlier. You do not have to do anything to enjoy these features. Just update Gradle. See https://blog.gradle.org/incremental-compiler-avoidance

Categories

Resources