configurations { python { canBeResolved = true canBeConsumed = false } } dependencies { python project(path: ':protobuf', configuration: 'python') } task copyPythonCode(type: Copy, dependsOn: configurations.python){ // Copy python protobuf code from proto project. from zipTree(configurations.python.asPath) into 'src' } task build(type: Exec, dependsOn: copyPythonCode) { commandLine 'python3', 'setup.py', 'bdist_wheel' } task clean { doLast { delete 'dist' delete 'build' } }