all: generate automatic module name in the manifest (#10413)

This commit is contained in:
sanjaypujare 2023-07-25 09:00:11 -07:00 committed by GitHub
parent 08a44b9224
commit 41552bfd9a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 130 additions and 0 deletions

View File

@ -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

View File

@ -21,6 +21,11 @@ compileContextJava {
targetCompatibility = 1.7
}
tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc')
}
}
dependencies {
compileOnly sourceSets.context.output

View File

@ -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

View File

@ -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'),

View File

@ -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

View File

@ -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 = [

View File

@ -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')

View File

@ -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'),

View File

@ -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'),

View File

@ -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')

View File

@ -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

View File

@ -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 {

View File

@ -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,

View File

@ -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"

View File

@ -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,

View File

@ -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'),

View File

@ -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'),

View File

@ -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',

View File

@ -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',

View File

@ -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

View File

@ -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')

View File

@ -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')

View File

@ -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 {