Skip to content
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
4 changes: 2 additions & 2 deletions ide/utils/sdk/sdk_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,9 +298,9 @@ def build(ctx):

ctx.set_group('bundle')
ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob(['src/pkjs/**/*.js', 'src/pkjs/**/*.json']), js_entry_file='src/pkjs/{{pkjs_entry}}')
"""
""".replace('{{pkjs_entry}}', project.pkjs_entry_point)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it possible to just chain this with the other replace instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean, something like...

return wscript.replace('{{jshint}}', 'True' if jshint and not for_export else 'False').replace('{{pkjs_entry}}', project.pkjs_entry_point or '')

?
It was chained before, but the problem was that project.pkjs_entry_point can be None.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To clarify why this should always work:

  • pkjs_entry_point is not-None if the project is a package, rocky, or [native project with commonjs selected]
  • This function is only called for native projects, and the {{pkjs_entry}} replacement only happens with commonjs selected, so pkjs_entry_point will never be None.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, my concern was not with the jshint parameter, but rather the pkjs_entry one. However, given that pkjs_entry being None is no longer an issue, I think chaining the pkjs replace with the existing jshint replace is sufficient.


return wscript.replace('{{jshint}}', 'True' if jshint and not for_export else 'False').replace('{{pkjs_entry}}', project.pkjs_entry_point)
return wscript.replace('{{jshint}}', 'True' if jshint and not for_export else 'False')


def generate_wscript_file(project, for_export=False):
Expand Down