In JetBrains Rider, is there a way to run compound run / debug configurations without closing running projects? - rider

I have a bunch of compound run / debug configurations, each containing about 20 profiles, a lot of which overlap.
Every time I ran a compound configuration where some projects were already running I had to press the cancel button about 15 times in order to prevent already running projects from stopping.
Today I noticed the Don't show this again checkbox, so I checked it and clicked cancel, expecting it to always cancel. Now, instead of keeping all my projects running, it stops all of them.
How do I get this dialog back, or switch it to not stop projects that are already running?

I received an answer from Rider Support:
To restore the notification, open the file .idea/workspace.xml from your project root, and set the value to true in the following parameter:
<property name="restartRequiresConfirmation" value="false" />

Related

Invoke an intelliJ run/debug configuration from command line?

I've got some Run/Debug Configurations defined in my JetBrains IDE, and to run them obviously you'd normally press the green 'play' icon;
However, I want to combine that with scripts I've got on my machine which detect file system changes and re-run some validation steps in the background;
Now what I'd like to do is to say something like 'when the CLI detects that something is stale, start the run/debug configuration in the IDE'.
So in pseudo-bash, something like
# if any "*.rs" file changes, press the green button in intellij;
watch-files *.rs -x "run-intellij-config 'check controlplane'
Is it possible to invoke tasks within IntelliJ like this?
There is no way to do this currently, please vote for IDEA-157076 to be notified on any progress with this feature request

Unable to add External Tool to run Before Configuration Launch IntelliJ

Introduction
I've looked around and haven't seen anyone else having my issue.
Basically, I am wanting to run a start.bat file to start up my server before I start up my debugging session. I currently have my debugging inside of an IntelliJ Configuration and it works well. The problem is that in the options for my configuration I can't seem to add an "External Tools" task to the Before Launch section. I was able to add a maven task here previously. However, when I follow the following steps, the "start.bat" is not added.
First I go into Settings->Tools->External Tools to add my Spigot-Server tool which basically calls the start.bat file inside of a test-server directory.
Snippet of External Tools
Second, I go into my "Debug Spigot" configuration and at the bottom, I see a "Before Launch" Section.
Snippet of Spigot Debug options
I click on the + inside of that section to add a new task, and I click on "External Tools"
Snippet of adding External Tools Task
And then I make sure my Spigot-Server task is selected.
Snippet of select external tool
And then once I hit okay, the window closes but I don't see a new task added to the before launch section. It looks the same it did before I clicked on anything. I also don't see any status message at the bottom of IntelliJ
I basically expect the task "Spigot-Server" to show under the Before Launch section. This would basically start up the server and once the server was completely started, it would then launch the debugging configuration.
I think it may be an issue with IntelliJ's UI. I searched IntelliJ's issue tracker But couldn't find any that matched.
I'm wanting to know if there are any work arounds to get this setup in IntelliJ>
I was able to achieve my goal by doing some workarounds that I discovered with the help of CrazyCoder. I found this stackoverflow question that told me about the batch plugin.
I was able to create a Batch run configuration for a wrapper batch file that gets around the limitation CrazyCoder mentioned. He said that even if I did get my setup where my server runs before my debugging is launched, my debugging would never launch. This is because the terminal process needs to exit before the next task starts.
To get around this this is the wrapper batch file I created.
#echo OFF
START "Spigot-Server" /D C:\Users\rocke\Documents\Programming\Minecraft\Spigot\capture-the-carrot\test-server "start.bat"
ping -n 3 127.0.0.1 >nul
It basically uses the "START" command to run the task asynchronously and then waits 2 seconds. This is because all I need to do is wait for the start.bat command to run the very first part so that it establishes remote debugging. And then the wrapper ends after 2 seconds (the 3 represents the number of seconds I want to wait +1). And this allows the Debugging process to start while also ensuring that the server has setup remote debugging!
I'll just share screenshots of my configuration if anyone wants to do the same.
Maven Build Configuration
Spigot Server Start Configuration
Remote Debugging Configuration
The way this is setup is once I run the Remote Debugging Configuration, it has a "Before Launch" Task of Spigot Server. Spigot Server also has a "Before Launch" Task of Maven Build Project.
So my Maven Build Project runs, then my Spigot Server wrapper runs and after 2 seconds terminates, and then my Debugging Configuration runs!
If you have any questions regarding remote debugging with spigot, use this resource: https://www.spigotmc.org/wiki/intellij-debug-your-plugin/

Intellij GitToolBox Plugin Spawns dozens of ssh.exe that never close

