Use RAM with gradle and IntelliJ Idea - intellij-idea

Currently, I'm using gradle as our production java builder and it's slow.
I was thinking is there a way to set-up some kind of RAMdrive working directory, so compiling, building, testing, and running would be much faster and the source code would remain on HDD.
Ideally, if I could tune it in my IDE somehow (maybe IDE internal gradle options).
I have initialized a RAMdrive but stuck in gradle :) Any ideas?

Related

Intellij - work-around for IDE not building module on Run/Debug

I have a pretty large project, of which the Selenium/Cucumber part is integrated, and belongs to me.
No, after upgrading to Intelij 2022, I find that things have changed to the worse. Since I only bother about the module containin cucumber/selenium tests, I have been used to just clicking Run or Debug on each Run/Debug configuration to get my changes built, and the Cucumber/Selenium tests run locally on my computer.
This doesn't work anymore, and absolutely 100% of all help/support I have found on the net is unhelpful. The problem is that when I make a change in the code and click Run or Debug, the module (cucumber, where all the Cucumber/selenium tests resides) is not built. So, it keeps running the previously built code when I'm working on debugging/fixing tests.
The solution has been to first build the module containing the tests, then run/debug the test(s). Even though the run/debug configuration DOES have "Build" before launch. But this is tiresome, and a total waste of time.
So, what I'm wondering is: Can I tailer a terminal command to do all this? That is, build a specified module, then Run or Debug a Cucumber test.
Any help/hints are appreciated. I'm experiencting the usual "me" problem, where it seems that everyone else in the world has something working, while the same solutions doesn't work for me.
EDIT:
I tried the solution offered below in the comments: Deleted the .idea folder, reimported all Maven modules and reconfigured the project. It seemed to work on the first run, but then it went back to not building before launch.
You can try to change Select Run/Debug configuration in idea. Change Build to Build Project. It worked for me.

Force IntelliJ to rerun anntoation processors?

Is there any way to rerun annotation processors without rebuilding the entire project?
I'm developing an annotation processor which is used in project that takes ~ 10 minutes to build from scratch and it's a bit painful to wait 10 mins to test a change...
General Aspect
This sounds like you don't have a proper testing approach for your annotation processor.
If you do testing always in an integrated environment, you will always have the problem of long running tests. This applys to any test environment that depens on heavy task.
So, my generall advice would be to write lightwight unit tests to check you code is working as expected. That's a general advice I can give you.
This article https://blog.jooq.org/2018/12/07/how-to-unit-test-your-annotation-processor-using-joor/ from Lukas Eder - the founder of JOOQ and that uses java annotation processors as well - is about unit testing java annotation processors.
Only Run Annotation Processors
Intellij Idea
AFAIK there is no way to do this.
Maven
If your project runs on maven, you can trigger annotation processors by just execution the generate-sources phase.
Annotation processor can not be run without the compiler.
If you are not using Maven or Gradle to build the project but is using the IDE's build, invoke the Build | Build Project action. This way IDE will perform an incremental build that will build only changed classes.

What is Gradle build system in Kotlin?

I was reading the Kotlin documentation and I came across the statement,
By default, your project will use the Gradle build system with Kotlin DSL.
What does it mean?
I've seen Gradle Kotlin option while making a new project in IntelliJ:
Can somebody explain me these, and which Bundle I should be using as a beginner?
A build system combines and simplifies some of the key tasks involved in building and distributing your program. The main things a build system does include:
Downloading any dependencies your application has
Running tests against your application
Compiling your code
Packaging up your application and its dependencies into a form you can share with others
You could run all of these tasks separately yourself, but build systems make it a lot easier and less prone to mistakes. In practice, all but the smallest projects use some kind of build system. Gradle is one such tool, but you can also use Maven, or the tools built into an IDE like IntelliJ.
Which one should I use?
If this is a personal project, the build system and tools built into an IDE like IntelliJ are more than good enough.
If you're working with other people, you might want to consider a standalone build system instead. That's because standalone build systems like Gradle can be used with multiple IDEs, and can also be used on the command line without an IDE at all. Large projects with many contributors will often run a build server that runs the build system in an automated way against all new changes, to make sure the code builds and runs as expected.
IDEs like IntelliJ have very good integration with the common build systems, including Maven and Gradle, so you won't disadvantage yourself by choosing them over the built-in IDE tools.
Maven, Gradle, or Gradle with Kotlin?
There are plenty of other resources you can find comparing Maven with Gradle. The crucial difference, though, is the way you write the build script that allows you to customise the dependencies, tests, and other parameters of your build.
In Maven, your build script is an XML file. It follows a rigid structure, providing inputs and configuration to existing tasks and plugins.
In Gradle, the build script was historically written in Groovy, a loosely-typed language that gives you a lot of flexibility. As well as configuring tasks and plugins, you can easily add your own tasks and functions.
You can also choose to write Gradle build scripts in Kotlin. This offers the same flexibility and customisation as Groovy, but the addition of a type system means the IDE can give you much more help with writing the script correctly.

Write an IDE on top of IntelliJ Platform

I want to write a custom IDE on top of IntelliJ Platform. Android Studio is an example. It was built based on IntelliJ Platform and was designed to support Android application development.
There are lots of git GUI out there. However, in Linux, I don't satisfy with any. That is my motivation to write a git IDE for Linux. IntelliJ IDEA already have a very good Git plugin. Using IntelliJ IDEA is a solution. But it is too heavy for opening entire project with different functionalities (Run, Debug, Refactor...) for just Git operations. Therefore, I want to make that plugin a complete IDE for only Git operation.
On IntelliJ Platform forum page, there are tutorials to write plugins. However, it doesn't have the guide for writing a complete IDE.
Are there any tutorials to help me get started?
IntelliJ platform is probably not the best choice for writing a general purpose RCP applications.
https://intellij-support.jetbrains.com/hc/en-us/community/posts/207769065-Developing-a-desktop-Business-Application-using-the-JetBrains-Platform
Git plugin has 65k lines of code, you are talking about gutting ~13M lines IDE (respectively 3M lines of pure Java source code).

Intellij complains about fork mode when running tests with code cover

I want to get information about how much the tests cover in our application. When I try to run all tests with coverage Intellij complains about the current fork mode. See image below.
The strange thing is that in the selected Run/Debug Configuration that I have the Fork mode is already set to none. Intellij still encourage me to change the Fork mode to none.
I am using Intellij 13.0.1, this is a feature that have been around for long, so I am missing something obvious, right?
Does anyone know what the problem might be?
IDEA-118572 unable to run JUnit tests with code coverage - fork mode is required