Exclude user_home directory from Header Search Paths list - cmake

Clion always tries to index my USER_HOME directory and it takes much time to complete. Deleting line <root url="file://$USER_HOME$" /> in project iml file give effect, but it continues while cmake project is not reloaded. When it happens something external change iml file back and return <root url="file://$USER_HOME$" /> line.
How to exclude this directory forewer? "Mark directory as" does not exist in popup menu. CLion 2016.2. Win10

Related

PhpStorm excluding folders from test source

I'm using PHPUnit to run tests in PhpStorm. The tests source folder has been set that when right clicking the folder, PhpStorm runs all the tests in that folder. However there is one folder of tests that I don't want to run when right clicking "run tests".
I've removed that folder from the testsuite in the phpunit.xml so that it doesn't run specific tests from the terminal, however they still run when right clicking on the folder.
Is there any way to exclude a folder from the test sources in PhpStorm or is it simply not possible?
If you don't need specific files, but you don't want to completely remove them, you can temporarily exclude these files from the project. Excluded files are ignored by code completion, navigation and inspections.
To exclude a file, you need to mark it as a plain text file. You can always return excluded files to their original state.
Right-click the necessary file in the directory tree of the
Project tool window.
Select Mark as Plain Text from the menu. Plain text files are
marked with the plain text icon icon in the directory tree.
To revert the changes, right-click the file and select Mark as from the menu.
Here is the source : https://www.jetbrains.com/help/idea/creating-and-managing-modules.html
Peace !

Packaging a Repast model as a jar file without including the source code?

I want to create a model jar file but not include the source code. Is it possible? The Repast model installer includes the source code by default, but I would like to hide it from the recipient of the model.
Yes, it’s possible but there is an important caveat. Compiled Java code distributed as binary files like jars can be trivially de-compiled back into the original source code with remarkable accuracy. If your goal is to protect proprietary source code then code obfuscation is required – see https://www.excelsior-usa.com/articles/java-obfuscators.html for more details. Code obfuscation is unfortunately a fairly complicated subject.
There are two ways to omit the project source code from the Repast model installer:
Method 1 – Remove /src elements from the model installer configuration files. This will instruct the model installer to omit /src files in the installer jar. The compiled agent classes will be in the usual project /bin folder.
In the /installer/installation_compnents.xml file, around line 156 comment the following:
<!--
<pack name="Sources" required="no">
<description>The model source code</description>
<file src="$StagingOptionalArea/src" targetdir="$INSTALL_PATH/Geography"/>
</pack>
-->
The “” denote the start and end of the code block that is commented. Next, in the /installer/installation_coordinator.xml file, comment around line 62:
<!-- Copy optional files to a separate directory -->
<copy todir="${StagingOptionalArea}" overwrite="true" failonerror="false">
<fileset dir="." casesensitive="no">
<!-- <include name="**/src/**" /> -->
<include name="**/docs/**" />
</fileset>
</copy>
Here you only want to comment the single line that copies the /src folder and not the /docs folder (although you can if you like). Now just build the model installer as usual.
Method 2 – export the /src folder to a jar file. This method does not require any changes to the default installer files as in the first method. However it requires deleting the source code after exporting it to a JAR file which means you would need to work on a copy of the project to preserve your source code. To export the model code to a JAR file, right click on the /src folder and select Export… -> Java -> JAR file. In the export dialog, make sure the src folder is checked in the “Select resources to export” box and then specify the JAR file name and location. The best place to export the jar file in in the project /lib folder. Most other options should be left as default. Make sure that “Export Java source files and resources” is unchecked, otherwise it will copy the source into the jar file. After the JAR files is generated and you verify that it exists in the /lib folder, then delete the contents of the /src folder but not the /src folder itself. This will permanently delete the model source code, so again please work on a copy of the project if you take this route. Simply renaming or deleting the /src folder will cause the installer to fail, so the delete is required for this method. Last, the user_path.xml file in the .rs folder needs to be updated to reflect the change in the source code location. Change the line to assuming that the exported model JAR file is in the /lib folder. All of the model code is now in the single JAR file in your project/lib folder. The /src and /bin folder should be empty at this point. build the model installer as usual. The option to install source code will still appear in the installer, but no source is contained in the installer JAR so no source will be copied upon installation.

WXS - How to modify installation directory to append extra folder to install directory in Wxs file

How to modify installation directory to append extra folder to install directory in Wxs file.
I am new to wxs file creation. Suppose my installation directory is **C:\Sample\Test** then I want to append one more directory path (example: **C:\Sample\Testz\data\install** ) to this location when we click on Next button on selecting installation directory. Any suggestion please.
You can use another property to fix it.
e.g.
<Property Id="AnotherDir" value="[FirstDir]\data\install" />

Folders missing in project pane in Webstorm

