Shiraji's Blog

Difference Between Generating Java and Generating Kotlin for Developing IntelliJ Plugin

Motivation

I am a maintainer of PermissionsDispatcher Plugin which generates Java and Kotlin for PermissionsDispatcher Since Kotlin is getting famous for Android developers, I thought IntelliJ plugins, which generate Android code, should support both Java and Kotlin. (By the way, Kotlin 1.0.2 now supports Android lint! This definitely will lead more developers use Kotlin!)

However, while I was developing this plugin, I found really hard to generate both Java and Kotlin code.

So, this blog post describes what are the differences between generating Java and generating Kotlin using IntelliJ plugin.

Tips for Creating Intellij Plugin

Summery

There are tips for creating intellij plugins

  • Logging
  • plugin.xml
  • Action

This is note for myself. I won’t add description if the sample is clear enough for me.

ForwardingAstVisitor's Life Cycle (Android Lint)

Summary

  • ForwardingAstVisitor has life cycle
  • visitXxx -> afterXxx -> endXxx
  • Begin visitCompilationUnit, End afterVisitCompilationUnit
  • Go from top to bottom. No surprise, except annotation.
  • Does not talk about visitIf or any of visitXxx where Xxx is keyword

Custom Lint for Library

Summary

  • PermissionsDispatcher now have a custom lint
  • Adding custom lint is not that hard
  • LintDetectorTest…? Forget it

プルリク駆動勉強

まとめ

勉強出来そうなプロジェクトを選らんで、pull requestを投げて、レビューしてもらうと勉強になるよ。

リファクタリングについて伝えたいこと。

この文章は以下のURLのコピーです。

http://shiraji.hatenablog.com/entry/2015/09/06/225204


この文章は以下に該当する方へ、なぜエンジニアにリファクタリング(リファクタ)させるべきなのかを記載しています。

  • リファクタリングする=サービスの開発が停止すると考えている方
  • リファクタリングに関して価値を見出せない方
  • エンジニアにリファクタリングさせて欲しいと言われる方