From 0675e88571b96438e312a5dea0426f8061e7956a Mon Sep 17 00:00:00 2001 From: Sam Blackshear Date: Tue, 7 Mar 2017 15:48:36 -0800 Subject: [PATCH] [annotations] pom.xml for releasing infer annotations via maven Reviewed By: jvillard Differential Revision: D4598899 fbshipit-source-id: 21f45cb --- .gitignore | 3 + infer/annotations/Makefile | 5 +- infer/annotations/pom.xml | 86 +++++++++++++++++++ .../facebook/infer/annotation/Assertions.java | 0 .../facebook/infer/annotation/Expensive.java | 0 .../infer/annotation/FalseOnNull.java | 0 .../facebook/infer/annotation/Functional.java | 6 +- .../infer/annotation/IgnoreAllocations.java | 0 .../infer/annotation/Initializer.java | 0 .../infer/annotation/IntegritySink.java | 0 .../infer/annotation/IntegritySource.java | 0 .../facebook/infer/annotation/Mutable.java | 0 .../infer/annotation/NoAllocation.java | 0 .../facebook/infer/annotation/OkToExtend.java | 0 .../infer/annotation/PerformanceCritical.java | 0 .../facebook/infer/annotation/Present.java | 0 .../infer/annotation/PrivacySink.java | 0 .../infer/annotation/PrivacySource.java | 0 .../infer/annotation/ReturnsOwnership.java | 0 .../SuppressFieldNotInitialized.java | 0 .../annotation/SuppressFieldNotNullable.java | 0 .../infer/annotation/SuppressLint.java | 0 .../annotation/SuppressNullFieldAccess.java | 0 .../annotation/SuppressNullMethodCall.java | 0 .../SuppressParameterNotNullable.java | 0 .../SuppressReturnOverAnnotated.java | 0 .../annotation/SuppressViewNullability.java | 0 .../infer/annotation/ThreadConfined.java | 0 .../facebook/infer/annotation/ThreadSafe.java | 6 +- .../facebook/infer/annotation/TrueOnNull.java | 0 .../com/facebook/infer/annotation/Verify.java | 0 scripts/create_annotations_release.sh | 27 ++++++ 32 files changed, 125 insertions(+), 8 deletions(-) create mode 100644 infer/annotations/pom.xml rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Assertions.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Expensive.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/FalseOnNull.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Functional.java (89%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/IgnoreAllocations.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Initializer.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/IntegritySink.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/IntegritySource.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Mutable.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/NoAllocation.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/OkToExtend.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/PerformanceCritical.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Present.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/PrivacySink.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/PrivacySource.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/ReturnsOwnership.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressFieldNotInitialized.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressFieldNotNullable.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressLint.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressNullFieldAccess.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressNullMethodCall.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressParameterNotNullable.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressReturnOverAnnotated.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/SuppressViewNullability.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/ThreadConfined.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/ThreadSafe.java (73%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/TrueOnNull.java (100%) rename infer/annotations/{ => src/main/java}/com/facebook/infer/annotation/Verify.java (100%) create mode 100755 scripts/create_annotations_release.sh diff --git a/.gitignore b/.gitignore index 40943cafa..22589ba02 100644 --- a/.gitignore +++ b/.gitignore @@ -137,3 +137,6 @@ infer/src/.project # build artifacts cache /.yarn/* + +# generated by Maven +/infer/annotations/target \ No newline at end of file diff --git a/infer/annotations/Makefile b/infer/annotations/Makefile index 61135f6e4..0851f41fc 100644 --- a/infer/annotations/Makefile +++ b/infer/annotations/Makefile @@ -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) diff --git a/infer/annotations/pom.xml b/infer/annotations/pom.xml new file mode 100644 index 000000000..e5ed3eeed --- /dev/null +++ b/infer/annotations/pom.xml @@ -0,0 +1,86 @@ + + 4.0.0 + + com.facebook.infer.annotation + infer-annotation + 0.10.0.3-SNAPSHOT + jar + Annotations for the Infer static analyzer + http://fbinfer.com/ + + + + BSD license + https://github.com/facebook/infer/blob/master/LICENSE + repo + + + + + scm:git:git@github.com:facebook/infer.git + scm:git:git@github.com:faceook/infer.git + https://github.com/facebook/infer/ + infer-annotations-0.10.0.3 + + + + + + + org.sonatype.oss + oss-parent + 7 + + + + + sonatype-nexus-snapshots + Sonatype Nexus Snapshots + https://oss.sonatype.org/content/repositories/snapshots + + true + + + false + + + + + + + sonatype-nexus-staging + Nexus Release Repository + http://oss.sonatype.org/service/local/staging/deploy/maven2/ + + + + + + com.google.code.findbugs + jsr305 + 3.0.1 + + + + + + + org.apache.maven.plugins + maven-release-plugin + 2.5.3 + + + default + + perform + + + infer/annotations/pom.xml + + + + + + + + diff --git a/infer/annotations/com/facebook/infer/annotation/Assertions.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Assertions.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Assertions.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Assertions.java diff --git a/infer/annotations/com/facebook/infer/annotation/Expensive.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Expensive.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Expensive.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Expensive.java diff --git a/infer/annotations/com/facebook/infer/annotation/FalseOnNull.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/FalseOnNull.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/FalseOnNull.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/FalseOnNull.java diff --git a/infer/annotations/com/facebook/infer/annotation/Functional.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Functional.java similarity index 89% rename from infer/annotations/com/facebook/infer/annotation/Functional.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Functional.java index 368ff4474..780ba8d77 100644 --- a/infer/annotations/com/facebook/infer/annotation/Functional.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/Functional.java @@ -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 diff --git a/infer/annotations/com/facebook/infer/annotation/IgnoreAllocations.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/IgnoreAllocations.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/IgnoreAllocations.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/IgnoreAllocations.java diff --git a/infer/annotations/com/facebook/infer/annotation/Initializer.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Initializer.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Initializer.java diff --git a/infer/annotations/com/facebook/infer/annotation/IntegritySink.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/IntegritySink.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySink.java diff --git a/infer/annotations/com/facebook/infer/annotation/IntegritySource.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/IntegritySource.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/IntegritySource.java diff --git a/infer/annotations/com/facebook/infer/annotation/Mutable.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Mutable.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Mutable.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Mutable.java diff --git a/infer/annotations/com/facebook/infer/annotation/NoAllocation.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/NoAllocation.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/NoAllocation.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/NoAllocation.java diff --git a/infer/annotations/com/facebook/infer/annotation/OkToExtend.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/OkToExtend.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/OkToExtend.java diff --git a/infer/annotations/com/facebook/infer/annotation/PerformanceCritical.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/PerformanceCritical.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/PerformanceCritical.java diff --git a/infer/annotations/com/facebook/infer/annotation/Present.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Present.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Present.java diff --git a/infer/annotations/com/facebook/infer/annotation/PrivacySink.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/PrivacySink.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySink.java diff --git a/infer/annotations/com/facebook/infer/annotation/PrivacySource.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/PrivacySource.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/PrivacySource.java diff --git a/infer/annotations/com/facebook/infer/annotation/ReturnsOwnership.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/ReturnsOwnership.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/ReturnsOwnership.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressFieldNotInitialized.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressFieldNotInitialized.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressFieldNotInitialized.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressFieldNotInitialized.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressFieldNotNullable.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressFieldNotNullable.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressFieldNotNullable.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressFieldNotNullable.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressLint.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressLint.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressLint.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressNullFieldAccess.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressNullFieldAccess.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressNullFieldAccess.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressNullFieldAccess.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressNullMethodCall.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressNullMethodCall.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressNullMethodCall.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressNullMethodCall.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressParameterNotNullable.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressParameterNotNullable.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressParameterNotNullable.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressParameterNotNullable.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressReturnOverAnnotated.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressReturnOverAnnotated.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressReturnOverAnnotated.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressReturnOverAnnotated.java diff --git a/infer/annotations/com/facebook/infer/annotation/SuppressViewNullability.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/SuppressViewNullability.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/SuppressViewNullability.java diff --git a/infer/annotations/com/facebook/infer/annotation/ThreadConfined.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/ThreadConfined.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadConfined.java diff --git a/infer/annotations/com/facebook/infer/annotation/ThreadSafe.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java similarity index 73% rename from infer/annotations/com/facebook/infer/annotation/ThreadSafe.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java index 62c5a71f5..02f7374e5 100644 --- a/infer/annotations/com/facebook/infer/annotation/ThreadSafe.java +++ b/infer/annotations/src/main/java/com/facebook/infer/annotation/ThreadSafe.java @@ -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 }) diff --git a/infer/annotations/com/facebook/infer/annotation/TrueOnNull.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/TrueOnNull.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/TrueOnNull.java diff --git a/infer/annotations/com/facebook/infer/annotation/Verify.java b/infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java similarity index 100% rename from infer/annotations/com/facebook/infer/annotation/Verify.java rename to infer/annotations/src/main/java/com/facebook/infer/annotation/Verify.java diff --git a/scripts/create_annotations_release.sh b/scripts/create_annotations_release.sh new file mode 100755 index 000000000..07878c93a --- /dev/null +++ b/scripts/create_annotations_release.sh @@ -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