Permalink
Browse files

Add stuff that got left out when putting together the first release t…

…o GitHub
  • Loading branch information...
FUDCo committed Aug 3, 2016
1 parent 02ada4d commit e46103c79ded47de961e999a59328d5a3c6ca3c9
Showing with 6,421 additions and 58 deletions.
  1. +386 −0 Build/Makefile
  2. +5 −0 Build/Scripts/dbclear.sh
  3. +6 −0 Build/Scripts/dbpurge.sh
  4. +3 −0 Build/Scripts/dbreinit.sh
  5. +30 −0 Build/Utils/StripClass/code.c
  6. +215 −0 Build/Utils/StripClass/code.h
  7. +406 −0 Build/Utils/StripClass/defs.h
  8. +925 −0 Build/Utils/StripClass/dump.c
  9. +9 −0 Build/Utils/StripClass/dump.h
  10. +97 −0 Build/Utils/StripClass/free.c
  11. +5 −0 Build/Utils/StripClass/free.h
  12. +310 −0 Build/Utils/StripClass/gc.c
  13. +8 −0 Build/Utils/StripClass/gc.h
  14. +74 −0 Build/Utils/StripClass/main.c
  15. +208 −0 Build/Utils/StripClass/prune.c
  16. +5 −0 Build/Utils/StripClass/prune.h
  17. +591 −0 Build/Utils/StripClass/read.c
  18. +26 −0 Build/Utils/StripClass/read.h
  19. +633 −0 Build/Utils/StripClass/refct.c
  20. +21 −0 Build/Utils/StripClass/refct.h
  21. +193 −0 Build/Utils/StripClass/util.c
  22. +11 −0 Build/Utils/StripClass/util.h
  23. +490 −0 Build/Utils/StripClass/write.c
  24. +23 −0 Build/Utils/StripClass/write.h
  25. +2 −0 Build/components
  26. +177 −0 Build/install
  27. +20 −0 Build/stripjar
  28. +149 −0 Example/build/Makefile
  29. +1 −0 Example/build/javadoc-group-defs
  30. +4 −0 Example/build/javadoc-package-list
  31. +166 −0 Example/build/sun-packages/package-list
  32. +41 −0 Example/db/classes-example.json
  33. +9 −0 Example/db/ctx-exchatroom1.json
  34. +13 −0 Example/db/ctx-exfield.json
  35. +9 −0 Example/db/ctx-expresentationroom1.json
  36. +11 −0 Example/db/item-expenguin1.json
  37. +11 −0 Example/db/item-expenguin2.json
  38. +11 −0 Example/db/item-exrock1.json
  39. +11 −0 Example/db/item-exrock2.json
  40. +11 −0 Example/db/item-exrock3.json
  41. +6 −0 Example/db/statics-example.json
  42. +5 −0 Example/db/user-exalice.json
  43. +5 −0 Example/db/user-exbob.json
  44. +5 −0 Example/db/user-excarol.json
  45. +5 −0 Example/db/user-exdave.json
  46. +5 −0 Example/db/user-exedna.json
  47. +5 −0 Example/db/user-exfred.json
  48. +46 −0 Example/java/com/example/game/mods/ExampleContextMod.java
  49. +80 −0 Example/java/com/example/game/mods/ExampleItemMod.java
  50. +46 −0 Example/java/com/example/game/mods/ExampleUserMod.java
  51. +70 −0 Example/java/com/example/game/mods/Movement.java
  52. +34 −0 Example/java/com/example/game/mods/PrivateChat.java
  53. +69 −0 Example/java/com/example/game/mods/Prop.java
  54. +92 −0 Example/java/com/example/game/mods/SimpleChat.java
  55. BIN Run/manage/elkologosmall.png
  56. +36 −0 Run/run.broker_dev/start
  57. +4 −0 Run/run.broker_dev/start.dbg
  58. +0 −57 Run/run.context_ubuntu/start
  59. +12 −0 Run/run.logtest/debug.broker
  60. +12 −0 Run/run.logtest/debug.context
  61. +12 −0 Run/run.logtest/debug.director
  62. +12 −0 Run/run.logtest/debug.workshop
  63. +40 −0 Run/run.logtest/launch.broker
  64. +64 −0 Run/run.logtest/launch.context
  65. +55 −0 Run/run.logtest/launch.director
  66. +50 −0 Run/run.logtest/launch.workshop
  67. +7 −0 Run/run.logtest/setlocvars
  68. +10 −0 Run/run.logtest/start.all
  69. +7 −0 Run/run.logtest/start.broker
  70. +7 −0 Run/run.logtest/start.context
  71. +7 −0 Run/run.logtest/start.director
  72. +7 −0 Run/run.logtest/start.workshop
  73. +42 −0 Run/run.presence_dev/start
  74. +4 −0 Run/run.presence_dev/start.dbg
  75. +45 −0 Run/run.workshop_dev/cribsheet
  76. +9 −0 Run/run.workshop_dev/odb/bank
  77. +5 −0 Run/run.workshop_dev/odb/bankclient
  78. +6 −0 Run/run.workshop_dev/odb/bankservice
  79. +7 −0 Run/run.workshop_dev/odb/bpbank
  80. +21 −0 Run/run.workshop_dev/odb/classes-bank
  81. +11 −0 Run/run.workshop_dev/odb/classes-workshoptest
  82. +5 −0 Run/run.workshop_dev/odb/echotest
  83. +14 −0 Run/run.workshop_dev/odb/statics-badpets
  84. +37 −0 Run/run.workshop_dev/odb/testbank
  85. +6 −0 Run/run.workshop_dev/odb/testbankservice
  86. +10 −0 Run/run.workshop_dev/odb/workers
  87. +53 −0 Run/run.workshop_dev/start
  88. +4 −0 Run/run.workshop_dev/start.dbg
  89. +1 −1 Web/index.html
