Programmatically Update Third-Party Modules

I think I figured everything out. Here is the full solution to run the designer from IntelliJ with my module code:

  1. Create a new run configuration in IntelliJ called DesignerStartupHook
  2. Click 'Modify Options' in the top right and enable the following:
  3. Set your classpath variable in the 'Build and Run' section of the run configuration to '-cp designer-launcher' (package that contains the pom.xml file previously discussed in this thread)
  4. Set the SDK to match that of your designer-launcher package and set the 'Main class' variable to com.inductiveautomation.ignition.designer.DesignerStartupHook
  5. Put the following VM flags in the 'VM options' section. Note: your paths to various folders might be different:
--add-opens=java.base/java.lang=ALL-UNNAMED
--add-opens=java.base/java.util=ALL-UNNAMED
--add-opens=java.desktop/java.awt=ALL-UNNAMED
--add-opens=java.desktop/java.awt.event=ALL-UNNAMED
--add-opens=java.desktop/javax.swing=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.tree=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.basic=ALL-UNNAMED
--add-opens=java.desktop/javax.swing.plaf.synth=ALL-UNNAMED
--add-exports=java.base/sun.security.action=ALL-UNNAMED
--add-exports=java.desktop/com.apple.eawt=ALL-UNNAMED
--add-exports=java.desktop/com.sun.awt=ALL-UNNAMED
--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED
--add-exports=java.desktop/sun.awt=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.image=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.shell=ALL-UNNAMED
--add-exports=java.desktop/sun.awt.windows=ALL-UNNAMED
--add-exports=java.desktop/sun.swing=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.plaf.synth=ALL-UNNAMED
--add-exports=java.desktop/sun.swing.table=ALL-UNNAMED
--add-exports=java.desktop/sun.print=ALL-UNNAMED
-Dsr.gateway=localhost:8017
-Dautologin.username={your username}
-Dautologin.password={your password}
-Dignition.version=dev
-DlibPath="C:\Program Files\Inductive Automation\Ignition8.0.17\user-lib\pylib"
-Dpython.home="C:\\Program Files\\Inductive Automation\\Ignition8.0.17\\lib\\core\\common\\jython-2.7.1-ia5.jar"
  1. Go to File->Project Structure->Libraries. In the box on the right, click the '+' icon and navigate to the Ignition directory that contains all the jar files for the native Ignition modules. My jar directory path looks like this:
    "C:\Program Files\Inductive Automation\Ignition8.0.17\data\jar-cache"
    Inside of this directory are subdirectories of each module. Simply select all of these directories and add them to your project library.
  2. IMPORTANT In order to use the module code you currently have typed out in IntelliJ, you need also need to add your path to your fully built .modl file into the project library. You also need to install your .modl file on the gateway at least once so the Designer can see and update your module from the GatewayInterface side.
  3. Upon adding your .modl file to the project library, IntelliJ will ask you what to do with it, because it doesn't recognize the file structure. Select "Classes" and "Jar Directory" from the available options.

After doing all this, run your new configuration. Your Designer session should open with no errors if you added all jars to the project library correctly.

If you are reading this somewhere down the line and have questions or issues, feel free to DM me.

1 Like