There are two options for creating scripts not bound to object creation/updating or pre/post deployment - Script (Build) and Script (Not in build).
Script (Not in build) can be used, for example, for including into a Pre-Deployment or Post-Deployment script by :r directive. They will just be included into generated deployment script.
I tried to use Script (Build) just to see how it is used. First, it did not recognize PRINT instruction: build just fails on it. Second, if I just leave a comment in Script (Build), it just never included into generated deployment script.
I also notices that if to open a Script (Not in build) in VS editor, it shows a toolbar of Execute-Parse-Plan-Connect, while I cannot see or turn on this toolbar for a Script (Build).
The question is - what is the purpose of introducing Script (Build)? How can I harness and use it, why can I need it? At which step of build does it make sense?
If you display properties of the scripts you will see:
Script (Build) - Build Action = Build
Script (Not in build) - Build Action = None
So script not in build is just a helper file that you might want to include in a project but it wont be parsed nor compiled into dacpac.
Script Build is a regular file that is parsed and compiled into dacpac, it has the same meaning as table file or stored procedure file. One can use it if he doesn't like to go through Add Item menu or he just want to include multiple objects of different type in one file.
Related
My .py files in Robot-Framework allows me to introduce breakpoints but .robot file it doesn't allow. How do i introduce and toggle breakpoints in my .robot test files for debugging?
Nohow - you can't add a Pycharm breakpoint in a .robot file.
The reason is your test script is not a real python code. When a run is started, Pycharm runs the entry point of the robot module - which reads the file's text, parses it in its internal structures and "converts" to python code (in quotes, as it really doesn't convert anything, makes RF objects and constructs a flow b/n them).
The actual python code that is ran is in the robotframework package (and any other py packages & modules it imports). For both the framework and Pycharm the .robot file is just a text file - thus no breakpoints are effective.
You can add a breakpoint inside a py file - one of the framework's, or in a library of yours, and it will be honored.
Or, you can use the Debug library - once it hits the point where you've put the Debug keyword, it gives you an interactive shell with full context at the current point (e.g. you can CRUD variables, or run available keywords).
It is possible to add breakpoints to both .py and .robot files with Robot Framework Language Server.
There are plugins for both PyCharm and VS Code.
I am trying to populate a QTableview with some data. When developing under Qt Creator, data is read from build directory. Running the program each time, the QTableview keeps getting repopulated with previous data.
If I manually change the build directory each time before run, doesn't happen. But how do I solve the problem without manually changing the build directory every time I want a fresh run?
In your project directory there is a file name ProjectName.pro.user.
This file creating when you configure your project. it's XML file.
you can find this line on *.user files:
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">C:/Users/probook/Documents/Qt/testProject/Build/Windows/Debug</value>
This line define build directory address for debug. there is a same line for Release and Profile in that file.
You can also use Qt creator to define(customize) relative directory build:
goto Qt creator, Tools, Options..., Build & Run, General, Default build directory.
More info:
Qt Creator stores user-specific project settings in a .pro.user file. You can share these settings between several projects as a .pro.shared file. It has the same XML structure as a .pro.user file, but only contains the settings to share.
Based on comment, issue seems to be data which gets saved to build directory. And solution would be to remove it before running the application.
You can add Custom Process Step, either under Projects - Build Settings -
Build Steps, or under Projects - Run Settings - Deployment, and just delete the desired data files. Exact command depends on operating system.
An alternative might be to add a command line switch, something like --development-erase-saved-data, to the application itself, and erase the files (or just not read them, or whatever). Then add that command line switch to Projects - Run Settings - Run Steps - Command Line Arguments for desired build configurations.
Adding support for this in the application itself is easier to maintain, and is almost automatically cross-platform. However, it might be a feature you don't want in the application, though in that case you might only enable it for Debug builds (with #ifdef).
As a side note, saving data to executable directory is not a good idea these days. You might want to save it for example to location returned by
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)
(See here for more info.)
I have a pre-build event in a web project in Visual Studio (2012 but same behaviour in 2010).
The prebuild invoke a simple exe which look for every filename.aspx.vb file if there is a matching filename.html in the folder.
If it does, it just read the filename.html as a string (escaped and minified) and inject it as a string also in the finename.aspx.vb something like :
myStribBuilder.Append("This is where the html code from the external file is going")
Let say i made a modification on filename.html I save and I compile and test the website. It should reflect the latest change when calling filename.aspx
Here what happens :
If I have a very light project with one page or two, it does work. It compiles fine as expected.
Then project get bigger and it doesn't work anymore. I mean code is injected but not compiled as expected, if I refresh filename.aspx on webserver I will still have same version but if I open filename.aspx.vb on VS the code is in there. Second compilation works 100% ok.
I can live with that but I have to compile TWICE each time for testing purpose after html files changes.
This doesn't make sense to me.
What "pre-build" means if in fact it seems to cache the code right on compilation request before executing the prebuild routine.
So, how can I be sure to inject code in my *.vb file before compilation begins ?
I figured out the problem was not VS not waiting for exe to complete on prebuild, but rather having the filename.aspx.vb opened when compiling.
The code update itself on the IDE (with options set to autoupdate externally modified opened page) but I guess the compile process keep the pre-build version of the opened file, which make sense in a way.
If I close the file before compiling it is ok.
Now I wonder if there is a workaround to this, but I understand it is not common practice to externally modify on the fly opened files in IDE before compilation. I do however rely heavily on this technique.
I've got an app that consists of a shell app which loads in other modules. As I've made changes and put them on the web of course others on the team haven't seen updates because of older versions they've cached.
Now of course a simple fix is to change the directory I'm uploading to and symbolically linking to that file, but I thought I could get around this by custom compiler arguments...
I've been getting around the caching of the external modules by appending a random number to the url of the module to be loaded by the shell (ie loadModule(blah/blah.swf?123). But this also means that the modules get pulled everytime; that's not needed. I then created a VERSION string in the main app that I change when the modules need to be pulled (ie loadModule(module.swf?+VERSION). That works for the modules but not the main app.
I'm thinking that if I can add some sort of VERSION to the compiler - the Consts I suppose - then I could also use that CONST to compile the file with shell_{CONST}.swf (ie shell_203.swf) and make sure that the htmlTemplate ALSO embeds this versioned file...
Suggestions?
I'm playing a bit with beta version of PHP Storm (PHP version of WebIDE) and its integration of PHPUnit. I know how to set a profile to run tests in particular file, directory or class. Problem is, I'd like to create some profile where Run button would run tests in currently opened file.
Any idea if there's a way to do it? Or perhaps it isn't implemented in beta version yet?
Open a context run/debug menu via Ctrl-Alt-F9 (this depends on your OS, look at Run|Debug... menu item), then look at lines marked with 2 & 3 - they correspond to current file and test. Press number to invoke.
You can record a macro with Tools|Record Macro and add a shortcut via Settings|Keymap|Macros. Do not forget to make a Copy on default keymap before attempting a change.