Gradle: use method instead of deprecated dynamic property