Return-Path: X-Original-To: apmail-felix-users-archive@minotaur.apache.org Delivered-To: apmail-felix-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id F1B4D11C75 for ; Wed, 11 Jun 2014 14:02:24 +0000 (UTC) Received: (qmail 8742 invoked by uid 500); 11 Jun 2014 14:02:24 -0000 Delivered-To: apmail-felix-users-archive@felix.apache.org Received: (qmail 8687 invoked by uid 500); 11 Jun 2014 14:02:24 -0000 Mailing-List: contact users-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@felix.apache.org Delivered-To: mailing list users@felix.apache.org Received: (qmail 8677 invoked by uid 99); 11 Jun 2014 14:02:24 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2014 14:02:24 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of nbaker@pentaho.com designates 98.129.35.7 as permitted sender) Received: from [98.129.35.7] (HELO server505.appriver.com) (98.129.35.7) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jun 2014 14:02:21 +0000 X-Note-AR-ScanTimeLocal: 6/11/2014 9:01:55 AM X-Policy: GLOBAL - pentaho.com X-Policy: GLOBAL - pentaho.com X-Primary: nbaker@pentaho.com X-Note: This Email was scanned by AppRiver SecureTide X-Virus-Scan: V- X-Note-SnifferID: 0 X-Note: TCH-CT/SI:0-182/SG:2 6/11/2014 9:01:07 AM X-GBUdb-Analysis: 0, 98.129.35.1, Ugly c=1 p=-0.938045 Source White X-Signature-Violations: 0-0-0-7500-c X-Note-419: 15.6004 ms. Fail:0 Chk:1340 of 1340 total X-Note: SCH-CT/SI:0-1340/SG:1 6/11/2014 9:01:49 AM X-Note: Spam Tests Failed: X-Country-Path: UNKNOWN->UNITED STATES->UNITED STATES X-Note-Sending-IP: 98.129.35.1 X-Note-Reverse-DNS: X-Note-Return-Path: nbaker@pentaho.com X-Note: User Rule Hits: X-Note: Global Rule Hits: G330 G331 G332 G333 G337 G338 G448 X-Note: Encrypt Rule Hits: X-Note: Mail Class: VALID X-Note: Headers Injected Received: from [98.129.35.1] (HELO smtp.exg5.exghost.com) by server505.appriver.com (CommuniGate Pro SMTP 6.0.2) with ESMTPS id 391167665; Wed, 11 Jun 2014 09:01:54 -0500 Received: from MBX15.exg5.exghost.com ([169.254.1.50]) by HT09-e5.exg5.exghost.com ([98.129.23.242]) with mapi; Wed, 11 Jun 2014 09:01:53 -0500 From: Nick Baker To: "users@felix.apache.org" CC: Guillaume Nodet Date: Wed, 11 Jun 2014 09:01:50 -0500 Subject: Re: Constructing and matching version ranges in code with OSGi Thread-Topic: Constructing and matching version ranges in code with OSGi Thread-Index: Ac+FfbIbXsb5Oua+QL280mXCAvm/dg== Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.4.1.140326 acceptlanguage: en-US Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org On a possibly related note. We (Pentaho) have a framework similar to the WebJars project which we plan on migrating to OSGI. We create javascript/css jars with embedded RequireJS module definitions. One of the biggest challenges will be marrying AMD versioned module dependencies with OSGI versioning. If there=B9s interest I=B9ll send an update to the mailing list once we get there. -Nick Baker On 6/11/14, 9:46 AM, "Christopher BROWN" wrote: >Thanks for the quick replies. I'm not yet using V5, so copying >VersionRange from V5 seems like the simplest option (looking to moving >later to V5). Had a look at the code, and it's what is needed. > >Thanks, >Christopher > > >On 11 June 2014 15:40, Neil Bartlett wrote: > >> I would say that the VersionRange class from OSGi R5 Core is exactly the >> right tool for the job. If you need to use a version of OSGi older than >>R5 >> =8B bearing in mind that Felix, Equinox and Knopflerfish all comply with >>at >> least R5 =8B then you can copy the source of that class to your own >>project. >> >> Regards, >> Neil >> >> >> On 11 June 2014 at 14:29:02, Guillaume Nodet (gnodet@apache.org) wrote: >> >> Felix utils has a few classes that you can use. >> >> >>=20 >>https://github.com/apache/felix/tree/trunk/utils/src/main/java/org/apache >>/felix/utils/version >> Though with osgi r5, there is a new VersionRange class. >> So depending on which osgi minimal version you target, pick the one you >> need. >> >> >> 2014-06-11 15:11 GMT+02:00 Christopher BROWN : >> >> > Hello, >> > >> > Regarding version ranges, such as [1.0.0,2.0.0), is there any way to >> > construct an object representation of that range in code with Felix / >> OSGi >> > in general, and then test if a given Version object matches? Something >> > along the lines of FrameworkUtil.createFilter(string)... >> > >> > This is all done automatically for package dependencies, but I'm >>looking >> > for a solution in a different area. >> > >> > The OSGi-based product I'm working on uses OSGi for packing code, >>that's >> > fine. However, the user interface associated is packaged up in ZIP >>files >> > that the application loads, containing templates, CSS, and JavaScript. >> The >> > JavaScript files in particular can have dependencies on specific >>versions >> > of specific libraries, such as jQuery 1.9.x or 2.x+, Underscore, >> Backbone, >> > to name but a few. The non-technical suppliers of these ZIP files >>aren't >> > skilled in defining OSGi manifests to express these dependencies but >>they >> > can choose to pick a library and a version from a list. These >>JavaScript >> > libraries are made available as URLs that are injected into the >>templates >> > based on these declared dependencies. >> > >> > So I'd like to be able to reuse this logic at an application level, >> instead >> > of reimplementing it (for the principle, even if it's not a huge >> > challenge). >> > >> > Is there any such solution available with Felix? >> > >> > Thanks, >> > Christopher >> > >> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@felix.apache.org For additional commands, e-mail: users-help@felix.apache.org