Soong convert Android.mk file for shared lib that uses LOCAL_AIDL_INCLUDES

9,260 views
Skip to first unread message

Michael Lekman

unread,
Sep 12, 2017, 12:38:54 PM9/12/17
to Android Building
Hello,

I am trying to convert my Android.mk file to Android.bp.
But it fails when I use aidl_includes. ANdroid.mk was converted using androidmk.


include $(CLEAR_VARS)
LOCAL_MODULE := libmysharedlib
LOCAL_SRC_FILES := \
    file.cpp \
    $(call all-Iaidl-files-under, api)
LOCAL_CPPFLAGS := -std=gnu++11 -Wall
LOCAL_C_INCLUDES += \
     $(LOCAL_PATH) \
     external/rapidjson/include
LOCAL_LDFLAGS := -llog
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
LOCAL_MULTILIB := both
LOCAL_SHARED_LIBRARIES := \
    liblog \
    libbinder \
    libutils \
    libpowermanager \

LOCAL_STATIC_LIBRARIES := libcutils
LOCAL_AIDL_INCLUDES := $(LOCAL_PATH)/api

include $(BUILD_SHARED_LIBRARY)

FAILED: out/soong/build.ninja
out/soong/.bootstrap/bin/soong_build -t -b out/soong -d out/soong/build.ninja.d -o out/soong/build.ninja Android.bp
Clang SA is not enabled
error: vendor/my-shared-lib/Android.bp:38:18: unrecognized property "aidl_includes"
error: vendor/my-shared-lib/Android.bp:74:18: unrecognized property "aidl_includes"
ninja: build stopped: subcommand failed.
13:59:19 soong bootstrap failed with: exit status 1
make: *** [run_soong_ui] Error 1

BR
/Michael

Colin Cross

unread,
Sep 12, 2017, 1:12:16 PM9/12/17
to android-...@googlegroups.com
That's a mistake in the androidmk tool, it should have produced:
aidl: {
    local_include_dirs: ["api"],
}

--
--
You received this message because you are subscribed to the "Android Building" mailing list.
To post to this group, send email to android-building@googlegroups.com
To unsubscribe from this group, send email to
android-building+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Lekman

unread,
Sep 12, 2017, 5:09:15 PM9/12/17
to Android Building
Thanks.

It didn't translate LOCAL_RESOURCE_DIR and LOCAL_MANIFEST_FILE. Are they not supported anymore?
To post to this group, send email to android-...@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-buildi...@googlegroups.com.

Colin Cross

unread,
Sep 12, 2017, 5:38:16 PM9/12/17
to android-...@googlegroups.com
Java support for soong is still a work in progress and not ready for wide use yet.

To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

Michael Lekman

unread,
Sep 15, 2017, 10:15:31 AM9/15/17
to Android Building
follow up question about aidl code generation: I have added this to my Android.bp file

cc_library_shared {
    name: "libtest",
    srcs: [
        "api/corp/proj/IGreatService.aidl",
    ],
    cppflags: [
        "-std=gnu++11",
        "-Wall",
    ],
    include_dirs: ["external/rapidjson/include"],
    local_include_dirs: ["."],
    export_include_dirs: ["."],
    compile_multilib: "both",
    shared_libs: [
        "liblog",
        "libbinder",
        "libutils",
    ],

    static_libs: ["libcutils"],
    aidl: {
        local_include_dirs: ["api"],
    }
}


Unfortunately it doesn't generated the header file from aidl.

vendor/proj/proprietary/system/test/MyState.h:4:10: fatal error: 'corp/proj/IGreatService.h' file not found

BR
/Michael

Michael Lekman

unread,
Sep 16, 2017, 3:54:44 PM9/16/17
to Android Building
I found it. aidl export flag was missing:

    aidl: {
        local_include_dirs: ["api"],
        export_aidl_headers: true,
    }

filzap...@gmail.com

unread,
Sep 18, 2017, 10:25:12 AM9/18/17
to Android Building
How you convert android.mk to android.bp file. I am looking for documentation but haven't find any thing? Can you please write the procedure here?

Regards,

Colin Cross

unread,
Sep 18, 2017, 12:07:08 PM9/18/17
to android-...@googlegroups.com

To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.

Michael Lekman

unread,
Sep 18, 2017, 4:45:51 PM9/18/17
to Android Building
$ androidmk  Android.mk > Android.bp

androidmk must be built first. build/soong/androidmk/Android.bp

Rugnath Ram

unread,
Sep 25, 2017, 11:39:49 AM9/25/17
to Android Building
Thanks michael,
build/soong$ androidmk Android.mk > Android.bp
androidmk: command not found
 
Please help me how to built androidmk? thanks in advance. 

Colin Cross

unread,
Sep 25, 2017, 2:07:20 PM9/25/17
to android-...@googlegroups.com
m blueprint_tools

To post to this group, send email to android-building@googlegroups.com

To unsubscribe from this group, send email to

For more options, visit this group at
http://groups.google.com/group/android-building?hl=en

---
You received this message because you are subscribed to the Google Groups "Android Building" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-building+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages