How to Build Developer Tools on Top of IntelliJ Platform
-
date post
19-Oct-2014 -
Category
Technology
-
view
3.390 -
download
1
description
Transcript of How to Build Developer Tools on Top of IntelliJ Platform
![Page 1: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/1.jpg)
How to Build Developer Tools on Top
of IntelliJ Platform
Dmitry Jemerov, CTO, JetBrains
Tuesday, July 30, 13
![Page 2: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/2.jpg)
What is IntelliJ Platform
• Foundation of all IntelliJ-based IDEs
• Provides building blocks for developer tools
• Open-source, Apache 2 license
Tuesday, July 30, 13
![Page 3: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/3.jpg)
JetBrains Productson IntelliJ Platform
Tuesday, July 30, 13
![Page 4: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/4.jpg)
IntelliJ IDEA
• Where it all began
• Started as monolithic IDE
• Refactored over the years to modularize and introduce extension points
• For more history: Malmö, September 7,http://www.jetbrains.com/jetbrainsday/
Tuesday, July 30, 13
![Page 5: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/5.jpg)
"Small" IDEs
• PyCharm, RubyMine, WebStorm, PhpStorm, AppCode, C++ IDE, <to be announced>
• Set of bundled plugins + UI customizations
• Same source tree as IntelliJ IDEA
Tuesday, July 30, 13
![Page 6: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/6.jpg)
MPS
• Meta Programming System - IDE for domain specific languages
• Uses IntelliJ IDEA's overall UI framework
• Replaces text editing and PSI-based features with its own DSL framework
Tuesday, July 30, 13
![Page 7: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/7.jpg)
Kotlin Compiler
• Same code for command-line compiler and IDE features in plugin
• Uses low-level parsing/PSI framework and Java PSI
• 7.6M distribution
Tuesday, July 30, 13
![Page 8: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/8.jpg)
UpSource
• http://upsource.jetbrains.com/
• Online code browser
• Uses core PSI, indexing, Java language support (other languages coming soon)
• Web-based UI
Tuesday, July 30, 13
![Page 9: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/9.jpg)
External Productson IntelliJ Platform
Tuesday, July 30, 13
![Page 10: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/10.jpg)
Android Studio
• http://developer.android.com/sdk/installing/studio.html
• Repackaged IntelliJ IDEA Community Edition
• Custom UI for Gradle-based project model
• Developed in partnership with JetBrains
Tuesday, July 30, 13
![Page 11: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/11.jpg)
GuideWire
• http://www.guidewire.com/
• Insurance business
• Gosu programming language
• Lots of domain-specific UI
• Commercial
Tuesday, July 30, 13
![Page 12: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/12.jpg)
mbeddr
• http://mbeddr.wordpress.com/
• MPS-based tool for embedded development (generates C code)
• Open-source
Tuesday, July 30, 13
![Page 13: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/13.jpg)
esn.me
• http://www.planetframework.com/
• Commercial Python framework for real-time Web
• IDE based on PyCharm with custom plugin
• Acquired by EA, no longer supported
Tuesday, July 30, 13
![Page 14: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/14.jpg)
Realaxy
• ActionScript IDE based on MPS
• Commercial
• No longer in development, last released in 2010
Tuesday, July 30, 13
![Page 15: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/15.jpg)
IntelliJ Platform Components
Tuesday, July 30, 13
![Page 16: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/16.jpg)
core
• Virtual file system, lexer, parser, PSI, references
• Utilities: collections, concurrency etc.
• No UI
• No specific language support
Tuesday, July 30, 13
![Page 17: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/17.jpg)
platform
• Action systen
• UI framework: toolwindows, dialogs etc.
• Text editor
• Diff
Tuesday, July 30, 13
![Page 18: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/18.jpg)
lang
• Language-independent implementations of core code insight features
• Highlighting, navigation, completion, refactorings, code formatter and a whole lot more
Tuesday, July 30, 13
![Page 19: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/19.jpg)
Other Platform Modules
• Local history
• Debugger framework
• Test runner framework
• VCS framework
Tuesday, July 30, 13
![Page 20: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/20.jpg)
java-psi
• UI-less part of IntelliJ IDEA's Java support
• Parser, reference resolution, inspections etc.
Tuesday, July 30, 13
![Page 21: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/21.jpg)
xml
• Parsing, DTD/XML Schema/RelaxNG, etc.
• DOM framework for XML-based DSLs
• Recently separated into non-UI and UI parts
Tuesday, July 30, 13
![Page 22: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/22.jpg)
Other Platform Extensions
• Spellchecker
• Images support
• Regular expression support
Tuesday, July 30, 13
![Page 23: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/23.jpg)
Community Edition Plugins
• Version control: Git, Mercurial, Subversion, CVS
• Build systems: Ant, Maven, Gradle
• Tasks / issue tracker integration
• UI Designer
• Terminal
Tuesday, July 30, 13
![Page 24: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/24.jpg)
IntelliJ Platform vs Eclipse/NetBeans RCP
• Not a general-purpose RCP
• Best for code-centric tools, a lot of stuff comes for free
• Not necessarily best for graphics-intensive tools
Tuesday, July 30, 13
![Page 25: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/25.jpg)
Product Opportunities
• Language IDEs: Haskell, Go, Lua, D, Perl, assembly, Verilog/VHDL
• Framework-specific IDEs
• Code analysis/exploration tools
• Game development?
• ERP?
Tuesday, July 30, 13
![Page 26: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/26.jpg)
Plugin vs Product
• Start with plugin in any case
• Product lets you remove what you don't need, change what you don't like
• Product gives you control over branding
• Both plugins and products can use commercial license
Tuesday, July 30, 13
![Page 27: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/27.jpg)
Product Licensing
• IntelliJ Platform is Apache 2 licensed, does not restrict licensing of derivative products
• Talk to us if you need components only available in IntelliJ IDEA Ultimate
Tuesday, July 30, 13
![Page 28: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/28.jpg)
Building a Product
Tuesday, July 30, 13
![Page 29: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/29.jpg)
idea.platform.prefix
• System property used as prefix for names of plugin and application info files
• Set in default VM options
Tuesday, July 30, 13
![Page 30: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/30.jpg)
Product Plugin File
• <idea.platform.prefix>Plugin.xml
• For example, IdeaPlugin.xml for IDEA CE
• Same format as regular plugin.xml file
• Can include chunks of components from platform
Tuesday, July 30, 13
![Page 31: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/31.jpg)
<idea-plugin version="2" xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="/META-INF/IdeaPlugin.xml" xpointer="xpointer(/idea-plugin/*)"/></idea-plugin>
Tuesday, July 30, 13
![Page 32: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/32.jpg)
Application Info File
• <idea.platform.prefix>ApplicationInfo.xml
• For example, IdeaApplicationInfo.xml for IDEA CE
• Single entry point for all branding info
• Patched by build script to include build number etc.
Tuesday, July 30, 13
![Page 33: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/33.jpg)
<component> <version codename="Community Edition" major="13" minor="0" eap="true"/> <company name="JetBrains s.r.o." url="http://www.jetbrains.com/"/> <build number="__BUILD_NUMBER__" date="__BUILD_DATE__"/> <logo url="/idea_community_logo.png"/> <about url="/idea_community_about.png"/></component>
Tuesday, July 30, 13
![Page 34: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/34.jpg)
Building the Product
• build/scripts/dist.gant
• IntelliJ project file built with JPS (JetBrains' homegrown build system)
• Layout tasks used to build structure of product distribution
• Layout has common and OS-specific (Windows, Linux, Mac) parts
Tuesday, July 30, 13
![Page 35: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/35.jpg)
def info = layout(targetDirectory) { dir("lib") { jar("util.jar") { module("util") module("util-rt") }
jar("openapi.jar") { openapiModules.each { module it} } }}
Tuesday, July 30, 13
![Page 36: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/36.jpg)
Windows Launcher
• native/WinLauncher
• tools/LauncherGenerator
• buildWinLauncher() in utils.gant
Tuesday, July 30, 13
![Page 37: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/37.jpg)
Distribution Scripts
• Windows - NSIS installer, scripts currently not open but likely will be
• Mac - DMG build script tied to our environment, roll your own
• Linux - just a .tar.gz
Tuesday, July 30, 13
![Page 38: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/38.jpg)
Server Infrastructure
• Exception reporting
• Automatic updates and patches
• Plugin repository
• Usage statistics
• All URLs in ApplicationInfo.xml
Tuesday, July 30, 13
![Page 39: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/39.jpg)
Contributing to IntelliJ Platform
Tuesday, July 30, 13
![Page 40: How to Build Developer Tools on Top of IntelliJ Platform](https://reader033.fdocuments.net/reader033/viewer/2022050801/5443b31dafaf9fa0098b45c6/html5/thumbnails/40.jpg)
Contribution Workflow
• Sign the CLA
• Send us a pull request on GitHub
• Explain the motivation for the change
Tuesday, July 30, 13