CLion remote development - how to sync vcpkg packages? - cmake

I have a cmake project that uses vcpkg (I added vcpkg as a submodule under my repo and configured CMAKE_TOOLCHAIN_FILE to point to the vcpkg.cmake).
Now I configured CLion to connect over ssh and build remotely on a different machine, but I am not sure how I can go about telling it to sync my vcpkg folder which is outside of the CMAKE_SOURCE_DIR.
I tried also to put the vcpkg submodule in CMAKE_SOURCE_DIR (even though I would like to keep it separate) and this works, it gets synced.
I was thinking also if there is some way to control where CLion does the sync on the remote machine and I could just put vcpkg there myself (relative to the sync path) and install the needed packages, but I did not find this option either.

OK, I found how to set the remote for my ssh connection path:
File | Settings | Build, Execution, Deployment | Deployment
So I can go myself on the remote machine, clone vcpkg relatively to the Deployment path and install all packages.
This works well enough, I just need to make remember to install any new packages in both places.
EDIT:
I found also a completely automated solution:
From the same CLion Deployment settings, I can actually add multiple mappings so I can add an extra folder sync for my out of source vcpkg.
At the end, I am thinking that it will be a waste for CLion to keep the whole vcpkg with all the installed packages automatically in sync when I can just sync it myself once in a blue moon when I install a new package.
I am not sure how expensive it would be for CLion to monitor such a big folder.

Related

How to reference npm project locally?

I am using npm, yarn build as manager tool. Using these tech, create two project , CommonLib and SampleProject. so first I build CommonLib project, release its library and publish it to AWS codeartifact then ref that published artifact to SampleProject.
This flow looks fine and works well as well. But this whole process force us to publish our changes to artifact which block other.
So not think to do change locally in IDE (here is mscode), release it locally and then ref it to SampleProject.
I used npm install ../CommonLib command to install the package and IDE start point to locally project. But it doesn't compile the project.
Can anyone help me on this, what could be wrong here.

Clion Remote - Is it possible to create a Remote Toolchain and apply it to a Project?

I am following the Clion Blog article: Stay Local, let your IDE do remote work for you
Under the heading, "How to configure a remote project in Clion?" I'm told: first of all go to settings/preferences / Build, Execution, Deployment / Toolchains: Create a new Toolchain
So, I'm guessing the author is suggesting that 'first' I can go to the toolchains dialog and create a 'remote toolchain' with ssh settings and so forth.
However, Clion does not seem to enable access to the Toolchains configuration unless I already have a project.
So is this a problem of my expectations for accurate precision being too high, or is there actually a way to create a toolchain configuration without first creating a project to associate the toolchain configuration with?
Also, after creating a toolchain configuration associated with a project, how can I associate that toolchain with other projects, as other areas of the bloc seem to say is possible?
Thanks,
Stato Machino
However, Clion does not seem to enable access to the Toolchains configuration unless I already have a project.
Hi Stato. You can configure your toolchain from Welcome screen or on IDE first running without opening any project.
Also, after creating a toolchain configuration associated with a project, how can I associate that toolchain with other projects, as other areas of the bloc seem to say is possible?
When you create CMake project or opening existing one CLion creates new profile with Default toolchain. Default is just a first toolchain in the list. So simply moving Remote toolchain to the top in Preferences | Build, Execution, Deployment | Toolchains will automatically switch all your project to remote mode.

How to stop git update and clear git cache in Windows

I want to stop egit from updating the repository with modifications I make to an app, which I downloaded from git. I found out that I have to update .gitignore file. I did that. But then I read that I have to clear the git cache also. But all the procedures I find are for the linux setup of Eclipse. I don't find any information on how to do this in the Windows environment. On Linux setup, you can issue "git rm -r --cached [filename]", and that stops git from updating the repository with changes to the file. But I can not find the git or egit executable in my setup. I am running Eclipse from the Android bundle setup. This is a zip file that you can download from Android developer site, and it has Eclipse along with Android Development Environment. I am running this on a Windows 7 machine. I think egit is the Eclipse addon for git? Is that right?
I found this link: Eclipse Git Tutorial But it did not help me.

How to install a jar file from target to a specific location using maven?

Currently I have a simple maven project that is building a jar file and putting it inside target/some-1.0.jar when i run mvn install.
I want to copy this file to another location when I run mvn deploy.
Currently the location is on the same machine, but it would also be great if the solution could be applied for multiple targets, some of them being on other machines (scp deployment).
What is the easiest solution to do this? I would be nice, if you could include an example too.
Details: I have few jira plugins that are compiled as jar files and I just want to be able to run a single maven command that would copy the files to the server and eventually restart the server.
mvn deploy is intended for deployment to a remote Maven repository. mvn install is used for copying to the local Maven repo (so actually, the jar is also ending up in $HOME/.m2/repository, as well as target).
I'm not sure what you're intending to do, but I suggest you look at deploying something like http://www.sonatype.org/nexus/ if you want Maven artifacts to be available to multiple machines. This will integrate nicely with the rest of Maven.
Edit: based on your updated question, it's probably best to investigate the Wagon ssh plugin, or see if there's an Ant plugin. A suitable phase would be pre-integration-test: install and deploy should be run after you've run your integration tests to check the artefact works as expected. Use profiles to distinguish the local vs. remote cases.

What is the difference between "mvn deploy" to a local repo and "mvn install"?

My team uses an internal team maven repo that is shared from a development server using Apache. We also run the Continuum CI server on the same machine. Maven builds in Continuum are run with the "install" goal, which copies the final artifact directly into the shared directory.
The question is, what is the difference between adding files to the shared repo using mvn install and using the deploy goal (mvn-deploy plugin)?
It seems to me that using mvn deploy creates additional configuration hassles, but I have read somewhere that installing files into a shared repo is a bad idea for some reason related to the internal workings of maven.
update: I get the functional differences between deploy and install; I am actually more interested in the low level details in terms of what files are created in the maven repo.
Ken, good question. I should be more explicit in the The Definitive Guide about the difference. "install" and "deploy" serve two different purposes in a build. "install" refers to the process of installing an artifact in your local repository. "deploy" refers to the process of deploying an artifact to a remote repository.
Example:
When I run a large multi-module project on a my machine, I'm going to usually run "mvn install". This is going to install all of the generated binary software artifacts (usually JARs) in my local repository. Then when I build individual modules in the build, Maven is going to retrieve the dependencies from the local repository.
When it comes time to deploy snapshots or releases, I'm going to run "mvn deploy". Running this is going to attempt to deploy the files to a remote repository or server. Usually I'm going to be deploying to a repository manager such as Nexus
It is true that running "deploy" is going to require some extra configuration, you are going to have to supply a distributionManagement section in your POM.
From the Maven docs, sounds like it's just a difference in which repository you install the package into:
install - install the package into the local repository, for use as a dependency in other projects locally
deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
Maybe there is some confusion in that "install" to the CI server installs it to it's local repository, which then you as a user are sharing?
"matt b" has it right, but to be specific, the "install" goal copies your built target to the local repository on your file system; useful for small changes across projects not currently meant for the full group.
The "deploy" goal uploads it to your shared repository for when your work is finished, and then can be shared by other people who require it for their project.
In your case, it seems that "install" is used to make the management of the deployment easier since CI's local repo is the shared repo. If CI was on another box, it would have to use the "deploy" goal.