summaryrefslogtreecommitdiffstats
path: root/annotations
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
committerJon Bratseth <bratseth@yahoo-inc.com>2016-06-15 23:09:44 +0200
commit72231250ed81e10d66bfe70701e64fa5fe50f712 (patch)
tree2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /annotations
Publish
Diffstat (limited to 'annotations')
-rw-r--r--annotations/.gitignore2
-rw-r--r--annotations/OWNERS1
-rw-r--r--annotations/pom.xml62
-rw-r--r--annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java23
-rw-r--r--annotations/src/main/java/com/yahoo/api/annotations/package-info.java3
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java23
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/Version.java24
-rw-r--r--annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java3
-rw-r--r--annotations/src/main/resources/.gitignore1
9 files changed, 142 insertions, 0 deletions
diff --git a/annotations/.gitignore b/annotations/.gitignore
new file mode 100644
index 00000000000..12251442258
--- /dev/null
+++ b/annotations/.gitignore
@@ -0,0 +1,2 @@
+/target
+/pom.xml.build
diff --git a/annotations/OWNERS b/annotations/OWNERS
new file mode 100644
index 00000000000..31af040f698
--- /dev/null
+++ b/annotations/OWNERS
@@ -0,0 +1 @@
+bratseth
diff --git a/annotations/pom.xml b/annotations/pom.xml
new file mode 100644
index 00000000000..59dd7e82ac9
--- /dev/null
+++ b/annotations/pom.xml
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>parent</artifactId>
+ <version>6-SNAPSHOT</version>
+ <relativePath>../parent/pom.xml</relativePath>
+ </parent>
+ <artifactId>annotations</artifactId>
+ <packaging>jar</packaging>
+ <version>6-SNAPSHOT</version>
+ <name>annotations</name>
+ <description>Public API annotations</description>
+ <repositories>
+ <repository>
+ <id>apache-org</id>
+ <name>apache.org Repository for Maven</name>
+ <url>https://repository.apache.org/content/groups/public</url>
+ <releases>
+ <updatePolicy>never</updatePolicy>
+ </releases>
+ <snapshots>
+ <enabled>false</enabled>
+ </snapshots>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-deploy-plugin</artifactId>
+ <version>2.5</version>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <compilerArgs>
+ <arg>-Xlint:all</arg>
+ <arg>-Werror</arg>
+ </compilerArgs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-install-plugin</artifactId>
+ <configuration>
+ <updateReleaseInfo>true</updateReleaseInfo>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java b/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java
new file mode 100644
index 00000000000..7bb250a8b73
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/api/annotations/PublicApi.java
@@ -0,0 +1,23 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.api.annotations;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * For annotating packages that should be part of the public API.
+ *
+ * Must be placed in a file called package-info.java in the
+ * package that is to be public.
+ * @author tonytv
+ * @author gjoranv
+ * @since 5.1.5
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target(ElementType.PACKAGE)
+@Documented
+public @interface PublicApi {
+}
diff --git a/annotations/src/main/java/com/yahoo/api/annotations/package-info.java b/annotations/src/main/java/com/yahoo/api/annotations/package-info.java
new file mode 100644
index 00000000000..d4c7c9a8a1a
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/api/annotations/package-info.java
@@ -0,0 +1,3 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+@PublicApi
+package com.yahoo.api.annotations;
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java
new file mode 100644
index 00000000000..f3bf17e29bd
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/ExportPackage.java
@@ -0,0 +1,23 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.osgi.annotation;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * For annotating packages that should be exported.
+ *
+ * Must be placed in a file called package-info.java in the
+ * package that is to be exported.
+ *
+ * @author tonytv
+ */
+@Retention(RetentionPolicy.CLASS)
+@Target(ElementType.PACKAGE)
+@Documented
+public @interface ExportPackage {
+ Version version() default @Version;
+}
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java
new file mode 100644
index 00000000000..69379780182
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/Version.java
@@ -0,0 +1,24 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.osgi.annotation;
+
+/**
+ * Version of an exported package
+ * The default version is 1.0.0
+ * @see <a href="http://www.osgi.org/javadoc/r4v43/org/osgi/framework/Version.html">Osgi version documentation</a>
+ * @author tonytv
+ */
+public @interface Version {
+
+ /** must be non-negative **/
+ int major() default 1;
+
+ /** must be non-negative **/
+ int minor() default 0;
+
+ /** must be non-negative **/
+ int micro() default 0;
+
+ /** must follow the format (alpha|digit|'_'|'-')+ **/
+ String qualifier() default "";
+
+}
diff --git a/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java
new file mode 100644
index 00000000000..5e84b29d8f3
--- /dev/null
+++ b/annotations/src/main/java/com/yahoo/osgi/annotation/package-info.java
@@ -0,0 +1,3 @@
+// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+@com.yahoo.api.annotations.PublicApi
+package com.yahoo.osgi.annotation;
diff --git a/annotations/src/main/resources/.gitignore b/annotations/src/main/resources/.gitignore
new file mode 100644
index 00000000000..b347c417aa1
--- /dev/null
+++ b/annotations/src/main/resources/.gitignore
@@ -0,0 +1 @@
+/getversion