Can't set OBJECTS_DIR from .pri file - qmake

I want to have one directory for all object files and create Common.pri file that set OBJECTS_DIR like that
OBJECTS_DIR = $$PWD/../
But when build project i can't find obj file in given directory.If I write this direct in .pro file I get the expected result.I successfully include Common.pri file. I checked that with
!include( ../../Common.pri)::warning(Fail to include Common.pri)
How to achieve what i want.I can't find anything in google

The PWD variable specifies the full path leading to the directory containing the current file being parsed, that is, in your case the full path leading to the Common.pri file and NOT the .pro file. I would place a warning($$OBJECTS_DIR) function in both the .pri and the .pro file to verify the value of OBJECTS_DIR variable.

Related

How to change new File method in Groovy?

How do I replace the new File method with a secure one? Is it possible to create a python script and connect it?
Part of the code where I have a problem:
def template Name = new File(file: "${template}").normalize.name.replace(".html", "").replace(".yaml", "")
But when I run my pipeline, I get the error
java.lang.SecurityException: Unable to find constructor: new java.io .File java.util.LinkedHashMap
This method is prohibited and is blacklisted. How do I replace it and with what?
If you're reading the contents of the file, you can replace that "new File" with "readFile".
See https://www.jenkins.io/doc/pipeline/steps/workflow-basic-steps/#readfile-read-file-from-workspace
readFile: Read file from workspace
Reads a file from a relative path (with root in current directory, usually > workspace) and returns its content as a plain string.
file : String
Relative (/-separated) path to file within a workspace to read.
encoding : String (optional)
The encoding to use when reading the file. If left blank, the platform default encoding will be used. Binary files can be read into a Base64-encoded string by specifying "Base64" as the encoding.

Lua require does not work but file is in the trace

