Project Perfect让Swift在服务器端跑起来-Perfect in Visual St

编者语 : 本系列文章已经被Perfect官方引用了,这种感受很好,感恩!Thx all !json

       

       Visual Studio Code是一个轻量级的编辑器,但也功能丰富,经过插件你能够完成如Cordova,ReactNative,NodeJS,PHP,ASP.NET Core 的开发。上文经过Visual Studio Code对Perfect文件进行编辑,但编译过程仍是在终端中完成。其实经过对Visual Studio Code 添加tasks.json就能够完成对Perfect项目的编译工做。app

       这里有个疑问,为什么选择Visual Studio Code ? 这是一个好复杂的三角关系,如图:less

            

       Microsoft + Swift + Linux = True Love编辑器

       (固然你能够说哥有所执拗,可是这是爱,并且微软表明的是生产力啊!)ui

       咱们继续引用上篇博客中的例子(这里建议在root帐号下进行)this

       1. Ctrl+Shit+P 以后输入Configure Task Runner 回车后就会生成tasks.json文件spa

       

       2. 配置tasks.json 因为是编译成动态库, 因此咱们能够把task.json按照C++的编译方式进行配置.net

 

[plain] view plain copy插件

 print?在CODE上查看代码片派生到个人代码片debug

  1. {  
  2.     "version": "0.1.0",  
  3.     "command": "make",  
  4.     "isShellCommand": true,  
  5.     "tasks": [  
  6.         {  
  7.             "taskName": "makefile",  
  8.             // Make this the default build command.  
  9.             "isBuildCommand": true,  
  10.             // Show the output window only if unrecognized errors occur.  
  11.             "showOutput": "always",  
  12.             // No args  
  13.             "args": ["all"],  
  14.             // Use the standard less compilation problem matcher.  
  15.             "problemMatcher": {  
  16.                 "owner": "cpp",  
  17.                 "fileLocation": ["relative", "${workspaceRoot}"],  
  18.                 "pattern": {  
  19.                     "regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",  
  20.                     "file": 1,  
  21.                     "line": 2,  
  22.                     "column": 3,  
  23.                     "severity": 4,  
  24.                     "message": 5  
  25.                 }  
  26.             }  
  27.         }  
  28.     ]  
  29. }  

          3. 保存tasks.json后你就能够直接编译你的Perfect项目了

 

          
          注意: 固然你也能够经过他去排错,但遗憾一点就是不能debug。(这个问题已经和Perfect的团队说起了,但愿能尽早跟进)。

          好,接下来的博客我会谈谈项目实战,欢迎世界各地的朋友继续留意,也给我更多的反馈!

相关文章
相关标签/搜索