Buck: Building the IntelliJ Plugin

Building the IntelliJ Plugin

To build the Buck Intellij Plugin you will have to install Buck, by following the guide from Downloading and Installing Buck, the manual build process to get the repo.

Building with Buck

cd third-party/java/intellij/
sh get_jars.sh "PathToYourIntellijLib" #for unix systems
get_jars.bat "PathToYourIntellijLib"   #for windows systems
buck build ideabuck
Once you have built the plugin, you can install it by following the Installing a Plugin from Disk guide. In order to access it you have to go to View > Tool Windows > Buck.

Building with Intellij

The ideabuck plugin can also be built with intellij. A big advantage of this, when working on the plugin, is the fact that you can easily debug it by creating a new Run/Debug Configuration.

  1. Generate the grammar and the lexer with the Grammar-Kit plugin.
    • You can install the grammar kit plugin from third-party/java/grammar-kit/grammar-kit.jar by following the Installing Plugin from Disk guide. After you installed Grammar-Kit you can generate the files by navigating in Intellij to
      tools/ideabuck/src/com/facebook/buck/intellij/ideabuck/lang/Buck.bnf
      tools/ideabuck/src/com/facebook/buck/intellij/ideabuck/lang/Buck.flex
                
      and pressing ctrl-shift-G / meta-shift-G.
    • If you don't want to install the Grammar-Kit plugin you can run
      python tools/ideabuck/scripts/intellij/generate_grammar_kit.py
                

      The above mentioned commands will create a gen directory in tools/ideabuck.

  2. Configure the Intellij Platform Plugin SDK and set it as the plugin's module sdk.
  3. Remove the Buck Intellij Plugin, tools/ideabuck from the Compiler Excludes list.
  4. Create a new Plugin Run/Debug configuration for the Buck Intellij Plugin.
  5. Run/Debug the plugin or create a new release of it by going to Build > Prepare all plugin modules for deployment.