summaryrefslogtreecommitdiffstats
path: root/compatibility-client-compiled
diff options
context:
space:
mode:
authorMirjan Merruko <mirjan@vaadin.com>2017-03-24 13:33:37 +0200
committerHenri Sara <henri.sara@gmail.com>2017-04-25 15:01:06 +0300
commit9a6ebeb5a80bdb1d97d47422c62a973b3f2d2cf9 (patch)
tree20b1c09d6c2e6319cba036f9ecf409893c4b6c56 /compatibility-client-compiled
parentd0a8608c7e074d4baeef0282146b2da5c47603a5 (diff)
downloadvaadin-framework-9a6ebeb5a80bdb1d97d47422c62a973b3f2d2cf9.tar.gz
vaadin-framework-9a6ebeb5a80bdb1d97d47422c62a973b3f2d2cf9.zip
Add OSGi support #8830 #8827 #8828 #8829
Use bnd-maven-plugin instead of maven-bundle-plugin and helper class, and add support for publishing static resources such as themes and widgetsets.
Diffstat (limited to 'compatibility-client-compiled')
-rw-r--r--compatibility-client-compiled/bnd.bnd6
-rw-r--r--compatibility-client-compiled/pom.xml65
-rw-r--r--compatibility-client-compiled/src/main/java/com/vaadin/osgi/compatibility/widgetset/CompatibilityWidgetsetContribution.java47
3 files changed, 64 insertions, 54 deletions
diff --git a/compatibility-client-compiled/bnd.bnd b/compatibility-client-compiled/bnd.bnd
new file mode 100644
index 0000000000..665722b56b
--- /dev/null
+++ b/compatibility-client-compiled/bnd.bnd
@@ -0,0 +1,6 @@
+Bundle-SymbolicName: ${project.groupId}.compatibility.client.compiled
+Bundle-Name: Compatibility Widgetset
+Bundle-Version: ${osgi.bundle.version}
+Import-Package: com.vaadin*;version='[${osgi.bundle.version},${osgi.bundle.version}]',\
+ *
+Export-Package: com.vaadin.osgi.compatibility.widgetset;-noimport:=true
diff --git a/compatibility-client-compiled/pom.xml b/compatibility-client-compiled/pom.xml
index 9f09cede62..1a21712a94 100644
--- a/compatibility-client-compiled/pom.xml
+++ b/compatibility-client-compiled/pom.xml
@@ -50,41 +50,20 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.osgi</groupId>
+ <artifactId>osgi.cmpn</artifactId>
+ </dependency>
</dependencies>
<build>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <executions>
- <execution>
- <id>generate-export-package</id>
- <phase>package</phase>
- <goals>
- <goal>exec</goal>
- </goals>
- <configuration>
- <classpathScope>compile</classpathScope>
- <executable>${java.home}/bin/java</executable>
- <arguments>
- <argument>-Dvaadin.version=${parsedVersion.majorVersion}.${parsedVersion.minorVersion}.${parsedVersion.incrementalVersion}</argument>
- <argument>-DincludeNumberPackages=1</argument>
-
- <argument>-classpath</argument>
- <classpath />
-
- <argument>com.vaadin.buildhelpers.GeneratePackageExports</argument>
-
- <argument>${project.build.directory}/${project.build.finalName}.${project.packaging}</argument>
- <argument>VAADIN/widgetsets</argument>
- </arguments>
- </configuration>
- </execution>
- </executions>
- </plugin>
-
- <plugin>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-maven-plugin</artifactId>
<configuration>
@@ -104,32 +83,10 @@
</execution>
</executions>
</plugin>
-
-
<plugin>
- <groupId>org.apache.felix</groupId>
- <artifactId>maven-bundle-plugin</artifactId>
- <extensions>true</extensions>
- <configuration>
- <instructions>
- <Bundle-Version>${osgi.bundle.version}</Bundle-Version>
- <Bundle-RequiredExecutionEnvironment>${osgi.execution.environment}</Bundle-RequiredExecutionEnvironment>
- <!-- Export package is handled in exec plugin -->
- <Export-Package></Export-Package>
- <Import-Package></Import-Package>
- </instructions>
- </configuration>
- <executions>
- <execution>
- <id>bundle-manifest</id>
- <phase>prepare-package</phase>
- <goals>
- <goal>manifest</goal>
- </goals>
- </execution>
- </executions>
+ <groupId>biz.aQute.bnd</groupId>
+ <artifactId>bnd-maven-plugin</artifactId>
</plugin>
-
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
diff --git a/compatibility-client-compiled/src/main/java/com/vaadin/osgi/compatibility/widgetset/CompatibilityWidgetsetContribution.java b/compatibility-client-compiled/src/main/java/com/vaadin/osgi/compatibility/widgetset/CompatibilityWidgetsetContribution.java
new file mode 100644
index 0000000000..f9c4c4d121
--- /dev/null
+++ b/compatibility-client-compiled/src/main/java/com/vaadin/osgi/compatibility/widgetset/CompatibilityWidgetsetContribution.java
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2000-2016 Vaadin Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.vaadin.osgi.compatibility.widgetset;
+
+import org.osgi.service.component.ComponentContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+import org.osgi.service.component.annotations.Reference;
+import org.osgi.service.http.HttpService;
+
+import com.vaadin.osgi.resources.OSGiVaadinResources;
+import com.vaadin.osgi.resources.VaadinResourceService;
+
+@Component(immediate = true)
+public class CompatibilityWidgetsetContribution {
+ private HttpService httpService;
+
+ private static final String WIDGETSET_NAME = "com.vaadin.v7.Vaadin7WidgetSet";
+
+ @Activate
+ void startup(ComponentContext context) throws Exception {
+ VaadinResourceService service = OSGiVaadinResources.getService();
+ service.publishWidgetset(WIDGETSET_NAME, httpService);
+ }
+
+ @Reference
+ void setHttpService(HttpService httpService) {
+ this.httpService = httpService;
+ }
+
+ void unsetHttpService(HttpService httpService) {
+ this.httpService = null;
+ }
+}