Skip to content

Commit 8339b14

Browse files
authored
Update instructions for ArkAnalyzer (#306)
1 parent 180ca42 commit 8339b14

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

jacodb-ets/ARKANALYZER.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,13 @@ npm run build
1414

1515
The `npm run build` command will generate the `out` directory, which contains the compiled code.
1616

17+
### Usage of forked ArkAnalyzer
18+
19+
Most probably, you will have to use our fork of ArkAnalyzer (https://gitee.com/Lipenx/arkanalyzer) and checkout a specific branch that is consistent with the current state of jacodb.
20+
For this, replace the repo url in the commands above and use `git switch <branch>` to checkout the desired branch.
21+
22+
> Latest supported AA branch is `neo/2025-02-13`.
23+
1724
## Serialize TS to JSON
1825

1926
To serialize ArkIR to JSON for TypeScript files/projects, use the `serializeArkIR.ts` script:
@@ -35,11 +42,34 @@ Options:
3542
-h, --help display help for command
3643
```
3744

38-
You can also use `node <out>/serializeArkIR.js` directly (note the `.js` extension here!) instead of `npx`. Remember to run `npm run build` beforehand.
45+
You can also use `node <out>/serializeArkIR.js` directly (note the `.js` extension here!) instead of `npx ts-node`.
46+
Remember to run `npm run build` beforehand.
3947

4048
For example, to serialize ArkIR for all TS files in `resources/ts/` into the corresponding JSON files in `resources/ir/`, run:
4149

4250
```shell
4351
cd .../resources
4452
npx ts-node ~/dev/arkanalyzer/out/src/save/serializeArkIR.ts -m ts ir
4553
```
54+
55+
## Serialize sample projects and test the deserialization
56+
57+
To test the serialization/deserialization pipeline in jacodb, first prepare and serialize the projects using `prepare_repos.sh` (pulls repos with sources) and `prepare_projects.sh` (serializes all projects) scripts:
58+
59+
```shell
60+
cd jacodb-ets/src/test/resources
61+
bash prepare_repos.sh
62+
bash prepare_projects.sh
63+
```
64+
65+
(Use `-f` flag for `prepare_projects.sh` to force re-serialization, that is, override already existing folders.)
66+
67+
Then, to test the serialization, run jacodb tests devoted to the serialization:
68+
69+
```shell
70+
71+
The, run jacodb tests devoted to the deserialization:
72+
73+
```shell
74+
gw :jacodb-ets:test --tests "org.jacodb.ets.test.EtsFromJsonTest"
75+
```

0 commit comments

Comments
 (0)