Gradle lib template override

Is there way to override Unity gradle template for specific library? For example I have mopub plugin, which needs declaration of google play services in build.gradle file just for this library. Of course, I can override “libTemplate.gradle”, but it will affect all ilbraries in project.

1 Like

Gradle support seems to be yet another half-assed feature in Unity.

Correct me if you have a better solution, but you can just add build.gradle for specific lib, but not a template. You have to set tool versions etc manually.

Alternatively, add condittional dependency into libTemplate.gradle. It seems you can’t copy this template into a project, so all your projects will use it.

We just append gradle settings the build.gradle file during the postprocess, it appeared to be easier than struggling with the template system.