How to add a custom Module-Description Variable in Android.mk? - android-build

I want to access a module description variable (a custom variable) while building an android module i.e. an executable or shared-library or prebuilt and based on its value do some extra processing on the executable or shared-lib or prebuilt.
Is there a way to do it?

Add the variable to the list of variables in clear_vars.mk , so that they get cleared when an Android.mk does include $(CLEAR_VARS)

Related

Can CPACK_INSTALL_CMAKE_PROJECTS be used for selective install?

For my application, I created 4 components, and want to 'install' only the applications and their docs. According to https://cmake.org/Wiki/CMake:CPackConfiguration, if in my config file I have the line
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
then all the four components are installed. If I use the component names instead like
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};apps docs;/")
I receive a package with no component name appended, and it contains the top level requested directory but no files at all. If I provide only one component like
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};apps;/")
the package name does not contain the name of the component, but the files are generated in their right position.
What do I wrong?
EDIT: Just to add more strange things:
For the ALL case 4 files with names install_manifest_+comp name are created. For the second case I have install_manifest_apps docs.txt of zero length, and for the third case I have install_manifest_apps.txt, with the right content.
It seems to me that the macro can only accept one argument which can be either ALL or a component name; this means it cannot be used to install a 2-component system.
Moreover: if I use a component name, make package only produces that one package, without appending the component name, but with the right content. Till now I guessed that make install and make package are independent.
Set multiple values to CPACK_INSTALL_CMAKE_PROJECTS, one for each component you want to include:
set( CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};apps;/"
"${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};docs;/"
)

Global variables in Intellij templates

I am trying to create some variables similar to the predefined ones that come with the IntelliJ templating system. I am looking to create a variable called $MY_NAME_AND_EMAIL where I can define it once and then reference it in different templates. Is this possible?
I have tried creating an include called AuthorName.txt:
#set($MY_NAME_AND_EMAIL = "Name <email#example.com>")
Then, in one of my templates, I put the following line at the top:
#parse("AuthorName.txt")
Further down the file, I use ${MY_NAME_AND_EMAIL} in the header. However, when I create a new file base on that template, it still prompts me for the name and email field, even though I set it in an include file and added the #parse directive. What am I doing wrong?

Customize genmodel not to create plugin.xml, plugin.propeties and build.properties

I have a metamodel.ecore which I generate its Model Code from the genmodel file (Right click on metamodel.genmodel ==> Select Generate Model Code);
However, some additional files (plugin.xml, plugin.properties and build.properties) are created during code generation. Since I just need the model code for my special purpose (e.g. I don't want my current project to be converted to a plugin project), I want to prevent generating these files.
Any simple way to do that?
With the properties view opened, select the root element in your genmodel. You need to do the following changes in your genmodel:
Set All / Bundle Manifest to false. It will prevent MANIFEST.MF to be generated.
Set Model / Model Plug-in ID to empty string or use the button on the top right of the properties view named "Restore Default Value" to set it to null. It will prevent the generation of the files plugin.xml, plugin.properties and build.properties.
Set Template & Merge / Update Classpath to false. This one is optional but with your use case, you may want EMF to stop messing out with your .classpath file.

empty default component name is displayed as 'Unspecified'

I'm trying to make two packages using cmake 2.8.12: the first one contains a shared library, the second one contains headers files. Apparently, I want two packages with names libname and libname-dev respectively, so I used command install with no specified component for the shared library and the same command with COMPONENT dev for the headers files. Before this I had defined an empty default component name. So I have a code as follows:
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "")
install(TARGETS libname DESTINATION /usr/local/lib)
install(FILES ${header_files} DESTINATION /usr/local/include COMPONENT dev)
But as a result, despite the empty default component name libname-Unspecified and libname-dev are generated. I find this behavior quite weird, because it seems I have no way to define two packages with previously described names. Are there any ideas how to do this in any other way?
In case of debian:
Give your main component some temporary name, e.g. "runtime".
install(TARGETS my-target
COMPONENT runtime
DESTINATION ${INSTALLDIR}
)
Then remove the postfixed component name as follows:
set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}")
Might work with other generators, too if they provide something equivalent to "CPACK_DEBIAN_RUNTIME_PACKAGE_NAME".

Opencart display one module conents into another module

I'm having custom footer module in my template. Also i'm using testimonial module in the position content bottom. I'm trying to display testimonial inside custom footer.
To do this i simply copied testimonial.tpl and testimonial.php contents and pasted into customfooter.tpl and customfooter.php
After this i'm getting errors stating
undefined variable and class name already assigned error
Did you know how to do this?
See this answer for how to do use a module in a separate modification/controller
opencart - How to manually display a module inside a template file?
You simply need to change from the common/home to your module's controller and view files
please define variable.
how can you define i will show you.
catalog > controller > header.php
for static variable
$this->load->language('common/header');
$data['text_home'] = $this->language->get('text_home');
// Where language file in assign this variable with different language foler
$data['text_home'] = $this->url->link('information/contact');
and you can tpl file in use this varible.
<?php echo $text_home; ?>
make sure 100% erorr has not facing
for dynamic variable