pax_global_header 0000666 0000000 0000000 00000000064 11633734772 0014527 g ustar 00root root 0000000 0000000 52 comment=a39f639ea011a77f5c4fc300141d032b44a0b565
animal-sniffer-1.7/ 0000775 0000000 0000000 00000000000 11633734772 0014271 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/ 0000775 0000000 0000000 00000000000 11633734772 0021517 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/pom.xml 0000664 0000000 0000000 00000004753 11633734772 0023045 0 ustar 00root root 0000000 0000000
4.0.0org.codehaus.mojoanimal-sniffer-parent1.7animal-sniffer-annotationsAnimal Sniffer Annotationsorg.apache.maven.pluginsmaven-enforcer-pluginenforce-javaenforceAnnotations require Java 1.5+ to compile[1.5,)maven-compiler-plugin1.51.5
animal-sniffer-1.7/animal-sniffer-annotations/src/ 0000775 0000000 0000000 00000000000 11633734772 0022306 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/ 0000775 0000000 0000000 00000000000 11633734772 0023232 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/ 0000775 0000000 0000000 00000000000 11633734772 0024153 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/org/ 0000775 0000000 0000000 00000000000 11633734772 0024742 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/org/codehaus/ 0000775 0000000 0000000 00000000000 11633734772 0026535 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/org/codehaus/mojo/ 0000775 0000000 0000000 00000000000 11633734772 0027501 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/org/codehaus/mojo/animal_sniffer/ 0000775 0000000 0000000 00000000000 11633734772 0032456 5 ustar 00root root 0000000 0000000 IgnoreJRERequirement.java 0000664 0000000 0000000 00000003107 11633734772 0037250 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/main/java/org/codehaus/mojo/animal_sniffer package org.codehaus.mojo.animal_sniffer;
/*
* The MIT License
*
* Copyright (c) 2008 Kohsuke Kawaguchi and codehaus.org.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import static java.lang.annotation.RetentionPolicy.CLASS;
import java.lang.annotation.Target;
/**
* @author Kohsuke Kawaguchi
*/
@Retention(CLASS)
@Documented
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.TYPE})
public @interface IgnoreJRERequirement
{
}
animal-sniffer-1.7/animal-sniffer-annotations/src/site/ 0000775 0000000 0000000 00000000000 11633734772 0023252 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/site/apt/ 0000775 0000000 0000000 00000000000 11633734772 0024036 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-annotations/src/site/apt/index.apt.vm 0000664 0000000 0000000 00000011450 11633734772 0026275 0 ustar 00root root 0000000 0000000 ~~ The MIT License
~~
~~ Copyright (c) 2009 codehaus.org.
~~
~~ Permission is hereby granted, free of charge, to any person obtaining a copy
~~ of this software and associated documentation files (the "Software"), to deal
~~ in the Software without restriction, including without limitation the rights
~~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~~ copies of the Software, and to permit persons to whom the Software is
~~ furnished to do so, subject to the following conditions:
~~
~~ The above copyright notice and this permission notice shall be included in
~~ all copies or substantial portions of the Software.
~~
~~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
~~ THE SOFTWARE.
~~
-----
Animal Sniffer Annotations
-----
Stephen Connolly
-----
2009-11-03
-----
Animal Sniffer Annotations
Animal Sniffer Annotations provides Java 1.5+ annotations which allow marking methods which Animal Sniffer should
ignore signature violations of.
* Introduction
Animal Sniffer is designed to detect when you have used classes/methods/fields which are not part of the JRE
that you are targetting. There are certain situations when you might be compiling with a newer JDK than the
JRE you are targetting. For example newer versions of MacOS do not have JDK 1.5 available and so only JDK 1.6
can be used. Another case is where you are targetting JRE 1.5, but you need to work around some bugs in the
JDK 1.5 compiler (there are some well known bugs to do with generics) and so you compile with JDK 1.6.
There are some situations where you may want to make use of some of the classes that are available on the newer
JRE when your program is executed on the newer JDK. For example, JDK 1.6 introduced <<>>.
In these cases you would wrap the use of the newer classes inside a <<>> block, e.g.
---
...
import javax.awt.SplashScreen;
...
public final class Someclass {
...
public static void main(String[] args) {
...
// long running initialization
...
try {
SplashScreen.getSplashScreen().close();
} catch (LinkageError e) {
// JDK 5 doesn't display a splash screen, no need to hide it
}
...
}
...
}
---
The above code will require JDK 1.6 or newer to compile, but will safely run on JRE 1.5. When you run animal-sniffer
over the above class with the signatures for JRE 1.5, however, animal sniffer will report a signature failure.
Animal Sniffer Annotations provides an annotation <<<@IgnoreJRERequirement>>> which you can use to annotate methods
which are to be ignored by animal sniffer, e.g.
---
public final class MapFactory {
...
@IgnoreJRERequirement
public ConcurrentMap newConcurrentMap() {
try {
// Note this map implementation is only available in JRE 1.6+
return new ConcurrentSkipListMap();
} catch (LinkageError e) {
// fall back to JRE 1.5's only concurrent map
return new ConcurrentHashMap();
}
}
...
}
---
Note: if you have compiled with the <<>> you do not have to change
anything as animal-sniffer automatically detects this annotation as well (even although it is in a different
package.
* Using animal-sniffer-annotations in Maven projects
To annotate your methods, you need to add either an optional and/or provided dependency on
<<>>, (technically optional is the correct way, but to work around some
incorrectly written maven plugins, you may end up using scope provided) e.g.
---
...
...
${project.groupId}${project.artifactId}${project.version}true
...
...
...
...
maven-compiler-plugin
...
...
1.51.5
...
...
...
...
---
animal-sniffer-1.7/animal-sniffer-annotations/src/site/site.xml 0000664 0000000 0000000 00000002477 11633734772 0024752 0 ustar 00root root 0000000 0000000
animal-sniffer-1.7/animal-sniffer-ant-tasks/ 0000775 0000000 0000000 00000000000 11633734772 0021067 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/pom.xml 0000664 0000000 0000000 00000010674 11633734772 0022414 0 ustar 00root root 0000000 0000000
4.0.0org.codehaus.mojoanimal-sniffer-parent1.7org.codehaus.mojoanimal-sniffer-ant-tasksjarAnimal Sniffer Ant Tasks
Animal Sniffer Ant Tasks.
org.codehaus.mojoanimal-sniffer1.7org.apache.antant1.7.1providedorg.apache.maven.pluginsmaven-shade-plugin1.2.1packageshadefalsetruejunit:junitorg.objectweb.asmorg.codehaus.mojo.animal_sniffer.asm.shadedmaven-invoker-plugin*/pom.xmlrun-itsverifyorg.apache.maven.pluginsmaven-invoker-plugin1.4integration-testinstallrunfalsetrue
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/ 0000775 0000000 0000000 00000000000 11633734772 0021656 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/ 0000775 0000000 0000000 00000000000 11633734772 0022272 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/ 0000775 0000000 0000000 00000000000 11633734772 0024346 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/build.xml 0000664 0000000 0000000 00000013546 11633734772 0026200 0 ustar 00root root 0000000 0000000
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/invoker.properties 0000664 0000000 0000000 00000002163 11633734772 0030143 0 ustar 00root root 0000000 0000000 #
# The MIT License
#
# Copyright (c) 2009 codehaus.org.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
invoker.goals=validate
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/pom.xml 0000664 0000000 0000000 00000007726 11633734772 0025677 0 ustar 00root root 0000000 0000000
4.0.0integration-testmerge-testpom1.0-SNAPSHOT
Check that signature files can be merged.
maven-clean-plugin2.3maven-source-plugin2.0.4maven-dependency-plugin2.1maven-resources-plugin2.3maven-surefire-plugin2.4.3maven-install-plugin2.2maven-deploy-plugin2.4maven-site-plugin2.0-beta-6maven-compiler-plugin2.0.2org.apache.maven.pluginsmaven-antrun-plugin1.3maven-jar-plugin2.2org.apache.maven.pluginsmaven-antrun-pluginvalidaterunUTF-8UTF-8UTF-8
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/ 0000775 0000000 0000000 00000000000 11633734772 0025135 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api1/ 0000775 0000000 0000000 00000000000 11633734772 0025767 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api1/java/ 0000775 0000000 0000000 00000000000 11633734772 0026710 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api1/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031172 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api1/java/localdomain/localhost/ 0000775 0000000 0000000 00000000000 11633734772 0033162 5 ustar 00root root 0000000 0000000 Api.java 0000664 0000000 0000000 00000002312 11633734772 0034455 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api1/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api2/ 0000775 0000000 0000000 00000000000 11633734772 0025770 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api2/java/ 0000775 0000000 0000000 00000000000 11633734772 0026711 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api2/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031173 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api2/java/localdomain/localhost/ 0000775 0000000 0000000 00000000000 11633734772 0033163 5 ustar 00root root 0000000 0000000 Api.java 0000664 0000000 0000000 00000002345 11633734772 0034464 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api2/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
void checkVersion2();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api3/ 0000775 0000000 0000000 00000000000 11633734772 0025771 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api3/java/ 0000775 0000000 0000000 00000000000 11633734772 0026712 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api3/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031174 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api3/java/localdomain/localhost/ 0000775 0000000 0000000 00000000000 11633734772 0033164 5 ustar 00root root 0000000 0000000 OtherApi.java 0000664 0000000 0000000 00000002317 11633734772 0035466 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/api3/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface OtherApi
{
void checkVersion3();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/main/ 0000775 0000000 0000000 00000000000 11633734772 0026061 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/main/java/ 0000775 0000000 0000000 00000000000 11633734772 0027002 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/merge-test/src/main/java/JDK15.java 0000664 0000000 0000000 00000002522 11633734772 0030424 0 ustar 00root root 0000000 0000000 /*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import localdomain.localhost.Api;
import localdomain.localhost.OtherApi;
public class JDK15
{
public void doChecks(Api api, OtherApi other)
{
api.checkVersion2();
other.checkVersion3();
}
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/ 0000775 0000000 0000000 00000000000 11633734772 0025051 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/build.xml 0000664 0000000 0000000 00000011321 11633734772 0026670 0 ustar 00root root 0000000 0000000
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/invoker.properties 0000664 0000000 0000000 00000002217 11633734772 0030646 0 ustar 00root root 0000000 0000000 #
# The MIT License
#
# Copyright (c) 2009 codehaus.org.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
invoker.goals=validate
invoker.buildResult=failure
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/pom.xml 0000664 0000000 0000000 00000007737 11633734772 0026404 0 ustar 00root root 0000000 0000000
4.0.0integration-testnegative-testpom1.0-SNAPSHOT
Test that a signature mismatch fails the build.
maven-clean-plugin2.3maven-source-plugin2.0.4maven-dependency-plugin2.1maven-resources-plugin2.3maven-surefire-plugin2.4.3maven-install-plugin2.2maven-deploy-plugin2.4maven-site-plugin2.0-beta-6maven-compiler-plugin2.0.2org.apache.maven.pluginsmaven-antrun-plugin1.3maven-jar-plugin2.2org.apache.maven.pluginsmaven-antrun-pluginvalidaterunUTF-8UTF-8UTF-8
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/ 0000775 0000000 0000000 00000000000 11633734772 0025640 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api1/ 0000775 0000000 0000000 00000000000 11633734772 0026472 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api1/java/ 0000775 0000000 0000000 00000000000 11633734772 0027413 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api1/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031675 5 ustar 00root root 0000000 0000000 0000775 0000000 0000000 00000000000 11633734772 0033606 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api1/java/localdomain/localhost Api.java 0000664 0000000 0000000 00000002312 11633734772 0035160 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api1/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api2/ 0000775 0000000 0000000 00000000000 11633734772 0026473 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api2/java/ 0000775 0000000 0000000 00000000000 11633734772 0027414 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api2/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031676 5 ustar 00root root 0000000 0000000 0000775 0000000 0000000 00000000000 11633734772 0033607 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api2/java/localdomain/localhost Api.java 0000664 0000000 0000000 00000002345 11633734772 0035167 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/api2/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
void checkVersion2();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/main/ 0000775 0000000 0000000 00000000000 11633734772 0026564 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/main/java/ 0000775 0000000 0000000 00000000000 11633734772 0027505 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/negative-test/src/main/java/JDK15.java 0000664 0000000 0000000 00000002374 11633734772 0031134 0 ustar 00root root 0000000 0000000 /*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import localdomain.localhost.Api;
public class JDK15
{
public void doChecks(Api api)
{
api.checkVersion2();
}
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/settings.xml 0000664 0000000 0000000 00000004545 11633734772 0024664 0 ustar 00root root 0000000 0000000
it-repotruecentralfile:///@localRepository@trueignorenevertrueignorenevercentralfile:///@localRepository@trueignorenevertrueignorenever
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/ 0000775 0000000 0000000 00000000000 11633734772 0024365 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/build.xml 0000664 0000000 0000000 00000011316 11633734772 0026210 0 ustar 00root root 0000000 0000000
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/invoker.properties 0000664 0000000 0000000 00000002163 11633734772 0030162 0 ustar 00root root 0000000 0000000 #
# The MIT License
#
# Copyright (c) 2009 codehaus.org.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
invoker.goals=validate
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/pom.xml 0000664 0000000 0000000 00000007745 11633734772 0025717 0 ustar 00root root 0000000 0000000
4.0.0integration-testsmoke-testpom1.0-SNAPSHOT
Test that the basic functionality works (positive test).
maven-clean-plugin2.3maven-source-plugin2.0.4maven-dependency-plugin2.1maven-resources-plugin2.3maven-surefire-plugin2.4.3maven-install-plugin2.2maven-deploy-plugin2.4maven-site-plugin2.0-beta-6maven-compiler-plugin2.0.2org.apache.maven.pluginsmaven-antrun-plugin1.3maven-jar-plugin2.2org.apache.maven.pluginsmaven-antrun-pluginvalidaterunUTF-8UTF-8UTF-8
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/ 0000775 0000000 0000000 00000000000 11633734772 0025154 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api1/ 0000775 0000000 0000000 00000000000 11633734772 0026006 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api1/java/ 0000775 0000000 0000000 00000000000 11633734772 0026727 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api1/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031211 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api1/java/localdomain/localhost/ 0000775 0000000 0000000 00000000000 11633734772 0033201 5 ustar 00root root 0000000 0000000 Api.java 0000664 0000000 0000000 00000002312 11633734772 0034474 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api1/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api2/ 0000775 0000000 0000000 00000000000 11633734772 0026007 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api2/java/ 0000775 0000000 0000000 00000000000 11633734772 0026730 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api2/java/localdomain/ 0000775 0000000 0000000 00000000000 11633734772 0031212 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api2/java/localdomain/localhost/ 0000775 0000000 0000000 00000000000 11633734772 0033202 5 ustar 00root root 0000000 0000000 Api.java 0000664 0000000 0000000 00000002345 11633734772 0034503 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/api2/java/localdomain/localhost package localdomain.localhost;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
public interface Api
{
void checkVersion1();
void checkVersion2();
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/main/ 0000775 0000000 0000000 00000000000 11633734772 0026100 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/main/java/ 0000775 0000000 0000000 00000000000 11633734772 0027021 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/it/smoke-test/src/main/java/JDK15.java 0000664 0000000 0000000 00000002374 11633734772 0030450 0 ustar 00root root 0000000 0000000 /*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import localdomain.localhost.Api;
public class JDK15
{
public void doChecks(Api api)
{
api.checkVersion2();
}
} animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/ 0000775 0000000 0000000 00000000000 11633734772 0022602 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/ 0000775 0000000 0000000 00000000000 11633734772 0023523 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/ 0000775 0000000 0000000 00000000000 11633734772 0024312 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/ 0000775 0000000 0000000 00000000000 11633734772 0026105 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/ 0000775 0000000 0000000 00000000000 11633734772 0027051 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ 0000775 0000000 0000000 00000000000 11633734772 0032026 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant/ 0000775 0000000 0000000 00000000000 11633734772 0032610 5 ustar 00root root 0000000 0000000 AntLogger.java 0000664 0000000 0000000 00000004670 11633734772 0035265 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant package org.codehaus.mojo.animal_sniffer.ant;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import org.codehaus.mojo.animal_sniffer.logging.Logger;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.Project;
/**
* An animal sniffer logger that delegates to a maven log.
*
* @author connollys
* @since 1.3
*/
public final class AntLogger
implements Logger
{
private final Task delegate;
public AntLogger( Task delegate )
{
this.delegate = delegate;
}
public void info( String message )
{
delegate.log( message, Project.MSG_INFO );
}
public void info( String message, Throwable t )
{
delegate.log( message, t, Project.MSG_INFO );
}
public void debug( String message )
{
delegate.log( message, Project.MSG_DEBUG );
}
public void debug( String message, Throwable t )
{
delegate.log( message, t, Project.MSG_DEBUG );
}
public void warn( String message )
{
delegate.log( message, Project.MSG_WARN );
}
public void warn( String message, Throwable t )
{
delegate.log( message, t, Project.MSG_WARN );
}
public void error( String message )
{
delegate.log( message, Project.MSG_ERR );
}
public void error( String message, Throwable t )
{
delegate.log( message, t, Project.MSG_ERR );
}
} BuildSignaturesTask.java 0000664 0000000 0000000 00000013215 11633734772 0037325 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant package org.codehaus.mojo.animal_sniffer.ant;
/*
* The MIT License
*
* Copyright (c) 2008 Kohsuke Kawaguchi and codehaus.org.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;
import org.codehaus.mojo.animal_sniffer.SignatureBuilder;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
import java.util.Vector;
/**
* @author Kohsuke Kawaguchi
*/
public class BuildSignaturesTask
extends Task
{
private File destfile;
private Vector paths = new Vector();
private Vector signatures = new Vector();
private Vector includeClasses = new Vector();
private Vector excludeClasses = new Vector();
public void setDestfile( File dest )
{
this.destfile = dest;
}
public void addPath( Path path )
{
paths.add( path );
}
public Signature createSignature()
{
Signature signature = new Signature();
signatures.add( signature );
return signature;
}
public Ignore createIncludeClasses()
{
final Ignore result = new Ignore();
includeClasses.add( result );
return result;
}
public Ignore createExcludeClasses()
{
final Ignore result = new Ignore();
excludeClasses.add( result );
return result;
}
protected void validate()
{
if ( destfile == null )
{
throw new BuildException( "destfile not set" );
}
if ( paths.size() < 1 )
{
throw new BuildException( "path not set" );
}
Iterator i = signatures.iterator();
while ( i.hasNext() )
{
Signature signature = (Signature) i.next();
if ( signature.getSrc() == null )
{
throw new BuildException( "signature src not set" );
}
if ( !signature.getSrc().isFile() )
{
throw new BuildException( "signature " + signature.getSrc() + " does not exist" );
}
}
i = includeClasses.iterator();
while ( i.hasNext() )
{
Ignore tmp = (Ignore) i.next();
if ( tmp.getClassName() == null )
{
throw new BuildException( "includeClasses className not set" );
}
}
i = excludeClasses.iterator();
while ( i.hasNext() )
{
Ignore tmp = (Ignore) i.next();
if ( tmp.getClassName() == null )
{
throw new BuildException( "excludeClasses className not set" );
}
}
}
public void execute()
throws BuildException
{
validate();
try
{
Vector inStreams = new Vector();
Iterator i = signatures.iterator();
while ( i.hasNext() )
{
Signature signature = (Signature) i.next();
log( "Importing signatures from " + signature.getSrc() );
inStreams.add( new FileInputStream( signature.getSrc() ) );
}
SignatureBuilder builder =
new SignatureBuilder( (InputStream[]) inStreams.toArray( new InputStream[inStreams.size()] ),
new FileOutputStream( destfile ), new AntLogger( this ) );
i = includeClasses.iterator();
while ( i.hasNext() )
{
Ignore tmp = (Ignore) i.next();
builder.addInclude( tmp.getClassName() );
}
i = excludeClasses.iterator();
while ( i.hasNext() )
{
Ignore tmp = (Ignore) i.next();
builder.addExclude( tmp.getClassName() );
}
i = paths.iterator();
while ( i.hasNext() )
{
Path path = (Path) i.next();
final String[] files = path.list();
for ( int j = 0; j < files.length; j++ )
{
log( "Capturing signatures from " + files[j], Project.MSG_INFO );
process( builder, new File( files[j] ) );
}
}
builder.close();
}
catch ( IOException e )
{
throw new BuildException( e );
}
}
private void process( SignatureBuilder builder, File f )
throws IOException
{
if ( f.exists() )
{
builder.process( f );
}
}
}
CheckSignatureTask.java 0000664 0000000 0000000 00000014217 11633734772 0037123 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant package org.codehaus.mojo.animal_sniffer.ant;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.Task;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.types.Reference;
import org.apache.tools.ant.types.resources.FileResource;
import org.codehaus.mojo.animal_sniffer.ClassFileVisitor;
import org.codehaus.mojo.animal_sniffer.ClassListBuilder;
import org.codehaus.mojo.animal_sniffer.SignatureChecker;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Iterator;
import java.util.Set;
import java.util.Vector;
/**
* Checks the files against the provided signature.
*
* @author connollys
* @since 1.3
*/
public class CheckSignatureTask
extends Task
{
private File signature;
private Path classpath;
private Vector paths = new Vector();
private Vector ignores = new Vector();
public void addPath( Path path )
{
paths.add( path );
}
public Ignore createIgnore( )
{
final Ignore result = new Ignore();
ignores.add( result );
return result;
}
public void setSignature( File signature )
{
this.signature = signature;
}
public Path createClasspath()
{
log( "In createClasspath", Project.MSG_INFO );
if ( this.classpath == null )
{
this.classpath = new Path( getProject() );
}
return this.classpath.createPath();
}
public void setClasspath( Path classpath )
{
log( "In setClasspath", Project.MSG_INFO );
if ( this.classpath == null )
{
this.classpath = classpath;
}
else
{
this.classpath.append( classpath );
}
}
public void setClasspathRef( Reference r )
{
log( "In setClasspathRef", Project.MSG_INFO );
createClasspath().setRefid( r );
}
public void execute()
throws BuildException
{
validate();
try
{
log( "Checking unresolved references to " + signature, Project.MSG_INFO );
if ( !signature.isFile() )
{
throw new BuildException( "Could not find signature: " + signature );
}
final Set ignoredPackages = buildPackageList();
Iterator i = ignores.iterator();
while ( i.hasNext() )
{
Ignore ignore = (Ignore) i.next();
if (ignore == null|| ignore.getClassName()== null) continue;
ignoredPackages.add( ignore.getClassName().replace( '.', '/' ) );
}
final SignatureChecker signatureChecker =
new SignatureChecker( new FileInputStream( signature ), ignoredPackages, new AntLogger( this ) );
i = paths.iterator();
while ( i.hasNext() )
{
Path path = (Path) i.next();
final String[] files = path.list();
for ( int j = 0; j < files.length; j++ )
{
signatureChecker.process( new File( files[j] ) );
}
}
if ( signatureChecker.isSignatureBroken() )
{
throw new BuildException( "Signature errors found. Verify them and put @IgnoreJRERequirement on them.",
getLocation() );
}
}
catch ( IOException e )
{
throw new BuildException( "Failed to check signatures", e );
}
}
protected void validate()
{
if ( signature == null )
{
throw new BuildException( "signature not set" );
}
if ( paths.size() < 1 )
{
throw new BuildException( "path not set" );
}
}
/**
* List of packages defined in the application.
*/
private Set buildPackageList()
throws IOException
{
ClassListBuilder plb = new ClassListBuilder( new AntLogger( this ) );
apply( plb );
return plb.getPackages();
}
private void apply( ClassFileVisitor v )
throws IOException
{
Iterator i = paths.iterator();
while ( i.hasNext() )
{
Path path = (Path) i.next();
final String[] files = path.list();
for ( int j = 0; j < files.length; j++ )
{
log( "Ignoring the signatures from file to be checked: " + files[j], Project.MSG_INFO );
v.process( new File( files[j] ) );
}
}
if ( classpath != null )
{
i = classpath.iterator();
while ( i.hasNext() )
{
Object next = i.next();
if ( next instanceof FileResource )
{
final File file = ( (FileResource) next ).getFile();
log( "Ignoring the signatures from classpath: " + file, Project.MSG_INFO );
v.process( file );
}
}
}
}
} Ignore.java 0000664 0000000 0000000 00000004056 11633734772 0034624 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant package org.codehaus.mojo.animal_sniffer.ant;
/*
* The MIT License
*
* Copyright (c) 2009, codehaus.org.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*
*/
/**
* Created by IntelliJ IDEA.
*
* @author Stephen Connolly
* @since 07-Sep-2009 16:55:55
*/
public class Ignore
{
private String className;
public String getClassName()
{
return className;
}
public void setClassName( String className )
{
this.className = className;
}
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( !( o instanceof Ignore ) )
{
return false;
}
Ignore ignore = (Ignore) o;
if ( className != null ? !className.equals( ignore.className ) : ignore.className != null )
{
return false;
}
return true;
}
public int hashCode()
{
return 0;
}
public String toString()
{
return "Ignore{" + "className='" + className + '\'' + '}';
}
}
Signature.java 0000664 0000000 0000000 00000003274 11633734772 0035343 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/java/org/codehaus/mojo/animal_sniffer/ant package org.codehaus.mojo.animal_sniffer.ant;
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you 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.
*/
import java.io.File;
/**
* Created by IntelliJ IDEA.
*
* @author Stephen Connolly
* @since 07-Sep-2009 19:58:20
*/
public class Signature
{
private File src;
public File getSrc()
{
return src;
}
public void setSrc( File src )
{
this.src = src;
}
public boolean equals( Object o )
{
if ( this == o )
{
return true;
}
if ( !( o instanceof Signature ) )
{
return false;
}
Signature signature = (Signature) o;
if ( src != null ? !src.equals( signature.src ) : signature.src != null )
{
return false;
}
return true;
}
public int hashCode()
{
return src != null ? src.hashCode() : 0;
}
public String toString()
{
return "Signature{" + "src=" + src + '}';
}
}
animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/ 0000775 0000000 0000000 00000000000 11633734772 0024614 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/org/ 0000775 0000000 0000000 00000000000 11633734772 0025403 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/org/codehaus/ 0000775 0000000 0000000 00000000000 11633734772 0027176 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/org/codehaus/mojo/ 0000775 0000000 0000000 00000000000 11633734772 0030142 5 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/org/codehaus/mojo/animal_sniffer/ 0000775 0000000 0000000 00000000000 11633734772 0033117 5 ustar 00root root 0000000 0000000 antlib.xml 0000664 0000000 0000000 00000002550 11633734772 0035035 0 ustar 00root root 0000000 0000000 animal-sniffer-1.7/animal-sniffer-ant-tasks/src/main/resources/org/codehaus/mojo/animal_sniffer