Skip to content

Commit

Permalink
Updated publishMavenLocal script and add steps in Contribution.md (#29)
Browse files Browse the repository at this point in the history
* updated publishMaven script and steps in contribution.md

* update publishMavenLocal

* added print publishversion

Co-authored-by: Anubhav Gupta <[email protected]>
  • Loading branch information
Anubhav Gupta and Anubhav Gupta authored Jul 4, 2022
1 parent 2f35fb3 commit 4ea455b
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
18 changes: 11 additions & 7 deletions CONTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@
It is licensed using the [MIT License][2].
We appreciate pull requests; here are our guidelines:

1. [File an issue][3]
1. [File an issue][3]
(if there isn't one already). If your patch
is going to be large it might be a good idea to get the
discussion started early. We are happy to discuss it in a
new issue beforehand, and you can always email
<[email protected]> about future work.

2. DO follow our coding style (as described below).
2. Please also make sure your code compiles by running `./gradlew assembleDebug`

3. DO run spotlessApply task (`./gradlew spotlessApply`) before submitting a pull request
3. If you want to test locally you can publish artifacts locally using `./scripts/publishMavenLocal.sh`

4. DO include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.
4. DO follow our coding style (as described below).

5. We use the [binary-compatibility-validator plugin][] for tracking the binary compatibility of the APIs we ship. If your change implies changes to any public API, run `./gradlew apiDump` to generate the updated API dumps and commit those changes.
5. DO run spotlessApply task (`./gradlew spotlessApply`) before submitting a pull request

5. We ask that you squash all the commits together before
6. DO include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.

7. We use the [binary-compatibility-validator plugin][9] for tracking the binary compatibility of the APIs we ship. If your change implies changes to any public API, run `./gradlew apiDump` to generate the updated API dumps and commit those changes.

8. We ask that you squash all the commits together before
pushing and that your commit message references the bug.

6. DON'T surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time.
9. DON'T surprise us with big pull requests. Instead, file an issue and start a discussion so we can agree on a direction before you invest a large amount of time.

## Coding Style

Expand Down
15 changes: 9 additions & 6 deletions gradle/publish-module.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,13 @@ afterEvaluate {
}

signing {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"],
rootProject.ext["signing.key"],
rootProject.ext["signing.password"],
)
sign publishing.publications
def isLocal = project.hasProperty("IS_LOCAL") && (project.findProperty("IS_LOCAL") == "true")
if (!isLocal) {
useInMemoryPgpKeys(
rootProject.ext["signing.keyId"],
rootProject.ext["signing.key"],
rootProject.ext["signing.password"],
)
sign publishing.publications
}
}
1 change: 1 addition & 0 deletions gradle/script-ext.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
ext {
gitVersionCode = grgit.tag.list().size()
gitVersionName = grgit.describe(tags: true, always: true)
println("version : $gitVersionName")
}
16 changes: 7 additions & 9 deletions scripts/publishMavenLocal.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/bin/sh

echo "Publishing Libraries to Maven Local..."
echo "is ci value is : $PIS_CI"
echo "present directory : $pwd"
./gradlew :paho:assemble -PIS_CI=:$1 :courier-core:assemble -PIS_CI=:$1 :courier-core-android:assemble -PIS_CI=:$1 --parallel --daemon && ./gradlew :paho:publishToMavenLocal -PIS_CI=:$1 :courier-core:publishToMavenLocal -PIS_CI=:$1 :courier-core-android:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :mqtt-pingsender:assemble -PIS_CI=:$1 && ./gradlew :mqtt-pingsender:publishToMavenLocal -PIS_CI=:$1
./gradlew :workmanager-pingsender:assemble -PIS_CI=:$1 :workmanager-2.6.0-pingsender:assemble -PIS_CI=:$1 :alarm-pingsender:assemble -PIS_CI=:$1 :timer-pingsender:assemble -PIS_CI=:$1 --parallel --daemon && ./gradlew :workmanager-pingsender:publishToMavenLocal -PIS_CI=:$1 :workmanager-2.6.0-pingsender:publishToMavenLocal -PIS_CI=:$1 :alarm-pingsender:publishToMavenLocal -PIS_CI=:$1 :timer-pingsender:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :network-tracker:assembleRelease -PIS_CI=:$1 :adaptive-keep-alive:assemble -PIS_CI=:$1 :courier-message-adapter-gson:assemble -PIS_CI=:$1 :courier-message-adapter-protobuf:assemble -PIS_CI=:$1 :courier-message-adapter-moshi:assemble -PIS_CI=:$1 :courier-stream-adapter-rxjava:assemble -PIS_CI=:$1 :courier-stream-adapter-rxjava2:assemble -PIS_CI=:$1 :courier-stream-adapter-coroutines:assemble -PIS_CI=:$1 :courier:assembleRelease -PIS_CI=:$1 :app-state-manager:assembleRelease -PIS_CI=:$1 --parallel --daemon && ./gradlew :network-tracker:publishToMavenLocal -PIS_CI=:$1 :adaptive-keep-alive:publishToMavenLocal -PIS_CI=:$1 :courier-message-adapter-gson:publishToMavenLocal -PIS_CI=:$1 :courier-message-adapter-moshi:publishToMavenLocal -PIS_CI=:$1 :courier-message-adapter-protobuf:publishToMavenLocal -PIS_CI=:$1 :courier-stream-adapter-rxjava:publishToMavenLocal -PIS_CI=:$1 :courier-stream-adapter-rxjava2:publishToMavenLocal -PIS_CI=:$1 :courier-stream-adapter-coroutines:publishToMavenLocal -PIS_CI=:$1 :courier:publishToMavenLocal -PIS_CI=:$1 :app-state-manager:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :mqtt-client:assembleRelease -PIS_CI=:$1 --parallel --daemon && ./gradlew :mqtt-client:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :courier:assembleRelease -PIS_CI=:$1 :courier-auth-http:assembleRelease -PIS_CI=:$1 --parallel --daemon && ./gradlew :courier:publishToMavenLocal -PIS_CI=:$1 :courier-auth-http:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :chuck-mqtt:assembleRelease -PIS_CI=:$1 :chuck-mqtt-no-ops:assembleRelease --parallel --daemon && ./gradlew :chuck-mqtt:publishToMavenLocal -PIS_CI=:$1 :chuck-mqtt-no-ops:publishToMavenLocal -PIS_CI=:$1 --parallel --daemon
./gradlew :paho:assemble :courier-core:assemble :courier-core-android:assemble --parallel --daemon && ./gradlew :paho:publishToMavenLocal -PIS_LOCAL=true :courier-core:publishToMavenLocal -PIS_LOCAL=true :courier-core-android:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon
./gradlew :mqtt-pingsender:assemble && ./gradlew :mqtt-pingsender:publishToMavenLocal -PIS_LOCAL=true
./gradlew :workmanager-pingsender:assemble :workmanager-2.6.0-pingsender:assemble :alarm-pingsender:assemble :timer-pingsender:assemble --parallel --daemon && ./gradlew :workmanager-pingsender:publishToMavenLocal -PIS_LOCAL=true :workmanager-2.6.0-pingsender:publishToMavenLocal -PIS_LOCAL=true :alarm-pingsender:publishToMavenLocal -PIS_LOCAL=true :timer-pingsender:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon
./gradlew :network-tracker:assemble :adaptive-keep-alive:assemble :courier-message-adapter-gson:assemble :courier-message-adapter-protobuf:assemble :courier-message-adapter-moshi:assemble :courier-stream-adapter-rxjava:assemble :courier-stream-adapter-rxjava2:assemble :courier-stream-adapter-coroutines:assemble :courier:assemble :app-state-manager:assemble --parallel --daemon && ./gradlew :network-tracker:publishToMavenLocal -PIS_LOCAL=true :adaptive-keep-alive:publishToMavenLocal -PIS_LOCAL=true :courier-message-adapter-gson:publishToMavenLocal -PIS_LOCAL=true :courier-message-adapter-moshi:publishToMavenLocal -PIS_LOCAL=true :courier-message-adapter-protobuf:publishToMavenLocal -PIS_LOCAL=true :courier-stream-adapter-rxjava:publishToMavenLocal -PIS_LOCAL=true :courier-stream-adapter-rxjava2:publishToMavenLocal -PIS_LOCAL=true :courier-stream-adapter-coroutines:publishToMavenLocal -PIS_LOCAL=true :courier:publishToMavenLocal -PIS_LOCAL=true :app-state-manager:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon
./gradlew :mqtt-client:assemble --parallel --daemon && ./gradlew :mqtt-client:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon
./gradlew :courier:assemble :courier-auth-http:assemble --parallel --daemon && ./gradlew :courier:publishToMavenLocal -PIS_LOCAL=true :courier-auth-http:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon
./gradlew :chuck-mqtt:assemble :chuck-mqtt-no-ops:assembleRelease --parallel --daemon && ./gradlew :chuck-mqtt:publishToMavenLocal -PIS_LOCAL=true :chuck-mqtt-no-ops:publishToMavenLocal -PIS_LOCAL=true --parallel --daemon

status=$?
if [ "$status" = 0 ] ; then
Expand Down

0 comments on commit 4ea455b

Please sign in to comment.