After generating a .sln and .vcxproj from the gyp file below msbuild fails with
"C:\proj\test\test.sln" (default target) (1) ->
(ValidateSolutionConfiguration target) ->
C:\proj\test\test.sln.metaproj : error MSB4126: The specified soluti
on configuration "Default|X64" is invalid. Please specify a valid
solution conf iguration using the Configuration and Platform
properties (e.g. MSBuild.exe Sol ution.sln /p:Configuration=Debug
/p:Platform="Any CPU") or leave those properti es blank to use the
default solution configuration. [C:\proj\test\test.sln]
how do I make gyp generate a Default|x64 solution?
{
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [
'test.cpp',
],
},
],
}
Probably you need to have declared target configuration and use it as a default value of target_default, similar to this:
{
'target_defaults': {
'default_configuration': 'Release_x64',
'configurations':
{
'Debug': {
# configuration specific settings
},
'Release': {
# configuration specific settings
},
'Debug_x64': {
'inherit_from': ['Debug'],
'msvs_configuration_platform': 'x64',
},
'Release_x64': {
'inherit_from': ['Release'],
'msvs_configuration_platform': 'x64',
},
},
},
'targets': [
{
'target_name': 'test',
'type': 'executable',
'sources': [
'test.cpp',
],
},
],
}
Related
Is there a way to configure renovate with packageRules, so that I get a MR with automerge disables for pre-release versions, like v1.0.0-alpha.1 and MR with automerge enabled for patch versions, liken v1.0.0.
I have enabled unstableVersion support in renovate, but I want different behaviors for release/prerelease versions. My current configuration looks like the following, but I am unsure if this works, because the documenation of renovate states that prerelases is not a valid value for matchUpdateTypes.
{
"matchDatasources": [
"git-tags"
],
"matchManagers": [
"ansible-galaxy"
],
"matchUpdateTypes": [
"patch"
],
"enabled": true,
"automerge": true,
"platformAutomerge": true
},
{
"matchDatasources": [
"git-tags"
],
"matchManagers": [
"ansible-galaxy"
],
"matchUpdateTypes": [
"prerelease"
],
"enabled": true,
"automerge": false,
"platformAutomerge": false
},
What I want is that renovate automerges
v1.0.0 -> v1.0.1
v1.0.2-alpha.1 -> v1.0.2
but no automerge (only MR) for
v1.0.0 -> v1.0.1-alpha.1
v1.0.1-alpha.1 -> v1.0.1-alpha.2
According to https://docs.renovatebot.com/modules/versioning/#regular-expression-versioning, you could set "ignoreUnstable": true
I use some files written with Gherkin mode, but they don't have the ".feature" extension. I tried to change some visual code files related to cucumber extension to be able to highlight files that are not .feature but I had no success.
For example:
Workspace settings.json:
{
"folders": [
{
"path": "/home/user/git"
},
{
"path": "/home/user/Documents/scripts"
}
],
"settings": {}
"cucumberautocomplete.steps": [
"*.myext"
],
"cucumberautocomplete.syncfeatures": "*.myext",
"cucumberautocomplete.strictGherkinCompletion": true
}
It worked changing the file /home/user/.config/Code/User/settings.json and adding this config:
"files.associations": {
"*.myext": "feature"
}
{
"editor.renderWhitespace": "all",
"window.titleBarStyle": "custom",
"editor.fontSize": 15,
"python.jediEnabled": false,
"terminal.integrated.shell.linux": "/bin/bash",
"workbench.colorTheme": "Visual Studio Dark",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"[feature]": {
},
"files.associations": {
"*.myext": "feature"
}
}
I am developing a custom vsts extension for a release task which have a picklist which has values populated from the REST endpoint data source ( my storage account ). I am following this blow link as reference.
https://learn.microsoft.com/en-us/vsts/extend/develop/service-endpoints?view=vsts
I have uploaded my extension but the picklist is not populating with values in the task.
Below are the configurations that I have done.
vss-extension.json:
{
“manifestVersion”: 1,
“id”: “build-release-task”,
“name”: “My Custom release task”,
“version”: “0.0.1”,
“publisher”: “custext”,
“public”: false,
“targets”: [
{
“id”: “Microsoft.VisualStudio.Services”
}
],
“description”: “A picklist which has values populated from the REST
endpoint data source. Includes one build/release task.”,
“categories”: [
“Build and release”
],
“icons”: {
“default”: “images/extension-icon.png”
},
“files”: [
{
“path”: “buildAndReleaseTask”
}
],
“contributions”: [
{
“id”: “service-endpoint”,
“description”: “Service Endpoint type for custom Storage connection”,
“type”: “ms.vss-endpoint.service-endpoint-type”,
“targets”: [ “ms.vss-endpoint.endpoint-types” ],
“properties”: {
“name”: “custom”,
“displayName”: “Custom server connection”,
“url”: {
“displayName”: “Server Url”,
“helpText”: “storage end point url.”
},
“dataSources”: [
{
“name”: “Storage Account”,
“endpointUrl”: “{{endpoint.url}}test/?restype=container&comp=list”,
“resultSelector”: “xpath://EnumerationResults/Blobs/Blob/Name”
}
],
]
}
],
“helpMarkDown”: “Learn More”
}
},
{
“id”: “custom-build-release-task”,
“type”: “ms.vss-distributed-task.task”,
“description”: “Task with a dynamic property getting data from an
endpoint REST data source”,
“targets”: [
“ms.vss-distributed-task.tasks”
],
“properties”: {
“name”: “buildAndReleaseTask”
}
}
]
}
task.json:
{
“id”: “325958a0-63b7-11e6-88a5-f7c7f66e6264”,
“name”: “dropdownlist”,
“friendlyName”: “Drop down list”,
“description”: “Lists the db files”,
“helpMarkDown”: “Custom release task.Drop down list”,
“category”: “Utility”,
“visibility”: [
“Release”
],
“author”: “satyam”,
“version”: {
“Major”: 0,
“Minor”: 1,
“Patch”: 0
},
“instanceNameFormat”: “dropdownlist $(message)”,
“groups”: [
{
“name”: “advanced”,
“displayName”: “Advanced”,
“isExpanded”: false
}
],
“inputs”: [
{
“name”: “CustomService”,
“type”: “connectedService:custom”,
“label”: “Storage end point”,
“defaultValue”: “”,
“required”: true,
“helpMarkDown”: “Select the storage account to use. If needed,
click on ‘manage’, and add a new Service Endpoint of type
‘Custom server connection'”
},
{
“name”: “Scripts”,
“type”: “pickList”,
“label”: “saasscripts”,
“required”: true,
“helpMarkDown”: “Select the name of the saas script.”,
“properties”: {
“EditableOptions”: “True”
}
}
],
“dataSourceBindings”: [
{
“target”: “Scripts”,
“endpointId”: “$(CustomService)”,
“dataSourceName”: “Storage Account”
}
],
“outputVariables”: [
{
“name”: “dbfile”,
“description”: “Application URL of the selected App
Service.”
}
],
“execution”: {
“Node”: {
“target”: “powershell.js”
}
}
}
endpointUrl: I tried with following ways in endpointUrl in datasources (vss-extension.json)
{{endpoint.url}}test/?restype=container&comp=list
2.https://mycontainername.blob.core.windows.net/test/restype=container&comp=list
The picklist is not populated with the blob contents.
I guess problem in above issue might be unable to parse the azure storage blob list response type. the rest api response includes BOM (” ) at that start of the XML file which might be cause of the parsing.

