Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: generate automatic module name in the manifest #10413

Merged
merged 2 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions alts/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,9 @@ tasks.named("javadoc").configure {
tasks.named("jar").configure {
// Must use a different archiveClassifier to avoid conflicting with shadowJar
archiveClassifier = 'original'
manifest {
attributes('Automatic-Module-Name': 'io.grpc.alts')
}
}

// We want to use grpc-netty-shaded instead of grpc-netty. But we also want our
Expand Down
5 changes: 5 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ compileContextJava {
targetCompatibility = 1.7
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc')
}
}

dependencies {
compileOnly sourceSets.context.output
Expand Down
7 changes: 7 additions & 0 deletions auth/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ plugins {
}

description = "gRPC: Auth"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.auth')
}
}

dependencies {
api project(':grpc-api'),
libraries.google.auth.credentials
Expand Down
6 changes: 6 additions & 0 deletions benchmarks/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ configurations {
alpnagent
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.benchmarks')
}
}

dependencies {
implementation project(':grpc-core'),
project(':grpc-netty'),
Expand Down
6 changes: 6 additions & 0 deletions census/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ plugins {

description = 'gRPC: Census'

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.census')
}
}

dependencies {
api project(':grpc-api')
// force dependent jars to depend on latest grpc-context
Expand Down
6 changes: 6 additions & 0 deletions core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ tasks.named("javadoc").configure {
exclude 'io/grpc/perfmark/**'
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.internal')
}
}

animalsniffer {
// Don't check sourceSets.jmh
sourceSets = [
Expand Down
6 changes: 6 additions & 0 deletions gcp-observability/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ tasks.named("compileJava").configure {
"|")
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.gcp.observability')
}
}

dependencies {
annotationProcessor libraries.auto.value
api project(':grpc-api')
Expand Down
6 changes: 6 additions & 0 deletions googleapis/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ plugins {

description = 'gRPC: googleapis'

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.googleapis')
}
}

dependencies {
api project(':grpc-api')
implementation project(path: ':grpc-alts', configuration: 'shadow'),
Expand Down
6 changes: 6 additions & 0 deletions grpclb/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ plugins {

description = "gRPC: GRPCLB LoadBalancer plugin"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.grpclb')
}
}

dependencies {
implementation project(':grpc-core'),
project(':grpc-protobuf'),
Expand Down
6 changes: 6 additions & 0 deletions inprocess/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ plugins {

description = 'gRPC: Inprocess'

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.inprocess')
}
}

dependencies {
api project(':grpc-core')

Expand Down
6 changes: 6 additions & 0 deletions netty/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ configurations {
alpnagent
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.netty')
}
}

dependencies {
api project(':grpc-core'),
libraries.netty.codec.http2
Expand Down
3 changes: 3 additions & 0 deletions netty/shaded/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ dependencies {
tasks.named("jar").configure {
// Must use a different archiveClassifier to avoid conflicting with shadowJar
archiveClassifier = 'original'
manifest {
attributes('Automatic-Module-Name': 'io.grpc.netty.shaded')
}
}

tasks.named("shadowJar").configure {
Expand Down
6 changes: 6 additions & 0 deletions okhttp/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins {

description = "gRPC: OkHttp"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.okhttp')
}
}

dependencies {
api project(':grpc-util')
implementation libraries.okio,
Expand Down
6 changes: 6 additions & 0 deletions protobuf-lite/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ dependencies {
signature libraries.signature.android
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.protobuf.lite')
}
}

tasks.named("compileTestJava").configure {
options.compilerArgs += [
"-Xlint:-cast"
Expand Down
6 changes: 6 additions & 0 deletions protobuf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ plugins {

description = 'gRPC: Protobuf'

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.protobuf')
}
}

dependencies {
api project(':grpc-api'),
libraries.jsr305,
Expand Down
6 changes: 6 additions & 0 deletions rls/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins {

description = "gRPC: RouteLookupService Loadbalancing plugin"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.rls')
}
}

dependencies {
implementation project(':grpc-util'),
project(':grpc-protobuf'),
Expand Down
6 changes: 6 additions & 0 deletions services/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ tasks.named("compileJava").configure {
]
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.services')
}
}

dependencies {
api project(':grpc-protobuf'),
project(':grpc-stub'),
Expand Down
6 changes: 6 additions & 0 deletions servlet/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ sourceSets {
}
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.servlet')
}
}

dependencies {
api project(':grpc-api')
compileOnly 'javax.servlet:javax.servlet-api:4.0.1',
Expand Down
6 changes: 6 additions & 0 deletions servlet/jakarta/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ tasks.withType(Checkstyle) {
enabled = false
}

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.servlet.jakarta')
}
}

dependencies {
api project(':grpc-api')
compileOnly 'jakarta.servlet:jakarta.servlet-api:5.0.0',
Expand Down
7 changes: 7 additions & 0 deletions stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ plugins {
}

description = "gRPC: Stub"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.stub')
}
}

dependencies {
api project(':grpc-api'),
libraries.guava
Expand Down
6 changes: 6 additions & 0 deletions testing-proto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins {

description = "gRPC: Testing Protos"

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.testing.protobuf')
}
}

dependencies {
api project(':grpc-protobuf'),
project(':grpc-stub')
Expand Down
6 changes: 6 additions & 0 deletions util/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ plugins {

description = 'gRPC: Util'

tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.util')
}
}

dependencies {
api project(':grpc-core')

Expand Down
3 changes: 3 additions & 0 deletions xds/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@ tasks.named("compileJava").configure {

tasks.named("jar").configure {
archiveClassifier = 'original'
manifest {
attributes('Automatic-Module-Name': 'io.grpc.xds')
}
}

tasks.named("sourcesJar").configure {
Expand Down