I've built a project in WebStorm and then submitted the project to GitHub.
When I rebooted the computer and relaunched WebStorm (and the project), all I can see in the project pane is the root files, and none of the folders (yes the folders are there)
See the image below for reference.
Does anyone know how I can get those folders to re-appear in the project pane of Webstorm?
It can be caused by the corrupted .idea/modules.xml project file. You can either try to fix it manually (restore from Local History, version control or backup) or create the new project from scratch.
Check this issue for the hints/workarounds.
It happens sometimes in WebStorm 9.
The easiest way to fix it for me:
close WebStorm;
in project's folder remove .idea/ (hidden directory);
open your project, enjoy:)
Solution:
Creating a new project from existing sources
File => New => Project
Select "Empty Project"
Browse to the location of your project with folder issues
Click "Create"
Select "Create from Existing Sources" in the "Directory Is Not Empty" dialog
Why this solution:
Editing and deleting in various combinations of .idea and XML files did not solve the issue for me. Hence the solution above. Back up your .idea directory in case you have project customizations you want to keep. This likely overwrites them.
Outcome:
All the various folders I had created were now visible and the project worked as expected. The .idea directory was now formatted correctly with all the necessary files.
Find the .idea/modules.xml in your project root
make sure that these lines are correct :
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/NameOfYourProject.iml" filepath="$PROJECT_DIR$/.idea/NameOfYourProject.iml" />
</modules>
Replace NameOfYourProject.iml with the name of your project.
Then, make sure that the file .idea/NameOfYourProject.iml exists, if not , create it and put this in it :
<?xml version="1.0" encoding="UTF-8"?>
<module type="WEB_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="PHP">
<CLASSES>
<root url="file://$MODULE_DIR$/../../php/PEAR" />
</CLASSES>
<SOURCES />
</library>
</orderEntry>
</component>
</module>
You do not need to delete whole .idea folder and reconfigure your whole project, just
delete the .idea/modules.xml
restart the IDE and your folders are there again!
I ran into the same issue and resolved it by invalidating the cache.
The option is under File > Invalidate Caches/Restart.
On the prompt click Invalidate and restart.
Note: The project in concern needs to be open before you do this.
I see this from time to time. I use Git, and I have my .gitignore file set up as recommended, specifically:
.idea/workspace.xml
.idea/tasks.xml
.idea/*.iml
I sometimes see this after cloning the repository, and when trying to figure out why, I came across this post and read the accepted answer.
I deleted the modules.xml file and reopened WebStorm (2016.2.4), and it was resolved. I looked at the new modules.xml and found that its contents were exactly the same as before, but my <projectName>.iml file was bigger.
So it seems to be a corruption in the .iml file, not modules.xml. I assume that deleting modules.xml triggers a rebuild of the .iml file. Not sure if this helps anyone with anything, but thought I would offer the extra insight.
floor 36 solve my problem. in WebStrorm 11
It happens sometimes in WebStorm 9. The easiest way to fix it for me:
close WebStorm;
in project's folder remove .idea/ (hidden directory);
open your project, enjoy:)
Try deleting workspace.xml and watchertask.xml then just restart the IDE. You must see your full source code in all folders there.
Finally I found the culprit, it was Team Foundation Server - Version Control Integration plugin from https://plugins.jetbrains.com/plugin/7961-team-foundation-server--version-control-integration/
I looked at the system/log/idea.log file and found that this plugin was producing Null exception whenever I open a new folder as a new project and breaks the content root auto detection by the IDE, and after I uninstalled this plugin, all folders show up as it should.
You might have this issue because of a culprit plugin, and disabling those which you have just installed recently just before this issue occurs, will resolve the issue. Check the log file and search for ERROR.
If it is found to be an important plugin you are actively using which you are not willing to disable, then a temporary fix is to open Settings->Directories and click Add content root button to add the root folder of your project, click Ok now folders will show up and indexing will begin, and of course you have to do this everytime you open a new folder as new project.

Disable intellij indexing on specific folder

In my project I have .deploy folder which is created/updated when I deploy my app locally. Is it possible to disable indexing on that folder? Everything slows down whenever I deploy and it's really annoying - I have to wait a few minutes whilist intellij doing unnecessary indexing. In module view I excluded that folder but it's not helping. Any help would be appreciated.
Mark this folder as Excluded in the File | Project Structure | Modules | Sources tab.
Edit: also make sure it's not added as a library in the project.
On IntelliJ 13+ (don't know for earlier versions), you can right click on a folder > Mark Directory As > Excluded.
if you cannot do it throu the Modules menu because your intellij freezes (like in my case) edit .iml file of your projet and add excludeFolder line as below:
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/features" type="java-test-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/node_modules" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
The option is now called Stop/Start Index, available from the folder context menu in solution explorer. When index is stopped, the folder will appear with "no index" annotation on the right.
I excluded the build output folder and no longer getting lengthy index refreshes after each build. Also full text search is a lot faster (near instant).
After applying the Mark As > Excluded method to a folder you still might see unwanted results.
You have to explicitly mark sub-folders as well to disable certain functionalities for sub-folders.
indexing, find usages etc.
Sometimes it is not possible to mark the folder as excluded. It happens with direct node dependencies.
For that, it's a bit extreme but you can add it to Editor-> File types -> ignored file types and folders. It won't be indexed at all. It won't be shown in the project either