Commit Graph

53 Commits

Author SHA1 Message Date
Eric Anderson 5f8958f65c Use Javadoc's -linkoffline instead of -link
`-link` does I/O to download the package list, for every javadoc
invocation. There is no caching, so this happens many times per build.
Swap to offline mode to avoid spamming the servers, and avoid build
failures if the servers aren't entirely healthy.
2024-02-23 17:22:48 -08:00
Eric Anderson e65b4eb5a2 all: Add grpc-inprocess
This should have been added when inprocess was moved out of core. This
includes inprocess in the Javadoc and code coverage reporting.
2023-11-25 08:01:18 -08:00
Larry Safran f90656293f
Mark MultiChildLoadBalancer as Internal. (#10481)
* Mark MultiChildLoadBalancer as Internal.  Cannot move to the internal package because of its use of classes in the util package.

* Exclude MultiChildLoadBalancer from javadoc generation.

* Fix javadoc creation.
2023-08-15 17:33:23 -07:00
Eric Anderson b67a29af3b all: Copy mustRunAfter from each project's JacocoTestReport
While JacocoReportBase.getExecutionData() is properly annotated with
`@InputFiles` and is a FileCollection, which can propagate dependencies,
the JacocoPlugin's configuration of the task [goes through a
File][barefile], which doesn't propagate task dependency information.
This is overcome in the plugin by mustRunAfter. This may have been on
purpose to allow jacocoTestReport to report on the subset of tests
already run, but is atypical these days.

Because of that, we need to copy the mustRunAfter from the other
JacocoTestReports. The dependsOn weren't doing anything because there
were no dependsOn; that configuration is quite old so it's hard to say
when they stopped functioning.

This fixes warnings like:
```
  - Gradle detected a problem with the following location: 'grpc-java/core/build/jacoco/test.exec'. Reason: Task ':grpc-all:jacocoTestReport' uses this output of task ':grpc-core:test' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.6/userguide/validation_problems.html#implicit_dependency for more details about this problem.
  - Gradle detected a problem with the following location: 'grpc-java/testing/build/resources/main'. Reason: Task ':grpc-all:jacocoTestReport' uses this output of task ':grpc-testing:processResources' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed. Please refer to https://docs.gradle.org/7.6/userguide/validation_problems.html#implicit_dependency for more details about this problem.
```

I was able to trigger the warnings by:
```
./gradlew clean
./gradlew :grpc-core:test
./gradlew :grpc-all:jacocoTestReport
./gradlew :grpc-core:test :grpc-all:jacocoTestReport
```

[barefile]: bc4029063c/subprojects/jacoco/src/main/java/org/gradle/testing/jacoco/tasks/JacocoReportBase.java (L162-L168)
2023-08-02 10:41:28 -07:00
Eric Anderson e8f36fa522 all: Remove grpc-context from grpc-all
grpc-context is empty, so isn't needed. Including it also causes the
warning:
```
> Task :grpc-all:javadoc
Resolution of the configuration :grpc-context:compileClasspath was attempted from a context different than the project context. Have a look at the documentation to understand why this is a problem and how it can be resolved. This behaviour has been deprecated and is scheduled to be removed in Gradle 8.0. See https://docs.gradle.org/7.6/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors for more details.
```
2023-07-18 11:20:18 -07:00
Eric Anderson 8dbc88f3a3
gradle: Improve compatibility with Gradle 8 2023-05-08 10:46:10 -07:00
Eric Anderson 1551cc7403 Upgrade Protobuf Java to 3.22.3 (aka 22.3)
The version used by protoc-gen-grpc-java will be upgraded separately,
because of large C++ build changes necessary. But that won't impact
users at all. We are upgrading to protoc 22.3; only the grpc plugin is
not upgraded.

