Skip to content

Module search paths can be shared between tools. #325

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/tla2tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ const NO_ERROR = 0;
const MIN_TLA_ERROR = 10; // Exit codes not related to tooling start from this number
const LOWEST_JAVA_VERSION = 8;
const DEFAULT_GC_OPTION = '-XX:+UseParallelGC';
const TLA_CMODS_LIB_NAME = 'CommunityModules-deps.jar';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. This works for Java if I understand correctly, but for the TLAPS to use modules from both jars, I have to provide them both as module search paths.

By the way, I added support for using modules from zips/jars in TLAPM.

const TLA_TOOLS_LIB_NAME = 'tla2tools.jar';
const TLA_TOOLS_LIB_NAME_END_UNIX = '/' + TLA_TOOLS_LIB_NAME;
const TLA_TOOLS_LIB_NAME_END_WIN = '\\' + TLA_TOOLS_LIB_NAME;
const toolsJarPath = path.resolve(__dirname, '../tools/' + TLA_TOOLS_LIB_NAME);
const cmodsJarPath = path.resolve(__dirname, '../tools/' + TLA_CMODS_LIB_NAME);
const javaCmd = 'java' + (process.platform === 'win32' ? '.exe' : '');
const javaVersionChannel = new ToolOutputChannel('TLA+ Java version');
const TLA_TOOLS_STANDARD_MODULES = '/tla2sany/StandardModules';
Expand Down Expand Up @@ -158,7 +160,8 @@ async function runTool(

export function moduleSearchPaths(): string[] {
return [
'jar:file:' + toolsJarPath + '!' + TLA_TOOLS_STANDARD_MODULES
'jar:file:' + toolsJarPath + '!' + TLA_TOOLS_STANDARD_MODULES,
'jar:file:' + cmodsJarPath + '!' + '/'
];
}

Expand Down