Currently I'm using a custom task.json file to compile and run C and C++ code in Linux:
{
"version": "2.0.0",
"tasks": [
{
"label": "PIYUSH Compiler",
"type": "shell",
"command": "g++",
"args": [
"-g",
"${relativeFile}",
"-o",
"${fileBasenameNoExtension}.out",
"&&",
"clear",
"&&",
"./${fileBasenameNoExtension}.out"
],
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": {
"owner": "cpp",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"pattern": {
"regexp": "^(.*):(\\d+):(\\d+):\\s+(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
}
},
]
}
Now there is a build file from Sublime text:
{
"shell_cmd": "g++ \"${file}\" -o \"${file_path}/${file_base_name}\"",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Run",
"shell_cmd": "python3 /home/piyush/Documents/CPHelper/Main.py\"${file_path}/${file_base_name}\""
}
]
}
I want a JSON file to merge both my custom task.json file and this Sublime Text build file in a single task.json file.
How to do it?
Related
Currently I have to enter -exec -enable-pretty-printing into vimspector debugger command line (debugging C++ code using vscode-cpptools) to see std::string as a "string" rather than as a STL container. Could you advice me how to modify my .vimspector.json to run the command automatically on vimspector launch? I tried to google it out but without success... My current .vimspector.json looks like this.
{
"configurations": {
"Vim - run a test": {
"adapter": "vscode-cpptools",
"configuration": {
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/main",
"args": [
"-enable-pretty-printing"
],
"cwd": "${workspaceRoot}",
"environment": [
{ "name": "VIMRUNTIME", "value": "${workspaceRoot}" }
],
"externalConsole": true,
"stopAtEntry": true,
"MIMode": "gdb",
"logging": {
"engineLogging": false
}
}
}
}
}
Thx,
Michal
PS: The mentioning -enable-pretty-printing as argument in .json file does not work.
OK, I have installed vscode and had a look at its configuration files. It seems that the following .vimspector.json file does what I want.
{
"configurations": {
"FinMat": {
"adapter": "vscode-cpptools",
"configuration": {
"type": "cppdbg",
"request": "launch",
"program": "${workspaceRoot}/main",
"args": [],
"cwd": "${workspaceRoot}",
"environment": [
{ "name": "VIMRUNTIME", "value": "${workspaceRoot}" }
],
"externalConsole": true,
"stopAtEntry": true,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"logging": {
"engineLogging": false
}
}
}
}
}
I have two problems.
The first is related with dfm form design preview.
Not work. I will try to simulate error message for more info. Before that I need to setup configuration due to the buld error:"Missig Form Unit".
Let start this amazing post with many different configuration. All the stuff are referring for Delphi and Omnipascal.
C:\Users\My-PC\AppData\Roaming\Code\User\settings.json
{
"window.zoomLevel": -0.3862065056838846,
"workbench.colorTheme": "Visual Studio 2019 Dark",
"editor.tabSize": 2,
"git.confirmSync": false,
"projectManager.git.baseFolders": [
],
"files.associations": {
"*.pas": "pascal"
},
"editor.fontFamily": "'Courier New', 'Courier New Cyr', Consolas, monospace, '#MS Gothic'",
"editor.wordWrapColumn": 200,
"editor.fontSize": 13,
"editor.scrollbar.verticalScrollbarSize": 10,
"GLOBAL": "C:\\gnu\\glo653wb\\share\\gtags\\gtags.conf",
"global": "C:\\gnu\\glo653wb\\share\\gtags\\gtags.conf",
"GTAGSCONF": "C:\\gnu\\glo653wb\\share\\gtags\\gtags.conf",
"GTAGSLABEL": "pygments",
"workbench.iconTheme": "material-icon-theme",
"files.encoding": "windows1251",
"omnipascal.defaultDevelopmentEnvironment":"Delphi",
"objectpascal.delphiInstallationPath":"C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source",
"omnipascal.delphiInstallationPath": "C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\source",
"omnipascal.searchPath": "D:\\Borland\\*;$(DELPHI)\\Lib;$(DELPHI)\\Bin;$(DELPHI)\\Imports;$(DELPHI)\\Projects\\Bpl;$(DELPHI)\\Rave5\\Lib;C:\\Program Files (x86)\\Embarcadero\\F\\Dcu\\D7;C:\\Program Files (x86)\\Embarcadero\\F\\Source;C:\\Program Files (x86)\\FTrial\\LIBD7;D:\\Borland\\Delphi7\\Projects\\Indy10\\Core;D:\\Borland\\Delphi7\\Projects\\Indy10\\Protocols;D:\\Borland\\Delphi7\\Projects\\Indy10\\SuperCore;D:\\Borland\\Delphi7\\Projects\\Indy10\\System;$(DELPHI)\\source\\vcl;$(DELPHI)\\Source\\Rtl;$(DELPHI)\\source\\rtl\\Corba45;$(DELPHI)\\source\\rtl\\Sys;$(DELPHI)\\source\\rtl\\Win;$(DELPHI)\\source\\rtl\\common;$(DELPHI)\\source\\Internet;$(DELPHI)\\source\\clx;$(DELPHI)\\source\\websnap;$(DELPHI)\\Source\\WebMidas;$(DELPHI)\\Source\\Indy;$(DELPHI)\\Source\\IntraWeb;$(DELPHI)\\Source\\Samples;$(DELPHI)\\Source\\Soap;$(DELPHI)\\Source\\ToolsAPI;$(DELPHI)\\Source\\Xml;C:\\Program Files (x86)\\Embarcadero\\S;C:\\Program Files (x86)\\rial\\LID7;",
"omnipascal.msbuildPath": "C:\\Users\\-PC\\.vscode\\extensions\\ms-dotnettools.csharp-1.22.1\\.omnisharp\\1.35.3\\.msbuild\\Current\\Bin\\",
"omnipascal.createBuildScripts": true,
"pascal.formatter.enginePath": "D:\\DWN\\prog\\jcf_243_exe\\JCF.exe",
"pascal.formatter.engineParameters": "D:\\DWN\\prog\\jcf_243_exe\\JCFSettings.cfg",
"pascal.format.wrapLineLength": 30000,
"pascal.formatter.engine": "jcf",
"editor.rulers": [
],
"editor.minimap.enabled": false,
"editor.renderControlCharacters": true,
}
D:\Git\develop.vscode\tasks.json
{
// See https://go.mic.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"label": "Delphi",
"type": "shell",
"windows": {
"command": "C:\\Program Files (x86)\\Embarcadero\\Studio\\21.0\\bin\\DCC32.EXE"
},
"presentation": {
"reveal": "always",
"panel": "new"
},
"args": [
{
"value": "D:\\Git\\develop\\Ere\\Eore.dpr",
"quoting": "escape"
}
],
"problemMatcher": {
"owner": "external",
"pattern": {
"regexp": "^(.*.(pas|dpr|dpk))\\((\\d+)\\)\\s(Fatal|Error|Warning|Hint):(.*)",
"file": 1,
"location": 3,
"message": 5
}
},
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
https://github.com/alefragnani/vscode-language-pascal#code-navigation
GNU Global 6.5 or higher (http://www.gnu.org/software/global/global.html)
Exuberant Tags 5.5 or higher (http://ctags.sourceforge.net/)
Python 2.7 or higher (https://www.python.org/)
Python Pygments (via pip install Pygments)
{
"manifestVersion": 1,
"id": "build-release-task",
"name": "",
"version": "1.1.9",
"publisher": " ",
"targets": [
{
"id": "Microsoft.VisualStudio.Services"
}
],
"description": "",
"categories": [
"Azure Pipelines"
],
"icons": {
"default": "images/extension-icon.png"
},
"files": [
{
"path": "buildAndReleaseTask"
},
{
"path": "images",
"addressable": true
}
],
"contributions": [
{
"id": "custom-build-release-task",
"type": "ms.vss-distributed-task.task",
"targets": [
"ms.vss-distributed-task.tasks"
],
"properties": {
"name": "buildAndReleaseTask",
"icon": "images/extension-icon.png"
}
}
]
}
You should put the icon file also in the task folder (where the .ts/.ps1 files).
With below-mentioned log4js configuration, I intend to log everything to a file in logs/test/log-timestamp.txt file and only INFO level to console, but I see that the console prints all the levels. How do I fix this?
{
"appenders": {
"test": {
"type": "dateFile",
"filename": "logs/test/log",
"pattern": "-yyyy-MM-dd-hh-mm-ss.txt",
"alwaysIncludePattern": true,
"keepFileExt": true
},
"test-filter": {
"type": "logLevelFilter",
"appender": "test",
"level": "trace",
"maxLevel": "fatal"
},
"default": {
"type": "dateFile",
"filename": "logs/default",
"pattern": "-yyyy-MM-dd.txt",
"alwaysIncludePattern": true,
"keepFileExt": true
},
"console": {
"type": "console",
"level": "info",
"maxLevel": "info"
}
},
"categories": {
"default": {
"appenders": [
"default"
],
"level": "info"
},
"test": {
"appenders": [
"test-filter",
"console"
],
"level": "debug"
}
}
}
I'm creating a flatpak package for vlc. Since flatpak runs in sandbox and vlc depends on lua -> guile -> bdw-gc -> libunistring.
I have to first compile all these dependencies into flatpak sandbox. However bdw-gc and libunistring`` compile perfectly, butguilefails in last step ofmake` with error:
make[1]: Leaving directory '/run/build/guile'
stripping /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/bin/guile to /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/bin/guile.debug
stripping /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/libguile-2.0.so.22.8.1 to /home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/lib/libguile-2.0.so.22.8.1.debug
Error: module guile: Error opening file '/home/ivansek/projects/vlc/flatpak/vlc-repo2/files/lib/debug/source/guile/libguile/scmconfig.h': Permission denied
I'm using flatpak-builder for that using manifest file as:
{
"app-id": "org.gnome.vlc",
"runtime": "org.gnome.Platform",
"runtime-version": "3.22",
"sdk": "org.gnome.Sdk",
"command": "vlc",
"finish-args": [
"--socket=x11",
"--share=network",
"--share=ipc",
"--filesystems=host"
],
"modules": [
{
"name": "bdw-gc",
"sources": [
{
"type": "archive",
"url": "http://www.hboehm.info/gc/gc_source/gc-7.6.0.tar.gz",
"sha256": "a14a28b1129be90e55cd6f71127ffc5594e1091d5d54131528c24cd0c03b7d90"
}
]
},
{
"name": "libunistring",
"sources": [
{
"type": "archive",
"url": "http://ftp.gnu.org/gnu/libunistring/libunistring-0.9.6.tar.xz",
"sha256": "2df42eae46743e3f91201bf5c100041540a7704e8b9abfd57c972b2d544de41b"
}
]
},
{
"name": "guile",
"sources": [
{
"type": "archive",
"url": "https://ftp.gnu.org/gnu/guile/guile-2.0.13.tar.xz",
"sha256": "3744f2addc282a0de627aaef048f062982b44564d54ac31ff5217972529ed88b"
}
]
},
{
"name": "autogen",
"sources": [
{
"type": "archive",
"url": "https://ftp.gnu.org/gnu/autogen/rel5.18/autogen-5.18.tar.xz",
"sha256": "0c2dce22d4306ea29a01f6e54a35ea2b42dc7cf14f9818057b785e375bfbb784"
}
]
},
{
"name": "lua",
"sources": [
{
"type": "archive",
"url": "https://www.lua.org/ftp/lua-5.3.3.tar.gz",
"sha256": "5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2"
}
]
},
{
"name": "vlc",
"sources": [
{
"type": "archive",
"url": "http://get.videolan.org/vlc/2.2.4/vlc-2.2.4.tar.xz",
"sha256": "1632e91d2a0087e0ef4c3fb4c95c3c2890f7715a9d1d43ffd46329f428cf53be"
}
]
}
]
}
How can I solve this problem, or what is another approach to include vlc in flatpak?