X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=meta-app-framework%2Fclasses%2Faglwgt.bbclass;h=faa17e3a813a48b05f577864db8d22603b81b890;hb=refs%2Fchanges%2F65%2F24465%2F5;hp=ab3416a0d95a3992e51fcaab18256c622ea73c84;hpb=51eb7a5b152e80e4ad09419e52e4d7b924365c92;p=AGL%2Fmeta-agl.git diff --git a/meta-app-framework/classes/aglwgt.bbclass b/meta-app-framework/classes/aglwgt.bbclass index ab3416a0d..faa17e3a8 100644 --- a/meta-app-framework/classes/aglwgt.bbclass +++ b/meta-app-framework/classes/aglwgt.bbclass @@ -8,7 +8,6 @@ # The makefile needs to use wgtpkg-pack. # - # 'wgtpkg-pack' in af-main-native is required. DEPENDS_append = " af-main-native" @@ -21,66 +20,114 @@ DEPENDS_append = " cmake-apps-module-native" # for hal bindings genskel is required. DEPENDS_append = " af-binder-devtools-native" -EXTRA_OECMAKE_append_agl-ptest = " -DBUILD_TEST_WGT=TRUE" +# Set the default build type for cmake based projects +# NOTE: This can be removed after switching to using the autobuild +# script to do compilation +EXTRA_OECMAKE_append = " -DCMAKE_BUILD_TYPE=RELEASE" + +# FIXME: Remove once CMake+ninja issues are resolved +OECMAKE_GENERATOR = "Unix Makefiles" + +AGLWGT_EXTRA_BUILD_ARGS = "VERBOSE=TRUE ${PARALLEL_MAKE}" + +# Only widgets with recipe names starting with agl-service- are +# assumed to have tests by default, set this to "true" to force +# building/packaging of the test widget for other widgets. +AGLWGT_HAVE_TESTS = "false" + +# Warning on missing test/debug/coverage packages disabled by default +# for now to reduce build output clutter. +AGLWGT_PACKAGE_WARN = "false" + +# There are some widgets with build issues wrt test/debug/coverage +# that are currently non-fatal but do not yield a widget, allow empty +# test and coverage packages for now to allow the build to proceed. +# This matches the default behavior for -dbg packages. +# +# NOTE: This should revisited after a round of autobuild script rework +# to address SPEC-3300. +ALLOW_EMPTY_${PN}-coverage = "1" +ALLOW_EMPTY_${PN}-test = "1" + do_aglwgt_package() { - cd ${B} - ${S}/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B} VERBOSE=TRUE || \ - ( ${S}/conf.d/autobuild/agl/autobuild package BUILD_DIR=${B} DEST=${B}/package VERBOSE=TRUE && \ - ( bbwarn "OBSOLETE: Your autobuild script should be located in :" ; \ - bbwarn "autobuild/agl/ from the project root source folder"; \ - bbwarn "and generate a .wgt file using wgtpack in the build"; \ - bbwarn "root folder calling:" ; \ - bbwarn "./autobuild/agl/autobuild package DEST=" ; \ - bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes" \ - ) - ) || - ( bbwarn "OBSOLETE: You must have an autobuild script located in:" ; \ - bbwarn "autobuild/agl/ from the project root source folder"; \ - bbwarn "with filename autobuild which should generate"; \ - bbwarn "a .wgt file using wgtpack in the build"; \ - bbwarn "root folder calling:" ; \ - bbwarn "./autobuild/agl/autobuild package DEST=" ; \ - bbwarn "Fix your package as it will not work within the SDK" ; \ - bbwarn "See: https://wiki.automotivelinux.org/troubleshooting/app-recipes"; \ - make package) + bldcmd=${S}/autobuild/agl/autobuild + if [ ! -x "$bldcmd" ]; then + bbfatal "Missing autobuild/agl/autobuild script" + fi + + cd ${B} + if ! $bldcmd package BUILD_DIR=${B} DEST=${B}/build-release ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package failed" + fi + + if echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then + mkdir -p ${S}/build-test + cd ${S}/build-test + if ! $bldcmd package-test BUILD_DIR=${S}/build-test DEST=${B}/build-test ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-test failed" + fi + fi + + mkdir -p ${S}/build-debug + cd ${S}/build-debug + if ! $bldcmd package-debug BUILD_DIR=${S}/build-debug DEST=${B}/build-debug ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-debug failed" + fi + + mkdir -p ${S}/build-coverage + cd ${S}/build-coverage + if ! $bldcmd package-coverage BUILD_DIR=${S}/build-coverage DEST=${B}/build-coverage ${AGLWGT_EXTRA_BUILD_ARGS}; then + bbwarn "Target: package-coverage failed" + fi } python () { d.setVarFlag('do_aglwgt_deploy', 'fakeroot', '1') } - POST_INSTALL_LEVEL ?= "10" POST_INSTALL_SCRIPT ?= "${POST_INSTALL_LEVEL}-${PN}.sh" EXTRA_WGT_POSTINSTALL ?= "" do_aglwgt_deploy() { - TEST_WGT="*-test.wgt" - if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ] - then - install -d ${D}/usr/AGL/apps/manualinstall - install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/manualinstall || \ - install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/manualinstall + DEST=release + if [ "${AGLWGT_AUTOINSTALL_${PN}}" = "0" ]; then + DEST=manualinstall + fi + + if [ "$(find ${B}/build-release -name '*.wgt')" ]; then + install -d ${D}/usr/AGL/apps/$DEST + install -m 0644 ${B}/build-release/*.wgt ${D}/usr/AGL/apps/$DEST/ else - install -d ${D}/usr/AGL/apps/autoinstall - install -m 0644 ${B}/*.wgt ${D}/usr/AGL/apps/autoinstall || \ - install -m 0644 ${B}/package/*.wgt ${D}/usr/AGL/apps/autoinstall - - if [ "$(find ${D}/usr/AGL/apps/autoinstall -name ${TEST_WGT})" ] - then - install -d ${D}/usr/AGL/apps/testwgt - mv ${D}/usr/AGL/apps/autoinstall/*-test.wgt ${D}/usr/AGL/apps/testwgt - fi + bberror "no package found in widget directory" fi - APP_FILES="" - for file in ${D}/usr/AGL/apps/autoinstall/*.wgt;do - APP_FILES="${APP_FILES} $(basename $file)"; + for t in test debug coverage; do + if [ "$(find ${B}/build-${t} -name *-${t}.wgt)" ]; then + install -d ${D}/usr/AGL/apps/${t} + install -m 0644 ${B}/build-${t}/*-${t}.wgt ${D}/usr/AGL/apps/${t}/ + elif [ "${AGLWGT_PACKAGE_WARN}" = "true" ]; then + if [ "$t" != "test" ]; then + bbwarn "no package found in ${t} widget directory" + elif echo ${BPN} | grep -q '^agl-service-' || [ "${AGLWGT_HAVE_TESTS}" = "true" ]; then + bbwarn "no package found in ${t} widget directory" + fi + fi done - install -d ${D}/${sysconfdir}/agl-postinsts - cat > ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} < ${D}/${sysconfdir}/agl-postinsts/${POST_INSTALL_SCRIPT} <