summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2009-02-18 22:26:07 +0000
committerPaul Buetow <paul@buetow.org>2009-02-18 22:26:07 +0000
commit832b02ef0fbf477dbd73dcedfbfb5c9093b82c8c (patch)
tree0c3f19893282fca75b3f14f6fa428ba99cc0939b
parent9d33ec10dba1bfea791aa6b117370728ec71afe8 (diff)
ant works
-rw-r--r--Makefile37
-rw-r--r--TODO.txt1
-rw-r--r--build.xml35
3 files changed, 29 insertions, 44 deletions
diff --git a/Makefile b/Makefile
index 0404568..5894c3e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,8 +1,6 @@
PASSWORD=123456
all:
- javac shared/Main.java
-run:
- java shared/Main
+ echo Use ant for building the sources
sslclientrun:
java \
-Djavax.net.ssl.keyStore=./SSL/clientKeys \
@@ -18,14 +16,6 @@ sslserverrun:
-Djavax.net.ssl.trustStore=./SSL/serverTrust \
-Djavax.net.ssl.trustStorePassword=$(PASSWORD) \
shared/Main --server-only
-test: all run
-t: test
-err:
- sh -c 'make 2> err'
-clean:
- find ./ -name '*.class' -exec rm -f {} \;
- find . -name '*.jar' -exec rm -f {} \;
- if [ -d ./dist ]; then rm -Rf dist; fi
astyle:
find ./ -name '*.java' -exec sh -c 'astyle -s2 {}; rm -f {}.orig' \;
check:
@@ -33,32 +23,7 @@ check:
'{ if (length($$0) > 80) { \
printf "Max line length reached @ %s:%d => %d\n", \
f, NR, length($$0) } }' $$f; done
-stats:
- @sh -c 'wc=`find ./ -name "*.java" | xargs wc -l`; \
- echo "===> Num source files : `echo \"$$wc\" | \
- grep -E \"\\.java$$\" | wc -l`"; \
- echo "===> Num of source lines: `echo \"$$wc\" | \
- tail -n 1 | sed s/total//`"'
newline:
@echo
-replace:
- find ./ -name '*.java' -exec sh -c 'sed -n "s/$(FROM)/$(INTO)/g; \
- w .tmp" {} && mv -f .tmp {}' \;
-headers:
- @find ./ -name '*.java' -exec sh -c 'export FILE={}; \
- make header' \;
-header:
- @echo "===> Processing $(FILE)"
- @sed -n '/*:/d; w .tmp' $(FILE)
- @header=`sed 's/\(.*\)/ echo " \*: \1"/' $(HEADER)`; \
- echo '/*:*' > $(FILE); eval "$$header" >> $(FILE); \
- echo ' *:*/' >> $(FILE); cat .tmp >> $(FILE); rm -f .tmp
sslkeygen:
keytool -genkey -keystore mySrvKeystore -keyalg RSA
-createjar: clean all
- jar cvfm NetCalendar.jar MANIFEST.MF `find . -name \*.class`
-createdist: createjar
- mkdir ./dist
- cp NetCalendar.jar dist
- cp -R *.txt calendardb config.txt images SSL ./dist
- find ./dist -type d -name .svn | xargs rm -Rf
diff --git a/TODO.txt b/TODO.txt
index a4e4e12..139a960 100644
--- a/TODO.txt
+++ b/TODO.txt
@@ -1,2 +1 @@
Hot keys
-Ant
diff --git a/build.xml b/build.xml
index 0255c2e..feb7fed 100644
--- a/build.xml
+++ b/build.xml
@@ -4,6 +4,7 @@
<!-- set global properties for this build -->
<property name="sources" location="sources" />
<property name="dist" location="dist" />
+ <property name="jar" location="jar" />
<property name="classes" location="classes" />
<target name="init">
@@ -24,36 +25,56 @@
<copy file="config.txt" tofile="${classes}/config.txt" />
</target>
- <target name="dist" depends="compile" description="generate the distribution" >
+ <target name="jar" depends="compile" description="generate the jar" >
<delete file="MANIFEST.MF" />
<manifest file="MANIFEST.MF">
<attribute name="Built-By" value="Dipl.-Inform. (FH) Paul C. Buetow" />
<attribute name="Main-Class" value="shared/Main" />
</manifest>
+ <mkdir dir="${jar}/lib" />
+ <jar jarfile="${jar}/lib/NetCalendar-${DSTAMP}.jar" basedir="${classes}" manifest="MANIFEST.MF" />
+ <copy file="${jar}/lib/NetCalendar-${DSTAMP}.jar" tofile="${jar}/lib/NetCalendar-Latest.jar" />
+ </target>
- <mkdir dir="${dist}/lib" />
- <jar jarfile="${dist}/lib/NetCalendar-${DSTAMP}.jar" basedir="${classes}" manifest="MANIFEST.MF" />
- <copy file="${dist}/lib/NetCalendar-${DSTAMP}.jar" tofile="${dist}/lib/NetCalendar-Latest.jar" />
+ <target name="dist" depends="jar" description="generate the distribution" >
+ <mkdir dir="${dist}/" />
+ <copy file="${jar}/lib/NetCalendar-Latest.jar" tofile="${dist}/NetCalendar.jar" />
+ <copy todir="${dist}/icons">
+ <fileset dir="icons" />
+ </copy>
+ <copy todir="${dist}/images">
+ <fileset dir="images" />
+ </copy>
+ <copy todir="${dist}/SSL">
+ <fileset dir="SSL" />
+ </copy>
+ <copy todir="${dist}/calendardb">
+ <fileset dir="calendardb" />
+ </copy>
+ <copy file="config.txt" tofile="${dist}/config.txt" />
+ <copy file="CHANGELOG.txt" tofile="${dist}/CHANGELOG.txt" />
+ <copy file="README.txt" tofile="${dist}/README.txt" />
+ <copy file="LICENSE.txt" tofile="${dist}/LICENSE.txt" />
+ <copy file="TODO.txt" tofile="${dist}/TODO.txt" />
</target>
<target name="clean" description="clean up" >
<delete dir="${basedir}/javadoc/" />
<delete dir="${classes}" />
<delete dir="${dist}" />
+ <delete dir="${jar}" />
<delete file="MANIFEST.MF" />
</target>
<target name="rundist" depends="dist">
- <java jar="${dist}/lib/NetCalendar-Latest.jar" fork="true" />
+ <java jar="${dist}/NetCalendar.jar" fork="true" />
</target>
<target name="run" depends="compile">
<java dir="${classes}" classname="shared.Main" fork="true" />
</target>
- <target name="testdist" depends="dist,rundist" />
-
<target name="test" depends="compile">
<java dir="${classes}" classname="shared.Main" fork="true">
<!-- <arg value="-debug" /> -->