I just started at a new company and they use Intellij with the GitToolBox plugin. Their code is on BitBucket. I seem to be able to do everything manually so I think Git and the SSH stuff is all connected. When I open Intellij it opens up a dozen or more ssh.exe and maxes out my CPU (i9) and will stay that way forever until I manually kill them. When I try to fetch it also runs forever and never shows progress or completes. I verified that it is indeed the GitToolBox plugin as this issue does not occur when I remove that plugin. I have tried older versions as well as adding/removing the plugin.
The only thing I can see in the Intellij logs are repo hash mismatch INFO messages and the following:
2021-08-16 14:04:36,198 [ 557785] WARN - nSystem.impl.ActionToolbarImpl - 'TodoViewToolbar' toolbar by default uses any focused component to update its actions. Toolbar actions that need local UI context would be incorrectly disabled. Please call toolbar.setTargetComponent() explicitly.
java.lang.Throwable: toolbar creation trace
And
2021-08-16 14:04:59,580 [ 581167] WARN - penapi.actionSystem.impl.Utils - Use DataManager.getDataContext(component) instead of SimpleDataContext for wrapping.
java.lang.Throwable: Use DataManager.getDataContext(component) instead of SimpleDataContext for wrapping.
Has anyone encountered this or know how to fix it?
For anyone that happens upon this issue, I installed Git For Windows incorrectly and was using the "Git Bash only" option instead of the "Command line and 3rd party apps" option during the initial install. To change these you have to completely uninstall g4w and reinstall it selecting the new options.

How to prevent Gradle job running in background on TFS agent

I have configured a Windows 7 VM as an agent to my TFS2015 setup.
I have created a Gradle (invoking the gradlew.bat) job to run my selenium scripts from the TFS build definition as
gradlew.bat clean test aggregate
This works fine (I can see IE being invoked) when I run it MANUALLY from the VM directly, BUT when the same is triggered as a job, it runs only in the background. Here are my observations:
The processes - Java, iexplorer, IEDriver.exe are all getting invoked in the Process manager.
When I kill iexplorer process, I can see the UnreachableBrowserException on the TFS console and the next test case runs.
The job with 2 test cases (approx 3-4 mins) fail after running for 10 mins and I see the error logs in TFS console
The scripts ran on UI the very first time I set this up but has never run after that.
I am using Gradle 3.0 and have disabled the Gradle Daemon by adding org.gradle.daemon=false in gradle.properties. This has been bugging me for a couple of days so badly.
Any help would be great.
For your tests to interact with the desktop they will need to be running interactively on a machine that is logged on and not locked (no screensaver active).
See: https://www.visualstudio.com/en-us/docs/build/admin/agents/v2-windows#interactive
You can configure the machine to start-up automatically and authenticate on start-up, disable the scren locking policy and screensavers and add the run.cmd to the windows start-up section in the star-menu.
See: http://donovanbrown.com/post/2015/08/28/auto-start-build-agent-in-interactive-mode
Press Windows Key + R to open the Run dialog
Type in the following and press enter:
control userpasswords2
Uncheck the box for User must enter a user name and password to use this computer.
Click the Apply button
You will be prompted by an Automatically sign in dialog
Enter the password for the user
Click OK
Click OK on the Users Accounts dialog
And
Right-click the desktop
Select New / Shortcut
Enter cmd
Click Next
Change the name to Start Agent
Click Finish
Right-click on the new shortcut
Select Properties
Append /c {pathTo\run.cmd} to the target
If you installed your agent to C:\Agent, your target should look like this: C:\Windows\System32\cmd.exe /c c:\agent\agent\run.cmd
Click OK
Note: updated for the 2.0 build agent, which is started using run.cmd instead of vsoagent.exe
Press Windows Key + R to open the Run dialog
Type in the following
shell:startup
Click OK
This will open the Startup folder in Windows Explorer.
Drag and drop the shortcut to this folder

Error when enabling auto login of macOS app using a helper

