@Stanislav-Silnicki long story short: i did it.
write correct targets interdependency in .pro:
#-------------------------------------------------
#
# Project created by QtCreator 2018-04-02T04:41:55
#
#-------------------------------------------------
QT -= core gui
TARGET = andy
TEMPLATE = lib
DEFINES += ANDROID_ANDY_LIB_LIBRARY
SOURCES += \
andy_native.cpp
HEADERS += \
com_andy_EartActivity.h \
andy_native.h
firsttarget.target = firsttarget
firsttarget.commands += javac -cp /home/user/Android/platforms/android-26/android.jar:/home/user/Unity-2018.1.0b8/Editor/Data/PlaybackEngines/AndroidPlayer/Variations/mono/Release/Classes/classes.jar -sourcepath java/src java/src/com/andy/AndyActivity.java -d java/classes
secondtarget.target = secondtarget
secondtarget.commands = javah -cp java/src com.andy.AndyActivity
lasttarget.target = lasttarget
lasttarget.commands = jar cvfM andy.jar -C java/classes . libandy.so
QMAKE_EXTRA_TARGETS = firsttarget secondtarget lasttarget
PRE_TARGETDEPS = firsttarget secondtarget
DISTFILES += \
java/src/com/andy/AndyActivity.java
this will produce first three targets while in first make invocation.
Than, the last forth target (.jar) has to be built during second make invocation, that is added via QtCreators menu:
[image: 26ebfbd9-9df9-4c3d-872d-9f783c65cf85.png]
note, last two default build steps in QtCreators menu are disabled. This saves compile time. It just adds no value to my goal.
We are the champions! ))
UPDATE: just couple sidenotes for those, who stucks in android's development like I constantly do:
a) packing native libYourNativeLib.so in java's .jar will make it hard to init... so, finally I refused this approach and just left binary lib for deployment as a separate file.
b) if your Android app will crush due to inability to load gnustl_shared, just add this line in qmake's .pro:
QMAKE_LIBS_PRIVATE -= -lgnustl_shared