Skip to content

Commit

Permalink
Merge pull request #1240 from google/sync-master-2019/04/07
Browse files Browse the repository at this point in the history
Moe Sync
  • Loading branch information
sameb authored Apr 9, 2019
2 parents dafa4b0 + 7e7ac3e commit 6fd2442
Show file tree
Hide file tree
Showing 51 changed files with 714 additions and 1,351 deletions.
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,14 @@ jdk:
- oraclejdk11
- oraclejdk9
- oraclejdk8
- openjdk7

env:
global:
- secure: "WuvBM11o29dIluXelJpV1TFPqprFOlLEs6ES4LjvNKrtB/FT9g569Q63jnbg43ufs4fhQZKuqc3ue1KwZiWWozmkRTry8+2KimiCC0QRFc2UfWPy5BBlPepWahnkC5/CSnjQWtTVKzs67DobyCmAsU3mraOidQatXSpoOozGnNA="
- secure: "pAeI941ODNSo6F7A94WFafxYqp2kdeFTJksMLVHljT0h2nX6/236OXn/iZXiB+FbXe/DkQIHN3n1IZRwE8UJAbSAwoaPUWenPy4mNAhnI4L/rwysREwq5FKSFTWJet9HitfFR57ezLGOV0VLFfH1xGsNWabHzzbwbV3WMl9pH0M="
- secure: "Pqj194YmdK0va4bOkbjVG0wCZ7sbB5k3Qq66zSG2M26M21uHonwhXprdtSeYZ5Oy9fWcQte7jSA69euyYyLriDH6DU2NE34scK2Y1yO6SCfx5SGr3XuxHWqxtNOxoUaH4RP1WR/9CRkBg8kBxzWus3M2ZeqElu33/p2CtgJEdJg="
matrix:
- LABEL=ant CMD="ant dist test.dist" INSTALL="/bin/true"
- LABEL=ant_no_aop CMD="ant -f build/no_aop/build.xml dist test.dist" INSTALL="ant no_aop"
- LABEL=docs CMD="ant javadoc jdiff" INSTALL="/bin/true"
- LABEL=mvn CMD="mvn -B -P!standard-with-extra-repos verify --fail-at-end -Dsource.skip=true -Dmaven.javadoc.skip=true" INSTALL="mvn -P!standard-with-extra-repos dependency:go-offline test clean --quiet --fail-never -DskipTests=true"

install:
Expand All @@ -29,7 +27,6 @@ script:

after_success:
- util/generate-latest-docs.sh
- util/compareBuilds.sh
- util/publish-snapshot-on-commit.sh

branches:
Expand Down
164 changes: 0 additions & 164 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,125 +17,6 @@
<pathelement location="${build.dir}/classes"/>
</path>


<target name="jar" depends="jar.withdeps, manifest" description="Build jar.">
<jar jarfile="${build.dir}/dist/guice-${version}.jar"
manifest="${build.dir}/META-INF/MANIFEST.MF">
<zipfileset src="${build.dir}/${ant.project.name}-with-deps.jar"/>
</jar>
</target>

<target name="dist" depends="distjars, javadoc"
description="Build entire distribution.">
<ant antfile="extensions/servlet/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/spring/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/struts2/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/assistedinject/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/jmx/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/jndi/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/throwingproviders/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/dagger-adapter/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/persist/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/grapher/build.xml" target="distjars" inheritAll="false"/>
<ant antfile="extensions/testlib/build.xml" target="distjars" inheritAll="false"/>

<copy toDir="${build.dir}/dist">
<fileset dir="extensions/servlet/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/spring/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/struts2/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/assistedinject/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/jmx/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/jndi/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/throwingproviders/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/dagger-adapter/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/persist/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/grapher/build" includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="extensions/testlib/build" includes="*.jar"/>
</copy>

