diff --git a/jacodb-ets/ARKANALYZER.md b/jacodb-ets/ARKANALYZER.md index 0b750a1a7..a3969696a 100644 --- a/jacodb-ets/ARKANALYZER.md +++ b/jacodb-ets/ARKANALYZER.md @@ -14,6 +14,13 @@ npm run build The `npm run build` command will generate the `out` directory, which contains the compiled code. +### Usage of forked ArkAnalyzer + +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. +For this, replace the repo url in the commands above and use `git switch ` to checkout the desired branch. + +> Latest supported AA branch is `neo/2025-02-13`. + ## Serialize TS to JSON To serialize ArkIR to JSON for TypeScript files/projects, use the `serializeArkIR.ts` script: @@ -35,7 +42,8 @@ Options: -h, --help display help for command ``` -You can also use `node /serializeArkIR.js` directly (note the `.js` extension here!) instead of `npx`. Remember to run `npm run build` beforehand. +You can also use `node /serializeArkIR.js` directly (note the `.js` extension here!) instead of `npx ts-node`. +Remember to run `npm run build` beforehand. For example, to serialize ArkIR for all TS files in `resources/ts/` into the corresponding JSON files in `resources/ir/`, run: @@ -43,3 +51,25 @@ For example, to serialize ArkIR for all TS files in `resources/ts/` into the cor cd .../resources npx ts-node ~/dev/arkanalyzer/out/src/save/serializeArkIR.ts -m ts ir ``` + +## Serialize sample projects and test the deserialization + +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: + +```shell +cd jacodb-ets/src/test/resources +bash prepare_repos.sh +bash prepare_projects.sh +``` + +(Use `-f` flag for `prepare_projects.sh` to force re-serialization, that is, override already existing folders.) + +Then, to test the serialization, run jacodb tests devoted to the serialization: + +```shell + +The, run jacodb tests devoted to the deserialization: + +```shell +gw :jacodb-ets:test --tests "org.jacodb.ets.test.EtsFromJsonTest" +```