skeleton of client app
This commit is contained in:
@ -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 ->
|
||||
|
5
plug/templates/clients.config.template
Normal file
5
plug/templates/clients.config.template
Normal 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}
|
49
webui/src/main/java/com/muwire/webui/MuWireClient.java
Normal file
49
webui/src/main/java/com/muwire/webui/MuWireClient.java
Normal 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";
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user