prj.properties
build_name = my_prj
build.gradle
def pFile = file("prj.properties")loadProperties = { Properties p = new Properties() pFile.withInputStream { stream-> p.load(stream) } println p.build_name}task hello << { loadProperties()}
运行
gradle hello