[annotations] pom.xml for releasing infer annotations via maven

Reviewed By: jvillard

Differential Revision: D4598899

fbshipit-source-id: 21f45cb
master
Sam Blackshear 8 years ago committed by Facebook Github Bot
parent ef79b20e17
commit 0675e88571

3
.gitignore vendored

@ -137,3 +137,6 @@ infer/src/.project
# build artifacts cache
/.yarn/*
# generated by Maven
/infer/annotations/target

@ -10,7 +10,8 @@ include $(ROOT_DIR)/Makefile.config
CWD = $(shell pwd)
JSR_JAR = $(DEPENDENCIES_DIR)/java/jsr-305/jsr305.jar
ANNOT_SOURCES = $(shell find com/facebook/infer/annotation -name "*.java")
SOURCES_DIR = src/main/java
ANNOT_SOURCES = $(shell find $(SOURCES_DIR)/com/facebook/infer/annotation -name "*.java")
ANNOT_CLASSES = 'annot_classes'
ANNOTATIONS_JAR = $(CWD)/annotations.jar
@ -24,7 +25,7 @@ $(ANNOTATIONS_JAR): $(ANNOT_SOURCES)
cd $(ANNOT_CLASSES) && jar cvf $(ANNOTATIONS_JAR) com
$(SOURCES_JAR): $(ANNOT_SOURCES)
jar cvf $(SOURCES_JAR) com
jar cvf $(SOURCES_JAR) $(SOURCES_DIR)/com
clean:
@rm -rf $(ANNOT_CLASSES)

@ -0,0 +1,86 @@
<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>
<groupId>com.facebook.infer.annotation</groupId>
<artifactId>infer-annotation</artifactId>
<version>0.10.0.3-SNAPSHOT</version>
<packaging>jar</packaging>
<description>Annotations for the Infer static analyzer</description>
<url>http://fbinfer.com/</url>
<licenses>
<license>
<name>BSD license</name>
<url>https://github.com/facebook/infer/blob/master/LICENSE</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<connection>scm:git:git@github.com:facebook/infer.git</connection>
<developerConnection>scm:git:git@github.com:faceook/infer.git</developerConnection>
<url>https://github.com/facebook/infer/</url>
<tag>infer-annotations-0.10.0.3</tag>
</scm>
<developers>
</developers>
<parent>
<groupId>org.sonatype.oss</groupId>
<artifactId>oss-parent</artifactId>
<version>7</version>
</parent>
<pluginRepositories>
<pluginRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
<distributionManagement>
<repository>
<id>sonatype-nexus-staging</id>
<name>Nexus Release Repository</name>
<url>http://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<dependencies>
<dependency>
<groupId>com.google.code.findbugs</groupId>
<artifactId>jsr305</artifactId>
<version>3.0.1</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<executions>
<execution>
<id>default</id>
<goals>
<goal>perform</goal>
</goals>
<configuration>
<pomFileName>infer/annotations/pom.xml</pomFileName>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

@ -18,10 +18,10 @@ import java.lang.annotation.Target;
* overrides of methods.
*
* This annotation is used to suppress benign race warnings on fields assigned to methods annotated
* with @Functional in the thread-safety analysis. For example:
* with {@literal @Functional} in the thread-safety analysis. For example:
*
* T mField;
* @Functional T someMethod();
* {@literal @Functional} T someMethod();
* public void getField() {
* if (mField == null) {
* mField = someMethod();
@ -30,7 +30,7 @@ import java.lang.annotation.Target;
* }
*
* Normally, we'd report that the access to mField is unsafe, but we won't report here because of
* the @Functional annotation.
* the {@literal @Functional} annotation.
*
* If the return value of the annotated function is a double or long, the annotation will be
* ignored because writes to doubles/longs are not guaranteed to be atomic. That is, if type T was

@ -15,9 +15,9 @@ import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Similar to @ThreadSafe annotation from javax.concurrent.annotation, but can be applied to
* methods. In addition, you can ask Infer to assume thread-safety rather than checking it by using
* @ThreadSafe(enableChecks = false).
* Similar to the {@literal @ThreadSafe} annotation from javax.concurrent.annotation, but can be
* applied to methods. In addition, you can ask Infer to assume thread-safety rather than checking
* it by using {@literal @ThreadSafe(enableChecks = false)}.
*/
@Target({ ElementType.CONSTRUCTOR, ElementType.METHOD, ElementType.TYPE })

@ -0,0 +1,27 @@
#!/bin/bash
# Copyright (c) 2017 - present Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
# create a release of the Infer Java annotations to send to oss.sonatype.org
set -x
set -e
REMOTE="$( git remote get-url origin )"
OSS_REMOTE=https://github.com/facebook/infer.git
# check if we're in the open-source repo
if ! git remote get-url origin | grep -q "\bgithub\.com\b"; then
echo "Please run this script from the Git repo for open-source Infer!"
exit 1
fi
echo "Starting release..."
mvn release:clean release:prepare
mvn release:perform -DpushChanges=false
Loading…
Cancel
Save