Is there any way or workaround to change the azure blob rest api response to exclude BOM (” ) or changing the response to JSON format.
I am building a native module that needs to link a static library. The path to that library. My binding.gyp file has the following appearance:
{
"targets": [
{
"target_name": "DcpServer",
"sources": [
"DcpServer.cc"
],
"include_dirs": [
"../../coratools",
"../../../boost-1.65.1"
],
"libraries": [
"<(module_root_dir)/../../coratools/release_uni64/coratools.lib"
],
"defines": [ "CSIWEB_EMBEDDED", "UNICODE", "_UNICODE" ],
"configurations": {
"Release": {
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
"RuntimeTypeInfo": "true"
}
}
},
"Debug": {
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
"RuntimeTypeInfo": "true"
}
}
}
}
}
]
}
The path to coratools.lib will vary based upon whether the debug or release configuration is selected. The problem is that node-gyp did not allow me to place the "libraries" key within the "configurations" property. Is there a way of doing what I want by making the library path conditional?
I never did discover how to do this. In the end, I switched to using cmake-js to build my native module.
I'm developing a big node.js project which also includes several native libraries.
To use these libraries in JavaScript I'm compiling them to node addons (.node) using node-gyp.
I'd like to run node-gyp once from the root directory to compile all the available binding.gyp recursively (in all the subdirectories).
Is there any way to do that?
GYP allows to set a list of dependencies for a target. You can create a target of type: none in the top-level bindings.gyp and list there dependencies from subdirectories:
{
'targets': [
{
'target_name': 'build_all',
'type': 'none',
'dependencies': ['subdir1/bindings.gyp:*', 'subdir/subdir2/bindings.gyp:*'],
# or generate dependencies list with a command expansion
'dependencies': ['<!#(find -mindepth 2 -name binding.gyp | sed -e s/$/:*/)'],
}
]
}
This will compile all the dependencies and put them into build/ directory in the root.
For putting each addon in its corresponding directory, add a postbuild target inside the addon's binding.gyp:
{
"targets": [
{
"target_name": "my-target",
"sources": [ "example.cpp" ]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "my-target" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/my-target.node" ],
"destination": "."
}
]
}
]
}
I didn't find any option to do this with just node-gyp, but one of the possible solutions is doing this in a script.
For example, adding the following to the package.json in the root folder:
"scripts": {
"install": "find ./app/* -name binding.gyp -execdir node-gyp rebuild ;"
}
This will cause all the native addons to compile when running npm install in the root folder.
An alternative to the other answers which seems to work so far (without ever having to update binding.gyp):
{
"targets": [
{
"target_name": "addon",
"sources": [
"<!#(node -p \"var fs=require('fs'),path=require('path'),walk=function(r){let t,e=[],n=null;try{t=fs.readdirSync(r)}catch(r){n=r.toString()}if(n)return n;var a=0;return function n(){var i=t[a++];if(!i)return e;let u=path.resolve(r,i);i=r+'/'+i;let c=fs.statSync(u);if(c&&c.isDirectory()){let r=walk(i);return e=e.concat(r),n()}return e.push(i),n()}()};walk('./sources').join(' ');\")"
]
}
]
}
(from https://stackoverflow.com/a/60947528/2016831)