-
Notifications
You must be signed in to change notification settings - Fork 37
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
Publish to mavencentral #144
Changes from all commits
1e8e48f
d5a262e
cd2077a
da4a307
3f3f997
dd9c26b
3380a8b
0c58dc8
f456cd1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,6 +280,8 @@ section below under "Usage" for more details. | |
|
||
### Generating Code | ||
|
||
> TODO change to Sonatype link after migrating | ||
|
||
Pbandk's code generator leverages `protoc`. Download the [latest | ||
protoc](https://github.com/google/protobuf/releases/latest) and make sure `protoc` is on the `PATH`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See placeholder above so we don't forget to update this link |
||
Then download the [latest protoc-gen-kotlin self-executing jar | ||
|
@@ -327,11 +329,14 @@ protoc \ | |
### Runtime Library | ||
|
||
Pbandk's runtime library provides a Kotlin layer over the preferred Protobuf library for each platform. The libraries are | ||
present on JCenter. Using Gradle: | ||
present on Maven Central. Using Gradle: | ||
|
||
``` | ||
repositories { | ||
jcenter() | ||
// This repository is only needed if using a SNAPSHOT version of pbandk | ||
maven { url "https://s01.oss.sonatype.org/content/repositories/snapshots/" } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @JeroenMols FYI, if you ever need to test the latest code on |
||
|
||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
|
@@ -590,7 +595,7 @@ To create a new release: | |
1. Commit the change. E.g.: `git commit -m "Bump to ${VERSION}" -a`. | ||
1. Tag the new version. E.g.: `git tag -a -m "See https://github.com/streem/pbandk/blob/v${VERSION}/CHANGELOG.md" "v${VERSION}"`. | ||
1. Push the changes to GitHub: `git push origin --follow-tags master`. | ||
1. Wait for CI to notice the new tag, build it, and upload it to Bintray. | ||
1. Wait for CI to notice the new tag, build it, and upload it to Maven Central. | ||
1. Create a new release on GitHub. Use the contents of the tag description as the release description. E.g.: `gh release create "v${VERSION}" -F <(git tag -l --format='%(contents)' "v${VERSION}")`. | ||
|
||
Then prepare the repository for development of the next version: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ plugins { | |
} | ||
|
||
repositories { | ||
jcenter() | ||
mavenCentral() | ||
} | ||
|
||
dependencies { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import org.gradle.api.publish.maven.MavenPublication | ||
|
||
fun MavenPublication.configurePbandkPom(pomDescription: String) { | ||
val pomName = artifactId | ||
pom { | ||
name.set(pomName) | ||
description.set(pomDescription) | ||
url.set("https://github.com/streem/pbandk") | ||
|
||
licenses { | ||
license { | ||
name.set("MIT License") | ||
url.set("https://opensource.org/licenses/MIT") | ||
} | ||
} | ||
|
||
organization { | ||
name.set("Streem, LLC") | ||
url.set("https://github.com/streem") | ||
} | ||
|
||
developers { | ||
developer { | ||
id.set("streem") | ||
name.set("Streem, LLC") | ||
url.set("https://github.com/streem") | ||
} | ||
} | ||
|
||
scm { | ||
connection.set("scm:git:[email protected]:streem/pbandk.git") | ||
developerConnection.set("scm:git:[email protected]:streem/pbandk.git") | ||
url.set("[email protected]:streem/pbandk.git") | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import com.google.common.base.CaseFormat | ||
import org.gradle.api.provider.Provider | ||
import org.gradle.api.provider.ProviderFactory | ||
|
||
/** | ||
* Creates a [Provider] whose value is fetched from the Gradle property named [propertyName], or if there is no such | ||
* Gradle property, then from the environment variable whose name is the ALL_CAPS version of [propertyName]. For | ||
* example, given a [propertyName] of "fooBar", this function will look for an environment variable named "FOO_BAR". | ||
*/ | ||
@Suppress("UnstableApiUsage") | ||
fun ProviderFactory.gradlePropertyOrEnvironmentVariable(propertyName: String): Provider<String> { | ||
val envVariableName = CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_UNDERSCORE, propertyName) | ||
return gradleProperty(propertyName) | ||
.forUseAtConfigurationTime() | ||
.orElse(environmentVariable(envVariableName).forUseAtConfigurationTime()) | ||
} |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,9 @@ kotlin.code.style=official | |
kotlin.mpp.stability.nowarn=true | ||
org.gradle.caching=true | ||
|
||
# Workaround because Bintray doesn't support *.sha256 and *.sha512 checksum | ||
# Workaround because Maven Central doesn't support *.sha256 and *.sha512 checksum | ||
# files yet. See https://github.com/gradle/gradle/issues/11412 for details. | ||
# Open sonatype issue: https://issues.sonatype.org/browse/NEXUS-23603 | ||
systemProp.org.gradle.internal.publish.checksums.insecure=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked and this issue still seems to exist |
||
|
||
# Gradle 6.3+ seem to require a larger metaspace size when run against this | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I realized that we can get snapshot builds more or less for free by just running the "release" workflow for all pushes to the
master
branch. The nexus-publish gradle plugin automatically chooses whether to publish to the OSSRH snapshot or release repository based on whether the version name includes "-SNAPSHOT".