hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject [06/50] httpcomponents-parent git commit: As discussed, add Animal-Sniffer profile
Date Sun, 28 May 2017 11:16:04 GMT
As discussed, add Animal-Sniffer profile

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/project/trunk@1653926 13f79535-47bb-0310-9956-ffa450edef68


Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-parent/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-parent/commit/019831c9
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-parent/tree/019831c9
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-parent/diff/019831c9

Branch: refs/heads/master
Commit: 019831c94906bd2597847f2c7c59d23b7586fddd
Parents: a38bcac
Author: Sebastian Bazley <sebb@apache.org>
Authored: Thu Jan 22 16:08:39 2015 +0000
Committer: Sebastian Bazley <sebb@apache.org>
Committed: Thu Jan 22 16:08:39 2015 +0000

----------------------------------------------------------------------
 pom.xml | 98 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 97 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/httpcomponents-parent/blob/019831c9/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 33139a6..efa1b48 100644
--- a/pom.xml
+++ b/pom.xml
@@ -684,6 +684,97 @@ Fixed JIRA link
   </reporting>
 
  <profiles>
+
+  <profile>
+    <!--
+      Make the version parts of the maven.compiler.target property
+      available as separate properties, so that they can be used to define
+      the java signature artifactId used by animal-sniffer etc.
+    -->
+    <id>parse-target-version</id>
+    <activation>
+      <property>
+        <!--
+           This property should always be defined.
+           The intention is to ensure that the profile is always enabled.
+           (activeByDefault only applies if other profiles are not enabled) 
+        -->
+        <name>user.home</name>
+      </property>
+    </activation>
+    <build>
+      <plugins>
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>build-helper-maven-plugin</artifactId>
+          <version>1.9.1</version>
+          <executions>
+            <execution>
+              <id>parse-version</id>
+              <goals>
+                <goal>parse-version</goal>
+              </goals>
+              <configuration>
+                <propertyPrefix>javaTarget</propertyPrefix>
+                <versionString>${maven.compiler.target}</versionString>
+              </configuration>
+            </execution>
+          </executions>
+        </plugin>
+      </plugins>
+    </build>
+  </profile>
+
+  <!-- 
+       Runs the Animal Sniffer plugin to check that generated code does not included references
+       to methods/classes etc that are not present in the standard Java runtime for the defined
target version.
+       To bypass the checks, define "animal.sniffer.skip" as true, or create the file "src/site/resources/profile.noanimal"

+  -->
+
+  <profile>
+    <id>animal-sniffer</id>
+    <activation>
+      <!--  active unless the file is found -->
+      <file>
+        <missing>src/site/resources/profile.noanimal</missing>
+      </file>
+    </activation>
+    
+    <properties>
+      <!-- define this as a property to allow command-line override -->
+      <animal-sniffer.signature>java${javaTarget.majorVersion}${javaTarget.minorVersion}</animal-sniffer.signature>
+    </properties>
+
+    <build>
+      <plugins>
+
+        <!-- Run the Animal Sniffer checks -->
+        <plugin>
+          <groupId>org.codehaus.mojo</groupId>
+          <artifactId>animal-sniffer-maven-plugin</artifactId>
+          <version>${hc.animal-sniffer.version}</version>
+          <executions>
+            <execution>
+              <id>checkAPIcompatibility</id>
+              <phase>test</phase>
+              <goals>
+                <goal>check</goal>
+              </goals>
+            </execution>
+          </executions>
+          <configuration>
+            <signature>
+              <groupId>org.codehaus.mojo.signature</groupId>
+              <artifactId>${animal-sniffer.signature}</artifactId>
+              <version>${hc.animal-sniffer.signature.version}</version>
+            </signature>
+          </configuration>
+        </plugin>
+
+      </plugins>
+    </build>
+  </profile>
+
    <profile>
      <id>release</id>
      <build>
@@ -801,6 +892,9 @@ Fixed JIRA link
 
     </profile>
 
+
+
+
  </profiles>
 
  <prerequisites>
@@ -824,7 +918,9 @@ Fixed JIRA link
    <hc.surefire.version>2.17</hc.surefire.version>
    <hc.project-info.version>2.7</hc.project-info.version>
    <hc.checkstyle.version>2.9.1</hc.checkstyle.version>
-
+   <!-- plugin versions 1.12 and 1.13 currently require Java 7 -->
+   <hc.animal-sniffer.version>1.11</hc.animal-sniffer.version>
+   <hc.animal-sniffer.signature.version>1.0</hc.animal-sniffer.signature.version>
    <!-- build meta inf -->
    <maven.build.timestamp.format>yyyy-MM-dd HH:mm:ssZ</maven.build.timestamp.format>
    <implementation.build>${scmBranch}@r${buildNumber}; ${maven.build.timestamp}</implementation.build>


Mime
View raw message