Giter VIP home page Giter VIP logo

conan-clion-plugin's Introduction

Conan CLion plugin

Build Version Downloads

Conan, the C and C++ package manager, now directly in your IDE. List available libraries, install and use them without leaving CLion

Using the Plugin

Note

For a detailed explanation of how to use the plugin check: https://blog.conan.io/introducing-new-conan-clion-plugin/

Go to the “Conan” tool tab at the bottom of the IDE. You will see that the only enabled action in the toolbar of the plugin is the one with the ⚙️ (wheel) symbol, click on it.

Initial configuration

The first thing you should do there is configuring the Conan client executable that's going to be used. You can point to one specifically installed in an arbitrary location on your system or you can select "Use Conan installed in the system" to use the one installed at the system level.

Set conan executable

You will find there some options marked as default. Normally, if you are using the Conan plugin, you wouldn't want to unmark them. So leave them and let's create our project and add the libraries to it. So, click on the OK button and the plugin should be ready to use.

After doing the initial configuration, you will notice that the list of libraries is now enabled and that the 🔄 (update) and 👁️ (inspect) symbols are also enabled.

Now that we have our plugin configured and ready, you can now search for any libraries available in Conan Center and add those to your project.

Search libraries

Now, if you click on the 👁️ (inspect) icon mentioned earlier, you will see all the libraries we added to the project. This includes basic target information for CMake and the necessary code snippets to add to CMake to use them.

Inspect libraries

Installation

  • Using IDE built-in plugin system:

    Settings/Preferences > Plugins > Marketplace > Search for "Conan" > Install Plugin

  • Manually:

    Download the latest release and install it manually using Settings/Preferences > Plugins > ⚙️ > Install plugin from disk...


Plugin based on the IntelliJ Platform Plugin Template.

conan-clion-plugin's People

Contributors

abrilrbs avatar actions-user avatar czoido avatar github-actions[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

conan-clion-plugin's Issues

Add support for conan build --config

For some projects it is not sufficient to run conan install to get a valid configuration for CMake project loading.
For instance, finding packages is one of tasks that need running build --config first.

Detect settings automatically if profiles aren't matched

From CLion's API it appears we can get the current toolchain and use that to pass settings to Conan command line if the user does not match profiles, of course retaining the ability to override with profiles.

I am currently looking into this.

Allow for arbitrary build directory

Currently the plugin "force assumes" the build directory to be the default CLion cmake-build-debug and uses it in the invocation via the if flag:

/usr/local/bin/conan install /Users/marco/Development/gossip -if=/Users/marco/Development/gossip/cmake-build-debug -pr=default

However, one can change the build folder in CLion (I personally detest that, and use build everywhere; also because my build scripts use that one): the Conan plugin does not allow that to be configured, or even overridden (in the settings page).

Specifying again the -if in the Settings causes an error:

conan install: error: -if can only be specified once

The plugin should be smart enough to figure out CLion build folder, and use that one instead (or, at a very minimum, allow the user to customize that).

Allow to set the path of Conanfile

In my project structure right now, the project root doesn't contain the conanfile.py . It is two levels inside, from where i load the cmake project in clion. The plugin says no conanfile found in project directory. It would be nice if there is an option to specify the path of the conanfile in the project.

Thanks

Test against every supported version of CLion

Unit tests should be run against every major version of CLion since the minimum supported version.

I'd be in favour of running against the most recent patch version of each.

If this is too costly, only test all versions on the master branch, or some other policy.

I'm currently getting my head around the build system to try and implement this.

Unable to install in CLion 2018.2 EAP

Plugin 'Conan' is incompatible with this installation is the error I receive when I try to install version 0.1.2 from zip into CLion 2018.2 EAP, build #CL-182.2371.31

[feature] Add Create Command Support

It would be very helpful to be able to click a button in the CLion Conan plugin view to essentially do 'conan create'. A common use case for my company is the following:

  1. Open CLion project for libA
  2. Develop changes for libA, using the Conan plugin to install dependencies in support of libA CLion-based building
  3. Completely development of libA changes
  4. Open CLion project for appX

It would be nice if in between step 3) and step 4) one could do a 'conan create' of libA to stick the latest and greatest libA package into the local cache. Then, when you get to step 4) and 'conan install' dependencies via the plugin you pull in the latest libA changes.

