Is there a way to access passwords from the Mac OS X keychain to be used in a build?

We currently store some unencrypted passwords in ~/.gradle/gradle.properties, which is not very secure. Is there a better way to manage these on developer machines?