When inspecting the dummy configurations task depe...
# plugin-development
m
When inspecting the dummy configurations task dependencies, it knows it is supposed to run the generateMdkJar task from our project, but it just never runs it during the resolve. Am I missing something that would trigger that? Or is that simply not possible?
๐Ÿงต 1
v
Please do not split topics across several threads. This makes following the conversation in the threads view very hard as the context of the other messages is missing. If you have additional information either edit the original message or post to its thread. Regarding the problem, can you maybe provide an MCVE that demoes the situation?
m
Sure sorry I will keep it to one message. And yes I can provide you with a minimal viable reproduction, but the plugin is not small so it will take me a bit to build.
n
putting the message in the thread, but then also sending to channel kind of defeats the purpose, no? ๐Ÿ˜‰
m
It does. I forgot that if you do not uncheck the damn checkbox in slack it does not do that
n
oh, it remembers that state, I wasn't even aware ๐Ÿ˜ฑ that's quite annoying indeed
m
Here you go: <https://github.com/marchermans/config-included-build-reproduction> Simply running the Targetbuild task from the project root indicates our problem. The target project here needs some information from a jar that is generated by a task in the master project. The dependency is properly resolved as can be seen from the outputted error message (FileNotFoundException targetting the normal location where the .jar file would be generated in the build/libs directory of the master project). But the task that actually generates it, is not ran.
v
Did you maybe forget to commit and / or push?
m
No
Why do you think that I forgot to commit / push?
Nevermind
v
There is no
includeBuild
anywhere. There are three builds that are not interconnected. If I go to
target
and do
build
it only does
buildEnvironment
.
m
I am not sure why it did that
I wrote the whole project and everything
Then hit publish but it still did not publish everything
n
you're eagerly resolving the artifact during the configuration phase:
Copy code
$ ./gradlew :target:build --dry-run --stacktrace 

> Configure project :target
Resolved greeting artifact to: /usr/local/git/github/thirdparty/config-included-build-reproduction/master/build/libs/greeting.jar
m
Yes on purpose
๐Ÿค” 1
In that file there is information I need to setup the tasks and other components
For example it contains a list of runnable variants of the master projects.
And what the arguments are needed to start it
For that specific version of the master project
So it reads what kind of runs exist in that MDK jar
And then creates a task for each of it
@Niels Doucet Obviously it is not great, but has Gradle any mechanic where you can transmit such information?
n
I'm trying to wrap my head around this setup. My instinct is that you should probably not publish this metadata as a jar, but I'm not certain I've fully grasped the problem just yet, so bear with me ๐Ÿ™‚
m
When we originally envisioned that we did not have much of an other option
But I am completely open to change how we distribute it
In reality it is a single json file that we parse in
And then extract all the tasks from
v
Why does `plugin`have to declare a dependency for
target
and resolve it? Can't
plugin
simply depend on
master
?
m
Because in reality the thing the json defines is a decompiler structure
There is no real master dependency in reality
We generate it on the fly
When the user request its, and then have the user run the generation task
Which populates the jar
So the master only populates the metadata
As to how to decompile and patch the relevant systems
To make it work
But since you asked for a reproduction case, I removed that part of the complexity to show where I am running into the issue
n
so just to clarify in my head: the json file is the recipe for a toolkit capable of building plugins using your MDK, right?
m
Yes
It defines the structure of the tasks, their interdependencies, which files they need, what tools to execute etc
n
I think it would make sense to build a plugin tightly coupled to your mdk and just release it alongside
m
But that would tie a given plugin version hardcoded to a given mdk right?
right now we have one global version, the user sets the mdk he wants to run with
n
you could even make a settings plugin that wraps both your MDK and the related plugin and configures both in one of those plugin projects of your users
m
Hmm
So the settings plugin would then manage that
Or how would I understand it?
Right now the user just calls a method on an extension gives it the version
And the plugin downloads the config file for that version
And sets up all the tasks
n
the settings plugin would manage both the mdk dependencies and the toolkit that's capable of building a plugin using that mdk version
so the change would be to just configure the settings plugin instead and it takes care of all the rest. From a UX perspective I think it's exactly the same for your users, but it removes the weird configuration time dynamic resolution of your current setup.
m
Okey, but how would that circumvent me needing to download the configuration for the tasks?
Or would that now happen during the config phase of the settings object?
n
it's baked into the plugin at build time?
(of the MDK and its plugins_
m
So I would need to publish a hardcoded plugin for every build we do....
That is a said state of affairs to be honest
Especially because this works relatively painlessly if the project is not included via includeBuild
But the artifact is just published
n
you could do dynamic resolution in your settings plugin, I suppose, which would indeed shift the build over to an earlier phase, if I'm not mistaken
m
But that then again would not really work would it
Because the dependency replacement would not really work
As far as I can tell
n
I'm not sure, to be honest. It's a bit too abstract to keep the full picture in my head. I would probably give it a try by creating a settings plugin that does the work of your current
TargetExtension
while also configuring the project dependency to a specific MDK (which would be part of the settings plugin configuration). That way the build of your settings plugin is still independent of the specific MDK (given the recipe doesn't change), but you get resolution of the recipe at application time of the settings plugin.
m
I will try