Skip to content

Commit

Permalink
hello-world for cjp
Browse files Browse the repository at this point in the history
  • Loading branch information
ahadas committed Mar 5, 2015
1 parent aba3c5f commit be6afe6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 0 deletions.
10 changes: 10 additions & 0 deletions closures_demos/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,14 @@
<java classname="bonusprogram.Main" classpath=".:${outjar}:${aspectjrt}"/>
</target>

<target name="weave_helloworld" depends="clean">
<java fork="true" classname="org.aspectj.tools.ajc.Main" classpath="${classpath_for_weaving}">
<arg line="-1.5 -Xset:pipelineCompilation=false -outjar ${outjar} helloworld/src/Impact.aj helloworld/src/HelloWorld.java"/>
</java>
</target>

<target name="test_helloworld" depends="weave_helloworld">
<java classname="test.HelloWorld" classpath=".:${outjar}:${aspectjrt}"/>
</target>

</project>
15 changes: 15 additions & 0 deletions closures_demos/helloworld/src/HelloWorld.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package test;

public class HelloWorld {
public static void main(String[] args) {
exhibit say(String message) {
System.out.println("Hello, " + message);
}("World");
}
}






16 changes: 16 additions & 0 deletions closures_demos/helloworld/src/Impact.aj
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package test;

aspect Impact {
joinpoint void say(String message);

after say(String message) {
System.out.println(
"It did a " + message + " of good.");
}
}






0 comments on commit be6afe6

Please sign in to comment.