Run programs in Conan virtualenv

Given I have a runnable program in CLion
I want to be able to run it in a Conan virtualenv
So that DLLs in packages that it depends on can be found.

I'm copy-pasting a conversation I had on the JetBrains slack with clues for how this can be done:

Is it possible for a plugin to add environment variables to run configurations in CLion?

Yes, you can use platform API com.intellij.execution.configuration.RunConfigurationExtensionBase that allows patching command line of any run configuration. For CLion specific run configuration you can use com.jetbrains.cidr.execution.CidrRunConfigurationExtensionBase

Just extend patchCommandLine and use GeneralCommandLine#withEnvironment() to change environment that is used to run configuration. It should work

The withEnvironment method mentioned above has the following signature:
public GeneralCommandLine withEnvironment(@Nullable Map<String, String> environment)

I'm opening an issue in the Conan repo to add a tool that can help us do this in a platform-independent way.

As far as the UX of this feature, I'm imagining the user having a list of the run configurations in a settings tab, and they can check a box "run in virtualenv" for each.

[question] Is it possible to set CLion toolchain based on conan profile?

We use conan profiles for compiling a project with different compilers. When using CLion together with conan-clion-plugin, I either have to set toolchain manually or have to set CC/CXX variables before starting CLion. This is inconvenient and I thought about how to improve this. Do you think it is possible for conan-clion-plugin to set the CLion Toolchain based on the profile data? How about the following:

  1. Developer selects profile in 'match profile' dialog.
  2. Developer clicks in install (triggering 'conan install'). Behind the scenes:
    i. plugin searches through dependency information created by 'conan install' and retrieves CC and CXX variables.
    ii. Plugin creates CLion toolchain configuration 'current conan toolchain' and sets compiler etc according to CC and CXX variables.

Arbitrary profile-file matching selector

When trying to match CMake and Conan profiles, it seems currently the plugin is only looking in ~/.conan/profiles, but I am also keeping some profiles local to my project that I want to select. If we can select an arbitrary file from the menu, this can be resolved.

Because of this issue, I haven't been able to really use the plugin yet, but I'm excited to give it a try when we have a solution!

As a side note, I don't think it should show me files stating with a ., as they are hidden files :)

image

Build, run, debug in Conan shell environment

It would be great to have CLion make use of the activate.bat generated by the virtualenv generator so tools like CMake itself, Ninja, Compilers, ... can be installed via Conan too. Maybe this is already possible somehow?

Could not find Conan client in Path

I am on pop_os 20.04 running the latest cLion, and conan 1.33.1

Conan runs from the Path in a console but I can't get past the error Could not find Conan client in path.

I also tried putting the Conan executable in the settings to /home/jeff/.local/bin/conan but I get the same problem.

