Accurev Externals? - svn-externals

Does Accurev have a feature like SubVersions 'svn:externals'? This works like a symbolic link to another area of the repository.
Example: In my subversion test automation projects I had my shared libraries defined as a 'svn:externals' within each test project. This made it easy to work with relative paths as everything needed appeared to be a child of the top project folder. I have attempted to show this below.
Shared_Libraries (the real one)
Project_1
-> Project_specific_code
-> Shared_Libraries (external reference)
Project_2
-> Project_specific_code
-> Shared_Libraries (external reference)
Thanks
Glenn

AccuRev supports both traditional symbolic links (for the linux/unix world) as well as our own element links (elinks). My guess is that if you're not on *nix, you could easily use element links to create references to those shared libraries at the correct folder level for what you need...
Check out our documentation on element links (elinks) for how to implement.
Regards,
~James

Related

IntelliJ IDEA: how to restrict project tree view to a couple of folders

I'm working with IntelliJ IDEA in a rather large tree of projects almost exclusively on about 5 folders nested deeply in the hierarchy. Ideally I just want to see those 5 folders most of the time - the other projects and the other folders in their projects are usually just visual clutter. How can I get a view as close as possible to this with IDEA?
I do want all projects accessible in my workspace, so I can't just throw away the others. And even that would not help too much, because those folders are deeply nested in their projects. The favorites view almost does what I want, since you can unfold the folders there - but if there are some new files they are often not visible there (not sure whether this is a bug or a feature). Do you have other ideas? Thank you very much!
It depends on what you are trying to do. You can create scopes by criteria.
Go to preferences (mac) -> appearance & behavior -> scopes
There you can create local and shared scopes. You can manually edit these or use a regex pattern. The current reference documentation is located here.
Here are some examples from the jetbrains website of using regex.
file[MyMod]:src/main/java/com/example/my_package//* - include in a project all the files from module "MyMod", located in the specified directory and all subdirectories.
src[MyMod]:com.example.my_package..* - recursively include all classes in a package in the source directories of the module.
lib:com.company..*||com.company..* - recursively include all classes in a package from both project and libraries.
test:com.company.* - include all test classes in a package, but not in subpackages.
[MyMod]:com.company.util.* - include all classes and test classes in the package of the specified module.
file:*.js||file:*.coffee - include all JavaScript and CoffeeScript files.
file:*js&&!file:*.min.* - include all JavaScript files except those that were generated through minification, which is indicated by the min extension.

Intellij - Find path to src directory

I am creating an IntelliJ plugin and I am using JavaParser for one of my features. My plugin will allow users to click a gutter icon next to a method and automatically navigate to the tests associated with that method.
To achieve this, temporerily I have used the line:
typeSolver.add(new JavaParserTypeSolver(new File("/home/webby/IdeaProjects/project00/src/")));
My problem is that I need to pass the source folder of the given module into this type solver. Is there any way I can find the source folder programmatically? Perhaps from an actionEvent?
I have tried things along the lines of the following:
actionEvent.getData(PlatformDataKeys.PROJECT).getBasePath()
This gives me: '/home/webby/IdeaProjects/project00/' but I'm struggling to see how I can get the source folder? I feel there should be a fairly straight forward way of doing this using IntelliJ's SDK but I have not found anything in the documentation or anywhere else online.
Any and all solutions welcome!
Many Thanks,
James
You can use
ModuleRootManager.getInstance(module).getSourceRoots()
to access sources roots of a module. Refer to IntelliJ SDK Docs for details.
BTW IntelliJ IDEA provides special API to syntax trees of Java files, it works more efficiently and better integrates with other IDE features than external JavaParsers.
And it's better to ask questions about IntelliJ IDEA API on a special forum.

In JetBrains tools, how can I share IDE and project settings between multiple developers?

