How to configure and build VSCode with Omnipascal and Delphi - omnipascal

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)

Related

How to merge JSON files in Sublime Text

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?

Enable Diagnostics Logs for App Service using ARM Template

I am trying to setup enable diagnostics logs for app service using portal, which is working fine as below :
The same settings i am trying create using ARM Template but it is not working.
My ARM Template looks like below :
Is there anything wrong with settings or any other ways to enable logs ?
Anyone help is appreciated.
Regards,
Dipti Mamidala
In the resources array of the resource for which you want to enable Diagnostic Logs, add a resource of type [resource namespace]/providers/diagnosticSettings.
Example :
"resources": [
{
"type": "providers/diagnosticSettings",
"name": "[concat('Microsoft.Insights/', parameters('settingName'))]",
"dependsOn": [
"[/*resource Id for which Diagnostic Logs will be enabled>*/]"
],
"apiVersion": "2017-05-01-preview",
"properties": {
"name": "[parameters('settingName')]",
"storageAccountId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('storageAccountName'))]",
"eventHubAuthorizationRuleId": "[parameters('eventHubAuthorizationRuleId')]",
"eventHubName": "[parameters('eventHubName')]",
"workspaceId": "[parameters('workspaceId')]",
"logs": [
{
"category": "/* log category name */",
"enabled": true,
"retentionPolicy": {
"days": 0,
"enabled": false
}
}
],
"metrics": [
{
"category": "AllMetrics",
"enabled": true,
"retentionPolicy": {
"enabled": false,
"days": 0
}
}
]
}
}
]
Read more here in documentation
Update : To set the value of Web Server logging use the below example
"properties": {
"applicationLogs": {
"Storage": {
"level": "Verbose"
}
},
"httpLogs": {
"fileSystem": {
}
}
}
If you want Storage or fileSystem use any one of above
I got this working by setting the httpLogs and httpLoggingEnabled properties.
This is the config resource nested within a site resource:
"resources": [
{
"apiVersion": "2018-02-01",
"type": "config",
"name": "logs",
"dependsOn": [
"[concat('Microsoft.Web/sites/', parameters('name'))]"
],
"properties": {
"applicationLogs": {
"azureBlobStorage": {
"level": "information",
"retentionInDays": 15
}
},
"httpLogs": {
"fileSystem": {
"retentioninMb": 35,
"retentioninDays": 15,
"enabled": true
}
},
"requestTracingEnabled": true,
"requestTracingExpirationTime": "9999-12-31T23:59:00Z",
"remoteDebuggingEnabled": false,
"httpLoggingEnabled": true,
"logsDirectorySizeLimit": 34,
"detailedErrorLoggingEnabled": true
}
}
]

VSTS fabrikam-build-extension sample not working (Template)

Just tried the fabrikam-build-extension sample on TFS 2017 and VSTS. I can see the custom tasks modifying a build, but I'm unable to use the Template1 Template to create a build definition. Template1 isn't listed.
Anybody have a clue?
Yes, I can reproduce the issue. The two tasks can be add successfully. But the template1 can’t be added in VSTS build template.
But If I use the same content as template.json to create a build template by REST API, I can find it in build template.
PUT https://marinaliu.visualstudio.com/DefaultCollection/Git2/_apis/build/definitions/templates/myCustomTemplate?api-version=2.0
Application/json:
{
"id": "android",
"name": "My Custom Andriod Template",
"category": "Build",
"iconTaskId": "DF857559-8715-46EB-A74E-AC98B9178AA0",
"description": "Build your Android projects, run tests, sign and align Android App Package files. This template requires the Android SDK to be installed on the build agent.",
"template": {
"buildNumberFormat": "$(date:yyyyMMdd)$(rev:.r)",
"build": [{
"enabled": true,
"inputs": {
"wrapperScript": "$(Parameters.wrapperScript)",
"tasks": "$(Parameters.tasks)"
},
"task": {
"id": "8D8EEBD8-2B94-4C97-85AF-839254CC6DA4",
"versionSpec": "1.*"
}
},
{
"enabled": true,
"inputs": {
"files": "**/*.apk",
"jarsign": "false",
"zipalign": "false"
},
"task": {
"id": "80F3F6A0-82A6-4A22-BA7A-E5B8C541B9B9",
"versionSpec": "1.*"
}
},
{
"enabled": true,
"alwaysRun": true,
"inputs": {
"SourceFolder": "$(build.sourcesdirectory)",
"Contents": "**/*.apk",
"TargetFolder": "$(build.artifactstagingdirectory)"
},
"task": {
"id": "5bfb729a-a7c8-4a78-a7c3-8d717bb7c13c",
"versionSpec": "2.*"
}
},
{
"enabled": true,
"alwaysRun": true,
"inputs": {
"PathtoPublish": "$(build.artifactstagingdirectory)",
"ArtifactName": "drop",
"ArtifactType": "Container"
},
"task": {
"id": "2ff763a7-ce83-4e1f-bc89-0ae63477cebe",
"versionSpec": "1.*"
}
}
],
"options": [{
"definition": {
"id": "5D58CC01-7C75-450C-BE18-A388DDB129EC"
},
"enabled": true,
"inputs": {}
}],
"variables": {
"system.debug": {
"value": "false",
"allowOverride": true
}
},
"triggers": [],
"processParameters": {
"inputs": [{
"name": "wrapperScript",
"label": "{GradleWrapper}",
"defaultValue": "gradlew",
"required": true,
"type": "filePath"
},
{
"name": "tasks",
"label": "{GradleTasks}",
"defaultValue": "build",
"required": true,
"type": "string"
}
]
}
}
}
And the create an issue here, you can follow up.

