-
Notifications
You must be signed in to change notification settings - Fork 83
Fix building native projects with old-style JS #335
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
Conversation
ide/utils/sdk/sdk_scripts.py
Outdated
| 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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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_pointis 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.
There was a problem hiding this comment.
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.
|
Would you mind fixing cloudpebble/ide/utils/sdk/sdk_scripts.py Line 295 in 95dc7af
|
|
Do you want to get rid of just that instance of passing in json, or all of them? |
|
|
|
👍 |
This fixes a regression in the 4.0 release where building projects using JS concatenation would result in a