Felix maven bundle plugin issue with Include-Resource instruction - maven-bundle-plugin

The problem: I am generating some files under target/temp that I want to be included in the final bundle wab that is being bundled in the package phase. Here is the code snippet that I am using:
<_wab>src/main/webapp</_wab>
<Include-Resource>
{maven-resources},
              src/main/webapp/destination=target/temp
</Include-Resource>
I would like the directories generated under target/temp to be included under the destination directory structure. However the above syntax is not including the files under temp anywhere. But the maven-resources are getting included in the root location of the wab.
The documentation is from this page: http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html under <Include-Resource> instruction.
It says " If a specific resource must be placed into a subdirectory of the bundle jar, then use the assignment form, where the first path is the the destination path (including file name if the resource is a file) and the second path is the resource to copy."
I have checked and the required directories are being generated under target/temp before the package phase where the maven-bundle-plugin is being used. Is there something that I am missing?
I would really appreciate any help with this issue.

I believe you mean your destination path to be without src/main/webapp, because that's "relative to the root of the resulting bundle JAR file", and your resource to copy perhaps work better with a slash to indicate it's a directory - try if this works better for you:
<Include-Resource>{maven-resources},destination/=target/temp/</Include-Resource>
I have NOT tried this out, but FYI the following does work for me, although this is for two particular files (whereas you want a directory):
<Include-Resource>{maven-resources},META-INF/git.properties=target/classes/META-INF/git.properties,target/classes/LICENSE</Include-Resource>

Related

Cant find project for PackageCompiler

I am trying to create an executable using PackageCompiler.jl. However, whenever I run the command
create_app("src/UnsteadyFlowSolvers.jl","UNSflowCompiled")
I keep getting the error
ERROR: could not find project at "C:\\Users\\Matthew\\OneDrive - Mississippi State University\\Research\\UNSflow\\Ramesh Live\\src\\UnsteadyFlowSolvers.jl"
This is the exact location of the file. For instance:
include("src/UnsteadyFlowSolvers.jl") ; UnsteadyFlowSolvers.julia_main()
works perfectly fine and generates the exact result I would like the executable to return. The Project.toml file is in the current directory if that matters. I have tried an alternate version of the package where the module file is not located in another directory to no avail.
Thanks
create_app(package_dir::String, compiled_app::String; kwargs...)
Compile an app with the source in package_dir to the folder compiled_app.
So the first argument to create_app is the package folder, not the .jl file. I'd suggest a ;cd .. to get outside your project folder, then
create_app("Ramesh Live", "UNSflowCompiled")

How to access modules from mura tag in content

I'd like to access the modules directory in /themes/[themename]/modules instead of /sites/default/themes/[themename]/modules/ from [mura]-tag in content
This is Mura Core Version 7.1.438
[mura]dspInclude('themes/[themename]/modules/sprachweiche.cfm')[/mura]
Error 500
Could not find the included template /muraWRM/sites/default/themes/[themename]/modules/sprachweiche.cfm.
To display a registered module, simply use the following syntax, and pass in the directory name of your module.
[m]$.dspObject(object='your-module-directory-name-goes-here')[/m]
That said, in your example though, it doesn't appear to be a valid "module", since you're attempting to include a file called sprachweiche.cfm. So, if you simply want to include a file, I wouldn't put it under the modules directory. So, if you have a directory under your theme called includes, you could use this instead:
[m]$.dspThemeInclude('includes/sprachweiche.cfm')[/m]
This method automatically generates the path to your theme, so you can simply pass in the rest of the path to your desired file.
Cheers!
Thanks Steve
[m]$.dspThemeInclude('includes/sprachweiche.cfm')[/m] caused the error:
Could not find the included template /muraWRM/themes/[themename]/includes/sprachweiche.cfm.
But including the modules directory to the path works:
[m]$.dspThemeInclude('modules/includes/sprachweiche.cfm')[/m]

Add files with target using CMake

