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

Include native-image.properties in Netty shaded #7657

Closed
wants to merge 2 commits into from
Closed
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: 0 additions & 3 deletions api/src/main/java/io/grpc/ServiceProviders.java
Expand Up @@ -25,9 +25,6 @@
import java.util.ServiceLoader;

final class ServiceProviders {
private ServiceProviders() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

// do not instantiate
}

/**
* If this is not Android, returns the highest priority implementation of the class via
Expand Down
9 changes: 0 additions & 9 deletions build.gradle
Expand Up @@ -275,15 +275,6 @@ subprojects {
}
}

// For jdk10 we must explicitly choose between html4 and html5, otherwise we get a warning
if (JavaVersion.current().isJava10Compatible()) {
allprojects {
tasks.withType(Javadoc) {
options.addBooleanOption('html4', true)
}
}
}

jacoco { toolVersion = "0.8.2" }

checkstyle {
Expand Down
12 changes: 12 additions & 0 deletions netty/shaded/build.gradle
Expand Up @@ -26,6 +26,18 @@ jar {
classifier = 'original'
}

task readFile(){
doLast{
File file = file('native-image.properties')
println file.text
println ""
file.readLines().each{
println it
}

}
}

shadowJar {
classifier = null
dependencies {
Expand Down
16 changes: 16 additions & 0 deletions netty/shaded/native-image.properties
@@ -0,0 +1,16 @@
# Copyright 2019 The Netty Project
#
# The Netty Project licenses this file to you under the Apache License,
# version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at:
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

Args = --initialize-at-build-time=io.grpc.netty.shaded.io.netty \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't want this hard-coded in gRPC. If you really wanted to avoid making the transformer/relocator, then you could extract the file from the Netty jar dependency. But hard-coding it here is a dead-end.

--initialize-at-run-time=io.grpc.netty.shaded.io.netty.handler.codec.http.HttpObjectEncoder,io.grpc.netty.shaded.io.netty.handler.codec.http.websocketx.WebSocket00FrameEncoder,io.grpc.netty.shaded.io.netty.handler.codec.http.websocketx.extensions.compression.DeflateDecoder