Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically download plugin dependencies from repositories (Fix #22) #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DRSchlaubi
Copy link

@DRSchlaubi DRSchlaubi commented Nov 21, 2021

This is my initial attempt at implementing #22, any suggestions

Another way to solve this, would probably be to Download the plugin first, then inspect the manifest and download the plugins through that

@decebals
Copy link
Member

@DRSchlaubi Sorry for delay and thank you for contribution.
The idea is good, the implementation is OK. What I don't like is the part with add dependencies in PluginInfo (and in XML).
The plugin's dependencies in my opinion should be discovered at runtime, using DependencyResolver existed in PF4J core, as I said in #22.
It's hard to maintain (edit by hand) the dependencies available in plugins.json.
I will take a look to see if I can extract this information at runtime.

@DRSchlaubi
Copy link
Author

It's hard to maintain (edit by hand) the dependencies available in plugins.json.

I just wrote a Gradle plugin generating the complete plugins.json, so I guess I didn't think about that too much

@decebals
Copy link
Member

decebals commented Nov 27, 2021

It's hard to maintain (edit by hand) the dependencies available in plugins.json.

I just wrote a Gradle plugin generating the complete plugins.json, so I guess I didn't think about that too much

Interesting.
Can you tell me more about this plugin? Is it open source, is it available for use by anyone?

In fact, I think that I am (very) curios how other people/projects maintain information about the available plugins (plugins.json) 😄.

@DRSchlaubi
Copy link
Author

It's a work in progress, but it's here: https://github.com/DRSchlaubi/mikbot/tree/main/gradle-plugin
It's currently not in the Gradle plugin portal because I got tired after working on it for 6 hrs, but it will be eventually

it can generate the plugin.properties file almost automatically
id is the gradle module name, dependencies are inferred from from the actual module dependencies, as there is a plugin and optionalPlugin dependency config, version is also inferred from the module

It also supports making a repository by geenerating a local repository

My CI clones the existing repo which is a branch with GH Pages on it, then add ne new versions to it and generate the plugins.json and push it to the branch again
Ci is here: https://github.com/DRSchlaubi/mikbot/blob/main/.github/workflows/ci.yaml#L58-L93

@DRSchlaubi
Copy link
Author

The plugin should now be available to all Gradle users. docs are here: https://github.com/DRSchlaubi/mikbot/tree/main/gradle-plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants