четверг, 2 июля 2015 г.

Pants initial wizard

I was working on initial wizard for IntelliJ IDEA. I was looking at such IDEA's plugins as Gradle, Android, Scala and Aspose.
Firstly I adapted the Gradle plugin's wizard code for Pants plugin. But unfortunately IDEA didn't see my wizard despite the fact that I modified the plugin.xml file appropriately.
Thanks to my mentor who helped me by showing how the minimal initial wizard should look like.
I took it this implementation as a basis.

Then I was designing the wizard steps. As Pants plugin wizard should have a possibility to create projects both in Java and Scala, the first wizard's step should contain the choice of language. To implement this I looked at the source code of Android and Scala plugins' wizards for IntelliJ IDEA. To add a possibility to choose Scala SDK I had to make two separate Module builders for Java and Scala appropriately. I think there is a better way to do it, but I haven't yet found out. Here it is what we have for now. 

Also I worked on implementation of generating a new project's BUILD file. I studied how it is done in Gradle plugin : via templates (.ft). As I understood, information about all templates from all plugins are stored in the hash table, where IDEA then could find a requested template by calling findTemplateByName() of FTManager class. I unsuccessfully tried to insert a new template for Pants in this hash table. May be I'm moving in the wrong direction and it should be done in another way: I'm working on this issue.

четверг, 11 июня 2015 г.

Outreachy: always studying

The project has just started but I have already learned some new things. For example, I have never worked with such a useful service as Travis-ci before. It is easy to use and provides cool integration with GitHub.

At the beginning I spent some time solving problems with setting up the working environment. Due to my mentors' advices and our joint efforts everything was finally set up for work :)

At the same time I was working on another issue concerning the Pants plugin. Due to this, I studied the plagin's source code attentively and obtained the better understanding of its internals.

Also, I have found a lot of interesting information while reading articles about IntelliJ internal architecture and API. Unfortunately, there is no any documentation (or at least I haven't found it) about how to write wizards for IntelliJ IDEA. So to understand how an IntelliJ IDEA plugin's wizard (like Gradle's one) works inside, I downloaded the source code of IntelliJ IDEA Community edition, put breakpoints in the Gradle plugin's part and analyzed what functions are responsible for what actions. The same way I used to study the sources of Aspose plugin's wizard.
It was quite curious to compare their APIs as there are some differences.

The next step was to write something similar (to what I saw in Gradle/Aspose plugins' wizards) for Pants plugin. And I'm working on it right now.

See you soon.

Hello everyone! 

I'm one of the participants of Outreachy program, Round 10. So the next few months I will describe my work on the project "Pants plugin wizard". I have never written blog posts before, so I'm not good at it yet, but I'll do my best to make it interesting :)

As it can be concluded from the project's name, my aim is to design and develop a wizard for Pants plugin for IntelliJ IDEA

"What is it - Pants?"- you'll probably ask. In a nutshell, Pants is a build system for software. It works particularly well for a source code workspace containing many distinct but interdependent pieces. It is similar to make, Maven, Ant, Gradle, sbt, etc.; but it pursues different design goals.
Pants optimizes for:
  • building multiple, dependent things from source
  • building code in a variety of languages
  • speed of build execution
A Pants build "sees" only the target it's building and the transitive dependencies of that target. This approach works well for a big repository containing several things.

So here we go :)