View
@@ -0,0 +1,386 @@
# Master makefile for Elko server and applications
#
# Make operations are all in reference to a configured set of applications and
# components. These components are listed by name in the file 'components' or
# by defining COMPONENTS as an environment variable or on the make command
# line. Also, regardless how the set of components is configured externally,
# the components will always includes the core server itself.
#
# Instructions:
# make - Default make, currently same as "make build".
# make build - Make .jars for configured components.
# make clean - Remove intermediate files for configured components.
# make javadoc - Make a Javadoc site for the configured components.
# make sdk - Make a distribution package for developers (including
# documentation and support files). Uses a stripped
# version of the server .jar
# make db - Make MongoDB setup scripts
# make deploy - Make an Elko internal deployment package containing the
# configured components
#
# make <COMPONENTNAME> - Build a particular named component's .jar
# make all - Build all components
# Makefile hackery to allow the subst function to replace spaces (this is how
# the gnumake documentation says to do it, honest).
EMPTY :=
SPACE := $(EMPTY) $(EMPTY)
# What to make if no make target is otherwise specified.
default: build
# Make everything, mainly because people expect to be able to do this
all: export COMPONENTS = $(ALL_COMPONENTS)
all:
$(MAKE) build
# Extract the components list from the 'components' file.
export COMPONENTS ?= ServerCore $(shell cat components)
# List of directories where the various components are rooted
COMP_DIRS = $(COMPONENTS:%=../%)
# The directories where compiled .class files for configured components are put
CLA_DIRS = $(subst $(SPACE),:,$(COMPONENTS:%=../%/built/classes))
# The directories where Java source files for configured components are
JAV_DIRS = $(subst $(SPACE),:,$(COMPONENTS:%=../%/java))
# List of directories where MongoDB object definition files are found
DB_DIRS = $(COMPONENTS:%=../%/db)
# List of .jar files for configured components
COMP_JARS = $(COMPONENTS:%=../%/built/bin/*.jar)
# Directory where javadoc output goes
JAVADOC_DIR := Doc/Javadoc
# Directory where components are put for distribution
DIST_DIR := ../Distrib
# Directory from which to obtain 3rd party components
EXT_IMPORT_DIR := $(DIST_DIR)/External
# Directory to where built components are placed
INT_IMPORT_DIR := $(DIST_DIR)/Internal
# Directory into which shippable distribution files should be put
SHIP_DIR := $(DIST_DIR)/Ship
# Directory where the sources for the runtime environment files are
RUN_DIR := ../Run
# Current list of 3rd party components that the server requires
EXT_JARS = $(EXT_IMPORT_DIR)/mongo.jar:$(EXT_IMPORT_DIR)/ScalableSSL.jar:$(EXT_IMPORT_DIR)/zmq.jar
# Add 3rd party .jars to the class path
ifeq ($(CLASSPATH),)
CLASSPATH = $(CLA_DIRS):$(EXT_JARS)
else
CLASSPATH := $(CLASSPATH):$(CLA_DIRS):$(EXT_JARS)
endif
#############################################################
# Recursive invocation of various make targets on configured components
#############################################################
TASK ?= build
build: TASK = build
build: $(COMPONENTS)
clean: TASK = clean
clean: $(COMPONENTS)
installable: TASK = installable
installable: $(COMPONENTS)
%-build: $(@:%-build=%)
cd ../$(@:%-build=%)/build; make dist-terse
%-clean: $(@:%-clean=%)
cd ../$(@:%-clean=%)/build; make clean
%-installable: $(@:%-installable=%)
cd ../$(@:%-installable=%)/build; make installable
#############################################################
# The available components
#############################################################
ALL_COMPONENTS = ServerCore ZeroMQ Example
# The server and its parts
ServerCore:
$(MAKE) $@-$(TASK)
ZeroMQ: ServerCore
$(MAKE) $@-$(TASK)
# The applications
Example: ServerCore
$(MAKE) $@-$(TASK)
#############################################################
# SDK related stuff
#############################################################
# Base name for the SDK package that gets generated by "make sdk"
SDK_NAME := ElkoSDK
# Pre-configured component set for the SDK
SDK_COMPONENTS := ServerCore
# Make the SDK
sdk: export COMPONENTS = $(SDK_COMPONENTS)
sdk: PKG_NAME = $(SDK_NAME)
sdk: PACK_FILES = $(SDK_NAME)
sdk: gen-tempdir do-sdk pack-tempdir
@echo
@echo '****************************************'
@echo '* SDK package is in $(PACK_TARGET)'
@echo '****************************************'
# Web client files
WEB_DIR = ../Web
WEB_FILES = \
READ.ME \
chat.html \
chatjq.html \
connection.html \
connection.js \
connectionjq.html \
connectionjq.js \
json.js \
session.js \
trace.js
DOC_DIR = ../ServerCore/doc
DOC_FILES = \
ElkoTutorial.pdf \
broker.html \
clientcui.html \
clientmods.html \
cui.html \
director.html \
gatekeeper.html \
httpjmsg.html \
index.html \
jmsg.html \
presence.html \
repository.html \
rtcp.txt \
serverconfig.html \
servercui.html \
servermods.html \
elko.css \
elkologosmall.png
# Example "game"
EXAMPLE_DIR = ../Example
# Gather the SDK package contents
do-sdk: do-sdk-deploy javadoc
cp LICENSE.txt $(PKG_DIR)
mkdir $(PKG_DIR)/Doc
cp $(DOC_FILES:%=$(DOC_DIR)/%) $(PKG_DIR)/Doc
cp -rf $(JAVADOC_DIR) $(PKG_DIR)/Doc/javadoc
mkdir $(PKG_DIR)/Example
cp -rf $(EXAMPLE_DIR)/db $(EXAMPLE_DIR)/java $(PKG_DIR)/Example
mkdir $(PKG_DIR)/Web
cp $(WEB_FILES:%=$(WEB_DIR)/%) $(PKG_DIR)/Web
# Gather the deployment package contents that belong in the SDK
do-sdk-deploy: do-build
mkdir -p $(PKG_DIR)
cp $(COMP_JARS) $(PKG_DIR)
./stripjar $(PKG_DIR)/elkoserver.jar
mv $(PKG_DIR)/elkoserver.jar $(PKG_DIR)/elkosdk.jar
#############################################################
# Deployment related stuff
#############################################################
# Base name for the deployment package that gets generated by "make deploy"
DEPLOY_NAME := SSDeploy
# Make the deployment package
deploy: PKG_NAME = $(DEPLOY_NAME)
deploy: PACK_FILES = install $(DEPLOY_NAME)
deploy: gen-tempdir do-core-deploy do-private-deploy purge-rundirs pack-tempdir
@echo
@echo '****************************************'
@echo '* Built deployment package containing $(COMPONENTS)'
@echo '* Deployment package is in $(PACK_TARGET)'
@echo '****************************************'
# Common run-time environment files
RUN_COMMON_DIR = $(RUN_DIR)/common
RUN_COMMON_FILES = \
brokercmd \
brokerwatcher \
cleanRundir \
clearModules \
clusterStart \
clusterStop \
debugStart \
refreshModuleProperties \
rmModule \
setenvvars \
setlocvars \
startBrokerWatcher \
startComponent \
useModuleInternal \
useModuleUploaded \
validateModule
RUN_MANAGE_DIR = $(RUN_DIR)/manage
RUN_MANAGE_FILES = \
admin.js \
configurize.php \
genlaunch.php \
launcherfuncs.php \
manage.php \
manage_environ.php \
overview.php \
validatecluster.php \
elko.css \
elkologosmall.png \
title_bg.png
# Run environments for distribution
RUN_ENVS_CORE = \
run.basiccluster \
run.example \
run_template
# Gather the deployment package contents that are independent of destination
do-core-deploy: do-build db
mkdir -p $(PKG_DIR)/Distrib/Internal
cp $(COMP_JARS) $(PKG_DIR)/Distrib/Internal
mkdir $(PKG_DIR)/Scripts
mv $(DBINIT_SCRIPT) $(PKG_DIR)/Scripts
cp $(RUN_DIR)/mongosupport/mongohelper.js $(PKG_DIR)/Scripts
cp ./Scripts/* $(PKG_DIR)/Scripts
mkdir -p $(PKG_DIR)/Run/common
cp $(RUN_COMMON_FILES:%=$(RUN_COMMON_DIR)/%) $(PKG_DIR)/Run/common
mkdir -p $(PKG_DIR)/Run/manage
cp $(RUN_MANAGE_FILES:%=$(RUN_MANAGE_DIR)/%) $(PKG_DIR)/Run/manage
mkdir -p $(PKG_DIR)/Run/overview
$(foreach F,$(RUN_ENVS_CORE),cp -r $(RUN_DIR)/$(F) $(PKG_DIR)/Run/;)
# Run environments for organization internal use only
RUN_ENVS_PRIVATE = \
run.chipdev \
run.full_production
# Gather the deployment package contents that are strictly internal
do-private-deploy:
cp -Rf $(EXT_IMPORT_DIR)/ $(PKG_DIR)/Distrib/External
$(foreach F,$(RUN_ENVS_PRIVATE),cp -r $(RUN_DIR)/$(F) $(PKG_DIR)/Run/;)
purge-rundirs:
$(eval RUNDIRS := $(shell echo $(PKG_DIR)/Run/run.*))
$(foreach D,$(RUNDIRS),cd $(D); ../common/cleanRundir;)
#############################################################
# Packaging stuff, shared in common by deployment and SDK makes
#############################################################
# Recursive build, to allow the Makefile to override the components list
do-build:
$(MAKE) build
# Create a temporary place in which to accumulate a package's contents
gen-tempdir:
$(eval TEMP_DIR := $(shell mktemp -d -t ssworkXXXXX))
$(eval PKG_DIR := $(TEMP_DIR)/$(PKG_NAME))
mkdir $(PKG_DIR)
# Bundle the contents of the temporary directory into a tarball
pack-tempdir:
cp ./install $(TEMP_DIR)
cd $(TEMP_DIR) ; touch .svn ; /bin/rm -rf `find . -name .svn`
$(eval PACK_TARGET := $(SHIP_DIR)/$(PKG_NAME).tar.gz)
$(eval TGT := $(shell cd $(dir $(PACK_TARGET)); pwd))
cd $(TEMP_DIR) ; tar cfz $(TGT)/$(notdir $(PACK_TARGET)) $(PACK_FILES)
rm -rf $(TEMP_DIR)
#############################################################
# MongoDB related stuff
#############################################################
# Mongo shell Javascript files for component-specific configuration setup
MONGODB_PREINITS = $(shell find $(COMP_DIRS) -path '*/db/*' -name 'dbinitpre.js')
MONGODB_POSTINITS = $(shell find $(COMP_DIRS) -path '*/db/*' -name 'dbinitpost.js')
# JSON object definitions supplied by the various components
MONGODB_OBJECTS = $(shell find $(COMP_DIRS) -path '*/db/*' -name '*.json')
# The file that actually gets produced by "make db"
DBINIT_SCRIPT = Built/dbinit.sh
# Make the database setup stuff
db: $(DBINIT_SCRIPT)
# Synthesize the database init script
$(DBINIT_SCRIPT):
java -cp ../ServerCore/built/bin/elkoserver.jar org.elkoserver.util.JSONValidator $(MONGODB_OBJECTS)
echo '#!/bin/bash' > $(DBINIT_SCRIPT)
echo 'mongo elko --shell mongohelper.js <<ENDINITS' >> $(DBINIT_SCRIPT)
cat $(MONGODB_PREINITS) >> $(DBINIT_SCRIPT)
$(foreach F,$(MONGODB_OBJECTS),echo "eupdate("`sed -e 's/\\\/\\\\\\\\/' -e 's/\\$$/\\\\$$/' < $(F)`")" >> $(DBINIT_SCRIPT);)
cat $(MONGODB_POSTINITS) >> $(DBINIT_SCRIPT)
echo 'ENDINITS' >> $(DBINIT_SCRIPT)
chmod +x $(DBINIT_SCRIPT)
#############################################################
# Javadoc related stuff
#############################################################
# Base URL for linkage into official Java API Javadoc pages
EXTERNAL_JAVADOC = http://java.sun.com/j2se/1.5/docs/api
# Java packages for configured components included in the Javadoc output
JAVADOC_PKGS = $(shell find $(COMP_DIRS) -name javadoc-package-list)
# Javadoc group definitions for configured components
JAVADOC_GROUPS = $(shell find $(COMP_DIRS) -name javadoc-group-defs)
# Root FQN for all our packages and classes
PKG_ROOT = org.elkoserver
# Make the Javadoc pages
javadoc: $(JAVADOC_DIR)
cat $(JAVADOC_PKGS) > _javadoc-package-list
rm -rf $(JAVADOC_DIR)/*
$(eval GROUP_PARAMS := $(shell cat $(JAVADOC_GROUPS)))
javadoc -d $(JAVADOC_DIR) \
-sourcepath $(JAV_DIRS) \
-classpath "$(CLASSPATH)" \
-link $(EXTERNAL_JAVADOC) \
-tag internal:Xa:"Internal:" \
-windowtitle "Elko Server Framework" \
@_javadoc-package-list \
$(GROUP_PARAMS)
mv _javadoc-package-list $(JAVADOC_DIR)/package-list
# Make the directory where the Javadoc output will go
$(JAVADOC_DIR):
mkdir -p $(JAVADOC_DIR)
#############################################################
.PHONY: default build clean installable sdk do-sdk deploy do-core-deploy do-private-deploy do-build gen-tempdir pack-tempdir db javadoc
.PHONY: ServerCore ZeroMQ
View
@@ -0,0 +1,5 @@
#!/bin/bash
mongo elko --shell <<ENDSCRIPT
use elko
db.dropDatabase();
ENDSCRIPT
View
@@ -0,0 +1,6 @@
#!/bin/bash
mongo elko --shell mongohelper.js <<ENDSCRIPT
db.odb.drop();
ENDSCRIPT
Oops, something went wrong.

0 comments on commit e46103c

Please sign in to comment.