Bazel is upgraded for both Java and C++.
2023-04-17 13:16:20 -07:00
Colin Alworth 706646f8bb
servlet: Implement gRPC server as a Servlet (#8596)
Full end to end implementation of gRPC server as a Servlet including tests and examples

Co-authored-by: Penn (Dapeng) Zhang <zdapeng@google.com>
Co-authored-by: Chengyuan Zhang <chengyuanzhang@google.com>
2023-01-20 13:17:58 -08:00
Eric Anderson 0ff9f37b9e Use Gradle's task configuration avoidance APIs
This can avoid creating an additional 736 tasks (previously 502 out of
1591 were not created). That's not all that important as the build time
is essentially the same, but this lets us see the poor behavior of the
protobuf plugin in our own project and increase our understanding of how
to avoid task creation when developing the plugin. Of the tasks still
being created, protobuf is the highest contributor with 165 tasks,
followed by maven-publish with 76 and appengine with 53. The remaining
59 are from our own build, but indirectly caused by maven-publish.
2022-07-08 12:16:40 -07: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
Eric Anderson 8a9aa41416 all: Only depend on evaluation of enumerated subprojects
Back in 10fb206 when this for loop was added, we didn't have the
subprojects list. That was added in 9bd7bab, but I failed to update one
reference to rootProject. So all has had an evaluation dependency on all
projects, even though it only needs a subset.

This should have little impact, but would prevent weird scenarios like
an issue in :grpc-gae-interop-testing-jdk8 preventing :all-all from
being loaded. Not to say things wouldn't still fail to load, but that
this bug could distract from the real problem. I noticed this
during #8049.
2021-04-19 14:18:54 -07:00
Eric Anderson 31cfb6d32e
all: JacocoMerge must run after grpc-interop-testing's tests (#8093)
Otherwise the executionData would be out-of-date.
2021-04-16 11:10:04 -07:00
ZHANG Dapeng 23bb2ebf31
all: publish grpc-rls
Making `io.grpc:grpc-rls` a maven artifact from next release.
2021-02-08 21:39:54 -08:00
Chengyuan Zhang 941ea1cc6f Remove grpc-rls from grpc-all dependencies 2020-06-11 19:06:20 +00:00
ZHANG Dapeng 7b3b9a2fdb
grpc-all: use api configuration for dependencies
Use `api` configuration instead of `implementation` for grpc-all to avoid breaking users.
2020-05-11 09:48:33 -07:00
Jihun Cho 8e8477704a
rls: generate rls coverage (#7004) 2020-05-05 10:11:33 -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 84dd812db8 all: Add more projects to the all super-project
This adds to the published JavaDoc and reported code coverage.
2020-04-02 08:57:31 -07:00
Eric Anderson fb8833c57b all: Add grpc-xds
This will fix reporting of xDS code coverage.
2020-04-01 12:39:11 -07:00
Eric Anderson 186cfebcba all: Move jacocoTestReport exclusions to individual projects
The sourceSets.main.output.collect should probably be improved at some point to
improve loading performance, but this is technically better than what we had
before so let's call it a win and move on.
2020-04-01 10:33:32 -07:00
Eric Anderson 4215b80b81 Apply java 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 3c3a823a81 Swap to Gradle's Plugin DSL for much of build
Examples and android projects were left unchanged. They can be changed
later.

No plugin versions were changed, to make this as non-functional of a
change as possible. Upgrading Gradle to 5.6 was necessary for
pluginManagement in settings.gradle.
2019-09-13 09:42:17 -07:00
Eric Anderson 26bd76fa76
Upgrade to Gradle 5 2019-06-07 08:40:53 -07:00
Eric Anderson 50b08eee3b
Delete protobuf-nano
Nano was dropped from upstream protobuf. See gRFC L51
2019-05-22 08:49:07 -07:00
Eric Anderson 80c3c992a6 core: Move io.grpc to grpc-api
io.grpc has fewer dependencies than io.grpc.internal. Moving it to a
separate artifact lets users use the API without bringing in the deps.
If the library has an optional dependency on grpc, that can be quite
convenient.

We now version-pin both grpc-api and grpc-core, since both contain
internal APIs.

I had to change a few tests in grpc-api to avoid FakeClock. Moving
FakeClock to grpc-api was difficult because it uses
io.grpc.internal.TimeProvider, which can't be moved since it is a
production class. Having grpc-api's tests depend on grpc-core's test
classes would be weird and cause a circular dependincy. Having
grpc-api's tests depend on grpc-core is likely possible, but weird and
fairly unnecessary at this point. So instead I rewrote the tests to
avoid FakeClock.

Fixes #1447
2019-04-16 21:45:40 -07:00
ZHANG Dapeng 4d80886231
all: exclude internal/testing package from jacoco coverage report 2018-11-21 15:03:13 -08:00
ZHANG Dapeng 5ce10f0146
all: add gradle format checker
This PR adds an automatic gradle format checker and reformats all the *.gradle files. After this, new changes to *.gradle files will fail to build if not in good format, just like checkStyle failure.
2018-06-11 18:35:18 -07:00
zpencer 066ad3ceac
buildscripts,travis: fetch from mvn with retries (#4140)
A band aid for #3284, to make its symptoms less noticeable.
2018-03-01 19:11:24 -08:00
ZHANG Dapeng 6c6538648b
testing: add testing package to javadoc 2017-11-22 16:10:25 -08:00
ZHANG Dapeng 7c97aa95a1 thrift: Delete thrift
Thrift support is moved to https://github.com/grpc-ecosystem/grift
2017-09-28 09:31:32 -07:00
Eric Anderson 8f75f8ee7c all: Don't depend directly on grpc-protobuf-lite
grpc-protobuf-lite brings in protobuf-lite as a dependency, which has
different versions of classes in protobuf. This causes duplicate classes
on the class path, which easily breaks things. Since lite the lite
runtime/codegen is incompatible with full protobuf, it makes sense to
only depend on one of the two.

grpc-protobuf actually already has a dependency on grpc-protobuf-lite,
but excludes the protobuf-lite dependency, making the dep safe. But this
is more of an implementation detail.

We only change deps so that JavaDoc, code coverage, and similar will
still include grpc-protobuf-lite.

Fixes #2985
2017-06-29 10:29:11 -07:00
Eric Anderson cb53bbf0be all: Filter out Internal* classes from Javadoc
core's sources already have filters applied, so it isn't necessary to
copy them to all.
2017-06-16 14:53:51 -07:00
Carl Mastrangelo 50a4278671 all: drop thrift from grpc-all deps 2017-02-07 08:08:48 -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
Naveen Reddy Chedeti 2860959d5f Support Thrift Messages 2016-07-28 08:48:27 -07:00
Eric Anderson f56fdf0441 Stop producing a fat grpc-all jar
grpc-all contains a copy of all the classes and sources of "important"
artifacts. The copy causes problems when grpc-all is mixed with the
individual artifacts like grpc-netty or grpc-core, since they will
collide on the classpath. Avoiding the copy fixes the problem.

See #1597
2016-04-28 16:23:39 -07:00
Eric Anderson 996f30f43d Include protobuf-lite in javadoc and test coverage reporting 2016-04-06 15:28:26 -07:00
Eric Anderson d77314ae68 Include sources for all files in 'fat' binary jar
Fixes #1420
2016-03-25 14:37:07 -07:00
Eric Anderson 6715f1202c Add support for codecov.io
Codecov.io provides patch-based code coverage, so you can easily know
how many of the added lines are covered. It also has a more useful UI.

Unfortunately, the percentage it reports does not include partially-
covered lines--those with uncovered conditions. Thus the reported
percentage is about 6% lower than the coverage we've been looking at
previously. Because of this alone, I don't expect to remove coveralls
support soon.

Use the bash script instead of python module since pip isn't available
by default on Travis OS X.

jacocoTestReport uses mustRunAfter (contrary to the docs; see
https://issues.gradle.org/browse/GRADLE-2960) to make sure it runs after
all tests, only if testing is taking place. We would like
:grpc-all:jacocoTestReport to behave the same way. Without it, we would
need two separate invocations of gradle (adding ~1m to Travis run) in
order to prevent getting random results depending on what tests just so
happened to have been run.
2016-02-17 12:24:17 -08:00
Xudong Ma b121c46b42 Reduce OkHttp dependency, copy all the needed files into our repository. 2015-10-15 16:35:08 -07:00
Kun Zhang 687a6f4814 Skip io.grpc.internal in javadoc.
Also move ExperimentalApi and Internal to io.grpc, so that they appear
in javadoc.
2015-08-20 08:48:44 -07:00
Eric Anderson 522580dd0e Add coveralls support 2015-08-11 11:26:21 -07:00
Eric Anderson 9bd7baba56 Produce cleaner JavaDoc and Jacoco output
Instead of producing output for all projects, just do it for projects
that matter to our users.
2015-08-07 17:23:08 -07:00
Eric Anderson 041cdb11ed Add Jacoco code coverage
After running tests, you can run jacocoTestReport. The jacocoTestReport
task does not depend on the tests, so they should be run separately.

There is still a lot of noise in the jacoco output since we aren't yet
filtering generated code.
2015-05-05 14:36:00 -07:00
Eric Anderson 10fb20650d Produce combined JavaDoc, add links, exclude internals 2015-05-05 11:32:15 -07:00
Eric Anderson 844d207823 Add missing projects to grpc-all
Protobuf was recently moved into its own project and should have been
added to grpc-all at that time. Nano has always been absent.
2015-04-13 08:54:01 -07:00
nmittler f83145865a Removing all references to "stubby" 2015-01-27 11:25:25 -08:00
nmittler 19052499f7 Removing Maven build 2015-01-27 08:57:37 -08:00
nathanmittler 164b734aa9 Adding gradle build for Java grpc
-------------
Created by MOE: http://code.google.com/p/moe-java
MOE_MIGRATED_REVID=82152044
2015-01-08 14:43:21 -08:00