I'm trying to require files in Lua, in one case it is working, but when I want to simplify the requirements in updating the LUA PATH the file is not found, but it is in the trace!
To reproduce my require problem I did the test with the package.searchpath function, which takes the required key and the Lua path in arguments.
So the code :
print('MY LUA PATH')
local myLuaPath = "?;?.lua;D:\\Projets\\wow-addon\\HeyThere\\?;D:\\Projets\\wow-addon\\HeyThere\\src\\HeyThere\\?;D:\\Projets\\wow-addon\\HeyThere\\test\\HeyThere\\?"
print(myLuaPath)
print('package search core.add-test')
print(package.searchpath('core.add-test', myLuaPath))
print('package search test.HeyThere.core.add-test')
print(package.searchpath('test.HeyThere.core.add-test', myLuaPath))
The result :
MY LUA PATH
?;?.lua;D:\Projets\wow-addon\HeyThere\?;D:\Projets\wow-addon\HeyThere\src\HeyThere\?;D:\Projets\wow-addon\HeyThere\test\HeyThere\?
package search core.add-test
nil no file 'core\add-test'
no file 'core\add-test.lua'
no file 'D:\Projets\wow-addon\HeyThere\core\add-test'
no file 'D:\Projets\wow-addon\HeyThere\src\HeyThere\core\add-test'
no file 'D:\Projets\wow-addon\HeyThere\test\HeyThere\core\add-test'
package search test.HeyThere.core.add-test
test\HeyThere\core\add-test.lua
So the first try with 'core.add-test' should work with the 'D:\Projets\wow-addon\HeyThere\test\HeyThere\?' value in the path but fails...
In the trace, there is the file I want!
no file 'D:\Projets\wow-addon\HeyThere\test\HeyThere\core\add-test'
But with the same LUA PATH but starting in a parent folder the file is found... Second test with 'test.HeyThere.core.add-test' found from the 'D:\Projets\wow-addon\HeyThere\?'
-> test\HeyThere\core\add-test.lua
Can someone explains to me why it doesn't work the first time?
EDIT :
My current directory is D:\Projets\wow-addon\HeyThere
My lua.exe is in D:\Projets\wow-addon\HeyThere\bin\lua but is added to my PATH variable (I'm on Windows)
I set the LUA_PATH environment variable and execute
lua "test\test-suite.lua" -v
The code inside test-suite.lua is the test code described above
As #EgorSkriptunoff suggested, adding file extansion in the path resolve the problem...
Ex:
Wrong path D:\Projets\wow-addon\HeyThere\?
Good path D:\Projets\wow-addon\HeyThere\?.lua
The extension should be in the path variable because in the require the dot is replace and used as a folder separator.

How can i use relative path names in Doxygen configuration

I have my doxygen in my /utils directory, and my source is in another directory in the root(/code_with_doxygen), how could i make a relative path name for that since it's in a repository that will be on different places on other computers. I can't document the whole root because i don't want the directory /code_without_doxygen build too.
the project tree looks like this:
root
utils
code
code_with_doxygen
code_without_doxygen
documentation
right now i have the settings, but that doesn't seem to work:
FULL_PATH_NAMES = YES
STRIP_FROM_PATH = ../
i can't seem to figure it out with: Relative files paths in doxygen-generated documentation
The relative paths depend on the directory from which directory you are executing doxygen. For example if you have the following project tree:
+ project_root
+ documentation
+ config
- doxyfile
+ pictures
+ output
- run_doxygen.bat
+ code
+ code_with_doxygen
+ code_without_doxygen
In this case all relative paths have they root in the folder "documentation" because you are running the script "run_doxygen.bat" from this folder. So you would set the INPUT tag in the "doxyfile" to
INPUT = ./../code
and the OUTPUT_DIRECTORY tag in the doxyfile to
OUTPUT_DIRECTORY = ./output
The misleading thing is that even if the doxyfile is in the subfolder "config" the paths are NOT relative to the location of the doxyfile because the paths are relative to the location from where doxygen is called. In this case it is the folder "documentation" because this is the location of the script which is calling doxygen.
Doxygen allows for including files into doxyfile. You can generate a file using a script before actually calling doxygen. The content of this file has to look like this:
INPUT += path1
INPUT += path2
...
You seem to to run Linux, I don't know the correct bash-commands.
The file has to be integrated into your doxyfile:
INPUT = (project path)
#INCLUDE = generated filename
This will lead to doxygen using the content of your generated file.
#gmug was right. Don't forget to add comment blocks in your code as specified by doxygen For python I needed to add this: """#package docstring""" at the beginning of the file.
I have been able to use relative paths in my doxygen.cfg file by setting INPUT to a string or set of strings. For example:
INPUT = "." "src"
will tell doxygen to look in both the current directory and its subdirectory, $HERE/src.

Remove zip file item path with Abbrevia

Is it possible to remove a zip file item's path with Abbrevia? After looking at the source code I can not find a method to remove the path of a file. Has anyone tried to do this and if so, how?
EDIT
I am displaying the contents of a zipfile in a TAbListView where the path for each file is stored in the archive. The items were added to the zip file with the StoreOptions set at [soStripDrive], so the path is stored in the TAbListView.Items.Item[I].Subitem[9] for each file in the zip file. I am looking to strip the paths and then save the archive so that none of the files have paths.
Paths before removal
TAbListView.Items.Item[0].Subitem[9] := \DelphiXE4\Projects\Abbrevia\Unit1.pas
TAbListView.Items.Item[1].Subitem[9] := \DelphiXE4\Projects\Abbrevia\Unit1.dfm
Paths after removal
TAbListView.Items.Item[0].Subitem[9] := '';
TAbListView.Items.Item[1].Subitem[9] := '';
So the zipped items do not have any paths.
AFAICT, you can't change the name in the archive (zip) without actually extracting the file and then putting it back in without storing the path in the first place.
The obvious place to try and change it would be with TAbZipItem.StoredPath, but that's read only; using TAbZipItem.FileName works fine when compiling and running, but has no effect. Nothing you do in the TAbsListView will change anything, as it's just displaying content and has nothing to do with the underlying zip archive.

Save current document as .html with same name and path

I'm working on a script for FoldingText which will convert a FoldingText outline (basically a Markdown Text file) into a Remark presentation (an HTML script which makes slideshows from Markdown files). The script works, but I'd like to make the following improvement:
Instead of asking for the name and location to save the HTML file, I'd like to grab the name of the current document and save it as an HTML file (with the same name) in the current folder. The script should fail nicely if there is already a document with that name (offering to either write-over the document or save as a new document with a different name).
The script I'm using for writing to the file was from these forums. The first part is:
on write_to_file(this_data, target_file, append_data) -- (string, file path as string, boolean)
try
set the target_file to the target_file as text
set the open_target_file to ¬
open for access file target_file with write permission
if append_data is false then ¬
set eof of the open_target_file to 0
write this_data to the open_target_file starting at eof as «class utf8»
close access the open_target_file
return true
on error
try
close access file target_file
end try
return false
end try
end write_to_file
And the second part is:
set theFile to choose file name with prompt "Set file name and location:"
my write_to_file(finalText, theFile, true)
Thanks.
FoldingText should have some way of retrieveng the path of the document. I've not found any free dowonload fo the application, so I've not benn able to check by myself, but you should be able to find it if you view the dictionary of the application.
My guess is that there's a property like 'path of', or 'file of' for the FoldingText document:
You will probably end up with something like this:
set theDocPath to file of front document of application "FoldingText"
tell application "Finder"
set theContainer to container of theFile
end tell
set newPath to (theContainer & "export.html) as string
repeat while (file newPath exists)
set newPath to choose file name with prompt "Set file name and location:"
end repeat
my write_to_file(finalText, newPath, true)

Resources