aboutsummaryrefslogtreecommitdiffstats
path: root/build/conf/project_specific/maps/aar.conf
diff options
context:
space:
mode:
authoralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
committeralexv-smirnov <alex@ydb.tech>2023-06-13 11:05:01 +0300
commitbf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0 (patch)
tree1d1df72c0541a59a81439842f46d95396d3e7189 /build/conf/project_specific/maps/aar.conf
parent8bfdfa9a9bd19bddbc58d888e180fbd1218681be (diff)
downloadydb-bf0f13dd39ee3e65092ba3572bb5b1fcd125dcd0.tar.gz
add ymake export to ydb
Diffstat (limited to 'build/conf/project_specific/maps/aar.conf')
-rw-r--r--build/conf/project_specific/maps/aar.conf338
1 files changed, 338 insertions, 0 deletions
diff --git a/build/conf/project_specific/maps/aar.conf b/build/conf/project_specific/maps/aar.conf
new file mode 100644
index 0000000000..6f03e07c1f
--- /dev/null
+++ b/build/conf/project_specific/maps/aar.conf
@@ -0,0 +1,338 @@
+
+_GRADLE_FLAGS_VALUE=
+### @usage: GRADLE_FLAGS(flags...) # internal
+###
+### SEt additional flags for gradle
+macro GRADLE_FLAGS(FLAGS...) {
+ SET_APPEND(_GRADLE_FLAGS_VALUE $FLAGS)
+}
+
+### @usage: PROGUARD_RULES(ProguardRuleFiles...)
+###
+### This macro is strictly prohibited to use outside of mapsmobi project
+macro PROGUARD_RULES(RULES...) {
+ SET_APPEND(_PROGUARD_RULES_GLOBAL $RULES)
+}
+
+### @usage: AARS(Aars...)
+###
+### This macro is strictly prohibited to use outside of mapsmobi project
+macro AARS(DEPS...) {
+ SET_APPEND(_AARS_GLOBAL $DEPS)
+}
+
+### @usage: MOBILE_DLL() # internal
+module MOBILE_DLL: DLL {
+ .CMD=LINK_MOBILE_DLL
+
+ PEERDIR(build/external_resources/android_sdk)
+ PEERDIR(build/external_resources/gradle)
+ PEERDIR(build/platform/java/jdk)
+ PEERDIR($JDK_RESOURCE_PEERDIR)
+
+ SET(BIN_AAR_DIR $BINDIR/aar)
+ SET(BIN_TMP_DIR $BINDIR/tmp)
+}
+
+_MOBILE_TEST_APK_AAR_MANIFEST_VALUE=
+### @usage: MOBILE_TEST_APK_AAR_MANIFEST(file) # internal
+macro MOBILE_TEST_APK_AAR_MANIFEST(FILE) {
+ SET(_MOBILE_TEST_APK_AAR_MANIFEST_VALUE $FILE)
+}
+
+_MOBILE_TEST_APK_AAR_PROGUARD_RULES_VALUE=
+### @usage: MOBILE_TEST_APK_AAR_PROGUARD_RULES(file) # internal
+macro MOBILE_TEST_APK_AAR_PROGUARD_RULES(FILE) {
+ SET(_MOBILE_TEST_APK_AAR_PROGUARD_RULES_VALUE $FILE)
+}
+
+_MOBILE_TEST_APK_AAR_AARS_VALUE=
+### @usage: MOBILE_TEST_APK_AAR_AARS(filenames...) # internal
+macro MOBILE_TEST_APK_AAR_AARS(AARS...) {
+ SET_APPEND(_MOBILE_TEST_APK_AAR_AARS_VALUE $AARS)
+}
+
+_MOBILE_TEST_APK_AAR_BUNDLES_VALUE=
+### @usage: MOBILE_TEST_APK_AAR_BUNDLES(filenames...) # internal
+macro MOBILE_TEST_APK_AAR_BUNDLES(BUNDLES...) {
+ SET_APPEND(_MOBILE_TEST_APK_AAR_BUNDLES_VALUE $BUNDLES)
+ BUNDLE_EXTRA_INPUTS($BUNDLES)
+}
+
+_MOBILE_TEST_APK_TEMPLATE_DIR=
+### @usage: MOBILE_TEST_APK_TEMPLATE(dir filenames...) # internal
+macro MOBILE_TEST_APK_TEMPLATE(TEMPLATE_DIR, INPUTS...) {
+ SET(_MOBILE_TEST_APK_TEMPLATE_DIR $TEMPLATE_DIR)
+ BUNDLE_EXTRA_INPUTS(${pre=$TEMPLATE_DIR/:INPUTS})
+}
+
+_MOBILE_TEST_APK_CMDLINE=\
+$FS_TOOLS md $BIN_TMP_DIR \
+&& $FS_TOOLS md $BINDIR/.android \
+&& $COPY_CMD $GRADLE_DEBUG_STORE_RESOURCE_GLOBAL/debug.keystore $BINDIR/.android/debug.keystore \
+&& $FS_TOOLS md $BINDIR/jni_libs/$ARCH_NAME \
+&& $YMAKE_PYTHON ${input:"build/scripts/extract_asrc.py"} --output $BIN_TMP_DIR --input ${suf=.asrc:PEERS} \
+&& $MOVE_FILE $OUTPUT $BINDIR/jni_libs/$ARCH_NAME/${pre=lib;suf=.so:_MOBILE_TEST_APK_LIBRARY_NAME} \
+&& $FS_TOOLS md $BIN_AAR_DIR \
+&& $YMAKE_PYTHON ${input:"build/scripts/gen_aar_gradle_script.py"} \
+${input;hide:EXTRA_INPUTS} \
+--aidl-dirs $BIN_TMP_DIR/aidl \
+--assets-dirs $BIN_TMP_DIR/assets \
+--java-dirs $BIN_TMP_DIR/src \
+--jni-libs-dirs $BINDIR/jni_libs \
+--res-dirs $BIN_TMP_DIR/res \
+--manifest ${input:_MOBILE_TEST_APK_AAR_MANIFEST_VALUE} \
+--proguard-rules ${input:_MOBILE_TEST_APK_AAR_PROGUARD_RULES_VALUE} ${input:_PROGUARD_RULES_GLOBAL} \
+--aars $_MOBILE_TEST_APK_AAR_AARS_VALUE $_AARS_GLOBAL \
+--bundles $_MOBILE_TEST_APK_AAR_BUNDLES_VALUE \
+--output-dir $BIN_AAR_DIR \
+--bundle-name unittest \
+--maven-repos ${MAPSMOBI_MAVEN_REPO_RESOURCE_GLOBAL} \
+&& ${cwd:BIN_AAR_DIR} ${GRADLE_RESOURCE_GLOBAL}/bin/gradle $_GRADLE_FLAGS_VALUE --no-daemon --offline -g $BIN_GRADLE_USER_HOME_DIR assemble${_BUNDLE_BUILD_TYPE} ${env:"ANDROID_HOME=$ANDROID_SDK_RESOURCE_GLOBAL/android_sdk"} ${env:"JAVA_HOME=$JDK_RESOURCE"} ${env:"ANDROID_SDK_HOME=$BINDIR"} \
+&& $FS_TOOLS md $BIN_APK_DIR \
+&& $FS_TOOLS md $BIN_APK_DIR/res \
+&& $COPY_CMD $_MOBILE_TEST_APK_TEMPLATE_DIR/Manifest.xml $BIN_APK_DIR/Manifest.xml \
+&& $YMAKE_PYTHON ${input:"build/scripts/gen_test_apk_gradle_script.py"} \
+${input;hide:EXTRA_INPUTS} \
+--app-id $REALPRJNAME \
+--assets-dirs $_MOBILE_TEST_APK_ASSETS_DIRS_VALUE \
+--java-dirs $_MOBILE_TEST_APK_TEMPLATE_DIR/java \
+--jni-libs-dirs \
+--res-dirs $BIN_APK_DIR/res $_MOBILE_TEST_APK_TEMPLATE_DIR/res $BIN_TMP_DIR/res \
+--manifest Manifest.xml \
+--aars \
+--output-dir $BIN_APK_DIR \
+--bundle-name $REALPRJNAME \
+--bundles $BIN_AAR_DIR/build/outputs/aar/unittest-${tolower:_BUNDLE_BUILD_TYPE}.aar $_MOBILE_TEST_APK_AAR_BUNDLES_VALUE \
+--library-name $_MOBILE_TEST_APK_LIBRARY_NAME \
+--maven-repos ${MAPSMOBI_MAVEN_REPO_RESOURCE_GLOBAL} \
+&& ${cwd:BIN_APK_DIR} ${GRADLE_RESOURCE_GLOBAL}/bin/gradle $_GRADLE_FLAGS_VALUE --no-daemon --offline -g $BIN_GRADLE_USER_HOME_DIR assembleDebug ${env:"ANDROID_HOME=$ANDROID_SDK_RESOURCE_GLOBAL/android_sdk"} ${env:"JAVA_HOME=$JDK_RESOURCE"} ${env:"ANDROID_SDK_HOME=$BINDIR"} \
+&& $COPY_CMD $BIN_APK_DIR/build/outputs/apk/${tolower:_BUNDLE_BUILD_TYPE}/$REALPRJNAME.apk ${OUTPUT}
+
+_MOBILE_TEST_APK_EXTRA_INPUTS_VALUE=
+
+macro _MOBILE_TEST_APK_CMD_IMPL(OUTPUT, EXTRA_INPUTS...) {
+ .CMD=$_MOBILE_TEST_APK_CMDLINE
+}
+
+_MOBILE_TEST_APK_CMD=$_MOBILE_TEST_APK_CMD_IMPL($TARGET $_BUNDLE_EXTRA_INPUTS_VALUE)
+
+LINK_MOBILE_TEST_APK=$LINK_DYN_LIB && $_MOBILE_TEST_APK_CMD
+
+### @usage: MOBILE_TEST_APK() # internal
+module MOBILE_TEST_APK: DLL {
+ .CMD=LINK_MOBILE_TEST_APK
+ .GLOBAL=_AARS _PROGUARD_RULES
+
+ PEERDIR(build/external_resources/android_sdk)
+ PEERDIR(build/external_resources/gradle)
+ PEERDIR(build/platform/java/jdk)
+ PEERDIR($JDK_RESOURCE_PEERDIR)
+
+ SET(MODULE_PREFIX)
+ SET(MODULE_SUFFIX .apk)
+
+ SET(BIN_AAR_DIR $BINDIR/aar)
+ SET(BIN_APK_DIR $BINDIR/apk)
+ SET(BIN_TMP_DIR $BINDIR/tmp)
+ SET(BIN_GRADLE_USER_HOME_DIR $BINDIR/gradle)
+
+ SET(_MOBILE_TEST_APK_LIBRARY_NAME unittests)
+
+ when ($OS_ANDROID == "yes") {
+ when ($ARCH_ARM7 == "yes") {
+ ARCH_NAME=armeabi-v7a
+ }
+ elsewhen ($ARCH_ARM64 == "yes") {
+ ARCH_NAME=arm64-v8a
+ }
+ elsewhen ($ARCH_I386 == "yes") {
+ ARCH_NAME=x86
+ }
+ elsewhen ($ARCH_X86_64 == "yes") {
+ ARCH_NAME=x86_64
+ }
+ otherwise {
+ ARCH_NAME=unsupported
+ }
+ }
+}
+
+
+### @usage: MOBILE_BOOST_TEST_APK() # internal
+module MOBILE_BOOST_TEST_APK: MOBILE_TEST_APK {
+ PEERDIR(devtools/dummy_arcadia/test/test_apk/template)
+ PEERDIR(build/external_resources/mapsmobi_maven_repo)
+ ADD_YTEST($MODULE_PREFIX$REALPRJNAME boost.test)
+
+ MOBILE_TEST_APK_TEMPLATE(${ARCADIA_ROOT}/devtools/dummy_arcadia/test/test_apk/template Manifest.xml java/com/yandex/test/unittests/RunTestsActivity.java java/com/yandex/test/unittests/CrashHandler.java res/values/strings.xml)
+}
+
+when ($BT_RELEASE) {
+ _BUNDLE_BUILD_TYPE=Release
+}
+otherwise {
+ _BUNDLE_BUILD_TYPE=Debug
+}
+
+_AAR_EXTRA_INPUTS_VALUE=
+
+_AAR_MANIFEST_VALUE=
+### @usage: AAR_MANIFEST(filename) # internal
+macro AAR_MANIFEST(FILE) {
+ SET(_AAR_MANIFEST_VALUE $FILE)
+}
+
+_AAR_PROGUARD_RULES_VALUE=
+### @usage: AAR_PROGUARD_RULES(filename) # internal
+macro AAR_PROGUARD_RULES(FILE) {
+ SET(_AAR_PROGUARD_RULES_VALUE $FILE)
+}
+
+_AAR_AARS_VALUE=
+### @usage: AAR_AARS(aars...) # internal
+macro AAR_AARS(Aars...) {
+ SET_APPEND(_AAR_AARS_VALUE $Aars)
+}
+
+_AAR_COMPILE_ONLY_AARS_VALUE=
+### @usage: AAR_COMPILE_ONLY_AARS(compile_only_aars...) # internal
+macro AAR_COMPILE_ONLY_AARS(Aars...) {
+ SET_APPEND(_AAR_COMPILE_ONLY_AARS_VALUE $Aars)
+}
+
+
+_AAR_AIDL_DIRS_VALUE=
+### @usage: AAR_AIDL_SRCS(dir filenames...) # internal
+macro AAR_AIDL_SRCS(PREFIX, ABSOLUTE[], FILES...) {
+ SET_APPEND(_AAR_AIDL_DIRS_VALUE $PREFIX)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE ${pre=$PREFIX/:FILES} ${ABSOLUTE})
+}
+
+_AAR_ASSETS_DIRS_VALUE=
+### @usage: AAR_ASSETS_SRCS(dir filenames...) # internal
+macro AAR_ASSETS_SRCS(PREFIX, ABSOLUTE[], FILES...) {
+ SET_APPEND(_AAR_ASSETS_DIRS_VALUE $PREFIX)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE ${pre=$PREFIX/:FILES} ${ABSOLUTE})
+}
+
+_AAR_BUNDLES_VALUE=
+### @usage: AAR_BUNDLES(filenames...) # internal
+macro AAR_BUNDLES(BUNDLES...) {
+ SET_APPEND(_AAR_BUNDLES_VALUE $BUNDLES)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE $BUNDLES)
+}
+
+_AAR_JNI_LIB_DIRS_VALUE=
+### @usage: AAR_JNI_LIBS(dir filenames...) # internal
+macro AAR_JNI_LIBS(PREFIX, ABSOLUTE[], FILES...) {
+ SET_APPEND(_AAR_JNI_LIB_DIRS_VALUE $PREFIX)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE ${pre=$PREFIX/:FILES} ${ABSOLUTE})
+}
+
+_AAR_JAVA_DIRS_VALUE=
+### @usage: AAR_JAVA_SRCS(dir filenames...) # internal
+macro AAR_JAVA_SRCS(PREFIX, ABSOLUTE[], FILES...) {
+ SET_APPEND(_AAR_JAVA_DIRS_VALUE $PREFIX)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE ${pre=$PREFIX/:FILES} ${ABSOLUTE})
+}
+
+_AAR_RES_DIRS_VALUE=
+### @usage: AAR_RES_SRCS(dir filenames...) # internal
+macro AAR_RES_SRCS(PREFIX, ABSOLUTE[], FILES...) {
+ SET_APPEND(_AAR_RES_DIRS_VALUE $PREFIX)
+ SET_APPEND(_AAR_EXTRA_INPUTS_VALUE ${pre=$PREFIX/:FILES} ${ABSOLUTE})
+}
+
+_AAR_LOCAL_MAVEN_REPO_VALUE=
+### @usage: AAR_LOCAL_MAVEN_REPO(repo...)
+macro AAR_LOCAL_MAVEN_REPO(REPO...) {
+ SET_APPEND(_AAR_LOCAL_MAVEN_REPO_VALUE $REPO)
+}
+
+_AAR_GRADLE_SCRIPT_GENERATOR_VALUE=
+### @usage: AAR_GRADLE_SCRIPT_GENERATOR(python_script)
+macro AAR_GRADLE_SCRIPT_GENERATOR(GENERATOR) {
+ SET(_AAR_GRADLE_SCRIPT_GENERATOR_VALUE $GENERATOR)
+}
+
+when ($AAR_NO_STRIP) {
+ _AAR_NO_STRIP_VALUE=--do-not-strip
+}
+otherwise {
+ _AAR_NO_STRIP_VALUE=
+}
+
+_AAR_CMDLINE=\
+$FS_TOOLS md $BIN_TMP_DIR \
+&& $FS_TOOLS md $BINDIR/.android \
+&& $COPY_CMD $GRADLE_DEBUG_STORE_RESOURCE_GLOBAL/debug.keystore $BINDIR/.android/debug.keystore \
+&& $YMAKE_PYTHON ${input:"build/scripts/extract_asrc.py"} --output $BIN_TMP_DIR --input ${suf=.asrc:PEERS} \
+&& $YMAKE_PYTHON ${input:_AAR_GRADLE_SCRIPT_GENERATOR_VALUE} \
+${input;hide:EXTRA_INPUTS} \
+--aidl-dirs $_AAR_AIDL_DIRS_VALUE $BIN_TMP_DIR/aidl \
+--assets-dirs $_AAR_ASSETS_DIRS_VALUE $BIN_TMP_DIR/assets \
+--java-dirs $_AAR_JAVA_DIRS_VALUE $BIN_TMP_DIR/src \
+--jni-libs-dirs $_AAR_JNI_LIB_DIRS_VALUE $BIN_TMP_DIR/jni_libs \
+--res-dirs $_AAR_RES_DIRS_VALUE $BIN_TMP_DIR/res \
+--manifest ${input:_AAR_MANIFEST_VALUE} \
+--proguard-rules ${input:_AAR_PROGUARD_RULES_VALUE} ${input:_PROGUARD_RULES_GLOBAL} \
+--aars $_AAR_AARS_VALUE $_AARS_GLOBAL \
+--compile-only-aars $_AAR_COMPILE_ONLY_AARS_VALUE \
+--bundles $_AAR_BUNDLES_VALUE \
+--output-dir $BINDIR \
+--bundle-name $REALPRJNAME \
+--peers $PEERS \
+--maven-repos $_AAR_LOCAL_MAVEN_REPO_VALUE \
+$_AAR_NO_STRIP_VALUE \
+&& ${cwd:BINDIR} ${GRADLE_RESOURCE_GLOBAL}/bin/gradle $_GRADLE_FLAGS_VALUE --no-daemon --offline -g $BIN_GRADLE_USER_HOME_DIR bundle${_BUNDLE_BUILD_TYPE}Aar ${env:"ANDROID_HOME=$ANDROID_SDK_RESOURCE_GLOBAL/android_sdk"} ${env:"JAVA_HOME=$JDK_RESOURCE"} ${env:"ANDROID_SDK_HOME=$BINDIR"} $VCS_INFO_DISABLE_CACHE__NO_UID__ \
+&& ${cwd:BINDIR} $COPY_CMD build/outputs/aar/${REALPRJNAME}-${tolower:_BUNDLE_BUILD_TYPE}.aar $TARGET \
+&& ${cwd:BINDIR} $COPY_CMD build/${suf=-pom.xml:REALPRJNAME} ${output;suf=-pom.xml:REALPRJNAME} \
+&& ${cwd:BINDIR} $COPY_CMD build/libs/${suf=-sources.jar:REALPRJNAME} ${output;suf=-sources.jar:REALPRJNAME}
+
+macro _AAR_CMD_IMPL(EXTRA_INPUTS...) {
+ .CMD=$_AAR_CMDLINE && $GENERATE_MF
+}
+
+AAR_CMD=$_AAR_CMD_IMPL($_AAR_EXTRA_INPUTS_VALUE)
+
+### @usage: AAR() # internal
+module AAR: _BASE_UNIT {
+ .CMD=AAR_CMD
+ .GLOBAL=_AARS _PROGUARD_RULES
+ .PEERDIR_POLICY=as_build_from
+ .FINAL_TARGET=yes
+
+ SET(MODULE_PREFIX)
+ SET(MODULE_SUFFIX .aar)
+ SET(DONT_RESOLVE_INCLUDES yes)
+ SET(NEED_PLATFORM_PEERDIRS no)
+ NO_PLATFORM()
+
+ PEERDIR(build/external_resources/android_sdk)
+ PEERDIR(build/external_resources/gradle)
+ PEERDIR(build/platform/java/jdk)
+ PEERDIR($JDK_RESOURCE_PEERDIR)
+
+ SET(BIN_TMP_DIR $BINDIR/tmp)
+ SET(BIN_GRADLE_USER_HOME_DIR $BINDIR/gradle)
+}
+
+_SECONDARY_OUTPUT_VALUE=
+
+### @usage: SECONDARY_OUTPUT(filename) # internal
+###
+### The use of this macro is strictly prohibited!!!
+macro SECONDARY_OUTPUT(OUTPUT) {
+ SET(_SECONDARY_OUTPUT_VALUE $OUTPUT)
+}
+
+_AAR_PROXY_LIBRARY_CMD=$LINK_LIB && $COPY_CMD $_SECONDARY_OUTPUT_VALUE ${input;hide:_SECONDARY_OUTPUT_VALUE} ${output:REALPRJNAME.aar}
+
+### @usage: AAR_PROXY_LIBRARY() # internal
+###
+### The use of this module is strictly prohibited!!!
+module AAR_PROXY_LIBRARY: _PROXY_LIBRARY {
+ .ALLOWED=SECONDARY_OUTPUT
+ .CMD=_AAR_PROXY_LIBRARY_CMD
+}