Instead of manually tracking dependencies and creating them in
CommandLoader, just have a module to provide a set of commands
that we can load.
This makes it stupidly easy to add dependencies in commands.
Also rename the /set command from Set because that's just
confusing.
Change-Id: I7967609e356de3c17d0942ebc913be438debe49c
Reviewed-on: http://gerrit.dmdirc.com/2722
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Have Dagger provide most of the classes which we give to SimpleInjector
for plugins, instead of doing a weird dance involving lots of global
state and horribleness.
Change-Id: I1d15796c85f90ac22b65a952ab1a5fca0fe0b337
Reviewed-on: http://gerrit.dmdirc.com/2714
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Get rid of all the Main.getPluginManager() references.
Change-Id: I2a377ce00423af5c560e0fd840948568d771b566
Reviewed-on: http://gerrit.dmdirc.com/2712
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Fully initialise the PluginManager instead of passing around
one in various states of existance.
Move plugin extraction logic into a CorePluginExtractor class.
Inject UpdateManager where appropriate.
Change-Id: I6c15f7682cccd93b40dcc189a0a8466d067095f0
Reviewed-on: http://gerrit.dmdirc.com/2692
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Pass the MSM into Main so it actually gets created, as the few
places that refer to it aren't being inflated by dagger yet.
Change-Id: Ic92f88aac29d4c68fdbc062a582b3e44ecd23637
Reviewed-on: http://gerrit.dmdirc.com/2691
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
No need for Main to do it - might as well get a fully-initialised
manager when we ask for one.
Change-Id: I55ed29bbc0270a5c610184572e58b0270055e0bc
Reviewed-on: http://gerrit.dmdirc.com/2690
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Separate out the constructor and initialisation logic in line
with other managers.
Change-Id: Ie5d2f12b838213a6500f0a87e44e56254b8d5916
Reviewed-on: http://gerrit.dmdirc.com/2689
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Create a proper LifecycleController implementation that can be
injected, move the interface to the interfaces package, and
then inject the CommandLoader instead of creating it in Main.
Change-Id: I4236b4668301f585544c8c6a9f17c39771290ea5
Reviewed-on: http://gerrit.dmdirc.com/2688
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Introduce a new dagger module that exposes the results of the
command line parser, such as the config directory.
This will let us inject the relevant directories into managers
and simplify the creation logic.
Change-Id: I9548f6ab11d76e03f25c0cd2a164032073b9ffd1
Reviewed-on: http://gerrit.dmdirc.com/2686
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
Start off with the simple stuff, just providing unitialised managers
and having Main do all the wiring. Update the tests to match.
Change-Id: I0e86451a7a719d514fa1fed0c79aa4fe45134477
Reviewed-on: http://gerrit.dmdirc.com/2679
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Do the same as the IdentityManager, to make it easier to DI later.
Change-Id: I29e96fa04615fa86c028b384ccd26a7a53fee6cf
Reviewed-on: http://gerrit.dmdirc.com/2678
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Instead, have Main provide the instance which becomes the
singleton. This allows us to inject dependencies to it, and
construct it using dagger later, while keeping all of the
code that calls the static getIdentityManager() method working.
Change-Id: I4ceaa062c84509bed66824f39cca8e76d25d131c
Reviewed-on: http://gerrit.dmdirc.com/2677
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Currently we pass in an IdentityManager which it uses to
construct the plugin directory itself, which is odd...
Also keep the reference given to the IdentityManager and
use it in favour of singleton calls.
Change-Id: I1364af35271dbfd7bf42052ebaaabe9f6f764890
Reviewed-on: http://gerrit.dmdirc.com/2674
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Avoid static/singleton references, and use a temporary Provider<>
implementation that will eventually be replaced by Dagger.
Change-Id: Id1bda9437f71cc9ddceb0a9ed1ba38d4787f2226
Reviewed-on: http://gerrit.dmdirc.com/2671
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
URLBuilder can use a static reference for now, as it makes a lot
more sense than getting a PluginManager from an ActionManager(?!?!).
Eventually we'll need to rewrite URLBuilder to not be a bunch of
static methods, so it can be instansiated with a PluginManager.
Change-Id: I609153d236f82dfd632c7da27d841eb6f031e2dd
Reviewed-on: http://gerrit.dmdirc.com/2664
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Pass in the relevant dependencies in all cases except for the Quit
command, which does actually need a Main (but it can access it
statically, for now).
Change-Id: I056a0782b9d073622c04343ebba103d0880b9567
Reviewed-on: http://gerrit.dmdirc.com/2661
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Remove all static/singleton references in the constructor so that
Servers can be instansiated sensibly without all the client existing.
Also change everything that creates a Server to use the appropriate
method in the ServerManager instead of doing it manually.
Depends-On: I3fff818d6e6694163660a36f47d60271d8f0e68e
Change-Id: I9842c20b4e4ff846c9bbf4858da794a843c3b053
Reviewed-on: http://gerrit.dmdirc.com/2655
Reviewed-by: Greg Holmes <greg@dmdirc.com>
Automatic-Compile: DMDirc Build Manager
Don't ask Main for the config directory.
Remove getMain() from Main.
Everything that needs a main now either gets given it, or asks something else.
Unfortunately, a few more dependencies on the static IdentityManager.getIdentityManager()
were introduced, but they can be tackled separately.
Fix unit tests for the above.
Change-Id: I9e42ac7f74453b739209a681d0a31f50c1be2a04
Depends-On: Ib5a9fdea5a2e25d5471d0b849f4f65fa0286d1f8
Reviewed-on: http://gerrit.dmdirc.com/2520
Automatic-Compile: DMDirc Build Manager
Reviewed-by: Greg Holmes <greg@dmdirc.com>