I have got thousands of files/folders inside a solution. For some reason I have to exclude them all and then include again in the project, to get the latest list of files.
The normal "Exclude From Project" in visual studio menu takes too much time. Is there a quick way to do it?
Thanks!
Put them all into one master folder and include that folder.
If some are files, you may also want to compile them and include the DLLs or the equivalent in whatever language you're using.
Related
I have two android projects. One is the login and membership screen and the other is my main project. I did both separately, in case it would be okay to combine them later, but I realized that I made a big mistake. When I tried to combine the two, it started giving errors all the time and I couldn't do it. Gradle files were probably missing, but I'm very confused. Can anyone help me how to do it easily?
Error:(1, 0) Plugin with id 'kotlin-android-extensions' not found
There is currently no easy option to "combine" two projects like to merge them without exceptions. But you can do the following:
The easiest way to combine two projects is to take the smaller project and copy all the files in /java /layout /drawable to the other project.
Then I would look up all files in /values and copy the values if you changed them.
After that you should look at the Mainfest and see wether you made changes there and transfer them. This will make most of the errors not come up because you just copied all the classes.
If you get the error anyway then go to your gradle files (build.gradle for project and module and settings.gradle if you use android studio bumblebee or newer) and check if there is any plugin or line you have in one project and not in the other and then add that accordingly.
It's explained how to exclude a directory in Android Studio here. It also has a warning about not knowing how to include it back again. Now I need to do so.
Of-course I can create/import the project again. But I guess there's a better way of doing that. Is there? How?
As there is no "Mark directory as" menu in Android Studio, I found out that such settings like including and excluding directories are stored in a ".iml" file. Named like "project-name.iml".
A line like bellow is used to exclude a dir:
<excludeFolder url="file://$MODULE_DIR$/src/main/blah/blah/blah/" />
So, Re-including is done as easily as removing the line.
if you right click an excluded directory in the Project View, you can select from the context menu:
Mark directory as → Cancel exclusion
You must delete .iml file then try to sync and it will work fine
Following some links here I tried to rename a project. I went to c:\path\to\AndroidStudioProject and renamed the folder there, then found the .idea file and changed that. Now the project loads but java files are missing! However, on clicking java (in the bar at the top), then com I can see them each with a small red j.
I then looked in module Gradle build where there were 3 files, one with the new name and 2 older ones which stated that they did not belong so I deleted them, copying the compile info into the new one. Naturally on doing a Sync Now I get a bunch of errors.
Why does this have to be such a complex operation? Can anyone assist?
After you rename the folder, open the project in Android Studio. From there, right click something that needs to be renamed (e.g., module, package names, etc.) and use Refactor->Rename from the context menu. Keep doing this until everything that can be refactored is.
You will need to manually change the value of applicationId in the app-level build.gradle. Obviously, things like #string/app_name will also have to be changed manually. I recommend making these manual adjustments from inside Android Studio rather than directly editing the files. That way you'll know immediately if you break something.
I have a VS project, but I moved some source, resource files to another location.
It's not easy for me to readd all again (cause of filled properties tab for custom build tools, etc.)
Is there any easy GUI way to change the included source file path? In XCode it's easy to do this, but I don't see any way in Visual Studio (currently using 2012).
Do I have to rewrite the xml build file?
I have finally find it. Easiest way is to edit the xml file .vcxproj. I just have to manually find the paths (they are relative... i dont really know why Microsoft did this, it is so stupid) in that xml and edit it.
I'm porting a Linux C project in Visual Studio 2010.
I have the following folder project structure under linux:
ProjectName->Src->Source C files
ProjectName->Header->Source H files related to C
How should I configure Visual Studio 2010 to recreate the same structure without compile errors ?
How to create the include folder and tell to the the compiler that is an include folder.
I cannot even add include files (existing elements) in a simple folder. They simply don't appear as I add it.
On the C/C++ configuration tab is the Additional Include Directories option. Set it to the following:
$(ProjectDir)/Header
That should do it. Don't forget to do it for all your configs (debug, release, etc).
Oh, and regarding adding new header files, when you open the Add.. option to add a new file, pay close attention to the BOTTOM of the dialog. it will tell you where it will be placed, and you can change it there.