How to use pub build by command line directly from terminal? Using dart2js is easy, it works like this:
/Applications/dart-sdk/bin/dart2js --minify --out=file:/Users/muggins/my_project/web/my_project.dart.js /Users/muggins/my_project/web/my_project.dart
But this creates the my_project.dart.js file into the same directory as my_project.dart. How can I obtain the distinct directory build by command line without using a software like ItelliJ IDEA?
I can't get any result from https://www.dartlang.org/tools/pub/cmd/pub-build.html.
Related
I'm wondering if there is an option to obtain msiexec command line at "install" custom action (we use vs2008 "setup project" for the installer).
We know that we can access "CustomActionData" parameters but if we run the following command:
msiexec /i demo.msi /quiet user=test log=true
we know how to access "CustomActionData" parameters (user=test log=true), but we don't know how to access whole msiexec command line parameters (including "/i /quiet")...
Is it even possible because in Process Monitor we can see that at install action, this msiexec process (running as SYSTEM) is run with command the following command:
C:\Windows\system32\MsiExec.exe -Embedding 3E439F7DA7DE174205150FEBCEB7B14F E Global\MSI0000
So, is it possible to obtain "msiexec" command line parameters inside the installer (c++) code?
I am using ceedling for unit testing in a firmware I am working on.
I would like to see all command line option ceedling uses when invoking the compiler.
I tried to use the option --trace, but so for I have not found any difference.
ceedling test:all --trace
try:
ceedling verbosity[4] test:all
If you are on a Windows machine, the command line args can be intercepted like this:
Create a little command line tool ShowArgs.exe that displays the given command line args in a message box.
Create a registry key in SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Foo.exe whereas Foo.exe is the name of the compiler without the path.
Add a value with name debugger and value "" including the quotation marks, e.g.
SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\Foo.exe\debugger="C:\Temp\ShowArgs.exe"
Now ShowArgs.exe acts as the debugger for Foo.exe and is called instead. The first argument is the path to Foo.exe, all other arguments are the ones you are interested in.
I have following code under package pack1. Name of file is pack1.go
package pack1
var Pack1Int int = 42
var pack1Float = 3.14
func ReturnStr() string {
return "Hello world!"
}
And following code in main program. Name of file is package_test.go
package main
import (
"fmt"
"./pack1"
)
func main() {
var test1 string
test1 = pack1.ReturnStr()
fmt.Printf("Return string from pack1 : %s\n", test1)
fmt.Printf("Integer from pack1 : %d\n", pack1.Pack1Int)
}
When I try to run it with command go run package_test.go I get following error:
go run: cannot run *_test.go files (package_test.go)
But if I rename file to abc.go then I am getting proper output i.e.
Return string from pack1 : Hello world!
Integer from pack1 : 42
I am curious about what is wrong with using package_test.go as file name.
For code with only main package this name is working fine.
Is this a bug in Go or I am doing something wrong ?
Not a bug, it's designed so. go run detects the _test files and consider them as test files for a package, test files will be compiled as a separate package, and then linked and run with the main test binary.
It's recommended to put your package file to GOPATH/src/PACK_NAME/, then run your *_test.go with go test.
You can't name your program files as *_test.go as this is part of integrated Go testing system
To write a new test suite, create a file whose name ends _test.go that contains the TestXxx functions as described here. Put the file in the same package as the one being tested. The file will be excluded from regular package builds but will be included when the “go test” command is run. For more detail, run “go help test” and “go help testflag”.
Just rename package_test.go to packagetest.go
For BASH
Run go run PATH_TO_FILES/!(*_test).go
NOTE
If you get an event not found error when running this command, you probably need to enable extended globbing in your bash terminal.
Run shopt-s extglob
after you Run go run PATH_TO_FILES/!(*_test).go
For those using ZSH
setopt extendedglob # to get help regarding globbing
next
foo*~*bar* # match everything that starts with foo but doesn't contain bar
So with my case, go run PATH_TO_FILES/*~*_test.go*
if you are using linux:
go run `ls PATH_TO_FILES/*.go | grep -v _test.go`
it workes for me.
I'm writing a shared library, and in order to update the header files in my /usr/include dir, I wrote a python program to compare and keep the header files from the source directory up to date in the /usr/include directory, in hopes to have auto completion within the headers themselves on every build when I link them with my testing executable.
The problem is that Qt Creator fails to execute the python program. My settings are as follows:
Command : 'python'
Working Directory : '/path/to/python/file'
Args : 'PythonFile.py'
Yes, the Enable custom process step box is checked.
My output resembles the following:
Could not start process "python " PythonFile.py
Granted, if there's another way to solve this header issue that is far more simpler (and includes the ability for the auto completion to be updated), I'm totally all ears.
Edit
I should also say I've executed the program via CLI and it works fine.
Update
Per updating the command according to Slava's suggestion, I got the following output:
Program is beginning
Traceback (most recent call last):
File "UpdateHeaders.py", line 59, in <module>
PROJECT_ROOT = environ['ATLAS_PROJ_ROOT']
File "/usr/lib/python2.7/UserDict.py", line 23, in __getitem__
raise KeyError(key)
KeyError: 'ATLAS_PROJ_ROOT'
13:08:35: The process "/usr/bin/env" exited with code 1.
Yet, if I run it via CLI I get this:
Program is beginning
Updating include directory on a UNIX based system, copying files from /home/amsterdam/Programming/atlas/Engine/AtlasEngine/ to /usr/include/atlas/Engine/
Found a source count of 5;
Found a dest count of 0
No headers have been copied to "/usr/include/atlas/Engine/", yet; copying now from "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/"
Iterating through ['AtlasEngine.pro', 'GameObject.hpp', 'AtlasEngine_global.h', 'Type_Config.hpp', 'Rectangle.hpp', 'AtlasEngine.pro.user', 'Engine.hpp', 'Engine.cpp']
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/GameObject.hpp" to "/usr/include/atlas/Engine/GameObject.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/AtlasEngine_global.h" to "/usr/include/atlas/Engine/AtlasEngine_global.h"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Type_Config.hpp" to "/usr/include/atlas/Engine/Type_Config.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Rectangle.hpp" to "/usr/include/atlas/Engine/Rectangle.hpp"
Copying "/home/amsterdam/Programming/atlas/Engine/AtlasEngine/Engine.hpp" to "/usr/include/atlas/Engine/Engine.hpp"
As shown, everything works fine without any errors unless it's ran through Qt Creator. Any suggestions?
Command : '/usr/bin/env'
Working Directory : '/path/to/python/file'
Args : 'python PythonFile.py'
or
Command : '/usr/bin/env'
Args : 'python /path/to/python/file/PythonFile.py'
I have a C++ program that writes to stdout that I am trying to compile into a command line utility in XCode. I need the program compiled into a release build (which it seems, XCode calls an Archive - go figure), not run it as debug.
I basically want to pipe the output of my program into a textfile like this
MyProgram > TextFile.txt
I can compile the program into a command line and run it like this via a Bash shell like this:
Open MyProgram
This spawns a new process (not what I want). However, I could live with that if this worked:
Open MyProgram > TextFile.txt
...But it doesnt :-(. If I try to just run MyProgram directly from Bash, I get the error: -bash: MyProgram: command not found.
What am I doing wrong? How can I compile my command line tool to NOT require the Open command under Mac OSX?
Thanks for any help you can provide. I am picking up C++ on the Mac platform and I am beginning to find it quite it a bit more troublesome than Visual Studio. Does it ever get less painful to work with? :-)
Make your project a Command Line Tool. This will make it so you can run it from the command line directly.
Run it by typing ./MyProgram or ./MyProgram > TextFile.txt not open MyProgram.