Return-Path: X-Original-To: apmail-celix-dev-archive@www.apache.org Delivered-To: apmail-celix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BDB49199D0 for ; Thu, 21 Apr 2016 19:49:56 +0000 (UTC) Received: (qmail 48729 invoked by uid 500); 21 Apr 2016 19:49:56 -0000 Delivered-To: apmail-celix-dev-archive@celix.apache.org Received: (qmail 48694 invoked by uid 500); 21 Apr 2016 19:49:56 -0000 Mailing-List: contact dev-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list dev@celix.apache.org Received: (qmail 48677 invoked by uid 99); 21 Apr 2016 19:49:56 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Apr 2016 19:49:56 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id D27DFC2C58 for ; Thu, 21 Apr 2016 19:49:55 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.262 X-Spam-Level: X-Spam-Status: No, score=0.262 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_SOFTFAIL=0.972, T_FILL_THIS_FORM_SHORT=0.01] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=mibesis-si.20150623.gappssmtp.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id CUupnyWEcOO9 for ; Thu, 21 Apr 2016 19:49:53 +0000 (UTC) Received: from mail-lf0-f48.google.com (mail-lf0-f48.google.com [209.85.215.48]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id D646B5F239 for ; Thu, 21 Apr 2016 19:49:52 +0000 (UTC) Received: by mail-lf0-f48.google.com with SMTP id c126so67225794lfb.2 for ; Thu, 21 Apr 2016 12:49:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mibesis-si.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-transfer-encoding; bh=+KWEHksX3UU6xai78XRKmewF7jpUg95nGj9uVfmbQ2o=; b=DMGA9wABFsQglCMDXzJ/cTFdzOwW+kySB9kuuAvxwACuRDIz5cKIO9aWpypryjvXmb oOvEWHRRufacT9z9AT01wWNb9awQLG88Cu3P06vPLvovgxF/m7AQ/b3Pf2y6xhwacUgz uoSEgQCW0KS55Dv71ge0Mjza/Zd6+R1mEMU9uOJZF+0MlMpoSGc/JJ81q2OlhNoOfy6x Is4zGelPJyD+KbrbJyOpnXL3PJOymutGDDtTLr8wnsRbbkOn+CglvqqHz4rQP9jSnHML NY+ll1QopWe3cHofRgCHA8bcTQwwdl1PcbEpwsvwuecOLhZ/T1dRaubjUCWGXORJOEiC nmwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-transfer-encoding; bh=+KWEHksX3UU6xai78XRKmewF7jpUg95nGj9uVfmbQ2o=; b=GloSNz1FaVAGT21cb7ic1HNKEw2mori2F+4QQtIjVL3WP4dApJgbggyFoAq0wAyur0 SFRRUr083MPT2ONoHQzX+RipwwiF/wuA5J6IN9VPrqAOGj2h2V+/dgJ7OIqR/84Sf+l9 ypJAmLqdmdruZ1wudP17QUG/4luxxRf9/WpirT3DPs160WaRyYTu55/De+e3DtaoLBGg 0lvXiU86mBbhg72O8UPmHntn36RBkj8oh6cp/saqvHeQyXTYkcXEaqXi0vjkCtAMJ5pU lj5plx4j6DLnTUhwOYOsQ24WyEx8bXUTLC2YjvazRz948vUasyylKg2yAaZjVucOchlO 1RLg== X-Gm-Message-State: AOPr4FVWbyd8lSlWWQg2h7pr79ZrESjxDqsqX4+znom/usBajoxT/DkvjLnOtX/c98BaZCFKmhQkwBfCG7F/EA== X-Received: by 10.25.65.212 with SMTP id o203mr7054334lfa.145.1461268185726; Thu, 21 Apr 2016 12:49:45 -0700 (PDT) MIME-Version: 1.0 Received: by 10.114.97.194 with HTTP; Thu, 21 Apr 2016 12:49:26 -0700 (PDT) In-Reply-To: References: From: =?UTF-8?Q?Miroslav_Berani=C4=8D?= Date: Thu, 21 Apr 2016 21:49:26 +0200 Message-ID: Subject: Re: Updated CMake bundle and deploy commands To: dev@celix.apache.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Pepijn, I've updated GIT repository. This was quick. $ sh ./run.sh -> entry .cache/bundle4/version0.0/root Mongoose started on: 8081 Launcher: Framework Started ^C INFO: FRAMEWORK: Start shutdownthread INFO: FRAMEWORK: Shutdown Mongoose stopped INFO: FRAMEWORK: Successful shutdown Launcher: Exit $ Looks like it works. So thank you very much. I thought bundle_files are only for the per-file addition of resources to the bundle. Need to check it out further. Well, I used IMPORT_LIBRARIES until now -- so this was not used/picked up by CELIX? Hmmm. OK, I have like this (this is current setup, working with CELIX 1.x -- do not know the exact version number). Bundle 1: BUNDLE_LIBRARY(my_lib_1 SOURCES private/src/source.c LINK_LIBRARIES celix_framework ) BUNDLE_PRIVATE_LIBRARY(private SOURCES private/src/activator.c LINK_LIBRARIES celix_framework my_lib_1 ) BUNDLE( ACTIVATOR "${BUNDLE_SYMBOLICNAME}-private" PRIVATE_LIBRARIES "private" EXPORT_LIBRARIES my_lib_1 ) I use this in other bundles: BUNDLE(my_bundle_1 SOURCES private/src/activator IMPORT_LIBRARIES "my_lib_1" ) Well, do not ask me how I picked up this flow, as I forgot. I picked up from existing (at that time) examples, samples and CELIX source tree. Do you suggest better flow/arrangement of the bundles/libraries? One thing that I would like to achieve is: a.) Make my own sources compiled to a library available to other bundles on the same CELIX deployment. b.) Make 3rd party libraries deployed on CELIX and available to other bundles deployed on the same CELIX deployment I thought this solves my issue, do you suggest another approach? Well, I'm still working on "my" HTTP CELIX Service. I do not want to make it public, as I have to work on the API and developer examples and documentation. What I can say is --- CELIX is my top favorite project to work with. It brought back the love for the C language. I know you do not agree/approve C++, I will have to use it - as I am using Boost Spirit for a text parser. It is the only C/C++ project that I know to work with. I also wrote small CSP - C server pages parser, to be able to write "JSP like" pages and do like <%=3D "Hello world" %> ( and much more :D ), compile it to C (at the CMake run) and deploy it to CELIX bundle and be deployed and served on /hello URL. BUT: it is long way to have it memory leak free and developer friendly. Hacking is one effort, public/production project takes another :D . All in all, thank you for the quick response. Now I have another bone to chew on :D . Thank you. Kind Regards, Miroslav 2016-04-21 21:05 GMT+02:00 Pepijn Noltes : > Hi Miroslav, > > On Thu, Apr 21, 2016 at 5:57 PM, Miroslav Berani=C4=8D > wrote: >> Hi Pepijn, >> >> I've just now, yesterday, updated GIT - and took time to checkout new >> version of CELIX. >> Nothing was building nor working :D So that is a good start - a lot of c= hanges. >> >> I think I am more-or-less clear on all the changes done, but some are >> still getting my head knocking against my desk. >> >> As I did not find answer in the current source tree or documentation, >> can be I was sloppy, but. Could you be kind to help me about a bit. >> >> So I had a bundle, that has CMake definition like this: >> >> bundle(${BUNDLE_SYMBOLICNAME} >> SOURCES >> private/src/activator >> DIRECTORIES >> root >> ) >> >> Where did the DIRECTORIES command/directive move to? I saw: add_files, >> but not directories. >> I looked at the mongoose example, but - I am not able to get it >> working, as it looks like it is also missing this root directory in >> the bundle entry set. > > Oops. Good catch, yes the mongoose example did not work anymore. I > just committed the fix on the develop branch. > Please check this out, it uses the bundle_files cmake command to add a > directory to the bundle. > I did notice that for me make clean was needed to trigger a new > creation of the bundle zip. > >> >> I build CELIX and Mongoose example like this: >> >> >> git clone https://github.com/apache/celix.git >> git checkout develop >> >> mkdir build && cd build >> cmake -DBUILD_DEPENDENCY_MANAGER=3DON -DBUILD_DEPLOYMENT_ADMIN=3DON >> -DBUILD_DEVICE_ACCESS=3DON -DBUILD_DEVICE_ACCESS_EXAMPLE=3DON >> -DBUILD_EXAMPLES=3DON -DBUILD_FRAMEWORK=3DON -DBUILD_LAUNCHER=3DON >> -DBUILD_LOG_SERVICE=3DON -DBUILD_LOG_WRITER=3DON >> -DBUILD_LOG_WRITER_SYSLOG=3DON -DBUILD_REMOTE_SERVICE_ADMIN=3DON >> -DBUILD_REMOTE_SHELL=3DON -DBUILD_SHELL=3DON -DBUILD_SHELL_TUI=3DON >> -DCMAKE_BUILD_TYPE=3DDebug -DDOXYFILE_LATEX=3DON >> -DJAR_COMMAND=3D/opt/jdk1.8/bin/jar -DCMAKE_INSTALL_PREFIX=3D/opt/celix/ >> ../celix/ >> >> make all >> >> make deploy >> >> >> cd deploy/mongoose_deploy >> >> $ sh ./run.sh >> -> entry (null) >> Launcher: Framework Started >> INFO: FRAMEWORK: Start shutdownthread >> >> CTRL+C >> >> INFO: FRAMEWORK: Shutdown >> Segmentation fault (core dumped) >> $ >> $ tree .cache/bundle4/ >> .cache/bundle4/ >> =E2=94=9C=E2=94=80=E2=94=80 bundle.id >> =E2=94=9C=E2=94=80=E2=94=80 bundle.lastmodified >> =E2=94=9C=E2=94=80=E2=94=80 bundle.location >> =E2=94=94=E2=94=80=E2=94=80 version0.0 >> =E2=94=9C=E2=94=80=E2=94=80 libmongoose.so.0 >> =E2=94=9C=E2=94=80=E2=94=80 META-INF >> =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 MANIFEST.MF >> =E2=94=94=E2=94=80=E2=94=80 revision.location >> >> 2 directories, 6 files >> >> >> Did I miss something or is this example not correct? It looks like it >> is missing something as the startup fails and there is no response on >> port 8081. >> >> >> Another problem I have, and also failed to find appropriate replacement = is: >> >> BUNDLE(${BUNDLE_SYMBOLICNAME} >> SOURCES >> private/src/activator.c >> IMPORT_LIBRARIES >> "eu.mibesis.httpservice.api.library" >> "eu.mibesis.mvc.api.library" >> ) >> >> With what is the command IMPORT_LIBRARIES replaced? Also for this I >> did not find working replacement. > > The IMPORT_LIBARIES is also part of the updated cmake command. But i > saw there was a typo in the > cmake command document. I also commit a update for this on the develop br= anch. > > That being said, import libraries are not yet supported. > I known we had some experimental changes from that, but in the current > master/develop this is not used. > Note that this is not the result of the revamped cmake commands. > > Do you really import the libraries from different bundles? > Or do want to embed the libraries in your bundles, because for the > latter you the PRIVATE_LIBRARIES options in add_bundle (or > bundles_private_libs cmake command) > > >> >> For other changes it was well documented and working as advertised. >> >> >> I've tried master and develop branch from GitHub GIT repository. >> >> I've also not tried the celix bootstrap project, but it looks really >> interesting. +1 for it. >> >> >> Kind Regards, >> Miroslav >> >> >> 2016-02-04 14:44 GMT+01:00 Pepijn Noltes : >>> Hi All, >>> >>> I have been working on a revamp of the Celix specific CMake commands. T= he >>> main reason to do this was to get rid of the deploy.cmake files. >>> At the moment these files are needed when you want to create a "deploym= ent" >>> of a selection of bundes. >>> One of the problems is that even if you disabled a certain subdirectory= the >>> deploy.cmake in that directory will still be processed. To counter this >>> additional CMake code is needed. >>> >>> To solve this and some other issues I rewrote the Packaging.cmake so th= at >>> to process is more based on CMake target properties [1] and CMake gener= ator >>> expressions [2]. I also took the liberty to split up and rename the >>> commands in a more CMake style (e.g. add_ commands) >>> >>> Differences are >>> - No separate deploy.cmake needed. You can use add_deploy in normal >>> CMakeLists.txt files. Also as result no additional test concerning >>> subprojects are needed. >>> - bundle command has become add_bundle command >>> - deploy command has become add_deploy command >>> - possibility to create multiple bundles in one CMakeLists.txt file. >>> - There are several supporting CMake commands for add_bundle and add_de= ploy >>> - version info of bundle also used for so version information >>> - libcelix_framework, libcelix_utils and libcelix_dfi are now generated >>> with a so version. >>> - Added CMake commands are documented in documents dir, see [3] >>> - Legacy wrapper command for bundle -> add_bundle and deploy-> add_depl= oy >>> exists. Supporting most, but not all old features. >>> - For the Celix project all existing bundle commands and deploy.cmake f= iles >>> are updated to the new commands >>> - If jar or zip command is present on the host system, make install can= be >>> used. If not make install-all (CPack) must be used. CMake will generate= a >>> message for this. >>> - add_deploy supports adding not yet existing bundle targets. Removing = the >>> need for certain add_bundle ordering. >>> - support for Ninja and "make -j" >>> - Moved and updated the "Apache Celix Subprojects", "building Apache Ce= lix" >>> and "Getting Started with Apache Celix" to the documents dir, see [4]. = [5] >>> and [6] >>> >>> If there are no objections I would like to merge this feature into the >>> development branch. >>> The documentation still needs some work and there are probably still so= me >>> bugs. but I would prefer to push this in preparation of a next Celix >>> release. >>> >>> [1] https://cmake.org/cmake/help/v3.4/command/set_target_properties.htm= l >>> [2] >>> https://cmake.org/cmake/help/v3.4/manual/cmake-generator-expressions.7.= html?highlight=3Dgenerator >>> [3] >>> https://github.com/apache/celix/blob/feature/CELIX-335_deploy_refactori= ng/documents/cmake_commands/readme.md >>> [4] >>> https://github.com/apache/celix/tree/feature/CELIX-335_deploy_refactori= ng/documents/subprojects >>> [5] >>> https://github.com/apache/celix/tree/feature/CELIX-335_deploy_refactori= ng/documents/building >>> [6] >>> https://github.com/apache/celix/tree/feature/CELIX-335_deploy_refactori= ng/documents/getting_started >>> >>> >>> Greetings, >>> Pepijn >> >> >> >> -- >> Miroslav Berani=C4=8D >> MIBESIS >> +386(0)40/814-843 >> miroslav.beranic@mibesis.si >> http://www.mibesis.si --=20 Miroslav Berani=C4=8D MIBESIS +386(0)40/814-843 miroslav.beranic@mibesis.si http://www.mibesis.si