<copy toDir="${build.dir}/dist" file="COPYING"/>
<copy toDir="${build.dir}/dist">
<fileset dir="${lib.dir}"
includes="*.jar"/>
</copy>
<copy toDir="${build.dir}/dist">
<fileset dir="${build.dir}" includes="javadoc/**/*"/>
</copy>

<zip destfile="${build.dir}/guice-${version}.zip">
<zipfileset dir="${build.dir}/dist" prefix="guice-${version}" excludes="*-src.jar"/>
</zip>
<zip destfile="${build.dir}/guice-${version}-src.zip">
<zipfileset dir="." prefix="guice-${version}-src"
excludes="build/**,**/.svn/**,classes/**,.settings/**,bin/**,latest-api-diffs/**,latest-javadoc/**,.classpath,.project"/>
</zip>
</target>

<target name="test.dist"
description="Execute JUnit tests against distribution jar.">
<antcall target="test.dist.run">
<param name="jvmarg-value" value="-Dguice_include_stack_traces="/>
</antcall>
<antcall target="test.dist.run">
<param name="jvmarg-value" value="-Dguice_include_stack_traces=OFF"/>
</antcall>
<antcall target="test.dist.run">
<param name="jvmarg-value" value="-Dguice_include_stack_traces=COMPLETE"/>
</antcall>
</target>

<target name="test.dist.run"
depends="jar, test.withdeps"
description="Execute JUnit tests against distribution jar with the given jvmarg.">
<java fork="true"
classname="junit.textui.TestRunner"
failonerror="true"
taskname="junit">
<classpath>
<pathelement location="${build.dir}/guice-${version}-tests.jar"/>
<pathelement location="${build.dir}/dist/guice-${version}.jar"/>
<pathelement location="lib/javax.inject.jar"/>
<pathelement location="lib/aopalliance.jar"/>
<pathelement location="lib/guava-25.1-android.jar"/>
<pathelement location="lib/build/guava-testlib-25.1-android.jar"/>
<pathelement location="lib/build/junit.jar"/>
<pathelement location="lib/build/servlet-api-2.5.jar"/>
<pathelement location="lib/build/truth-0.41.jar"/>
<pathelement location="lib/build/easymock.jar"/>
<pathelement location="lib/build/javax.inject-tck.jar"/>
<pathelement location="lib/build/bnd-0.0.384.jar"/>
<pathelement location="lib/build/felix-2.0.5.jar"/>
</classpath>
<arg value="com.google.inject.AllTests"/>
<jvmarg value="${jvmarg-value}"/>
<syspropertyset>
<propertyref name="version"/>
<propertyref name="build.dir"/>
<propertyref name="lib.dir"/>
</syspropertyset>
</java>
</target>

<property name="old.api" value="4.2.2"/>
<property name="new.api" value="latest"/>
<target name="jdiff" depends="compile">
Expand Down Expand Up @@ -247,51 +128,6 @@
</javadoc>
</target>