I'm trying to have my app auto launch on login following Tim's tutorial: http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/
I followed the instructions to the letter but I'm getting an error when I re-login to my computer as follows:
Jan 10 12:55:01 pc61 com.apple.xpc.launchd[1] (com.myApp.macgap.helper[25725]): Could not resolve CFBundleIdentifier specified by service: -10814: com.myApp.macgap.helper
Jan 10 12:55:01 pc61 com.apple.xpc.launchd[1] (com.myApp.macgap.helper): Service only ran for 0 seconds. Pushing respawn out by 10 seconds.
To outline:
I have my main app called "myApp" (ID: com.myApp.macgap )
In that app I have a helper app with ID: com.myApp.macgap.helper
When you launch the main app and go to preferences, you have an option to enable auto login (to fit to the Apple compliance rules)
I log out of my computer, log back in and look at the console to see what's going on (that's how I get the code above)
Another point worth mentioning, is when I do "Show package content" on the app and double click the helper app, it does launch the main app...
It all comes down to how launchd and launchctl work, as already answered, the regular use case often can be solved by reinstalling the app and ensuring the app is inside the applications folder. But there's another case that #byb is talking about, when this happens on your development machine – this can be caused by invalid launchd configuration.
When you run SMLoginItemSetEnabled it registers your bundle identifier along with other information in launchd service. At some point later, when your app changes, gets cleaned, or something else happens to it, which gets picked up by launchd, launchd may disable that particular login item. Apparently, sometimes this doesn't go smoothly, and consecutive calls with SMLoginItemSetEnabled will not work as expected or the agent / helper app simply won't launch.
The first thing to try is simply changing the bundle identifier for your launcher. If this solves the issue, try figuring out what's wrong with the original. Run launchctl print-disabled "user/$(id -u)" to display disabled services and login item associations. If the output contains your troubling bundle identifier – you are in luck.
I didn't find a way of removing disabled services by name using launchctl and had to do it by manually editing configuration files. Because they system-owned, you won't be able to simply click and edit, instead launch Xcode as root and remove the necessary references.
sudo /Applications/Xcode.app/Contents/MacOS/Xcode "/private/var/db/com.apple.xpc.launchd/loginitems.$(id -u).plist"
sudo /Applications/Xcode.app/Contents/MacOS/Xcode "/private/var/db/com.apple.xpc.launchd/disabled.$(id -u).plist"
Restart, run launchctl print-disabled "user/$(id -u)" to confirm removed items are no longer in the list. Try SMLoginItemSetEnabled again, hopefully now it will work as expected.
I had the exact same problem just now, and while looking for a solution found this (unanswered) question.
At least in my case, this desired functionality of the worked fine when I copied the app (exported from Xcode as a dev-id signed .app) to a fresh OS X install/account without all my development stuff on it. Of course it must also be in /Applications, as stated in the tutorial referred to in the question.
I am not sure why this feature of the app did not work on my development machine. Perhaps the problem could be due to some form of conflict with all the other near-identical copies of my app I have on disk (I have an archive of different versions of the app, plus the copies Xcode stores itself), all with the same bundle id of course.
Hope this helps in one way or another!
I had the same problem, removing other copies of app except one in /Applications solved the problem for me. To remove .app files generated by Xcode you can run Product->Clean.
I was struggling with this for hours. I had many apps with auto login but a new one just did not want to work.
Strangely this worked on the development machine:
Build App as normal
Move it to Application directory
Clean Xcode (CMD+k)!!
Enable auto login in the app.
Logout Login
I accidentally noticed that the system started the app (it tries in every 10 sec) when I clean Xcode :)
I can't find the duplicate copy but did find you can remove the service:
In a terminal window:
launchctl remove com.annoying.service
As it was already stated if there are more then one copies of service bundle on the machine launchd cannot resolve which one must be started by bundle identifier.
What I would recommend to you is find all copies of your service and then remove not desired ones.
For this you need to run following Swift code (It works even in Swift Playground):
import Cocoa
let bundleId = "com.your.bundleId"
let paths = LSCopyApplicationURLsForBundleIdentifier(bundleId as CFString, nil)
print("Available service instances by bundle id: \(paths)")
In my case it produces:
Available service instances by bundle id:
Optional(Swift.Unmanaged<__ObjC.CFArray>(_value: <__NSArrayI 0x6000002234a0>(
file:///Applications/MyApp.app/Contents/Library/LoginItems/MyService.app/,
file:///Users/igor/Library/Developer/Xcode/Archives/2017-12-27/MyApp%2027-12-2017,%2016.06.xcarchive/Products/Applications/MyService.app/
)
))
So I easely identified copy to be removed:
file:///Users/igor/Library/Developer/Xcode/Archives/2017-12-27/MyApp%2027-12-2017,%2016.06.xcarchive/Products/Applications/MyService.app/
Hope it help.
Assuming that you followed Tim Schroeder's recipe at: http://blog.timschroeder.net/2012/07/03/the-launch-at-login-sandbox-project/ :
What actually ended up working for me, was, in Xcode, to change my main project's build number from 1 to 2. I also tried a build number of 1000 and that worked fine as well.
In Xcode, select your main project target. Then, select the 'General' tab. If you see your Build is set to 1, change it to 2 and then rebuild, redeploy and see if that resolves the issue for you.
This was probably one of the screwiest bugs I have run into, in a while.