aboutsummaryrefslogtreecommitdiffstats
path: root/docs/teaching
diff options
context:
space:
mode:
authorehilsdal <ehilsdal>2003-09-09 18:26:18 +0000
committerehilsdal <ehilsdal>2003-09-09 18:26:18 +0000
commitab504b46ba5585a43018026976a44a5ccefcfe7c (patch)
treef13d9793053ac5100107e8f83364f50dc254dc4b /docs/teaching
parent1553a17192f29f74f7e7c065916d745d31bda4f8 (diff)
downloadaspectj-ab504b46ba5585a43018026976a44a5ccefcfe7c.tar.gz
aspectj-ab504b46ba5585a43018026976a44a5ccefcfe7c.zip
added in building architecture for turoial exercises
Diffstat (limited to 'docs/teaching')
-rwxr-xr-xdocs/teaching/exercises/README.txt92
-rwxr-xr-xdocs/teaching/exercises/build.xml154
-rw-r--r--docs/teaching/exercises/index.html2
-rwxr-xr-xdocs/teaching/exercises/install.txt63
-rwxr-xr-xdocs/teaching/exercises/junit.jarbin0 -> 121070 bytes
-rwxr-xr-xdocs/teaching/exercises/scripts/ajbrowser3
-rwxr-xr-xdocs/teaching/exercises/scripts/ajbrowser.bat9
-rwxr-xr-xdocs/teaching/exercises/scripts/ajc3
-rwxr-xr-xdocs/teaching/exercises/scripts/ajc.bat9
-rwxr-xr-xdocs/teaching/exercises/scripts/setpaths.bat15
-rwxr-xr-xdocs/teaching/exercises/scripts/setpaths.csh11
-rwxr-xr-xdocs/teaching/exercises/scripts/setpaths.sh18
12 files changed, 303 insertions, 76 deletions
diff --git a/docs/teaching/exercises/README.txt b/docs/teaching/exercises/README.txt
new file mode 100755
index 000000000..d06249316
--- /dev/null
+++ b/docs/teaching/exercises/README.txt
@@ -0,0 +1,92 @@
+AspectJ Figures Exercises
+------------------------------
+
+THIS FILE IS OUT-OF-DATE !!! (2003-3-17)
+
+These exercises are designed to be used with AspectJ 1.0.6.
+
+THEY MUST NOT BE DISTRIBUTED ELECTRONICALLY WITHOUT THINKING FIRST!!!
+There may be licence issues with just sticking the junit jar in there
+that I don't understand.
+
+To build distribution zips, use ant -f build.xml. This will create
+
+ EV-exercises.zip -- the contents of these exercises, minus AspectJ
+ EV-answers.zip -- some answers to these exercises.
+ EV-setup.zip -- the exercises bundled with AspectJ
+ EV-allcontent.zip -- the exercises bundled with the answers
+
+
+If you don't want to be bothered with specifying where AspectJ is,
+feel free to just do ant -f build.xml answers.zip. By default it will
+build both exercises and answers.
+
+------------------------------
+Required environment
+
+In order to actually do the exercises, the three very important files
+to have are:
+
+ EV-exercises.zip
+ aspectj-tools-1.0.6.jar
+ <some installer of java>
+
+It is almost certainly a good idea to hope that Java is already
+installed on the students' systems, but to provide two installers
+(windows and linux) anyway.
+
+ http://java.sun.com
+
+You may want to also include the rest of the AspectJ installers as
+well, but that might be a bit of a distraction
+
+ http://aspectj.org/dl
+
+These require junit.jar. I've included a copy in with the two zip
+files, but they might want to be refreshed every now and again.
+
+ http://junit.org
+
+
+------------------------------
+Printing
+
+It would be really nice to have an automated solution to generate the
+documents, but no such luck.
+
+* index.html should print out with useful page breaks. It should be
+ separated into four chunks if possible.
+
+* answers in four chunks.
+
+* quick reference sheets.
+
+Remember to have a one-sided copy of everything as a separate
+clean-copy.
+
+
+------------------------------
+Distribution
+
+ /j2sdk-1_4_1_01-linux-i586.bin
+ /j2sdk-1_4_1_01-windows-i586.exe
+ /exercises.zip containing:
+ aj-EV/src/figures.zip
+ aj-EV/src/aspectj-tools-1.0.6.jar
+ aj-EV/src/aspectj-docs-1.0.6.jar
+ aj-EV/<exploded version of figures.zip>
+ aj-EV/aspectj/<exploded version of aspectj-tools>
+ aj-EV/aspectj/<exploded version of aspectj-docs>
+ aj-EV/setpaths
+ aj-EV/setpaths.bat
+
+/bin/ajc, are edited to make sure that JAVA_HOME is used, as the
+defaults will almost certainly be wrong. setpaths scripts do what
+they look like they do. All six of these scripts are stored in
+scripts under CVS.
+
+---- Instructors
+
+Since the only difference is the answers, just overwrite the
+extraction directory with answers.zip.
+
diff --git a/docs/teaching/exercises/build.xml b/docs/teaching/exercises/build.xml
index faf523754..7793b4d19 100755
--- a/docs/teaching/exercises/build.xml
+++ b/docs/teaching/exercises/build.xml
@@ -1,115 +1,119 @@
-<project name="build" default="dist" basedir=".">
+<!--
+
+This build script will create a directory called burn that is
+_almost_ suitable for burning onto a CD. However, there
+are a number of things that should be done to this directory
+before actually burning:
+
+The PDFs in the print directory need to be manually generated.
+Use the content of foo.pdf.contents to generate foo.pdf, and
+and then delete the foo.pdf.contents directory.
+
+The powerpoint and packages directory should be populated
+with whatever you want to populate it with. The
+packages directory is typically filled with Linux installers
+and a clean AspectJ installer.
+-->
+
+<project name="build" default="burn" basedir=".">
<description>
- Build the exercises we do at various conferences
+ Build a CD image containing AspectJ exercises.
</description>
- <!-- this directory needs to hold tools and docs, unpacked -->
- <property name="aj.home" value="c:/apps/aspectj106" />
+ <!-- CUSTOMIZE THESE PROPERTIES -->
- <!-- this is the name of the tutorial event -->
- <property name="aj.event" value="aosd2003" />
+ <!-- this directory should hold a clean unpacked AspectJ release -->
+ <property name="aj.home" value="c:/apps/aspectj11" />
+
+ <!-- this is the name of the event -->
+ <property name="aj.event" value="oopsla2003" />
+
+ <!-- NO CUSTOMIZABLE PROPERTIES BELOW HERE -->
+
+ <property name="burndir" value="burn" />
+ <property name="eventdir" value="${burndir}/aj-${aj.event}" />
+ <property name="packagedir" value="${burndir}/packages" />
+ <property name="printdir" value="${burndir}/print" />
+ <property name="powerpointdir" value="${burndir}/powerpoint" />
<!-- now real targets -->
+ <target name="burn" depends="clean,skeleton,event,answers,printables" />
- <target name="dist"
- depends="clean,distdir,exercises.zip,answers.zip" />
+ <target name="printables" depends="skeleton">
+ <delete dir="${printdir}/answers.pdf.contents" />
+ <mkdir dir="${printdir}/answers.pdf.contents" />
+ <copy toDir="${printdir}/answers.pdf.contents">
+ <fileset dir="answers" includes="*.java" excludes="Answer.java"/>
+ </copy>
- <target name="event.zip" depends="tools,exercises">
- <zip destfile="dist/${aj.event}.zip">
- <zipfileset dir="dist/aj-${aj.event}"
- prefix="aj-${aj.event}"
- excludes="answers/*.java"
- />
- <zipfileset dir="dist/aj-${aj.event}"
- prefix="aj-${aj.event}"
- includes="answers/Answer.java"
- />
- </zip>
+ <delete dir="${printdir}/exercises.pdf.contents" />
+ <mkdir dir="${printdir}/exercises.pdf.contents" />
+ <copy toDir="${printdir}/exercises.pdf.contents" file="index.html" />
+
+ <delete dir="${printdir}/install.pdf.contents" />
+ <mkdir dir="${printdir}/install.pdf.contents" />
+ <copy toDir="${printdir}/install.pdf.contents" file="install.txt" />
</target>
- <target name="exercises.zip" depends="exercises">
- <zip destfile="dist/${aj.event}-exercises.zip">
- <zipfileset dir="dist/aj-${aj.event}"
- prefix="aj-${aj.event}"
- includes="junit.jar,base.lst,guibase.lst,*.html,support/**/*.java,figures/**/*.java,tests/**/*.java,answers/Answer.java"
+ <target name="answers" depends="skeleton">
+ <zip destfile="${packagedir}/${aj.event}-answers.zip">
+ <zipfileset dir="answers"
+ prefix="aj-${aj.event}/answers"
+ includes="*.java"
+ excludes="Answer.java"
/>
- </zip>
+ </zip>
+ </target>
+
+ <target name="event" depends="tools,exercises">
+ <filter token="aj.event" value="${aj.event}" />
+ <copy file="install.txt" toDir="${eventdir}" filtering="yes" />
</target>
- <target name="answers.zip" depends="answers">
- <zip destfile="dist/${aj.event}-answers.zip">
- <zipfileset dir="dist/aj-${aj.event}"
- prefix="aj-${aj.event}"
- includes="answers/*.java"
- excludes="answers/Answer.java"
+ <target name="exercises" depends="skeleton">
+ <copy toDir="${eventdir}">
+ <fileset dir="."
+ includes="junit.jar,base.lst,guibase.lst,*.html,support/**/*.java,figures/**/*.java,tests/**/*.java,answers/Answer.java"
/>
- </zip>
+ </copy>
</target>
- <target name="tools" depends="eventdir">
- <mkdir dir="dist/aj-${aj.event}" />
- <mkdir dir="dist/aj-${aj.event}/aspectj" />
+ <target name="tools" depends="skeleton">
+ <mkdir dir="${eventdir}/aspectj" />
<filter token="aj.event" value="${aj.event}" />
- <copy toDir="dist/aj-${aj.event}/aspectj">
+ <copy toDir="${eventdir}/aspectj">
<fileset dir="${aj.home}" excludes="bin/**" />
</copy>
- <copy toDir="dist/aj-${aj.event}/aspectj/bin" filtering="yes">
+ <copy toDir="${eventdir}/aspectj/bin" filtering="yes">
<fileset dir="scripts" excludes="setpaths*" />
</copy>
- <copy toDir="dist/aj-${aj.event}" filtering="yes">
+ <copy toDir="${eventdir}" filtering="yes">
<fileset dir="scripts" includes="setpaths*" />
</copy>
- <fixcrlf srcDir="dist/aj-${aj.event}"
+ <fixcrlf srcDir="${eventdir}"
includes="setpaths.bat,aspectj/bin/ajbrowser.bat,aspectj/bin/ajc.bat"
eol="crlf" />
- <fixcrlf srcDir="dist/aj-${aj.event}"
+ <fixcrlf srcDir="${eventdir}"
includes="setpaths.sh,setpaths.csh,aspectj/bin/ajbrowser,aspectj/bin/ajc"
eol="lf" />
</target>
- <target name="exercises" depends="eventdir">
- <filter token="aj.event" value="${aj.event}" />
- <copy file="install.txt" toDir="dist/aj-${aj.event}" filtering="yes" />
- <copy toDir="dist/aj-${aj.event}">
- <fileset dir="."
- includes="junit.jar,base.lst,guibase.lst,*.html,support/**/*.java,figures/**/*.java,tests/**/*.java,answers/Answer.java"
- />
- </copy>
- </target>
-
- <target name="answers" depends="eventdir">
- <copy toDir="dist/aj-${aj.event}">
- <fileset dir="."
- includes="answers/*.java"
- excludes="answers/Answer.java"
- />
- </copy>
- </target>
-
- <target name="allcontent.zip" depends="exercises.zip,answers.zip">
- <zip destfile="dist/${aj.event}-notools.zip">
- <zipfileset src="dist/${aj.event}-exercises.zip" />
- <zipfileset src="dist/${aj.event}-answers.zip" />
- </zip>
- </target>
-
- <target name="distdir">
- <mkdir dir="dist" />
- </target>
-
- <target name="eventdir" depends="distdir">
- <mkdir dir="dist/aj-${aj.event}" />
+ <target name="skeleton">
+ <mkdir dir="${burndir}" />
+ <mkdir dir="${eventdir}" />
+ <mkdir dir="${packagedir}" />
+ <mkdir dir="${printdir}" />
+ <mkdir dir="${powerpointdir}" />
</target>
<target name="clean">
- <delete dir="dist" />
+ <delete dir="burn" />
</target>
<target name="javaclean">
- <delete dir="dist" />
+ <delete dir="burn" />
</target>
-
</project>
diff --git a/docs/teaching/exercises/index.html b/docs/teaching/exercises/index.html
index 0e381b3c3..d1ec1b4fd 100644
--- a/docs/teaching/exercises/index.html
+++ b/docs/teaching/exercises/index.html
@@ -4,7 +4,7 @@
</head>
<body bgcolor="white">
-<h1>AspectJ Exercises</h1>
+<h2>Advanced Aspect-Oriented Programming with AspectJ</h2>
<h3>Organization</h3>
diff --git a/docs/teaching/exercises/install.txt b/docs/teaching/exercises/install.txt
new file mode 100755
index 000000000..ccb2b9e71
--- /dev/null
+++ b/docs/teaching/exercises/install.txt
@@ -0,0 +1,63 @@
+0. Install
+
+ Now get the directory "aj-@aj.event@/". Just copy the
+ "aj-@aj.event@/" directory from the provided CD.
+
+ If you're running a Windows machine, we recommend you copy into
+ "c:\". If you're running your favorite Unix (we've had success under
+ Linux and MacOS X), we recommend you install into "~\".
+
+1. Configure
+
+ Our installation is fairly well self-contained, but it does need to know
+ where Java lives. To do this you must set the environment variable named
+ JAVA_HOME. This variable should point to something like
+
+ c:\apps\jdk1.3.1_04
+ /usr/java
+ /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
+
+ depending on your system. You may either do this globally, or you may
+ edit the appropriate setpaths script:
+
+ setpaths.bat (under Windows)
+ setpaths.sh (if you run bash/sh/ksh, like most Linux setups)
+ setpaths.csh (if you run csh, like most MacOS X setups)
+
+ Also, if you installed into a directory other than "c:\" or "~/", then you
+ need to change the EXTRACTION environment variable in the setpaths script.
+
+2. Test
+
+ Open a new command shell and change to the "aj-@aj.event@/" directory.
+
+ We have provided a "setpaths" script to set permissions and various paths
+ variables, so run this script:
+
+ > setpaths.bat (under Windows)
+ > source setpaths.sh (if you run bash/sh/ksh, like most Linux setups)
+ > source setpaths.csh (if you run csh, like most MacOS X setups)
+
+ You must remember to run this script every time you open a new command
+ shell.
+
+ Now, compile the core system with ajc:
+
+ > ajc -argfile guibase.lst
+
+ This should compile the figures application (source code in the figures
+ directory) as well as a single unit test (source code in the tests
+ directory).
+
+ See if the compile was successful by running the gui figures app you just
+ compiled:
+
+ > java figures.gui.Main
+
+ And, after quitting out of the gui figures app, run the unit test:
+
+ > java tests.Test
+ ....
+ Time: 0.076
+
+ OK (4 tests)
diff --git a/docs/teaching/exercises/junit.jar b/docs/teaching/exercises/junit.jar
new file mode 100755
index 000000000..674d71e89
--- /dev/null
+++ b/docs/teaching/exercises/junit.jar
Binary files differ
diff --git a/docs/teaching/exercises/scripts/ajbrowser b/docs/teaching/exercises/scripts/ajbrowser
new file mode 100755
index 000000000..2f804efda
--- /dev/null
+++ b/docs/teaching/exercises/scripts/ajbrowser
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+"$JAVA_HOME/bin/java" -classpath "$ASPECTJ_HOME/lib/aspectjtools.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH" -Xmx64M org.aspectj.tools.ajbrowser.Main "$@"
diff --git a/docs/teaching/exercises/scripts/ajbrowser.bat b/docs/teaching/exercises/scripts/ajbrowser.bat
new file mode 100755
index 000000000..dd717ccae
--- /dev/null
+++ b/docs/teaching/exercises/scripts/ajbrowser.bat
@@ -0,0 +1,9 @@
+@echo off
+if exist "%JAVA_HOME%\bin\java.exe" goto haveJava
+if exist "%JAVA_HOME%\bin\java.bat" goto haveJava
+if exist "%JAVA_HOME%\bin\java" goto haveJava
+echo java does not exist as %JAVA_HOME%\bin\java
+echo please fix the JAVA_HOME environment variable
+
+:haveJava
+"%JAVA_HOME%\bin\java" -classpath "%ASPECTJ_HOME%\lib\aspectjtools.jar;%JAVA_HOME%\lib\tools.jar;%CLASSPATH%" -Xmx64M org.aspectj.tools.ajbrowser.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/docs/teaching/exercises/scripts/ajc b/docs/teaching/exercises/scripts/ajc
new file mode 100755
index 000000000..f8f45ee35
--- /dev/null
+++ b/docs/teaching/exercises/scripts/ajc
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+"$JAVA_HOME/bin/java" -classpath "$ASPECTJ_HOME/lib/aspectjtools.jar:$JAVA_HOME/lib/tools.jar:$CLASSPATH" -Xmx64M org.aspectj.tools.ajc.Main "$@"
diff --git a/docs/teaching/exercises/scripts/ajc.bat b/docs/teaching/exercises/scripts/ajc.bat
new file mode 100755
index 000000000..ca51b07be
--- /dev/null
+++ b/docs/teaching/exercises/scripts/ajc.bat
@@ -0,0 +1,9 @@
+@echo off
+if exist "%JAVA_HOME%\bin\java.exe" goto haveJava
+if exist "%JAVA_HOME%\bin\java.bat" goto haveJava
+if exist "%JAVA_HOME%\bin\java" goto haveJava
+echo java does not exist as %JAVA_HOME%\bin\java
+echo please fix the JAVA_HOME environment variable
+
+:haveJava
+"%JAVA_HOME%\bin\java" -classpath "%ASPECTJ_HOME%\lib\aspectjtools.jar;%JAVA_HOME%\lib\tools.jar;%CLASSPATH%" -Xmx64M org.aspectj.tools.ajc.Main %1 %2 %3 %4 %5 %6 %7 %8 %9
diff --git a/docs/teaching/exercises/scripts/setpaths.bat b/docs/teaching/exercises/scripts/setpaths.bat
new file mode 100755
index 000000000..c750e1d10
--- /dev/null
+++ b/docs/teaching/exercises/scripts/setpaths.bat
@@ -0,0 +1,15 @@
+@echo off
+
+rem Change this to be the full path for this directory
+set EXTRACTION=c:\aj-@aj.event@
+
+if exist "%JAVA_HOME%\bin\java.exe" goto haveJava
+if exist "%JAVA_HOME%\bin\java.bat" goto haveJava
+if exist "%JAVA_HOME%\bin\java" goto haveJava
+echo java does not exist as %JAVA_HOME%\bin\java
+echo please fix the JAVA_HOME environment variable
+
+:haveJava
+set ASPECTJ_HOME=%EXTRACTION%\aspectj
+set PATH=%ASPECTJ_HOME%\bin;%PATH%
+set CLASSPATH=.;%ASPECTJ_HOME%\lib\aspectjrt.jar;%EXTRACTION%\junit.jar
diff --git a/docs/teaching/exercises/scripts/setpaths.csh b/docs/teaching/exercises/scripts/setpaths.csh
new file mode 100755
index 000000000..88482de8b
--- /dev/null
+++ b/docs/teaching/exercises/scripts/setpaths.csh
@@ -0,0 +1,11 @@
+# this file should be sourced, NOT executed
+
+# Change this to be the full path for this directory
+set EXTRACTION=$HOME/aj-@aj.event@
+
+set ASPECTJ_HOME=$EXTRACTION/aspectj
+set PATH=$ASPECTJ_HOME/bin:$PATH
+set CLASSPATH=.:$ASPECTJ_HOME/lib/aspectjrt.jar:$EXTRACTION/junit.jar
+
+chmod a+x $ASPECTJ_HOME/bin/ajc
+chmod a+x $ASPECTJ_HOME/bin/ajbrowser
diff --git a/docs/teaching/exercises/scripts/setpaths.sh b/docs/teaching/exercises/scripts/setpaths.sh
new file mode 100755
index 000000000..f54f3dfaf
--- /dev/null
+++ b/docs/teaching/exercises/scripts/setpaths.sh
@@ -0,0 +1,18 @@
+# this file should be sourced, NOT executed
+
+# Change this to be the full path for this directory
+EXTRACTION=$HOME/aj-@aj.event@
+
+if [ "$JAVA_HOME" = "" ]
+then
+ echo Please remember to manually set $JAVA_HOME to
+ echo the location of your java installation
+fi
+
+export ASPECTJ_HOME=$EXTRACTION/aspectj
+export PATH=$ASPECTJ_HOME/bin:$PATH
+export CLASSPATH=.:$ASPECTJ_HOME/lib/aspectjrt.jar:$EXTRACTION/junit.jar
+
+chmod a+x $ASPECTJ_HOME/bin/ajc
+chmod a+x $ASPECTJ_HOME/bin/ajbrowser
+