I am working using CMake on a little C project using OpenGL. To be able to run, my executable needs to access some resources files such as 3D meshes, textures or shader program sources.
When I run the generated executable, the current folder is the directory where it is created. This directory may differ depending on the binary tree location (out of source ? insource ? anywhere in the coputer). But my resources are located near my source tree.
I would like my CMakeLists.txt to copy the resource folder in my executable output directory but I have not a good idea of the way to do that. Besides, I am not sure this is a "best practice" of CMake.
Thank you for reading :)
You have 2 useful variable to do so: CMAKE_CURRENT_BINARY_DIR and CMAKE_BINARY_DIR, the former refers to the current CMakeLists.txt output directory, the latter refers to the top level project output directory.
Most of the time, you handle resources near the executable depending on it, then you'll certainly want to refer to CMAKE_CURRENT_BINARY_DIR.
configure_file(
"MyResourceDir/myresource"
"${CMAKE_CURRENT_BINARY_DIR}/" COPYONLY
)
This command will copy resource of the CURRENT_CMAKE_SOURCE_DIR/MyResourceDir named myresource in the directory matching the current CMakeLists.txt.
You can glob files of your MyResourceDir and loop on it (maybe there is also some function to copy directory instead of list of files).

Understand the linux build process

I'm trying to build the linux kernel and would like to understand a few things:
I have added a new file (b.c) to a certain directory with the intention of having the file compiled in. The Makefile has been updated accordingly. While compiling the file, an error is thrown saying that a certain header (a.h) is not found. However, other files in the same directory use a.h without any issues.
I have observed that .o.cmd file get created for all files except b.c. Is this a prerequisite for the headers to be correctly included? Does this file have any significance to the issue I'm facing?
For eg: I added 'async_infra.o' to this line in the Makefile:
uml_gre-objs := uml_gre_kern.o uml_gre_user.o async_infra.o
uml_gre_user.c includes the header that I'd like to be included in async_infra.c
Any suggestions on what's missing and how to address the issue will be appreciated.

How to define relative paths in Visual Studio Project?

I have a library and a console application that uses a library. The library has a folder with source and header files.
My project is in a child/inner directory but that library directory that I want to include is in a parent/upper directory.
My project directory:
H:\Gmail_04\gsasl-1.0\lib\libgsaslMain
Includes files are here:
H:\Gmail_04\gsasl-1.0\src
How can I use paths relative to the project directory, to include folders that are in a parent/upper directory?
Instead of using relative paths, you could also use the predefined macros of VS to achieve this.
$(ProjectDir) points to the directory of your .vcproj file, $(SolutionDir) is the directory of the .sln file.
You get a list of available macros when opening a project, go to
Properties → Configuration Properties → C/C++ → General
and hit the three dots:
In the upcoming dialog, hit Macros to see the macros that are predefined by the Studio (consult MSDN for their meaning):
You can use the Macros by typing $(MACRO_NAME) (note the $ and the round brackets).
If I get you right, you need ..\..\src
I have used a syntax like this before:
$(ProjectDir)..\headers
or
..\headers
As other have pointed out, the starting directory is the one your project file is in(vcproj or vcxproj), not where your main code is located.
By default, all paths you define will be relative. The question is: relative to what? There are several options:
Specifying a file or a path with nothing before it. For example: "mylib.lib". In that case, the file will be searched at the Output Directory.
If you add "..\", the path will be calculated from the actual path where the .sln file resides.
Please note that following a macro such as $(SolutionDir) there is no need to add a backward slash "\". Just use $(SolutionDir)mylibdir\mylib.lib.
In case you just can't get it to work, open the project file externally from Notepad and check it.
There are a couple of hints you need to know.
consider your app is running under c:\MyRepository\MyApp
a single dot on your path means the folder where your app runs. So if you like to reach some folder or file under MyApp folder (imagine c:\MyRepository\MyApp\Resources\someText.txt) you can do it like var bla = File.Exists(./Resources/someText.txt)
and you can go one level up with double dots (..) think about a folder under c:\MyRepository\SomeFolder\sometext.txt
for MyApp, it will be like
var bla = File.Exists(../SomeFolder/someText.txt)
and it is possible to go 2,3,4.. levels up like
../../SomeFolder (2 levels up)
../../../SomeFolder (3 levels up)
and path starting with no dots means the drive root. var bla = File.Exists(/SomeFolder/someText.txt) will look for the c:\SomeFolder\someText.txt in our scenario.

Resources