How to get all VirtualFile of a project using intellij plugin sdk - intellij-plugin

How to get all VirtualFile of a project using intellij plugin sdk. Also are there any books or tutorial for advanced intellij plugin development.

Your task does not require getting all VirtualFiles of a project. To get a VirtualFile for a specific file in your project, use LocalFileSystem.getInstance().findFileByIoFile().

Related

option to create a kotlin multiplatform project not present in idea 2019.3

i want to create a kotlin mp project in intellij idea 2019.3 Community, but the options i see in new project window for kotlin are just jvm|idea and js|idea.
In several articles there are options like mobile shared library | gradle, present even for older versions oj IJIdea.
I already have kotlin in another project, as part of a maven project
any hints?
Make sure you have latest Kotlin plugin installed and Gradle bundled plugin enabled.
See these steps about creating Kotlin MPP project.
gradle plugin was enabled, but still something smelled, so after some time spent enabling/disabling plugins, i decided to enable android support plugin - then after restart idea complained that gradle-java plugin is not enabled, after enabling that (from the error tab link, not the plugin management window in preferences) - the options to create various gradle projects appeared, including the ones for kotlin/multiplatform

IntelliJ 2018.1 - Add Plug-in nature to project

I cloned a project from GitHub, but IntelliJ doesn't see it as a Plug-in development project. Can I attach a Plug-in nature to it?
I'm using IntelliJ 2018.1
Delete the old module in Project Settings, create a new IntelliJ Platform Plugin module and mark directories as sources, test, etc.

Can I get project build command in intellij plugin?

I'm trying to make plugin for Intellij.
Can I get project build command in plugin? (like make dist or gbs build --include-all)
And does it works for Android Studio?
In IntelliJ IDEA, to build a project, call
CompilerManager.getInstance(project).make(null);
Android Studio does not use IntelliJ IDEA's build system, so you need to call a different API:
GradleInvoker.getInstance(project).compileJava(moduleManager.getModules());

Opening Dart projects in IntelliJ

I can't seem to import dart projects, I have the dart plugin installed, have it enabled, selecting both the dart project's pubspec.yaml or build.dart seem to give me the error "Cannot import anything from _.dart / _.yaml".
If I select the root directory of the dart project and select create modules from existing sources (since it's not a maven/gradle/eclipse project), it gets picked up as a python project and there is no way to select a dart SDK.
Right clicking and clicking add framework support only gives me python related frameworks such as Django and App Engine (Python). Trying to add a project facet, there are tons of options, everything from Vaadin, to GWT, to Scala, etc, but no Dart.
The official Dart page for dart-support gives me an error 404: https://www.jetbrains.com/idea/help/Preparing_for_Dart_Development.html
(related to Netbeans + Eclipse + Dart -> IntelliJ)
(PS, this project was created in Dart Editor)
File > Open > selecting the folder does it for me (WebStorm). I don't know what create modules should do.
When I open a file it asks me if I want to make it a Dart project, and I'm done.

Getting contents and natures of all projects in a Maven build

Currently I'm working on a Maven plugin that should generate files in all projects (OSGi bundles) that have a certain Eclipse project nature.
How can I access the contents of the projects included in the build and the project natures by using the Maven API?
Maven is a standalone build tool, not an Eclipse plugin. You cannot access Eclipse project settings from core Maven API.
Eclipse supports Maven with the M2E Eclipse plugin. It is possible to write M2E extensions and in the extension you can query the project natures via the functions of AbstractProjectConfigurator class.
However, M2E extensions will not run when you compile your code in the command line. I suggest that you choose one of the followings:
Write an Eclipse plugin that generates the source code into the src folder of the maven project. Code generation should be started by the user manually (selecting a context menu in the project or something).
Avoid using Eclipse project natures and solve your questions based on analyzing the source and pom of your project.
If you need to react on certain aspects in the source code like it looks from the thread with Balazs then you can simply write an ordinary maven plugin and include it in the parent pom. It will then run in every project and can analyze the code and react based on it.