Not sure what to do... :(

Consider upgrading Gradle version

There is a new version of the JDK which is used by JetBrains products 2019.2 and newer.

Upon trying to run Gradle targets for this project in IntelliJ 2019.2 using the new JDK 11, the following message is received:

Unable to start the daemon process.

The project uses Gradle 4.6 which is incompatible with Java 11 or newer.

Possible solution:
 - Upgrade Gradle wrapper to 4.8.1 version and re-import the project
 - Use Java 8 as Gradle JVM: Open Gradle settings 

We should consider whether there is a problem with simply upgrading the Gradle version.

Allow setting CONAN_USER_HOME for the run commands

Since we have the option to install configs with this plugin, and I don't want to pollute my global config with a bunch of installed configs from different projects (especially since conan config install actually composes some options by default).

The specified directory should be created if it doesn't exist for convenience.

Need to be able to do `--build missing`

I rely heavily on --build missing because our CI server doesn't have enough power to build every conceivable version of all of our packages every time we commit. I need the Conan plugin in CLion to be able to add --build missing and, when invoked with --update, also add --build outdated.

Editor hasn't been released when close project

CLion 2018.1.3 + Conan-0.1.3 plugin

  • open project
  • run Conan install
  • close project

result: exception

Editor of class com.intellij.openapi.editor.impl.EditorImpl hasn't been released:
com.intellij.openapi.util.TraceableDisposable.ObjectNotDisposedException: See stack trace responsible for creation of unreleased object below
at com.intellij.openapi.editor.impl.EditorImpl.(EditorImpl.java:147)
at com.intellij.openapi.editor.impl.EditorFactoryImpl.a(EditorFactoryImpl.java:207)
at com.intellij.openapi.editor.impl.EditorFactoryImpl.createViewer(EditorFactoryImpl.java:177)
at com.intellij.execution.impl.ConsoleViewUtil.setupConsoleEditor(ConsoleViewUtil.java:68)
at com.intellij.execution.impl.ConsoleViewImpl.doCreateConsoleEditor(ConsoleViewImpl.java:884)
at com.intellij.execution.impl.ConsoleViewImpl.d(ConsoleViewImpl.java:861)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:927)
at com.intellij.openapi.application.ReadAction.compute(ReadAction.java:47)
at com.intellij.execution.impl.ConsoleViewImpl.n(ConsoleViewImpl.java:860)
at com.intellij.execution.impl.ConsoleViewImpl.a(ConsoleViewImpl.java:436)
at com.intellij.execution.impl.ConsoleViewImpl.getComponent(ConsoleViewImpl.java:415)
at conan.ui.ConanToolWindow.createConanProfilesTabs(ConanToolWindow.java:81)
at conan.ui.ConanToolWindow.recreateContent(ConanToolWindow.java:61)
at conan.ui.profileMatching.ProfileMatcher.onOK(ProfileMatcher.java:77)
at conan.ui.profileMatching.ProfileMatcher.lambda$new$0(ProfileMatcher.java:46)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6548)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3325)
at java.awt.Component.processEvent(Component.java:6313)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4903)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.i(IdeEventQueue.java:786)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:723)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:109)
at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:190)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:235)
at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:233)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:233)
at java.awt.Dialog.show(Dialog.java:1077)
at java.awt.Component.show(Component.java:1685)
at java.awt.Component.setVisible(Component.java:1637)
at java.awt.Window.setVisible(Window.java:1014)
at java.awt.Dialog.setVisible(Dialog.java:998)
at conan.ui.profileMatching.ProfileMatcher.showDialog(ProfileMatcher.java:70)
at conan.actions.MatchProfilesAction.actionPerformed(MatchProfilesAction.java:21)
at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:220)
at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:237)
at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:208)
at com.intellij.openapi.actionSystem.impl.ActionButton.a(ActionButton.java:158)
at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:372)
at java.awt.Component.processEvent(Component.java:6313)
at java.awt.Container.processEvent(Container.java:2237)
at java.awt.Component.dispatchEventImpl(Component.java:4903)
at java.awt.Container.dispatchEventImpl(Container.java:2295)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4889)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4526)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4467)
at java.awt.Container.dispatchEventImpl(Container.java:2281)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4725)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:764)
at java.awt.EventQueue.access$500(EventQueue.java:98)
at java.awt.EventQueue$3.run(EventQueue.java:715)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:90)
at java.awt.EventQueue$4.run(EventQueue.java:737)
at java.awt.EventQueue$4.run(EventQueue.java:735)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:80)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:734)
at com.intellij.ide.IdeEventQueue.i(IdeEventQueue.java:786)
at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:723)
at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:395)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Better plugin information inside CLion

v1.1.2 shows the following:

image

We can format and add more information, like this one for protobuf: list of features, link to the issue tracker, release date, link to the full changelog...

image

plugin does not seem to propagate cppstd.

I am using compiler.cppstd, but when trying to build with the use of conan plugin, the cppstd=17 flag does not seem to propagate.

it works when i switch to console with same profile etc.
With verbose I can clearly see that the flag -std=c++17 is present in console but not in plugin run.

