diff --git a/plug/build.gradle b/plug/build.gradle index fcb14b13..e9375549 100644 --- a/plug/build.gradle +++ b/plug/build.gradle @@ -47,6 +47,17 @@ task pluginConfig { } } +task clientsConfig { + doLast { + def binding = [ "libname" : libDirPath()] + def templateFile = new File("$projectDir/templates/clients.config.template") + def engine = new groovy.text.SimpleTemplateEngine() + def output = engine.createTemplate(templateFile).make(binding) + def outputFile = new File(zipDir, "clients.config") + outputFile.text = output + } +} + task pluginDir { dependsOn ':webui:assemble' doLast { task -> diff --git a/plug/templates/clients.config.template b/plug/templates/clients.config.template new file mode 100644 index 00000000..b51e8eed --- /dev/null +++ b/plug/templates/clients.config.template @@ -0,0 +1,5 @@ +clientApp.0.main=com.muwire.webui.MuWireClient +clientApp.0.name=MuWire +clientApp.0.startOnLoad=false +clientApp.0.delay=5 +clientApp.0.classpath=${libname} diff --git a/webui/src/main/java/com/muwire/webui/MuWireClient.java b/webui/src/main/java/com/muwire/webui/MuWireClient.java new file mode 100644 index 00000000..2f3376f9 --- /dev/null +++ b/webui/src/main/java/com/muwire/webui/MuWireClient.java @@ -0,0 +1,49 @@ +package com.muwire.webui; + +import net.i2p.app.ClientAppManager; +import net.i2p.app.ClientAppState; +import net.i2p.router.RouterContext; +import net.i2p.router.app.RouterApp; + +public class MuWireClient implements RouterApp { + + private final RouterContext ctx; + private final ClientAppManager mgr; + private final String[] args; + + private ClientAppState state; + + public MuWireClient(RouterContext ctx, ClientAppManager mgr, String[]args) { + this.ctx = ctx; + this.mgr = mgr; + this.args = args; + } + + @Override + public void startup() throws Throwable { + // TODO Auto-generated method stub + + } + + @Override + public void shutdown(String[] args) throws Throwable { + // TODO Auto-generated method stub + + } + + @Override + public synchronized ClientAppState getState() { + return state; + } + + @Override + public String getName() { + return "MuWire"; + } + + @Override + public String getDisplayName() { + return "MuWire"; + } + +}