Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 58270cf

Browse files
authored
doc: clarify getting-started
1 parent a42cbb2 commit 58270cf

1 file changed

Lines changed: 9 additions & 23 deletions

File tree

docs/getting-starting.md

Lines changed: 9 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Pre-requisites:
88
* You will need **jdk 8** installed (if you have multiple jdk versions installed you can switched between them using update-alternatives).
99
* You will need **maven** installed (possibly with some additional pluggins, so look out for these if error messages come up during compilation).
1010

11-
## Option 1: the installation route
12-
11+
## Maven installation
1312
git clone https://github.com/SpoonLabs/astor.git
1413
cd astor
1514
mvn install -DskipTests=true
@@ -19,46 +18,33 @@ In any case, most important test cases are always executed on [travis](https://t
1918

2019
Warning: Windows is only partially supported.
2120

22-
### Creating astor.jar containing dependencies.
23-
2421
mvn package -DskipTests=true
2522
26-
The following JAR will be created: `target/astor-0.0.2-SNAPSHOT-jar-with-dependencies.jar`
23+
The following JAR will be created by this command: `target/astor-0.0.2-SNAPSHOT-jar-with-dependencies.jar`
2724
This will referenced as `astor.jar` for the rest of this guide but you will need to replace it with the full line when inserting commands.
28-
29-
## Option 2: compiling and building class path separately
30-
31-
In addition to compiling and building the classpath for astor, the following also gives you the command required to compile an example test.
32-
33-
git clone https://github.com/SpoonLabs/astor.git
34-
cd astor
35-
mvn clean compile # compiling astor
36-
cd examples/Math-issue-280
37-
mvn clean compile test # compiling and running bug example
38-
cd ../../
39-
mvn dependency:build-classpath -B | egrep -v "(^\[INFO\]|^\[WARNING\])" | tee /tmp/astor-classpath.txt
40-
cat /tmp/astor-classpath.txt
41-
42-
Note: you will need to rebuild the class path each day if you store it in /tmp/ as suggested, so expect an error if you come back the following day and try to run astor without doing so.
4325

4426
## Executing the program
4527

4628
The execution of the program will be different depending on the build option you chose previously.
4729

48-
### Executing after building with option 2, demonstrated for jGenProg
30+
### Executing with jGenProg
4931

5032
We present a command line with the required arguments for executing jGenProg. Optional arguments found using option -help are also listed further down this document. The arguments can also be changed in "./target/classes/astor.properties".
5133

5234
Then the main execution command is as follows (note that the "location" argument is mandatory, and must be an absolute path):
5335

54-
java -cp $(cat /tmp/astor-classpath.txt):target/classes fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ -bintestfolder /target/test-classes/ -location /home/user/astor/examples/Math-issue-280/ -dependencies examples/Math-issue-280/lib
36+
cd examples/Math-issue-280
37+
mvn clean compile test -DskipTests # compiling and running bug example
38+
cd ../../
39+
java -cp target/astor-*-jar-with-dependencies.jar fr.inria.main.evolution.AstorMain -mode jgenprog -srcjavafolder /src/java/ -srctestfolder /src/test/ -binjavafolder /target/classes/ -bintestfolder /target/test-classes/ -location /home/user/astor/examples/Math-issue-280/ -dependencies examples/Math-issue-280/lib
5540

5641
The only part of the above command that you should need to alter is the absolute path that follows the -location argument.
5742

5843
Notes:
5944

6045
* the default ingredient scope is `package`, to change it do `ConfigurationProperties.properties.setProperty("scope","global")`
6146
* Always put code in a package, not in the default unnamed package.
47+
* if the project under repair has dependencies, you must use the `--dependencies` flag, see below.
6248

6349
### Output
6450

@@ -98,7 +84,7 @@ Folder “default” contains the original program, without any modification. It
9884

9985
Each folder "variant-x" is a valid solution to the repair problem (passes all tests). The "x" corresponds to the id (unique identifier) assigned to a variant. There is an command line argument `saveall` that allows you to save all variants that Astor generates, even if they are not a solution.
10086

101-
## Executing after building with option 1
87+
## Other repair modes
10288

10389
### jKali
10490

0 commit comments

Comments
 (0)