I love the JetBrains tools. But, I can't find a way to effectively share settings at the IDE level and the project level with team members. To date, I've followed instructions provided by an article on the JetBrains site, titled "How to manage projects under Version Control Systems". But, many comments on the article warn against implementing it as a method for sharing project settings. And I've run into a few issue with the method, namely not everything I'd like to be shared, is actually shared with team members.
I've also tried using the function found under the File->Settings Repository menu of the JetBrains tools. It shares some settings between users, and I like that it automatically creates commits to the Git repo, but it doesn't share all the settings. The settings that are shared work great! But, it seems like the "Settings Repository" feature is a work in progress.
I've read many discussions on this topic, but no definitive answer on a way to share IDE level settings and, at the same time, project specific settings when using the JetBrains tools. Not to mention, I use a multiple JetBrains tools (PhpStorm, PyCharm, WebStorm and IntelliJ). I'd like it if there were a solution that also shared settings between all the tools, because some settings are global across all JetBrains tools, some are specific to a particular tool, and some are specific to a project.
Sharing settings between JetBrains tools is more of a "nice to have". What I really need to know is, how can I share global IDE settings and project level settings easily between team members. But, I'll give mad respect points to anyone who can figure out both. :-)
I finally found a few minutes to write up an answer to this. I want to write up a more complete answer, but I've been incredibly busy lately so this will have to do for now.
This solution describes what I've been using to share code and settings of PyCharm projects. There is one caveat to this solution, which I'll attempt to describe and detail a work-around for.
Following the instructions on JetBrain's knowledge-base, we'll add the entire project folder to a Git repo. But, before doing so, be sure to exclude at least the workspace.xml file by creating a .gitignore file in the project directory and add at least the following line:
.idea/workspace.xml
# JetBrains also recommends adding tasks.xml, but I found it useful to
# share tasks with team members.
# Uncomment the following line to avoid sharing tasks with team members
# .idea/tasks.xml
You'll definitely want to add workspace.xml to .gitignore because it stores all of your local window sizes, debug panel layouts and the like. My team found it useful to syncronize our tasks, so that we could coordinate work. But, every team works differently, so use your own discretion.
There are three main locations project and personal preferences are stored:
<project_directory>/.idea contains project specific settings.
$HOME/.PyCharmYYYY.M/config contains options for all projects managed by PyCharm (or substitue "PyCharm" for any other JetBrains tool).
If you use the shared settings found in File->Settings Repository, $HOME/.PyCharmYYY.M/config will contain all of the settings shared via JetBrain's built in "shared settings" function. I and my team didn't care for it, because it seemed to automatically share some things we didn't want to (like the color theme, and key mappings). And we weren't able to select a sub-set of options to share team-wide. Long story short, it didn't give us the flexibility and control we need.
We did try using options 1 and 3 at the same time, but it was too unwieldy. For example, one person would change a font, and it would change it for the whole team the next time we re-launched JetBrains. It was a mess. If you do decide to try out using options 1 and 3, I recommend proceeding with extreme caution.
Presently, we are using only option 1, and it's working out quite nicely.
A few other notable folders you might want to add or remove from the .gitignore file are:
<project_folder>/.idea/runConfigurations/ contains all of your debug and run configurations used to run nose tests and debug into your code.
<project_folder>/.idea/scopes/ contains all of the scopes used to filter your view of the project files, into more management groupings.
$HOME/.PyCharmYYYY.M/options contains all of the global options for version of PyCharm you're using. For example, the color scheme, key mappings and any other non-project specific options. For a full list of other global settings, see this JetBrains article, or the following excerpt:

How does Find Usages choose which modules it searches?

My project was created from an maven project, with additional external maven modules added as I discovered that it was useful to have other source files at hand.
The source for interface X lives in module-library. If I navigate to the source file, highlight the X.execute() signature, and then invoke Find Usages (Project Files), a get a list of the usages in module-library.
The source for the application Y lives in module-app. If I navigate to the source file, find a place where X.execute is invoked, highlight that usage, and then invoke Find Usages (Project Files), I get a list that includes usages in module-app, and also the usages in module-library.
Shouldn't these be the same? Does the fact that they are different imply that I've somehow screwed up the creation/configuration of my project?
It looks like a bug, I've reported it in YouTrack. Please login to the tracker and provide more details (like your IDEA version/build number). Sample project to reproduce this problem would help a lot.
You can also check if File | Invalidate caches helps.

