Using ant basics:
http://developer.android.com/tools/projects/projects-cmdline...
http://developer.android.com/tools/building/index.html
And using the Android SDK Manager to manage packages (this assumes that the 3rd party libraries you are using are well-admined enough to have a proper Android SDK Manager add-on site, which many popular libs do have):
http://developer.android.com/sdk/exploring.html (Scroll down to 'Adding New Sites')