Android NDK Make File and Maven Build Issues - maven

Let me just say that I'm pretty new to Android NDK and so, I've been trying to go through Androids documentation on it. I've come across some issues with it when trying to utilize it in Maven (via plugins). My maven plugins snippets are below as well as my Android.mk file.
pom.xml (plugins portion):
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-AguiceAnnotationDatabasePackageName=my.package.name</compilerArgument>
<fork>true</fork>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>native-maven-plugin</artifactId>
<version>1.0-alpha-8</version>
<executions>
<execution>
<goals>
<goal>javah</goal>
</goals>
<phase>compile</phase>
<configuration>
<javahClassNames>
<javahClassName>my.package.name.MyClass</javahClassName>
</javahClassNames>
<javahVerbose>true</javahVerbose>
<javahPath>$(THE_JAVA_PATH)\bin\javah.exe</javahPath>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-maven-plugin</artifactId>
<extensions>true</extensions>
<configuration>
<manifest>
<debuggable>true</debuggable>
<usesSdk>
<minSdkVersion>17</minSdkVersion>
<targetSdkVersion>18</targetSdkVersion>
</usesSdk>
</manifest>
<apk>
<debug>true</debug>
</apk>
<extractDuplicates>true</extractDuplicates>
<dex>
<coreLibrary>true</coreLibrary>
<jvmArguments>
<jvmArgument>-Xmx2048m</jvmArgument>
</jvmArguments>
</dex>
<nativeLibrariesDirectory>${to.ndk.libs}</nativeLibrariesDirectory>
<ndkOutputDirectory>${to.ndk.objs}/local</ndkOutputDirectory>
</configuration>
</plugin>
<plugin>
<groupId>com.simpligility.maven.plugins</groupId>
<artifactId>android-ndk-maven-plugin</artifactId>
<version>1.0.1-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>ndk-build</goal>
</goals>
<configuration>
<target>${project.artifactId}</target>
<finalLibraryName>${project.artifactId}</finalLibraryName>
<ndkPath>$(THE_NDK_PATH)</ndkPath>
<makefile>jni/Android.mk</makefile>
<applicationMakefile>jni/Application.mk</applicationMakefile>
<architectures>${arch}</architectures>
<additionalCommandline>${ndk.args}</additionalCommandline>
<librariesOutputDirectory>${to.ndk.libs}</librariesOutputDirectory>
<objectsOutputDirectory>${to.ndk.objs}</objectsOutputDirectory>
<headerFilesDirectives>
<headerFilesDirective>
<directory>${basedir}/jni</directory>
<includes>
<include>**\/*.h</include>
</includes>
</headerFilesDirective>
<headerFilesDirective>
<directory>${project.build.directory}/native/javah</directory>
<includes>
<include>**\/*.h</include>
</includes>
</headerFilesDirective>
</headerFilesDirectives>
</configuration>
</execution>
</executions>
</plugin>
My directory structure is as follows MyRoot -> jni - > (c/cpp files). And of course the standard directory structure for java files. My Android.mk file is the following:
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := my-lib
LOCAL_SRC_FILES := MyClass1.cpp \
MyFile1.c \
MyClass2.cpp
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/../target/native/javah
LOCAL_LDLIBS := -llog
LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_CFLAGS += \
-D _NX_FEATURE_ATOMIC_C_PLUS_PLUS_11_ \
-D _NX_FEATURE_CAN_BUS_INTERFACE_ROUTER_ \
-D _NX_FEATURE_CAN_BUS_CREATED_BY_CONFIGURATION_ \
-D _NX_FEATURE_CAN_BUS_TC_SERVICE_ \
-D _NX_FEATURE_CRC_ \
-D _NX_FEATURE_EXCEPTIONS_ \
-D _NX_FEATURE_FILE_SUPPORT_CRT_ \
-D _NX_FEATURE_FLOAT_64_ \
-D _NX_FEATURE_LOG_ \
-D _NX_FEATURE_MUTEX_PTHREAD_ \
-D _NX_FEATURE_POSIX_SIGNAL_HANDLER_ \
-D _NX_FEATURE_RANDOM_ \
-D _NX_FEATURE_SECURITY_UNSET_INTENTIONALLY_ \
-D _NX_FEATURE_THREAD_ \
-D _NX_FEATURE_TRACE_STDIO_ \
-D _NX_FEATURE_TCP_IP_ \
-D _NX_FEATURE_XML_PARSER_ \
-D NX_CUSTOMER_FAR \
-D __STDC_FORMAT_MACROS
-D HAVE_FTRUNCATE=1 \
-D HAVE_GETCWD=1 \
-D HAVE_GETPAGESIZE=1 \
-D HAVE_GETTIMEOFDAY=1 \
-D HAVE_INTTYPES_H=1 \
-D HAVE_MALLOC=1 \
-D HAVE_MEMCHR=1 \
-D HAVE_MEMMOVE=1 \
-D HAVE_MEMORY_H=1 \
-D HAVE_MEMSET=1 \
-D HAVE_MKDIR=1 \
-D HAVE_MMAP=1 \
-D HAVE_MUNMAP=1 \
-D HAVE_NETDB_H=1 \
-D HAVE_PTRDIFF_T=1 \
-D HAVE_RMDIR=1 \
-D HAVE_SELECT=1 \
-D HAVE_SOCKET=1 \
-D HAVE_STDDEF_H=1 \
-D HAVE_STDINT_H=1 \
-D HAVE_STDLIB_H=1 \
-D HAVE_STRINGS_H=1 \
-D HAVE_STRING_H=1 \
-D HAVE_STRPBRK=1 \
-D HAVE_STRRCHR=1 \
-D HAVE_STRSPN=1 \
-D HAVE_STRTOUL=1 \
-D HAVE_STRTOULL=1 \
-D HAVE_SYS_PARAM_H=1 \
-D HAVE_SYS_SOCKET_H=1 \
-D HAVE_SYS_STAT_H=1 \
-D HAVE_SYS_TIME_H=1 \
-D HAVE_SYS_TYPES_H=1 \
-D HAVE_TERMIOS_H=1 \
-D HAVE_UNISTD_H=1
LOCAL_STATIC_LIBRARIES := $(ANDROID_MAVEN_PLUGIN_LOCAL_STATIC_LIBRARIES)
LOCAL_SHARED_LIBRARIES := $(ANDROID_MAVEN_PLUGIN_LOCAL_SHARED_LIBRARIES)
include $(BUILD_SHARED_LIBRARY)
# Important: Must be the last import in order for Android Maven Plugins paths to work
include $(ANDROID_MAVEN_PLUGIN_MAKEFILE)
So the error I'm getting Is the following:
...\android-ndk-r10e\ndk-build.cmd -C ...\MyRoot APP_BUILD_SCRIPT=jni/Android.mk NDK_APPLICATION_MK=jni/Application.mk NDK_TOOLCHAIN=x86_64-4.9 APP_ABI=x86_64 V=1 -B NDK_DEBUG=1 NDK_LIBS_OUT=...\MyRoot\target\ndk-libs NDK_OUT=...\MyRoot\target\ndk-obj MyRoot
make.exe: *** No rule to make target `MyRoot'. Stop.
I'm not sure why MyRoot is even being used. And when I do the command manually wihtout the 'MyRoot' the build process starts but it doesn't seem to use any of my include files listed in my Android.mk file (LOCAL_C_INCLUDES).
Its probably something silly but I'm at a lost here. Any help is appreciated.

At the end of your command you have a floating 'MyRoot'. I'm pretty sure removing that will resolve this error.
...\android-ndk-r10e\ndk-build.cmd -C ...\MyRoot \
APP_BUILD_SCRIPT=jni/Android.mk NDK_APPLICATION_MK=jni/Application.mk \
NDK_TOOLCHAIN=x86_64-4.9 APP_ABI=x86_64 V=1 -B NDK_DEBUG=1 \
NDK_LIBS_OUT=...\MyRoot\target\ndk-libs \
NDK_OUT=...\MyRoot\target\ndk-obj MyRoot # this MyRoot is unnecessary
You will also find that many of these options (APP_ABI, NDK_TOOLCHAIN, etc.) are unnecessary if your Application.mk and directory structure are set up correctly.

Related

WebSphere 8.5 :ESB is missing. How to start it together with WebSphere

I installed BPM:
./imcl install \
com.ibm.bpm.ESB.v85_8.6.0.20170918_1207, \
com.ibm.websphere.ND.v85_8.5.5012.20170627_1018 \
-repositories /u01/tmp/BPM/repository/repos_64bit/repository.config \
-acceptLicense \
-installationDirectory /u01/apps/IBM/BPM \
-properties user.wasjava=java8 \
-showVerboseProgress -log silentinstall.log
Than i created Deployment_Managed Profile:
./manageprofiles.sh \
-create \
-adminPassword XXXXXXX \
-profileName Dmgr06 \
-cellName Cell03 \
-serverType DEPLOYMENT_MANAGER \
-adminUserName wasadmin \
-enableAdminSecurity true \
-nodeName CellManager03 \
-profilePath /u01/apps/IBM/BPM/profiles/Dmgr06 \
-personalCertValidityPeriod 15 \
-signingCertValidityPeriod 15 \
-keyStorePassword XXXXXXXX \
-templatePath /u01/apps/IBM/BPM/profileTemplates/management/ \
-startingPort 10000 \
-isDefault
After This i run the startManager.sh command. I was expecting to see WebSphere and ESB up and running but i see only WebSphere:
How do i add the ESB?

Bazel genrule: Use linebreaks in command

I use a genrule with a lot of sources, that have a long identifier. The command needs to list all sources explicitely, which would result in a reeaally long cmd. Therefore I tried to use linebreaks (as known from bash or shell commands)...
However, bazel complains about unterminated strings.
genrule(
name = "Aggregate_Reports",
srcs = ["//really/long/path/to/module/ModuleA/src:CoverageHtml",
"//really/long/path/to/module/ModuleA/src:TestRun",
"//really/long/path/to/module/ModuleB/src:CoverageHtml",],
outs = ["UT_Summary.txt"],
message = "Create unified report",
tools = [":Create_Summary"],
cmd = "$(location :Create_Summary) -t \
$(location //really/long/path/to/module/ModuleA/src:TestRun) \
$(location //really/long/path/to/module/ModuleB/src:TestRun) \
-c \
$(location //really/long/path/to/module/ModuleA/src:CoverageHtml) \
$(location //really/long/path/to/module/ModuleB/src:CoverageHtml) \
-o $(#)",
executable = True,
visibility=["//visibility:public"],
)
Escaping the \ with $ does not change anything...
As in Python, you can use triple-quotes to preserve the newlines:
cmd = """$(location :Create_Summary) -t \
$(location //really/long/path/to/module/ModuleA/src:TestRun) \
$(location //really/long/path/to/module/ModuleB/src:TestRun) \
-c \
$(location //really/long/path/to/module/ModuleA/src:CoverageHtml) \
$(location //really/long/path/to/module/ModuleB/src:CoverageHtml) \
-o $(#)""",

Golang in Vim - Tagbar plugin shows incorrect places

I've installed vim-go with all needed binaries, added tagbar plugin from https://github.com/majutsushi/tagbar, gotags and ctags binaries exist in may $PATH.
The problem is that some functions/variables redirect me to the absolutely wrong line (same for multiple tagbar's functions), and some of them works properly. I can't open even main() function in a current project. And I don't see the differences in tagbar/code among these functions/objects.
This is also added to the .vimrc:
let g:tagbar_type_go = {
\ 'ctagstype' : 'go',
\ 'kinds' : [
\ 'p:package',
\ 'i:imports:1',
\ 'c:constants',
\ 'v:variables',
\ 't:types',
\ 'n:interfaces',
\ 'w:fields',
\ 'e:embedded',
\ 'm:methods',
\ 'r:constructor',
\ 'f:functions'
\ ],
\ 'sro' : '.',
\ 'kind2scope' : {
\ 't' : 'ctype',
\ 'n' : 'ntype'
\ },
\ 'scope2kind' : {
\ 'ctype' : 't',
\ 'ntype' : 'n'
\ },
\ 'ctagsbin' : 'gotags',
\ 'ctagsargs' : '-sort -silent'
\ }
Please help to make tagbar work properly, what am I missing?

Custom garmin map have no name

I created a Garmin map from my own OSM files (using JOSM and my own GPS records, no input from Openstreetmap).
The whole process run well, but I have just a little problem : when I load the final map to Basecamp, the name of this map is empty (blank).
Any idea ?
Here is the code. Before, some variables :
PREFIX=640000
ORIGINALNAME=$(echo ${PREFIX}00)
NAME=$(echo ${PREFIX}01)
ID_PUBLIC=64
DIR="/home/Carto"
GMAPIBUILDER="/Applications/Carto/gmapi-builder.py"
MKGMAP="/Applications/Carto/mkgmap/mkgmap.jar"
First, create img files from different layers
for f in $DIR/src/public/*.osm ; do
g=$(basename $f .osm) ;
d=$(dirname $f)
java -Xmx2G -jar $MKGMAP \
--transparent --add-pois-to-areas \
--keep-going --draw-priority=$drawpriority \
--description="[iero] "$g \
--family-name="iero Congo" \
--series-name="iero Congo" \
--mapname=$NAME --family-id=$ID --product-id=$ID \
--country-name=Congo --country-abbr=CG \
--style-file=$DIR/styles --style=iero \
--copyright-message="[iero.org] Congo $DATE" \
--product-version=$VERSION \
--latin1 --output-dir=$DIR/output/imgs/public $f 1> /dev/null;
cp $DIR/output/imgs/public/${NAME}.img $DIR/output/imgs/public/${NAME}.img
let NAME++ ;
let nbfiles++ ;
let drawpriority++ ;
done
Next, concatenate those files in unique img file
java -jar $MKGMAP --tdbfile --gmapsupp $DIR/output/imgs/public/*.img \
--keep-going \
--style-file=$DIR/styles --style=iero \
--family-name="iero Congo" \
--series-name="iero Congo" \
--description="[iero] Congo map" \
--mapname=$ORIGINALNAME --family-id=${ID_PUBLIC} --product-id=${ID_PUBLIC} \
--copyright-message="[iero.org] Congo $DATE" \
--product-version=$VERSION \
--output-dir=$DIR/output/gps/public 1> /dev/null;
Then, create gmapi files, ready for Basecamp :
python $GMAPIBUILDER -t $DIR/output/gps/public/osmmap.tdb -b $DIR/output/gps/public/osmmap.img -o $DIR/output/basecamp/mac/public $DIR/output/imgs/public/*.img
If you want to see the problem, final files can be downloaded in my website : http://www.iero.org/blog/2014/06/carte-du-congo/
Thanks !
Greg
I have done testing and only get the blank names with versions of mkgmap after they introduced the overview map feature. I built a map with r2585 and the name showed correctly.

Installing Magento using SSH to bypass web based installer

I know that I am supposed to use (;) to separate multiple commands but what is the correct format for issuing all these commands in a single line to install magento using ssh to bypass the web based installer?
php-cli -f install.php -- \
--license_agreement_accepted "yes" \
--locale "en_US" \
--timezone "America/Los_Angeles" \
--default_currency "USD" \
--db_host "DB_HOST" \
--db_name "DB_NAME" \
--db_user "DB_USER" \
--db_pass "DB_PASS" \
--url "SITE_URL" \
--use_rewrites "yes" \
--use_secure "no" \
--secure_base_url "" \
--use_secure_admin "no" \
--admin_firstname "FIRST_NAME" \
--admin_lastname "LAST_NAME" \
--admin_email "EMAIL_ADDRESS" \
--admin_username "USERNAME" \
--admin_password "PASSWORD"
Those don't seem to be commands but parameters. Putting them all into a single line:
php-cli -f install.php --license_agreement_accepted "yes" --locale "en_US" ...
should work.

Resources