weixin_39557419
weixin_39557419
2020-12-09 11:23

Compilation

It would be neat if it was possible to trigger compilation from IntelliJ Idea. I previously used an external-tools for this purpose, but this proved next to impossible on Mac.

该提问来源于开源项目:dmarcotte/idea-handlebars

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

9条回答

  • weixin_39987847 weixin_39987847 5月前

    Having some sort of build mechanism could be interesting, but I'm concerned that since there's such a variety of ways across different projects, and what mustache dialect they are using, and whether or not they are precompiling (and with what mechanism), that it seems tough to create something appropriate.

    I don't want to leave you hanging though; what problems are you having with External Tools on Mac? I bet we can get that fixed up for you.

    点赞 评论 复制链接分享
  • weixin_39557419 weixin_39557419 5月前

    I see your predicament.

    The problem is a well known one. The context in which PhpStorm executes commands differs from the context given by ie. bash. A lot of workarounds exists around the net, but they all focus on the same thing. Duplicate the settings you need for the application that needs them. Apple has altered the behaviour regarding this at least three times. The last known working fix is to edit the Info.plist for the application in question. I did try this, but I was unable to create the environment grunt needs to do the compilation. The path-variable seems to be the most important one.

    A little snippet from my current Info.plist:

    LSEnvironment $PATH /usr/local/sbin/:/Users/henning/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/bin/

    The key probably should be just "PATH". I added the $-character in desperation! :p This method also has at least one drawback I can think of. For every update/EAP I install, this file needs to be edited.

    I installed node via homebrew and grunt via node if I remember correctly.

    点赞 评论 复制链接分享
  • weixin_39987847 weixin_39987847 5月前

    Ah... that does sound sticky. I unfortunately haven't had experience with your toolchain, so it looks like I probably can't be much help after all. Upvoting and/or commenting on any issues related to this on http://youtrack.jetbrains.com/ might help...

    And you probably already thought of this, but I'll mention it just in case it's helpful: if it would positively impact developer happiness, it could be worth changing your build process to work around this.

    I'm going to close this, but as always, feel free to file more issues anytime.

    点赞 评论 复制链接分享
  • weixin_39557419 weixin_39557419 5月前

    Finally found the solution. 1. Add this key to Webstorm.app/Contents/Info.plist:

    LSEnvironment PATH [Your Path Value]

    2.Update: /System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -v -f /Applications/WebStorm.app

    The process is the same for PhpStorm. The second step is the one I was missing.

    Just thought I'd let you know! :)

    点赞 评论 复制链接分享
  • weixin_39987847 weixin_39987847 5月前

    Sweet! I'm glad you got that worked out, and thanks for posting the solution (good chance it'll help someone else out).

    点赞 评论 复制链接分享
  • weixin_39557419 weixin_39557419 5月前

    PhpStorm recently added support for file-watchers. The new plugin has some issues with this plugin. I posted an issue here: http://youtrack.jetbrains.com/issue/WI-16712. Jetbrains will probably fix it, just thought you should know! :)

    点赞 评论 复制链接分享
  • weixin_39987847 weixin_39987847 5月前

    Thanks for the heads up ! I'll see if there's anything I can do to help...

    点赞 评论 复制链接分享
  • weixin_39557419 weixin_39557419 5月前

    I see you have already helped! Not bad! :)

    点赞 评论 复制链接分享
  • weixin_39987847 weixin_39987847 5月前

    :) Always glad when I can pitch in.

    Also: thanks for bringing the File Watcher plugin to my attention... definitely going to make use of it in the future.

    点赞 评论 复制链接分享

相关推荐