Build standalone plugin without "uploadArchives" in plugin folder and use it in root project build script

Hello! I had a problem with my plugin. I need create plugin.jar in repo for apply plugin in root build.script using only one task without “uploadArchives” in plugin project folder.

rootProject | : : |___myPlugin | |___build.gradle

It’s not clear to me what you are trying to achieve here.

Before i can apply my plugin in project i must build them to repository. I want do this from project’s build.gradle in which i apply my plugin.

P.S sorry for my English

There is no good way to do this (no matter if ‘uploadArchives’ is used or not). Instead, the plugin will need to have its own Gradle build.

It has own build.gradle. It is standalone plugin. When i run “gradle build” for my project which apply my plugin i want to rebuild plugin before.

We have next configuration:

/root/a - our specific plugin /root/b - our project /root/build.gradle /root/settings.gradle ‘root’ project is multi-project that has two sub projects ‘a’ and ‘b’. All subprojects have own build.gardle. We used to our plugin for specific purpose. But we have problem with gradle our plugin doesn’t work as standalone project. When functionality(source code) of plugin contains in /root/build.gradle all works fine. But when we move plugin functionality from /root/build.gradle to /root/a project. Plugin haven’t worked because we need to build it firstly. When we run firstly root:build we don’t have plugin.jar yet. So we need to run firstly root:a:build and after that only use our plugin. So how we can use our plugin in one flow? Just run ‘gradle build’ in root folder without any additional running.

As I said, there isn’t currently a good way to do this. One and the same build cannot both build version x of the plugin and apply version x. Instead, /root/b will have to apply version x-1 from some local or remote repository.

Thanks for the answer.