Enable the globstar Bash shell option: shopt -s globstar
Now change directory into B and run:
for ipath in **/; do
[ -d "<A-dir>/$i"$path" ] && cp "$i-n "$path/"*.build "<A-dir>/$i"$path"
done
This will recursively check each subdirectory in B and see if there is an equivalent subdirectory in A. If there is then it will copy all .build files from the B subdirectory over to A.