Skip to content

Commit

Permalink
No lite - fixes #234 (#250)
Browse files Browse the repository at this point in the history
* try to remove stub-lite for #234

* try to non-transitive grpc-stub

* make grpc-stub transitive

* upgrade info

* tests need grpc-protobuf

* always publish to maven local

* fix links

* to kts

* doc cleanupp

* plain console

* add retry to arm tests

* Update CHANGELOG.md

Co-authored-by: Brent Shaffer <[email protected]>

Co-authored-by: Brent Shaffer <[email protected]>
  • Loading branch information
jamesward and bshaffer committed Apr 29, 2021
1 parent c38faf9 commit da32440
Show file tree
Hide file tree
Showing 25 changed files with 504 additions and 606 deletions.
1 change: 0 additions & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ jobs:
max_attempts: 3
command: ./gradlew build
- name: Publish to Maven Local
if: contains(github.event.pull_request.labels.*.name, 'prerelease')
uses: eskatos/gradle-command-action@v1
with:
arguments: publishToMavenLocal
Expand Down
24 changes: 22 additions & 2 deletions .github/workflows/gradle_arm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/[email protected]
- uses: uraimo/[email protected]
- name: test_on_arm
continue-on-error: true
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu18.04
Expand All @@ -24,4 +26,22 @@ jobs:
# Build library using gradle
run: |
./gradlew build
./gradlew --console=plain build
- name: test_on_arm_retry
if: steps.test_on_arm.outcome=='failure'
uses: uraimo/[email protected]
with:
arch: aarch64
distro: ubuntu18.04

# Not required, but speeds up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}

install: |
apt-get update -q -y
apt-get install openjdk-8-jdk -q -y
# Build library using gradle
run: |
./gradlew --console=plain build
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
## Change Log

### 1.1.0

- The `grpc-kotlin-stub` library no longer depends on `grpc-protobuf` or `protobuf-java-util`, so your project will need
to include protobuf dependencies itself. For examples, see:
[examples/stub/build.gradle.kts](examples/stub/build.gradle.kts),
[examples/stub-lite/build.gradle.kts](examples/stub-lite/build.gradle.kts), or
[examples/stub-android/build.gradle.kts](examples/stub-android/build.gradle.kts)
- The `grpc-kotlin-stub-lite` library no longer exists, instead use `grpc-kotlin-stub`.
- `grpc-kotlin-stub` now exports the `javax.annotation:javax.annotation-api` dependency, so you can drop it from your
project's explicitly listed dependencies.
7 changes: 0 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

[![grpc-kotlin-stub][label:stub]][maven:stub]
[![protoc-gen-grpc-kotlin][label:plugin]][maven:plugin]
[![grpc-kotlin-stub-lite][label:stub-lite]][maven:stub-lite]