Could not find Conan client in path (but I specified it in config)

I installed the conan plugin on my mac today. I've used pip to install conan and it got installed under my home directory to Library/Python/3.6/bin/conan. I installed the plugin from within CLion. I specified the whole path in the preferences. I can see in the CLion log file that it gets picked up there:

2019-05-24 23:27:17,640 [ 12654] INFO - onan.commands.ConanCommandBase - Conan at:
/Users/jbj1/Library/Python/3.6/bin/conan

I can paste that into a terminal session and it indeed runs conan. But inside the CLion IDE none of the Conan stuff is working and it says "Could not find Conan client in path"

Publishing a forked version

Hello, I'm considering forking this with some experimental features and publishing it separately on the JetBrains repo for other people to try.

I'm asking if this is OK to do by you guys and legally as well.

Show command line in the console each time a command is invoked

Installing CMake profile Debug

PROJECT: Installing /home/david/Documents/DocsLink/Programming/RedLion/wsbu-libs/conanfile.py
Requirements
...
...

That amount of output doesn't help me debug the problem, it doesn't help me report issues that I'm having, and it doesn't help me learn Conan if I'm new to it. Please provide the full command being invoked at the top of the console, similar to how CLion prints the CMake line generating Makefiles:

/home/david/reusable/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/182.2371.31/bin/cmake/bin/cmake -DCMAKE_BUILD_TYPE=Debug -G "CodeBlocks - Unix Makefiles" /home/david/Documents/DocsLink/Programming/RedLion/wsbu-libs
-- The C compiler identification is GNU 7.3.0
-- The CXX compiler identification is GNU 7.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -
...
...

Add support for WSL

When I build projects on Windows using i.e. gcc on WSL, I am not able to match CMake and Conan profiles as the configuration from WSL is not read by the plugin and there is no way to provide a configuration name by hand.

Conan in CLion Remote Development

Hi there,

I have a conan based project and tried to work on it via CLions remote development. So far I did not see an obvious way how this works together with the conan plugin: I can see only how it works locally.
Is there a way to work around that with the current plugin? Do you have a any plans to make the plugin working with CLions remote development?

No profiles to match up

When I attempt to match profiles, I get this window:

image

I am likely doing something wrong, but I'm unsure what.

CI: We need end-to-end tests

It looks like we would need to wait until CLion 2019.3 (at least) to have some documentation (or some public API) that allows us to implement this kind of tests.

Add dependency with one click

If a header isn't found, or a piece of code has no import/include suggestion from clion, the plugin should try to find a package that matches the desired import or the namespace of the used code, and suggest to install any matching packages.

The matching would require some sort of database similar to current package managers on Linux where you can search for packages by files in packages themselves. This part sounds like it might be an enhancement for Conan itself.

The installation would have to:

  • Add the package to the conanfile requirements
  • Add the package's CMake target to the target the source file is in
    • This is different for cmake and eg. cmake_find_package where you need to call find_package first

Different parts of this enhancement could be implemented separately, eg. just offering one click install of a package from user's manual entry of a reference in the UI and then clicking a button.

Configurable package options for build configuration

As a consumer I want to be able to tweak my profiles with some options defined in my recipe. Currently to avoid discrepancy I have to duplicate profiles, specify said options, and match those with the build configurations I set up.

Using 'Install args' is insufficient because if build A needs -o some_option=True but build B needs -o some_option=False, I would need to edit them every time I switch between my build configurations.

Does not respect generation Path

In my case I'd like to use a build output directory where the cmake build folders e.g. cmake-build-debug are located.
So I set them in the Clion CMake settigs and CLion resprects them correctly and the output is generated within e.g. <project_root>/build/cmake-build-debug. That works like expected.

When hitting Install on the conan plugin this settings is not respected. Conan creates new folder in the project root and moves content into that directory rather then the configured configuration path.

support for exporting and uploading

Thank you for developing this plugin! It already made it into my workflow since it was published a few days ago.
It would be nice to be able to export the package to the local cache and maybe also upload it to a remote from within CLion.

