I have streams in perforce that are used to create software releases on several different platforms (macOS, iOS, Windows, and Android). Is there a way to specify that certain directories or file types don't need to be downloaded on specific platforms?
For example, we have several large windows libraries that contain several hundred megabytes worth of .lib, .dll, and .pdb files that are updated on a fairly regular basis. There's no reason for them to ever be downloaded on our Mac machines. However, combing through the directory tree and only grabbing the latest release of the directories that are needed for the platform is tedious and error prone, so we generally just grab the latest revision on the root directory.
We do have different workspaces for each machine, but since we are using streams it doesn't seem like we can exclude them in the workspace.
Create a virtual stream for each platform.
Suppose your main stream is //stream/main
and it contains the directories:
src
lib.win
lib.mac
and for your Mac build you just want src
and lib.mac
. Create a virtual stream like this:
p4 stream -t virtual -P //stream/main //stream/main_mac
and set it up to only include the Mac directories:
Stream: //stream/main_mac
Parent: //stream/main
Type: virtual
Paths:
share src/...
share lib.mac/...
Then switch your Mac workspaces to use the main_mac
stream instead of main
, and they won't see the lib.win
directory.
You could also specify the paths through exclusion, e.g.:
Stream: //stream/main_mac
Parent: //stream/main
Type: virtual
Paths:
share ...
exclude lib.win/...
A "virtual" stream maps directly through to its parent stream's depot paths, so working in a virtual stream doesn't mean you're working in a branch; any changes you make in main_mac
are submitted to the depot under the main
path and are instantly visible to people working in main
(or other virtual streams of main
).