skeleton of client app

This commit is contained in:
Zlatin Balevsky
2019-11-29 17:02:15 +00:00
parent 9cb0655cfa
commit cd0b860210
3 changed files with 65 additions and 0 deletions

View File

@ -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 ->

View File

@ -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}

View File

@ -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";
}
}