How can I create recurring hierarchical files and directories? - android-studio

I have to recursively create files and directories in the projects I develop. For example, if I'm using the MVVM architecture, I'm constantly creating directories like view, model, model_view for a component in project structure.
Naturally, my question is, does android studio include a feature for these repetitive directory and file operations?
If so, what is the name of this feature?
How can I create this hierarchy more rationally in android studio?;
component_name/
model
/params.dart
view
/view.dart
view_model
/view_model.dart
I searched this question on the internet, but I could not reach the result I was looking for from the results related to android, so I apologize if this question has been asked before.

Related

Find all classes involved in a method call

I have a .NET 4.0 C# Solution with a single .csproj (Library) having several thousand files.
I want to extract out a small subset of the functionality from the thousands of files.
e.g. I want to extract the functionality of the MyLibrary.RelevantMethod() method into another library.
The aim is to create a new .csproj with the bare minimum class files needed to achieve this functionality.
i have a Program.cs which invokes the functionality and i can navigate through the flow to find all classes involved. Just that there are too many. (still a small subset of all classes)
Solutions tried:
the usual brute force of going through the flow from the method (F12) and copying over every class file and associated files needed for it to compile. this is taking a lot of time, but i know that if i keep at it, it'll be done. so that is what i am doing right now.
other option was to copy over the whole project and eliminate folders of classes based on instinct/name space references, build to verify and keep at it. this got nasty because a subset of classes in a folder were needed.
the vs 2013 code-map graphs became unmanageable in 3 drill downs. sequence diagrams became too complex as well.
Call hierarchy seemed to be the most promising showing all the classes involved visually but there is still the manual task of drilling through and copying the classes.
while i manually continue extracting the class one-by-one using the call hierarchy, is there a faster way or a more automated way (semi works as well) to determine all the classes involved in a method call in C#?
if i can get the list, i can do a search on the physical folders nesting the .cs. files (every class has an equivalent .cs file) and just copy them over.
You can find all classes involved in a method call with the Runtime Flow tool (developed by me). From the Runtime Summary window you can also copy these classes to the Clipboard for the selected module or a namespace.

Haskell coding via Emacs/Vim in Linux : organising files into projects

I have two questions regarding coding Haskell in Emacs/VIM in Linux :
If one wanted to organise a haskell code base into multiple projects (where files of a given project are stored in a particular folder) then can emacs and vim handle this? The reason is that I have used IDE's before where all the projects are loaded at once into the session, but am not sure how this would work for Emacs/VIM.
Another nice thing about IDEs is that I can go the definition of a function from a given project, even if that function definition is in a separate project (i.e. stored in a separate folder). Can Emacs/VIM handle this?
There was some discussion here : Haskell IDE for Windows?
VIM/Emacs don't care how you organize your files. They're primarily editors, so you can use them to edit files no matter how you lay out your directory structure. Other than that, it's good to follow some standard conventions, or adapt the structure for tools you are going to use. You can have a look at Structure of a Haskell project. It is also convenient to use Cabal to build your project and to manage its dependencies.
VIM/Emacs can use Ctags index files for navigating in your project. See Tags for available options how to create these index files. The indexing tools don't expect any specific project structure, so if you need to navigate in multiple projects, you can just index a directory with multiple projects into one index file.
There's an Emacs mode called Projectile that allows some "project-like" functionality, which might be what you're looking for. I haven't really used it myself (I tend to stick to the old *nix way of just editing files), so I can't give you details, but it can't hurt to check it out.
Not sure if I understood the gist of question correctly. The following is my suggestion concerning the question of management of multiple projects in Vim, without regard to the language employed.
You could take advantage of vim sessions. With a few custom functions/keymappings in your .vimrc you'll be able to keep a separate session file for each project, either in the project directory or the one you'd dedicate for session files.
This is the general how-to: http://vim.runpaint.org/editing/managing-sessions/
And there you'll find a number of scripts that specifically address the issue of handling multiple project-specific sessions: How to auto save vim session on quit and auto reload on start including split window state?

Allow multiple directory trees to be layered on top of each other. Is this possible?

Ok, this question requires some background. I have an apache webserver that will host a development testing site that contains a foundation directory tree- a set of folders and files.
On top of this foundation directory tree i would like another partial directory tree "layered" on top. if a file is not found in the top layer, then I want the file in the foundation layer to be looked up instead.
For my project i would need 4 partial directory trees layered on top of each other, all behaving the same way: if the file in not found in the top layer, it will look for it in the layer underneath, and if it's not there it will go to the next layer underneath that one, until it reaches the base layer.
I've been trying to hypothesize a solution for this problem and i've come up with two: either with a linux filesystem, and somehow linking directories with this proposed behavior, or possibly through the apache webserver, somehow telling apache to search for a file in a different folder if it doesn't exist- perhaps in the httpd.conf file somewhere or a custom module.
Ideally some kind of linux filesystem special folder link would be the best solution, where the folder can link to a different folder but also be able to contain folders and files within it?
Ok that's my sound like a lot of crazy, but the reason i would like this system setup is so that i can use Git branches accessible through a url. Each Git repository branch would have their own modified files in their own directory tree's and have a foundation layer of files (say the master Git branch) underneath. This way i could navigate to a url and access different branches eg: branch1.newsite.com branch2.newsite.com etc.
I've put a lot of thought into this and have a near working model except for this one last caveat of layering directory trees on top of each other. Any help or thoughts are appreciated.
Maybe you're looking for this:
http://en.wikipedia.org/wiki/UnionFS
"[Unionfs] allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system."

Converting Makefiles to MsBuild

I would like to know if there is good practices, good tools to move a bunch of windows makefile projects to some msbuid (VS 2010) format?
If you think that' not a good idea to make it using a tool, maybe you do know something like a dependency analyser to make a checklist?
Having recently converted a legacy "make" based build to MSBuild, I'd have to say that there is no real easy way. Granted, the legacy build I was working on was actually calling msbuild to build .sln (I believe that the build engineer that put the other process in place was Old-Skool, and was using the toolset that best suited him, rather than .Net).
However, what I noticed was that the make (specifically nmake.exe/build.exe) tools were directory based - subdirs were "built" before parent dirs. Whereas that is not the case for msbuild - it's solution and project based.
Get your code into Visual Studio projects, living in a "flat" directory structure (having all projects as children of a single "Source" folder will really make your life easier in the long run - don't have projects that live several dirs "down the tree"
Use multiple solutions to break the build into "tiers" - order the build of the slns into a helper .bat file - this will help you in the long term to convert to TeamBuild
(my answer started to get out of control - your question reminds me of that joke with the American visiting Ireland who gets lost, and he asks a local "how do you get to Kilarney?", and the local replies "well, I wouldn't start from here".. Can you give a bit more detail about what you are actually buiding? Is it .Net code? I'm sure there is countless advice I and others could give you, but don't know what you are working with)

VC++ merge multiple COM DLLs into one

Let's say we have multiple libraries (DLLs) whose features one wants to use in an application, and wants to use them as a single DLL.
Is it possible to merge the DLLs into a single one, with all the features packed into it? I am not looking at the option to write a wrapper.
EDIT:
I've revisited the problem. Now all I want to do is bring all the projects under one solution and get a single DLL as the output instead of each project having it's independant output. Is this possible?
You can't literally merge several compiled .dll files into one. Your best bet is to put all files into a single project and recompile as a single library. You will likely have conflicts you'll have to resolve manually.
If you really have several COM in-proc servers you will also have to merge the data that facilitates class factories and COM registration - you will have to do that manually.

Resources