Xcode search paths for public headers in dependencies

I am trying to clean up some of my projects, and one of the things that are puzzling me is how to deal with header files in static libraries that I have added as "project dependencies" (by adding the project file itself). The basic structure is like this:
MyProject.xcodeproj
Contrib
thirdPartyLibrary.xcodeproj
Classes
MyClass1.h
MyClass1.m
...
Now, the dependencies are all set up and built correctly, but how can I specify the public headers for "thirdPartyLibrary.xcodeproj" so that they are on the search path when building MyProject.xcodeproj. Right now, I have hard-coded the include directory in the thirdPartyLibrary.xcodeproj, but obviously this is clumsy and non-portable. I assume that, since the headers are public and already built to some temporary location in ~/Library (where the .a file goes as well), there is a neat way to reference this directory. Only.. how? An hour of Googling turned up blank, so any help is greatly appreciated!
If I understand correctly, I believe you want to add a path containing $(BUILT_PRODUCTS_DIR) to the HEADER_SEARCH_PATHS in your projects build settings.
As an example, I took an existing iOS project which contains a static library, which is included just in the way you describe, and set the libraries header files to public. I also noted that the PUBLIC_HEADERS_FOLDER_PATH for this project was set to "/usr/local/include" and these files are copied to $(BUILT_PRODUCTS_DIR)/usr/local/include when the parent project builds the dependent project. So, the solution was to add $(BUILT_PRODUCTS_DIR)/usr/local/include to HEADER_SEARCH_PATHS in my project's build settings.
HEADER_SEARCH_PATHS = $(BUILT_PRODUCTS_DIR)/usr/local/include
Your situation may be slightly different but the exact path your looking for can probably be found in Xcode's build settings. Also you may find it helpful to add a Run Script build phase to your target and note the values of various settings at build time with something like:
echo "BUILT_PRODUCTS_DIR " $BUILT_PRODUCTS_DIR
echo "HEADER_SEARCH_PATHS " $HEADER_SEARCH_PATHS
echo "PUBLIC_HEADERS_FOLDER_PATH " $PUBLIC_HEADERS_FOLDER_PATH
.
.
.
etc.
I think that your solution is sufficient and a generally accepted one. One alternative would be to have all header files located under an umbrella directory that can describe the interface to using the depended-on libraries and put that in your include path. I see this as being similar to /usr/include. Another alternative that I have never personally tried, but I think would work would be to create references to all the headers of thirdPartyLibrary from MyProject so that they appear to be members of the MyProject. You would do this by dragging them from some location into MyProject, and then deselecting the checkbox that says to copy them into the project's top level directory. From one perspective this seems feasible to me because it is as if you are explicitly declaring that your project depends on those specific classes, but it is not directly responsible for compiling them.
One of the things to be wary of when addressing this issue is depending on implementation-specific details of Xcode for locating libraries automatically. Doing so may seem innocuous in the meantime but the workflows that it uses to build projects are subject to change with updates and could potentially break your project in subtle and confusing ways. If they are not well-defined in some documentation, I would take any effect as being coincidental and not worth leveraging in your project when you can enforce the desired behavior by some other means. In the end, you may have to define a convention that you follow or find one that you adopt from someone else. By doing so, you can rest assured that if your solution is documented and reproducible, any developer (including yourself in the future) can pick it up and proceed without tripping over it, and that it will stand the testament of time.
The way we do it is to go into build target settings for the main project and add:
User Header Search Path = "Contrib"
and check that it searches recursively. We don't see performance problems with searching recursively even with many (10-15 in some projects) dependencies.