You could separate that into included build (or but more legacy buildSrc), put both classpath entries as implementation dependencies, add dummy plugin (or plugin that will apply your
com.mycompany.plugin1
via plugins block in a convention plugin) and apply it in the primary buildscript.