Trapping them in a building never worked for me. Even when not aggro i could not feed it. If taming in the desert use a flying combat mount. Use bug spray on the mount and yourself so you can land,dismount,feed and fly off clearing nearby dinos until next feed. This stops it aggroing on your mount and helps you avoid chasing it around on foot losing food/water

More Mantis Taming & KO Tips