Plugin v1.1.1 NullPointerException stacktrace

java.lang.NullPointerException
	at conan.ui.ConanToolWindow.cleanConsole(ConanToolWindow.java:160)
	at conan.actions.CleanConsole.actionPerformed(CleanConsole.java:24)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:261)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:278)
	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:183)
	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:147)
	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:415)
	at java.awt.Component.processEvent(Component.java:6315)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4899)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:739)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:729)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:674)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:373)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

NullPointerException on attempt to match profiles

version: 1.2.0
During the first 'conan install' it seems like it couldn't match Cmake and Conan profiles

java.lang.NullPointerException at conan.actions.ActionUtils.lambda$matchProfilesAndInstall$1(ActionUtils.java:63) at java.base/java.util.HashMap.forEach(HashMap.java:1336) at conan.actions.ActionUtils.matchProfilesAndInstall(ActionUtils.java:62) at conan.actions.ActionUtils.runInstall(ActionUtils.java:42) at conan.actions.InstallAction.actionPerformed(InstallAction.java:23) at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:266) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:283) at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAwareWithCallbacks(ActionUtil.java:257) at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:192) at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:155) at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:432) at java.desktop/java.awt.Component.processEvent(Component.java:6416) at java.desktop/java.awt.Container.processEvent(Container.java:2263) at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5026) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4918) at java.desktop/java.awt.LightweightDispatcher.processMouseEvent(Container.java:4547) at java.desktop/java.awt.LightweightDispatcher.dispatchEvent(Container.java:4488) at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2307) at java.desktop/java.awt.Window.dispatchEventImpl(Window.java:2773) at java.desktop/java.awt.Component.dispatchEvent(Component.java:4858) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:778) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:727) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:751) at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:749) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:748) at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:906) at com.intellij.ide.IdeEventQueue.dispatchMouseEvent(IdeEventQueue.java:844) at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:776) at com.intellij.ide.IdeEventQueue.lambda$dispatchEvent$8(IdeEventQueue.java:422) at com.intellij.openapi.progress.impl.CoreProgressManager.computePrioritized(CoreProgressManager.java:698) at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:421) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)

Automatic dependency download doesn't work in CLion 2019.1

I installed the plugin in CLion 2019.1.3 but the conan dependencies are not downloaded automatically before CMake is run, I have to manually click the install button.

After some investigation it seems the CMakeRunnerStep.Parameters has changed a bit, where getOutputDir() returns java.nio.file.Path instead of java.io.File.

Applying this patch made it work