A Kotlin/JVM implementation of [gRPC](https://grpc.io): A high performance, open
source, general RPC framework that puts mobile and HTTP/2 first.
Expand All @@ -23,10 +22,6 @@ This repo includes the sources for the following:
- [grpc-kotlin-stub](stub): A Kotlin implementation of gRPC, providing runtime
support for client-stubs and server-side code.

- [grpc-kotlin-stub-lite](stub-lite): An implementation of `grpc-kotlin-stub`,
but with a dependency on `grpc-protobuf-lite` instead of `grpc-protobuf` for
Android projects.

For more information, see the following [Kotlin/JVM pages from grpc.io][]:

- [Quick start][]
Expand All @@ -48,10 +43,8 @@ Note that [official releases][] are [published to Maven Central][].
[Kotlin/JVM pages from grpc.io]: https://grpc.io/docs/languages/kotlin/
[label:plugin]: https://img.shields.io/maven-central/v/io.grpc/protoc-gen-grpc-kotlin.svg?label=protoc-gen-grpc-kotlin
[label:stub]: https://img.shields.io/maven-central/v/io.grpc/grpc-kotlin-stub.svg?label=grpc-kotlin-stub
[label:stub-lite]: https://img.shields.io/maven-central/v/io.grpc/grpc-kotlin-stub-lite.svg?label=grpc-kotlin-stub-lite
[maven:plugin]: https://search.maven.org/search?q=g:%22io.grpc%22%20AND%20a:%22protoc-gen-grpc-kotlin%22
[maven:stub]: https://search.maven.org/search?q=g:%22io.grpc%22%20AND%20a:%22grpc-kotlin-stub%22
[maven:stub-lite]: https://search.maven.org/search?q=g:%22io.grpc%22%20AND%20a:%22grpc-kotlin-stub-lite%22
[official releases]: https://github.com/grpc/grpc-kotlin/releases
[protoc]: https://github.com/protocolbuffers/protobuf#protocol-compiler-installation
[protocolbuffers/protobuf#3742]: https://github.com/protocolbuffers/protobuf/issues/3742
Expand Down
161 changes: 0 additions & 161 deletions build.gradle

This file was deleted.

139 changes: 139 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.utils.addToStdlib.safeAs

plugins {
kotlin("jvm") version "1.3.72" apply false
id("com.google.protobuf") version "0.8.15" apply false
}

ext["grpcVersion"] = "1.36.0" // CURRENT_GRPC_VERSION
ext["protobufVersion"] = "3.14.0"
ext["kotlinVersion"] = "1.3.61"
ext["coroutinesVersion"] = "1.3.3"
ext["googleauthVersion"] = "0.20.0"

subprojects {

apply {
plugin("java")
plugin("org.jetbrains.kotlin.jvm")
plugin("com.google.protobuf")
plugin("maven-publish")
plugin("signing")
}

group = "io.grpc"
version = "1.1.0-SNAPSHOT"

repositories {
mavenCentral()
}

tasks.withType<JavaCompile> {
sourceCompatibility = JavaVersion.VERSION_1_7.toString()
targetCompatibility = JavaVersion.VERSION_1_7.toString()
}

tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf("-Xjsr305=strict")
jvmTarget = JavaVersion.VERSION_1_6.toString()
}
}

tasks.withType<Test> {
testLogging {
showStandardStreams = true

// set options for log level LIFECYCLE
events = setOf(
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
)

exceptionFormat = TestExceptionFormat.FULL
showExceptions = true
showCauses = true
showStackTraces = true

// set options for log level DEBUG and INFO
debug {
events = setOf(
TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
)

exceptionFormat = TestExceptionFormat.FULL
}

info.events = debug.events
info.exceptionFormat = debug.exceptionFormat
}

afterSuite(
KotlinClosure2({ desc: TestDescriptor, result: TestResult ->
if (desc.parent == null) { // will match the outermost suite
println("Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} successes, ${result.failedTestCount} failures, ${result.skippedTestCount} skipped)")
}
})
)
}

extensions.getByType<PublishingExtension>().publications {
create<MavenPublication>("maven") {
pom {
url.set("https://github.com/grpc/grpc-kotlin")

scm {
connection.set("scm:git:https://github.com/grpc/grpc-kotlin.git")
developerConnection.set("scm:git:[email protected]:grpc/grpc-kotlin.git")
url.set("https://github.com/grpc/grpc-kotlin")
}

licenses {
license {
name.set("Apache 2.0")
url.set("https://opensource.org/licenses/Apache-2.0")
}
}

developers {
developer {
id.set("grpc.io")
name.set("gRPC Contributors")
email.set("[email protected]")
url.set("https://grpc.io/")
organization.set("gRPC Authors")
organizationUrl.set("https://www.google.com")
}
}
}
}
repositories {
maven {
val snapshotUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
val releaseUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
url = if (version.safeAs<String>()?.endsWith("SNAPSHOT") == true) snapshotUrl else releaseUrl
credentials {
username = project.findProperty("sonatypeUsername")?.safeAs() ?: ""
password = project.findProperty("sonatypePassword")?.safeAs() ?: ""
}
}
}
}

extensions.getByType<SigningExtension>().sign(extensions.getByType<PublishingExtension>().publications.named("maven").get())

tasks.withType<Sign> {
onlyIf { project.hasProperty("signing.keyId") }
}

}
Loading

0 comments on commit da32440

Please sign in to comment.