${relativeFile} fetched by visualstudio / cmake launch json file is not including the backslash - c++

I have configured some tasks for CMake in Visual studio. One of the commands to execute includes the ${relativeFile} and it is under subdirectory. The fetched result is not including the '/' to separate the directories.
Here is the tasks.vs.json file sample:
{
"taskName": "TestTask",
"appliesTo": "*/",
"type": "remote",
"remoteWorkingDirectory": "/home/root/",
"contextType": "custom",
"localCopyDirectory": "${workspaceRoot}\\..\\build\\${env.name}\\bin",
"remoteMachineName": "${env.TARGET_MACHINE}",
"remoteCopyMethod": "sftp",
"remoteCopyDirectory": "/tmp/",
"command": "echo changing permissions for ${relativeFile}",
"args": ""
}
Expected result: changing permissions for test\test1
Current Result: changing permissions for testtest1

Related

npm build failing due to rescript cannot handle multiple files error

Error:
rescript: [32/234] src/C...ts/Common/Transition.cmj
FAILED: src/Components/Common/Transition.cmj
can not handle multiple files
Caused when I ran:
npm start
or
yarn start
bsconfig.json contents [name doesn't have any spaces]
{
"name": "care_fe",
"reason": {
"react-jsx": 3
},
"bsc-flags": ["-bs-super-errors"],
"sources": [{
"dir": "src",
"subdirs": true
}],
....
...so on
package.json contents
dependencies:
"#rescript/react": "^0.10.3",
"rescript-material-ui": "^2.1.2"
devDependencies:
"rescript": "^9.1.4"
Transition.res contents
type reactClass
module Transition = {
#module("./Transition.tsx") #react.component
external make: (
~show: option<bool>,
~enter: string,
~enterFrom: string,
~enterTo: string,
~leave: string,
~leaveFrom: string,
~leaveTo: string,
~children: 'a,
) => React.element = "default"
}
#react.component
let make = (
~show=None,
~enter="",
~enterFrom="",
~enterTo="",
~leave="",
~leaveFrom="",
~leaveTo="",
~children,
) => <Transition show enter enterFrom enterTo leave leaveFrom leaveTo> children </Transition>
From the comments, it seems the rescript build system has a bug where the current working directory is passed to a build command unescaped, and so a project residing in a path that contains spaces will be interpreted as multiple paths, hence the "multiple files" error.
The workaround is to move the project to a path that does not contain spaces, until the bug is hopefully (soon) fixed.

Why Chutzpah does not recognize all TypeScript tests?

I have a project with the following chutzpah.json:
{
"Framework": "jasmine",
"TestHarnessReferenceMode": "AMD",
"TestHarnessLocationMode": "SettingsFileAdjacent",
"EnableTestFileBatching": true,
"References": [
{ "Path": "node_modules/es6-shim/es6-shim.min.js" },
{ "Path": "node_modules/zone.js/dist/zone.min.js" },
{ "Path": "node_modules/reflect-metadata/Reflect.js" },
{ "Path": "node_modules/systemjs/dist/system.js" },
{ "Path": "system-config.js" }
],
"CodeCoverageExcludes": ["node_modules/*"],
"Tests": [
{ "Path": "app", "Includes": [ "*.spec.ts" ] }
]
}
and the following tests files
Test explorer just shows tests stored in the first file
If I try to run the the command of the VSTest I get the same result:
If I call the command setting the name of the file (e.g. "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe" app\InspectionDataView.spec.ts /UseVsixExtensions:true ), the tests in the file run.
Extra point:
I tried to run the test directly with Chutzpah.console.exe, this is what I got:
What am I missing here ?
Note: Using VS 2015 Update 3
Chutzpah does not run TypeScript. It "supports" it, but you have to add this support in the chutzpah.json.
Why the first test suite succeeds? Perhaps it is written in pure ES5 (Without ES6/TS classes, interfaces, etc).
I did set up chutzpah support for typescript from this repo https://github.com/mmanela/chutzpah/tree/master/Samples/Compilation/TypeScript
Basically, in short:
create a compile.bat that transpiles TS to ES5. Normally - tsc.exe with or without tsconfig.json
add "Compile" section as seen in https://github.com/mmanela/chutzpah/blob/master/Samples/Compilation/TypeScript/chutzpah.json
this shall transpile TS to ES5 every time you run chutzpah.console.exe

Cannot run C++ program when using sublime-build, works fine when running from terminal

I'm trying to run a C++ program on Linux/Ubuntu 14.04
I'm using the SFML library, the tutorial suggests to include this line before running if SFML was installed in a non-standard path (which it was):
$ export LD_LIBRARY_PATH=<sfml-install-path>/lib
I can run the program from the terminal using the following input:
$ export LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib && ./YorickTheSavant
However, when attempting to launch the program in Sublime Text 2 with a sublime-build file, I get the following error:
[Errno 2] No such file or directory
[cmd: [u'export', u'LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib', u'&&', u'./YorickTheSavant']]
[dir: /home/dan/yorickthesavant]
[path: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/dan/.rvm/bin]
[Finished]
Here is my sublime-build file for reference:
{
"cmd": ["g++", "-m32", "-c", "-std=c++11",
"src/buff.cpp",
"src/card.cpp",
"src/clickableObject.cpp",
"src/creature.cpp",
"src/dataHandler.cpp",
"src/dungeonRun.cpp",
"src/enemy.cpp",
"src/gameQueue.cpp",
"src/gameSystem.cpp",
"src/graphics.cpp",
"src/hoverText.cpp",
"src/infoText.cpp",
"src/main.cpp",
"src/player.cpp",
"src/queueBlock.cpp",
"src/queueEffect.cpp",
"src/roundedCornerRect.cpp",
"src/save.cpp",
"src/ttText.cpp",
"-I", "include"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "/home/dan/yorickthesavant/",
"selector": "source.c, source.c++",
"variants":
[
{
"name": "Link",
"cmd": ["g++", "-m32",
"buff.o",
"card.o",
"clickableObject.o",
"creature.o",
"dataHandler.o",
"dungeonRun.o",
"enemy.o",
"gameQueue.o",
"gameSystem.o",
"graphics.o",
"hoverText.o",
"infoText.o",
"main.o",
"player.o",
"queueBlock.o",
"queueEffect.o",
"roundedCornerRect.o",
"save.o",
"ttText.o",
"-o", "YorickTheSavant",
"-L", "/home/dan/SFML-2.3.1/lib",
"-lsfml-graphics",
"-lsfml-window",
"-lsfml-system"]
},
{
"name": "Run",
"cmd": ["export", "LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib", "&&", "./YorickTheSavant"]
}
]
}
The "Run" variant is the one I'm using. How would I make it so that this line is automatically included when the game is launched outside of the terminal and in Sublime Text 2?
The cmd key in .sublime-build files specifies the program to run.
The first value is expected to be the program and the rest are the arguments,
so it fails when it cannot find a program called export - because it is a shell built-in.
To run the entire command in a shell (like you would when doing it manually), you can specify "shell" : true in your Run variant (or use shell_cmd instead of cmd):
{
"name": "Run",
"cmd": ["export", "LD_LIBRARY_PATH=/home/dan/SFML-2.3.1/lib", "&&", "./YorickTheSavant"],
"shell" : true
}
This should work better than invoking /bin/sh -c <stuff> directly, and I don't think you'll need to condense the entries in the cmd array into a single string anymore.
Alternatively, you could also try using the env key (also found here) to specify the LD_LIBRARY_PATH environment variable before running your executable:
{
"name": "Run",
"cmd": ["./YorickTheSavant"],
"env" : { "LD_LIBRARY_PATH" : "/home/dan/SFML-2.3.1/lib" }
}

running Sublime Text build with latex instead of pdflatex from LaTeXTools plugin

In the build file supplied with the LatexTools plugin for Sublime Text, I modified the statement
"cmd": ["latexmk", "-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'", "-f", "-pdf"]
by replacing the second instance of pdflatex with latex.
My question is, how do I specify whether I want to use "dvipdfm" or "dvi2ps + ps2pdf".
If someone could provide a sample build file for this purpose, that would be most helpful.
After a bit of trial and error, I finally have the following build file working correctly. This allows me to choose between pdflatex and latex, and also choose between dvipdfm and the alternative of "dvi2ps + ps2pdf"
// Compilation settings
// ====================
//
// The actual magic happens in the make_pdf command
// I stick to the format of standard ST2 sublime-build files
// with minor variations.
// NOTE: the viewer is NOT configured from here!
// As of 5/24/11, it cannot be changed, but I will introduce a setting later
{
// General settings; DO NOT MODIFY!!!
"target": "make_pdf",
"selector": "text.tex.latex",
//-----------------------
// Linux-specific settings
// ----------------------
// If linux/os variable is used, then command palette does not show variant names
// Linux texification settings
// -------------------------
// Personalize this, IF you know what you are doing!
// e.g. change 'pdflatex...' to 'xelatex...'
// Refer to the documentation for latexmk
//
// Note: do NOT include $file or similar!!!
// Only configure the compilation parameters you need, MINUS the
// actual file to be compiled
//
// By default, latexmk is told to use pdflatex, with synctex on for
// backward/forward search, forcing compilation (e.g. even if no bib file is found)
// and producing pdf rather than dvi output
"cmd": ["latexmk",
"-e","\\$dvipdf = 'dvipdfmx %O -o %D %S'", "-e", "\\$latex = 'latex %O -interaction=nonstopmode -synctex=1 %S'",
"-f", "-pdfdvi"],
"variants":
[
{ "cmd": ["latexmk",
"-e", "\\$pdflatex = 'pdflatex %O -interaction=nonstopmode -synctex=1 %S'",
"-f", "-pdf"],
"name": "Run"
},
{ "cmd": ["latexmk",
"-e", "\\$latex = 'latex %O -interaction=nonstopmode -synctex=1 %S'",
"-f", "-pdfps"],
"name": "LaTeX_PS_PDF"
},
{"cmd": ["latexmk", "-e", "\\$clean_ext = 'aux fls fdb_latexmk dvi ps synctex.gz'", "-c"],
"name" : "Clean "
}
]
}

How to use Sencha SDK for ExtJS?

I am using ExtJS 4.1 and I am deploying my simple HelloExt program on GlassFish V3.1.
I am trying to create a build from Sencha SDK.
I have used the following two commands...
C:\>sencha create jsb -a http://localhost:8080/HelloExt/index.jsp -p appname.jsb
3 -v
C:\>sencha build -p appname.jsb3 -v -d .
As per the documentation, it will create app-all.js file. But where does it create the file?
How can I know IF build are created successfully or not?
Where are the generated JS files?
I made a search but I can not found anything like app-all.js.
For more information:
I am using JDK 1.6.0_12 and GlassFish V3.1 application server.
Here are the edited content of the question ....
And when I am trying to use the sencha SDK, It generates a .dpf file into the class path.
The contents of the .dpf file as as below ...
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE glassfish-web-app PUBLIC "-//GlassFish.org//DTD GlassFish Application Server 3.1 Servlet 3.0//EN" "http://glassfish.org/dtds/glassfish-web-app_3_0-1.dtd">
<glassfish-web-app error-url="">
<context-root>/HelloExt</context-root>
<class-loader delegate="true"/>
<jsp-config>
<property name="keepgenerated" value="true">
<description>Keep a copy of the generated servlet class' java code.</description>
</property>
</jsp-config>
</glassfish-web-app>
Can anyone tell me Why here it generated .DPF file ? Why its not generating the app-all.js file ?
Try running the command from inside the app root directory and then using a relative path:
0) open cmd window
1) run in cmd window: "cd C:\[webserver_webapp_root]\[app_name]"
In other words change the cmd directory to the app root. Fill in the bracketed text above with the correct paths.
2) run in cmd window: "sencha create jsb -a index.html -p app.jsb3 -v"
The app.jsb3 should be created in your app's root directory (C:\[webserver_webapp_root]\[app_name]). Open it up and make sure it contains all of your app classes, it should look something like this:
{
"projectName": "Project Name",
"licenseText": "Copyright(c) 2012 Company Name",
"builds": [
{
"name": "All Classes",
"target": "all-classes.js",
"options": {
"debug": true
},
"files": [
{
"clsName": "YourApp.view.Viewport",
"name": "Viewport.js",
"path": "app/view/"
},
// plus ALOT more classes...
]
},
{
"name": "Application - Production",
"target": "app-all.js",
"compress": true,
"files": [
{
"path": "",
"name": "all-classes.js"
},
{
"path": "",
"name": "app.js"
}
]
}
],
"resources": []
}
If everything looks fine then you can go onto the next step, if not then there is something wrong with your app directory structure and you need to fix it per Sencha recommended ExtJS application architecture.
You can also use any error messages to help identify the problem.
3) update placeholders ("Project Name", etc) at the top of app.jsb3
4) run in cmd window: "sencha build -p app.jsb3 -d . -v"
The app-all.js file should also be created in the app's root directory. If the cmd window doesn't give any errors before it says "Done Building!" then you are all done. You can now change your index.html script link to point to app-all.js instead of app.js.
If there are errors then you have to fix those and run this again.
Other things you can try:
In response to your last comment, your -p switch parameter should be a jsb3 file not jsb.
Make sure that the web server is running and that your app runs without any errors before you try to use the SDK Tools.
Then try these:
C:\Projects\HelloExt\build\web>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v
C:\Projects\HelloExt>sencha create jsb -a index.jsp -p HelloExt.jsb3 -v
C:\>sencha create jsb -a [actual IP address]:8080/HelloExt/index.jsp -p HelloExt.jsb3 -v
Fill in your actual IP address where the brackets are (not localhost).
This should produce the jsb3 file shown in #2 above then you can move on to step #3 above.