Commit Graph

22 Commits

Author SHA1 Message Date
sanjaypujare 4d2c3aac0e
context, all: move Context classes to grpc-api (#10313)
* context, all: move Context classes to grpc-api
clean up grpc-context since it has no source code: only add dep on grpc-api
add exclusion for all transitive deps of grpc-api - only guava
exclude grpc-context as a dependency from grpc-alts because all context code is in grpc-api now
api: 1.7 as target Java version for Context source-set of grpc-api

* core, census: fix the issues with android project pulling in old grpc-context version


* api,context: make changes to bazel build files to account for context code moving from context to api
2023-06-28 18:28:30 -07:00
Eric Anderson f46793e82d Remove unneeded dependency excludes
Since 44847bf4e, when we upgraded our JUnit version, the JUnit
exclusions have probably not been necessary. e0ac97c4f upgraded
Robolectric to a version that had the auto.service problem fixed.
2023-06-23 11:18:10 -07:00
Eric Anderson 29b8483fd6
Use test fixtures instead of sourceSets.test.output
This avoids the (often missing) evaluationDependsOn and fixes using
results from other projects without propagating those through
Configuration. It also reduces the number of useless classes pulled in
by down-stream tests, reducing the probability of rebuilds.

The expectation of fixtures is they help testing down-stream code that
use the classes in main. That applies to all the classes here except for
FakeClock and StaticTestingClassLoader. It would also apply to many
internal classes in grpc-testing, but let's consider cleaning that up
future work.
2023-05-16 12:10:13 -07:00
Eric Anderson a8a81e709d
Bump Google Auth, Guava, Auto Value
The Google Auth version is getting quite old. The new version pulls in
newer Guava and Auto Value. Two require Java 8: Google Auth since 1.x,
Guava since 31.x. Google Auth only needs Auto Value 1.8.2, but this
bumps to the latest, so all three are at their latest versions.
2022-02-16 15:47:24 -08:00
Penn (Dapeng) Zhang cf4cd65707 Revert "all: clean up code related to android api level less than 19"
This reverts commit 3ad4d9bfb7.
2022-01-18 10:14:50 -08:00
Eric Anderson 7cf048eb28
Drop Java 7 support
Oracle's Premier Support for Java 7 ended in July 2019. Per gRFC P5,
dropping support for the only release. Android is able to desugar many
Java 8 language features.
2022-01-18 07:17:51 -08:00
Eric Anderson d44de5069d
Bump to Gradle 6.9 and update plugins
These changes make the build compatible with Gradle 7, except for
Android which requires plugin updates.

I removed animalsniffer from binder because it did nothing (as there
were no signatures) and it was failing after setting toolVersion. It
failed because animalsniffer is only compatible with java plugin. After
this change I put the withId(animalsniffer) loading inside the
withId(java) to avoid a plugin ordering failure. That made it safe again
for binder to load animalsniffer, but it is still best to remove the
plugin from binder as it is misleading.

I did not upgrade Android plugin versions as newer versions (even 3.6)
require dealing with androidx (#8421).
2022-01-07 09:54:50 -08:00
ZHANG Dapeng 3ad4d9bfb7
all: clean up code related to android api level less than 19 2022-01-07 08:13:32 -08:00
Elliotte Rusty Harold 417d7700dd
deps: Update guava to 29.0 (#7079) 2020-06-03 13:48:02 -07:00
ZHANG Dapeng 0044f8ce56
all: migrate gradle build to java-library plugin
- Use gradle configuration `api` for dependencies that are part of grpc public api signatures.
- Replace deprecated gradle configurations `compile`, `testCompile`, `runtime` and `testRuntime`.
- With minimal change in dependencies: If we need dep X and Y to compile our code, and if X transitively depends on Y, then our build would still pass even if we only include X as `compile`/`implementation` dependency for our project. Ideally we should include both X and Y explicitly as `implementation` dependency for our project, but in this PR we don't add the missing Y if it is previously missing.
2020-05-04 16:44:30 -07:00
Eric Anderson 2b945774b6 Apply animalsniffer plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 4215b80b81 Apply java plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson e13221b503 Apply japicmp plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 5b838e5284 Apply maven-publish plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Eric Anderson 55ac6f08af Apply JMH plugin explicitly when needed 2019-09-13 09:42:17 -07:00
Aaditya Gavandalkar 39dc883b34 context: Implement equals and hashCode for Deadline (grpc#6075) 2019-08-30 08:25:07 -07:00
Eric Gribkoff 79b24709b9
all: update animalsniffer to Java 7 and add Android 14 (#4727) 2018-08-09 09:09:21 -07:00
Eric Anderson 2bde25d2d9 testing: Remove DeadlineSubject
The class is still used internally, so we move it to context's tests for
it to be reused. To avoid a circular dependency with context's tests
depending on core's tests, StaticTestingClassLoader was also moved to
context's tests.

This is driven by a need to modernize DeadlineSubject for newer versions
of Truth, but the newer versions of Truth update Guava. To avoid leaking
the Guava update to all users of grpc-testing, we're removing the
Subject. In our internal tests we can update the Truth dependency with
less issue.
2017-11-22 17:57:46 -08:00
ZHANG Dapeng db279eb3c1 context: add test for the scenario that Context's logger itself is using Context
This will break if
7f1ac34d41,
2f6e2c87ab,
a3a5420922
are reverted:

```
io.grpc.ContextTest > initContextWithCustomClassLoaderWithCustomLogger FAILED
    java.lang.ExceptionInInitializerError
        at io.grpc.ContextTest$LoadMeWithStaticTestingClassLoader.run(ContextTest.java:789)
        at io.grpc.ContextTest.initContextWithCustomClassLoaderWithCustomLogger(ContextTest.java:760)

        Caused by:
        java.lang.RuntimeException: Storage override had failed to initialize
            at io.grpc.Context.storage(Context.java:134)
            at io.grpc.Context.current(Context.java:163)
            at io.grpc.ContextTest$LoadMeWithStaticTestingClassLoader$1.publish(ContextTest.java:773)
            at java.util.logging.Logger.log(Logger.java:738)
            at java.util.logging.Logger.doLog(Logger.java:765)
            at java.util.logging.Logger.log(Logger.java:875)
            at io.grpc.Context.<clinit>(Context.java:122)
            ... 2 more
```
2017-07-21 15:20:02 -07:00
Eric Anderson c436561fc5 all: Use fixed version number for java 6/7 signatures
This is important for stable builds, as if the signature changes the old source
may no longer validate.
2017-06-30 15:25:34 -07:00
Eric Anderson 42aa64c647 all: swap to newer animalsniffer plugin
The new plugin uses a newer version of animalsniffer, allows overriding
the animalsniffer version used, and has up-to-date handling. The
up-to-date handling cuts fully incremental parallel build times in half,
from 5.5s to 2.7s.

The previous plugin was supposed to be verifying tests. However, either
it wasn't verifying them or its verification was broken.
2017-02-07 12:49:01 -08:00
Kun Zhang c4f7f5c4fd core: split Context into a separate grpc-context artifact.
The Context API is not particularly gRPC-specific, and will be used by
Census as its context propagation mechanism.

Removed all dependencies to make it easy for other libraries to depend
on.
2016-09-02 13:18:35 -07:00