[build] Port build system to Gradle