Taiwan’s outgoing president says boosting her country’s military was the only way to defy China’s threat.