Unable to start a ubuntu container in openshift-origin

Am trying to bring up a ubuntu container in a POD in openshift. I have setup my local docker registry and have configured DNS accordingly. Starting the ubuntu container with just docker works fine without any issues. When I deploy the POD, I can see that my docker ubuntu image is pulled successfully, but doesnt succeed in starting the same. It fails with back-off pulling image error. Is this because my entry point does not have any background process running in side the container ?
"openshift.io/container.ubuntu.image.entrypoint": "[\"top\"]",
Snapshot of the events
Deployment-config :
{
"kind": "DeploymentConfig",
"apiVersion": "v1",
"metadata": {
"name": "ubuntu",
"namespace": "testproject",
"selfLink": "/oapi/v1/namespaces/testproject/deploymentconfigs/ubuntu",
"uid": "e7c7b9c6-4dbd-11e6-bd2b-0800277bbed5",
"resourceVersion": "4340",
"generation": 6,
"creationTimestamp": "2016-07-19T14:34:31Z",
"labels": {
"app": "ubuntu"
},
"annotations": {
"openshift.io/deployment.cancelled": "4",
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"strategy": {
"type": "Rolling",
"rollingParams": {
"updatePeriodSeconds": 1,
"intervalSeconds": 1,
"timeoutSeconds": 600,
"maxUnavailable": "25%",
"maxSurge": "25%"
},
"resources": {}
},
"triggers": [
{
"type": "ConfigChange"
},
{
"type": "ImageChange",
"imageChangeParams": {
"automatic": true,
"containerNames": [
"ubuntu"
],
"from": {
"kind": "ImageStreamTag",
"namespace": "testproject",
"name": "ubuntu:latest"
},
"lastTriggeredImage": "ns1.myregistry.com:5000/ubuntu#sha256:6d9a2a1bacdcb2bd65e36b8f1f557e89abf0f5f987ba68104bcfc76103a08b86"
}
}
],
"replicas": 1,
"test": false,
"selector": {
"app": "ubuntu",
"deploymentconfig": "ubuntu"
},
"template": {
"metadata": {
"creationTimestamp": null,
"labels": {
"app": "ubuntu",
"deploymentconfig": "ubuntu"
},
"annotations": {
"openshift.io/container.ubuntu.image.entrypoint": "[\"top\"]",
"openshift.io/generated-by": "OpenShiftNewApp"
}
},
"spec": {
"containers": [
{
"name": "ubuntu",
"image": "ns1.myregistry.com:5000/ubuntu#sha256:6d9a2a1bacdcb2bd65e36b8f1f557e89abf0f5f987ba68104bcfc76103a08b86",
"resources": {},
"terminationMessagePath": "/dev/termination-log",
"imagePullPolicy": "Always"
}
],
"restartPolicy": "Always",
"terminationGracePeriodSeconds": 30,
"dnsPolicy": "ClusterFirst",
"securityContext": {}
}
}
},
"status": {
"latestVersion": 5,
"details": {
"causes": [
{
"type": "ConfigChange"
}
]
},
"observedGeneration": 5
}
The problem was with the http proxy. After solving that image pull was successful

New Storage Plugin for csv , json

I want to add a new storage plugin ( called onetest)
When I add it on the webUI onetest appear but the directory and files that I had inside "onetest" doesn't appear on my drill explorer.
Note that in montest I placed two csvs.
The JSON I put on the webUI:
{
"type": "file",
"enabled": true,
"connection": "maprfs:///",
"workspaces": {
"root": {
"location": "/patrick",
"writable": false,
"defaultInputFormat": null
},
"montest": {
"location": "/patrick/test",
"writable": true,
"defaultInputFormat": null
},
"tmp": {
"location": "/tmp",
"writable": true,
"defaultInputFormat": null
}
},
"formats": {
"psv": {
"type": "text",
"extensions": [
"tbl"
],
"delimiter": "|"
},
"csv": {
"type": "text",
"extensions": [
"csv"
],
"delimiter": ","
},
"tsv": {
"type": "text",
"extensions": [
"tsv"
],
"delimiter": "\t"
},
"parquet": {
"type": "parquet"
},
"json": {
"type": "json"
},
"maprdb": {
"type": "maprdb"
}
}
}
Output in drill explorer:
The directories has read and write access :
Do you have any idea?
Best

Resources