--- a/src/main/java/conan/extensions/CMakeRunnerStepImpl.java
+++ b/src/main/java/conan/extensions/CMakeRunnerStepImpl.java
@@ -49,8 +49,8 @@ public class CMakeRunnerStepImpl implements CMakeRunnerStep {
     private CMakeProfile getCMakeProfile(@NotNull Project project, @NotNull CMakeRunnerStep.Parameters parameters) {
         CMakeWorkspace ws = CMakeWorkspace.getInstance(project);
         for (CMakeModelConfigurationData data : ws.getModelConfigurationData()) {
-            if (FileUtil.filesEqual(data.getGenerationDir(), parameters.getOutputDir())) {
-                return new CMakeProfile(data.getConfigName(), parameters.getOutputDir());
+            if (FileUtil.filesEqual(data.getGenerationDir(), parameters.getOutputDir().toFile())) {
+                return new CMakeProfile(data.getConfigName(), parameters.getOutputDir().toFile());
             }
         }
         return null;

Support workspaces since Conan version 1.13

Workspaces have a new, separate command for installing in 1.13.

This may require adding a setting to choose a workspace config file since it is an explicit argument to the workspace install command.

This might be impractical to implement at this time while the separate workspace command must be run from inside the install folder and has no install folder argument as an option.

It also might be worth waiting until (if) the workspace command is again merged into the base conan install command.

Add support for `cmake_find_package`

A Clion toolchain setting should be generated to match the compiler given by the conan profile.

The CMake profiles that have had a CMake/Conan profile match need their CMake profile copying. Modify the toolchain used by the CMake profile to the one we just generated to match the conan profile, then update the CMake options to add CMAKE_MODULE_PATH.

No idea if the plugin APIs even allow this but ATM I have to manually do the above.

[feature] Save Conan CLion settings external to workspace.xml

Currently the CLion Conan settings have 3 options:

  • Config install source
  • Install args
  • Conan executable

Only the config install source ends up in the CLion global configuration - if I go and open a different CLion project that is the only CLion Conan configuration option that carries over.

  1. Can the plugin be updated to include all 3 options in the CLion global configuration, please?
  2. Can the CMake-Conan Profile mapping somehow be saved in the global configuration context as well? (We have over 50 CLion/Conan/CMake projects that would benefit from having this all in the global configuration space as opposed to having to duplicate it for every project.)

Conan plugin's actions throw exceptions when conan executable isn't configured

  • install Conan plugin
  • click Install button
Details: [com.intellij.execution.configurations.GeneralCommandLine.createProcess(GeneralCommandLine.java:416), com.intellij.execution.process.OSProcessHandler.startProcess(OSProcessHandler.java:51), com.intellij.execution.process.OSProcessHandler.<init>(OSProcessHandler.java:44), conan.commands.task.SyncConanTask.run(SyncConanTask.java:44), com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:731), com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:442), com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164), com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586), com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532), com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86), com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151), com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:594), com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311), java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511), java.util.concurrent.FutureTask.run(FutureTask.java:266), java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149), java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624), java.lang.Thread.run(Thread.java:748)]

java.lang.Throwable: Cannot run program "conan" (in directory "C:\Users\Maria.Baburina\ClionProjects\untitled34"): CreateProcess error=2, The system cannot find the file specified
	at com.intellij.openapi.diagnostic.Logger.error(Logger.java:162)
	at conan.utils.Utils.log(Utils.java:38)
	at conan.commands.task.SyncConanTask.run(SyncConanTask.java:54)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:731)
	at com.intellij.openapi.progress.impl.CoreProgressManager$5.run(CoreProgressManager.java:442)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:164)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:586)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:532)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:86)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:151)
	at com.intellij.openapi.application.impl.ApplicationImpl.lambda$null$10(ApplicationImpl.java:594)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:311)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
  • click 'Clean console' action
java.lang.NullPointerException
	at conan.ui.ConanToolWindow.cleanConsole(ConanToolWindow.java:160)
	at conan.actions.CleanConsole.actionPerformed(CleanConsole.java:24)
	at com.intellij.openapi.actionSystem.ex.ActionUtil$1.run(ActionUtil.java:260)
	at com.intellij.openapi.actionSystem.ex.ActionUtil.performActionDumbAware(ActionUtil.java:277)
	at com.intellij.openapi.actionSystem.impl.ActionButton.actionPerformed(ActionButton.java:183)
	at com.intellij.openapi.actionSystem.impl.ActionButton.performAction(ActionButton.java:147)
	at com.intellij.openapi.actionSystem.impl.ActionButton.processMouseEvent(ActionButton.java:415)
	at java.awt.Component.processEvent(Component.java:6315)
	at java.awt.Container.processEvent(Container.java:2239)
	at java.awt.Component.dispatchEventImpl(Component.java:4899)
	at java.awt.Container.dispatchEventImpl(Container.java:2297)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
	at java.awt.Container.dispatchEventImpl(Container.java:2283)
	at java.awt.Window.dispatchEventImpl(Window.java:2746)
	at java.awt.Component.dispatchEvent(Component.java:4721)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:766)
	at java.awt.EventQueue.access$500(EventQueue.java:98)
	at java.awt.EventQueue$3.run(EventQueue.java:715)
	at java.awt.EventQueue$3.run(EventQueue.java:709)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
	at java.awt.EventQueue$4.run(EventQueue.java:739)
	at java.awt.EventQueue$4.run(EventQueue.java:737)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:736)
	at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:747)
	at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:692)
	at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:391)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.