Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add custom logging #55

Merged
merged 5 commits into from
May 6, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
[submodule "modules/ControlFlowExtension"]
path = modules/ControlFlowExtension
url = [email protected]:qiemem/ControlFlowExtension.git
[submodule "modules/Custom-Logging-Extension"]
path = modules/Custom-Logging-Extension
url = [email protected]:NetLogo/Custom-Logging-Extension.git
2 changes: 1 addition & 1 deletion LevelSpaceXWGUI.nlogo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extensions [ls table string xw cf]
extensions [ls table string xw cf custom-logging]
__includes [ "notebook.nls" ]

breed [models model]
Expand Down
29 changes: 21 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ LS_MOD=modules/LevelsSpace
LS_SRCS=$(shell find $(LS_MOD) -type f -name '*.java')
CF_MOD=modules/ControlFlowExtension
CF_SRCS=$(shell find $(CF_MOD) -type f -name '*.scala')
CL_MOD=modules/Custom-Logging-Extension
CF_SRCS=$(shell find $(CL_MOD) -type f -name '*.scala')
GIT_SHA1=$(shell git log | head -1 | cut -d\ -f2 )
GIT_SHA1_SHORT=$(shell echo $(GIT_SHA1) | sed 's/.\{32\}$$//' )
RELEASE_NAME=release-$(GIT_SHA1_SHORT)
EXTENSION_ROOTS=ls xw cf string custom-logging
SBT=env SBT_OPTS="-Xms512M -Xmx2048M -Xss6M -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:MaxPermSize=724M" sbt

default: string/string.jar xw/xw.jar xw/widgets/LSWidgets/LSWidgets.jar ls/ls.jar cf/cf.jar
default: string/string.jar xw/xw.jar xw/widgets/LSWidgets/LSWidgets.jar ls/ls.jar cf/cf.jar custom-logging/custom-logging.jar

modules $(STRING_MOD) $(LS_MOD) $(XW_MOD) $(LS_XW_MOD) $(CF_MOD): .git/modules/$(STRING_MOD) .git/modules/$(LS_MOD) .git/modules/$(XW_MOD) .git/modules/$(LS_XW_MOD) .git/modules/$(CF_MOD)
modules $(STRING_MOD) $(LS_MOD) $(XW_MOD) $(LS_XW_MOD) $(CF_MOD) $(CL_MOD): .git/modules/$(STRING_MOD) .git/modules/$(LS_MOD) .git/modules/$(XW_MOD) .git/modules/$(LS_XW_MOD) .git/modules/$(CF_MOD) .git/modules/$(CL_MOD)
mkdir -p modules
git submodule update --init
touch modules
Expand All @@ -39,6 +42,7 @@ xw/xw.jar $(XW_WIDGET_JARS) $(XW_MOD)/xw/extrawidgets-api.jar: $(XW_SRCS) $(XW_M
cp $(XW_TARGET)/extrawidgets-core.jar xw
cp $(XW_TARGET)/xw.jar xw
cp -r $(XW_TARGET)/widgets xw
find $(XW_TARGET)/widgets -type d | grep target | xargs rm -rf --

$(LS_XW_MOD)/lib/extrawidgets-api.jar: $(XW_MOD)/xw/extrawidgets-api.jar
mkdir -p $(LS_XW_MOD)/lib
Expand All @@ -47,6 +51,7 @@ $(LS_XW_MOD)/lib/extrawidgets-api.jar: $(XW_MOD)/xw/extrawidgets-api.jar
xw/widgets/LSWidgets xw/widgets/LSWidgets/LSWidgets.jar: xw/xw.jar $(LS_XW_MOD)/LSWidgets.jar
mkdir -p xw/widgets/LSWidgets
cp $(LS_XW_MOD)/*.jar xw/widgets/LSWidgets
rm -f xw/widgets/LSWidgets/NetLogo*.jar

$(LS_XW_MOD)/LSWidgets.jar: $(LS_XW_SRCS) $(LS_XW_MOD)/src $(LS_XW_MOD)/lib/extrawidgets-api.jar
cd $(LS_XW_MOD); $(SBT) package
Expand All @@ -65,15 +70,23 @@ cf/cf.jar: $(CF_MOD)/cf.jar
mkdir -p cf
cp $(CF_MOD)/cf.jar cf/cf.jar

$(CL_MOD)/custom-logging.jar: $(CL_MOD)/src $(CL_SRCS)
cd $(CL_MOD); $(SBT) package

custom-logging/custom-logging.jar: $(CL_MOD)/custom-logging.jar
mkdir -p custom-logging
cp $(CL_MOD)/custom-logging.jar custom-logging/custom-logging.jar

.PHONY: release
release: string/string.jar cf/cf.jar xw/xw.jar $(XW_WIDGET_JARS) ls/ls.jar xw/widgets/LSWidgets/LSWidgets.jar LevelSpaceXWGUI.nlogo
release: string/string.jar cf/cf.jar xw/xw.jar $(XW_WIDGET_JARS) ls/ls.jar xw/widgets/LSWidgets/LSWidgets.jar custom-logging/custom-logging.jar LevelSpaceXWGUI.nlogo
mkdir -p dist/$(RELEASE_NAME)
$(foreach dir,$(shell find ls xw cf string | egrep jar | grep -v target | sed "s;[^/]*\.jar;;g" | uniq),mkdir -p dist/$(RELEASE_NAME)/$(dir);)
$(foreach jar,$?,cp "$(jar)" "dist/$(RELEASE_NAME)/$(jar)";)
tar -czf dist/$(RELEASE_NAME).tgz dist/$(RELEASE_NAME)
zip -r dist/$(RELEASE_NAME).zip dist/$(RELEASE_NAME)
$(foreach dir,$(shell find $(EXTENSION_ROOTS)| egrep jar | grep -v target | sed "s;[^/]*\.jar;;g" | uniq),mkdir -p dist/$(RELEASE_NAME)/$(dir);)
$(foreach jar,$(shell find $(EXTENSION_ROOTS) -type f -name '*.jar'),cp "$(jar)" "dist/$(RELEASE_NAME)/$(jar)";)
cp LevelSpaceXWGUI.nlogo dist/$(RELEASE_NAME)
cd dist && tar -czf $(RELEASE_NAME).tgz $(RELEASE_NAME)
cd dist && zip -r $(RELEASE_NAME).zip $(RELEASE_NAME)

clean:
rm -rf xw ls string cf
rm -rf xw ls string cf custom-logging
rm -rf dist/$(RELEASE_NAME)
git submodule foreach git clean -fdX
1 change: 1 addition & 0 deletions modules/Custom-Logging-Extension