You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
2. Change directory to one containing this project
136
+
3. Execute command `sbt ijRun`
137
+
138
+
### Running SBT tasks at part of IntelliJ IDEA build
139
+
140
+
[IntelliJ IDEA](https://www.jetbrains.com/idea/), with Scala plugin, can directly load SBT projects.
141
+
You can then execute sbt tasks to build and copy needed jars to run your plugins in ImageJ.
142
+
143
+
#### Option 1: Run `ijRun` task as "Run Configuration"
144
+
145
+
1. From the menu select "Run" > "Edit Configurations..."
146
+
2. Click `+` (add new configuration) and select "sbt Task" as configuration type
147
+
3. Give the configuration a name, say "ImageJ"
148
+
4. Under "Tasks" type `ijRun`
149
+
5. Make sure that working directory points to your module directory
150
+
151
+
Now you have new run configuration that will build your code, package jars, and start ImageJ with your plugins.
152
+
153
+
The downside of this method is that IntelliJ will not let you debug you code if you start it this way.
154
+
155
+
#### Option 2: Add `ijPrepareRun` to a typical application run configuration
156
+
157
+
The idea is to create a regular application run configuration and execute `sbt ijPrepareRun` to setup runtime directories:
166
158
167
-
You can find complete [build.xml](example/build.xml) in the [example](example) project.
159
+
1. From the menu select "Run" > "Edit Configurations..."
160
+
2. Click `+` (add new configuration) and select "Application" as configuration type
161
+
3. Give you configuration a name, say "ImageJ"
162
+
4. In "Main class:" type `ij.ImageJ`
163
+
5. In "Working directory:" select subdirectory "sandbox" of your module directory (or a directory you defined in `ijRuntimeSubDir`)
164
+
6. Select relevant project module.
165
+
7. In "Before lunch:" select `+` and then select "Run External Tool"
166
+
8. In "External Tool" window select `+` to define how to execute `sbt ijPrepareRun`
167
+
9. Give the external toll configuration some name.
168
+
10. In "Program:" type `sbt`
169
+
11. In "Arguments:" type `ijPrepareRun`
170
+
12. In "Working directory:" select your module directory
171
+
13. Click "OK" a couple of times to close dialogs
168
172
173
+
Now you have definition of an application run configuration that will run ImageJ, before the run SBT will be called to prepare plugin jars and copy them to plugins subdirectory.
0 commit comments