@echo off
 
call ..\config.bat

set server_jar=server.jar
set shell_jar=shell.jar
set backdoor_jar=backdoor.jar
set logger_jar=logger.jar

set server_classes=BoxServer$Client.class BoxServer.class ByteBufferInput.class ByteBufferOutput.class ConfigDefs.class ConsoleUtils.class DaemonThread$Code.class DaemonThread$Helper.class DaemonThread.class Mangle.class Proto.class SrvConnection$InputStreamDemux.class SrvConnection.class StreamInput.class StreamOutput.class WrappedInput.class WrappedOutput.class
set shell_classes=CarboUpgrade.class ClientIf.class ConfigDefs.class ConsoleIf.class ConsoleUtils.class DaemonThread$Code.class DaemonThread$Helper.class DaemonThread.class EMMBlockerDefs.class EMMSnifferDefs.class EPGDefs.class FSDefs.class HermesUpgrade$Info.class HermesUpgrade.class HTTPSnifferDefs.class Interpreter$CmdDesc.class Interpreter.class Mangle.class MPEGDefs.class Proto.class RecManDefs.class Shell$Cmd.class Shell$Option.class Shell.class SrvConnection$InputStreamDemux.class SrvConnection.class SrvUtilsDefs.class SSUDefs.class StreamInput.class StreamOutput.class SysInfoDefs.class TSReader.class TSRecorderDefs.class Twofish$Cipher.class Twofish$Key.class Twofish.class WrappedInput.class WrappedOutput.class XionDefs.class SCWatchDefs.class
set logger_classes=CommChannel.class NLogReader.class NLogReader$Client.class ConsoleUtils.class ConfigDefs.class
set backdoor_classes=*.class

set COMSPEC=%SYSTEMROOT%\SYSTEM32\CMD.EXE /E:8000

if not exist tmpclasses (
 mkdir tmpclasses
)

echo *** Compiling source files ***
call %javac% -source 1.4 -target 1.4 -classpath %classpath% -d . src\*.java

echo *** Preparing jar files ***
call %jar% cf %server_jar% %server_classes%
call %jar% cf %shell_jar% %shell_classes%
call %jar% cf %logger_jar% %logger_classes%
call %jar% cf %backdoor_jar% %backdoor_classes%

echo *** cleaning temporary files ***
del ..\docroot\nportal\*.class
copy *.class ..\docroot\nportal
del *.class
