how to use new build system using xcrun xcodebuild command

we use xcrun xcodebuild  in sh file to run builds on bamboo machines. recieving the error that swift packages are not supported in legacy build. How to use new build system using xcrun xcodebuild command