mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 15:33:00 +00:00
46
src/assembly/distribution-bin.xml
Normal file
46
src/assembly/distribution-bin.xml
Normal file
@@ -0,0 +1,46 @@
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>bin</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>tar.bz2</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<baseDirectory></baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>data/**</include>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/dist</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.build.directory}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>*-sources.jar</exclude>
|
||||
<exclude>*-javadoc.jar</exclude>
|
||||
</excludes>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>false</unpack>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
36
src/assembly/distribution-src.xml
Normal file
36
src/assembly/distribution-src.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>src</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
<format>tar.bz2</format>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<baseDirectory></baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<includes>
|
||||
<include>data/**</include>
|
||||
<include>src/**</include>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
</includes>
|
||||
</fileSet>
|
||||
<fileSet>
|
||||
<directory>${project.basedir}/dist</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<outputDirectory>/libs</outputDirectory>
|
||||
<useProjectArtifact>true</useProjectArtifact>
|
||||
<unpack>false</unpack>
|
||||
<scope>runtime</scope>
|
||||
</dependencySet>
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
@@ -8,7 +8,7 @@ import com.l2jserver.service.database.DatabaseService;
|
||||
import com.l2jserver.service.database.MySQLDatabaseService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingServiceImpl;
|
||||
import com.l2jserver.service.game.template.StaticTemplateService;
|
||||
import com.l2jserver.service.game.template.ScriptTemplateService;
|
||||
import com.l2jserver.service.game.template.TemplateService;
|
||||
import com.l2jserver.service.game.world.WorldService;
|
||||
import com.l2jserver.service.game.world.WorldServiceImpl;
|
||||
@@ -34,7 +34,7 @@ public class ServiceModule extends AbstractModule {
|
||||
Scopes.SINGLETON);
|
||||
bind(ScriptingService.class).to(ScriptingServiceImpl.class).in(
|
||||
Scopes.SINGLETON);
|
||||
bind(TemplateService.class).to(StaticTemplateService.class).in(
|
||||
bind(TemplateService.class).to(ScriptTemplateService.class).in(
|
||||
Scopes.SINGLETON);
|
||||
|
||||
bind(WorldService.class).to(WorldServiceImpl.class)
|
||||
|
||||
@@ -14,10 +14,10 @@ import com.l2jserver.service.game.scripting.ScriptContext;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.util.factory.CollectionFactory;
|
||||
|
||||
public class StaticTemplateService extends AbstractService implements
|
||||
public class ScriptTemplateService extends AbstractService implements
|
||||
TemplateService {
|
||||
private final ScriptingService scriptingService;
|
||||
private final StaticTemplateServiceConfiguration config;
|
||||
private final ScriptTemplateServiceConfiguration config;
|
||||
private final Injector injector;
|
||||
|
||||
private ScriptContext context;
|
||||
@@ -27,12 +27,12 @@ public class StaticTemplateService extends AbstractService implements
|
||||
TemplateID.class, Template.class);
|
||||
|
||||
@Inject
|
||||
public StaticTemplateService(ScriptingService scriptingService,
|
||||
public ScriptTemplateService(ScriptingService scriptingService,
|
||||
ConfigurationService configService, Injector injector) {
|
||||
this.scriptingService = scriptingService;
|
||||
this.injector = injector;
|
||||
this.config = configService
|
||||
.get(StaticTemplateServiceConfiguration.class);
|
||||
.get(ScriptTemplateServiceConfiguration.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -6,7 +6,7 @@ import com.l2jserver.service.configuration.Configuration;
|
||||
import com.l2jserver.service.configuration.Configuration.ConfigurationName;
|
||||
|
||||
@ConfigurationName("template")
|
||||
public interface StaticTemplateServiceConfiguration extends Configuration {
|
||||
public interface ScriptTemplateServiceConfiguration extends Configuration {
|
||||
@ConfigurationPropertyGetter(name = "template.descriptor", defaultValue = "data/script/template/template.xml")
|
||||
File getTemplateDescriptor();
|
||||
|
||||
@@ -4,28 +4,17 @@ import org.junit.Test;
|
||||
|
||||
import script.template.item.AdenaItemTemplate;
|
||||
|
||||
import com.google.inject.AbstractModule;
|
||||
import com.google.inject.Guice;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Scopes;
|
||||
import com.l2jserver.db.dao.DAOModuleMySQL5;
|
||||
import com.l2jserver.model.id.factory.IDFactoryModule;
|
||||
import com.l2jserver.model.id.template.factory.ItemTemplateIDFactory;
|
||||
import com.l2jserver.service.ServiceModule;
|
||||
import com.l2jserver.service.ServiceStartException;
|
||||
import com.l2jserver.service.game.scripting.ScriptingService;
|
||||
import com.l2jserver.service.game.scripting.ScriptingServiceImpl;
|
||||
|
||||
public class StaticTemplateServiceTest {
|
||||
private final Injector injector = Guice.createInjector(
|
||||
new IDFactoryModule(), new DAOModuleMySQL5(), new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ScriptingService.class).to(ScriptingServiceImpl.class)
|
||||
.in(Scopes.SINGLETON);
|
||||
bind(TemplateService.class).to(StaticTemplateService.class)
|
||||
.in(Scopes.SINGLETON);
|
||||
}
|
||||
});
|
||||
private final Injector injector = Guice.createInjector(new ServiceModule(),
|
||||
new IDFactoryModule(), new DAOModuleMySQL5());
|
||||
private final TemplateService service = injector
|
||||
.getInstance(TemplateService.class);
|
||||
private final ItemTemplateIDFactory factory = injector
|
||||
|
||||
Reference in New Issue
Block a user