<target name="no_aop"
description="Create a copy of the Guice source that doesn't do bytecode generation.">
<taskdef name="munge" classname="MungeTask" classpath="lib/build/munge.jar"/>
<mkdir dir="build/no_aop"/>
<munge todir="build/no_aop">
<fileset dir=".">
<!-- exclude generated files -->
<exclude name="build/**"/>
<exclude name="classes/**"/>
<exclude name="latest-api-diffs/**"/>
<exclude name="javadoc/**"/>
<exclude name="latest-javadoc/**"/>
<!-- exclude AOP-specific libraries -->
<exclude name="lib/aopalliance.jar"/>
<exclude name="lib/build/asm-*.jar"/>
<exclude name="lib/build/cglib-*.jar"/>
<!-- exclude AOP-specific classes -->
<exclude name="**/LineNumbers.java"/>
<exclude name="**/InterceptorBindingProcessor.java"/>
<exclude name="**/ProxyFactory.java"/>
<exclude name="**/ProxyFactoryTest.java"/>
<exclude name="**/InterceptorStackCallback.java"/>
<exclude name="**/InterceptorBinding.java"/>
<exclude name="**/MethodAspect.java"/>
<exclude name="**/MethodInterceptionTest.java"/>
<exclude name="**/BytecodeGenTest.java"/>
<exclude name="**/IntegrationTest.java"/>
<exclude name="**/MethodInterceptionTest.java"/>
</fileset>
<arg value="-DNO_AOP" />
</munge>
<replace file="build/no_aop/common.xml" value="">
<replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/asm-7.0.jar"/>]]></replacetoken>
</replace>
<replace file="build/no_aop/common.xml" value="">
<replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/cglib-3.2.9.jar"/>]]></replacetoken>
</replace>
<replace file="build/no_aop/common.xml" value="">
<replacetoken><![CDATA[<zipfileset src="${common.basedir}/lib/build/cglib-3.2.9.jar"><include name="LICENSE"/><include name="NOTICE"/></zipfileset>]]></replacetoken>
</replace>
<replace file="build/no_aop/common.xml" value='Bundle-Name" value="$${ant.project.name} (no_aop)'>
<replacetoken><![CDATA[Bundle-Name" value="${ant.project.name}]]></replacetoken>
</replace>
</target>

<target name="clean.all"
depends="clean"
description="Remove generated files.">
Expand Down
128 changes: 1 addition & 127 deletions common.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<javac srcdir="${src.dir}"
debug="on"
destdir="${build.dir}/classes"
source="1.7" target="1.7" includeantruntime="false">
source="1.8" target="1.8" includeantruntime="false">
<compilerarg value="-Xlint:all,-serial"/>
<classpath refid="compile.classpath"/>
</javac>
Expand All @@ -23,134 +23,8 @@
</copy>
</target>

<target name="manifest" description="Generate OSGi manifest." depends="compile">
<dirname property="common.basedir" file="${ant.file.common}"/>
<taskdef resource="aQute/bnd/ant/taskdef.properties"
classpath="${common.basedir}/lib/build/bnd-0.0.384.jar"/>

<fail unless="module" message="Missing 'module' property (use the primary package name in this jar)"/>
<property name="imports" value=""/>

<property name="Bundle-Name" value="${ant.project.name}"/>
<property name="Bundle-SymbolicName" value="${module}"/>
<property name="Bundle-Version" value="${replace;${version};^[^0-9];0.0.0.$0}"/>

<property name="Bundle-Description" value="Guice is a lightweight dependency injection framework for Java 6 and above"/>
<property name="Bundle-DocURL" value="https://github.com/google/guice"/>
<property name="Bundle-Copyright" value="Copyright (C) 2006 Google Inc."/>
<property name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
<property name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.7"/>
<property name="Bundle-Vendor" value="Google, Inc."/>

<property name="Export-Package" value="!${module}.internal.*,${module}.*;version=${api.version}"/>

<condition property="Eclipse-ExtensibleAPI" value="true">
<equals arg1="${module}" arg2="com.google.inject"/>
</condition>

<condition property="Import-Package" value="!com.google.inject.*,*" else="!${module}.*,${imports},*">
<istrue value="${fragment}"/>
</condition>

<condition property="Fragment-Host" value="com.google.inject">
<istrue value="${fragment}"/>
</condition>

<property name="-nouses" value="true"/>

<property name="-removeheaders" value="Bnd-LastModified,Ignore-Package,Include-Resource,Private-Package,Tool"/>

<bndwrap jars="${build.dir}/classes" output="${build.dir}"/>

<unjar src="${build.dir}/classes.bar" dest="${build.dir}">
<patternset>
<include name="META-INF/MANIFEST.MF"/>
</patternset>
</unjar>
</target>

