Import settings to IntelliJ via file system - intellij-idea

I'm preparing an IntelliJ IDEA 2017.3 rollout for about fifty software developers working with Windows PCs. To make life a little easier for them I want to provide some default settings fitting our company infrastructure and coding guidelines.
I've found I could export a file settings.jar but every developer would have to import it manually. That's not ideal.
An other way is to share settings via built-in plugin settings repository. But I couldn't get it to work properly with a git repository located at a network share.
Maybe I could overwrite files in directory user.home/.IntelliJIdea2017.3/config/options but installations are typically restricted to write to program files directories in Windows at our company.
Question is: Is there another way to import settings in IntelliJ via file system? I heard about dropping exported settings.jar to plugins directory in IntelliJ installation directory but that's not working either.

There is no ready-made solution for this, however, you can write a small plugin that will import your settings file on startup, and deploy it to the plugins directory of your installation of IntelliJ IDEA.
You can find the implementation of settings import here. The current implementation is not decoupled from the user interface, so you can't invoke it from your plugin, but basically the only important part for your usecase is this:
val filenameFilter = ImportSettingsFilenameFilter(getRelativeNamesToExtract(dialog.exportableComponents))
StartupActionScriptManager.addActionCommands(listOf(
StartupActionScriptManager.UnzipCommand(tempFile, File(configPath), filenameFilter),
StartupActionScriptManager.DeleteCommand(tempFile)))
You can simply perform the same operation in an ApplicationComponent of your own plugin.

Related

How to create a project from the commandline?

Is it possible to create an IntelliJ project purely from the command line?
We are looking a streamlining the on-boarding of new hires and off-shore resources and to minimise the amount of project setup they have to perform. As such, it would be nice if we had the IDE already configured for them to get started.
There is a legacy plug-in for Maven to generate IntelliJ IDEA project files, but we don't recommend using it.
Instead, it would be easier to instruct users to open pom.xml file in the IDE so that the import is performed automatically.

Is it possible to transfer all the plugins and settings?

I've been using IntelliJ IDEA on my Mac for too long. My company asked me to use their laptop but I need all my plugins and settings. I've never used IntelliJ IDEA on another computer so maybe it's easy, I really don't want to install all the plugins one by one since there are too many.
Settings can be moved using File | Manage IDE Settings | Export Settings / Import Settings or the Settings Repository plug-in.
As for the plugins, just copy the plugins folder from one system to another.

How to properly import a Play 2+ project in IntelliJ 14+ with all integrated features (run, debug, test)?

I work on a Java based Play! project for severals months now and I'd like to import it completely in IntelliJ, meaning being able to run, compile, test and debug from IntelliJ, without the need to use the command line.
According to this post from Jetbrain, it seems to be possible, if I quote the article it says clearly : "Now you don’t need to switch between IntelliJ IDEA and Play console anymore. Everything is available right from your favorite IDE.", but I can't figure out a way to achieve this for now, even if I follow the tutorial provided by Jetbrains.
Here are the steps I've been throught :
Open my fav IDE IntelliJ ;)
Go to the project list window.
Import project
Import from external model and choose SBT as suggested in Jetbrains tutorial.
option "Use auto import" checked, option "create directories for empty content roots automatically" checked. Project SDK Java 1.7
Global sbt settings : JVM From project JDK.
Finish
By now, if I try to make the project and launch it from IntelliJ, I'll get scala compiling errors related to routes object. Thanks to this post, we can understand that this happens because scala routes are located to specific folders that needs to be included in IntelliJ sources settings for this project. So next step was :
File -> Project Structure -> Modules
Add target/scala-2.10/classes:target/scala-2.10/resources_managed:target/scala-2.10/src_managed as sources folders.
But my problem remains the same, routes object being unrecognized.
Notes : I have no scala facets in my project structure configuration nor can add one.
IntelliJ provides integrated support for the Play Framework for Scala and Java. Support is currently only available in IntelliJ Ultimate Edition (see the Frameworks and Technology section).
Assuming Ultimate Edition, the setup for Play is incredibly easy. Simply create a new project by importing build.sbt, then choose Add Framework Support and choose Play 2.
Once complete, you can start and stop Play using the Play 2 Run/Debug configuration. No command line necessary.
Here is a more in depth look at IntelliJ's Play project configuration.
You could try the command play idea if you are using play or activator idea if you are using activator. That will do the magic.

How to ensure eclipse plugin has required bundles available?

I'm just starting to develop a new eclipse plugin where I want a web application server running in Eclipse. I found a nice blog, OSGi as a Web Application Server, that describes how to do this. The author suggests creating a target environment for my bundle requirements, and some of those bundles get pulled in from the Equinox Project SDK (now called Equinox Target Components in Juno). I notice that the tutorial project runs fine when my target platform is the platform I created in the tutorial, but fails to start when it is the default platform. So, now for my question...
If I need bundles that are not part of the default, how will my plugin project get access to those bundles? Will I need to deploy them along with my plugin? How would I know if the user's eclipse does or does not already have those required bundles?
You was not much clear about what kind of application you are developing. Running a web server in an Eclipse IDE as a plugin don't make any sense to me. This kind of server application is best just running on top of Equinox.
Anyway, the right path is to create a "Product Configuration" file and add categories that contains the needed bundles (go to File/Plug-in Development/Product Configuration).
With this file you can run an instance of the product (inside the IDE) and can export it (create a zip containing all needed bundles)
And if you want to able your user to install plugin inside his IDE you must create a P2 repository (using a Target Definition File) and expose the exported directory within a Http server. You could research about Tycho to build this kind of components in a maven style.
Well, I'm not sure if re-inventing the wheel again is really sufficient.
You might take a look at Pax-Web for inspiration on how to do it, or take a look Apache Karaf as a OSGi-Container (using Pax-Web). Or even better start contributing to one of the two :-)

Play Framework 2.1 application mounted as an IntelliJ Module

Known is the command to create IntelliJ files needed for a Play application:
play idea with-sources=yes
This generates two folders:
.idea (containing libraries.xml)
.idea_modules
Most of tutorials or simple article on the net explain how to mount the app as an IntelliJ Project.
However, I want to mount it as a Module (as part of an existing project so), thus I've just used the .idea_modules file.
I can't imagine me setting ALL dependencies (more than 100...) manually...
How to deal with the libraries (dependencies)? Indeed, libraries.xml is used in .idea file and typically used when someone want to mount the app as an entire Project.
To put in a nutshell, is there an efficient way to set up a Play app in IntelliJ as a simple Module including automatically all needed dependencies?
It would be great if IntelliJ could implement an SBT feature like the one for Maven in order to import dependencies automatically.