What is an SDK?

I'm asking this from the perspective of a custom language plugin author.  For something like Java, we have a standard directory that is home to the language installation, the JDK.  For other languages we have something similar.  But in the case of something like Haskell, you may or may not.  You may be using a specific build tool (Stack or Cabal) or just plain GHC (the Haskell compiler).  If you are using Stack, it manages your GHC installation for you, so you might not even have it installed yet.  So where is your SDK home?  The path to the build tool or GHC?  In this case, it seems easier to just not even have an SDK and let the user configure how to build the project using the Build and Compiler settings.

Does an SDK serve some other purpose?  Am I missing something obvious?

7 comments
Comment actions Permalink

To have or not to have the concept of an SDK is your choice, as a plugin developer. I can say that, for all the technologies that I'm aware of (Java, Python, Ruby, PHP, JS and so on), it was possible to define what an SDK is, and it was a useful concept (particularly in the IntelliJ IDEA UI, where the users of your plugin will always have a UI for choosing the SDK, and may get confused if you don't provide anything to enter there).

In your case, it may make sense to define different SDK types for different ways that the user can install Haskell.

0
Comment actions Permalink

The problem with that is, if you don't have an SDK, it seems like Building and Run Configurations won't work.  I'm not sure if it's they way I currently have them implemented or it's something that's just required in IntelliJ.  In fact, the plugin docs say -

Every project uses a Software Development Kit (SDK)...SDK determines which API library is used to build the project.

http://www.jetbrains.org/intellij/sdk/docs/reference_guide/project_model/sdk.html

So, it seems like it's not entirely optional.  Although, if the user is already configuring their compiler and build tool in the project settings, it's not clear why you'd even need an SDK in the first place, other than the "API library", which doesn't really apply to Haskell.  The compiler and/or build tool takes care of this for you.

0
Comment actions Permalink

Why exactly does it seem to you that they won't work? At least for run configurations, you definitely can implement a run configuration that does not depend on the SDK in any way.

0
Comment actions Permalink

could you give SDK use example?

e.g. there is valid SDK defined. with this SDK plugin coder can .... ?

0
Comment actions Permalink

The SDK is an abstraction that is provided to you as a plugin developer by the IntelliJ Platform, and also is shown to the user in the project configuration UI. Through the SDK concept, the user can specify where the installation of the target language compiler or interpreter is located, and the plugin code can locate various parts of the target language installation (compiler, runtime, library classes and so on).

As I said before, using the SDK concept is optional. You can write your own code to let the user configure the environment, store the settings, locate the paths and so on. The only downside of that approach is that the SDK configuration UI will still be visible in the IntelliJ IDEA project structure UI, and the users may be confused if you don't provide anything meaningful that they could select in that UI.

0
Comment actions Permalink

> the plugin code can locate various parts of the target language installation

Cheers, Dmitry. This is clear.

0
Comment actions Permalink

Then it seems like this plugin won't necessarily benefit from an SDK, since each user can have a very different setup.  It seems simpler to just have the user configure the build tool and/or compiler if the plugin doesn't infer it.  I appreciate the help, I've marked your original answer as the solution.

0

Please sign in to leave a comment.