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 1 commit
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
6 changes: 6 additions & 0 deletions api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ compileContextJava {
targetCompatibility = 1.7
}

// override default module name assigned
tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc')
}
}

dependencies {
compileOnly sourceSets.context.output
Expand Down
3 changes: 2 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ subprojects {
tasks.named("jar").configure {
manifest {
attributes('Implementation-Title': name,
'Implementation-Version': project.version)
'Implementation-Version': project.version,
'Automatic-Module-Name': 'io.grpc.' + project.name.substring(5)) // default name inferred from artifact
sanjaypujare marked this conversation as resolved.
Show resolved Hide resolved
}
}

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
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 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
7 changes: 7 additions & 0 deletions testing-proto/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ plugins {

description = "gRPC: Testing Protos"

// override default module name assigned
tasks.named("jar").configure {
manifest {
attributes('Automatic-Module-Name': 'io.grpc.testing.protobuf')
}
}

dependencies {
api project(':grpc-protobuf'),
project(':grpc-stub')
Expand Down