Gradle/Git: Extract non-core plugins / allow optional plugins #26
Comments
Whoever is implementing this should have a look at the build system |
I think adding another build system wouldn't be beneficial. Gradle does the job perfectly fine and I'm sure it's very capable to do this. I think the more interesting part is that the plugins depend on some classes in the syncany-lib (e.g. Connection, Plugin, TransferManager), and if they are not part of the same project (or git repo) dependencies might be more interesting. Maybe let syncany-lib or syncany-plugin-api (does not exist yet) be a git subtree of syncany-plugin-{sftp,rest,...}. Something like that. |
To the lucky one who gets to develop this: Vincent has already done some work that could be reused: https://github.com/vwiencek/syncany-plugin-hazelcast Related thread on the mailing list: |
This has to be done for 0.1, because SFTP and S3 shouldn't be in the first release. |
Dear all, 1/ First Step All these plugin repositories work with submodules, meaning that they 2/ Second Step 3/ Todo
Vincent On Wed, Mar 5, 2014 at 10:45 PM, Philipp C. Heckel <notifications@github.com
Vincent Wiencek |
Hi Vincent, very nice. Two things:
What do you think about that? |
I merged your branches into this ones here; @vwiencek @pimotte and @guitarlum should have full write access to them: |
I started the development of a Syntax will be |
Talked to Pim on IRC; decided that the syntax should be different:
The
|
I continued working on this. Commit a817fab now talks to http://api.syncany.org/v1/plugins/list.php (mock data), parses the response and can display it as shown below. Obviously the
|
Using ~/.syncany might give some namespace issues, since that is the same folder used if a user inits in ~. Though it doesn't cause any real issues afaik, would it be cleaner to use ~/.config/syncany instead? |
Agreed. |
So again, @pimotte opened my mind about things: We decided to not allow plugins to be activated/deactivated. Instead, "install" and "deinstall" should be enough. If anyone can think of a reason why we should allow deactivated plugins, speak now or forever hold your peace. The new help file would look like this:
|
I have another issue I would very much like feedback to. After I have implemented the basics of the plugin installation, I am trying to compile an example for an external plugin. The SFTP plugin prepared by Vincent works code-wise, but there is currently no way to dynamically add it to Syncany. The following things are necessary:
I don't see (2) as an issue, and (3) depends on (1). I am currently struggling with (1). In particular, I am not sure how to handle dependencies in plugins. There are two options: (1a) Create a single JAR including all dependencies. This might be a bit tricky gradle-wise, but the 'uberjar' target already does that (lib/util dependencies need to be excluded though). (1b) Create one JAR for the plugin without dependencies. This would have a couple of impacts:
In short, in (1a) the
For (1b), the
|
The final bullet point: Perhaps something like in: https://github.com/binwiederhier/syncany/blob/develop/gradle/arch/syncany/syncany However, my intuition is in favour of 1a. It reduces complexity and I can't imagine that plugins being so large that space becomes an issue. Is the .jar in syncany.org/dist/plugins/ftp the uberjar or the normal one? |
ok maybe one point regarding class loading issues (waiting for java ex :
I'm not sure whether java 7 or 8 can handle such cases .... On Mon, Apr 14, 2014 at 9:59 AM, pimotte notifications@github.com wrote:
Vincent Wiencek |
Instead of hacking shell scripts, on other solution could be to write a what do you think ? jcl tool : https://github.com/kamranzafar/JCL/ On Mon, Apr 14, 2014 at 10:04 AM, Vincent Wiencek vwiencek@gmail.comwrote:
Vincent Wiencek |
|
So after a discussion with @pimotte we decided that it'd be easier for now to have a single JAR. I prepared the SFTP plugin to create a JAR including the plugin dependencies. It's not quite as automatic as I had wished. The dependencies for the JAR have to be manually added as a configuration in the build file. Also, the plugins can have their own version, which is essential I think. I also added a description for plugin development here: Using the easyplugin branch, downloading I also managed to adjust the classpath: https://github.com/binwiederhier/syncany/blob/69203310c4b11def96c3ff240fd92c8d2999795e/syncany-cli/build.gradle#L39 Reviews and feedback of any kind are welcome! |
I think we're almost there.
|
nice :) On Tue, Apr 15, 2014 at 9:27 AM, Philipp C. Heckel <notifications@github.com
Vincent Wiencek |
(1) Download/install from syncany.org/dist
(2) Install from local file
(3) Install from any URL (!)
|
This is finally ready to be merged. Any comments? I'll merge it tonight unless you guys have any comments. |
Nicely done, no objections to merging. Minor-minor nitpick: PluginCommand, line 91. The comment in the middle of the if/else if construction threw me off slightly. I think it's cleaner to move that one into the elseif-clause. |
Sounds good. I'll merge it then, and externalize the webdav plugin. Regarding the "comment-before-else-if" thing: I've always done it this way, but Steffen also told me once that it's odd. Maybe I have to change my habits... |
Right now, the master branch contains many plugins in the syncany-plugins directory, namely these plugins: syncany-plugin-ftp, syncany-plugin-sftp, syncany-plugin-webdav, syncany-plugin-rest.
Also, the plugins appear in the gradle configuration for the CLI (and the GUI): settings.gradle and in the dependencies of syncany-cli.
In the future, the number of plugins will grow, and I won't have enough time to maintain them all. That's why we need the possibility to add optional plugins from other github repos -- which can be hosted at the Syncany organization space, but maintained by others.
Something like git subtree or submodule could be used, but maybe something completely loosely coupled would be even better.
I'm looking for someone to implement this. Please let me know if you're interested.
The text was updated successfully, but these errors were encountered: