Skip to content

Commit

Permalink
Merge pull request #7 from asarkar/upgrade
Browse files Browse the repository at this point in the history
Dependency upgrade and other maintenance
  • Loading branch information
asarkar authored May 9, 2021
2 parents 5d10ec2 + 6b98c36 commit f40aa56
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 63 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ jobs:
- uses: actions/checkout@v2

- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8

- name: Build and test
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,15 @@ jobs:
exit 1
- name: Set up JDK
uses: actions/setup-java@v1
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: 8

- name: Publish to Bintray
run: ./gradlew -P bintrayUser=${{ secrets.BINTRAY_USER }} -P bintrayKey=${{ secrets.BINTRAY_KEY }} bintrayUpload
- name: Publish to Maven Central
run: |
./gradlew -P signingKey=${{ secrets.SIGNING_KEY }} \
-P signingPassword=${{ secrets.SIGNING_PASSWORD }} \
-P sonatypeUsername=${{ secrets.SONATYPE_USERNAME }} \
-P sonatypePassword=${{ secrets.SONATYPE_PASSWORD }} \
publishToSonatype closeAndReleaseSonatypeStagingRepository
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ Requires Java 8 or later. Verified working with the latest JUnit 5 version, whic

## Installation

You can find the latest version on Bintray. [ ![Download](https://api.bintray.com/packages/asarkar/mvn/com.asarkar.grpc%3Agrpc-test/images/download.svg) ](https://bintray.com/asarkar/mvn/com.asarkar.grpc%3Agrpc-test/_latestVersion)

It is also on Maven Central and jcenter.
You can find the latest version
on [Maven Central](https://search.maven.org/search?q=g:com.asarkar.grpc%20AND%20a:grpc-test).

## Usage

Expand Down Expand Up @@ -46,9 +45,9 @@ class ExampleTestCase {

## Contribute

This project is a volunteer effort. You are welcome to send pull requests, ask questions, or create issues.
If you like it, you can help by spreading the word!
This project is a volunteer effort. You are welcome to send pull requests, ask questions, or create issues. If you like
it, you can help by spreading the word and "Starring" the GitHub repo!

## License

Copyright 2020 Abhijit Sarkar - Released under [Apache License v2.0](LICENSE).
Copyright 2021 Abhijit Sarkar - Released under [Apache License v2.0](LICENSE).
74 changes: 36 additions & 38 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import java.util.Base64

plugins {
kotlin("jvm")
`maven-publish`
id("org.jetbrains.dokka")
id("org.jlleitschuh.gradle.ktlint")
id("com.jfrog.bintray")
id("io.github.gradle-nexus.publish-plugin")
signing
}

val projectGroup: String by project
Expand All @@ -14,25 +17,26 @@ version = projectVersion
description = projectDescription

repositories {
jcenter()
maven("https://kotlin.bintray.com/kotlinx")
mavenCentral()
}

val jUnitVersion: String by project
val gRPCVersion: String by project
val junitVersion: String by project
val grpcVersion: String by project
val mockitoVersion: String by project
val jUnitTestkitVersion: String by project
val junitTestkitVersion: String by project

dependencies {
implementation(kotlin("stdlib-jdk8"))
implementation(platform("io.grpc:grpc-bom:$gRPCVersion"))
implementation(platform("org.junit:junit-bom:$jUnitVersion"))
implementation(platform("io.grpc:grpc-bom:$grpcVersion"))
implementation(platform("org.junit:junit-bom:$junitVersion"))
implementation("org.junit.jupiter:junit-jupiter-api")
implementation("io.grpc:grpc-api")
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("io.grpc:grpc-core")
testImplementation("org.mockito:mockito-core:$mockitoVersion")
testImplementation("org.mockito:mockito-junit-jupiter:$mockitoVersion")
testImplementation("org.junit.platform:junit-platform-testkit:$jUnitTestkitVersion")
testImplementation("org.junit.platform:junit-platform-testkit:$junitTestkitVersion")
}

plugins.withType<JavaPlugin> {
Expand All @@ -49,9 +53,13 @@ tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
}
}

tasks.withType<org.jetbrains.dokka.gradle.DokkaTask> {
outputFormat = "html"
outputDirectory = "$buildDir/javadoc"
tasks.dokkaHtml.configure {
outputDirectory.set(buildDir.resolve("javadoc"))
dokkaSourceSets.configureEach {
jdkVersion.set(8)
skipEmptyPackages.set(true)
platform.set(org.jetbrains.dokka.Platform.jvm)
}
}

val sourcesJar by tasks.creating(Jar::class) {
Expand All @@ -65,7 +73,7 @@ val kdocJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Creates KDoc"
archiveClassifier.set("javadoc")
from(tasks.dokka)
from(tasks.dokkaHtml)
}

tasks.jar.configure {
Expand Down Expand Up @@ -112,32 +120,22 @@ publishing {
}
}

val bintrayRepo: String by project
bintray {
user = (findProperty("bintrayUser") ?: System.getenv("BINTRAY_USER"))?.toString()
key = (findProperty("bintrayKey") ?: System.getenv("BINTRAY_KEY"))?.toString()
setPublications(*publishing.publications.names.toTypedArray())
with(pkg) {
repo = bintrayRepo
name = "${project.group}:${project.name}"
desc = project.description
websiteUrl = "https://$gitHubUrl"
vcsUrl = "https://$gitHubUrl.git"
setLabels("grpc", "protobuf", "test", "junit5", "junit")
setLicenses(licenseName)
with(version) {
name = project.version.toString()
with(gpg) {
sign = true
}
with(mavenCentralSync) {
sync = true
user = (findProperty("sonatypeUser") ?: System.getenv("SONATYPE_USER"))?.toString()
password = (findProperty("sonatypePwd") ?: System.getenv("SONATYPE_PWD"))?.toString()
}
fun base64Decode(prop: String): String? {
return project.findProperty(prop)?.let {
String(Base64.getDecoder().decode(it.toString())).trim()
}
}

signing {
useInMemoryPgpKeys(base64Decode("signingKey"), base64Decode("signingPassword"))
sign(*publishing.publications.toTypedArray())
}

nexusPublishing {
repositories {
sonatype {
username.set(base64Decode("sonatypeUsername"))
password.set(base64Decode("sonatypePassword"))
}
}
publish = true
override = false
dryRun = false
}
21 changes: 10 additions & 11 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
kotlin.code.style=official

jUnitVersion=5.6.2
gRPCVersion=1.31.0
mockitoVersion=3.4.6
jUnitTestkitVersion=1.6.2
kotlinPluginVersion=1.3.72
dokkaPluginVersion=0.10.1
ktlintVersion=9.3.0
bintrayPluginVersion=1.8.5
junitVersion=5.7.1
grpcVersion=1.37.0
mockitoVersion=latest.release
junitTestkitVersion=latest.release
kotlinPluginVersion=1.5.0
dokkaPluginVersion=1.4.32
ktlintVersion=10.0.0
nexusPluginVersion=1.0.0

projectGroup=com.asarkar.grpc
projectVersion=1.0.3
projectVersion=1.2.0
projectDescription=JUnit5 Extension that can automatically release gRPC resources at the end of the test
licenseName=Apache-2.0
licenseUrl=http://www.apache.org/licenses/LICENSE-2.0.txt
developerName=Abhijit Sarkar
developerEmail[email protected]
gitHubUsername=asarkar
bintrayRepo=mvn
gitHubUsername=asarkar
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
5 changes: 2 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@ pluginManagement {
val kotlinPluginVersion: String by settings
val dokkaPluginVersion: String by settings
val ktlintVersion: String by settings
val bintrayPluginVersion: String by settings
val nexusPluginVersion: String by settings
plugins {
kotlin("jvm") version kotlinPluginVersion
`maven-publish`
id("org.jetbrains.dokka") version dokkaPluginVersion
id("org.jlleitschuh.gradle.ktlint") version ktlintVersion
id("com.jfrog.bintray") version bintrayPluginVersion
id("io.github.gradle-nexus.publish-plugin") version nexusPluginVersion
}
}

Expand Down

0 comments on commit f40aa56

Please sign in to comment.