IntelliJ plugin topics:

Debug the sc4idea plugin:

TODO: these instructions probably need some updating but they are based on the normal instructions for debugging an IntelliJ plugin.

  • Enable the Groovy plugin
  • Install the IntelliJ PluginDev plugin
  • Get a copy of the community source for IntelliiJ
  • Create an sc4idea module (or import the one here)
  • Create a new SDK of type "Plugin" (in "Project Structure", select "SDKs" and "+")
  • Add the source of the intelliJ community editor to the source path of that plugin

  • Make sc4idea depend on the "sc" module for the StrataCode source, or create a Library in IntelliJ called sclib that points to the sc.jar file

  • create a run configuration of type "plugin" for sc4idea

To deploy the plugin:

  • in Project View, right click on the sc4idea module and select the Prepare plugin module for deployment menu. The results are in the sc4idea/sc4idea.jar or sc4idea.zip depending on whether or not the sc.jar is a dependency.

NOTE:

  • If you build from source, note that IntelliJ SDK or someone copies the class files from the intelliJ build directory into some sandbox directory in your home directory (on mac it is:

    ./Library/Caches/IntelliJIdea13/plugins-sandbox/plugins/sc4idea/classes/
    
    • Also note that when you use sclib and enable a Compile dependency, it will put the library into sandboxDir/.../sc4idea/lib
  • There's a problem because coreRuntime and fullRuntime have overlapping files. During the copy this classes folder might end up with the wrong run. Whe installed a simple shell script to workaround this problem - the run configuration for the sc4idea

        #!/bin/sh
        PLUGINDIR=/Users/jvroom/Library/Caches/IntelliJIdea13/plugins-sandbox/plugins/sc4idea/classes
        BUILDDIR=/jjv/vroomsys/out/production/fullRuntime
        cp $BUILDDIR/sc/type/PTypeUtil*.class $PLUGINDIR/sc/type/
        cp $BUILDDIR/sc/type/Type*.class $PLUGINDIR/sc/type/
    
  • There are cases where you need to clean out this directory, like if you rename the module - the one for the old module might still get loaded into the classpath and precede the one you are building.