how to run my analysis, no build.xml

147 views
Skip to first unread message

jbranchaud

unread,
Apr 2, 2012, 4:16:57 PM4/2/12
to chord-...@googlegroups.com
Hi,

I am attempting to build my own analysis with the Chord framework. I have created an Eclipse Java project and referenced Chord.jar as a library. I have now created a simple analysis that extends JavaAnalysis. I have also created a small Java program to run the analysis program. My chord.properties file has been written and is sitting in the project directory. I would now like to run my analysis to see how it works so that I can tweak it and make new analyses. The documentation online says to simply do ant <set various chord properties> run, but I am having issues with this.

When I try to execute that command (in terminal on Mac), I get "BuildFile: build.xml does not exists!" and "Build failed". Am I supposed to be running this command from a particular directory? I have used absolute paths for all the properties (work-dir, analysis location, analysis path). No where in the documentation did it say that I needed to have a build.xml file, but apparently I do need one. Is there a template for one? How do I set one up for my project/analyses? Where should build.xml be placed?

I appreciate your help!

Ariel Rabkin

unread,
Apr 2, 2012, 4:18:17 PM4/2/12
to chord-...@googlegroups.com
I just run the command from chord/main, which has a build.xml.

syntax is ant run -D.....

--Ari

> --
> You received this message because you are subscribed to the Google Groups
> "chord-discuss" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/chord-discuss/-/_NxXx4BQo7sJ.
> To post to this group, send email to chord-...@googlegroups.com.
> To unsubscribe from this group, send email to
> chord-discus...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/chord-discuss?hl=en.

--
Ari Rabkin asra...@gmail.com
UC Berkeley Computer Science Department

jbranchaud

unread,
Apr 2, 2012, 6:06:09 PM4/2/12
to chord-...@googlegroups.com
In my Eclipse project I have the chord.jar referenced, but I don't actually have the source checked out, so I am not sure that running ant from the chord/main directory would work. Is there a way to do this with just the JAR library and not the source?

> chord-discuss+unsubscribe@googlegroups.com.


> For more options, visit this group at
> http://groups.google.com/group/chord-discuss?hl=en.

Ariel Rabkin

unread,
Apr 2, 2012, 6:18:31 PM4/2/12
to chord-...@googlegroups.com
Aha, now I see what you want. Yes, that's also doable and I have done this.

I use the following command line:

java -Dchord.main.class=<mainClass> -Dchord.class.path=<path> <other
opts> -Dchord.props.file=chord.properties -jar chord.jar

I like to put a "nice -n 5 " in front of this, so the machine is still
friendly for interactive uses.

In my case, I needed to do this so I could run JChord inside a script
without the extra and confusing ant layer.

--Ari

On Mon, Apr 2, 2012 at 3:06 PM, jbranchaud <jbran...@gmail.com> wrote:
> In my Eclipse project I have the chord.jar referenced, but I don't actually
> have the source checked out, so I am not sure that running ant from the
> chord/main directory would work. Is there a way to do this with just the JAR
> library and not the source?

jbranchaud

unread,
Apr 3, 2012, 10:15:10 AM4/3/12
to chord-...@googlegroups.com
Thanks, this was just what I needed. I used the following command to get mine to run:

java -Dchord.work.dir=./ -Dchord.run.analyses=MethodPrinter -Dchord.java.analysis.path=./bin -Dchord.props.file=chord.properties -jar chord.jar

Note: there are some relative paths because I ran this from the root directory of my Eclipse project (i.e. work-dir is ./). Also, I have chord.jar in the directory that I am in (hence the relative path). And for the sake of completeness, the following is what my chord.properties file looks like:

    # specifies the fully qualified name of the main class to be analyzed
    chord.main.class=simple.BinaryNode
    # specifies the application classpath for the program
    chord.class.path=bin
    # specifies the Java source path for the program
    chord.src.path=subjects

Hope this can act as a useful example to others trying to run analyses that they are building in Eclipse.

Mayur Naik

unread,
Oct 2, 2012, 6:35:42 PM10/2/12
to chord-...@googlegroups.com
Perhaps the fact that your @Chord says the name is testAnalys*i*s whereas your command line says chord.run.analyses=testAnalys*e*s?

-- Mayur

On Tue, Oct 2, 2012 at 3:12 PM, <suvamth...@gmail.com> wrote:
Hi!
I am completely new to Chord and I have been trying hard to write my own analysis using Eclipse, and I'm facing similar issues. I want to do something very simple: write a Java analysis to print out the methods in a Java program.

I created a Java project and copied the files in chord-src-2.1 to it. Then I created my Java analysis file under chord/project/analyses
My file, testAnalysis.java, extends JavaAnalysis, is annotated with @Chord(name = "testAnalysis") and overrides the run().

Now I did ant compile
Then I ran
java -cp chord.jar -Dchord.work.dir=C:\Workspace\ChordTests -Dchord.run.analyses=testAnalyses chord.project.Boot

However, doing so results in the following error being logged in the working directory:

Chord run initiated at: 3 Oct, 2012 12:10:41 AM
java.lang.Error: ERROR: ClassicProject: Task named 'testAnalyses' not found in project.
    at chord.project.Messages.fatal(Messages.java:24)
    at chord.project.ClassicProject.getTask(ClassicProject.java:344)
    at chord.project.ClassicProject.runTask(ClassicProject.java:413)
    at chord.project.ClassicProject.run(ClassicProject.java:107)
    at chord.project.Main.run(Main.java:78)
    at chord.project.Main.main(Main.java:50)

What's going wrong? I would be really grateful if you could help me out with this.

Regards,
Suvam.

--
You received this message because you are subscribed to the Google Groups "chord-discuss" group.
To view this discussion on the web visit https://groups.google.com/d/msg/chord-discuss/-/CoutMMXXQBoJ.

To post to this group, send email to chord-...@googlegroups.com.
To unsubscribe from this group, send email to chord-discus...@googlegroups.com.

Suvam Mukherjee

unread,
Oct 3, 2012, 2:39:01 AM10/3/12
to chord-...@googlegroups.com
Hi Mayur,
Thanks a lot!
 
Regards,
Suvam.
Reply all
Reply to author
Forward
0 new messages