Schedule run configurations automatically - intellij-idea

I have a Intellij Gradle Run configuration. Is there a way to schedule this to run automatically? The commandline that IntelliJ use to run this seems to be hidden so I couldn't simply make a cron job for this with command line.

There is no such feature in IntelliJ. If it's a Gradle configuration, the only IntelliJ-specific command line customizations are related to running inside the IDE, so you can simply create a cron job that would run 'gradlew name-of-your-task>'.

Related

run a maven plugin goal with parameter in intiliji idea

I'm using the liquibase maven plugin to run and rollback the migrations.
I'm running the rollback goal using the command line as follows:
mvn liquibase:rollback -Dliquibase.rollbackCount=1
How to edit the configuration in intiliji idea to run the goal with the given parameter.
I'm using the intellij idea version : 2021.3.2
You need to create a custom Run Configuration for that, here is how to do it: Run/Debug Configuration: Maven
You'll basically need to
From the main menu, select Add Configuration.
Name you configuration and provide the command and parameters.
Done! Now you just need to select it from the dropdown menu of run configurations and execute it.

Run CMD/Powershell command before the build command?

How I can run a CMD/Powershell before my Java GUI Application will be build and invoked.
I want run the command: sass ANYFILE.scss:ANYFILE.css to compile my scss file first.
In the Run/Debug Configurations I found nothing which helps me at the Before launch option.
Add the External Tool in IDE which will run any command you want, then add it in Before launch section.
There is a PowerShell plugin that provides a run configuration to run powershell scripts. You can add it as Before launch option as well.

Use custom script in Intelij IDEA to run sbt shell

Is it possible to run sbt shell in Intelij IDEA using custom script instead of built in sbt or sbt from sbt-launch.jar? Why I need this, for example there is some project which uses custom script to set config file location, VM parameters, and other options for sbt and this script is shared in version control system. And it would be very convenient to just specify for IntelliJ IDEA location of such script.
This is currently not possible. However, to pass project-specific sbt command line parameters to sbt you may place a .sbtopts in your project directory, and likewise a .jvmopts for VM parameters.

How to run sbt task on make project in IntelliJ IDEA?

I'm working on a scalajs project. My workflow is: make code changes, make project in IntelliJ, go to sbt and run fastOptJS task to produce js file, go to browser and test. I would like to remove the step of manually running fastOptJS task in sbt and make that happen automatically when I make project in IDEA. Is there any way to do that?
UPD: It would be also nice to keep sbt running between fastOptJS calls, cause it takes time for sbt to start.
You can simply start the JavaScript compilation with the sbt watch mode.
Select Run | Edit configurations... and add a new SBT Task by pressing the green plus. In the field "Tasks:" define ~fastOptJS and then run the new configuration.
It will compile again whenever you have changed something.
This should be the workaround for your propose, instead of use "Make Project ( Ctrl + F9 )", you can create a run in IDEA and configure an external tool as the image shown, where you can run the fastOptJS task in sbt.

IntelliJ IDEA: Running a shell script as a Run/Debug Configuration

Is there a way by which a shell script can be invoked from IntelliJ Run/Debug configurations?
I just found out that we can invoke a shell script with the help of BashSupport plugin.
'Add External tool' in the 'Before Launch' does the trick.
Screenshot
IntelliJ IDEA 2019.2 update
New version of IntelliJ IDEA has Shell Script Support included. It means you can now create Shell Script build for your project.
Edit Configurations > (+) Add New Configuration > Shell Script
You can also build your project before executing your script by adding Run Another Configuration task. That's how it looks like: Add Shell Build window
Not sure about 11, but in 12 there's a part of Run/Debug Configuration that is called "Before Launch" and you can select your shell script in "Add External tool" option.