<target name="test.compile"
depends="compile"
description="Compile test source.">
<mkdir dir="${build.dir}/test"/>
<javac srcdir="${test.dir}"
debug="on"
destdir="${build.dir}/test"
source="1.7" target="1.7" includeantruntime="false">
<classpath path="${build.dir}/classes"/>
<classpath path="${build.dir}/test"/>
<classpath refid="compile.classpath"/>
</javac>
<copy toDir="${build.dir}/test">
<fileset dir="${test.dir}" excludes="**/*.java"/>
</copy>
</target>

<target name="test"
depends="test.compile"
description="Execute JUnit tests.">
<java fork="true"
classname="junit.textui.TestRunner"
failonerror="true"
taskname="junit">
<classpath>
<pathelement location="${build.dir}/test"/>
<pathelement location="${build.dir}/classes"/>
<path refid="compile.classpath"/>
</classpath>
<arg value="${test.class}"/>
</java>
</target>

<target name="clean"
description="Remove generated files.">
<delete dir="${build.dir}"/>
</target>

<target name="source.jar"
description="Create a .jar file with sources">
<mkdir dir="${build.dir}"/>
<zip destfile="${build.dir}/${ant.project.name}-${version}-src.jar">
<fileset dir="${src.dir}"/>
</zip>
</target>

<target name="distjars"
depends="source.jar, jar"
description="Build jar files"/>

<target name="test.withdeps" depends="test.compile"
description="Build a jar of tests with internal.util refocused.">
<mkdir dir="${build.dir}/dist"/>
<dirname property="common.basedir" file="${ant.file.common}"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
<jarjar jarfile="${build.dir}/${ant.project.name}-${version}-tests.jar">
<fileset dir="${build.dir}/test"/>
<rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
<rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
<keep pattern="com.googlecode.**"/>
</jarjar>
</target>

<target name="jar.withdeps" depends="compile"
description="Build jar with dependencies embedded.">
<mkdir dir="${build.dir}/dist"/>
<dirname property="common.basedir" file="${ant.file.common}"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
<jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
<fileset dir="${build.dir}/classes"/>
<zipfileset src="${common.basedir}/lib/build/cglib-3.2.9.jar"/>
<zipfileset src="${common.basedir}/lib/build/asm-7.0.jar"/>
<rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
<rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
<rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
<rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
<keep pattern="com.google.inject.**"/>
</jarjar>
</target>
</project>
27 changes: 27 additions & 0 deletions core/src/com/google/inject/Injector.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@

package com.google.inject;

import com.google.common.collect.ListMultimap;
import com.google.inject.spi.Element;
import com.google.inject.spi.InjectionPoint;
import com.google.inject.spi.TypeConverterBinding;
import java.lang.annotation.Annotation;
import java.util.List;
Expand Down Expand Up @@ -269,7 +271,32 @@ public interface Injector {
* <p>The returned list does not include elements inherited from a {@link #getParent() parent
* injector}, should one exist.
*
* <p>The returned list is immutable; it contains only the elements that were present when {@link
* #getElements} was invoked. Subsequent calls may return a list with additional elements.
*
* <p>The returned list does not include data inherited from a {@link #getParent() parent
* injector}, should one exist.
*
* <p>This method is part of the Guice SPI and is intended for use by tools and extensions.
*
* @since 5.0
*/
List<Element> getElements();

/**
* Returns the injection points created for calls to {@link #getMembersInjector} (either directly
* or indirectly, e.g. through {@link #injectMembers}.
*
* <p>This excludes any injection points from elements (which are accessible from each element via
* the SPI), unless {@link #getMembersInjector} or {@link #injectMembers} were also called for the
* same key.
*
* <p>The returned multimap does not include data inherited from a {@link #getParent() parent
* injector}, should one exist.
*
* <p>This method is part of the Guice SPI and is intended for use by tools and extensions.
*
* @since 5.0
*/
ListMultimap<TypeLiteral<?>, InjectionPoint> getAllMembersInjectorInjectionPoints();
}
Loading

0 comments on commit 6fd2442

Please sign in to comment.